/* ============================================================
   LaunchBoard — design tokens
   Split-flap departures/arrivals board, reinterpreted for game
   releases. Dark is the default; light is a cool steel tone,
   deliberately not the usual warm cream.
   ============================================================ */

:root {
  /* dark (default) */
  --bg: #0B0E14;
  --bg-panel: #131720;
  --bg-panel-raised: #181D28;
  --border: #232838;
  --text: #ECEFF4;
  --text-dim: #8B93A7;
  --text-faint: #545C6E;

  --amber: #F2A93B;
  --amber-dim: #6B4E1E;
  --teal: #45D9C3;
  --teal-dim: #1E5850;
  --red: #E5533D;
  --red-dim: #5E241C;

  --radius: 10px;
  --radius-sm: 6px;
  --font-display: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow: 0 8px 24px rgba(0,0,0,0.35);
  --motion-fast: 180ms;
  --motion-flap: 420ms;
}

[data-theme="light"] {
  --bg: #EEF1F5;
  --bg-panel: #FFFFFF;
  --bg-panel-raised: #F7F9FC;
  --border: #D8DEE7;
  --text: #12161F;
  --text-dim: #5B6472;
  --text-faint: #929AAA;

  --amber: #C97F12;
  --amber-dim: #F3DBB0;
  --teal: #14897A;
  --teal-dim: #C7EEE8;
  --red: #C43F2D;
  --red-dim: #F6D2CB;

  --shadow: 0 8px 24px rgba(20,25,40,0.08);
}

@media (prefers-reduced-motion: reduce) {
  :root { --motion-fast: 0ms; --motion-flap: 0ms; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.wrap { max-width: 1160px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- header ---------- */

.site-header {
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 20;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); display: inline-block; }

.brand-gear {
  color: var(--amber);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .brand-gear { animation: gear-spin 12s linear infinite; }
}

@keyframes gear-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

nav.primary { display: flex; gap: 1.5rem; font-size: 0.9rem; }
nav.primary a { text-decoration: none; color: var(--text-dim); transition: color var(--motion-fast); }
nav.primary a:hover, nav.primary a.active { color: var(--text); }

.header-actions { display: flex; align-items: center; gap: 0.75rem; }

.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-dim);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 0.9rem;
}

/* ---------- hero / split-flap board ---------- */

.hero {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  letter-spacing: -0.01em;
}

.hero p.tagline { color: var(--text-dim); margin: 0 0 1.25rem; font-size: 0.95rem; }

.platform-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.pill {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  transition: color var(--motion-fast), border-color var(--motion-fast);
}

.pill:hover { color: var(--text); border-color: var(--text-faint); }
.pill.active { color: var(--bg); background: var(--amber); border-color: var(--amber); }

.board-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 760px) {
  .board-grid { grid-template-columns: 1fr; }
}

.board {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.board-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 0.85rem 1rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.board-label.arriving { color: var(--amber); }
.board-label.leaving { color: var(--red); }
.board-label:has(+ .board-sublabel) { border-bottom: none; }

.board-sublabel {
  font-size: 0.72rem;
  color: var(--text-faint);
  padding: 0 1rem 0.6rem;
  border-bottom: 1px solid var(--border);
}

.flap-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
  opacity: 0;
  transform: translateY(-6px);
  animation: flap-in var(--motion-flap) ease forwards;
}

.flap-row:last-child { border-bottom: none; }
.flap-row:nth-child(2) { animation-delay: 40ms; }
.flap-row:nth-child(3) { animation-delay: 80ms; }
.flap-row:nth-child(4) { animation-delay: 120ms; }
.flap-row:nth-child(5) { animation-delay: 160ms; }
.flap-row:nth-child(6) { animation-delay: 200ms; }

@keyframes flap-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.flap-date {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  background: var(--bg-panel-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.4rem;
  text-align: center;
  color: var(--text);
}

.flap-date .m { display: block; font-size: 0.6rem; letter-spacing: 0.08em; color: var(--text-dim); }
.flap-date .d { display: block; font-size: 1.05rem; line-height: 1.1; }

.flap-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; display: flex; align-items: center; gap: 0.35rem; }
.flap-title a { text-decoration: none; }
.flap-title a:hover { color: var(--amber); }

.dayone-icon { color: var(--teal); display: inline-flex; flex-shrink: 0; }

.flag {
  font-family: var(--font-display);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  white-space: nowrap;
}

.flag-ontime { background: var(--teal-dim); color: var(--teal); }
.flag-delayed { background: var(--red-dim); color: var(--red); }
.flag-dayone { background: var(--teal-dim); color: var(--teal); }
.flag-leaving { background: var(--red-dim); color: var(--red); }

/* ---------- filter bar ---------- */

.filter-bar {
  position: sticky;
  top: 64px;
  z-index: 15;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.9rem 0;
}

.filter-bar form {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.filter-bar select, .filter-bar input[type="search"], .filter-bar input[type="date"] {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.85rem;
  color-scheme: dark;
}

[data-theme="light"] .filter-bar input[type="date"] { color-scheme: light; }

.filter-bar input[type="search"] { flex: 1; min-width: 180px; }

/* ---------- game grid ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  padding: 2rem 0;
}

.game-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform var(--motion-fast), border-color var(--motion-fast);
}

.game-card:hover { transform: translateY(-3px); border-color: var(--amber); }

.game-card .cover {
  aspect-ratio: 3 / 4;
  background: var(--bg-panel-raised);
  background-size: cover;
  background-position: center;
}

.game-card .info { padding: 0.85rem; display: flex; flex-direction: column; gap: 0.4rem; flex: 1; }
.game-card .title { font-weight: 700; font-size: 0.92rem; line-height: 1.3; }
.game-card .date { font-family: var(--font-display); font-size: 0.78rem; color: var(--text-dim); }
.game-card .flags { display: flex; gap: 0.35rem; flex-wrap: wrap; margin-top: auto; }

/* ---------- game detail page ---------- */

.game-detail { padding: 2.5rem 0; display: grid; grid-template-columns: 260px 1fr; gap: 2rem; }
@media (max-width: 700px) { .game-detail { grid-template-columns: 1fr; } }

.game-detail .cover { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }

.game-detail h1 { font-family: var(--font-display); font-size: 1.5rem; margin: 0 0 0.5rem; }
.game-detail .meta-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }

.change-log { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin: 1.25rem 0; }
.change-log .entry { padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); font-size: 0.85rem; }
.change-log .entry:last-child { border-bottom: none; }
.change-log .entry .dates { font-family: var(--font-display); color: var(--red); font-weight: 600; }
.change-log .entry .reason { color: var(--text-dim); margin-top: 0.2rem; }
.change-log .entry a { color: var(--teal); font-size: 0.8rem; }

.buy-links { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.5rem; }
.buy-link {
  border: 1px solid var(--border);
  background: var(--bg-panel);
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.buy-link:hover { border-color: var(--amber); }
.buy-link .price { color: var(--amber); font-family: var(--font-display); }

/* ---------- ad slot ---------- */

.ad-slot {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.75rem;
  margin: 2rem 0;
}

/* ---------- pagination ---------- */

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem 0 3rem;
}

.pagination-status {
  font-family: var(--font-display);
  font-size: 0.78rem;
  color: var(--text-faint);
}

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  color: var(--text-faint);
  font-size: 0.8rem;
  margin-top: 2rem;
}
