/* =============================================================================
 * A Snapshot in History — games hub (index.html)
 * Light "photo paper" page with one bold card per game. Each card links to
 * that game's own menu. Add a game: copy a .game-card block in index.html and
 * give it a background colour below.
 * ========================================================================== */

:root {
  --bg: #f6f1e6;
  --surface: #ebe3d3;
  --ink: #1c2a33;
  --ink-dim: #5d6a70;
  --accent: #c0392b;
  --radius: 26px;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  min-height: 100dvh;
  display: flex; flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* ------------------------------------------------------------------ header */
.hub-top {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid rgba(28, 42, 51, 0.1);
}
.hub-signin {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 999px;
  background: var(--ink); color: var(--bg);
  font-weight: 700; font-size: 0.95rem; text-decoration: none; white-space: nowrap;
  max-width: 50vw; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.15s ease, transform 0.15s ease;
}
.hub-signin:hover { background: #2c3e49; transform: translateY(-1px); }
.hub-signin.is-signed-in { background: var(--surface); color: var(--ink); }
.hub-signin.is-signed-in:hover { background: #e2d8c4; }
.hub-brand {
  display: inline-flex; align-items: center; gap: 12px;
  text-decoration: none;
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.2rem, 2.6vw, 1.55rem); letter-spacing: -0.01em;
}
.hub-brand img { border-radius: 8px; }
.hub-brand em { font-style: italic; font-weight: 600; color: var(--accent); }

/* -------------------------------------------------------------------- main */
.hub-main {
  flex: 1;
  width: 100%; max-width: 1240px; margin: 0 auto;
  padding: clamp(20px, 4vw, 40px) clamp(16px, 4vw, 48px) 40px;
}
.hub-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 22px;
}
.hub-h {
  font-size: 1.05rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
  color: #3d4a50;
}
.hub-date {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 16px 6px 6px; border-radius: 999px;
  background: var(--surface);
  font-weight: 700; color: var(--ink);
}
.hub-date-day {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 0.9rem; font-weight: 800;
}

.hub-grid {
  display: grid; gap: clamp(14px, 2vw, 24px);
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 980px) { .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .hub-grid { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------------- cards */
.game-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center;
  aspect-ratio: 2 / 3;
  padding: clamp(20px, 2.4vw, 30px) clamp(18px, 2.4vw, 30px) clamp(26px, 3vw, 38px);
  border-radius: var(--radius);
  color: #fff; text-decoration: none; text-align: center;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 10px 26px -14px rgba(28, 42, 51, 0.45);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
@media (max-width: 600px) { .game-card { aspect-ratio: auto; min-height: 380px; } }
a.game-card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px -16px rgba(28, 42, 51, 0.55); }
a.game-card:active { transform: translateY(-1px); }

.game-art { flex: 1; width: 100%; display: grid; place-items: center; min-height: 0; }
.game-art svg { width: 100%; max-width: 300px; height: auto; display: block; overflow: visible; }
a.game-card:hover .game-art svg { transform: rotate(-1.5deg) scale(1.02); }
.game-art svg { transition: transform 0.3s ease; }

.game-name {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(2rem, 3.4vw, 2.7rem); line-height: 1; letter-spacing: -0.015em;
  margin: 12px 0 14px;
}
.game-desc {
  font-weight: 600; font-size: clamp(0.98rem, 1.35vw, 1.1rem); line-height: 1.4;
  max-width: 26ch;
}

.game-badge {
  position: absolute; top: 16px; right: 16px;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.92); color: var(--ink);
}
.game-card.is-soon { cursor: default; }
.game-card.is-soon .game-art { opacity: 0.85; }

/* One colour per game */
.card-snapshot { background: #2c6e63; }
.card-snapshot .game-name { color: #f6f1e6; }
.card-timeline { background: #5a3d8a; }
.card-oldernewer { background: #c8553d; }

/* ------------------------------------------------------------------ footer */
.hub-foot {
  padding: 18px clamp(16px, 4vw, 48px) max(18px, env(safe-area-inset-bottom));
  font-size: 0.85rem; color: var(--ink-dim); text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* ============================================================= SIGN-IN PAGE */
.auth-main {
  flex: 1; display: grid; place-items: start center;
  padding: clamp(24px, 6vh, 64px) 16px 40px;
}
.auth-card {
  width: 100%; max-width: 420px;
  background: #fffdf8; border: 1px solid rgba(28, 42, 51, 0.1);
  border-radius: var(--radius); padding: clamp(22px, 4vw, 34px);
  box-shadow: 0 14px 34px -20px rgba(28, 42, 51, 0.45);
}
.auth-back {
  display: inline-block; margin-bottom: 14px;
  font-size: 0.9rem; font-weight: 600; color: var(--ink-dim); text-decoration: none;
}
.auth-back:hover { color: var(--ink); }
.auth-title { font-family: var(--font-display); font-weight: 800; font-size: 2rem; line-height: 1.1; letter-spacing: -0.01em; }
.auth-lede { margin-top: 6px; color: var(--ink-dim); }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  margin: 20px 0 18px; padding: 4px; border-radius: 14px; background: var(--surface);
}
.auth-tabs button {
  padding: 9px; border: 0; border-radius: 11px; background: transparent;
  font: inherit; font-weight: 700; font-size: 0.92rem; color: var(--ink-dim); cursor: pointer;
}
.auth-tabs button[aria-selected='true'] { background: #fffdf8; color: var(--ink); box-shadow: 0 1px 3px rgba(28, 42, 51, 0.15); }
.auth-form { display: grid; gap: 14px; }
.auth-field { display: grid; gap: 6px; }
.auth-field > span { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: #3d4a50; }
.auth-input-wrap { position: relative; }
.auth-field input {
  width: 100%; padding: 12px 14px; border-radius: 12px;
  border: 1.5px solid rgba(28, 42, 51, 0.18); background: #fff;
  font: inherit; font-size: 1rem; color: var(--ink);
}
.auth-input-wrap input { padding-right: 64px; }
.auth-field input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(28, 42, 51, 0.12); }
.auth-field input[aria-invalid='true'] { border-color: var(--accent); }
.auth-show {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  padding: 6px 10px; border: 0; border-radius: 8px; background: transparent;
  font: inherit; font-size: 0.82rem; font-weight: 700; color: var(--ink-dim); cursor: pointer;
}
.auth-show:hover { background: var(--surface); color: var(--ink); }
.auth-hint { font-size: 0.85rem; color: var(--ink-dim); line-height: 1.45; }
.auth-error { font-size: 0.9rem; font-weight: 600; color: var(--accent); }
.auth-error:empty { display: none; }
.auth-submit {
  margin-top: 4px; padding: 13px; border: 0; border-radius: 12px;
  background: var(--ink); color: var(--bg);
  font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer;
}
.auth-submit:hover:not(:disabled) { background: #2c3e49; }
.auth-submit:disabled { opacity: 0.6; cursor: progress; }
.auth-secondary {
  margin-top: 18px; width: 100%; padding: 12px; border-radius: 12px;
  border: 1.5px solid rgba(28, 42, 51, 0.18); background: transparent;
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: center; text-decoration: none; display: block;
}
.auth-secondary:hover { background: var(--surface); }
.auth-note { margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--surface); font-size: 0.9rem; line-height: 1.45; }
[hidden] { display: none !important; }
.auth-link { display: block; margin-top: 20px; text-align: center; text-decoration: none; }
