/* BAZUGE — a chart board for games.
   A dim arcade: aubergine cabinet, coin gold for rank and the one action that matters (play),
   signal pink for what is new. Numbers and labels in a tall signage face; reading text in the
   visitor's own system font so every language looks native. One column, thumb-reachable. */

@font-face {
  font-family: "Shoulders";
  src: url("/fonts/display.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215;
}

:root {
  --bg: #14111d;
  --panel: #1d1929;
  --panel-2: #272236;
  --line: #383148;
  --ink: #f4f1ea;
  --muted: #a79fb8;
  --gold: #f6c544;      /* fills */
  --gold-ink: #f6c544;  /* gold used as text */
  --coin-ink: #241c0a;  /* text on gold */
  --pink: #ff5c8a;
  --up: #48d597;
  --down: #ff7a6b;
  --focus: #9cc2ff;
  --veil: rgba(10, 8, 16, 0.62);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --display: "Shoulders", "Arial Narrow", "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", sans-serif;
  --body: system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Segoe UI", Roboto, sans-serif;
  --gl: max(16px, env(safe-area-inset-left, 0px));
  --gr: max(16px, env(safe-area-inset-right, 0px));
  --top: calc(56px + env(safe-area-inset-top, 0px));
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f5f3f8;
    --panel: #ffffff;
    --panel-2: #ebe7f1;
    --line: #d6d0e0;
    --ink: #1b1726;
    --muted: #645c75;
    --gold: #f6c544;
    --gold-ink: #7a5600;
    --coin-ink: #241c0a;
    --pink: #d81e5b;
    --up: #0d8f5b;
    --down: #c9372c;
    --focus: #2456c9;
    --veil: rgba(27, 23, 38, 0.6);
    --shadow: 0 8px 24px rgba(40, 30, 70, 0.14);
    color-scheme: light;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top) + 60px); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.6 var(--body); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ic { width: 1.15em; height: 1.15em; flex: none; }
.muted { color: var(--muted); }

.skip { position: absolute; left: var(--gl); top: -60px; z-index: 50; padding: 8px 12px; background: var(--gold); color: var(--coin-ink); border-radius: 8px; font-weight: 700; }
.skip:focus { top: calc(8px + env(safe-area-inset-top, 0px)); }

/* a thin bar while the next view loads */
html.is-busy::before { content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 60; background: var(--gold); transform-origin: left; animation: busy 1.1s ease-in-out infinite; }
@keyframes busy { 0% { transform: scaleX(0.05); } 60% { transform: scaleX(0.75); } 100% { transform: scaleX(0.98); } }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: var(--top); padding: env(safe-area-inset-top, 0px) var(--gr) 0 var(--gl); background: color-mix(in srgb, var(--bg) 94%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 9px; font: 800 23px/1 var(--display); letter-spacing: 0.05em; text-transform: uppercase; white-space: nowrap; }
.brand b { color: var(--gold-ink); font-weight: 800; }
.mark { width: 28px; height: 28px; }
.links { display: none; gap: 2px; margin-left: 20px; }
.links a { display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 14px; }
.links a:hover { color: var(--ink); }
.links a[aria-current] { color: var(--ink); background: var(--panel-2); }
.tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.tool { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: transparent; font-size: 13px; font-weight: 600; }
.tool.install { border-color: var(--gold-ink); color: var(--gold-ink); }
.langsw { position: relative; }
.langsw summary { display: inline-flex; align-items: center; gap: 5px; height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; list-style: none; cursor: pointer; font: 700 15px/1 var(--display); letter-spacing: 0.06em; }
.langsw summary::-webkit-details-marker { display: none; }
.langmenu { position: absolute; right: 0; top: 42px; min-width: 150px; padding: 6px; display: grid; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.langmenu a { padding: 9px 12px; border-radius: 8px; font-size: 14px; }
.langmenu a:hover { background: var(--panel-2); }
.langmenu a[aria-current] { color: var(--gold-ink); font-weight: 700; }

.notice { position: fixed; left: 50%; bottom: calc(78px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 40; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; box-shadow: var(--shadow); text-align: center; }

#app { max-width: 880px; margin: 0 auto; padding: 0 var(--gr) calc(84px + env(safe-area-inset-bottom, 0px)) var(--gl); outline: none; }

/* ---------- bottom tabs (phones) ---------- */
.tabbar { position: fixed; inset: auto 0 0 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); background: color-mix(in srgb, var(--bg) 95%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 9px 4px 7px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tabbar a[aria-current] { color: var(--gold-ink); }
.tabbar .ic { width: 22px; height: 22px; }
@media (min-width: 760px) {
  .tabbar { display: none; }
  .links { display: flex; }
  #app { padding-bottom: 56px; }
  .notice { bottom: 24px; }
}

/* ---------- charts ---------- */
.head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px 0 10px; }
.head h1 { font-size: 17px; font-weight: 700; }
.updated { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sub { margin: 28px 0 4px; font-size: 13px; color: var(--muted); font-weight: 700; }

.wins { position: sticky; top: var(--top); z-index: 10; display: flex; gap: 4px; margin: 0 calc(-1 * var(--gr)) 0 calc(-1 * var(--gl)); padding: 6px var(--gr) 8px var(--gl); overflow-x: auto; scrollbar-width: none; background: var(--bg); }
.wins::-webkit-scrollbar { display: none; }
.wins a { flex: none; padding: 7px 14px; border-radius: 999px; font: 700 16px/1.25 var(--display); letter-spacing: 0.03em; color: var(--muted); white-space: nowrap; }
.wins a:hover { color: var(--ink); }
.wins a[aria-current] { background: var(--gold); color: var(--coin-ink); }

.filters { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 4px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 600; }
.chip .ic { width: 15px; height: 15px; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }

.chart { list-style: none; margin: 6px 0 0; padding: 0; }
.entry { position: relative; display: grid; grid-template-columns: 40px 108px minmax(0, 1fr); align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.entry.no-pos { grid-template-columns: 108px minmax(0, 1fr); }
.pos { display: grid; justify-items: center; gap: 3px; }
.pos .n { font: 800 32px/0.9 var(--display); font-variant-numeric: tabular-nums; }
.ranked .entry:nth-child(-n + 3):not(.is-first) .pos .n { color: var(--gold-ink); }
.mv { display: inline-flex; align-items: center; gap: 1px; font: 800 13px/1 var(--display); letter-spacing: 0.03em; font-variant-numeric: tabular-nums; }
.mv .ic { width: 10px; height: 10px; }
.mv.up { color: var(--up); }
.mv.down { color: var(--down); }
.mv.new { color: var(--pink); letter-spacing: 0.1em; }

.thumb { position: relative; display: block; aspect-ratio: 16 / 10; border-radius: 10px; overflow: hidden; background: var(--panel-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .ph { display: grid; place-items: center; width: 100%; height: 100%; font: 800 44px/1 var(--display); color: hsl(var(--h) 70% 88%); background: linear-gradient(135deg, hsl(var(--h) 46% 34%), hsl(calc(var(--h) + 48) 52% 20%)); }
.thumb .go { position: absolute; right: 6px; bottom: 6px; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--gold); color: var(--coin-ink); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.45); transition: transform 0.15s ease; }
.thumb .go .ic { width: 16px; height: 16px; margin-left: 2px; }
.thumb:hover .go { transform: scale(1.12); }

.meta { min-width: 0; }
.title { font-size: 15px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; overflow-wrap: anywhere; }
.title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.by { display: flex; align-items: baseline; gap: 8px; margin-top: 3px; color: var(--muted); font-size: 12.5px; }
.by .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.re { flex: none; color: var(--pink); font-size: 11px; font-weight: 700; }
.buzz { flex: none; margin-left: auto; display: inline-flex; align-items: baseline; gap: 4px; color: var(--ink); }
.buzz b { font: 800 19px/1 var(--display); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.buzz i { font: 700 10.5px/1 var(--display); font-style: normal; letter-spacing: 0.14em; color: var(--muted); }
.buzz .ic { width: 13px; height: 13px; align-self: center; color: var(--pink); fill: currentColor; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 7px; }
.lg { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--line); border-radius: 5px; font: 700 12.5px/1 var(--display); letter-spacing: 0.07em; color: var(--muted); }
.lg.me { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.lg.any { padding: 0 3px; border-color: transparent; color: var(--up); }
.lg.any .ic { width: 16px; height: 16px; }
.dv { display: inline-flex; align-items: center; color: var(--muted); }
.dv .ic { width: 16px; height: 16px; }
.dv.only { height: 20px; padding: 0 6px; border: 1px dashed var(--line); border-radius: 5px; font-size: 11px; font-weight: 600; }
.ai { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; background: var(--panel-2); color: var(--muted); font-size: 11.5px; font-weight: 600; }
.tags .dv:first-of-type { margin-left: 4px; }
.tags .ai { margin-left: 4px; }

/* the first row of a list gets the room a number one deserves */
.entry.is-first { grid-template-columns: minmax(0, 1fr); gap: 12px; padding: 10px 0 18px; }
.entry.is-first .thumb { aspect-ratio: 16 / 9; border-radius: 14px; }
.entry.is-first .title { font-size: 20px; line-height: 1.3; }
.entry.is-first .by { font-size: 13.5px; }
.entry.is-first .buzz b { font-size: 24px; }
.entry.is-first .go { width: 54px; height: 54px; right: 12px; bottom: 12px; }
.entry.is-first .go .ic { width: 26px; height: 26px; margin-left: 3px; }
.entry.is-first .pos { position: absolute; z-index: 2; top: 20px; left: 10px; display: flex; align-items: center; gap: 8px; }
.chart .entry.is-first .pos .n { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: var(--gold); color: var(--coin-ink); font-size: 30px; line-height: 1; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45); }
.entry.is-first .mv { padding: 5px 8px; border-radius: 999px; background: var(--veil); color: #fff; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.entry.is-first .mv.up { color: #7dedb9; }
.entry.is-first .mv.down { color: #ffa398; }
.entry.is-first .mv.new { color: #ff9dba; }
@media (min-width: 720px) {
  .entry { grid-template-columns: 52px 150px minmax(0, 1fr); gap: 16px; }
  .entry.no-pos { grid-template-columns: 150px minmax(0, 1fr); }
  .pos .n { font-size: 38px; }
  .title { font-size: 16.5px; }
  .entry.is-first { grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 22px; align-items: center; }
  .entry.is-first .title { font-size: 26px; -webkit-line-clamp: 3; }
}

.empty { display: grid; justify-items: center; gap: 14px; padding: 56px 8px; text-align: center; color: var(--muted); }
.empty.tall { padding-top: 96px; }
.empty h1 { color: var(--ink); font-size: 20px; }

.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; padding: 28px 0 8px; color: var(--muted); font-size: 12.5px; }
.foot a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: 11px; background: var(--panel); font-size: 15px; font-weight: 700; }
.btn:hover { border-color: var(--muted); }
.btn.primary { border-color: var(--gold); background: var(--gold); color: var(--coin-ink); }
.btn.primary:hover { filter: brightness(1.06); border-color: var(--gold); }
.btn.primary .ic { width: 1.3em; height: 1.3em; }
.btn.big { min-height: 54px; padding: 0 26px; font-size: 17px; }
.btn.save.is-on { border-color: var(--gold-ink); color: var(--gold-ink); }
.btn.save.is-on .ic { fill: currentColor; }

/* ---------- game page ---------- */
.game { display: grid; gap: 28px; padding-top: 6px; }
.backlink { justify-self: start; display: inline-flex; align-items: center; gap: 2px; min-height: 40px; margin-bottom: -18px; color: var(--muted); font-size: 14px; font-weight: 600; }
.backlink:hover { color: var(--ink); }
.hero { display: grid; gap: 16px; }
.hero .thumb { aspect-ratio: 16 / 9; border-radius: 14px; }
.hero .go { width: 60px; height: 60px; right: 14px; bottom: 14px; }
.hero .go .ic { width: 30px; height: 30px; margin-left: 3px; }
.hero h1 { font-size: clamp(22px, 5.2vw, 32px); line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.hero .by { margin-top: 6px; font-size: 14px; gap: 12px; }
.hero .by a { color: var(--ink); font-weight: 600; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
.desc { margin-top: 12px; max-width: 62ch; }
.cta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.cta .primary { flex: 1 1 180px; min-height: 52px; font-size: 17px; }
@media (min-width: 720px) {
  .hero { grid-template-columns: minmax(0, 430px) minmax(0, 1fr); gap: 26px; align-items: start; }
  .cta .primary { flex: 0 1 220px; }
}

.facts { margin: 0; border-top: 1px solid var(--line); }
.facts > div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: 13px; padding-top: 3px; }
.facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 0; min-width: 0; overflow-wrap: anywhere; }
.facts .lg { height: 26px; padding: 0 10px; border-radius: 7px; font: 600 13px/1 var(--body); letter-spacing: 0; color: var(--ink); }
.facts .lg.me { color: var(--bg); }
.facts .dv { gap: 5px; color: var(--ink); font-size: 14px; }
.facts .ai { height: 26px; padding: 0 10px; border-radius: 7px; font-size: 13px; color: var(--ink); }
.facts .note { flex-basis: 100%; color: var(--muted); font-size: 13px; }
.facts a { text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }

.sec h2 { margin-bottom: 12px; color: var(--muted); font-size: 13px; font-weight: 700; }
.rankchips { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.rankchips a { display: grid; gap: 5px; height: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.rankchips a:hover { border-color: var(--muted); }
.rankchips .w { color: var(--muted); font-size: 12px; font-weight: 600; }
.rankchips b { font: 800 28px/1 var(--display); letter-spacing: 0.01em; color: var(--gold-ink); }
.rankchips .pk { color: var(--muted); font-size: 11px; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 14px 16px; }
.stats li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 9px; align-items: center; }
.stats .ic { grid-row: span 2; width: 20px; height: 20px; color: var(--muted); }
.stats b { font: 800 24px/1.05 var(--display); letter-spacing: 0.01em; font-variant-numeric: tabular-nums; }
.stats span { color: var(--muted); font-size: 12px; }
.asof { margin-top: 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.tweet-embed { display: grid; justify-items: center; gap: 10px; }
.tweet-embed.is-ready > .btn { display: none; }
.tweet-embed > div { width: 100%; }

/* ---------- player ---------- */
html[data-route="play"] .top, html[data-route="play"] .tabbar { display: none; }
html[data-route="play"] #app { max-width: none; padding: 0; }
html[data-route="play"] .notice { bottom: 24px; }
.player { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr); background: #000; }
.pbar { display: flex; align-items: center; gap: 2px; padding: calc(6px + env(safe-area-inset-top, 0px)) max(8px, env(safe-area-inset-right, 0px)) 6px max(8px, env(safe-area-inset-left, 0px)); background: var(--bg); border-bottom: 1px solid var(--line); }
.pbtn, .pbar .save { flex: none; display: grid; place-items: center; width: 40px; min-height: 40px; height: 40px; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--ink); }
.pbtn:hover, .pbar .save:hover { background: var(--panel-2); }
.pbar .ic { width: 22px; height: 22px; }
.ptitle { flex: 1 1 auto; min-width: 0; display: grid; padding: 0 6px; line-height: 1.25; }
.ptitle b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ptitle span { color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pnext { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 40px; margin-left: 4px; padding: 0 12px 0 14px; border-radius: 10px; background: var(--gold); color: var(--coin-ink); font-size: 13.5px; font-weight: 800; white-space: nowrap; }
.pnext .ic { width: 18px; height: 18px; }
.stage { position: relative; background: #000; }
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: #000; }
.loading { position: absolute; inset: 0; display: grid; place-items: center; color: #b9b3c7; font-size: 14px; }
.launch { height: 100%; display: grid; place-content: center; justify-items: center; gap: 18px; padding: 24px; background: var(--bg); text-align: center; }
.launch .thumb { width: min(440px, 82vw); aspect-ratio: 16 / 9; border-radius: 14px; }
.launch p { color: var(--muted); }

/* ---------- text pages ---------- */
.prose { max-width: 66ch; padding-top: 22px; }
.prose h1 { font-size: 24px; margin-bottom: 8px; }
.prose h2 { margin: 30px 0 8px; font-size: 17px; }
.prose p { margin: 0 0 12px; }
.prose a { text-decoration: underline; text-underline-offset: 3px; }
.reqform { display: grid; gap: 6px; margin: 8px 0 28px; }
.reqform label { margin-top: 8px; color: var(--muted); font-size: 13px; }
.reqform input, .reqform select, .reqform textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink); font: inherit; }
.reqform textarea { resize: vertical; }
.reqform .btn { justify-self: start; margin-top: 12px; }
.reqform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.formnote { min-height: 1.6em; margin: 4px 0 0 !important; color: var(--muted); font-size: 13.5px; }
.formnote.bad { color: var(--pink); }
.prose .tip { margin-top: 28px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: 13.5px; }

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