/* ============================================================
   components.css — reusable pieces: game "windows" (old Windows
   popup look), the signup/login modal, the player ID card, and
   the column layouts used on info.html / community.html.
   ============================================================ */

/* ---------------- GAME GRID ---------------- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 26px;
  margin-top: 28px;
}

/* a single game card, styled like an old Windows 98 popup window */
.game-window {
  background: #ffffff;
  color: #111111;
  border: 2px solid #000000;
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed) ease;
}

.game-window:hover {
  transform: translateY(-4px) scale(1.03);
}

.game-window .titlebar {
  background: #000000;
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 11px;
  padding: 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-window .titlebar .dots {
  display: flex;
  gap: 5px;
}

.game-window .titlebar .dots span {
  width: 9px;
  height: 9px;
  border: 1px solid #ffffff;
  display: inline-block;
}

.game-window .body {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-window .game-name {
  font-family: var(--font-display);
  font-size: 12px;
}

.game-window .game-desc {
  font-size: 16px;
  color: #333333;
  flex: 1;
}

.game-window.locked {
  filter: grayscale(1);
  opacity: 0.55;
}

.game-window .play-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.game-window .lock-badge {
  font-family: var(--font-display);
  font-size: 9px;
  color: #a00000;
  border: 1px solid #a00000;
  padding: 4px 6px;
}

.game-window button.play-btn {
  border-color: #000000;
  color: #000000;
  font-size: 10px;
}
.game-window button.play-btn:hover {
  background: #000000;
  color: #ffffff;
}

/* ---------------- MODAL (signup / login) ---------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal {
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 6px 6px 0 var(--accent-dim);
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
}

.modal .titlebar {
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 11px;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal .titlebar button {
  border: none;
  background: transparent;
  color: var(--bg);
  font-family: var(--font-display);
  font-size: 12px;
  padding: 0 4px;
}
.modal .titlebar button:hover {
  background: transparent;
  transform: scale(1.2);
}

.modal .modal-body {
  padding: 20px;
}

.modal-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border: 2px solid var(--fg-dim);
}

.modal-tabs button {
  flex: 1;
  border: none;
  border-right: 2px solid var(--fg-dim);
  font-size: 11px;
}
.modal-tabs button:last-child { border-right: none; }
.modal-tabs button.active {
  background: var(--accent);
  color: var(--bg);
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 14px;
  color: var(--fg-dim);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.field .hint {
  font-size: 13px;
  color: var(--fg-dim);
  margin-top: 3px;
}

.avatar-picker {
  display: flex;
  align-items: center;
  gap: 12px;
}

.avatar-picker img {
  width: 56px;
  height: 56px;
  border: 2px solid var(--fg-dim);
  image-rendering: pixelated;
  object-fit: cover;
}

.form-msg {
  font-size: 15px;
  margin-top: 10px;
  min-height: 20px;
}
.form-msg.error { color: var(--danger); }
.form-msg.ok { color: var(--accent); }

.guest-note {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 2px dashed var(--fg-dim);
  font-size: 14px;
  color: var(--fg-dim);
  text-align: center;
}
.guest-note button {
  margin-top: 8px;
  font-size: 10px;
}

/* ---------------- PLAYER ID CARD (community.html) ---------------- */
.id-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0;
  border: 2px solid var(--accent);
  box-shadow: 5px 5px 0 var(--accent-dim);
  overflow: hidden;
}

.id-card .id-photo {
  background: var(--bg-panel);
  border-right: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.id-card .id-photo img {
  width: 100%;
  border: 2px solid var(--fg-dim);
  image-rendering: pixelated;
  object-fit: cover;
}

.id-card .id-main {
  padding: 16px 18px;
}

.id-card .id-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--fg-dim);
}

.id-card .id-username {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--accent);
  margin-bottom: 10px;
  word-break: break-word;
}

.id-card .id-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
  font-size: 16px;
}

.id-card .id-stats .label {
  font-size: 12px;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.id-card .id-bio {
  margin-top: 12px;
  font-size: 16px;
  color: var(--fg-dim);
  border-top: 2px solid var(--grid-line);
  padding-top: 10px;
}

/* ---------------- COLUMN LAYOUTS (info.html / community.html) ---------------- */
.columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 28px;
  border: 2px solid var(--fg-dim);
}

.columns .col {
  padding: 20px;
  border-right: 2px solid var(--fg-dim);
}
.columns .col:last-child { border-right: none; }

.columns.two { grid-template-columns: 1fr 1fr; }

@media (max-width: 900px) {
  .columns { grid-template-columns: 1fr; }
  .columns .col { border-right: none; border-bottom: 2px solid var(--fg-dim); }
  .id-card { grid-template-columns: 1fr; }
}

.theme-swatches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.theme-swatches button {
  font-size: 9px;
  padding: 10px 4px;
}
.theme-swatches button.active {
  background: var(--accent);
  color: var(--bg);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  font-size: 16px;
}

.info-kv {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  font-size: 16px;
  margin-top: 8px;
}
.info-kv .k {
  color: var(--fg-dim);
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 1px;
  align-self: center;
}

.credit-list {
  margin-top: 10px;
  font-size: 15px;
  color: var(--fg-dim);
}
.credit-list div {
  padding: 4px 0;
  border-bottom: 1px dashed var(--grid-line);
}

.friend-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border: 2px solid var(--fg-dim);
  margin-top: 10px;
}
.friend-cols .fc {
  padding: 12px;
  border-right: 2px solid var(--fg-dim);
  min-height: 160px;
}
.friend-cols .fc:last-child { border-right: none; }
.friend-cols h4 {
  font-family: var(--font-display);
  font-size: 10px;
  color: var(--fg-dim);
  margin-bottom: 8px;
}
.friend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  padding: 4px 0;
}
.friend-item img {
  width: 22px;
  height: 22px;
  border: 1px solid var(--fg-dim);
  image-rendering: pixelated;
}

footer.site-footer {
  text-align: center;
  padding: 30px;
  color: var(--fg-dim);
  font-size: 14px;
  position: relative;
  z-index: 2;
}
