/* Shared look for the games hub and every game's lobby. */
:root {
  --bg: #0b1324;
  --bg2: #111c33;
  --card: #16233f;
  --line: #24365c;
  --text: #eef2fb;
  --muted: #9fb0cf;
  --accent: #14b8a6;
  --accent-ink: #04211e;
  --danger: #ef4444;
  --gold: #fbbf24;
  --radius: 14px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: radial-gradient(1200px 600px at 50% -200px, #1c2f57 0%, var(--bg) 60%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}
a { color: var(--accent); }
h1, h2, h3 { margin: 0 0 .5em; line-height: 1.15; }
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px calc(24px + var(--safe-b)); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.stack > * + * { margin-top: 12px; }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}
.btn {
  appearance: none; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 10px 18px; border-radius: 12px;
  font-family: inherit; font-weight: 600; font-size: 16px; line-height: 1.1; color: var(--accent-ink); background: var(--accent);
  text-decoration: none; touch-action: manipulation; user-select: none;
  transition: transform .06s ease, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.gold { background: var(--gold); color: #3a2600; }
.btn.block { width: 100%; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; border-radius: 10px; }
label.field { display: block; }
label.field > span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input, select {
  width: 100%; min-height: 46px; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg2); color: var(--text); font-family: inherit; font-size: 16px;
}
input:focus, select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
input.code { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-weight: 700; font-size: 22px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.roomcode { font: 800 44px/1 ui-monospace, Menlo, monospace; letter-spacing: .18em; color: var(--gold); }
.plist { list-style: none; padding: 0; margin: 0; }
.plist li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.plist li:last-child { border-bottom: 0; }
.dot { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px rgba(255,255,255,.7); }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 99px; background: var(--line); color: var(--muted); }
.topbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.topbar a.back { text-decoration: none; color: var(--muted); font-size: 14px; }
.toast {
  position: fixed; left: 50%; bottom: calc(20px + var(--safe-b)); transform: translateX(-50%);
  background: #fff; color: #111; padding: 12px 16px; border-radius: 12px;
  font-size: 15px; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(0,0,0,.4);
  z-index: 1000; animation: toastIn .2s ease;
}
.toast.err { background: #fee2e2; color: #7f1d1d; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

/* Hub */
.hub-head { text-align: center; padding: 18px 0 8px; }
.hub-head .logo { font-size: 46px; }
.hub-head h1 { font-size: 30px; letter-spacing: -.02em; }
.games { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 18px; }
@media (min-width: 640px) { .games { grid-template-columns: 1fr 1fr; } .wrap.hub { max-width: 900px; } }
@media (min-width: 1000px) { .games { grid-template-columns: 1fr 1fr 1fr; } }
.game-card {
  display: flex; gap: 14px; align-items: center; text-decoration: none; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 16px;
  transition: transform .1s, border-color .15s;
}
.game-card:active { transform: scale(.98); }
.game-card:hover { border-color: var(--accent); }
.game-card .icon { width: 64px; height: 64px; flex: none; border-radius: 16px; display: grid; place-items: center; font-size: 36px; }
.game-card h2 { font-size: 19px; margin: 0 0 4px; }
.game-card p { margin: 0; color: var(--muted); font-size: 14px; }
.game-card.soon { opacity: .5; pointer-events: none; }

.lobby-icon svg { width: 84px; height: 84px; }
.hub-head .logo svg { display: inline-block; }
