/* axi0 0Games (/games/): the family look (the theme block and header of /tools/, the Key card, buttons and footer of
   /slides/), then the grid, the stage with its sandboxed frame and the best-score table. No inline styles anywhere: the
   page runs under style-src 'self'. */
:root {
  --bg: #000; --panel: #0a0a0c; --panel2: #0d0d10; --panel-a: rgba(10, 10, 12, .9); --field: #050506; --hover: #141418; --raise: #18181d;
  --line: #1c1c21; --line1b: #1d1d23; --line2: #2a2a31; --line3b: #33333b; --line3: #3a3a42; --field-line: #2a2a31;
  --head: #fff; --ink: #f5f5f7; --ink2: #f1f1f4; --text: #d6d6dc; --text2: #c4c4cc; --icon: #b9b9c2; --soft: #b4b4bd; --soft2: #a9a9b3;
  --lede: #a3a3ad; --soft4: #9a9aa4; --mute: #8e8e98; --faint: #868692; --place: #7c7c87;
  --core: #f6a04d; --core-ink: #f6a04d; --core-hover: #ffb26a; --on-core: #000;
  --danger: #ff8f78; --danger-line: rgba(255, 143, 120, .4);
  --knob: #c8c8d0; --veil: rgba(255, 255, 255, .08); --uline: rgba(196, 196, 204, .45);
  color-scheme: dark;
}
html[data-axi0-theme="light"] {
  --bg: #f6f2ea; --panel: #fffdf9; --panel2: #fffdf9; --panel-a: rgba(255, 253, 249, .92); --field: #fffdf9; --hover: #efe8dc; --raise: #ece5d8;
  --line: #e6dfd3; --line1b: #e6dfd3; --line2: #d3cabb; --line3b: #b9ae9c; --line3: #8a8174; --field-line: #8a8174;
  --head: #17140f; --ink: #17140f; --ink2: #1f1b16; --text: #2c2823; --text2: #3d3730; --icon: #4f4940; --soft: #4a433b; --soft2: #50483f;
  --lede: #4f4940; --soft4: #5d554b; --mute: #675f54; --faint: #675f54; --place: #6f665a;
  --core-ink: #9a4a0a; --danger: #b3261e; --danger-line: rgba(179, 38, 30, .4);
  --knob: #6f665a; --veil: rgba(60, 40, 20, .07); --uline: rgba(61, 55, 48, .45);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  html:not([data-axi0-theme="dark"]) {
    --bg: #f6f2ea; --panel: #fffdf9; --panel2: #fffdf9; --panel-a: rgba(255, 253, 249, .92); --field: #fffdf9; --hover: #efe8dc; --raise: #ece5d8;
    --line: #e6dfd3; --line1b: #e6dfd3; --line2: #d3cabb; --line3b: #b9ae9c; --line3: #8a8174; --field-line: #8a8174;
    --head: #17140f; --ink: #17140f; --ink2: #1f1b16; --text: #2c2823; --text2: #3d3730; --icon: #4f4940; --soft: #4a433b; --soft2: #50483f;
    --lede: #4f4940; --soft4: #5d554b; --mute: #675f54; --faint: #675f54; --place: #6f665a;
    --core-ink: #9a4a0a; --danger: #b3261e; --danger-line: rgba(179, 38, 30, .4);
    --knob: #6f665a; --veil: rgba(60, 40, 20, .07); --uline: rgba(61, 55, 48, .45);
    color-scheme: light;
  }
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--bg);
  font: 15px/1.55 "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased;
}
a { color: var(--core-ink); text-underline-offset: 3px; }
::selection { background: rgba(246, 160, 77, .35); }
[hidden] { display: none !important; }
.is-locked .when-unlocked, .is-unlocked .when-locked { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 8px 14px; border-radius: 999px; background: var(--core); color: var(--on-core); font-weight: 600; text-decoration: none; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--core-ink); outline-offset: 2px; }
/* ---- header ------------------------------------------------------------------------------------------------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 1120px; margin: 0 auto; padding: 22px 20px 8px; }
.mark { display: inline-flex; align-items: baseline; gap: .12em; color: var(--head); text-decoration: none; font-size: 26px; font-weight: 600; letter-spacing: -.045em; white-space: nowrap; }
.mark-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--core); box-shadow: 0 0 9px var(--core); transform: translateY(-2px); }
.mark-s { color: var(--mute); font-weight: 500; }
.top-right { display: flex; align-items: center; gap: 14px; }
.me-slot { position: relative; flex: none; width: 36px; height: 36px; }
@media (max-width: 600px) { .mark { font-size: 22px; } }   /* the phone mark, as on every suite page */
.me-slot:empty { display: none; }
.card { margin-top: 18px; padding: 22px 24px 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); }
.card > p { margin: 0 0 10px; }
.mode { margin: 14px 0 0; color: var(--lede); font-size: 14px; }
.linkish { padding: 0; border: 0; background: none; color: var(--core-ink); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:hover { color: var(--head); }
label.inline { display: inline; margin: 0; color: var(--text); }
.hint { margin: 6px 0 0; color: var(--mute); font-size: 13px; }
.error { margin: 6px 0 0; color: var(--danger); font-size: 13px; }
.error:empty, .note:empty { display: none; }
.note { margin: 8px 0 0; color: var(--core-ink); font-size: 13px; }
.warn { color: var(--head); }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; }
.row.tight { flex-wrap: nowrap; margin-top: 0; }
.row.tight input { flex: 1 1 auto; min-width: 0; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 16px; margin: 0;
  border: 1px solid var(--line2); border-radius: 999px; background: var(--panel); color: var(--head); font: inherit; font-size: 14px;
  white-space: nowrap; cursor: pointer; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: rgba(246, 160, 77, .7); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { border-color: var(--core); background: var(--core); color: var(--on-core); font-weight: 600; }
.btn.primary:hover { background: var(--core-hover); }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn.file { position: relative; overflow: hidden; }
.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.btn.file:focus-within { outline: 2px solid var(--core-ink); outline-offset: 2px; }
.check { display: inline-flex; align-items: center; gap: 9px; margin: 0; font-size: 14px; color: var(--text); cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--core); }
.key .new { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.key .new h3 { margin-top: 0; }
.key .new p { margin: 0 0 12px; }
.keytext { margin: 10px 0 0; padding: 14px 16px; border: 1px dashed rgba(246, 160, 77, .55); border-radius: 12px; background: rgba(246, 160, 77, .05);
  color: var(--head); font: 15px ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .02em; overflow-wrap: anywhere; user-select: all; }
.sync { display: flex; align-items: center; gap: 8px; min-height: 22px; margin: 12px 0 0; color: var(--mute); font-size: 13px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--line3); flex: none; }
.sync:empty::before { display: none; }
.sync.is-ok::before { background: var(--core); box-shadow: 0 0 7px rgba(246, 160, 77, .8); }
.sync.is-busy::before { background: var(--icon); }
.sync.is-bad { color: var(--danger); }
.sync.is-bad::before { background: var(--danger); }
.foot { max-width: 1280px; margin: 0 auto; padding: 4px 20px 44px; color: var(--faint); font-size: 12.5px; }
.foot p { margin: 0 0 6px; max-width: 60em; }
.foot a { color: var(--text2); text-decoration: underline; text-decoration-color: var(--uline); }
.foot a:hover { text-decoration-color: currentColor; }
.locker { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.locker .row { margin-top: 8px; }
.locker .btn { min-height: 36px; font-size: 13px; }

/* ---- the page ------------------------------------------------------------------------------------------------ */
main { max-width: 1120px; margin: 0 auto; padding: 8px 20px 40px; min-height: calc(100vh - 220px); }
.intro h1 { margin: 18px 0 6px; font-size: 40px; letter-spacing: -.035em; color: var(--head); line-height: 1.05; }
.lede { margin: 0 0 14px; max-width: 48em; color: var(--lede); font-size: 17px; }
.is-unlocked .intro h1 { font-size: 30px; }
.is-unlocked .lede { font-size: 14px; }
.card h2, .best h2, .stage-top h2 { margin: 0 0 10px; font-size: 20px; color: var(--head); }
.card h3 { margin: 0 0 6px; font-size: 16px; color: var(--head); }
.mode { margin: 0 0 14px; }
.unlock label { display: block; margin: 0 0 6px; color: var(--text); font-size: 14px; }
.unlock input[type="text"] { font: inherit; font-size: 15px; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 999px; padding: 9px 16px; }
.fresh { margin-bottom: 18px; }

/* the grid: one tile per game, one line each */
.grid { margin-top: 18px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.tiles a { display: block; padding: 14px 16px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); color: var(--text); text-decoration: none; min-height: 84px; }
.tiles a:hover { border-color: var(--line3b); background: var(--hover); }
.tiles .t { display: block; color: var(--head); font-weight: 600; font-size: 15px; margin: 0 0 3px; }
.tiles .d { display: block; color: var(--mute); font-size: 13px; line-height: 1.4; }

/* the best table */
.best { margin: 18px 0 0; padding: 16px 18px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.best-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.best-table th, .best-table td { padding: 6px 8px; text-align: left; border-top: 1px solid var(--line); }
.best-table thead th { border-top: 0; color: var(--mute); font-weight: 500; font-size: 13px; }
.best-table tbody th { font-weight: 600; color: var(--head); }
.best-table tbody th a { color: inherit; text-decoration: none; }
.best-table tbody th a:hover { text-decoration: underline; }
.best-table .num { font-variant-numeric: tabular-nums; }
.best-table .when { color: var(--mute); }
.best-table td:last-child { text-align: right; }
.best .sync { margin-top: 8px; }

/* the stage: the game in its frame */
.crumbs { margin: 10px 0 12px; font-size: 14px; }
.crumbs a { color: var(--mute); text-decoration: none; }
.crumbs a:hover { color: var(--head); text-decoration: underline; }
.stage-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin: 0 0 10px; }
.stage-top h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.stage-best { margin: 0; color: var(--core-ink); font-weight: 600; font-size: 14px; }
.stage-btns { margin-left: auto; }
.stage-btns .btn { min-height: 34px; font-size: 13px; }
.frame { position: relative; width: 100%; height: min(78vh, 760px); min-height: 420px; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; background: #fff; }
.frame iframe { display: block; width: 100%; height: 100%; border: 0; background: #fff; }
.stage-note { margin-top: 10px; }
.stage-from { margin-top: 4px; }
@media (max-width: 600px) {
  main { padding: 8px 12px 32px; }
  .intro h1 { font-size: 32px; }
  .frame { height: min(72vh, 640px); min-height: 360px; border-radius: 10px; }
  .best-table .when { display: none; }
  .stage-top h2 { font-size: 22px; }
}

/* Play together: the card on the stage (games-live.js fills it; hidden until a room exists) */
.live { margin: 0 0 12px; padding: 16px 18px 18px; }
.live-status { margin: 0 0 8px; font-weight: 600; color: var(--head); min-height: 1.4em; }
.live-link input { font: inherit; font-size: 14px; color: var(--ink); background: var(--field); border: 1px solid var(--field-line); border-radius: 999px; padding: 8px 14px; }
.live .note { min-height: 1.2em; }
.live #live-acts { margin-top: 10px; }

/* ---- round 2: the views row, the Cloud list, the stage's gamepad hint and pause veil ---- */
.views { margin: 14px 0 0; align-items: center; }
.views-hint { margin: 0; }
.cloud { margin: 28px 0 0; }
.cloud h2 { font-size: 20px; margin: 0 0 6px; }
.cloud .hint { margin: 0 0 12px; max-width: 78ch; }
.cloud-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.cloud-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.cloud-name { flex: 1 1 120px; font-weight: 600; color: var(--head); font-size: 14px; }
.out { font-size: 13px; color: var(--text); text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.out:hover { border-color: var(--line3b); background: var(--hover); }
.stage-gp { margin: 0; align-self: center; }
#pause-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: 600; color: #fff; background: rgba(0,0,0,.72); z-index: 2; }
#pause-veil[hidden] { display: none; }
