/* Mono Air — phone build.
   The tokens mirror src/theme.ts so the site and the seat-back tablet read as
   one product: same palette, same glass pills, same corner radii. */

:root {
  --bg: #000000;
  --panel: #101012;
  --panel-alt: #141418;
  --text: #ffffff;
  --dim: rgba(255, 255, 255, 0.68);
  --faint: rgba(255, 255, 255, 0.5);
  --border: rgba(255, 255, 255, 0.1);
  --chip-bg: rgba(255, 255, 255, 0.08);
  --chip-text: rgba(255, 255, 255, 0.7);
  --chip-active-bg: #ffffff;
  --chip-active-text: #000000;
  --ok: #6fdc8c;
  --accent: #8aa4ff;
  --glass: rgba(16, 20, 26, 0.55);
  --glass-border: rgba(255, 255, 255, 0.12);
  --pill-ink: rgba(255, 255, 255, 0.78);
  /* The hero copy is always white, so its wash stays dark in both themes —
     the tablet's dashboard does the same. */
  --hero-fade: #000000;
  --nav-bg: rgba(8, 9, 12, 0.9);
  --tile: rgba(125, 155, 255, 0.12);

  --radius-card: 18px;
  --radius-panel: 22px;
  --pad: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* The page is phone-shaped; on a laptop it stays a centred column. */
  --column: 760px;

  color-scheme: dark;
}

[data-theme='light'] {
  --bg: #f2f2f5;
  --panel: #ffffff;
  --panel-alt: #e9e9ee;
  --text: #1a1a20;
  --dim: rgba(0, 0, 0, 0.65);
  --faint: rgba(0, 0, 0, 0.48);
  --border: rgba(0, 0, 0, 0.08);
  --chip-bg: rgba(0, 0, 0, 0.06);
  --chip-text: rgba(0, 0, 0, 0.6);
  --chip-active-bg: #1a1a20;
  --chip-active-text: #ffffff;
  --ok: #188a4b;
  --accent: #1a3ec6;
  --nav-bg: rgba(255, 255, 255, 0.92);
  --tile: rgba(26, 62, 198, 0.06);
  /* The switches float over dark key art on the home screen but over paper on
     the inner ones, so in this theme the glass turns light and its ink dark. */
  --glass: rgba(255, 255, 255, 0.68);
  --glass-border: rgba(0, 0, 0, 0.12);
  --pill-ink: rgba(0, 0, 0, 0.7);
  --hero-fade: #0a0b18;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* A class that sets `display` outbids the UA rule behind the hidden attribute,
   which is how the player's error card ended up painted over a running game.
   One global rule keeps every hidden element hidden. */
[hidden] { display: none !important; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

body { min-height: 100dvh; padding-bottom: calc(var(--safe-bottom) + 34px); }
/* set while a game or the airline card is up */
body.locked { overflow: hidden; }

img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3 { font-weight: 800; letter-spacing: -0.4px; }

/* ── top chrome ───────────────────────────────────────────────────────────
   Sits over the hero at the top of the page and scrolls away with it. It is
   deliberately not fixed: a bar riding along over the artwork (and over a
   game's own HUD) is exactly what the tablet does not do either. */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(var(--safe-top) + 10px) max(var(--pad), calc((100% - var(--column)) / 2)) 10px;
}
.topbar .brand { height: 24px; width: auto; flex: 0 0 auto; }
.topbar .spacer { flex: 1; }

.pill {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.pill button {
  height: 32px;
  min-width: 34px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  color: var(--pill-ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pill button[aria-pressed='true'] { background: #efeff2; color: #1a1a20; }
[data-theme='light'] .pill button[aria-pressed='true'] { background: #1a1a20; color: #fff; }
.icon-btn { width: 40px; height: 38px; justify-content: center; }
.icon-btn svg { width: 19px; height: 19px; color: var(--pill-ink); }

/* The Centrum Air badge — the tablet keeps the airline behind exactly this
   round logo button in the header, and so does the phone. */
.badge-btn {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--glass-border);
  background: var(--glass);
}
.badge-btn img { width: 100%; height: 100%; object-fit: cover; }
.badge-btn:active { opacity: 0.8; }

#view { max-width: var(--column); margin: 0 auto; }

/* ── hero carousel ────────────────────────────────────────────────────── */
.hero { position: relative; }
.hero-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.hero-track::-webkit-scrollbar { display: none; }
.hero-slide {
  position: relative;
  flex: 0 0 100%;
  scroll-snap-align: start;
  height: clamp(430px, 72dvh, 620px);
  overflow: hidden;
  background: #0a0b18;
}
.hero-slide .art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* one wash from the top for the chrome, one from the bottom for the copy */
.hero-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to bottom, rgba(4, 6, 18, 0.55) 0%, rgba(4, 6, 18, 0) 32%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0) 38%, var(--hero-fade) 99%);
}
.hero-copy {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 0 var(--pad) 46px;
}
.hero-copy .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.4);
  margin-bottom: 12px;
}
.hero-copy h1 {
  font-size: clamp(34px, 10vw, 46px);
  line-height: 1.04;
  letter-spacing: -1.4px;
  color: #fff;
}
.hero-copy p {
  margin-top: 8px;
  max-width: 30ch;
  font-size: 15px;
  line-height: 21px;
  color: rgba(255, 255, 255, 0.72);
}
.play-btn {
  margin-top: 18px;
  height: 50px;
  padding: 0 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}
.play-btn:active { transform: scale(0.97); }
.hero-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 3;
  display: flex;
  justify-content: center;
  gap: 6px;
}
.hero-dots i {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  transition: width 0.2s ease, background-color 0.2s ease;
}
.hero-dots i.on { width: 20px; background: #fff; }

/* ── sections ─────────────────────────────────────────────────────────── */
.section-title {
  margin: 26px var(--pad) 12px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.section-sub { margin: -6px var(--pad) 14px; font-size: 13.5px; color: var(--dim); }

.rail {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 0 var(--pad) 2px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.rail::-webkit-scrollbar { display: none; }

.tile { flex: 0 0 auto; width: 104px; scroll-snap-align: start; }
.tile .art {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  object-fit: cover;
  background: var(--panel-alt);
}
.tile span {
  display: block;
  margin-top: 7px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--dim);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tile:active { opacity: 0.75; }

.chips { margin: 18px 0 14px; }
.chip {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--chip-text);
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
}
.chip[aria-pressed='true'] { background: var(--chip-active-bg); color: var(--chip-active-text); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  padding: 0 var(--pad);
}
.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--panel-alt);
  text-align: left;
}
.card:active { transform: scale(0.98); }
.card .art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 45%, rgba(0, 0, 0, 0.76) 100%);
}
.card .info {
  position: absolute;
  inset: auto 10px 10px 10px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card .info img { width: 26px; height: 26px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; }
.card .info b,
.card .info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .info b { font-size: 14px; font-weight: 700; color: #fff; }
.card .info small { font-size: 11.5px; color: rgba(255, 255, 255, 0.66); }
.card .best {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ── inner screens (scores, airline) ──────────────────────────────────── */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 4px var(--pad) 4px; }
.stat {
  background: var(--tile);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
}
.stat b { display: block; font-size: 20px; font-weight: 800; color: var(--accent); }
.stat span { display: block; margin-top: 3px; font-size: 11.5px; line-height: 15px; color: var(--dim); }

.list { padding: 14px var(--pad) 0; display: flex; flex-direction: column; gap: 8px; }
.row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 16px;
  background: var(--panel);
  border: 1px solid var(--border);
  text-align: left;
}
.row:active { opacity: 0.8; }
.row .rank { width: 22px; font-size: 13px; font-weight: 800; color: var(--faint); text-align: center; }
.row img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.row .meta { flex: 1; min-width: 0; }
.row .meta b { display: block; font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta small { font-size: 12px; color: var(--faint); }
.row .score { font-size: 15px; font-weight: 800; color: var(--ok); white-space: nowrap; }

.airline-head { display: flex; align-items: center; gap: 14px; padding-right: 34px; }
.airline-head img { width: 52px; height: 52px; border-radius: 26px; object-fit: cover; flex: 0 0 auto; }
.airline-head h1 { font-size: 23px; }
.airline-head small { display: block; margin-top: 2px; font-size: 12.5px; color: var(--dim); }
.airline-about { margin-top: 16px; font-size: 14.5px; line-height: 22px; color: var(--dim); }
.airline-mission { margin-top: 10px; font-size: 14px; line-height: 21px; color: var(--dim); }
.airline-mission b { color: var(--accent); }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 18px; }
.fleet-label { margin: 22px 0 10px; font-size: 11px; font-weight: 700; letter-spacing: 1.4px; color: var(--faint); }
.fleet { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.plane { border: 1px solid var(--border); border-radius: 16px; padding: 14px; }
.plane b { display: block; font-size: 15px; margin-bottom: 6px; }
.plane span { display: block; font-size: 13px; line-height: 20px; color: var(--dim); }

/* ── Centrum Air sheet ────────────────────────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.62); }
.sheet-panel {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 90dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 26px 26px 0 0;
  padding: 18px var(--pad) calc(var(--safe-bottom) + 26px);
  animation: sheet-up 0.28s ease;
}
.sheet-panel::before {
  content: '';
  display: block;
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: var(--chip-bg);
  margin: 0 auto 16px;
}
@keyframes sheet-up { from { transform: translateY(24px); opacity: 0; } }
.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  background: var(--chip-bg);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}
@media (min-width: 620px) {
  .sheet { align-items: center; padding: 24px; }
  .sheet-panel { border-radius: 26px; max-height: 84dvh; }
  .sheet-panel::before { display: none; }
}

/* ── player ───────────────────────────────────────────────────────────── */
.player { position: fixed; inset: 0; z-index: 60; background: #05060c; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }

.round-btn {
  position: absolute;
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 21px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(10, 14, 18, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.round-btn svg { width: 22px; height: 22px; }
.back { top: calc(var(--safe-top) + 10px); left: 12px; }

.game-badge {
  position: absolute;
  top: calc(var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.3);
  pointer-events: none;
}
.game-badge img { width: 100%; height: 100%; border-radius: 11px; object-fit: cover; }

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: #05060c;
  transition: opacity 0.32s ease;
}
.player-overlay.solid { background: #05060c; }
.player-overlay.gone { opacity: 0; pointer-events: none; }
.player-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.player-loading-row { position: relative; display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255, 255, 255, 0.7); }
.spinner {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.card-panel {
  position: relative;
  width: min(360px, calc(100% - 48px));
  padding: 26px 22px;
  border-radius: var(--radius-panel);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  color: #fff;
}
.card-panel h2 { font-size: 19px; }
.card-panel p { margin-top: 8px; font-size: 14.5px; line-height: 21px; color: rgba(255, 255, 255, 0.68); }
.row-btns { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.btn {
  height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
}
.btn.primary { background: #fff; border-color: #fff; color: #000; font-weight: 700; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-bottom) + 26px);
  transform: translateX(-50%);
  z-index: 5;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: #05060c;
  background: #fff;
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── wider phones / small tablets ─────────────────────────────────────── */
@media (min-width: 620px) {
  :root { --pad: 26px; }
  .hero-copy { padding-bottom: 54px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

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