/* Playfield — shared chrome for individual games */
:root {
  --bg: #0e0f1a;
  --bg-soft: #171a2b;
  --card: #1e2136;
  --card-hi: #262a44;
  --line: #313657;
  --text: #eef0ff;
  --muted: #9aa0c3;
  --accent: #6c5ce7;
  --accent-2: #00d2d3;
  --accent-3: #ff6b9d;
  --good: #2ecc71;
  --warn: #ffb020;
  --danger: #ff5c5c;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
body {
  min-height: 100vh;
  background:
    radial-gradient(1000px 500px at 10% -10%, rgba(108,92,231,0.25), transparent 60%),
    radial-gradient(800px 450px at 110% 0%, rgba(0,210,211,0.16), transparent 55%),
    var(--bg);
}
.g-wrap { max-width: 720px; margin: 0 auto; padding: 18px 16px 60px; }

.g-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.g-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
}
.g-back:hover { color: var(--text); }
.g-title { font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.g-best {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-2);
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 7px 12px;
  white-space: nowrap;
}

.g-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 22px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.g-hud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-bottom: 16px;
  font-size: 14px;
}
.g-hud b { color: var(--accent-2); font-size: 18px; display: block; }
.g-hud .stat span { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; }

.g-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b7bff);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
}
.g-btn:hover { filter: brightness(1.08); }
.g-btn:active { transform: translateY(1px); }
.g-btn.ghost { background: var(--card-hi); border: 1px solid var(--line); color: var(--text); }
.g-btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.g-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  background: var(--good);
  color: #04240f;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
  z-index: 50;
}
.g-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.g-center { text-align: center; }
.g-visits { text-align: center; color: var(--muted); font-size: 12px; margin: 18px 0 0; font-variant-numeric: tabular-nums; }
.g-big { font-size: 44px; font-weight: 800; margin: 6px 0; }
.g-muted { color: var(--muted); }

/* ---- small phones -------------------------------------------------------
   At 360px the header ran out of room and both the back button and the game
   title broke onto a second line, which is what made the top of the page look
   cramped and misaligned. */
@media (max-width: 430px) {
  .g-wrap { padding-left: 12px; padding-right: 12px; }
  .g-top { gap: 8px; margin-bottom: 14px; }
  .g-back {
    padding: 7px 11px;
    font-size: 13px;
    gap: 5px;
    white-space: nowrap;
  }
  .g-title { font-size: 15px; gap: 6px; min-width: 0; }
  .g-best { white-space: nowrap; }
}
