/* =========================================================
   5iPlay — Apple HIG–grounded redesign
   · semantic colors, light + dark from the system
   · 8pt spacing rhythm, 44pt touch targets, 4.5:1 text contrast
   · neutral chrome so any screenshot palette fits
   ========================================================= */

:root {
  color-scheme: light dark;

  --bg: #F5F5F7;
  --surface: #FFFFFF;
  --surface-2: #F2F2F7;
  --surface-3: #E8E8ED;
  --fill: rgba(118, 118, 128, .12);
  --fill-2: rgba(118, 118, 128, .08);
  --label: #1D1D1F;
  --label-2: #6E6E73;
  --label-3: #8E8E93;
  --separator: rgba(60, 60, 67, .14);
  --separator-strong: rgba(60, 60, 67, .24);
  --accent: #0071E3;
  --accent-ink: #FFFFFF;
  --star: #8E8E93;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .04);
  --shadow-float: 0 10px 40px rgba(0, 0, 0, .10), 0 2px 8px rgba(0, 0, 0, .06);
  --shadow-sheet: 0 30px 90px rgba(0, 0, 0, .28), 0 8px 24px rgba(0, 0, 0, .14);
  --nav-bg: rgba(245, 245, 247, .72);
  --stage: #000000;

  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;
  --r-2xl: 32px;

  --page: 1140px;
  --ease: cubic-bezier(.32, .72, 0, 1);

  --fs-large: clamp(32px, 4.2vw, 46px);
  --fs-h2: clamp(24px, 2.6vw, 30px);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #000000;
    --surface: #1C1C1E;
    --surface-2: #131315;
    --surface-3: #2C2C2E;
    --fill: rgba(120, 120, 128, .24);
    --fill-2: rgba(120, 120, 128, .14);
    --label: #F5F5F7;
    --label-2: #A1A1A6;
    --label-3: #8E8E93;
    --separator: rgba(255, 255, 255, .14);
    --separator-strong: rgba(255, 255, 255, .24);
    --accent: #0A84FF;
    --star: #A1A1A6;
    --shadow-card: none;
    --shadow-float: 0 12px 40px rgba(0, 0, 0, .6);
    --shadow-sheet: 0 30px 90px rgba(0, 0, 0, .8);
    --nav-bg: rgba(18, 18, 20, .72);
  }
}

/* explicit dark choice, even when the system is light (values mirror the block above) */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000;
  --surface: #1C1C1E;
  --surface-2: #131315;
  --surface-3: #2C2C2E;
  --fill: rgba(120, 120, 128, .24);
  --fill-2: rgba(120, 120, 128, .14);
  --label: #F5F5F7;
  --label-2: #A1A1A6;
  --label-3: #8E8E93;
  --separator: rgba(255, 255, 255, .14);
  --separator-strong: rgba(255, 255, 255, .24);
  --accent: #0A84FF;
  --star: #A1A1A6;
  --shadow-card: none;
  --shadow-float: 0 12px 40px rgba(0, 0, 0, .6);
  --shadow-sheet: 0 30px 90px rgba(0, 0, 0, .8);
  --nav-bg: rgba(18, 18, 20, .72);
}
:root[data-theme="light"] { color-scheme: light; }

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
    "Segoe UI", "Helvetica Neue", "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

::selection { background: var(--accent); color: var(--accent-ink); }

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 6px;
}

.page {
  width: 100%;
  max-width: var(--page);
  margin: 0 auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

svg { stroke: currentColor; stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
svg circle, svg line, svg path, svg polyline { vector-effect: non-scaling-stroke; }

/* =========================
   NAV
   ========================= */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-bg);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--separator);
}

.nav-inner {
  max-width: var(--page);
  margin: 0 auto;
  height: 58px;
  padding-inline: clamp(16px, 4vw, 40px);
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 7px;
  overflow: hidden;
  background: #161616;
}
.brand-mark img { display: block; width: 100%; height: 100%; object-fit: cover; }

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
}
.brand-text em {
  font-style: normal;
  font-size: 10px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--label-3);
}

.tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0 auto;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 13px;
  color: var(--label-2);
  transition: color .2s, background .2s;
}
.tab:hover { color: var(--label); background: var(--fill-2); }
.tab.is-active { color: var(--label); font-weight: 600; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: translateX(-50%);
}

.nav-actions { display: flex; align-items: center; gap: 8px; flex: none; }

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--label-2);
  transition: background .2s, color .2s;
}
.icon-btn:hover { background: var(--fill-2); color: var(--label); }
.icon-btn svg { width: 18px; height: 18px; }

.lang-btn {
  height: 32px;
  min-width: 44px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--label-2);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  transition: background .2s, color .2s;
}
.lang-btn:hover { background: var(--surface-3); color: var(--label); }

/* ---------- Search bar ---------- */
.searchbar {
  border-top: .5px solid var(--separator);
  animation: dropIn .32s var(--ease);
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}

.searchbar-inner {
  max-width: var(--page);
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 40px) 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-field {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  background: var(--fill);
  border-radius: var(--r-sm);
}
.search-field svg { width: 16px; height: 16px; color: var(--label-3); flex: none; }
.search-field input {
  flex: 1;
  min-width: 0;
  height: 100%;
  border: 0;
  background: transparent;
  color: var(--label);
  font-size: 15px;
  outline: none;
}
.search-field input::placeholder { color: var(--label-3); }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; }

.field-clear {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--label-3);
  color: var(--surface);
  font-size: 11px;
  line-height: 1;
  display: grid;
  place-items: center;
  flex: none;
}
.field-clear:hover { background: var(--label-2); }

.cancel-btn {
  height: 40px;
  padding: 0 6px;
  font-size: 15px;
  color: var(--accent);
  flex: none;
}

/* =========================
   TODAY
   ========================= */
.today { padding-top: clamp(28px, 4vw, 44px); }

.date-line {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--label-3);
}

.page-title {
  margin: 0;
  font-size: var(--fs-large);
  line-height: 1.05;
  letter-spacing: -.025em;
  font-weight: 700;
}

.page-sub {
  margin: 12px 0 0;
  max-width: 62ch;
  font-size: 17px;
  line-height: 1.55;
  color: var(--label-2);
}

/* ---------- Hero editorial card ---------- */
.hero {
  position: relative;
  display: block;
  width: 100%;
  margin-top: clamp(24px, 3vw, 34px);
  aspect-ratio: 16 / 8.4;
  min-height: 320px;
  border-radius: var(--r-2xl);
  overflow: hidden;
  background: var(--surface-3);
  box-shadow: var(--shadow-card);
  text-align: left;
}
.hero:focus-visible { outline-offset: 4px; }

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .8s var(--ease);
}
.hero:hover .hero-img { transform: scale(1.035); }

/* scrim keeps text legible on any screenshot */
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, .06) 0%, rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, .52) 64%, rgba(0, 0, 0, .84) 100%),
    linear-gradient(90deg, rgba(0, 0, 0, .42) 0%, rgba(0, 0, 0, 0) 58%);
  pointer-events: none;
}

.hero-content {
  position: absolute;
  left: clamp(20px, 3.4vw, 44px);
  right: clamp(20px, 3.4vw, 44px);
  bottom: clamp(22px, 3.2vw, 40px);
  z-index: 2;
  color: #fff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 27px;
  padding: 0 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  border: .5px solid rgba(255, 255, 255, .34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #fff;
}
.hero-kicker::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-kicker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.noai-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 4px;
  background: #fff;
  color: #111;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.hero-title {
  margin: 14px 0 0;
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.02;
  letter-spacing: -.03em;
  font-weight: 700;
  text-shadow: 0 1px 18px rgba(0, 0, 0, .25);
}

.hero-desc {
  margin: 10px 0 0;
  max-width: 46ch;
  font-size: 16px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .84);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 22px;
}

.btn-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 24px;
  border-radius: 999px;
  background: #fff;
  color: #1D1D1F;
  font-size: 15px;
  font-weight: 600;
  transition: transform .2s var(--ease), background .2s;
}
.btn-light:hover { background: rgba(255, 255, 255, .88); transform: scale(.985); }
.btn-light svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

.btn-glass {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  border: .5px solid rgba(255, 255, 255, .34);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  transition: background .2s;
}
.btn-glass:hover { background: rgba(255, 255, 255, .26); }

.hero-meta-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, .74);
}
.hero-meta-line b { color: #fff; font-weight: 600; }
/* stars sitting on artwork need their own contrast */
.hero-meta-line .stars { color: rgba(255, 255, 255, .4); }
.hero-meta-line .stars .on { color: #fff; }
.hero-meta-line .stars .off { opacity: 1; }
.hero-sep {
  width: 1px;
  height: 11px;
  background: rgba(255, 255, 255, .3);
}

/* ---------- hero stats ---------- */
.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: .5px solid var(--separator);
}

.hstat { display: flex; flex-direction: column; gap: 3px; }
.hstat-num {
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.02em;
}
.hstat-num .pct { font-size: 13px; color: var(--accent); }
.hstat-lab {
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--label-3);
}

/* =========================
   SECTIONS
   ========================= */
.section { padding-top: clamp(44px, 5vw, 64px); }
.about { padding-top: clamp(48px, 6vw, 76px); }

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head h2 {
  margin: 0;
  font-size: var(--fs-h2);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 700;
}

.section-sub {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--label-2);
}

.text-link {
  font-size: 15px;
  color: var(--accent);
  padding: 8px 4px;
  flex: none;
  white-space: nowrap;
}
.text-link:hover { text-decoration: underline; }

.rail-nav { display: flex; gap: 8px; flex: none; }

.round-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fill);
  color: var(--label-2);
  transition: background .2s, color .2s, opacity .2s;
}
.round-btn:hover { background: var(--surface-3); color: var(--label); }
.round-btn svg { width: 18px; height: 18px; }

/* ---------- Rail ---------- */
.rail {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding-bottom: 4px;
  margin-inline: -4px;
  padding-inline: 4px;
}
.rail::-webkit-scrollbar { display: none; }

.rail-card {
  flex: 0 0 clamp(180px, 22vw, 232px);
  scroll-snap-align: start;
  text-align: left;
  padding: 0;
  display: block;
  width: 100%;
  transition: transform .3s var(--ease);
}
.rail-card:hover { transform: translateY(-3px); }
.rail-card:active { transform: scale(.985); }

.rail-figure {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-3);
  box-shadow: var(--shadow-card);
}
/* hairline that survives every artwork colour */
.rail-figure::after,
.card-figure::after,
.chart-icon::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .16);
  pointer-events: none;
}

.rail-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.rail-card:hover .rail-figure img { transform: scale(1.05); }

.rail-flag {
  position: absolute;
  top: 8px;
  left: 8px;
  height: 22px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .9);
  color: #1D1D1F;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.rail-text { padding-top: 10px; }
.rail-name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-meta {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.rail-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--label-2);
}

/* ---------- Stars ---------- */
.stars {
  display: inline-flex;
  gap: 1px;
  color: var(--star);
  font-size: 11px;
  letter-spacing: .02em;
  line-height: 1;
}
.stars .on { color: var(--label); }
.stars .off { opacity: .55; }

/* ---------- Chart list ---------- */
.chart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: .5px solid var(--separator);
}

.chart-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 6px;
  margin-inline: -6px;
  text-align: left;
  border-radius: var(--r-md);
  border-bottom: .5px solid var(--separator);
  transition: background .2s;
}
.chart-row:hover { background: var(--fill-2); }

.chart-rank {
  width: 26px;
  flex: none;
  font-size: 15px;
  font-weight: 600;
  color: var(--label-3);
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.chart-icon {
  position: relative;
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface-3);
}
.chart-icon img { width: 100%; height: 100%; object-fit: cover; }

.chart-main { flex: 1; min-width: 0; display: block; }
.chart-name {
  display: block;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-meta {
  display: block;
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-side {
  display: none;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--label-2);
  flex: none;
}

.get-btn {
  height: 30px;
  padding: 0 14px;
  flex: none;
  border-radius: 999px;
  background: var(--fill);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  transition: background .2s, color .2s;
}
.get-btn:hover { background: var(--accent); color: var(--accent-ink); }

/* ---------- Chips ---------- */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 6px;
  margin-bottom: 16px;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  height: 34px;
  padding: 0 14px;
  flex: none;
  border-radius: 999px;
  background: var(--fill);
  color: var(--label-2);
  font-size: 13px;
  font-weight: 500;
  transition: background .2s, color .2s;
}
.chip:hover { color: var(--label); background: var(--surface-3); }
.chip.is-on { background: var(--label); color: var(--bg); }

/* ---------- Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: clamp(20px, 2.6vw, 30px) clamp(16px, 2vw, 24px);
}

.card { text-align: left; padding: 0; display: block; width: 100%; }

.card-figure {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-lg);
  overflow: hidden;
  background: var(--surface-3);
  box-shadow: var(--shadow-card);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
}
.card:hover .card-figure { transform: translateY(-4px); box-shadow: var(--shadow-float); }

.card-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .7s var(--ease);
}
.card:hover .card-figure img { transform: scale(1.04); }

.card-flag {
  position: absolute;
  top: 10px;
  left: 10px;
  height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, .92);
  color: #1D1D1F;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.card-noai,
.rail-noai {
  position: absolute;
  top: 10px;
  right: 10px;
  height: 24px;
  padding: 0 9px;
  display: inline-flex;
  align-items: center;
  border-radius: 4px;
  background: #111;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .28);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.rail-noai {
  top: 8px;
  right: 8px;
  height: 22px;
  padding: 0 8px;
  font-size: 9px;
}

.card-body { padding-top: 11px; }
.card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.012em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-meta {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--label-2);
}
.card-rate {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--label-2);
}

.empty {
  margin: 56px 0 20px;
  text-align: center;
  font-size: 15px;
  color: var(--label-2);
}

/* =========================
   ABOUT
   ========================= */
.about-inner {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(28px, 5vw, 64px);
  padding-block: clamp(36px, 4vw, 52px);
  border-top: .5px solid var(--separator);
}

.about-copy h2 {
  margin: 0 0 12px;
  font-size: var(--fs-h2);
  letter-spacing: -.02em;
}
.about-copy p {
  margin: 0 0 14px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--label-2);
  max-width: 52ch;
}

.about-facts { margin: 0; display: grid; align-content: start; }
.about-facts > div {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 11px 0;
  border-top: .5px solid var(--separator);
}
.about-facts dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--label-3);
  padding-top: 2px;
}
.about-facts dd { margin: 0; font-size: 13px; color: var(--label); }

/* =========================
   FOOTER
   ========================= */
.footer {
  margin-top: clamp(48px, 6vw, 80px);
  border-top: .5px solid var(--separator);
  background: var(--surface-2);
}
.footer-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-block: 28px;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--label-2);
  flex: none;
}
.footer-brand .brand-mark { width: 18px; height: 18px; border-radius: 5px; }
.footer-note {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--label-3);
  max-width: 70ch;
}
.footer-actions { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: none; }

.appearance {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  height: 28px;
  border-radius: 999px;
  background: var(--fill);
}
.appearance button {
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  color: var(--label-2);
  transition: background .2s, color .2s;
}
.appearance button:hover { color: var(--label); }
.appearance button.is-on {
  background: var(--surface);
  color: var(--label);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .12);
}

/* =========================
   FLOATING RECOMMEND
   ========================= */
.fab {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(22px + env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 44px;
  padding: 0 17px 0 14px;
  border-radius: 999px;
  background: var(--surface);
  border: .5px solid var(--separator-strong);
  box-shadow: var(--shadow-float);
  color: var(--label);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.fab svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
}
.fab:hover { transform: translateY(-2px); }
.fab:active { transform: none; }
body:has(.modal.open) .fab { opacity: 0; visibility: hidden; pointer-events: none; }

/* =========================
   PLAYER SHEET
   ========================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 24px;
  visibility: hidden;
  opacity: 0;
  transition: opacity .32s var(--ease), visibility .32s;
}
.modal.open { visibility: visible; opacity: 1; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .36);
  backdrop-filter: blur(18px) saturate(120%);
  -webkit-backdrop-filter: blur(18px) saturate(120%);
}

.sheet {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(1160px, 100%);
  height: min(90vh, 920px);
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-sheet);
  overflow: hidden;
  transform: translateY(18px) scale(.975);
  opacity: 0;
  transition: transform .42s var(--ease), opacity .3s var(--ease);
}
.modal.open .sheet { transform: none; opacity: 1; }

.grabber {
  width: 34px;
  height: 5px;
  border-radius: 3px;
  background: var(--label-3);
  opacity: .55;
  margin: 8px auto 0;
  flex: none;
}

.sheet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 6px 14px 10px;
  flex: none;
}

.sheet-id { display: flex; align-items: center; gap: 10px; min-width: 0; }

.sheet-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 22.5%;
  object-fit: cover;
  background: var(--surface-3);
}

.sheet-titles { min-width: 0; }
.sheet-titles h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-titles p {
  margin: 1px 0 0;
  font-size: 11px;
  color: var(--label-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sheet-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.sheet-rating {
  display: none;
  align-items: center;
  gap: 5px;
  margin-right: 4px;
  font-size: 12px;
  color: var(--label-2);
}

.close-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fill);
  color: var(--label-2);
  transition: background .2s, color .2s;
}
.close-btn:hover { background: var(--surface-3); color: var(--label); }
.close-btn svg { width: 14px; height: 14px; }

.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--stage);
}

.stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  transition: opacity .45s var(--ease);
}
.stage.is-loaded iframe { opacity: 1; }

.stage-load {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: rgba(255, 255, 255, .62);
  transition: opacity .4s var(--ease), visibility .4s;
}
.stage.is-loaded .stage-load { opacity: 0; visibility: hidden; }

.spinner {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .18);
  border-top-color: var(--accent);
  animation: spin .9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.stage-load-text { font-size: 12px; letter-spacing: .04em; }

.stage-note {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 3;
  width: min(460px, calc(100% - 28px));
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  color: var(--label);
}
.note-title { margin: 0 0 4px; font-size: 14px; font-weight: 600; }
.note-body { margin: 0 0 12px; font-size: 12px; line-height: 1.6; color: var(--label-2); }
.note-actions { display: flex; align-items: center; gap: 16px; }
.note-actions button {
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 600;
}
.note-actions a { font-size: 12px; color: var(--accent); }

.sheet-info {
  flex: none;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px clamp(16px, 2vw, 22px) 14px;
  border-top: .5px solid var(--separator);
  color: var(--label-2);
  font-size: 12px;
  line-height: 1.5;
}
.sheet-info p { margin: 0; }
.sheet-info .info-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.sheet-info .info-desc { color: var(--label-2); }
.tag-row { display: flex; flex-wrap: wrap; gap: 5px; }
.tag-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--fill-2);
  color: var(--label-2);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.sheet-info .info-meta { flex: none; display: flex; flex-wrap: wrap; gap: 6px 18px; min-width: 0; }
.sheet-info .info-meta span { display: inline-flex; gap: 4px; }
.sheet-info .info-meta b { font-weight: 500; color: var(--label); }
.dev-link {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.dev-link:hover { text-decoration: underline; }

/* =========================
   MOTION / A11Y
   ========================= */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* =========================
   RESPONSIVE
   ========================= */
@media (min-width: 720px) {
  .chart-side { display: flex; }
  .sheet-rating { display: flex; }
}

@media (max-width: 860px) {
  .tabs { gap: 0; }
  .tab { padding: 0 9px; font-size: 12px; }
  .about-inner { grid-template-columns: 1fr; }
  .footer-inner { flex-wrap: wrap; }
  .footer-note { max-width: 100%; order: 3; flex-basis: 100%; }
}

@media (max-width: 640px) {
  .brand-text em { display: none; }
  .nav-actions { margin-left: auto; }

  .fab {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(56px + env(safe-area-inset-bottom) + 14px);
    height: 42px;
    padding: 0 15px 0 12px;
    font-size: 12px;
  }

  /* iOS-style bottom tab bar */
  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 95;
    margin: 0;
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(56px + env(safe-area-inset-bottom));
    justify-content: space-around;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: .5px solid var(--separator);
  }
  .tab {
    flex: 1;
    height: 56px;
    justify-content: center;
    border-radius: 0;
    font-size: 12px;
    padding: 0;
  }
  .tab.is-active { color: var(--accent); font-weight: 600; }
  .tab.is-active::after { display: none; }

  body { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
  .hero { aspect-ratio: 4 / 3.2; min-height: 380px; border-radius: var(--r-xl); }
  .hero-desc { -webkit-line-clamp: 3; font-size: 14px; }
  .hero-actions { margin-top: 18px; }
  .btn-light, .btn-glass { height: 42px; font-size: 14px; padding: 0 18px; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 12px; }
  .page-sub { font-size: 16px; }
  .rail-card { flex-basis: 168px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
  .card-name { font-size: 14px; }
  .card-meta { font-size: 11px; }
  .sheet-info .info-main { display: none; }
  .sheet-info { justify-content: space-between; }

  /* full-screen sheet on phones */
  .modal { padding: 0; }
  .sheet {
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
  }
  .sheet-info { padding-bottom: calc(14px + env(safe-area-inset-bottom)); }
}

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