/* =========================================================
   WARP PROXIES — shared theme
   One palette, type set, focus ring, button, toast and motion timing for
   both the site (index.html → style.css) and the dashboard
   (dashboard/index.html → dashboard/style.css + mario.css).
   Load it before either app's own stylesheet.
   ========================================================= */

:root {
  --pz: 1;                           /* pixel-font scale (bigger for CJK) */

  --sky: #5c94fc;
  --sky-l: #84b7ff;                  /* sky inside a framed scene */
  --sky-d: #244b9d;                  /* shadows cast on the sky */
  --ink: #14141f;                    /* text, outlines and hard shadows */
  --cream: #fff8e6;                  /* paper */
  --red: #d12e25;
  --red-d: #a42f29;                  /* red text on paper */
  --gold: #f8b800;
  --gold-l: #fcd878;                 /* gold text on dark */
  --green: #3ec44a;
  --navy: #1a1f4d;
  --ug: #08080f;
  --night: #0a0c2a;
  --discord: #5865f2;

  /* Press Start 2P is drawn on an 8×8 grid: keep it on multiples of 4px (8, 12, 16, 20, 24…),
     where each of its pixels covers whole screen pixels; any other size blurs its edges */
  --f-pixel: "Press Start 2P", "ZCOOL QingKe HuangYou", ui-monospace, monospace;
  /* Figures (prices, totals, stats, counts) use the Jersey faces, sized in whole cells of their grids.
     Jersey 15 has 27 cells to the em, digits 15 tall: 27px and 54px are crisp on every screen, 40.5px on 2x screens.
     Jersey 10 has 18⅔ cells to the em, digits 10 tall: calc(56px / 3) puts one cell on each pixel. */
  --f-num: "Jersey 15", var(--f-pixel);
  --f-num-sm: "Jersey 10", var(--f-pixel);
  --f-head: "Pixelify Sans", "ZCOOL QingKe HuangYou", system-ui, sans-serif;
  --f-body: "Rubik", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --f-mono: ui-monospace, Menlo, Consolas, monospace;

  /* Small things move in whole frames, like the sprites: pair these times with steps().
     A whole panel (the menu drawer) slides smoothly with --ease-panel instead:
     a 250px panel jumping in four steps reads as dropped frames, not as pixel art. */
  --t-tap: .1s;                      /* hover hop and press: steps(2) */
  --t-pop: .2s;                      /* dialogs: steps(4); the drawer: --ease-panel */
  --t-slide: .3s;                    /* toasts: steps(5) */
  --ease-panel: cubic-bezier(.2, .8, .2, 1);

  --focus: var(--ink);               /* dark surfaces switch it to gold */
}
html[lang^="zh"] { --pz: 1.45; }
/* Traditional Chinese (Hong Kong): ZCOOL is a Simplified-only face, so use Noto Sans HK */
html[lang="zh-HK"] {
  --f-pixel: "Press Start 2P", "Noto Sans HK", ui-monospace, monospace;
  --f-head: "Pixelify Sans", "Noto Sans HK", system-ui, sans-serif;
  --f-body: "Rubik", "PingFang HK", "PingFang TC", "Microsoft JhengHei", "Noto Sans CJK TC", system-ui, sans-serif;
}

:focus-visible { outline: 3px dashed var(--focus); outline-offset: 4px; }

/* ---------- buttons: notched 4-side border, bevel and a two-frame hop ----------
   The dashboard names the same variants .primary, .small and .full. */
.btn {
  --bg: #fff; --fg: var(--ink); --line: var(--ink);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  margin: 4px;
  padding: 14px 18px;
  border: 0;
  font-family: var(--f-pixel);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: .02em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  color: var(--fg);
  background: var(--bg);
  cursor: pointer;
  box-shadow:
    0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line),
    inset -4px -4px 0 0 rgba(0, 0, 0, .22), inset 4px 4px 0 0 rgba(255, 255, 255, .35);
  transition: transform var(--t-tap) steps(2), filter .15s;
}
.btn:hover { transform: translateY(-2px); filter: brightness(1.07); }
.btn:active { transform: translateY(2px); box-shadow:
    0 -4px 0 0 var(--line), 0 4px 0 0 var(--line), -4px 0 0 0 var(--line), 4px 0 0 0 var(--line),
    inset 4px 4px 0 0 rgba(0, 0, 0, .22); }
.btn--red, .btn.primary { --bg: var(--red); --fg: #fff; }
.btn--white { --bg: #fff; }
.btn--gold { --bg: var(--gold); }
.btn--discord { --bg: var(--discord); --fg: #fff; }
.btn--ghost { --bg: transparent; --fg: #fff; --line: transparent; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .35); }
.btn--disabled { --bg: #c9c9d4; --fg: #6a6a7a; cursor: not-allowed; pointer-events: none; }
.btn--sm, .btn.small { padding: 10px 12px; }
.btn--lg { padding: 18px 22px; }
.btn--block, .btn.full { width: calc(100% - 8px); }
.btn.is-paid { --bg: #2ecc40; --fg: var(--ink); }
.btn:disabled, .btn[aria-disabled="true"] { cursor: default; transform: none; filter: none; }
.btn:disabled { opacity: .65; }

/* ---------- toast: ink plate, gold notched edge, slides up in five frames ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 100;
  max-width: min(92vw, 580px); padding: 16px 20px;
  background: var(--ink); color: #fff; text-align: center;
  font-family: var(--f-pixel); font-size: 12px; line-height: 1.8;
  box-shadow: 0 -4px 0 var(--gold), 0 4px 0 var(--gold), -4px 0 0 var(--gold), 4px 0 0 var(--gold);
  /* parked fully below the screen, gold edge included (180% of an empty toast left that edge showing) */
  transform: translate(-50%, calc(100% + 30px));
  transition: transform var(--t-slide) steps(5);
  pointer-events: none;
}
.toast.is-on { transform: translate(-50%, 0); }
/* As a manual popover (the dashboard's, so it shows above an open dialog) it keeps this box, not the popover's own
   centred, bordered one */
.toast[popover] { inset: auto auto 22px 50%; margin: 0; border: 0; overflow: visible; }
.toast b { color: var(--gold); font-weight: 400; }

/* Chinese reads better in the body face at a larger size than the 8-bit face allows */
html[lang^="zh"] :is(.btn, .toast) { font-family: var(--f-body); font-weight: 700; letter-spacing: .02em; }
html[lang^="zh"] .btn { font-size: 16px; }
html[lang^="zh"] :is(.btn--sm, .btn.small) { font-size: 14px; }
html[lang^="zh"] .btn--lg { font-size: 18px; }
html[lang^="zh"] .toast { font-size: 14px; }

/* ---------- loyalty tiers: a coin a tier (shared/visuals.js, paintSprites: the coin's 10 x 14 cells, two screen pixels a cell), and the
   rows that list them in the site's FAQ and the dashboard's help; the first tier takes nothing off (--base) ---------- */
.tier-ico { display: inline-block; flex: none; width: 20px; height: 28px; background: center / 100% 100% no-repeat; image-rendering: pixelated; }
.tier-ico--bronze { background-image: var(--spr-tier-bronze); }
.tier-ico--silver { background-image: var(--spr-tier-silver); }
.tier-ico--gold { background-image: var(--spr-coin); }
.tier-ico--diamond { background-image: var(--spr-tier-diamond); }
.tiers { list-style: none; margin: 12px 0; padding: 0; border-top: 2px dashed rgba(20, 20, 31, .22); }
.tiers__row { display: grid; grid-template-columns: 20px 5.5em minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; padding: 8px 0; border-bottom: 2px dashed rgba(20, 20, 31, .22); }
.tiers__name { font-family: var(--f-head); font-weight: 700; font-size: 18px; }
.tiers__need { color: #4a4f6a; }
.tiers__off { padding: 2px 10px; background: var(--ink); color: #fff; font-weight: 700; white-space: nowrap; }
.tiers__row--base .tiers__off { padding-right: 0; background: none; color: #5a5f80; font-weight: 400; }
@media (max-width: 640px) {
  .tiers__row { grid-template-columns: 20px minmax(0, 1fr) auto; column-gap: 12px; }
  .tiers__row .tier-ico { grid-row: 1 / 3; }
  .tiers__need { grid-column: 2; grid-row: 2; font-size: 14px; }
  .tiers__off { grid-column: 3; grid-row: 1 / 3; }
}

/* ---------- the page for one that does not exist (server/app.mjs, notFoundPage): paper, the body face, some room ---------- */
body.not-found { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); font-family: var(--f-body); line-height: 1.6; }
body.not-found main { max-width: 640px; margin: 0 auto; padding: 64px 16px; }
body.not-found h1 { margin: 0 0 12px; font-size: 48px; line-height: 1.1; }

/* ---------- the legal pages (legal/*.html, batch 63): paper, the body face, a column to read, the language switch on top ---------- */
body.legal { margin: 0; min-height: 100vh; background: var(--cream); color: var(--ink); font-family: var(--f-body); line-height: 1.7; }
body.legal .legal-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; max-width: 760px; margin: 0 auto; padding: 24px 16px 0; }
body.legal .legal-home { color: var(--ink); font-weight: 700; text-decoration: none; }
body.legal .legal-lang { display: flex; gap: 8px; }
body.legal .legal-lang button { font: inherit; font-size: 14px; padding: 4px 10px; border: 2px solid var(--ink); background: #fff; color: var(--ink); cursor: pointer; }
body.legal .legal-lang button[aria-pressed="true"] { background: var(--ink); color: #fff; }
body.legal main { max-width: 760px; margin: 0 auto; padding: 16px 16px 64px; overflow-wrap: anywhere; }
body.legal h1 { margin: 16px 0 4px; font-size: 32px; line-height: 1.2; }
body.legal h2 { margin: 32px 0 8px; font-size: 20px; line-height: 1.3; }
body.legal .legal-updated { margin: 0 0 24px; color: #555; font-size: 14px; }
body.legal ul { padding-left: 24px; }
body.legal a { color: var(--ink); }
body.legal .legal-links { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 48px; padding-top: 16px; border-top: 2px solid var(--ink); font-size: 14px; }
