/* Crazy Bear's Arcade. Header, a big "Now launching" spotlight, the launch-alert band,
   then shelves of upcoming and launched games. One column on phones. */
:root {
  --night: #120d24;
  --night-2: #1b1436;
  --panel: #231a45;
  --edge: rgba(255, 255, 255, 0.12);
  --text: #f1ecff;
  --muted: #b8afd6;
  --honey: #ffc83d;
  --honey-2: #ffdd7a;
  --pink: #ff4f9a;
  --cyan: #3de0ff;
  --lime: #b7f75a;
  --danger: #ff8a7a;
  --display: "Bungee", "Arial Black", Impact, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--night); scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 480px at 85% -5%, rgba(255, 79, 154, 0.22) 0%, transparent 60%),
    radial-gradient(800px 420px at 0% 10%, rgba(61, 224, 255, 0.14) 0%, transparent 60%),
    var(--night);
  color: var(--text);
  font: 17px/1.55 var(--body);
  overflow-x: hidden;
}
.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.top { border-bottom: 1px solid var(--edge); background: rgba(18, 13, 36, 0.7); backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; padding-block: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--honey); text-decoration: none; font: 400 1.45rem/1 var(--display); letter-spacing: 0.01em; }
.brand img { display: block; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4)); }
.brand em { font-style: normal; color: var(--pink); }
.top-nav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.who { display: inline-flex; gap: 12px; align-items: center; color: var(--muted); }
.who strong { color: var(--text); }
@media (max-width: 520px) { .brand { font-size: 1.1rem; } .brand img { width: 36px; height: 36px; } }

/* Buttons and links */
.primary {
  display: inline-block; padding: 11px 24px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--honey); color: #2a1600; font: 800 1rem var(--body); text-decoration: none;
  box-shadow: 0 4px 0 #b9851a;
}
.primary:hover { background: var(--honey-2); }
.primary:active { transform: translateY(2px); box-shadow: 0 2px 0 #b9851a; }
.primary.big { padding: 15px 34px; font-size: 1.15rem; }
.primary[aria-disabled="true"], .primary:disabled { opacity: 0.45; pointer-events: none; }
.ghost { background: none; border: 2px solid var(--edge); border-radius: 999px; padding: 7px 18px; color: var(--text); font: 700 0.95rem var(--body); cursor: pointer; }
.ghost:hover { border-color: var(--honey); color: var(--honey); }
.link { background: none; border: 0; padding: 0; color: var(--honey); font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.link.danger { color: var(--danger); }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

/* Spotlight: the game launching now */
.spotlight {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 32px; align-items: center;
  padding-block: 40px 48px;
}
@media (max-width: 860px) { .spotlight { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-block: 24px 36px; } }
.spot-art { position: relative; border-radius: 22px; overflow: hidden; border: 3px solid var(--honey); box-shadow: 0 0 0 6px rgba(255, 200, 61, 0.15), 0 24px 60px rgba(0, 0, 0, 0.5); transform: rotate(-1deg); }
.spot-art canvas { display: block; width: 100%; height: auto; aspect-ratio: 960 / 520; }
@media (max-width: 860px) { .spot-art { transform: none; } }
.badge {
  display: inline-flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 6px 14px; border-radius: 999px;
  background: var(--pink); color: #fff; font: 400 0.85rem/1 var(--display); letter-spacing: 0.06em; text-transform: uppercase;
}
.pulse { width: 10px; height: 10px; border-radius: 50%; background: #fff; }
.spot-title { margin: 0; font: 400 clamp(2rem, 5vw, 3.2rem)/1.05 var(--display); color: var(--text); text-wrap: balance; }
.spot-tagline { margin: 10px 0 0; font-size: 1.25rem; font-weight: 800; color: var(--lime); }
.spot-blurb { margin: 10px 0 0; color: var(--muted); max-width: 52ch; }
.spot-date { margin: 12px 0 0; font-weight: 700; color: var(--honey); }
.spotlight .actions { margin-top: 18px; }

.progress { margin: 6px 0 0; color: var(--cyan); font-size: 0.95rem; font-variant-numeric: tabular-nums; min-height: 1.5em; }
.progress:empty { min-height: 0; }
.actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.confirm { display: inline-flex; gap: 10px; align-items: center; color: var(--muted); flex-wrap: wrap; }

/* Launch alerts band */
.subscribe {
  background: linear-gradient(100deg, #ffc83d 0%, #ff9f43 55%, #ff4f9a 100%);
  color: #2a1030;
  padding-block: 30px;
  border-block: 4px solid #2a1030;
}
.subscribe-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 440px); gap: 20px 40px; align-items: center; }
@media (max-width: 860px) { .subscribe-row { grid-template-columns: minmax(0, 1fr); } }
.subscribe h2 { margin: 0; font: 400 clamp(1.5rem, 3.4vw, 2.1rem)/1.1 var(--display); }
.subscribe-copy p { margin: 8px 0 0; font-weight: 600; }
.next-up { font-weight: 800 !important; }
.subscribe-fields { display: flex; gap: 10px; flex-wrap: wrap; }
.subscribe-fields input { flex: 1 1 200px; min-width: 0; border: 3px solid #2a1030; background: #fffaf0; color: #2a1030; border-radius: 999px; padding: 12px 18px; }
.subscribe-fields input::placeholder { color: #8a7a8a; }
.subscribe .primary { background: #2a1030; color: var(--honey); box-shadow: 0 4px 0 #000; }
.subscribe .primary:hover { background: #3d1846; }
.subscribe .note { color: #3d1f40; }
.subscribe .error { color: #6b0018; font-weight: 800; }
.success { margin: 8px 0 0; font-weight: 800; }

/* Shelves of game cards */
.shelf { padding-block: 40px 8px; }
.eyebrow { margin: 0 0 18px; font: 400 1.25rem/1 var(--display); letter-spacing: 0.04em; color: var(--honey); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 22px; }
.card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--edge); border-radius: 18px; overflow: hidden; }
@media (prefers-reduced-motion: no-preference) {
  .card { transition: transform 0.15s, box-shadow 0.15s; }
  .card:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4); }
  .primary { transition: background 0.15s; }
  .pulse { animation: pulse 1.4s ease-in-out infinite; }
}
@keyframes pulse { 50% { opacity: 0.25; } }
.art { position: relative; }
.art canvas { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; }
.date-chip {
  position: absolute; left: 12px; top: 12px; padding: 4px 11px; border-radius: 999px;
  background: rgba(18, 13, 36, 0.85); color: var(--text); font: 800 0.8rem/1.4 var(--body);
}
.upcoming .date-chip { background: var(--cyan); color: #04202a; }
.card-body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.card-title { margin: 0; font: 400 1.2rem/1.2 var(--display); color: var(--text); text-wrap: balance; }
.blurb { margin: 4px 0 0; color: var(--muted); font-size: 0.97rem; }
.card .actions { margin-top: auto; padding-top: 10px; }
.upcoming .primary { background: transparent; color: var(--cyan); box-shadow: inset 0 0 0 2px var(--cyan); }
.upcoming .primary:hover { background: rgba(61, 224, 255, 0.12); }

.load-error { padding-block: 40px; color: var(--danger); }
.foot { padding-block: 48px 40px; color: var(--muted); font-size: 0.9rem; text-align: center; }
.foot p { margin: 0; }

/* Sign-in dialog */
dialog { border: 0; padding: 0; background: none; color: var(--text); width: min(380px, calc(100vw - 32px)); }
dialog::backdrop { background: rgba(8, 5, 18, 0.7); }
.panel { position: relative; background: var(--night-2); border: 1px solid var(--edge); border-radius: 18px; padding: 22px; }
.close { position: absolute; right: 10px; top: 6px; background: none; border: 0; color: var(--muted); font-size: 1.7rem; line-height: 1; cursor: pointer; padding: 4px 8px; }
.tabs { display: flex; gap: 4px; margin: 6px 24px 16px 0; border-bottom: 1px solid var(--edge); }
.tabs button { flex: 1; background: none; border: 0; padding: 8px 0 10px; color: var(--muted); font: 700 0.95rem var(--body); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--honey); border-bottom-color: var(--honey); }
form { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 700; font-size: 0.9rem; margin-top: 6px; }
input { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--edge); background: var(--night); color: var(--text); font: inherit; }
#auth-form .primary { margin-top: 12px; }
.note { margin: 6px 0 0; color: var(--muted); font-size: 0.88rem; }
.error { margin: 6px 0 0; color: var(--danger); font-size: 0.92rem; }
