/* Gamehub: a dark arcade launcher. Pixel font for the logo and game titles only;
   thin borders and soft shadows on the arcade; the Studio keeps its notched panels. */
:root {
  --bg: #07070d;
  --bg-2: #0d0e1a;
  --panel: #13152a;
  --panel-2: #1a1d36;
  --sunk: #0c0d1c;
  --line: #2b3056;
  --line-2: #3c4278;
  --ink: #eef0fb;
  --ink-2: #c0c5e4;
  --dim: #9097c2;
  --ok: #4fe08a;
  --bad: #ff6b6b;
  --warn: #ffbf47;
  --play: #ffd23f;
  --play-ink: #1b1400;
  --play-deep: #b8860b;
  --accent: #4cc9f0;
  --shadow: #000;
  --px: "Silkscreen", ui-monospace, "SF Mono", Menlo, monospace;
  --body: "Chakra Petch", system-ui, -apple-system, "Segoe UI", sans-serif;
  --n: 10px; /* notch size */
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* touch-action: no double-tap zoom on iPhone when tapping fast; pinch zoom still works. */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 500 16px/1.5 var(--body);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.px { font-family: var(--px); font-weight: 400; letter-spacing: .02em; }
[hidden] { display: none !important; }

/* ---------- sky: pixel stars ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bg);
}
.sky::before, .sky::after {
  content: ""; position: absolute; left: 0; top: 0; width: 2px; height: 2px; background: transparent;
  box-shadow:
    23px 41px #9aa3d9, 141px 88px #5a6299, 260px 22px #c9cff5, 377px 140px #5a6299, 512px 61px #9aa3d9,
    633px 181px #c9cff5, 740px 37px #5a6299, 881px 120px #9aa3d9, 1012px 70px #c9cff5, 1170px 152px #5a6299,
    1290px 30px #9aa3d9, 1405px 210px #5a6299, 66px 260px #5a6299, 210px 330px #9aa3d9, 333px 402px #5a6299,
    470px 300px #c9cff5, 590px 420px #5a6299, 701px 350px #9aa3d9, 822px 470px #5a6299, 960px 380px #c9cff5,
    1101px 455px #5a6299, 1240px 330px #9aa3d9, 1380px 500px #5a6299, 120px 560px #9aa3d9, 300px 640px #5a6299,
    450px 590px #c9cff5, 655px 690px #5a6299, 790px 610px #9aa3d9, 930px 720px #5a6299, 1060px 640px #9aa3d9,
    1210px 760px #5a6299, 1350px 680px #c9cff5, 40px 820px #5a6299, 260px 900px #9aa3d9, 520px 860px #5a6299,
    760px 950px #9aa3d9, 1000px 880px #5a6299, 1300px 960px #9aa3d9;
}
.sky::after { transform: translate(37px, 19px); opacity: .55; animation: twinkle 3.2s steps(2) infinite; }
@keyframes twinkle { 50% { opacity: .15; } }

/* ---------- notched frames ---------- */
.frame, .inner, .btn, .chip, .online, .tabs a {
  --nn: var(--n);
  clip-path: polygon(var(--nn) 0, calc(100% - var(--nn)) 0, 100% var(--nn), 100% calc(100% - var(--nn)),
    calc(100% - var(--nn)) 100%, var(--nn) 100%, 0 calc(100% - var(--nn)), 0 var(--nn));
}
.frame { padding: 2px; background: var(--line-2); }
.inner { --nn: calc(var(--n) - 1px); background: var(--panel); height: 100%; }
.drop { filter: drop-shadow(4px 4px 0 var(--shadow)); }

/* ---------- top bar ---------- */
.skip { position: absolute; left: -999px; top: 8px; z-index: 10; background: var(--play); color: var(--play-ink); padding: 8px 12px; font-weight: 700; border-radius: 6px; }
.skip:focus { left: 8px; }
.top { position: sticky; top: 0; z-index: 5; background: rgba(7, 7, 13, .92); border-bottom: 1px solid var(--line); backdrop-filter: blur(6px); }
.top-row { display: flex; align-items: center; gap: 12px; min-height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand-mark { width: 27px; height: 20px; fill: var(--play); }
.brand-word { font: 700 18px/1 var(--px); letter-spacing: .06em; }
.tabs { display: flex; gap: 4px; margin-left: auto; }
.tabs a {
  --nn: 0px; clip-path: none; border-radius: 8px; font: 600 13px/1 var(--body); letter-spacing: .02em; text-decoration: none; color: var(--ink-2);
  padding: 0 14px; min-height: 40px; display: inline-flex; align-items: center;
}
.tabs a:hover { background: var(--panel); }
.tabs a[aria-current="page"] { background: var(--panel-2); color: var(--ink); }
.online {
  clip-path: none; border-radius: 999px; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  background: var(--sunk); border: 1px solid var(--line); font: 600 12px/1 var(--body); color: var(--ink-2); white-space: nowrap;
}
.tabs:not([hidden]) + .online { margin-left: 0; }
.acct {
  flex: 0 1 auto; min-width: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; max-width: 46vw; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-2); color: var(--ink); text-decoration: none; font: 600 13px/1 var(--body); white-space: nowrap;
}
.acct:hover { background: var(--panel); }
.acct .who-n { overflow: hidden; text-overflow: ellipsis; }
.acct .who-a { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--bg); font-size: 10px; font-weight: 700; text-transform: uppercase; }
/* phones: the pill drops its word " online" (kept for screen readers) so the chip fits on the brand row */
.online .lbl { position: static; }
@media (max-width: 480px) {
  .online .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .top-row { gap: 8px; }
  .acct { max-width: 30vw; padding: 0 10px; }
  .online { margin-left: auto; }
  .online + .acct { margin-left: 0; }
}
@media (max-width: 360px) { .acct .who-n { display: none; } .acct:has(.who-a) { padding: 0 8px; } .top-row { gap: 6px; } .brand { gap: 6px; } .brand-word { font-size: 15px; letter-spacing: .03em; } .brand-mark { width: 22px; height: 16px; } .online, .acct { padding-left: 8px; padding-right: 8px; } .online { gap: 5px; } }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--dim); flex: none; }
.online.is-ok .led { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 224, 138, .2); }
.online.is-bad .led { background: var(--warn); }

/* ---------- hero ---------- */
.hero { padding: 22px 0 4px; }
.kicker { margin: 0 0 6px; font: 600 12px/1.2 var(--body); letter-spacing: .08em; color: var(--play); text-transform: uppercase; }
.hero-title { margin: 0; font-size: clamp(24px, 7vw, 40px); line-height: 1.08; letter-spacing: 0; }
.hero-title span { color: var(--play); }
.hero-sub { margin: 8px 0 0; max-width: 40em; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.hero-sub .more { display: none; }
@media (min-width: 640px) {
  .hero { padding: 22px 0 0; }
  .hero-title br { display: none; }
  .hero-title span { margin-left: .5em; }
  .hero-sub .more { display: inline; }
}

/* ---------- rails ---------- */
.rail { display: flex; align-items: center; gap: 12px; margin: 28px 0 14px; font: 600 12px/1.2 var(--body); letter-spacing: .08em; color: var(--ink-2); text-transform: uppercase; }
.rail::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- continue playing ---------- */
.shelf { margin: 14px 0 6px; }
.shelf .rail { margin: 0 0 10px; }
.resume-list { display: grid; gap: 8px; grid-template-columns: 1fr; }
.card.resume { grid-template-columns: 56px minmax(0, 1fr) auto; min-height: 68px; }
.card.resume .art { width: 56px; height: 56px; margin: 0; aspect-ratio: auto; border-radius: 8px; grid-column: auto; }
.card.resume .info { display: flex; padding: 0; }
.card.resume .info > * { padding: 0; grid-column: auto; }
.card.resume .acts { padding: 0; align-self: center; grid-column: auto; grid-row: auto; flex-direction: column; }
.card.resume .btn { min-height: 44px; min-width: 72px; }
.resume-prog { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-when { margin: 0; color: var(--dim); font-size: 11px; line-height: 1.3; }
@media (min-width: 640px) {
  .resume-list { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .card.resume { grid-template-columns: 56px minmax(0, 1fr) auto; padding: 6px 8px 6px 6px; gap: 0 10px; overflow: visible; }
  .card.resume::before { left: 0; right: auto; top: 14px; bottom: 14px; width: 3px; height: auto; border-radius: 0 3px 3px 0; }
}
@media (min-width: 900px) { .resume-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 359px) { .card.resume { grid-template-columns: 48px minmax(0, 1fr) auto; } .card.resume .art { width: 48px; height: 48px; } }

/* ---------- today boards ---------- */
.today-list { display: grid; gap: 8px; grid-template-columns: 1fr; }
.today-g { --accent: #4cc9f0; position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px 0 14px; }
.today-g::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.today-g > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 10px; border-radius: 8px; }
.today-g > summary::-webkit-details-marker { display: none; }
.today-g > summary::after { content: "\25B8"; margin-left: auto; color: var(--dim); flex: none; }
.today-g[open] > summary::after { content: "\25BE"; }
.today-g > summary:focus-visible { outline: 3px solid var(--play); outline-offset: 2px; }
.tg-t { font: 700 12px/1.2 var(--px); flex: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tg-lead { color: var(--ink-2); font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.today-g[open] .tg-lead { display: none; }
.tb { padding: 0 0 12px; }
.tb h4 { margin: 0 0 6px; font: 600 12px/1.3 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.tb ol { list-style: none; margin: 0; padding: 0; }
.tb li { display: flex; gap: 8px; align-items: baseline; padding: 3px 0; font-size: 14px; border-bottom: 1px solid var(--line); }
.tb li.me { color: var(--play); font-weight: 600; }
.tb .rk { flex: none; width: 1.4em; color: var(--dim); font-variant-numeric: tabular-nums; }
.tb .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb .sc { flex: none; font-variant-numeric: tabular-nums; }
.tb .mine, .tb .none { margin: 8px 0 0; font-size: 13px; color: var(--ink-2); }
.tb .mine b { color: var(--play); }
@media (min-width: 640px) { .today-list { grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start; } }
@media (min-width: 900px) { .today-list { grid-template-columns: repeat(3, 1fr); } }

/* ---------- shelf sections ---------- */
.shelf-sec { margin: 22px 0 0; }
.shelf-sec > .rail { margin: 0 0 10px; }
details.testing > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; border-radius: 8px; }
details.testing > summary::-webkit-details-marker { display: none; }
details.testing > summary .rail { flex: 1; margin: 0; }
details.testing > summary .rail::before { content: "\25B8"; font-size: 14px; }
details.testing[open] > summary .rail::before { content: "\25BE"; }
details.testing > summary .n { font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }
details.testing > summary:focus-visible { outline: 3px solid var(--play); outline-offset: 2px; }
details.testing[open] > summary { margin-bottom: 10px; }

/* ---------- cards: one grid ---------- */
.grid { display: grid; gap: 8px; grid-template-columns: 1fr; }
.card {
  position: relative; --accent: #4cc9f0; display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 0 10px; align-items: center;
  padding: 6px 8px 6px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25); transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--line-2); }
.card::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.art {
  position: relative; width: 72px; height: 72px; border-radius: 8px; background: var(--sunk); overflow: hidden;
}
.art img, .art svg { width: 100%; height: 100%; object-fit: cover; }
.art svg { image-rendering: pixelated; }
.art .glyph {
  position: absolute; inset: auto 0 6px 0; text-align: center; font: 700 15px/1 var(--px); color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000;
}
.art.is-icon { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, var(--sunk)); }
.art.is-icon img { width: 100%; height: 100%; }
.info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.game-kicker { font: 600 11px/1.2 var(--body); letter-spacing: .06em; text-transform: uppercase; color: var(--accent); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.game-title { margin: 0; font: 700 13px/1.2 var(--px); letter-spacing: 0; overflow-wrap: anywhere; }
.tagline { margin: 1px 0 0; color: var(--ink-2); font-size: 13px; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.meta-row { display: flex; gap: 6px; align-items: center; margin-top: 3px; flex-wrap: wrap; }
.acts { display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.card.is-down .art img, .card.is-down .art svg { filter: grayscale(1) brightness(.55); }
.card.is-down .game-title { color: var(--ink-2); }

.chip {
  clip-path: none; display: inline-flex; align-items: center; gap: 5px; padding: 0; background: none; color: var(--dim);
  font: 600 11px/1 var(--body); letter-spacing: .02em; text-decoration: none;
}
.chip .led { width: 6px; height: 6px; }
.chip.up { color: var(--ok); } .chip.up .led { background: var(--ok); }
.chip.down { color: var(--bad); } .chip.down .led { background: var(--bad); }
.chip.unknown { color: var(--warn); } .chip.unknown .led { background: var(--warn); }
.chip.ver { color: var(--dim); font-variant-numeric: tabular-nums; }
a.chip.ver:hover { color: var(--ink); text-decoration: underline; }
.badges { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  clip-path: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 38px; min-width: 72px; padding: 0 14px; border: 0; border-radius: 8px; cursor: pointer; text-decoration: none;
  font: 600 14px/1 var(--body); letter-spacing: .02em;
  background: var(--play); color: var(--play-ink); transition: background .12s, transform .06s;
}
.btn .tri { width: 0; height: 0; border-left: 9px solid currentColor; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.btn:hover { background: #ffe066; }
.btn:active { transform: translateY(1px); }
.btn-guide { background: transparent; color: var(--ink-2); border: 1px solid var(--line-2); min-height: 32px; font-size: 12px; font-weight: 600; padding: 0 12px; }
.btn-guide:hover { background: var(--panel-2); color: var(--ink); }
.btn[aria-disabled="true"] { background: var(--panel-2); color: var(--dim); cursor: not-allowed; font-size: 13px; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--play); outline-offset: 2px; }

@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) {
  .card { grid-template-columns: 1fr auto; grid-template-rows: auto; padding: 0; gap: 0; align-items: center; overflow: hidden; align-content: start; }
  .card::before { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0; z-index: 1; }
  .art { grid-column: 1 / -1; width: 100%; height: auto; aspect-ratio: 3 / 1; border-radius: 0; margin-bottom: 8px; }
  .art.is-icon img { width: auto; height: 100%; aspect-ratio: 1; }
  .art .glyph { font-size: 18px; inset: auto 0 50% 0; transform: translateY(50%); }
  .info { display: contents; }
  .info > * { grid-column: 1 / -1; padding: 0 14px; }
  .game-title { font-size: 15px; }
  .tagline { margin-top: 3px; }
  .meta-row { grid-column: 1; grid-row: 5; padding: 0 0 0 14px; align-self: center; flex-direction: column; align-items: flex-start; gap: 4px; }
  .acts { grid-column: 2; grid-row: 5; flex-direction: row-reverse; align-items: center; padding: 6px 12px 12px 6px; align-self: end; }
  .btn-guide { min-height: 36px; }
}
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 359px) {
  .card { grid-template-columns: 60px minmax(0, 1fr) auto; gap: 0 8px; }
  .art { width: 60px; height: 60px; }
  .btn { min-width: 64px; padding: 0 12px; }
}

.skeleton { pointer-events: none; }
.skeleton .art { background: repeating-linear-gradient(45deg, var(--panel-2) 0 8px, var(--panel) 8px 16px); }
.sk-line { height: 12px; border-radius: 4px; background: var(--panel-2); width: 70%; margin: 3px 0; }
.sk-line.short { width: 40%; }
.sk-btn { width: 76px; height: 40px; border-radius: 8px; background: var(--panel-2); }
.empty-grid { grid-column: 1 / -1; color: var(--dim); padding: 20px 0; }
.err { margin-top: 16px; padding: 14px 16px; background: #2a0f16; color: #ffc2c2; border: 1px solid var(--bad); border-radius: 10px; font-size: 14px; }
.fineprint { margin: 22px 0 0; color: var(--dim); font-size: 13px; max-width: 46em; }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 32px; margin-top: 24px; border-top: 1px solid var(--line); color: var(--dim); font-size: 12px; }
.foot a { color: var(--ink-2); }

/* ---------- Studio ---------- */
.who { color: var(--ink-2); font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.who b { color: var(--ink); font-weight: 600; }
.who a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); }


.chart { width: 100%; height: auto; overflow: visible; display: block; }
.chart text { font-family: var(--body); font-size: 11px; fill: var(--dim); }
.chart .axis { stroke: var(--line-2); stroke-width: 1; }
.chart .grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 2 3; }
.chart .bar { fill: var(--accent); }
.chart .bar.zero { fill: var(--line-2); }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover + .bar, .chart .bar.on { fill: #fff; }
.chart .label { fill: var(--ink); font-weight: 600; }

.funnel { display: grid; gap: 8px; }
.f-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; align-items: baseline; }
.f-lab { font-size: 13.5px; color: var(--ink); overflow-wrap: anywhere; }
.f-val { font: 600 13px/1 var(--body); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.f-val b { color: var(--ink); font-weight: 700; }
.f-track { grid-column: 1 / -1; height: 12px; background: var(--sunk); position: relative; }
.f-fill { height: 100%; background: var(--accent); min-width: 2px; }
.f-row.zero .f-fill { background: var(--line-2); }
.f-split { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; color: var(--ink-2); }
.f-split b { color: var(--ink); }

.tbl-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.t th { text-align: left; font: 400 10px/1.2 var(--px); text-transform: uppercase; color: var(--ink-2); padding: 6px 8px; border-bottom: 2px solid var(--line-2); white-space: nowrap; }
.t td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t td.num, .t th.num { text-align: right; white-space: nowrap; }
.t code { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.t .cell { display: inline-block; min-width: 50px; padding: 4px 4px; text-align: center; font-weight: 600; }
.t .at { display: block; color: var(--dim); font-size: 12px; margin-top: 2px; }
.t td.nowrap { white-space: nowrap; }
.t .cell.na { color: var(--dim); font-weight: 400; }
.dim { color: var(--dim); }

.new-list { display: grid; gap: 10px; }
@media (min-width: 760px) { .new-list { grid-template-columns: 1fr 1fr; } }
.new-ev { background: var(--sunk); padding: 12px; border-left: 4px solid var(--warn); min-width: 0; }
.new-ev .nm { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.new-ev code { font: 600 14px/1.3 ui-monospace, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; }
.new-ev .cnt { font-size: 12.5px; color: var(--ink-2); }
.new-ev ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; color: var(--ink-2); }
.new-ev li span { color: var(--ink); }
.badge-new { font: 400 10px/1 var(--px); background: var(--warn); color: #1b1100; padding: 4px 6px; margin-left: 8px; vertical-align: 2px; }

details.raw { margin-top: 10px; font-size: 13px; color: var(--ink-2); }
details.raw summary { cursor: pointer; min-height: 44px; display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font: 400 11px/1 var(--px); text-transform: uppercase; list-style: none; }
details.raw summary::-webkit-details-marker { display: none; }
details.raw summary::before { content: ""; width: 0; height: 0; border-left: 6px solid var(--accent); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
details.raw[open] summary::before { transform: rotate(90deg); }
.notes { margin: 18px 0 0; padding: 0; list-style: none; color: var(--dim); font-size: 12.5px; display: grid; gap: 4px; }
.notes li::before { content: "■ "; color: var(--line-2); }
.loading { padding: 30px 0; color: var(--ink-2); font: 400 13px/1 var(--px); text-transform: uppercase; }
.loading::after { content: "_"; animation: blink 1s steps(2) infinite; }

.tip {
  position: fixed; z-index: 20; pointer-events: none; background: var(--ink); color: var(--bg);
  padding: 6px 8px; font-size: 12.5px; font-weight: 600; line-height: 1.3; max-width: 220px;
  box-shadow: 3px 3px 0 #000;
}

/* ---------- invite pages ---------- */
body.bare { display: grid; place-items: center; padding: 24px 16px; }
.notice { max-width: 420px; background: var(--panel); padding: 28px 22px; border: 2px solid var(--line-2); box-shadow: 5px 5px 0 #000; }
.notice h1 { margin: 0 0 10px; font-size: 26px; }
.notice p { color: var(--ink-2); margin: 0 0 18px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .frame, .inner, .btn, .chip { border: 1px solid CanvasText; }
  .chart .bar, .f-fill { fill: CanvasText; background: CanvasText; }
}

/* ---------- header on phones: tabs get their own row ---------- */
@media (max-width: 599px) {
  .top-row { flex-wrap: wrap; row-gap: 0; }
  .top { position: static; }
  .tabs:not([hidden]) { order: 3; width: 100%; margin: 0 0 8px; }
  .tabs a { flex: 1; justify-content: center; }
  .tabs:not([hidden]) + .online { margin-left: auto; }
}
@media (max-width: 359px) {
  .brand-word { font-size: 16px; }
  .online { padding: 6px 10px; }
}

/* ---------- Studio banner ---------- */
  clip-path: polygon(var(--nn) 0, calc(100% - var(--nn)) 0, 100% var(--nn), 100% calc(100% - var(--nn)), calc(100% - var(--nn)) 100%, var(--nn) 100%, 0 calc(100% - var(--nn)), 0 var(--nn)); }

/* ---------- Studio v2 ---------- */
@media (min-width: 600px) { #studio .rail { scroll-margin-top: 130px; } }
.sub-h { margin: 16px 0 8px; font-size: 11px; color: var(--ink-2); text-transform: uppercase; }
ul.kv { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 13.5px; color: var(--ink-2); }
ul.kv .px { font-size: 11px; color: var(--accent); text-transform: uppercase; margin-right: 6px; }
ul.kv b { color: var(--ink); font-weight: 600; }
.mini3 { display: grid; gap: 4px 18px; }
@media (min-width: 760px) { .mini3 { grid-template-columns: repeat(3, 1fr); } }
.mini .funnel { gap: 4px; }
.mini .f-track { height: 8px; }
.mini .f-lab, .mini .f-val { font-size: 12.5px; }
.t .cell.mag { background: var(--sunk); color: var(--ink); border: 1px solid var(--line-2); font-weight: 600; min-width: 48px; }
.nowrap { white-space: nowrap; }
.mini .chart text { font-size: 10px; }
.err-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.err-list li { background: var(--sunk); padding: 10px 12px; border-left: 4px solid var(--bad); min-width: 0; }
.err-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.err-head code { font: 600 13.5px/1.35 ui-monospace, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; flex: 1 1 12em; }
.err-n { font: 700 15px/1 var(--body); color: var(--ink); margin-left: auto; }
.err-meta { margin-top: 6px; font-size: 12.5px; color: var(--dim); overflow-wrap: anywhere; }
.err-meta b { color: var(--ink-2); font-weight: 600; }
.err-meta code { font-size: 12px; color: var(--ink-2); }
@media (max-width: 420px) {
  .t { font-size: 13px; }
  .t th, .t td { padding: 6px 4px; }
  .t th { white-space: normal; font-size: 9.5px; }
  .t .cell { min-width: 42px; padding: 3px 2px; font-size: 12.5px; }
  .t code { font-size: 12px; }
}

/* ---------- Studio: calm layout (tabs, one sticky bar, thin panels) ---------- */
#studio { --st-gap: 20px; --st-top: 0px; font-family: var(--body); }
@media (min-width: 600px) { #studio { --st-top: 62px; } } /* the site header is sticky from 600px up */
.st-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.studio-head { display: flex; align-items: center; justify-content: space-between; gap: 2px 12px; flex-wrap: wrap; padding: 14px 0 4px; }
.st-title { margin: 0; font: 700 22px/1.2 var(--body); letter-spacing: .01em; }
.st-private { margin-left: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--dim); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 6px; vertical-align: middle; }
.who { color: var(--ink-2); font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.who b { color: var(--ink); font-weight: 600; }
.who a { min-height: 44px; display: inline-flex; align-items: center; color: var(--ink); }
.meta { color: var(--dim); font-size: 12.5px; margin: 10px 0 0; }
.meta b { color: var(--ink-2); font-weight: 600; }

/* the one sticky control bar: game, window, tabs */
.st-bar { position: sticky; top: var(--st-top); z-index: 4; margin: 6px -16px 0; padding: 8px 16px 0; background: rgba(7, 7, 13, .96); border-bottom: 1px solid var(--line); }
.st-bar[hidden] { display: none; }
.st-row { display: flex; gap: 8px; align-items: center; }
.st-game { position: relative; flex: 1 1 auto; min-width: 0; max-width: 340px; display: block; }
.st-game::before { content: ""; position: absolute; left: 12px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--accent); pointer-events: none; }
.st-game select {
  width: 100%; min-height: 44px; padding: 0 34px 0 28px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel) no-repeat right 12px center / 10px 6px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23c0c5e4' stroke-width='1.6'/%3E%3C/svg%3E");
  color: var(--ink); font: 600 14px/1 var(--body); appearance: none; -webkit-appearance: none; cursor: pointer; text-overflow: ellipsis;
}
.st-seg { display: flex; flex: none; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; }
.st-seg button { min-height: 42px; min-width: 46px; padding: 0 10px; border: 0; border-left: 1px solid var(--line); background: var(--panel); color: var(--ink-2); font: 600 13px/1 var(--body); cursor: pointer; }
.st-seg button:first-child { border-left: 0; }
.st-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.st-tabs { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; margin: 4px -16px 0; padding: 0 16px; }
.st-tabs::-webkit-scrollbar { display: none; }
.st-tabs button { flex: none; min-height: 44px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim); font: 600 14px/1 var(--body); cursor: pointer; }
.st-tabs button:hover { color: var(--ink); }
.st-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
@media (min-width: 760px) {
  .st-bar { display: flex; align-items: flex-end; gap: 16px; padding-top: 6px; }
  .st-row { flex: none; padding-bottom: 5px; }
  .st-game { width: 240px; flex: none; }
  .st-tabs { margin: 0; padding: 0; flex: 1; }
}
#studio :focus-visible { outline: 2px solid var(--play); outline-offset: 2px; }

/* slim game title row */
.st-banner { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin-top: var(--st-gap); min-height: 32px; }
.st-thumb, .st-banner svg { width: 28px; height: 28px; flex: none; border-radius: 6px; object-fit: cover; }
.st-dot { width: 10px; height: 10px; flex: none; border-radius: 50%; background: var(--accent); }
.st-gt { margin: 0; font: 700 18px/1.2 var(--body); }
.st-kick { color: var(--dim); font-size: 13px; }
.st-badges { display: inline-flex; gap: 6px; align-items: center; margin-left: auto; }
.st-badges .chip { position: static; }

.flag { margin-top: 14px; padding: 10px 12px; background: #2b1d05; border: 1px solid var(--warn); border-radius: 6px; color: #ffe2a8; font-size: 13.5px; }
.flag b { color: #fff; }

/* tiles: 2 across on a phone, 4 on desktop */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, 1fr); gap: 12px; } }
.tile { position: relative; min-width: 0; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; }
.tile::before { content: ""; position: absolute; left: -1px; top: 8px; bottom: 8px; width: 3px; border-radius: 2px; background: var(--accent); }
.tile .lab { font: 600 11px/1.2 var(--body); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.tile .val { font: 700 24px/1.1 var(--body); margin-top: 4px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tile .val small { font: 600 13px/1 var(--body); color: var(--ink-2); margin-left: 3px; }
.tile .sub { font-size: 11.5px; color: var(--dim); margin-top: 2px; line-height: 1.3; }
.tile .val.none { color: var(--dim); }

/* panels: 2 columns on desktop, 1 on a phone */
.st-grid { display: grid; grid-auto-flow: dense; gap: var(--st-gap); margin-top: var(--st-gap); }
.st-grid:first-child { margin-top: 14px; }
@media (min-width: 900px) { .st-grid { grid-template-columns: 1fr 1fr; } .span2, .st-wide { grid-column: 1 / -1; } }
.panel { min-width: 0; padding: 12px 14px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.st-ph { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel h3 { margin: 0; font: 700 14px/1.25 var(--body); letter-spacing: .01em; }
.panel .how { margin: 4px 0 8px; color: var(--dim); font-size: 12.5px; line-height: 1.4; }
.panel .empty { color: var(--dim); font-size: 14px; padding: 10px 0 4px; margin: 0; }
.st-info { flex: none; position: relative; width: 20px; height: 20px; padding: 0; border: 1px solid var(--line-2); border-radius: 50%; background: none; color: var(--ink-2); font: italic 700 12px/1 Georgia, serif; cursor: pointer; }
.st-info::after { content: ""; position: absolute; inset: -12px; } /* a 44px touch target around the 20px mark */
.st-info:hover, .st-info[aria-expanded="true"] { color: var(--bg); background: var(--ink); border-color: var(--ink); }
.tip.st-how { max-width: min(340px, calc(100vw - 16px)); font-weight: 400; font-size: 12.5px; line-height: 1.45; padding: 8px 10px; border-radius: 6px; box-shadow: 0 2px 10px rgba(0, 0, 0, .5); }
.tip.st-how code { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: rgba(0, 0, 0, .12); padding: 0 3px; }
.tip.st-how .cell { display: inline-block; min-width: 16px; text-align: center; }
.st-lead { margin: 0 0 6px; font-size: 13px; color: var(--ink-2); }
.st-lead b, .st-sentence b { color: var(--ink); }
.st-note { margin: 8px 0 0; font-size: 12.5px; color: var(--dim); line-height: 1.4; }
.st-sentence { margin: 0 0 6px; font-size: 14px; line-height: 1.4; color: var(--ink-2); }
.st-sentence.bad b { color: var(--bad); }
.st-foot { margin: 8px 0 0; }
.st-link { color: var(--ink); font-size: 13px; font-weight: 600; text-decoration: none; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.st-link:hover { border-bottom-color: var(--accent); color: var(--accent); }
.st-glance { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.st-glance li { padding: 10px 0; border-top: 1px solid var(--line); }
.st-glance li:first-child { padding-top: 0; border-top: 0; }
.st-gl-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; font: 600 11px/1.2 var(--body); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); }
.st-glance .f-track { height: 6px; border-radius: 3px; overflow: hidden; }

/* long lists: the first rows, then "Show all (N)" */
.st-fold[data-folded="1"] [data-x] { display: none; }
.st-more { margin-top: 6px; min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--ink-2); font: 600 13px/1 var(--body); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.st-more:hover { color: var(--ink); }

/* inside panels, calmer */
.panel .f-track { height: 8px; border-radius: 4px; overflow: hidden; }
.funnel { gap: 7px; }
.t th { font: 600 11px/1.2 var(--body); letter-spacing: .04em; border-bottom-width: 1px; }
.panel .sub-h { font: 600 11px/1.2 var(--body); letter-spacing: .05em; margin: 12px 0 6px; }
details.raw summary { font: 600 12px/1 var(--body); letter-spacing: .03em; }
.new-ev, .err-list li { border-radius: 6px; }
#studio .notes { margin-top: 0; }
.loading { font: 600 13px/1 var(--body); }

/* ---------- players ---------- */
.players-link {
  display: none; align-items: center; min-height: 44px; padding: 0 14px; margin-left: auto; border-radius: 8px; text-decoration: none;
  color: var(--ink-2); font: 600 13px/1 var(--body); letter-spacing: .02em;
}
.players-link:hover { background: var(--panel); }
.players-link[aria-current="page"] { background: var(--panel-2); color: var(--ink); }
.players-link:focus-visible, .pl-hero:focus-visible, .pl-back:focus-visible, .pl-chip:focus-visible, .pl-seg button:focus-visible, .pl-row:focus-visible, .pl-x:focus-visible, .pl-retry:focus-visible { outline: 3px solid var(--play); outline-offset: 2px; }
@media (min-width: 481px) { .players-link { display: inline-flex; } .players-link + .tabs, .players-link + .online { margin-left: 0; } .pl-hero { display: none !important; } }
.pl-hero { display: inline-flex; align-items: center; min-height: 44px; margin-top: 12px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink); text-decoration: none; font: 600 14px/1 var(--body); }
.pl-hero:hover { background: var(--panel); }
.pl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; margin: 18px 0 4px; }
.pl-head .st-title { margin: 0; }
.pl-back { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-2); text-decoration: none; font: 600 14px/1 var(--body); padding-right: 6px; }
.pl-back:hover { color: var(--ink); }
.pl-sub { margin: 0 0 12px; color: var(--ink-2); font-size: 14px; line-height: 1.45; max-width: 44em; }
.pl-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.pl-chip { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: 999px; background: var(--panel); color: var(--ink-2); text-decoration: none; font: 600 13px/1 var(--body); white-space: nowrap; }
.pl-chip:hover { background: var(--panel-2); }
.pl-chip[aria-current="page"] { background: var(--play); border-color: var(--play); color: var(--play-ink); }
.pl-chip .n { font-size: 11px; padding: 3px 6px; border-radius: 999px; background: var(--sunk); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pl-chip[aria-current="page"] .n { background: rgba(27, 20, 0, .18); color: var(--play-ink); }
#pl-body { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 760px) { #pl-body { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; } }
.pl-card { --accent: #4cc9f0; position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px 10px 14px; min-width: 0; }
.pl-card::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.pl-ch { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.pl-ch h2 { margin: 0; font: 600 13px/1.3 var(--body); letter-spacing: .04em; text-transform: uppercase; color: var(--accent); min-width: 0; overflow-wrap: anywhere; }
.pl-per { color: var(--dim); font-size: 12px; }
.pl-seg { display: flex; flex: none; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.pl-seg button { min-height: 44px; min-width: 44px; padding: 0 12px; border: 0; border-left: 1px solid var(--line); background: var(--sunk); color: var(--ink-2); font: 600 13px/1 var(--body); cursor: pointer; }
.pl-seg button:first-child { border-left: 0; }
.pl-seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pl-list { list-style: none; margin: 0; padding: 0; }
.pl-list li { border-bottom: 1px solid var(--line); }
.pl-list li:last-child { border-bottom: 0; }
.pl-row { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 44px; padding: 2px 4px; margin: 0; border: 0; border-radius: 8px; background: none; color: var(--ink); font: 500 14px/1.2 var(--body); text-align: left; }
button.pl-row { cursor: pointer; }
button.pl-row:hover { background: var(--panel-2); }
.pl-row.me { color: var(--play); font-weight: 600; }
.pl-row .rk { flex: none; width: 1.7em; color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.pl-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-row .you { color: var(--ink-2); font-weight: 500; }
.pl-row .sc { flex: none; font-variant-numeric: tabular-nums; }
.pl-av { flex: none; display: block; width: 32px; height: 32px; image-rendering: pixelated; background: var(--sunk); border-radius: 6px; }
.pl-av.fb { display: grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; font-family: var(--body); }
.pl-empty { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 6px 0 4px; }
.pl-empty p, .pl-msg p { margin: 0; color: var(--ink-2); font-size: 14px; flex: 1 1 14em; }
.pl-empty .pl-play { min-height: 44px; flex: none; }
.pl-msg { padding: 8px 0; color: var(--ink-2); font-size: 14px; grid-column: 1 / -1; }
.pl-retry { min-height: 44px; margin-top: 8px; padding: 0 16px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--panel); color: var(--ink); font: 600 13px/1 var(--body); cursor: pointer; }
/* profile sheet */
.pl-sheet { padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--panel); color: var(--ink); width: min(440px, calc(100vw - 24px)); max-height: min(86vh, 86dvh); overflow-y: auto; box-shadow: 6px 6px 0 #000; overscroll-behavior: contain; }
.pl-sheet::backdrop { background: rgba(3, 3, 8, .72); }
.pl-sheet > div { padding: 18px 16px 18px; }
.pl-x { position: sticky; top: 0; float: right; z-index: 1; width: 44px; height: 44px; margin: 4px 4px -48px 0; border: 0; border-radius: 10px; background: var(--panel-2); color: var(--ink); font: 400 26px/1 var(--body); cursor: pointer; }
.pf-top { display: flex; align-items: center; gap: 14px; padding-right: 44px; margin-bottom: 14px; }
.pf-top .pl-av { width: 96px; height: 96px; border-radius: 12px; }
.pf-top h2 { margin: 0; font: 700 18px/1.2 var(--px); overflow-wrap: anywhere; }
.pf-since { margin: 4px 0 0; color: var(--ink-2); font-size: 13px; }
.pf-game { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.pf-gh { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pf-gh h3 { margin: 0; font: 700 12px/1.2 var(--px); min-width: 0; overflow-wrap: anywhere; }
.pf-gh .pl-play { min-height: 44px; flex: none; }
.pf-boards { list-style: none; margin: 0; padding: 0; }
.pf-boards li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pf-boards li:last-child { border-bottom: 0; }
.pf-l { grid-row: 1 / 3; min-width: 0; overflow-wrap: anywhere; }
.pf-p { display: block; color: var(--dim); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.pf-s { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.pf-r { text-align: right; color: var(--play); font-size: 12px; }
@media (max-width: 600px) {
  .pl-sheet { margin: auto auto 0; width: 100%; max-width: none; border-radius: 14px 14px 0 0; border-bottom: 0; box-shadow: none; max-height: 90dvh; }
}
@media (max-width: 359px) { .pl-row { gap: 6px; } .pf-top .pl-av { width: 72px; height: 72px; } .pl-card { padding-right: 8px; } }
@media (forced-colors: active) { .pl-chip[aria-current="page"], .pl-seg button[aria-pressed="true"] { border: 2px solid Highlight; } }
