/* style.css — shared styling for the lobby (index) and game pages. */

:root {
  /* dark tokens tuned to the engine's backdrop (#12141c family) so the game
     page chrome blends with the embedded engine */
  --bg: #12141c;
  --panel: #1c2030;
  --panel-2: #252b40;
  --text: #e8ecf8;
  --muted: #9aa3c0;
  --accent: #3d7dca;
  --accent-2: #2c5c98;
  --good: #46a758;
  --warn: #f8d048;
  --danger: #d84028;
  --border: #343c58;
  --radius: 12px;

  /* Emerald tokens (mirror of the engine's :root) — shared by the lobby's
     .home kit and the game page's status chrome */
  --em-cream: #f8f0d8;
  --em-cream2: #e8d8b0;
  --em-cream3: #fff8e0;
  --em-border: #585048;
  --em-ink: #303030;
  --em-dim: #605848;
  --em-red: #d84028;
  --em-blue: #5890d8;
  --gold-border: #8a6d00;
  --blue-border: #1c3c68;
  --red-border: #701c10;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(160deg, #0f172a, #131f38);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  padding: 24px 20px 8px;
  text-align: center;
}
.topbar h1 { margin: 0; font-size: 2rem; letter-spacing: -0.5px; }
.topbar .tag {
  color: var(--accent);
  font-weight: 800;
}
.topbar .sub { color: var(--muted); margin: 6px 0 0; }

.wrap {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 640px) {
  .cards { grid-template-columns: 1fr; }
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card h2 { margin: 0; font-size: 1.15rem; }

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--muted);
}

input[type="text"],
input[type="password"] {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 1rem;
}
input:focus { outline: 2px solid var(--accent); border-color: transparent; }

.code-input {
  text-transform: uppercase;
  letter-spacing: 4px;
  font-weight: 700;
  font-family: ui-monospace, monospace;
}

button {
  cursor: pointer;
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  background: var(--panel-2);
  color: var(--text);
  transition: filter 0.15s ease;
}
button:hover { filter: brightness(1.15); }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.primary { background: var(--accent); color: #fff; }
button.primary:hover { background: var(--accent-2); }
button.ghost { background: transparent; border: 1px solid var(--border); }
button.small { padding: 6px 10px; font-size: 0.8rem; }

.result {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.result .big-code {
  font-family: ui-monospace, monospace;
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: 6px;
  color: var(--accent);
  text-align: center;
}
.result .linkrow {
  display: flex;
  gap: 6px;
  align-items: center;
}
.result input {
  flex: 1;
  font-size: 0.75rem;
  padding: 6px 8px;
}

.err {
  color: var(--danger);
  font-size: 0.85rem;
}

.muted { color: var(--muted); }
.small { font-size: 0.82rem; }
.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.row-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.row-head h2 { margin: 0; font-size: 1.15rem; }

.games {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.game-row {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.05s ease;
}
.game-row:hover { border-color: var(--accent); }
.game-row:active { transform: scale(0.995); }
.game-row .info { flex: 1; min-width: 0; }
.game-row .title { font-weight: 700; }
.game-row .meta { color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.game-row .dismiss-btn {
  flex: none;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  line-height: 1;
  cursor: pointer;
  font-size: 0.85rem;
}
.game-row .dismiss-btn:hover { border-color: var(--bad, #c0392b); color: var(--bad, #c0392b); }

/* Async-state badges: GBA-style embossed chips from the engine's Emerald kit,
   self-colored so they read on both the navy backdrop and cream panels. */
.badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  border: 2px solid var(--em-border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 0 rgba(0, 0, 0, 0.3);
}
.badge.turn { background: linear-gradient(#7ed88a, #46a758 55%, #2e7a3e); border-color: #1c4a26; }
.badge.wait,
.badge.over {
  background: linear-gradient(var(--em-cream3), var(--em-cream2));
  border-color: var(--em-border);
  color: var(--em-dim);
  text-shadow: none;
}
.badge.waiting { background: linear-gradient(#78b8e8, #3d7dca 55%, #2c5c98); border-color: var(--blue-border); }
.badge.won {
  background: linear-gradient(#ffe488, #ffcb05 55%, #cc9a00);
  border-color: var(--gold-border);
  color: #3a3000;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}
.badge.lost,
.badge.offline { background: linear-gradient(#f08868, var(--em-red) 55%, #a02818); border-color: var(--red-border); }
.badge.offline { animation: offlinepulse 1.6s ease-in-out infinite; }
@keyframes offlinepulse { 50% { filter: brightness(1.25); } }

/* Reinforce each async state with a leading glyph so it never reads by colour
   alone (accessibility). text-transform doesn't affect the symbols. */
.badge.turn::before    { content: "\25B6  "; }  /* ▶ your turn */
.badge.wait::before    { content: "\231B  "; }  /* ⌛ their turn */
.badge.waiting::before { content: "\231B  "; }  /* ⌛ waiting to fill / setup */
.badge.over::before    { content: "\2691  "; }  /* ⚑ finished */
.badge.won::before     { content: "\1F3C6  "; } /* 🏆 you won */
.badge.lost::before    { content: "\2691  "; }  /* ⚑ finished (lost) */
.badge.offline::before { content: "\26A0  "; }  /* ⚠ connection lost */

.notif { }

.foot {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 20px;
}

/* --- game page --- */
.game-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 16px 60px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.backlink {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.backlink:hover { color: var(--text); }

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.state-box {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
}

.counter {
  font-size: 3rem;
  font-weight: 800;
  text-align: center;
  color: var(--accent);
}

.notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.notes-list li {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 0.85rem;
}

.spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--muted);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===========================================================================
   PokéTopia main menu (index.html only — scoped to body.home so the game page
   is untouched). Styled with the ENGINE's Gen 3 / Emerald design kit: dark
   navy backdrop, cream panels with chunky brown borders, gold/red/blue
   GBA-style buttons — so the lobby and the game read as one product.
   =========================================================================== */

body.home {
  /* Emerald tokens live at :root (top of this file) — shared with game.html */
  color: var(--em-ink);
  /* the engine's dark navy backdrop with a faint dot grid */
  background:
    radial-gradient(circle at 12px 12px, rgba(88, 144, 216, 0.07) 2px, transparent 2px) 0 0 / 26px 26px,
    linear-gradient(180deg, #12141c, #171a26);
  background-attachment: fixed;
  min-height: 100vh;
}

.home-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  padding-top: calc(20px + env(safe-area-inset-top, 0px));
}

/* ---- logo header ---- */
.home-header { text-align: center; margin-bottom: 18px; }
.logo-img {
  width: min(420px, 88vw);
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.55));
}

.home .view { display: flex; flex-direction: column; gap: 16px; }

/* ---- Emerald panel + button kit (lobby copies of the engine's .em-*) ---- */
.panel {
  background: linear-gradient(var(--em-cream), var(--em-cream2));
  color: var(--em-ink);
  border: 3px solid var(--em-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.55), inset 0 -2px 0 rgba(0, 0, 0, 0.12), 0 3px 0 rgba(0, 0, 0, 0.35);
  display: flex; flex-direction: column; gap: 12px;
}
.panel-head { display: flex; align-items: center; gap: 10px; }
.panel-head h2 { margin: 0; font-size: 1.1rem; flex: 1; color: var(--em-ink); text-transform: uppercase; letter-spacing: 0.04em; }
.panel > h2 { margin: 0; font-size: 1.05rem; color: var(--em-ink); text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- big menu action buttons (engine .em-btn look) ---- */
.menu-actions { display: flex; flex-direction: column; gap: 12px; }
.menu-btn {
  display: flex; align-items: center; gap: 14px; text-align: left;
  width: 100%; padding: 14px 16px; border-radius: 12px; color: #fff;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 3px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.06s ease, filter 0.15s ease;
}
.menu-btn:hover { filter: brightness(1.1); }
.menu-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 1px 0 rgba(0, 0, 0, 0.4); }
.menu-btn.red { background: linear-gradient(#f08868, var(--em-red) 55%, #a02818); border: 3px solid var(--red-border); }
.menu-btn.blue { background: linear-gradient(#78b8e8, #3d7dca 55%, #2c5c98); border: 3px solid var(--blue-border); }
.menu-btn.green { background: linear-gradient(#7ed88a, #46a758 55%, #2e7a3e); border: 3px solid #1c4a26; }

/* Resume — the single most-urgent action, so it leads the page. */
.resume-btn { margin-bottom: 4px; }
.resume-btn .mb-icon { background: rgba(255, 255, 255, 0.28); }
.menu-btn .mb-icon {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center; font-size: 1.4rem; font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
}
.menu-btn .mb-text { display: flex; flex-direction: column; line-height: 1.2; }
.menu-btn .mb-text b { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.05em; }
.menu-btn .mb-text small { font-size: 0.78rem; opacity: 0.92; font-weight: 600; }

/* chips: engine "ghost" buttons (cream) */
.back-chip, .chip {
  background: linear-gradient(var(--em-cream3), var(--em-cream2));
  color: var(--em-ink); border: 2px solid var(--em-border);
  border-radius: 9px; padding: 8px 14px; font-size: 0.82rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.04em;
  min-height: 40px; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 rgba(0, 0, 0, 0.3);
}
.chip { min-height: 44px; }
.chip.wide { width: 100%; }
.back-chip:hover, .chip:hover { filter: brightness(1.05); }
.back-chip:active, .chip:active { transform: translateY(1px); }

.home .muted2 { color: var(--em-dim); margin: 0; font-size: 0.86rem; }
.home .small { font-size: 0.8rem; }

/* ---- games list ---- */
.games-panel .games { gap: 10px; }

/* your-turn count in the panel header */
.count-badge {
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px; margin-left: 6px;
  border-radius: 999px; font-size: 0.75rem; font-weight: 800;
  background: #46a758; color: #fff; text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.3);
  vertical-align: 2px;
}

/* server-unreachable banner (shown instead of a wall of "Unavailable" cards) */
.net-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: rgba(216, 64, 40, 0.1); border: 2px solid var(--em-red);
  border-radius: 9px; padding: 10px 12px;
  color: var(--em-red); font-size: 0.86rem; font-weight: 700;
}
.home .game-row {
  background: var(--em-cream3);
  border: 2px solid var(--em-border);
  border-radius: 10px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 rgba(0, 0, 0, 0.25);
}
.home .game-row:hover { border-color: #b08820; background: #fffdf0; }
.home .game-row .title { color: var(--em-ink); }
.home .game-row .meta { color: var(--em-dim); }
/* finished games recede so live games stand out */
.home .game-row.finished { opacity: 0.72; }
.home .game-row.finished:hover { opacity: 1; }
/* finger-sized dismiss target (the visual ✕ stays small, the hit area doesn't) */
.home .game-row .dismiss-btn { width: 44px; height: 44px; font-size: 1rem; }
.home .empty { color: var(--em-dim); font-size: 0.9rem; text-align: center; padding: 8px 0; margin: 0; }

/* ---- forms (settings / join) ---- */
.home .field { display: flex; flex-direction: column; gap: 8px; font-size: 0.85rem; color: var(--em-dim); font-weight: 700; }
.home .field-label { font-weight: 800; color: var(--em-ink); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; }
.home input[type="text"],
.home input[type="password"],
.home input[type="number"] {
  background: var(--em-cream3); border: 2px solid var(--em-border); color: var(--em-ink);
  border-radius: 9px; padding: 11px 12px; font-size: 1rem; font-weight: 600;
  box-shadow: inset 0 2px 3px rgba(0, 0, 0, 0.08);
}
.home input:focus { outline: 2px solid #b08820; }
.home .code-input { text-transform: uppercase; letter-spacing: 4px; font-weight: 800; font-family: ui-monospace, monospace; }

/* segmented control: cream buttons, GOLD selected state (like the engine's
   New Game settings) */
.seg { display: flex; gap: 6px; }
.seg button {
  flex: 1; background: linear-gradient(var(--em-cream3), var(--em-cream2));
  border: 2px solid var(--em-border); color: var(--em-ink);
  border-radius: 9px; padding: 10px 6px; font-weight: 800; font-size: 0.92rem;
  text-transform: uppercase; letter-spacing: 0.03em;
  min-height: 46px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 rgba(0, 0, 0, 0.25);
}
.seg button:hover { filter: brightness(1.05); }
.seg button.on {
  background: linear-gradient(#ffe488, #ffcb05 55%, #cc9a00);
  color: #3a3000; border-color: var(--gold-border);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}

/* quick-start preset chips: cream cards, gold selected state like .seg */
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  background: linear-gradient(var(--em-cream3), var(--em-cream2));
  border: 2px solid var(--em-border); color: var(--em-ink);
  border-radius: 9px; padding: 10px 12px; text-align: left;
  min-height: 56px; line-height: 1.25;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 0 rgba(0, 0, 0, 0.25);
}
.preset:hover { filter: brightness(1.05); }
.preset b { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.03em; }
.preset small { font-size: 0.74rem; color: var(--em-dim); font-weight: 600; }
.preset.on {
  background: linear-gradient(#ffe488, #ffcb05 55%, #cc9a00);
  color: #3a3000; border-color: var(--gold-border);
  text-shadow: 1px 1px 0 rgba(255, 255, 255, 0.35);
}
.preset.on small { color: #5a4a00; }
.preset-custom { grid-column: 1 / -1; min-height: 48px; }

/* a dependent row whose master toggle is off (storm timing with storm off) */
.seg-off { opacity: 0.45; pointer-events: none; }

/* Advanced (map seed) — a quiet collapsible so it never distracts */
.adv summary {
  cursor: pointer; font-weight: 800; color: var(--em-ink); font-size: 0.9rem;
  text-transform: uppercase; letter-spacing: 0.04em; user-select: none;
}
.adv[open] summary { margin-bottom: 10px; }
.seed-row { display: flex; gap: 8px; }
.seed-row input { flex: 1; font-family: ui-monospace, monospace; }
.seed-row .chip { flex: 0 0 auto; font-size: 1.05rem; }

/* invite-screen settings summary chips */
.sum-chips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.sum-chip {
  background: var(--em-cream3); border: 2px solid var(--em-border); border-radius: 999px;
  padding: 4px 10px; font-size: 0.74rem; font-weight: 800; color: var(--em-ink);
  text-transform: uppercase; letter-spacing: 0.03em;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

/* the create button rides in its own slim panel at the end of the groups */
.create-foot { gap: 8px; }

/* win-condition checkboxes */
.wins { display: flex; flex-direction: column; gap: 8px; }
.home .check {
  display: flex; align-items: flex-start; gap: 10px; flex-direction: row;
  background: var(--em-cream3); border: 2px solid var(--em-border); border-radius: 9px;
  padding: 12px; cursor: pointer; color: var(--em-ink); font-size: inherit;
  min-height: 44px; transition: border-color 0.12s ease;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.home .check:hover { border-color: #b08820; }
.home .check:has(input:checked) { border-color: #b08820; background: #fffdf0; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 2px #e6c14a; }
.home .check input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--em-red); }
.home .check span { display: flex; flex-direction: column; line-height: 1.25; }
.home .check span b { font-size: 0.92rem; }
.home .check span small { font-size: 0.76rem; color: var(--em-dim); font-weight: 600; }
.score-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.score-row input { max-width: 120px; }

/* big call-to-action buttons (engine .em-btn look) */
.big-btn {
  width: 100%; padding: 14px; border-radius: 10px; color: #fff;
  font-size: 1rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 3px 0 rgba(0, 0, 0, 0.4);
  transition: transform 0.06s ease, filter 0.15s ease;
}
.big-btn:hover { filter: brightness(1.1); }
.big-btn:active { transform: translateY(2px); box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.4), 0 1px 0 rgba(0, 0, 0, 0.4); }
.big-btn.red { background: linear-gradient(#f08868, var(--em-red) 55%, #a02818); border: 3px solid var(--red-border); }
.big-btn.blue { background: linear-gradient(#78b8e8, #3d7dca 55%, #2c5c98); border: 3px solid var(--blue-border); }
.big-btn:disabled { opacity: 0.55; }

/* invite screen */
.invite-panel .big-code {
  font-family: ui-monospace, monospace; font-size: 2rem; font-weight: 900;
  letter-spacing: 8px; text-align: center; color: var(--em-red);
  background: var(--em-cream3); border: 2px dashed var(--em-red); border-radius: 10px;
  padding: 14px; text-transform: uppercase;
}
.invite-panel .linkrow { display: flex; gap: 8px; align-items: center; }
.invite-panel .linkrow input { flex: 1; font-size: 0.78rem; }
.invite-panel .copyrow { display: flex; justify-content: center; margin-top: -6px; }

.home .err { color: var(--em-red); font-size: 0.85rem; font-weight: 700; }

/* ---- install panel ---- */
.dismiss-chip { min-height: 36px; padding: 6px 12px; font-size: 0.8rem; }
.ios-steps {
  margin: 0; padding: 0 0 0 4px; list-style: none;
  display: flex; flex-direction: column; gap: 8px;
  counter-reset: step;
}
.ios-steps li {
  counter-increment: step;
  display: flex; align-items: center; gap: 10px;
  background: var(--em-cream3); border: 2px solid var(--em-border); border-radius: 9px;
  padding: 10px 12px; font-size: 0.88rem; color: var(--em-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
.ios-steps li::before {
  content: counter(step);
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(#ffe488, #ffcb05 55%, #cc9a00);
  border: 2px solid var(--gold-border); color: #3a3000;
  font-weight: 800; font-size: 0.8rem;
}
.share-glyph {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border: 2px solid var(--em-blue); border-radius: 6px; color: var(--em-blue);
  font-weight: 800; font-size: 0.85rem; margin: 0 2px;
}

.home-foot {
  text-align: center; color: rgba(232, 236, 248, 0.4);
  font-size: 0.78rem; padding: 16px;
}

/* ---- motion (lobby) --------------------------------------------------------
   View switches fade/slide in (display:none -> block restarts the animation),
   game cards enter with a soft stagger. All skipped for reduced-motion. */
@media (prefers-reduced-motion: no-preference) {
  .home .view { animation: viewin 0.16s ease-out; }
  @keyframes viewin {
    from { opacity: 0; transform: translateY(8px); }
  }
  .home .game-row { animation: rowin 0.2s ease-out both; }
  .home .game-row:nth-child(2) { animation-delay: 0.04s; }
  .home .game-row:nth-child(3) { animation-delay: 0.08s; }
  .home .game-row:nth-child(n + 4) { animation-delay: 0.12s; }
  @keyframes rowin {
    from { opacity: 0; transform: translateY(4px); }
  }
  .badge { transition: background 0.2s ease, color 0.2s ease; }
}

/* --- account panel (optional cross-device sync) ---------------------------- */
/* The panel shows one of four stacked states (see index.html); each state div/
   form lays out like a panel of its own. */
.account-panel > div, .account-panel > form { display: flex; flex-direction: column; gap: 12px; }
.account-panel p { margin: 0; }
.account-panel .field small { text-transform: none; letter-spacing: 0; font-weight: 600; }
