/* ==========================================================================
   Vyven — "Night session"
   A training ground after dark: the numbers that matter (level, clock, places,
   ranks) live on dark LED scoreboards; everything around them stays calm.
   Amber LEDs = XP and actions. Teal = rank points and things you've locked in.
   The boards stay dark in the light theme too, like a scoreboard at noon.
   ========================================================================== */

:root {
  --f-ui: 'Alexandria', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
  --f-px: 'Vyven Pixel', 'Alexandria', ui-monospace, monospace;
  --f-led: 'Vyven LED', 'Vyven Pixel', ui-monospace, monospace;

  /* scoreboard hardware: identical in both themes */
  --board: #0f0d17;
  --board-dot: rgba(255, 178, 36, .085);
  --board-edge: rgba(255, 255, 255, .06);
  --board-text: #f3ede2;
  --board-muted: #a49cb8;
  --led: #ffb224;
  --led-glow: rgba(255, 178, 36, .5);
  --led-off: rgba(255, 178, 36, .13);
  --led-teal: #3ed6bf;
  --led-red: #ff6a55;

  /* rank lamp colours (on boards) */
  --rl-E: #b3aa9a; --rl-D: #79da6e; --rl-C: #5cbcff; --rl-B: #b79aff;
  --rl-A: #ff9447; --rl-S: #ffcf3d; --rl-N: #ff62a2;

  --g-xp: linear-gradient(90deg, #ffcf4a, #ff9a1f);
  --g-xp-rtl: linear-gradient(270deg, #ffcf4a, #ff9a1f);
  --g-rp: linear-gradient(90deg, #2fd3b6, #3aa8ff);
  --g-rp-rtl: linear-gradient(270deg, #2fd3b6, #3aa8ff);
  --g-btn: linear-gradient(135deg, #ffcc45, #ff9d1f);
  --r-panel: 18px;
  --r-ctl: 12px;
  --r-board: 10px;
  --gap: 20px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

:root[data-theme="dark"] {
  --bg: #12101c;
  --surface: #1b1828;
  --surface-2: #242036;
  --surface-3: #2e2944;
  --field: #161322;
  --line: #2e2943;
  --line-2: #463f61;
  --text: #f3effb;
  --muted: #ada6c4;
  --faint: #938caf;
  --accent: #ffb224;        /* accent used as text/lines */
  --accent-bg: #ffb224;     /* accent used as a fill */
  --on-accent: #261600;
  --teal: #3ed6bf;
  --red: #ff6a55;
  --off: rgba(255, 178, 36, .12);   /* unlit segment on a page surface */
  --shadow: 0 24px 60px rgba(0, 0, 0, .5);
  --r-E: #b3aa9a; --r-D: #79da6e; --r-C: #5cbcff; --r-B: #b79aff;
  --r-A: #ff9447; --r-S: #ffcf3d; --r-N: #ff62a2;
  --s-str: #ff7a5c; --s-agi: #4fdc8c; --s-int: #6aa7ff; --s-vit: #ff6fae; --s-per: #b48cff;
  --sky: radial-gradient(1000px 420px at 50% -160px, rgba(255, 170, 40, .16), transparent 70%),
         radial-gradient(760px 560px at 105% -5%, rgba(130, 96, 255, .2), transparent 62%),
         radial-gradient(700px 520px at -8% 105%, rgba(62, 214, 191, .1), transparent 60%);
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f0eef6;
  --surface: #ffffff;
  --surface-2: #f4f2f9;
  --surface-3: #e9e6f2;
  --field: #ffffff;
  --line: #e0dcea;
  --line-2: #c3bdd4;
  --text: #1c1828;
  --muted: #5b5570;
  --faint: #716a86;
  --accent: #9e5800;
  --accent-bg: #f4a816;
  --on-accent: #241500;
  --teal: #00776a;
  --red: #c23a25;
  --off: rgba(30, 28, 24, .09);
  --shadow: 0 24px 60px rgba(40, 34, 20, .16);
  --r-E: #6b6458; --r-D: #2e7d26; --r-C: #1b67ad; --r-B: #6a43cc;
  --r-A: #b84f0c; --r-S: #8c6200; --r-N: #b51b5b;
  --s-str: #c2410c; --s-agi: #15803d; --s-int: #1d5fd1; --s-vit: #be185d; --s-per: #7c3aed;
  --sky: radial-gradient(1000px 420px at 50% -160px, rgba(255, 170, 40, .22), transparent 70%),
         radial-gradient(760px 560px at 105% -5%, rgba(140, 110, 255, .16), transparent 62%),
         radial-gradient(700px 520px at -8% 105%, rgba(40, 190, 170, .1), transparent 60%);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
button, a, input, label, summary { touch-action: manipulation; }
.num, .led, .xp, .rp, .crest b { font-synthesis: none; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--f-ui);
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
/* floodlights over the field: warm light from above, a violet night sky, a teal glow below */
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--sky); }
/* every ability has its own colour, used wherever that ability shows up */
.st-str { --sc: var(--s-str); } .st-agi { --sc: var(--s-agi); } .st-int { --sc: var(--s-int); }
.st-vit { --sc: var(--s-vit); } .st-per { --sc: var(--s-per); }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-underline-offset: 3px; }
h1, h2, h3 { text-wrap: balance; }
[hidden] { display: none !important; }
.sprite { position: absolute; top: 0; left: 0; width: 0; height: 0; overflow: hidden; }
.noscript { padding: 2rem; color: #f3effb; background: #12101c; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.num { font-family: var(--f-px); font-weight: 600; font-size: 1.15em; letter-spacing: .02em; }
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- the scoreboard */
.board {
  position: relative;
  border-radius: var(--r-board);
  background-color: var(--board);
  background-image: radial-gradient(circle, var(--board-dot) 0 1.1px, transparent 1.7px);
  background-size: 6px 6px;
  background-position: 1px 1px;
  box-shadow: inset 0 0 0 1px var(--board-edge), inset 0 3px 14px rgba(0, 0, 0, .55);
  color: var(--board-text);
}
:root[data-theme="light"] .board { box-shadow: inset 0 0 0 1px var(--board-edge), inset 0 3px 14px rgba(0, 0, 0, .55), 0 1px 0 rgba(255, 255, 255, .8), 0 0 0 1px rgba(0, 0, 0, .08); }
.led {
  font-family: var(--f-led);
  font-weight: 700;
  line-height: .9;
  letter-spacing: .04em;
  color: var(--led);
  text-shadow: 0 0 5px var(--led-glow), 0 0 18px rgba(255, 178, 36, .22);
  font-variant-numeric: tabular-nums;
}

/* boards power on once when the app opens (the one choreographed moment) */
.is-boot .board .led, .auth__board .led, .splash__board .led { animation: powerOn .9s steps(1, end) both; }
.is-boot .hunter__board .bar--led .bar__fill { animation: fillIn 1.1s var(--ease-out) .35s both; }
@keyframes powerOn {
  0% { opacity: 0; }
  12% { opacity: .9; }
  20% { opacity: .15; }
  34% { opacity: 1; }
  44% { opacity: .55; }
  56%, 100% { opacity: 1; }
}
@keyframes fillIn { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
[dir="rtl"] .is-boot .hunter__board .bar--led .bar__fill { animation-name: fillInRtl; }
@keyframes fillInRtl { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }

/* ---------------------------------------------------------------- panels */
.win {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-panel);
}
.win__in { position: relative; flex: 1; padding: 22px 24px; min-width: 0; }
.win--red { border-color: color-mix(in srgb, var(--red) 55%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--red) 9%, var(--surface)), var(--surface) 160px); }
.win__head, .syshead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.win__title, .syshead__title { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.35; display: flex; align-items: center; gap: 10px; }
.win--red .syshead__title { color: var(--red); }
.syshead__tools { display: flex; align-items: center; gap: 8px; }

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px;
  padding: 8px 18px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--text);
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s, color .15s, transform .1s;
}
.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn--primary { background: var(--g-btn); border-color: transparent; color: var(--on-accent); font-weight: 600; box-shadow: 0 6px 18px -8px rgba(255, 150, 30, .7); }
.btn--primary:hover:not(:disabled) { background: var(--g-btn); filter: brightness(1.06) saturate(1.05); }
.btn--red { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn--red:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 88%, #000); }
.btn--danger-text { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); }
.btn--danger-text:hover:not(:disabled) { background: color-mix(in srgb, var(--red) 9%, transparent); }
.btn--sm { min-height: 36px; padding: 5px 13px; font-size: 13.5px; border-radius: 10px; }
.btn--block { width: 100%; }
.btn--step { font-family: var(--f-px); font-weight: 600; font-size: 17px; min-width: 52px; padding-inline: 10px; }
.btn .ic { width: 16px; height: 16px; }

.icon-btn {
  display: inline-grid; place-items: center; grid-auto-flow: column; gap: 6px;
  min-width: 40px; height: 40px; padding: 0 8px;
  border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: color .15s, background-color .15s, border-color .15s;
}
.icon-btn:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.icon-btn--sm { min-width: 34px; height: 34px; padding: 0 6px; }
.icon-btn__txt { font-weight: 600; font-size: 14px; }
.icon-btn--danger:hover:not(:disabled) { color: var(--red); background: color-mix(in srgb, var(--red) 9%, transparent); }
.linkbtn { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; padding: 2px 4px; color: var(--muted); cursor: pointer; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.linkbtn.is-on, .linkbtn:hover { color: var(--text); }
.linkbtn .ic { width: 14px; height: 14px; }
.linkbtn--danger, .linkbtn--danger:hover { color: var(--red); text-decoration-color: color-mix(in srgb, var(--red) 50%, transparent); }
.push-end { margin-inline-end: auto; }
.push-start { margin-inline-start: auto; }

/* segmented control */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-ctl); }
.seg--inline { display: inline-grid; }
.seg__btn { position: relative; border: 0; border-radius: 9px; background: transparent; color: var(--muted); padding: 7px 14px; min-height: 36px; cursor: pointer; font-weight: 500; transition: background-color .15s, color .15s; }
.seg__btn:hover:not(.is-on):not(:disabled) { color: var(--text); }
.seg__btn.is-on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 1px 3px rgba(0, 0, 0, .12); }
:root[data-theme="dark"] .seg__btn.is-on { background: var(--surface-3); box-shadow: none; }
.seg__btn:disabled:not(.is-on) { opacity: .35; cursor: not-allowed; }
.seg--tabs { margin-bottom: 18px; }
.seg--tabs .seg__btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; }
.seg--stack { grid-auto-flow: row; margin-bottom: 14px; }

/* fields */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field__lbl { font-size: 13.5px; font-weight: 500; color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.input {
  width: 100%;
  min-height: 46px;
  padding: 10px 14px;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: var(--r-ctl);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: var(--line-2); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-bg) 22%, transparent); }
.input::placeholder { color: var(--faint); }
.input--big { font-family: var(--f-px); font-size: 30px; text-align: center; }
.input--code { font-family: var(--f-px); font-size: 24px; letter-spacing: .3em; text-align: center; }
.input--sm { min-height: 40px; padding: 6px 12px; }
textarea.input { resize: vertical; min-height: 84px; }
input[type="date"].input { color-scheme: inherit; }
.form-err { color: var(--red); font-size: 13.5px; min-height: 1em; margin: 0 0 10px; }
.form-err:empty, .form-ok:empty { display: none; }
.form-ok { color: var(--teal); font-size: 13.5px; margin: 0 0 10px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.switch {
  appearance: none; -webkit-appearance: none;
  width: 46px; height: 26px; flex: none;
  border: 1px solid var(--line-2); border-radius: 99px;
  background: var(--surface-2);
  position: relative; cursor: pointer; margin: 0;
  transition: background-color .15s, border-color .15s;
}
.switch::after {
  content: ''; position: absolute; top: 3px; inset-inline-start: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: var(--faint);
  transition: inset-inline-start .2s var(--ease), background-color .15s;
}
.switch:checked { background: color-mix(in srgb, var(--accent-bg) 25%, var(--surface-2)); border-color: var(--accent); }
.switch:checked::after { inset-inline-start: 23px; background: var(--accent-bg); }

/* ---------------------------------------------------------------- segment bars */
/* every bar is a row of lamps: unlit cells behind, lit cells in front */
.bar {
  --cell: 6px; --gap: 2px;
  position: relative;
  display: block;
  height: 10px;
  background: var(--off);
  overflow: hidden;
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap)));
  mask: repeating-linear-gradient(90deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap)));
}
.bar__fill { display: block; height: 100%; background: var(--g-xp); transition: width .6s var(--ease); }
[dir="rtl"] .bar__fill { background: var(--g-xp-rtl); }
.bar--lg { height: 14px; --cell: 7px; }
.bar--thin { height: 6px; --cell: 4px; --gap: 2px; }
.bar--q { height: 5px; --cell: 4px; --gap: 2px; margin-top: 10px; max-width: 360px; }
.bar--rp .bar__fill { background: var(--g-rp); }
[dir="rtl"] .bar--rp .bar__fill { background: var(--g-rp-rtl); }
.bar--gate .bar__fill { background: linear-gradient(90deg, var(--s-per), var(--s-vit)); }
[dir="rtl"] .bar--gate .bar__fill { background: linear-gradient(270deg, var(--s-per), var(--s-vit)); }
.bar[class*="st-"] .bar__fill { background: var(--sc); }
.bar--led { background: var(--led-off); height: 12px; --cell: 7px; }
.bar--led .bar__fill { background: linear-gradient(90deg, #ffd65a, #ffb224 55%, #ff8a1f); box-shadow: 0 0 12px var(--led-glow); }
[dir="rtl"] .bar--led .bar__fill { background: linear-gradient(270deg, #ffd65a, #ffb224 55%, #ff8a1f); }

/* ---------------------------------------------------------------- chips, tags */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 99px; font-size: 12.5px; color: var(--muted); }
.chip b { font-family: var(--f-px); font-weight: 600; color: var(--text); font-size: 16px; line-height: 1; }
.chip .ic { width: 15px; height: 15px; }
.chip--flame.is-on { background: color-mix(in srgb, var(--r-A) 10%, transparent); color: var(--r-A); border-color: color-mix(in srgb, var(--r-A) 45%, transparent); }
.chip--flame.is-on .ic { fill: color-mix(in srgb, var(--r-A) 35%, transparent); }
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 1px 9px; font-size: 12px; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; line-height: 1.7; }
.tag .ic { width: 13px; height: 13px; }
.tag--red { color: var(--red); border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 8%, transparent); }
.tag--gold { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tag--ok { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, transparent); }
.tag--soft { border-style: dashed; }
.tag--stat { color: var(--sc); border-color: color-mix(in srgb, var(--sc) 35%, transparent); }
.tag--sys { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 40%, transparent); background: color-mix(in srgb, var(--teal) 8%, transparent); }
.tag--custom { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent-bg) 8%, transparent); }
/* difficulty letter */
.dchip {
  display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 4px;
  border-radius: 6px;
  font-family: var(--f-px); font-weight: 700; font-size: 15px; line-height: 1;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent);
}
.xp, .rp { font-family: var(--f-px); font-weight: 600; font-size: 16px; line-height: 1.2; white-space: nowrap; }
.xp { color: var(--accent); }
.rp { color: var(--teal); }
.rewards { display: inline-flex; gap: 10px; margin-inline-start: auto; }
.rewards .xp { margin: 0; }

.r-E { --c: var(--r-E); --cl: var(--rl-E); } .r-D { --c: var(--r-D); --cl: var(--rl-D); }
.r-C { --c: var(--r-C); --cl: var(--rl-C); } .r-B { --c: var(--r-B); --cl: var(--rl-B); }
.r-A { --c: var(--r-A); --cl: var(--rl-A); } .r-S { --c: var(--r-S); --cl: var(--rl-S); }
.r-N { --c: var(--r-N); --cl: var(--rl-N); }
.rank-txt { color: var(--c); font-weight: 600; }

/* rank crest: a small lit sign */
.crest {
  --s: 52px;
  flex: none;
  display: inline-grid; place-items: center;
  width: var(--s); height: var(--s);
  border-radius: 24%;
  background-color: var(--board);
  background-image: radial-gradient(circle, color-mix(in srgb, var(--cl) 16%, transparent) 0 1px, transparent 1.6px);
  background-size: 5px 5px;
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--cl) 65%, transparent), inset 0 0 14px color-mix(in srgb, var(--cl) 18%, transparent);
}
.crest b {
  font-family: var(--f-led); font-weight: 700; line-height: 1;
  font-size: calc(var(--s) * .64);
  color: var(--cl);
  text-shadow: 0 0 6px color-mix(in srgb, var(--cl) 70%, transparent);
  transform: translateY(4%);
}
.crest--xs { --s: 26px; } .crest--sm { --s: 36px; } .crest--md { --s: 50px; } .crest--lg { --s: 72px; } .crest--xl { --s: 132px; }
.crest--xs b, .crest--sm b { font-family: var(--f-px); transform: none; }
.crest--xl { border-radius: 22%; }

/* ---------------------------------------------------------------- splash / auth */
.splash { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 16px; text-align: center; padding: 24px; }
.splash__board { padding: 22px 30px 18px; }
.splash__word { font-size: clamp(56px, 13vw, 104px); direction: ltr; }

.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 64px 16px 48px; position: relative; }
.auth__bg { display: none; }
.auth__tools { position: absolute; top: max(14px, env(safe-area-inset-top)); inset-inline-end: 14px; display: flex; gap: 6px; }
.auth__col { width: min(440px, 100%); display: grid; gap: 16px; }
.auth__board { display: grid; justify-items: center; gap: 12px; padding: 30px 20px 22px; text-align: center; }
.auth__word { margin: 0; font-size: clamp(64px, 17vw, 104px); direction: ltr; }
.auth__tag { margin: 0; font-size: 15px; color: var(--board-muted); }
.auth__win { text-align: start; }
.auth__msg { margin: 0 0 18px; font-size: 15.5px; line-height: 1.7; }
.auth__form { margin-top: 18px; }
.auth__foot { font-size: 13px; margin: 0; text-align: center; }
.auth__links { display: flex; justify-content: space-between; gap: 12px; margin: -6px 0 14px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- shell */
.shell {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "side main";
  gap: var(--gap);
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 24px 48px;
  min-height: 100vh;
}
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 24px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; text-decoration: none; padding: 6px 12px 4px; border-radius: 9px; background-color: var(--board); background-image: radial-gradient(circle, var(--board-dot) 0 1px, transparent 1.6px); background-size: 5px 5px; box-shadow: inset 0 0 0 1px var(--board-edge); }
.brand__word { font-size: 28px; direction: ltr; }
.topbar__tools { display: flex; gap: 2px; margin-inline-start: auto; }

.nav { display: flex; gap: 2px; }
.nav__a {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  transition: color .15s, background-color .15s;
}
.nav__a:hover { color: var(--text); background: var(--surface-2); }
.nav__a.is-on { color: var(--text); }
/* the active page has its lamp lit */
.nav__a::after {
  content: ''; position: absolute; left: 50%; bottom: -15px; translate: -50% 0;
  width: 28px; height: 3px; border-radius: 3px;
  background: transparent;
}
.nav__a.is-on::after { background: var(--g-xp); box-shadow: 0 0 10px color-mix(in srgb, var(--accent-bg) 70%, transparent); }
.nav__a.is-on .ic { color: var(--accent); }
.nav--bottom { display: none; }

.side { grid-area: side; }
.side > .win { position: sticky; top: 92px; }
.main { grid-area: main; min-width: 0; outline: none; }
.stack { display: grid; gap: var(--gap); align-content: start; }
.stack--narrow { max-width: 720px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.page-title { margin: 0; font-size: 26px; font-weight: 700; line-height: 1.3; }

/* ---------------------------------------------------------------- player card */
.hunter { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 13%, var(--surface)), var(--surface) 190px); border-color: color-mix(in srgb, var(--c) 28%, var(--line)); }
.hunter .win__in { padding: 20px; }
.hunter__top { display: flex; align-items: center; gap: 14px; }
.hunter__id { min-width: 0; }
.hunter__name { font-size: 18px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.hunter__title { color: var(--accent); font-size: 13px; }
.hunter__handle { font-size: 12.5px; color: var(--faint); }
.hunter__board { margin: 18px 0 14px; padding: 14px 16px 16px; display: grid; gap: 10px; }
.hunter__lvl { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.hunter__lvl-lbl { font-size: 13px; color: var(--board-muted); padding-bottom: 6px; }
.hunter__lvl-num { font-size: 72px; }
.hunter__xp { display: flex; align-items: baseline; gap: 6px; font-family: var(--f-px); font-weight: 600; font-size: 17px; color: var(--board-text); line-height: 1; }
.hunter__xp small { font-size: 14px; color: var(--led); }
.hunter__rp { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 2px 0 6px; font-size: 12.5px; color: var(--muted); }
.hunter__rp b { font-family: var(--f-px); font-weight: 600; color: var(--teal); font-size: 15px; white-space: nowrap; }
.hunter__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.mini-stats { list-style: none; margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.mini-stats__row { display: grid; grid-template-columns: 18px 32px 1fr 30px; align-items: center; gap: 8px; }
.mini-stats__ic { width: 16px; height: 16px; color: var(--sc); }
.mini-stats__ab { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.mini-stats__row .bar__fill { background: var(--sc); }
.mini-stats__v { font-family: var(--f-px); font-weight: 600; font-size: 16px; text-align: end; line-height: 1; }
.gate-mini { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.gate-mini__row { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--muted); }
.gate-mini__row b { margin-inline-start: auto; font-family: var(--f-px); font-weight: 600; font-size: 16px; color: var(--text); }
.gate-mini.is-clear .gate-mini__row b, .gate-mini.is-clear .ic { color: var(--teal); }

/* ---------------------------------------------------------------- today's quests */
.dq .win__in { padding: 24px 26px 22px; }
.dq__arrived { margin: -6px 0 10px; color: var(--muted); }
.dq__foot { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.dq__timer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.dq__timer-lbl { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.dq__clock { padding: 9px 14px 7px; }
.dq__time { display: block; font-size: 34px; }
.dq__warn { margin: 0; display: flex; gap: 8px; align-items: flex-start; color: var(--red); font-size: 13.5px; }
.dq__warn .ic { margin-top: 3px; }
.dq__cleared { margin: 0; display: flex; gap: 8px; align-items: center; color: var(--teal); font-weight: 500; }
.dq__legend { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; margin-top: 14px; font-size: 12.5px; color: var(--muted); }
.dq__legend > span:not(.tag) { margin-inline-end: 10px; }

.qlist { list-style: none; margin: 0; padding: 0; }
.qrow {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: start;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.qlist > .qrow:last-child { border-bottom: 0; }
.qrow__main { min-width: 0; }
.qrow__top { display: flex; align-items: baseline; gap: 12px; }
.qrow__title { font-weight: 500; font-size: 15.5px; overflow-wrap: anywhere; }
.qrow__note { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.qrow__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.qrow__side { display: flex; align-items: center; gap: 4px; padding-top: 1px; }
.qctrl { display: flex; align-items: center; gap: 4px; }
.qacts { display: flex; gap: 2px; }
.qcount {
  margin-inline-start: auto; flex: none;
  border: 0; background: none; padding: 2px 4px; cursor: pointer;
  font-family: var(--f-px); font-size: 18px; color: var(--muted); line-height: 1.1;
  border-radius: 6px;
}
.qcount b { color: var(--text); font-weight: 700; }
.qcount small { font-family: var(--f-ui); font-size: 11.5px; color: var(--muted); margin-inline-start: 3px; }
.qcount:hover:not(:disabled) b { color: var(--accent); }
.qcount:disabled { cursor: default; }
/* the check is a lamp: unlit ring, lit when done */
.qcheck {
  width: 32px; height: 32px; margin-top: -2px;
  display: grid; place-items: center;
  border: 2px solid var(--line-2);
  border-radius: 50%;
  background: transparent;
  color: transparent; cursor: pointer;
  transition: background-color .2s, color .2s, box-shadow .2s, border-color .2s;
}
.qcheck .ic { width: 17px; height: 17px; stroke-width: 2.8; }
.qcheck:hover:not(:disabled) { border-color: var(--teal); color: color-mix(in srgb, var(--teal) 55%, transparent); }
.qcheck.is-done { background: var(--teal); border-color: var(--teal); color: var(--bg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 16%, transparent); }
:root[data-theme="light"] .qcheck.is-done { color: #fff; }
.qcheck.is-done .ic { animation: tick .35s var(--ease-out); }
.qcheck:disabled { opacity: .4; cursor: not-allowed; }
@keyframes tick { from { transform: scale(.3); opacity: 0; } }
.qrow.is-done .qrow__title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--teal) 70%, transparent); text-decoration-thickness: 1.5px; }
.qrow.is-done .qcount b, .qrow.is-done .xp, .qrow.is-done .rp { color: var(--teal); }
.qrow.is-done .bar__fill { background: var(--teal); }
.qrow.is-locked { opacity: .6; }
.qrow.is-overdue .qcheck { border-color: var(--red); }
.qlist--muted .qrow { padding: 12px 0; }
.qtimer { font-family: var(--f-px); font-weight: 700; font-size: 20px; color: var(--accent); min-width: 64px; text-align: center; }
.qtimer.is-done { color: var(--teal); font-family: var(--f-ui); font-size: 13px; font-weight: 600; }

.penalty p { margin: 0; }

.fold { border: 1px solid var(--line); border-radius: var(--r-panel); background: var(--surface); }
.fold__sum { display: flex; align-items: center; gap: 10px; padding: 14px 18px; cursor: pointer; color: var(--muted); list-style: none; border-radius: var(--r-panel); }
.fold__sum::-webkit-details-marker { display: none; }
.fold__sum::after { content: '+'; margin-inline-start: auto; font-family: var(--f-px); font-size: 20px; line-height: 1; }
.fold[open] .fold__sum::after { content: '−'; }
.fold__sum b { font-family: var(--f-px); font-size: 17px; color: var(--text); }
.fold > .qlist, .fold > .donelist { padding: 0 18px 8px; }
.fold--inner { margin-top: 12px; background: transparent; border-radius: 14px; }
.fold--inner .fold__sum .ic { width: 16px; height: 16px; }
.fold__body { padding: 4px 18px 16px; }
.donelist { list-style: none; margin: 0; }
.donelist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 14px; }
.donelist .ic { color: var(--teal); width: 16px; height: 16px; }
.donelist__t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donelist b { font-family: var(--f-px); color: var(--accent); font-size: 15px; }

.empty { display: grid; justify-items: center; gap: 12px; padding: 24px 8px; text-align: center; color: var(--muted); }
.empty p { margin: 0; }
.empty--quiet { padding: 8px 0; display: block; text-align: start; }

/* ---------------------------------------------------------------- status */
.status__grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; align-items: end; }
.status__id { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; margin: 0; }
.status__id > div { display: grid; gap: 1px; border-bottom: 1px solid var(--line); padding-bottom: 8px; min-width: 0; }
.status__id dt { font-size: 12.5px; color: var(--muted); }
.status__id dd { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.status__id dd.num { font-size: 24px; line-height: 1.2; }
.status__xp-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; color: var(--muted); font-size: 13.5px; }
.status__xp-row b { font-family: var(--f-px); font-size: 18px; color: var(--accent); }
.status__xp .fine { font-family: var(--f-px); font-size: 15px; letter-spacing: .04em; }
.status__stats { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); align-items: center; }
.slist { list-style: none; margin: 0 0 12px; padding: 0; display: grid; }
.srow { display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); min-height: 54px; }
.srow__ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--sc) 15%, transparent); color: var(--sc); }
.srow__name b { color: var(--sc); }
.srow__name { display: grid; line-height: 1.3; }
.srow__name b { font-weight: 600; letter-spacing: .03em; }
.srow__name span { font-size: 12.5px; color: var(--muted); }
.srow__v { font-family: var(--f-px); font-weight: 700; font-size: 26px; line-height: 1; }
.srow__v em { font-style: normal; color: var(--teal); font-size: 17px; margin-inline-start: 2px; }
.status__radar { display: grid; place-items: center; }
.radar { width: 100%; max-width: 250px; height: auto; overflow: visible; }
.radar__ring { fill: none; stroke: var(--line); stroke-width: 1; }
.radar__axis { stroke: var(--line); stroke-width: 1; }
.radar__shape { fill: color-mix(in srgb, var(--s-per) 18%, transparent); stroke: color-mix(in srgb, var(--s-per) 80%, var(--accent-bg)); stroke-width: 2; stroke-linejoin: round; }
.radar__dot { fill: var(--sc, var(--accent-bg)); stroke: var(--surface); stroke-width: 1.5; }
.radar__lbl { fill: var(--sc, var(--muted)); font-family: var(--f-px); font-weight: 600; font-size: 14px; }

.trial__body { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.trial__body p { margin: 0; }
.trial__note { flex-basis: 100%; }
.reqs { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; flex: 1; min-width: 0; }
.req__top { display: flex; align-items: center; gap: 8px; font-size: 13.5px; margin-bottom: 6px; }
.req__top b { margin-inline-start: auto; font-family: var(--f-px); font-size: 16px; white-space: nowrap; }
.req__ic { color: var(--faint); display: grid; }
.req__ic .ic { width: 15px; height: 15px; }
.req.is-ok .req__ic, .req.is-ok b { color: var(--teal); }
.req.is-ok .bar__fill { background: var(--teal); }

.gate__body { display: flex; align-items: center; gap: 18px; }
.gate__body p { margin: 0; font-size: 14px; }
.gate__viz { position: relative; width: 104px; height: 104px; flex: none; }
.gate__ring { width: 100%; height: 100%; }
.gate__track { fill: none; stroke: var(--off); stroke-width: 8; stroke-dasharray: 3 3.6; }
.gate__arc { fill: none; stroke: var(--accent-bg); stroke-width: 8; transition: stroke-dasharray .8s var(--ease); }
.gate__core { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.gate__core b { font-family: var(--f-px); font-size: 22px; }
.gate__core .rank-txt { font-size: 13px; }
.gate.is-clear .gate__arc { stroke: var(--teal); }

/* activity: a wall of lamps */
.hm-wrap { overflow-x: auto; padding: 2px 2px 6px; }
.hm { display: grid; grid-template-rows: repeat(7, 15px); grid-auto-flow: column; grid-auto-columns: 15px; gap: 5px; direction: ltr; width: max-content; }
[dir="rtl"] .hm-wrap { direction: ltr; }
.hm__c { display: block; width: 15px; height: 15px; border-radius: 50%; background: var(--off); }
.hm__c.l1 { background: color-mix(in srgb, var(--accent-bg) 32%, transparent); }
.hm__c.l2 { background: color-mix(in srgb, var(--accent-bg) 55%, transparent); }
.hm__c.l3 { background: #ffb224; }
.hm__c.l4 { background: #ff8a1f; }
:root[data-theme="dark"] .hm__c.l4 { box-shadow: 0 0 8px var(--led-glow); }
.hm__c.is-clear { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--teal); }
.hm__c.is-pen { background-image: radial-gradient(circle, var(--red) 0 3px, transparent 3.5px); }
.hm__c.is-today { outline: 1.5px solid var(--text); outline-offset: 2px; }
.hm__legend { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.hm__legend .hm__c { width: 11px; height: 11px; }

.counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px 12px; margin: 0; }
.counts > div { --cc: var(--accent-bg); padding: 12px 14px; border-radius: 12px; background: linear-gradient(180deg, color-mix(in srgb, var(--cc) 12%, var(--surface-2)), var(--surface-2)); box-shadow: inset 0 2px 0 var(--cc); }
.counts > div:nth-child(2) { --cc: var(--teal); } .counts > div:nth-child(3) { --cc: var(--s-str); }
.counts > div:nth-child(4) { --cc: var(--s-int); } .counts > div:nth-child(5) { --cc: var(--s-per); }
.counts > div:nth-child(6) { --cc: var(--s-vit); } .counts > div:nth-child(7) { --cc: var(--s-agi); }
.counts dt { font-size: 12.5px; color: var(--muted); }
.counts dd { margin: 4px 0 0; font-size: 28px; line-height: 1.1; }

.manual { margin: 0; display: grid; gap: 14px; }
.manual dt { font-weight: 600; }
.manual dd { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* ---------------------------------------------------------------- ranking */
.rank-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.rank-head .seg { margin-inline-start: auto; }
.lb-explain { margin: -8px 0 0; }
.podium { display: grid; grid-template-columns: 1fr 1.15fr 1fr; gap: 12px; align-items: end; }
.podium__slot {
  display: grid; justify-items: center; gap: 6px;
  padding: 0; background: none; border: 0; border-radius: 14px; cursor: pointer; color: var(--text);
}
.podium__name { font-size: 15px; font-weight: 600; max-width: 100%; text-align: center; overflow-wrap: anywhere; line-height: 1.3; }
.podium__meta { font-family: var(--f-px); font-size: 16px; color: var(--muted); }
.podium__base { width: 100%; margin-top: 8px; height: 64px; display: grid; place-items: center; border-radius: 12px 12px 4px 4px; }
.podium__pos { font-size: 40px; }
.podium__slot.p1 .podium__base { height: 104px; }
.podium__slot.p1 .podium__pos { font-size: 64px; }
.podium__slot.p2 .podium__base { height: 82px; }
.podium__slot.p2 .podium__pos, .podium__slot.p3 .podium__pos { color: var(--board-text); text-shadow: 0 0 5px rgba(243, 237, 226, .35); }
.podium__slot.is-me .podium__name { color: var(--accent); }

.lb-win .win__in { padding: 6px 10px; }
.lb { list-style: none; margin: 0; padding: 0; }
.lb__row + .lb__row { border-top: 1px solid var(--line); }
.lb__btn {
  display: grid; grid-template-columns: 44px 36px minmax(0, 1fr) auto auto; align-items: center; gap: 12px;
  width: 100%; padding: 10px 8px; background: none; border: 0; border-radius: 10px; cursor: pointer; text-align: start; color: var(--text);
}
.lb__btn:hover { background: var(--surface-2); }
.lb__row.is-me .lb__btn { background: color-mix(in srgb, var(--accent-bg) 10%, transparent); box-shadow: inset 3px 0 0 var(--accent-bg); }
[dir="rtl"] .lb__row.is-me .lb__btn { box-shadow: inset -3px 0 0 var(--accent-bg); }
.lb__pos { font-family: var(--f-px); font-weight: 700; font-size: 20px; color: var(--muted); text-align: center; }
.lb__who { display: grid; min-width: 0; line-height: 1.35; }
.lb__who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__who span { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb__streak { display: inline-flex; align-items: center; gap: 3px; font-family: var(--f-px); color: var(--faint); font-size: 16px; }
.lb__streak.is-on { color: var(--r-A); }
.lb__streak .ic { width: 15px; height: 15px; }
.lb__score { display: grid; text-align: end; min-width: 74px; line-height: 1.2; }
.lb__score b { font-family: var(--f-px); font-weight: 700; font-size: 18px; }
.lb__score small { font-size: 12px; color: var(--muted); font-family: var(--f-px); }
.lb-me { border: 1px dashed var(--line-2); border-radius: 14px; padding: 4px 8px; }
.skeleton { display: grid; gap: 10px; }
.skeleton span { height: 44px; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.2s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* profile */
.profile__top { display: flex; gap: 20px; align-items: center; }
.profile__title { color: var(--accent); font-weight: 500; }
.profile__nums { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.profile__nums span { display: grid; }
.profile__nums b { font-family: var(--f-px); font-size: 24px; line-height: 1.1; color: var(--text); }
.profile__body { display: grid; grid-template-columns: 240px 1fr; gap: 20px; margin-top: 20px; align-items: start; }
.profile__foot { display: flex; justify-content: flex-end; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.rep-note { margin-top: 4px; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 11px; font-size: 13px; border-radius: 99px; border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent); color: var(--accent); }
.badge .ic { width: 14px; height: 14px; }

/* arena */
.grid2--arena { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; }
.arena-left { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.pips { display: inline-flex; gap: 5px; }
.pip { width: 10px; height: 10px; border-radius: 50%; background: var(--off); }
.pip.is-on { background: var(--red); box-shadow: 0 0 8px color-mix(in srgb, var(--red) 60%, transparent); }
.arena-rule { margin: 0 0 16px; }
.combat { display: grid; gap: 9px; }
.cbar { display: grid; grid-template-columns: 44px 1fr 52px; align-items: center; gap: 10px; }
.cbar__lbl { font-size: 12px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.cbar b { font-family: var(--f-px); font-size: 16px; text-align: end; }
.bar--hp .bar__fill { background: linear-gradient(90deg, var(--red), var(--accent-bg)); }
[dir="rtl"] .bar--hp .bar__fill { background: linear-gradient(270deg, var(--red), var(--accent-bg)); }
.opps { list-style: none; margin: 0; padding: 0; }
.opp { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); }
.opp:first-child { border-top: 0; }
.opp__who { display: grid; min-width: 0; line-height: 1.35; }
.opp__who b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp__who span { font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opp__power { display: inline-flex; align-items: center; gap: 4px; font-family: var(--f-px); color: var(--muted); font-size: 16px; }
.opp__power .ic { width: 14px; height: 14px; }
.hist { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hist li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.hist li:first-child { border-top: 0; }
.hist li.is-win > b:first-child { color: var(--teal); }
.hist li.is-loss > b:first-child { color: var(--red); }
.hist li.is-def .ic { color: var(--muted); width: 15px; height: 15px; }
.hist__rp { margin-inline-start: auto; font-family: var(--f-px); font-size: 16px; }
.is-win .hist__rp { color: var(--teal); }
.is-loss .hist__rp { color: var(--red); }

.battle__sides { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.battle__vs { padding: 10px 12px 6px; }
.battle__vs .led { font-size: 34px; color: var(--led-red); text-shadow: 0 0 6px rgba(255, 106, 85, .6); }
.bside { display: grid; justify-items: center; gap: 6px; text-align: center; min-width: 0; }
.bside__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bside .bar { width: 100%; }
.bside .bar__fill { transition: width .35s var(--ease); }
.bside > b:last-child { font-family: var(--f-px); font-size: 18px; }
.blog {
  list-style: none; margin: 16px 0 0; padding: 12px 14px; height: 190px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 4px; font-size: 13.5px;
  border-radius: var(--r-board);
  background: var(--board); color: var(--board-text);
  box-shadow: inset 0 0 0 1px var(--board-edge), inset 0 3px 14px rgba(0, 0, 0, .55);
}
.blog li { animation: toastIn .25s var(--ease) both; }
.blog li.is-a { color: var(--led); }
.blog li.is-b { color: var(--led-red); }
.blog li.is-crit { font-weight: 700; }
.blog li.is-miss { color: var(--board-muted); }
.bresult { display: grid; justify-items: center; gap: 6px; margin-top: 16px; text-align: center; }
.bresult b { font-size: 30px; font-weight: 700; }
.bresult > span { font-family: var(--f-px); font-size: 24px; }
.bresult.is-win b, .bresult.is-win > span { color: var(--teal); }
.bresult.is-loss b, .bresult.is-loss > span { color: var(--red); }
.bresult .btn { margin-top: 8px; }

/* ---------------------------------------------------------------- titles: unlit and lit lamps */
.titles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.tcard { display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); align-items: start; }
.tcard > .btn { grid-column: 2; justify-self: start; }
.tcard__ic {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--board); color: rgba(255, 178, 36, .28);
  box-shadow: inset 0 0 0 1px var(--board-edge), inset 0 2px 8px rgba(0, 0, 0, .6);
}
.tcard__txt { display: grid; gap: 2px; min-width: 0; }
.tcard__txt span { font-size: 13px; color: var(--muted); }
.tcard.is-got .tcard__ic { color: var(--led); box-shadow: inset 0 0 0 1px rgba(255, 178, 36, .5), inset 0 0 12px rgba(255, 178, 36, .25), 0 0 14px rgba(255, 178, 36, .25); }
.tcard.is-got .tcard__ic .ic { filter: drop-shadow(0 0 4px var(--led-glow)); }
.tcard.is-got b { color: var(--text); }
.tcard.is-on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.tcard:not(.is-got) b { color: var(--faint); }

/* ---------------------------------------------------------------- settings & security */
.setrow, .secrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.secrow__main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.secrow__val { overflow-wrap: anywhere; color: var(--muted); }
.inline-form { display: flex; gap: 12px; align-items: flex-end; }
.inline-form .field { flex: 1; margin: 0; }
.btnrow { display: flex; flex-wrap: wrap; gap: 10px; }
.secwin .verify-banner { margin: 12px 0; }
.secblock { padding: 14px 0; border-bottom: 1px solid var(--line); }
.secblock__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.sessions, .events { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.sessions li { display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 10px; padding: 8px 0; }
.sessions li .ic { color: var(--muted); }
.sessions li.is-current .ic { color: var(--teal); }
.sessions__txt { display: grid; min-width: 0; line-height: 1.45; }
.sessions__txt b { font-weight: 500; font-size: 13.5px; }
.sessions__txt span { font-size: 12px; overflow-wrap: anywhere; }
.events { padding: 4px 18px 12px; }
.events li { display: grid; grid-template-columns: 1fr auto; gap: 0 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13px; }
.events li:first-child { border-top: 0; }
.events li b { font-weight: 500; }
.events li > span:nth-child(2) { grid-column: 1; font-size: 12px; }
.events li > span:nth-child(3) { grid-column: 2; grid-row: 1; font-size: 12px; }
.events li.is-warn b { color: var(--red); }
.qrbox { display: flex; gap: 18px; align-items: center; margin: 4px 0 16px; flex-wrap: wrap; }
.qr { width: 180px; height: 180px; flex: none; image-rendering: pixelated; border: 8px solid #fff; border-radius: 10px; }
.secret { display: inline-block; padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: 10px; font-family: var(--f-px); font-size: 17px; letter-spacing: .08em; word-break: break-all; }
.codes { list-style: none; margin: 0 0 14px; padding: 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 16px; border-radius: var(--r-board); background: var(--board); color: var(--led); box-shadow: inset 0 0 0 1px var(--board-edge); font-family: var(--f-px); font-size: 19px; letter-spacing: .06em; text-align: center; }

.pwm { display: flex; align-items: center; gap: 10px; margin: -8px 0 16px; }
.pwm__bar { flex: 1; height: 6px; background: var(--off); overflow: hidden; -webkit-mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px); mask: repeating-linear-gradient(90deg, #000 0 10px, transparent 10px 13px); }
.pwm__fill { display: block; height: 100%; width: 0; background: var(--red); transition: width .25s var(--ease), background-color .25s; }
.pwm[data-s="2"] .pwm__fill { background: var(--accent-bg); }
.pwm[data-s="3"] .pwm__fill, .pwm[data-s="4"] .pwm__fill { background: var(--teal); }
.pwm__lbl { font-size: 12px; color: var(--muted); min-width: 70px; text-align: end; }

.verify-banner {
  display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; align-items: start;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 16px;
  background: color-mix(in srgb, var(--accent-bg) 9%, var(--surface));
}
.verify-banner > .ic { color: var(--accent); margin-top: 3px; }
.verify-banner__txt { display: grid; gap: 2px; font-size: 13.5px; }
.verify-banner__txt span { color: var(--muted); overflow-wrap: anywhere; }
.verify-banner__form { grid-column: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.verify-banner__form .input { width: 150px; min-height: 40px; font-size: 18px; }

/* ---------------------------------------------------------------- editor */
.editor .field { margin-bottom: 18px; }
.tpl { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tpl__btn { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border: 1px dashed var(--line-2); border-radius: 99px; background: transparent; color: var(--text); cursor: pointer; font-size: 13px; white-space: nowrap; }
.tpl__btn .ic { width: 15px; height: 15px; color: var(--accent); }
.tpl__btn:hover { background: var(--surface-2); border-style: solid; }
.days__row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.daybtn { padding: 8px 0; border: 1px solid var(--line); border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12.5px; min-height: 40px; }
.daybtn.is-on { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent-bg) 14%, transparent); }
.days__presets { display: flex; gap: 10px; margin-top: 6px; }
.pick { display: grid; gap: 6px; }
.pick--stats { grid-template-columns: repeat(5, 1fr); }
.pick--diff { grid-template-columns: repeat(6, 1fr); }
.pickbtn { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; transition: border-color .15s, background-color .15s; }
.pickbtn b { font-weight: 600; color: var(--text); font-size: 13.5px; }
.pickbtn span { font-size: 11px; }
.pickbtn .ic { color: var(--muted); }
.pickbtn.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-bg) 13%, transparent); color: var(--text); }
.pickbtn.is-on .ic { color: var(--accent); }
.pickbtn--stat .ic { color: var(--sc); }
.pickbtn--stat.is-on { border-color: var(--sc); background: color-mix(in srgb, var(--sc) 13%, transparent); }
.pickbtn--stat.is-on .ic { color: var(--sc); }
.pickbtn--diff b { color: var(--c); font-family: var(--f-px); font-size: 22px; line-height: 1.1; }
.pickbtn--diff.is-on { border-color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.esc { border: 1px solid color-mix(in srgb, var(--red) 30%, transparent); border-radius: 14px; background: color-mix(in srgb, var(--red) 5%, transparent); padding: 14px; margin-bottom: 18px; display: grid; gap: 8px; }
.esc .field { margin: 6px 0 0; max-width: 200px; }
.esc__row { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.esc__lbl { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; }
.esc__lbl .ic { color: var(--red); }
.esc-preview { color: var(--red); font-family: var(--f-px); font-weight: 600; font-size: 17px; }
.reward { display: flex; align-items: center; gap: 8px; color: var(--accent); font-weight: 500; margin: 0 0 8px; }
.info { display: flex; gap: 10px; align-items: flex-start; padding: 11px 13px; font-size: 13px; margin: 0 0 16px; border: 1px solid var(--line); border-radius: 12px; }
.info .ic { flex: none; margin-top: 2px; width: 16px; height: 16px; }
.info--sys { border-color: color-mix(in srgb, var(--teal) 40%, transparent); background: color-mix(in srgb, var(--teal) 6%, transparent); }
.info--sys .ic { color: var(--teal); }
.info--custom { border-color: color-mix(in srgb, var(--accent) 40%, transparent); background: color-mix(in srgb, var(--accent-bg) 7%, transparent); }
.info--custom .ic { color: var(--accent); }
.syspanel__top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.syspanel__top .input { flex: 1; }
.catchips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 8px; scrollbar-width: thin; }
.catchip { flex: none; padding: 5px 13px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }
.catchip.is-on { color: var(--text); border-color: var(--accent); background: color-mix(in srgb, var(--accent-bg) 13%, transparent); }
.catalog { display: grid; gap: 6px; max-height: min(46vh, 420px); overflow-y: auto; padding: 2px; margin-bottom: 14px; }
.catitem {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--text); cursor: pointer; text-align: start;
  transition: border-color .15s, background-color .15s;
}
.catitem:hover:not(:disabled) { border-color: var(--line-2); background: var(--surface-2); }
.catitem.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-bg) 11%, transparent); }
.catitem:disabled { cursor: default; opacity: .6; }
.catitem__txt { display: grid; min-width: 0; }
.catitem__txt b { font-weight: 500; }
.catitem__txt span { font-size: 12.5px; }
.catitem__side { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.catitem__side .rewards { margin: 0; }
.sys-days { margin-top: 4px; }
.offcard { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 12px 14px; border: 1px solid var(--line-2); border-radius: 14px; margin-bottom: 14px; }
.offcard__txt { display: grid; }

/* ---------------------------------------------------------------- modal */
.backdrop {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 16px;
  background: color-mix(in srgb, #0b0914 62%, transparent);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade .18s ease both;
  overflow-y: auto;
}
.backdrop.is-out { animation: fade .14s ease reverse both; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(460px, 100%); min-width: 0; max-width: 100%; justify-self: center; margin: auto; box-shadow: var(--shadow); border-radius: 22px; animation: rise .3s var(--ease-out) both; }
.modal--wide { width: min(640px, 100%); }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
.modal .win__in { padding: 22px 24px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; min-width: 0; }
.modal__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.modal__title { margin: 0; font-size: 19px; font-weight: 700; flex: 1; }
.modal__body, .editor, .syspanel, .custompanel { min-width: 0; }
.modal__body > p:first-child { margin-top: 0; }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.catchips, .catalog { max-width: 100%; }

/* onboarding packs */
.packs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 14px; }
.pack { position: relative; display: grid; gap: 4px; align-content: start; text-align: start; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: transparent; color: var(--text); cursor: pointer; transition: border-color .15s, background-color .15s; }
.pack:hover { background: var(--surface-2); }
.pack.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-bg) 10%, transparent); }
.pack__check { position: absolute; top: 12px; inset-inline-end: 12px; width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--line-2); border-radius: 50%; color: transparent; }
.pack.is-on .pack__check { background: var(--accent-bg); border-color: var(--accent-bg); color: var(--on-accent); }
.pack__check .ic { width: 14px; height: 14px; stroke-width: 2.8; }
.pack__kind { justify-self: start; margin-bottom: 4px; }
.pack__desc { font-size: 13px; color: var(--muted); }
.pack__stats { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.pack__list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; }
.pack__list li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.pack__list .dchip { min-width: 20px; height: 18px; font-size: 13px; }
.pack--custom { border-style: dashed; }
.pack__note { font-size: 12.5px; color: var(--accent); margin-top: 6px; }
.ob-explain { display: grid; gap: 6px; margin: 12px 0 4px; font-size: 13px; }
.ob-explain p { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.notices { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.notice { padding: 13px 15px; border: 1px solid var(--line); border-radius: 14px; }
.notice p { margin: 0; }
.notice--red { border-color: color-mix(in srgb, var(--red) 40%, transparent); background: color-mix(in srgb, var(--red) 7%, transparent); }
.notice--gold { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: color-mix(in srgb, var(--accent-bg) 8%, transparent); }
.notice__q { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; font-weight: 500; }
.notice__q li { display: flex; align-items: center; gap: 6px; color: var(--red); }
.notice__q .ic { width: 14px; height: 14px; }
.notice__xp { color: var(--red); font-weight: 600; }

/* ---------------------------------------------------------------- toasts */
#toasts { position: fixed; z-index: 200; inset-inline: 0; bottom: 20px; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 12px;
  min-width: 260px; max-width: 440px;
  padding: 10px 18px 10px 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: toastIn .35s var(--ease-out) both;
  pointer-events: auto;
}
[dir="rtl"] .toast { padding: 10px 10px 10px 18px; }
.toast.is-out { animation: toastOut .25s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }
.toast__ic {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%;
  background: var(--board); color: var(--led-teal);
  box-shadow: inset 0 0 0 1px var(--board-edge);
}
.toast__ic .ic { filter: drop-shadow(0 0 4px currentColor); width: 17px; height: 17px; }
.toast__body { display: grid; line-height: 1.4; min-width: 0; }
.toast__body strong { font-weight: 600; }
.toast__body span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.toast__body .toast__meta { font-family: var(--f-px); font-weight: 600; font-size: 16px; color: var(--accent) !important; unicode-bidi: isolate; }
.toast--gold .toast__ic { color: var(--led); }
.toast--red { border-color: color-mix(in srgb, var(--red) 55%, var(--line-2)); }
.toast--red .toast__ic { color: var(--led-red); }
.toast--info .toast__ic { color: var(--board-muted); }

/* ---------------------------------------------------------------- celebrations */
.celebrate {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center;
  padding: 20px;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--k, #ffb224) 22%, transparent), transparent 55%), color-mix(in srgb, #0b0914 84%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade .25s ease both;
  cursor: pointer;
  outline: none;
}
.celebrate.is-out { animation: fade .2s ease reverse both; }
.celebrate--level, .celebrate--gate { --k: var(--led); }
.celebrate--rank { --k: var(--rl-S); }
.celebrate--clear { --k: var(--led-teal); }
.celebrate__card { position: relative; display: grid; justify-items: center; gap: 12px; text-align: center; padding: 20px; animation: rise .5s var(--ease-out) both; color: #f3ede2; }
.celebrate__board { padding: 22px 34px 16px; min-width: 220px; display: grid; place-items: center; }
.celebrate__big { display: flex; align-items: flex-end; gap: 12px; font-family: var(--f-led); color: var(--k); }
.celebrate__big small { font-family: var(--f-px); font-size: 26px; color: var(--board-muted); padding-bottom: 14px; }
.celebrate__num { font-size: clamp(110px, 24vw, 180px); }
.celebrate__check { width: 120px; height: 120px; display: grid; place-items: center; color: var(--k); }
.celebrate__check .ic { width: 84px; height: 84px; stroke-width: 2.6; filter: drop-shadow(0 0 10px var(--k)); }
.celebrate__crest .crest { animation: crestIn .9s var(--ease-out) both; }
@keyframes crestIn { 0% { transform: scale(.6); opacity: 0; } 30% { opacity: 1; } 45% { opacity: .3; } 60%, 100% { opacity: 1; transform: none; } }
.celebrate__title { font-weight: 700; font-size: clamp(30px, 6vw, 50px); line-height: 1.2; margin-top: 8px; }
.celebrate__sub { font-size: 16px; color: var(--k); font-weight: 500; max-width: 34ch; }
.celebrate__btn { margin-top: 12px; }

/* ---------------------------------------------------------------- install */
.install-banner { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: 16px; background: var(--surface); }
.install-banner img { flex: none; border-radius: 9px; }
.install-banner p { margin: 0; flex: 1; font-size: 13.5px; line-height: 1.5; }
.steps { margin: 0 0 12px; padding-inline-start: 22px; display: grid; gap: 8px; }
.steps li::marker { color: var(--accent); font-family: var(--f-px); font-weight: 700; }
.grow { flex: 1; margin: 0; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .shell { grid-template-columns: 270px minmax(0, 1fr); padding: 0 16px 40px; }
  .topbar { gap: 14px; }
  .nav__a span { display: none; }
  .nav__a { padding: 9px 11px; }
  .status__stats { grid-template-columns: 1fr; }
  .counts { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  :root { --gap: 14px; }
  .input { font-size: 16px; }
  .topbar { padding-top: max(10px, env(safe-area-inset-top)); }
  .shell { grid-template-columns: 1fr; grid-template-areas: "top" "side" "main"; padding: 0 16px calc(88px + env(safe-area-inset-bottom)); }
  .nav--top { display: none; }
  .nav--bottom {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; z-index: 30; inset-inline: 0; bottom: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }
  .nav--bottom .nav__a { flex-direction: column; gap: 3px; padding: 8px 2px 6px; font-size: 11px; justify-content: center; }
  .nav--bottom .nav__a span { display: block; }
  .nav--bottom .nav__a::after { top: -7px; bottom: auto; width: 22px; }
  .nav--bottom .ic { width: 22px; height: 22px; }
  .side > .win { position: static; }
  .shell.v-ranking .side, .shell.v-titles .side, .shell.v-settings .side, .shell.v-gym .side, .shell.v-arena .side, .shell.v-plans .side, .shell.v-progress .side { display: none; }
  .hunter .mini-stats, .hunter .gate-mini { display: none; }
  .hunter__board { margin: 14px 0 10px; }
  .hunter__lvl-num { font-size: 60px; }
  .hunter__chips { margin: 12px 0 0; }
  .grid2, .grid2--arena { grid-template-columns: 1fr; }
  .status__grid { grid-template-columns: 1fr; }
  .win__in, .dq .win__in { padding: 18px 16px; }
  .profile__body { grid-template-columns: 1fr; justify-items: center; }
  .brand__word { font-size: 26px; }
}
@media (max-width: 520px) {
  body { font-size: 14.5px; }
  .topbar { padding: 10px 0; }
  .qrow { gap: 12px; }
  .qrow__top { flex-wrap: wrap; gap: 2px 10px; }
  .qcount { margin-inline-start: 0; }
  .qrow__side { flex-direction: column; align-items: flex-end; gap: 6px; }
  .qrow__side .qctrl, .qacts { flex-direction: row; }
  .row2 { grid-template-columns: 1fr; gap: 0; }
  .pickbtn span { display: none; }
  .pick--diff { grid-template-columns: repeat(3, 1fr); }
  .pick--diff .pickbtn span { display: block; }
  .packs { grid-template-columns: 1fr; }
  .counts { grid-template-columns: repeat(2, 1fr); }
  .lb__btn { grid-template-columns: 34px 32px minmax(0, 1fr) auto; gap: 8px; }
  .lb__streak { display: none; }
  .podium { gap: 6px; }
  .podium__base { height: 52px; }
  .podium__slot.p1 .podium__base { height: 84px; }
  .podium__slot.p2 .podium__base { height: 66px; }
  .trial__body, .gate__body { flex-direction: column; text-align: center; }
  .profile__top { flex-direction: column; text-align: center; }
  .profile__nums { justify-content: center; }
  .inline-form { flex-direction: column; align-items: stretch; }
  .modal__foot .btn { flex: 1; }
  .modal__foot .push-end { flex-basis: 100%; order: 3; }
  .catitem { grid-template-columns: auto minmax(0, 1fr); }
  .catitem__side { grid-column: 1 / -1; justify-content: flex-start; }
  .offcard { grid-template-columns: auto 1fr; }
  .opp { grid-template-columns: 32px minmax(0, 1fr) auto; }
  .codes { grid-template-columns: 1fr; }
  .verify-banner { grid-template-columns: 1fr; }
  .verify-banner > .ic { display: none; }
  .verify-banner__form { grid-column: 1; }
  .dq__legend .push-start { margin-inline-start: 0; flex-basis: 100%; }
  .seg--tabs .seg__btn .ic { display: none; }
  .seg--tabs .seg__btn { padding: 7px 6px; font-size: 13.5px; }
  .dq__time { font-size: 30px; }
  .battle__vs .led { font-size: 26px; }
}
@media (display-mode: standalone) {
  .shell { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   v3: gym, rated quests, fights
   ========================================================================== */
.led--dim { color: rgba(255, 178, 36, .35); text-shadow: none; }
.led--teal { color: var(--led-teal); text-shadow: 0 0 5px rgba(62, 214, 191, .55), 0 0 16px rgba(62, 214, 191, .2); }
.led--red { color: var(--led-red); text-shadow: 0 0 6px rgba(255, 106, 85, .6); }
.icon-btn.is-on { color: var(--accent); }
.tag--up { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 45%, transparent); background: color-mix(in srgb, var(--teal) 9%, transparent); }

/* amount picker (official quests) */
.amount__row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.amount__in { width: 110px; text-align: center; font-family: var(--f-px); font-size: 20px; }
.amount .rewards { margin-inline-start: 6px; }

/* the System's rating box (custom quests) */
.ratebox { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; padding: 12px; margin-bottom: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.ratebox__board { display: grid; justify-items: center; gap: 2px; padding: 8px 14px 6px; min-width: 92px; }
.ratebox__lbl { font-size: 11px; color: var(--board-muted); }
.ratebox__tier { font-size: 44px; color: var(--cl); text-shadow: 0 0 8px color-mix(in srgb, var(--cl) 60%, transparent); }
.ratebox__txt { display: grid; gap: 2px; min-width: 0; }
.ratebox__txt .xp { justify-self: start; }
.pickbtn--stat.is-auto { border-style: dashed; }

/* ---- gym */
.gym-hero { display: grid; justify-items: center; gap: 10px; padding: 22px 18px 18px; text-align: center; margin-bottom: 18px; }
.gym-hero .led { font-size: 64px; }
.gym-hero p { margin: 0; max-width: 52ch; color: var(--board-text); }
.progs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.prog { display: grid; gap: 6px; align-content: start; text-align: start; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, transform .15s, background-color .15s; }
.prog:hover { border-color: var(--accent); background: var(--surface-2); transform: translateY(-2px); }
.prog b { font-size: 16px; }
.prog .muted { font-size: 13px; }
.prog__days { display: flex; gap: 4px; margin-bottom: 4px; }
.prog__days i { width: 10px; height: 10px; border-radius: 50%; background: var(--off); }
.prog__days i.is-on { background: var(--g-xp); box-shadow: 0 0 6px rgba(255, 170, 40, .5); }
.prog__codes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.prog__codes .led { font-size: 15px; padding: 3px 6px 1px; border-radius: 6px; background: var(--board); }
.prog--custom { border-style: dashed; }
.prog--custom .prog__days { color: var(--accent); }
.prog-seg .seg__btn { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: start; }
.seg--days { grid-auto-flow: column; margin-bottom: 14px; }
.seg--days .seg__btn { padding: 7px 4px; font-size: 13px; position: relative; }
.seg--days .seg__btn.has-plan::after { content: ''; position: absolute; top: 4px; inset-inline-end: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-bg); }

.gym-today__top { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.gym-today__txt { display: grid; gap: 2px; min-width: 0; flex: 1; }
.gym-today__meta .num { font-size: 18px; }
.gym-today__ok { display: inline-flex; align-items: center; gap: 6px; color: var(--teal); font-weight: 600; }
.gym-today__bar { margin-bottom: 16px; }
.gym-today.is-done { border-color: color-mix(in srgb, var(--teal) 50%, var(--line)); }
.gym-today.is-done .gym-today__bar .bar__fill { background: var(--g-rp); }
.gym-code { display: grid; place-items: center; min-width: 104px; padding: 12px 14px 8px; }
.gym-code .led { font-size: 34px; }
.gym-code--sm { min-width: 76px; padding: 8px 10px 5px; }
.gym-code--sm .led { font-size: 22px; }
.gym-code--xs { min-width: 58px; padding: 5px 7px 3px; border-radius: 7px; }
.gym-code--xs .led { font-size: 16px; }

.wk { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.wk__d { width: 100%; display: grid; justify-items: center; gap: 6px; padding: 8px 2px; border: 1px solid var(--line); border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; transition: border-color .15s, background-color .15s; }
.wk__d:disabled { cursor: default; }
.wk__d:not(:disabled):hover { border-color: var(--accent); }
.wk__code { width: 100%; max-width: 64px; padding: 5px 2px 3px; border-radius: 6px; display: grid; place-items: center; }
.wk__code .led { font-size: 14px; letter-spacing: 0; }
.wk__st { height: 16px; display: grid; place-items: center; }
.wk__st .ic { width: 15px; height: 15px; stroke-width: 2.6; }
.wk__d.is-today { border-color: var(--accent); color: var(--text); background: color-mix(in srgb, var(--accent-bg) 8%, transparent); }
.wk__d.is-done .wk__st { color: var(--teal); }
.wk__d.is-missed .wk__st { color: var(--red); }
.wk__d.is-rest { opacity: .7; }

.gx .win__in { padding: 18px 20px; }
.gx__head { display: flex; align-items: center; gap: 12px; }
.gx__n { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 9px; background: var(--surface-2); font-family: var(--f-px); font-size: 17px; color: var(--muted); }
.gx__t { flex: 1; min-width: 0; display: grid; }
.gx__t h3 { margin: 0; font-size: 16px; font-weight: 600; overflow-wrap: anywhere; }
.gx__t .muted { font-size: 12.5px; }
.gx__count { font-family: var(--f-px); font-size: 18px; color: var(--muted); }
.gx.is-done { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.gx.is-done .gx__n { background: var(--teal); color: var(--bg); }
.gx.is-done .gx__count { color: var(--teal); }
.gx__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 10px 0 0; font-size: 12.5px; }
.gsets { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 6px; }
.gset { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 40px; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 12px; background: var(--surface-2); transition: background-color .2s; }
.gset.is-done { background: color-mix(in srgb, var(--teal) 10%, var(--surface-2)); }
.gset__n { font-family: var(--f-px); font-size: 17px; color: var(--muted); text-align: center; }
.gset__f { display: flex; align-items: center; gap: 6px; min-width: 0; }
.gset__f .input { min-width: 0; width: 100%; text-align: center; font-family: var(--f-px); font-size: 19px; }
.gset__f small { color: var(--muted); font-size: 11.5px; flex: none; }
.gset__ok { margin: 0; justify-self: end; }
.gset.is-done .input { color: var(--teal); }
.prs { margin-top: 14px; }

/* rest timer: a little scoreboard floating above the bottom bar */
.rest {
  --k: 1;
  position: fixed; z-index: 150; inset-inline: 0; margin-inline: auto; bottom: calc(18px + env(safe-area-inset-bottom));
  width: min(360px, calc(100% - 32px));
  display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 16px;
  box-shadow: inset 0 0 0 1px var(--board-edge), 0 16px 40px rgba(0, 0, 0, .45);
  animation: rise .3s var(--ease-out) both;
  overflow: hidden;
}
.rest::after { content: ''; position: absolute; inset-inline-start: 0; bottom: 0; height: 3px; width: calc(var(--k) * 100%); background: var(--g-xp); transition: width .25s linear; }
.rest__lbl { color: var(--board-muted); font-size: 13px; }
.rest__time { font-size: 36px; margin-inline-end: auto; }
.rest__btn { color: var(--board-text); }
.rest__btn:hover:not(:disabled) { background: rgba(255, 255, 255, .08); color: #fff; }
@media (max-width: 820px) { .rest { bottom: calc(86px + env(safe-area-inset-bottom)); } }

/* plan builder */
.builder .info { margin-bottom: 14px; }
.brows { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.brow { display: grid; grid-template-columns: minmax(0, 1.5fr) 62px minmax(0, 1.25fr) 80px 66px auto; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.brow__name { display: grid; min-width: 0; align-self: center; }
.brow__name b { font-weight: 600; overflow-wrap: anywhere; }
.brow__name .muted { font-size: 12px; }
.brow__f { display: grid; gap: 3px; min-width: 0; }
.brow__f small { font-size: 11px; color: var(--muted); }
.brow__f .input { min-width: 0; width: 100%; text-align: center; padding-inline: 4px; }
.brow__range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 3px; }
.brow__acts { display: flex; gap: 2px; }
.copy-from { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; font-size: 13px; }
.pick-custom { display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.pick-custom .btn { justify-self: start; }

/* ---- fights */
.fighter { overflow: hidden; }
.fighter--me { background: linear-gradient(180deg, color-mix(in srgb, var(--c) 12%, var(--surface)), var(--surface) 200px); border-color: color-mix(in srgb, var(--c) 30%, var(--line)); }
.fighter__head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.fighter__score { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.fscore { display: grid; justify-items: center; gap: 4px; padding: 10px 8px 6px; }
.fscore__lbl { font-size: 12px; color: var(--board-muted); }
.fscore .led { font-size: 40px; }
.fighter__radar { display: grid; place-items: center; margin: 6px 0 4px; }
.fighter__radar .radar { max-width: 210px; }
.opp { grid-template-columns: 50px minmax(0, 1fr) auto auto; padding: 12px 0; }
.opp__nums { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.opp__power { font-size: 16px; color: var(--text); }
.opp__power .ic { color: var(--accent); }
.opp__chance { display: grid; justify-items: center; padding: 6px 10px 4px; min-width: 76px; }
.opp__chance small { font-size: 10.5px; color: var(--board-muted); white-space: nowrap; }
.opp__chance .led { font-size: 24px; }
.opp__chance.is-good .led { color: var(--led-teal); text-shadow: 0 0 6px rgba(62, 214, 191, .5); }
.opp__chance.is-bad .led { color: var(--led-red); text-shadow: 0 0 6px rgba(255, 106, 85, .5); }
.bal { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.bal__track { width: 70px; height: 6px; border-radius: 3px; background: var(--off); overflow: hidden; }
.bal__fill { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--s-str), var(--s-agi), var(--s-int), var(--s-vit), var(--s-per)); }
.bal b { font-family: var(--f-px); font-size: 15px; color: var(--muted); }

/* battle stage */
.arena-stage {
  --dir: 1;
  position: relative;
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center;
  padding: 18px 10px 14px; border-radius: 16px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(255, 170, 40, .18), transparent 60%),
    linear-gradient(180deg, #17142a, #0f0d18);
  box-shadow: inset 0 0 0 1px var(--board-edge);
  color: #f3effb;
  overflow: hidden;
}
[dir="rtl"] .arena-stage { --dir: -1; }
.arena-stage.is-quake { animation: quake .38s cubic-bezier(.36, .07, .19, .97); }
@keyframes quake { 10%, 90% { transform: translate(-1px, 1px); } 20%, 80% { transform: translate(3px, -2px); } 30%, 50%, 70% { transform: translate(-5px, 2px); } 40%, 60% { transform: translate(5px, -1px); } }
.bf { display: grid; justify-items: center; gap: 8px; text-align: center; min-width: 0; transition: filter .4s, opacity .4s; }
.bf__body { position: relative; display: grid; place-items: center; }
.bf .crest--xl { --s: 110px; }
.bf__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bf__hp { width: 100%; }
.bf > b.num { font-size: 18px; }
.bf__fx { position: absolute; inset: -10px; border-radius: 30%; pointer-events: none; opacity: 0; }
.bf--a.is-lunge .bf__body { animation: lungeA .42s var(--ease-out); }
.bf--b.is-lunge .bf__body { animation: lungeB .42s var(--ease-out); }
@keyframes lungeA { 40% { transform: translateX(calc(var(--dir) * 34px)) scale(1.06); } }
@keyframes lungeB { 40% { transform: translateX(calc(var(--dir) * -34px)) scale(1.06); } }
.bf.is-cast .bf__body { animation: cast .5s var(--ease-out); }
.bf.is-cast .bf__fx { animation: castRing .5s ease-out; box-shadow: 0 0 0 3px #8f7bff, 0 0 30px #8f7bff; }
@keyframes cast { 40% { transform: translateY(-8px) scale(1.04); } }
@keyframes castRing { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.35); } }
.bf.is-hit .bf__body { animation: hit .4s ease-out; }
.bf.is-hit .crest { animation: flash .4s ease-out; }
@keyframes hit { 15% { transform: translateX(calc(var(--dir) * -6px)) rotate(-4deg); } 45% { transform: translateX(calc(var(--dir) * 5px)) rotate(3deg); } 75% { transform: translateX(calc(var(--dir) * -2px)); } }
@keyframes flash { 0%, 30% { filter: brightness(2.2) saturate(.2) drop-shadow(0 0 14px #ff5a46); } }
.bf.is-dodge .bf__body { animation: dodge .45s var(--ease-out); }
@keyframes dodge { 35% { transform: translateY(-14px) translateX(calc(var(--dir) * 8px)); opacity: .55; } }
.dmg {
  position: absolute; top: 30%; left: 50%; translate: -50% 0; z-index: 2;
  font-family: var(--f-px); font-weight: 700; font-size: 28px; line-height: 1; white-space: nowrap;
  color: #ffd166; text-shadow: 0 2px 0 #3a1d00, 0 0 12px rgba(255, 170, 40, .7);
  pointer-events: none; animation: dmgUp 1.05s var(--ease-out) forwards;
}
.dmg--spell { color: #b8a8ff; text-shadow: 0 2px 0 #1b1240, 0 0 12px rgba(143, 123, 255, .8); }
.dmg--crit { font-size: 44px; color: #ff6a55; text-shadow: 0 2px 0 #3d0a04, 0 0 18px rgba(255, 90, 70, .9); }
.dmg--miss { font-size: 20px; color: #c9c3dc; text-shadow: none; letter-spacing: .1em; }
@keyframes dmgUp { 0% { opacity: 0; transform: translateY(10px) scale(.6); } 18% { opacity: 1; transform: translateY(-6px) scale(1.15); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }
.bf.is-ko { animation: ko .8s var(--ease-out) forwards; }
@keyframes ko { 30% { transform: rotate(calc(var(--dir) * -8deg)) translateY(-6px); } 100% { transform: rotate(calc(var(--dir) * 14deg)) translateY(14px); filter: grayscale(1) brightness(.55); opacity: .7; } }
.bf.is-lose { filter: grayscale(.85) brightness(.7); }
.bf.is-winner .crest { animation: champ 1.4s ease-in-out infinite alternate; }
@keyframes champ { to { box-shadow: inset 0 0 0 1.5px var(--cl), 0 0 28px color-mix(in srgb, var(--cl) 70%, transparent), 0 0 60px rgba(255, 170, 40, .35); transform: translateY(-4px); } }
.battle__bar { display: flex; justify-content: flex-end; margin-top: 10px; }
.battle__bar [hidden] { display: none; }
.blog { height: 150px; }
.blog li.is-spell { color: #b8a8ff; }
.bresult__board { padding: 14px 26px 10px; }
.bresult__board .led { font-size: 54px; }

@media (max-width: 520px) {
  .wk { gap: 4px; }
  .wk__d { padding: 6px 1px; font-size: 11px; }
  .wk__code .led { font-size: 12px; }
  .gym-code { min-width: 84px; }
  .gym-code .led { font-size: 28px; }
  .gset { grid-template-columns: 22px minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 6px; padding: 6px; }
  .gset__f small { display: none; }
  .brow { grid-template-columns: 1fr 1fr; }
  .brow__name { grid-column: 1 / -1; }
  .brow__acts { justify-content: flex-end; }
  .opp { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .opp > .btn { grid-column: 1 / -1; }
  .opp .crest--md { --s: 40px; }
  .bf .crest--xl { --s: 78px; }
  .dmg { font-size: 22px; }
  .dmg--crit { font-size: 34px; }
  .ratebox { grid-template-columns: 1fr; }
  .ratebox__board { justify-self: start; }
  .fscore .led { font-size: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .dmg { display: none; }
}

/* ==========================================================================
   v4 — schedules, character, monthly report, weekly challenges, proof, guide
   ========================================================================== */
a.seg__btn { text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }

/* schedule tabs: gym + each of your schedules */
.stabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: -6px 0 0; scrollbar-width: none; }
.stabs::-webkit-scrollbar { display: none; }
.stab { flex: none; display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; min-height: 38px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); text-decoration: none; font-weight: 500; font-size: 14px; cursor: pointer; transition: border-color .15s, color .15s, background-color .15s; }
.stab:hover { color: var(--text); border-color: var(--line-2); }
.stab.is-on { color: var(--on-accent); background: var(--g-btn); border-color: transparent; box-shadow: 0 6px 18px -8px rgba(255, 160, 30, .7); }
.stab .ic { width: 16px; height: 16px; }
.stab__ok { color: var(--teal); }
.stab.is-on .stab__ok { color: inherit; }
.stab--add { border-style: dashed; background: transparent; }
.sched-cards { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.sched-card { position: relative; }
.sched-card__ic { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: var(--on-accent); background: var(--g-btn); margin-bottom: 4px; }
.sched-card__ic .ic { width: 22px; height: 22px; }
.sched-card .tag { justify-self: start; }

/* a day of a schedule */
.ptasks { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 8px; }
.ptask { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); transition: background-color .2s; }
.ptask .qcheck { margin: 0; }
.ptask__t { font-weight: 600; overflow-wrap: anywhere; }
.ptask__n { font-family: var(--f-px); font-size: 17px; color: var(--muted); }
.ptask.is-done { background: color-mix(in srgb, var(--teal) 11%, var(--surface-2)); }
.ptask.is-done .ptask__t { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--teal) 70%, transparent); }
.ptask.is-done .ptask__n { color: var(--teal); }
.plan-today .gym-today__meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pweek { margin: 14px 0 0; display: grid; gap: 6px; }
.pweek__d { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 8px 12px; border-radius: 10px; font-size: 13.5px; }
.pweek__d dt { color: var(--muted); }
.pweek__d dd { margin: 0; overflow-wrap: anywhere; }
.pweek__d.is-today { background: color-mix(in srgb, var(--accent-bg) 9%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.pweek__d.is-today dt { color: var(--accent); font-weight: 600; }
div.wk__d { cursor: default; }
.prows { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.prow { display: grid; grid-template-columns: minmax(0, 1fr) 84px 110px auto; gap: 8px; align-items: center; }
.prow__n { text-align: center; font-family: var(--f-px); font-size: 17px; }
.seg--wrap { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
.qrow.is-plan .qcheck, .qrow.is-gym .qcheck { text-decoration: none; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line-2)); }
.qrow.is-plan .qcheck.is-done, .qrow.is-gym .qcheck.is-done { color: var(--bg); }
.gym-next { margin: 4px 0 0; display: flex; align-items: center; gap: 8px; color: var(--accent); }
.gym-next .ic { flex: none; }
.gym-offhint { display: flex; align-items: center; gap: 6px; color: var(--accent); }
.gym-mins { max-width: 120px; text-align: center; font-family: var(--f-px); font-size: 18px; }
.gym-clock { display: grid; justify-items: center; gap: 3px; padding: 9px 14px 7px; min-width: 92px; margin-inline-start: auto; }
.gym-clock .led { font-size: 30px; }
.gym-clock small { font-size: 11px; color: var(--board-muted); }

/* proof */
.tag--vf { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 50%, transparent); background: color-mix(in srgb, var(--teal) 12%, transparent); font-weight: 600; }
.tag--btn { cursor: pointer; background: transparent; font: inherit; font-size: 12px; border-style: dashed; transition: color .15s, border-color .15s; }
.tag--btn:hover { color: var(--teal); border-color: var(--teal); border-style: solid; }
.vf-quest { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 16px; }
.vf-quest .ic { color: var(--teal); width: 22px; height: 22px; }
.inbox { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.inbox li { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.inbox p { margin: 0 0 8px; }
.win.inbox { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, var(--teal) 9%, var(--surface)), var(--surface) 140px); }
.badge-n { min-width: 24px; height: 24px; padding: 0 7px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--teal); color: var(--bg); font-family: var(--f-px); font-size: 15px; }
.notice .btnrow { margin-top: 8px; }

/* motivation line */
.moto { margin: -4px 0 14px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.moto .ic { color: var(--accent); flex: none; width: 16px; height: 16px; }

/* weekly challenges */
.weekly { background: radial-gradient(520px 160px at 100% 0, color-mix(in srgb, var(--s-per) 13%, transparent), transparent 70%), var(--surface); }
.weekly .win__title .ic { color: var(--s-per); }
.chals { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.chal { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 14px; background: var(--surface-2); }
.chal__ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--s-per); background: color-mix(in srgb, var(--s-per) 14%, transparent); }
.chal__ic .ic { width: 20px; height: 20px; }
.chal__main { display: grid; gap: 4px; min-width: 0; }
.chal__top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.chal__top b { font-weight: 600; }
.chal__desc { font-size: 13px; }
.chal__n { font-family: var(--f-px); font-size: 18px; color: var(--muted); }
.chal.is-done { background: color-mix(in srgb, var(--teal) 11%, var(--surface-2)); }
.chal.is-done .chal__ic { color: var(--bg); background: var(--teal); }
.chal.is-done .chal__n, .chal.is-done .xp { color: var(--teal); }
.chal.is-locked { opacity: .78; background: transparent; border: 1px dashed var(--line-2); }
.chal.is-locked .chal__ic { color: var(--muted); background: var(--surface-2); }
.chal__lock { display: grid; justify-items: center; gap: 3px; text-align: center; }
.chal__lock small { font-size: 10.5px; color: var(--muted); max-width: 92px; line-height: 1.3; }
.weekly .bar--gate .bar__fill { background: linear-gradient(90deg, var(--s-per), var(--s-int)); }

/* your character */
.av { width: 100%; height: auto; display: block; overflow: visible; --av: var(--accent-bg); }
.av__aura { fill: color-mix(in srgb, var(--c, var(--av)) 26%, transparent); }
.av__shadow { fill: rgba(0, 0, 0, .28); }
.av__torso { fill: color-mix(in srgb, var(--av) 72%, #1b1530); stroke: color-mix(in srgb, var(--av) 72%, #1b1530); stroke-width: 3; stroke-linejoin: round; }
.av__limb { stroke: color-mix(in srgb, var(--av) 55%, #1b1530); stroke-linecap: round; }
.av__leg { stroke: #2b2540; }
:root[data-theme="light"] .av__leg { stroke: #3a3352; }
.av__shoe { fill: #15121f; }
.av__belt { stroke: #15121f; stroke-width: 2.4; stroke-linecap: round; opacity: .55; }
.av__emblem { fill: none; stroke: var(--led); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 3px var(--led-glow)); }
.av__skin { fill: #d9a77e; }
.av__hair { fill: #241c2e; }
.av__visor { fill: var(--led-teal); filter: drop-shadow(0 0 3px rgba(62, 214, 191, .8)); }
.av--was { --av: var(--line-2); opacity: .8; }
.av--was .av__emblem, .av--was .av__visor { filter: none; opacity: .5; }
.av--ghost { --av: var(--line-2); opacity: .55; }
.charwin { background: radial-gradient(420px 260px at 18% 30%, color-mix(in srgb, var(--accent-bg) 10%, transparent), transparent 70%), var(--surface); }
.charwin__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 22px; align-items: center; }
.charwin__pair { display: flex; align-items: flex-end; justify-content: center; gap: 6px; }
.charwin__arrow { font-family: var(--f-px); font-size: 26px; color: var(--muted); align-self: center; }
.charfig { margin: 0; display: grid; justify-items: center; gap: 6px; width: 150px; }
.charwin__pair.is-single .charfig { width: 190px; }
.charfig figcaption { display: grid; justify-items: center; font-size: 12.5px; }
.charfig figcaption b { font-family: var(--f-px); font-size: 20px; }
.charfig.is-now figcaption b { color: var(--accent); }
.charwin__side { display: grid; gap: 14px; min-width: 0; }
.charwin__empty { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 20px; align-items: center; }
.charwin__empty .btn { margin-top: 10px; }
.bodynums { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.bnum { display: grid; gap: 2px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.bnum .muted { font-size: 12px; }
.bnum b { font-family: var(--f-px); font-size: 22px; line-height: 1.1; }
.bnum b .u, .charfig b .u, .rptable td .u { font-family: var(--f-ui); font-size: 12px; font-weight: 500; color: var(--muted); }
.bnum small { font-size: 12px; color: var(--muted); }
.bnum.is-good b { color: var(--teal); }
.bnum.is-bad b { color: var(--red); }
.wchart-wrap { display: grid; gap: 4px; }
.wchart { width: 100%; height: 110px; display: block; border-radius: 12px; background: var(--surface-2); }
.wchart__line { fill: none; stroke: var(--accent-bg); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.wchart__area { fill: color-mix(in srgb, var(--accent-bg) 16%, transparent); }
.wchart__goal { stroke: var(--teal); stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; }
.wchart__axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); }
.wchart__gl { color: var(--teal); }
.body-setup__grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: center; }
.body-prev { padding: 8px; border-radius: 16px; background: radial-gradient(circle at 50% 60%, color-mix(in srgb, var(--accent-bg) 14%, transparent), transparent 70%), var(--surface-2); }
.body-setup__form { display: grid; gap: 12px; }
.body-setup__form .field { margin: 0; }

/* monthly report */
.report .win__head .seg { max-width: 100%; overflow-x: auto; }
.rptable-wrap { overflow-x: auto; margin: 0 -4px; }
.rptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.rptable th, .rptable td { padding: 8px 6px; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rptable thead th { font-size: 12px; font-weight: 500; color: var(--muted); }
.rptable tbody th { font-weight: 500; color: var(--muted); }
.rptable td { font-family: var(--f-px); font-size: 17px; }
.rptable tr.st-str th, .rptable tr.st-agi th, .rptable tr.st-int th, .rptable tr.st-vit th, .rptable tr.st-per th { color: var(--sc); }
.rp-arrow { color: var(--faint); text-align: center !important; }
.rp-d { font-size: 14px !important; }
.rp-d.is-up { color: var(--teal); }
.rp-d.is-down { color: var(--red); }
tr.is-neutral .rp-d { color: var(--muted); }
.rp-block { margin-top: 18px; }
.rp-block .counts { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.rp-block .counts dd { font-size: 22px; }
.rplifts, .rpamounts { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.rplifts li { display: grid; grid-template-columns: minmax(0, 1fr) auto 70px; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.rplifts__n { overflow-wrap: anywhere; }
.rplifts__v { font-family: var(--f-px); font-size: 17px; }
.rpamounts li { display: flex; gap: 8px; align-items: baseline; padding: 6px 12px; border-radius: 10px; background: var(--surface-2); }
.rpamounts li b { margin-inline-start: auto; font-family: var(--f-px); font-size: 16px; }

/* guide (everything that explains the game) */
.guide__tabs { grid-auto-columns: minmax(0, 1fr); }
.guide__tabs .seg__btn { padding-inline: 6px; font-size: 13.5px; }

/* fights: countdown, round counter, why you won or lost */
.battle__bar { align-items: center; justify-content: space-between; gap: 10px; }
.battle__round { font-family: var(--f-px); font-size: 15px; color: var(--muted); }
.battle__vs.is-pulse { animation: vsPulse .5s var(--ease-out); }
@keyframes vsPulse { 0% { transform: scale(1.5); filter: brightness(1.8); } 100% { transform: scale(1); filter: none; } }
.arena-stage.is-intro .bf { opacity: .75; }
.bresult__why { max-width: 520px; display: grid; gap: 4px; padding: 12px 16px; margin-top: 6px; border-radius: 14px; background: var(--surface-2); text-align: start; }
.bresult__why p { margin: 0; font-size: 14.5px; line-height: 1.7; color: var(--text); }
.bresult__why p + p { color: var(--muted); font-size: 13.5px; }

@media (max-width: 760px) {
  .charwin__grid { grid-template-columns: 1fr; }
  .charfig { width: 128px; }
  .charwin__pair.is-single .charfig { width: 160px; }
}
@media (max-width: 520px) {
  .prow { grid-template-columns: minmax(0, 1fr) 70px auto; }
  .prow__u { grid-column: 1 / 3; grid-row: 2; }
  .pweek__d { grid-template-columns: 1fr; gap: 0; }
  .charwin__empty, .body-setup__grid { grid-template-columns: 1fr; justify-items: center; }
  .charwin__empty .av, .body-prev { max-width: 140px; }
  .chal { grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .chal__ic { width: 34px; height: 34px; }
  .chal__lock small { display: none; }
  .gym-clock { min-width: 76px; padding: 7px 10px 5px; }
  .gym-clock .led { font-size: 24px; }
  .rplifts li { grid-template-columns: minmax(0, 1fr) auto; }
  .rplifts li > :last-child { display: none; }
  .guide__tabs .seg__btn .ic { display: none; }
  .brow { grid-template-columns: 1fr 1fr 1fr; }
}

/* ==========================================================================
   v5 — gym plan page, friends, today hero, interface polish
   ========================================================================== */

/* panels: a soft top light and depth */
.win { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 18px 40px -28px rgba(0, 0, 0, .55); }
:root[data-theme="light"] .win { box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 14px 34px -26px rgba(40, 30, 80, .35); }
.page-title { display: inline-flex; align-items: center; gap: 12px; }
.page-title::before { content: ''; width: 6px; height: 26px; border-radius: 4px; background: var(--g-xp); box-shadow: 0 0 14px color-mix(in srgb, var(--accent-bg) 60%, transparent); }
.topbar__tools { padding: 3px; border-radius: 14px; background: color-mix(in srgb, var(--surface) 80%, transparent); border: 1px solid var(--line); }
.topbar__tools .icon-btn { border-radius: 10px; }
.nav__a { position: relative; }
.nav__dot { position: absolute; top: 6px; inset-inline-end: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--red); box-shadow: 0 0 0 2px var(--bg); }
.badge-n--sm { min-width: 20px; height: 20px; font-size: 13px; padding: 0 5px; }

/* today hero: the day on one scoreboard */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 22px; padding: 20px 24px; border-radius: var(--r-panel); overflow: hidden; isolation: isolate; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(420px 220px at 12% 50%, rgba(255, 170, 40, .22), transparent 70%), radial-gradient(380px 200px at 95% 0%, rgba(130, 96, 255, .25), transparent 70%); }
.hero.is-clear::before { background: radial-gradient(420px 220px at 12% 50%, rgba(62, 214, 191, .25), transparent 70%), radial-gradient(380px 200px at 95% 0%, rgba(58, 168, 255, .22), transparent 70%); }
.hero__dial { position: relative; width: 120px; height: 120px; }
.hero__ring { width: 100%; height: 100%; }
.hero__track { fill: none; stroke: rgba(255, 178, 36, .12); stroke-width: 10; }
.hero__arc { fill: none; stroke-width: 10; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 170, 40, .55)); transition: stroke-dasharray .8s var(--ease-out); }
.hero.is-clear .hero__arc { filter: drop-shadow(0 0 6px rgba(62, 214, 191, .6)); }
.hero__core { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 2px; }
.hero__num { font-size: 36px; }
.hero__core small { font-size: 11.5px; color: var(--board-muted); }
.hero__ok { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--led-teal); color: #0f0d17; }
.hero__ok .ic { width: 26px; height: 26px; stroke-width: 3; }
.hero__txt { min-width: 0; display: grid; gap: 6px; }
.hero__hi { margin: 0; font-size: 22px; line-height: 1.3; color: var(--board-text); }
.hero__moto { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--board-muted); font-size: 14px; }
.hero__moto .ic { color: var(--led); flex: none; width: 16px; height: 16px; }
.hero__chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.hchip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 99px; font-size: 12.5px; color: var(--board-muted); background: rgba(255, 255, 255, .05); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07); }
.hchip b { font-family: var(--f-px); font-size: 16px; color: var(--board-text); }
.hchip .ic { width: 15px; height: 15px; }
.hchip.is-flame { color: #ffb38a; } .hchip.is-flame .ic { color: #ff8a3d; }
.hchip.is-xp b { color: var(--led); } .hchip.is-rp b { color: var(--led-teal); }
.hero__clock { display: grid; justify-items: center; gap: 4px; padding: 10px 14px 8px; border-radius: 12px; background: rgba(0, 0, 0, .25); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.hero__clock-lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--board-muted); }
.hero__clock-lbl .ic { width: 14px; height: 14px; }
.hero__time { font-size: 30px; }

/* quest rows become cards with their ability colour on the edge */
.qlist { display: grid; gap: 10px; }
.qrow { position: relative; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); transition: border-color .15s, background-color .2s, transform .15s; }
.qlist > .qrow:last-child { border-bottom: 1px solid var(--line); }
.qrow::before { content: ''; position: absolute; inset-block: 12px; inset-inline-start: -1px; width: 3px; border-radius: 3px; background: var(--sc, var(--line-2)); box-shadow: 0 0 10px color-mix(in srgb, var(--sc, transparent) 60%, transparent); }
.qrow:hover { border-color: var(--line-2); }
.qrow.is-done { background: color-mix(in srgb, var(--teal) 7%, var(--surface-2)); border-color: color-mix(in srgb, var(--teal) 30%, var(--line)); }
.qrow.is-done::before { background: var(--teal); }
.qlist--muted .qrow { background: transparent; }
.dq .win__in { padding: 22px 22px 20px; }

/* side card with your character */
.hunter__av { position: relative; flex: none; width: 74px; height: 96px; border-radius: 18px; display: grid; place-items: end center; padding: 4px 6px 0; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--accent-bg) 22%, transparent), transparent 70%), var(--board); box-shadow: inset 0 0 0 1px var(--board-edge); overflow: hidden; }
.hunter__av .av { width: 100%; }
.hunter__crest { position: absolute; top: 4px; inset-inline-end: 4px; }
.hunter__crest .crest--sm { --s: 26px; }

/* bottom bar on phones: a floating pill */
@media (max-width: 820px) {
  .nav--bottom { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 1fr; inset-inline: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 6px; border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .5); }
  .nav--bottom .nav__a { border-radius: 16px; }
  .nav--bottom .nav__a.is-on { background: color-mix(in srgb, var(--accent-bg) 14%, transparent); color: var(--text); }
  .nav--bottom .nav__a::after { display: none; }
  .nav--bottom .nav__dot { top: 4px; inset-inline-end: calc(50% - 18px); }
  .topbar__tools { gap: 0; }
  .topbar__tools .icon-btn { min-width: 36px; padding: 0 6px; }
}

/* gym: today / plan / log */
.gym-tabs { margin-bottom: 0; }
.gplan-head__top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.gplan-week { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.gpday { width: 100%; display: grid; justify-items: center; gap: 6px; padding: 10px 4px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--muted); cursor: pointer; font: inherit; transition: border-color .15s, background-color .15s, transform .15s; }
.gpday:hover { border-color: var(--line-2); transform: translateY(-2px); }
.gpday__name { font-size: 12.5px; font-weight: 600; }
.gpday__code { width: 100%; max-width: 70px; padding: 6px 2px 4px; border-radius: 8px; display: grid; place-items: center; }
.gpday__code .led { font-size: 20px; }
.gpday__sub { font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-inline: 4px; }
.gpday.is-rest { background: transparent; border-style: dashed; }
.gpday.is-today .gpday__name { color: var(--accent); }
.gpday.is-on { border-color: var(--accent); background: color-mix(in srgb, var(--accent-bg) 12%, var(--surface-2)); color: var(--text); box-shadow: 0 8px 20px -12px color-mix(in srgb, var(--accent-bg) 80%, transparent); }
.gplan-dayhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gpexs { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 10px; }
.gpex { display: grid; grid-template-columns: 30px minmax(0, 1.6fr) 64px minmax(0, 1.25fr) 82px 70px auto; align-items: end; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.gpex__n { align-self: center; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--board); color: var(--led); font-family: var(--f-led); font-size: 18px; }
.gpex__name { display: grid; min-width: 0; align-self: center; }
.gpex__name b { font-weight: 600; overflow-wrap: anywhere; }
.gpex__name .muted { font-size: 12px; }
.gpex__f { display: grid; gap: 3px; min-width: 0; }
.gpex__f small { font-size: 11px; color: var(--muted); }
.gpex__f .input { min-width: 0; width: 100%; text-align: center; padding-inline: 4px; font-family: var(--f-px); font-size: 17px; }
.gpex__acts { display: flex; gap: 2px; align-self: center; }
.gpday-sum { margin-top: 10px; }
.gplan-save { position: sticky; bottom: 12px; z-index: 5; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-radius: 18px; border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 92%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); box-shadow: 0 18px 40px -20px rgba(0, 0, 0, .55); }
.gplan-save.is-dirty { border-color: var(--accent); }
.gplan-save > .btn--primary { margin-inline-start: auto; }
.gplan-save__mins { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.gplan-save .form-err { margin: 0; flex-basis: 100%; }
.gplan-save .form-err:empty { display: none; }

/* friends */
.fr-add { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
[dir="rtl"] .fr-add { padding: 8px 14px 8px 8px; }
.fr-add > .ic { color: var(--accent); flex: none; }
.fr-add .input { border: 0; background: transparent; min-height: 40px; padding-inline: 4px; box-shadow: none; }
.fr-add .input:focus { outline: none; }
.fcards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.fcard__btn { width: 100%; display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); color: inherit; font: inherit; text-align: start; cursor: pointer; transition: border-color .15s, transform .15s; }
.fcard__btn:hover { border-color: color-mix(in srgb, var(--c) 60%, var(--line)); transform: translateY(-1px); }
.fcard.is-me .fcard__btn { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: color-mix(in srgb, var(--accent-bg) 7%, var(--surface-2)); }
.fcard__pic { width: 56px; height: 64px; display: grid; place-items: center; }
.fcard__av { width: 50px; height: 64px; border-radius: 14px; overflow: hidden; display: grid; place-items: end center; background: var(--board); }
.fcard__av .av { width: 100%; }
.fcard__who { display: grid; gap: 2px; min-width: 0; }
.fcard__who b { overflow-wrap: anywhere; }
.fcard__who .muted { font-size: 12.5px; }
.fcard__chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.fcard__chips .chip { padding: 1px 9px; font-size: 12px; }
.chip--gym { color: var(--s-str); }
.fcard__today { position: relative; width: 64px; display: grid; justify-items: center; gap: 2px; }
.fring { width: 56px; height: 56px; }
.fring__track { fill: none; stroke: var(--off); stroke-width: 6; }
.fring__arc { fill: none; stroke: var(--accent-bg); stroke-width: 6; stroke-linecap: round; }
.fcard.is-clear .fring__arc { stroke: var(--teal); }
.fcard__pct { position: absolute; top: 0; height: 56px; display: grid; place-items: center; font-family: var(--f-px); font-size: 15px; }
.fcard__pct .ic { color: var(--teal); width: 20px; height: 20px; stroke-width: 3; }
.fcard__today small { font-size: 11px; color: var(--muted); }
.fr-req p { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.vf-pick { display: grid; gap: 8px; }
.vf-pick__list { display: flex; flex-wrap: wrap; gap: 8px; }
.vf-chip { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 6px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); cursor: pointer; font: inherit; font-size: 13.5px; }
[dir="rtl"] .vf-chip { padding: 5px 6px 5px 12px; }
.vf-chip.is-on { border-color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, var(--surface-2)); }
.vf-chip .crest--xs { --s: 24px; }
.profile__av { width: 120px; height: 160px; border-radius: 22px; overflow: hidden; display: grid; place-items: end center; padding: 6px 10px 0; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%), var(--board); }
.profile__av .av { width: 100%; }
.profile__foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

@media (max-width: 820px) {
  .hero { grid-template-columns: auto minmax(0, 1fr); gap: 16px; padding: 16px; }
  .hero__clock { grid-column: 1 / -1; grid-template-columns: auto 1fr; justify-items: start; align-items: center; }
  .hero__clock .hero__time { justify-self: end; font-size: 26px; }
  .hero__dial { width: 96px; height: 96px; }
  .hero__num { font-size: 28px; }
  .hero__hi { font-size: 18px; }
  .gpex { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gpex__n { display: none; }
  .gpex__name { grid-column: 1 / 4; grid-row: 1; }
  .gpex__acts { grid-column: 4 / 5; grid-row: 1; justify-self: end; }
}
@media (max-width: 520px) {
  .gplan-week { gap: 4px; }
  .gpday { padding: 8px 1px 6px; border-radius: 10px; }
  .gpday__code .led { font-size: 15px; }
  .gpday__sub { display: none; }
  .gpex { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gpex__name { grid-column: 1 / 2; }
  .gpex__acts { grid-column: 2 / 3; }
  .fcard__btn { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; padding: 10px; }
  .fcard__pic { width: 46px; }
  .fcard__av { width: 44px; height: 56px; }
  .hero__chips .hchip__lbl { display: none; }
}

.hchip.is-lv { text-decoration: none; color: var(--board-text); }
.hchip__rank { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 6px; font-family: var(--f-led); font-size: 15px; color: var(--cl); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--cl) 60%, transparent); }
.hchip__bar { width: 54px; display: none; }
.vf-pick { margin-bottom: 4px; }
@media (max-width: 820px) {
  .shell.v-quests .side, .shell.v-friends .side, .shell.v-games .side { display: none; }
  .hchip__bar { display: block; }
  .gplan-save { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .gplan-head__top .btnrow { flex-basis: 100%; margin: 0; }
  .gplan-save__mins { flex: 1; }
}

@media (hover: none) { .nav__a:hover:not(.is-on) { background: transparent; color: var(--muted); } }

/* ==========================================================================
   v6 — colour refresh ("night arena"): midnight indigo surfaces, violet for
   structure and focus, amber LEDs for XP and actions, teal for rank, rose for danger.
   ========================================================================== */
:root[data-theme="dark"] {
  --bg: #0c0a1a;
  --surface: #161329;
  --surface-2: #1f1b36;
  --surface-3: #2a2548;
  --field: #110e22;
  --line: #2a2546;
  --line-2: #463e72;
  --text: #f5f2fd;
  --muted: #b3acce;
  --faint: #9a93bb;
  --violet: #8b5cf6;
  --violet-2: #b197fc;
  --violet-bg: rgba(139, 92, 246, .16);
  --rose: #fb5c7c;
  --red: #ff6b6b;
  --edge-a: rgba(139, 92, 246, .38);
  --edge-b: rgba(255, 178, 36, .16);
  --e1: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 12px 32px -22px rgba(0, 0, 0, .8);
  --e2: 0 1px 0 rgba(255, 255, 255, .05) inset, 0 24px 60px -28px rgba(0, 0, 0, .9), 0 0 0 1px rgba(139, 92, 246, .08);
  --sky: radial-gradient(900px 380px at 50% -170px, rgba(255, 170, 40, .14), transparent 70%),
         radial-gradient(820px 600px at 108% -8%, rgba(139, 92, 246, .26), transparent 62%),
         radial-gradient(700px 520px at -10% 108%, rgba(62, 214, 191, .1), transparent 60%),
         radial-gradient(600px 400px at 40% 120%, rgba(251, 92, 124, .07), transparent 70%);
}
:root[data-theme="light"] {
  --bg: #f3f1fa;
  --surface: #ffffff;
  --surface-2: #f6f4fd;
  --surface-3: #ebe7f7;
  --line: #e2ddf0;
  --line-2: #c6bee0;
  --text: #17142a;
  --muted: #555070;
  --faint: #6c6688;
  --violet: #6d3fe0;
  --violet-2: #6d3fe0;
  --violet-bg: rgba(109, 63, 224, .1);
  --rose: #d6335a;
  --edge-a: rgba(109, 63, 224, .22);
  --edge-b: rgba(244, 168, 22, .2);
  --e1: 0 1px 0 #fff inset, 0 10px 28px -20px rgba(40, 24, 100, .35);
  --e2: 0 1px 0 #fff inset, 0 22px 50px -26px rgba(40, 24, 100, .45);
  --sky: radial-gradient(900px 380px at 50% -170px, rgba(255, 170, 40, .2), transparent 70%),
         radial-gradient(820px 600px at 108% -8%, rgba(139, 92, 246, .16), transparent 62%),
         radial-gradient(700px 520px at -10% 108%, rgba(40, 190, 170, .1), transparent 60%);
}

/* panels: a thin violet→amber edge and one shared elevation scale */
.win { box-shadow: var(--e1); }
/* the edge glows at two corners (violet top, amber bottom); the border colour still shows between */
.win::after {
  content: ''; position: absolute; inset: -1px; border-radius: inherit; padding: 1px; pointer-events: none;
  background: linear-gradient(155deg, var(--edge-a), transparent 34%, transparent 72%, var(--edge-b));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.win--red::after { background: linear-gradient(155deg, color-mix(in srgb, var(--red) 70%, transparent), transparent 60%); }
.modal { box-shadow: var(--e2); }

/* focus: one violet ring everywhere, never hidden */
:focus-visible { outline: 2px solid var(--violet-2); outline-offset: 2px; }
.input:focus { border-color: var(--violet); box-shadow: 0 0 0 3px var(--violet-bg); }

/* controls */
.btn { transition: background-color .18s var(--ease), border-color .18s, transform .12s var(--ease), box-shadow .18s, filter .18s; }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn--primary { box-shadow: 0 8px 22px -10px rgba(255, 150, 30, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn--primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px -10px rgba(255, 150, 30, .9), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn--ghost:hover:not(:disabled), .btn:not(.btn--primary):not(.btn--red):hover:not(:disabled) { border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); }
.seg { background: var(--surface-2); }
.seg__btn.is-on { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px color-mix(in srgb, var(--violet) 40%, var(--line)), 0 4px 12px -6px rgba(0, 0, 0, .35); }
.seg__btn.is-on .ic { color: var(--violet-2); }
.seg--tabs .seg__btn.is-on { background: linear-gradient(180deg, color-mix(in srgb, var(--violet) 18%, var(--surface)), var(--surface)); }
.tag--btn:hover { color: var(--violet-2); border-color: var(--violet-2); }
.qcheck:hover:not(:disabled) { border-color: var(--teal); }

/* navigation: the active page glows violet, its lamp stays amber */
.nav__a.is-on { background: var(--violet-bg); }
.nav__a.is-on .ic { color: var(--violet-2); }
@media (hover: hover) { .nav__a:hover:not(.is-on) { background: var(--surface-2); } }
.topbar__tools { background: color-mix(in srgb, var(--surface) 85%, transparent); box-shadow: var(--e1); }

/* quests */
.qrow { background: linear-gradient(90deg, color-mix(in srgb, var(--sc, var(--violet)) 6%, var(--surface-2)), var(--surface-2) 45%); }
[dir="rtl"] .qrow { background: linear-gradient(270deg, color-mix(in srgb, var(--sc, var(--violet)) 6%, var(--surface-2)), var(--surface-2) 45%); }
.qrow.is-done { background: color-mix(in srgb, var(--teal) 8%, var(--surface-2)); }
.qrow:hover { border-color: color-mix(in srgb, var(--sc, var(--violet)) 35%, var(--line)); }
.dq__legend .tag { font-size: 12px; }

/* hero: richer night sky behind the day's dial */
.hero { box-shadow: var(--e2); }
.hero::before { background: radial-gradient(420px 240px at 10% 50%, rgba(255, 170, 40, .26), transparent 70%), radial-gradient(420px 220px at 100% 0%, rgba(139, 92, 246, .38), transparent 70%), radial-gradient(300px 160px at 60% 120%, rgba(251, 92, 124, .14), transparent 70%); }

/* challenges + friends pick up the violet */
.weekly .win__title .ic, .chal__ic { color: var(--violet-2); }
.chal__ic { background: var(--violet-bg); }
.weekly .bar--gate .bar__fill { background: linear-gradient(90deg, var(--violet), var(--rose)); }
.fcard.is-me .fcard__btn { background: linear-gradient(90deg, var(--violet-bg), var(--surface-2)); border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); }
.stab.is-on { box-shadow: 0 8px 22px -10px rgba(255, 160, 30, .8); }
.stab:hover:not(.is-on) { border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); }
.gpday.is-on { border-color: var(--violet); background: linear-gradient(180deg, var(--violet-bg), var(--surface-2)); box-shadow: 0 10px 24px -14px rgba(139, 92, 246, .9); }
.gpday.is-today .gpday__name { color: var(--accent); }

/* danger keeps a rose tint, not plain red */
.tag--red { color: var(--rose); border-color: color-mix(in srgb, var(--rose) 40%, transparent); background: color-mix(in srgb, var(--rose) 9%, transparent); }
.dq__warn { color: var(--rose); }

/* touch: comfortable targets on phones, readable small text */
@media (pointer: coarse) {
  .icon-btn--sm { min-width: 40px; height: 40px; }
  .btn--sm { min-height: 40px; }
  .tag--btn { padding: 5px 12px; }
  .linkbtn { min-height: 32px; }
}
@media (max-width: 820px) {
  .nav--bottom { background: color-mix(in srgb, var(--surface) 90%, transparent); box-shadow: var(--e2); }
  .nav--bottom .nav__a.is-on { background: linear-gradient(180deg, var(--violet-bg), color-mix(in srgb, var(--accent-bg) 10%, transparent)); }
  .nav--bottom .nav__a.is-on .ic { color: var(--violet-2); }
  .nav--bottom .nav__a { font-size: 11.5px; }
  .gpday__name, .fcard__today small, .gpex__f small, .brow__f small { font-size: 12px; }
}

/* motion: respect the system setting everywhere */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.gym-swapnote { margin: 14px 0; }
.tag--gymlink { text-decoration: none; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); border-style: solid; }

.stab--suggest { border-style: dashed; color: var(--violet-2); border-color: color-mix(in srgb, var(--violet) 45%, var(--line)); background: var(--violet-bg); }
.sugg { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sugg__row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.sugg__ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; color: var(--sc); background: color-mix(in srgb, var(--sc) 14%, transparent); }
.sugg__t { display: grid; min-width: 0; }
.sugg__t b { overflow-wrap: anywhere; }
.sugg__t .muted { font-size: 12.5px; }
.gym-intro .sched-cards { margin-top: 14px; }

/* character v2: skin, shirt, shorts, face */
.av__aura { fill: color-mix(in srgb, var(--c, var(--av)) 24%, transparent); }
.av__torso { fill: color-mix(in srgb, var(--av) 82%, #1b1530); stroke: color-mix(in srgb, var(--av) 55%, #1b1530); stroke-width: 1.2; stroke-linejoin: round; }
.av__shorts { fill: #2b2540; }
:root[data-theme="light"] .av__shorts { fill: #3a3352; }
.av__shoe { fill: #f3effb; stroke: #15121f; stroke-width: 1.2; }
.av__line { fill: none; stroke: rgba(20, 12, 40, .45); stroke-width: 1.1; stroke-linecap: round; }
.av__line--soft { stroke: rgba(20, 12, 40, .28); }
.av__emblem { fill: none; stroke: #fff6dc; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; filter: none; }
.av__hair { fill: #241c2e; }
.av__hair.is-buzz { opacity: .82; }
.av__beard { fill: #241c2e; }
.av__beard.is-stubble { opacity: .35; }
.av__scarf { fill: var(--violet, #7c5cd6); }
.av__eye { fill: #1a1424; }
.av__glint { fill: #fff; }
.av__brow { stroke: #241c2e; stroke-width: 1.3; stroke-linecap: round; fill: none; }
.av__mouth { fill: none; stroke: #6b2b2b; stroke-width: 1.2; stroke-linecap: round; }
.av__blush { fill: rgba(255, 110, 120, .3); }
.av--was .av__torso { fill: color-mix(in srgb, var(--line-2) 80%, #1b1530); stroke: var(--line-2); }
.av--ghost { opacity: .5; }
.looks { display: grid; gap: 12px; margin-top: 14px; }
.looks__row { display: grid; gap: 6px; }
.looks__opts { display: flex; flex-wrap: wrap; gap: 8px; }
.looks__opt { min-height: 40px; min-width: 40px; padding: 4px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted); cursor: pointer; font: inherit; font-size: 13.5px; display: inline-grid; place-items: center; transition: border-color .15s, color .15s, background-color .15s; }
.looks__opt:hover { border-color: var(--line-2); color: var(--text); }
.looks__opt.is-on { border-color: var(--violet); color: var(--text); background: var(--violet-bg); box-shadow: 0 0 0 2px var(--violet-bg); }
.looks__sw { width: 26px; height: 26px; }
.looks__opt:has(.looks__sw) { padding: 4px; }

/* exercise pictures: body map with the worked muscles lit */
.mm { width: 100%; height: auto; display: block; }
.mm__body { fill: color-mix(in srgb, var(--violet) 14%, var(--surface-3)); }
.mm__m { fill: color-mix(in srgb, var(--violet) 26%, var(--surface-3)); }
.mm__m.is-sec { fill: color-mix(in srgb, var(--accent-bg) 45%, var(--surface-3)); }
.mm__m.is-on { fill: var(--accent-bg); filter: drop-shadow(0 0 2px color-mix(in srgb, var(--accent-bg) 70%, transparent)); }
.mm__cut { stroke: rgba(15, 12, 30, .45); stroke-width: .6; }
:root[data-theme="light"] .mm__body { fill: #ddd7ee; }
:root[data-theme="light"] .mm__m:not(.is-on):not(.is-sec) { fill: #c9c1e2; }
.expic { display: block; flex: none; border-radius: 12px; padding: 4px; background: radial-gradient(circle at 50% 40%, var(--violet-bg), transparent 75%), var(--surface-2); }
.expic--xs { width: 52px; padding: 2px; border-radius: 8px; }
.gx__pic { width: 84px; }
.gx__head { align-items: center; }
.gpex__name { display: flex !important; align-items: center; gap: 10px; }
.gpex__pic { width: 76px; }
.gpex__nm { display: grid; min-width: 0; }
.prog__pics { display: flex; gap: 6px; margin-top: 4px; }
.prog__more { display: inline-flex; align-items: center; gap: 6px; color: var(--violet-2); font-size: 13px; font-weight: 600; margin-top: 2px; }
.prog__arrow { transform: rotate(90deg); width: 14px; height: 14px; }
[dir="rtl"] .prog__arrow { transform: rotate(-90deg); }
.pv-days { margin: 6px 0 12px; }
.pv-tabs { margin-bottom: 10px; grid-auto-columns: minmax(0, 1fr); }
.pv-code { font-size: 18px; color: inherit; text-shadow: none; }
.seg__btn.is-on .pv-code { color: var(--led); text-shadow: 0 0 6px var(--led-glow); }
.pv-title { margin: 0 0 10px; font-size: 17px; }
.excards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.excard { display: grid; grid-template-columns: 124px minmax(0, 1fr); gap: 14px; align-items: center; padding: 10px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface-2); }
.excard__pic { width: 124px; }
.excard__txt { display: grid; gap: 3px; min-width: 0; }
.excard__txt b { font-size: 15.5px; overflow-wrap: anywhere; }
.excard__txt .muted { font-size: 13px; }
.excard__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.excard__sets { font-family: var(--f-px); font-size: 18px; color: var(--accent); }
.picker .catchips { margin: 4px 0 2px; }
.exgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; max-height: min(52vh, 520px); overflow-y: auto; padding: 2px; }
.excell { display: grid; gap: 4px; align-content: start; text-align: start; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.excell:hover { border-color: var(--violet); transform: translateY(-2px); }
.excell__pic { width: 100%; }
.excell__name { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.excell__mu { font-size: 12px; }
.excell__tags .tag { font-size: 11.5px; }
.pick-custom .fold__body { display: grid; gap: 10px; }
@media (max-width: 520px) {
  .excard { grid-template-columns: 84px minmax(0, 1fr); gap: 10px; }
  .excard__pic { width: 84px; }
  .exgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gx__pic { width: 64px; }
  .gpex__pic { width: 52px; }
}
.catchips { flex-wrap: wrap; overflow: visible; }

.tag__n { font-family: var(--f-px); font-size: 12px; opacity: .85; margin-inline-start: 2px; }

/* v7: quests grow several abilities, so on phones the tags get the full card width
   and the buttons move to a row underneath instead of squeezing the text column */
.tag--stat { gap: 3px; padding-inline: 7px; }
@media (max-width: 520px) {
  .qrow { grid-template-columns: auto minmax(0, 1fr); row-gap: 10px; }
  .qrow__side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; gap: 8px; padding-top: 0; }
  .qrow__side:empty { display: none; }
  .qrow__side .qctrl { order: 0; }
}

/* ===================================================================== v8: brain games */
:root { --w-ok: #1f9a6c; --w-in: #b8860b; --w-no: #3a3650; --w-tile: var(--surface-2); }
:root[data-theme="light"] { --w-no: #8a8698; }

/* quests-page card */
.brain__sub { margin: 4px 0 12px; font-size: 13.5px; }
.btiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.btile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); text-decoration: none; text-align: center; transition: border-color .15s, transform .15s, background-color .15s; }
.btile b { font-size: 13.5px; font-weight: 600; }
.btile small { font-size: 11.5px; color: var(--muted); }
.btile__ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; color: var(--violet-2); background: var(--violet-bg); }
.btile__ic .ic { width: 22px; height: 22px; }
.btile.is-done { border-color: color-mix(in srgb, var(--teal) 35%, var(--line)); }
.btile.is-done .btile__ic { color: var(--teal); background: color-mix(in srgb, var(--teal) 14%, transparent); }
.btile.is-done small { color: var(--teal); }
@media (hover: hover) { .btile:hover { border-color: var(--violet); transform: translateY(-2px); } }
@media (max-width: 520px) { .btiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* hub */
.gback { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; width: fit-content; }
.gback:hover { color: var(--text); }
.gback .ic { transform: scaleX(-1); }
[dir="rtl"] .gback .ic { transform: none; }
.gm-got { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; color: var(--teal); font-size: 14px; }
.gm-got b { font-family: var(--f-led); }
.gtiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .gtiles { grid-template-columns: 1fr; } }
.gtile { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.gtile__ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; color: #fff; background: linear-gradient(135deg, var(--violet), #5b3fd1); box-shadow: 0 6px 18px color-mix(in srgb, var(--violet) 35%, transparent); }
.gt-math .gtile__ic { background: linear-gradient(135deg, #3aa8ff, #2563eb); box-shadow: 0 6px 18px rgba(58, 168, 255, .3); }
.gt-focus .gtile__ic { background: linear-gradient(135deg, #ff8a1f, #e2551c); box-shadow: 0 6px 18px rgba(255, 138, 31, .3); }
.gt-memory .gtile__ic { background: linear-gradient(135deg, #3ed6bf, #129a8a); box-shadow: 0 6px 18px rgba(62, 214, 191, .28); }
.gtile__ic .ic { width: 26px; height: 26px; }
.gtile__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.gtile__txt b { font-size: 16px; }
.gtile__txt .muted { font-size: 13px; }
.gtile__st { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 12.5px; color: var(--accent); }
.gtile.is-done .gtile__st { color: var(--teal); }
.gtile__go { color: var(--muted); }
[dir="rtl"] .gtile__go .ic { transform: scaleX(-1); }
@media (hover: hover) { .gtile:hover { border-color: var(--violet); transform: translateY(-2px); } }

/* shared game bits */
.whead { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.whead__title { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; }
.whead__title .ic { width: 22px; height: 22px; color: var(--violet-2); }
.whead__title small { font-size: 14px; font-weight: 500; }
.whead__tools { display: flex; gap: 4px; }
.gstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 14px 0; }
.gstat { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.gstat small { font-size: 12px; color: var(--muted); }
.gstat b { font-size: 22px; }
.gintro__rules { margin: 0; line-height: 1.75; }
.gintro__h { margin: 6px 0 8px; font-size: 14px; color: var(--muted); font-weight: 600; }
.gtiers { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 6px; }
.gtiers li { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: 10px; font-size: 14px; }
.gtiers li b { margin-inline-start: auto; font-family: var(--f-led); color: var(--muted); }
.gtiers li.is-hit { border-style: solid; border-color: color-mix(in srgb, var(--teal) 45%, transparent); color: var(--teal); }
.gtiers li.is-hit b { color: var(--teal); }
.gintro__go { width: 100%; margin-top: 6px; justify-content: center; min-height: 52px; font-size: 17px; }
.gintro__none { display: flex; align-items: center; justify-content: center; gap: 6px; flex-wrap: wrap; color: var(--muted); }
.gres { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px 12px; margin-bottom: 14px; border-radius: 16px; background: var(--board); border: 1px solid var(--board-edge); }
.gres small { color: var(--board-muted); }
.gres__n { font-size: 46px; line-height: 1.1; }
.gres.is-best { box-shadow: 0 0 0 1px var(--accent), 0 0 28px color-mix(in srgb, var(--accent-bg) 35%, transparent); }

/* live run */
.glive .win__in { position: relative; }
.glive__top { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
.gtimer.is-low { color: var(--led-red); text-shadow: 0 0 8px rgba(255, 106, 85, .6); }
.gbar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin: 12px 0; }
.gbar__fill { display: block; height: 100%; width: 100%; background: var(--g-xp); transition: width .1s linear; }
.gcount { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-led); font-size: 96px; color: var(--accent); text-shadow: 0 0 24px color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--surface) 82%, transparent); border-radius: inherit; z-index: 3; pointer-events: none; }
.gcount:empty { background: color-mix(in srgb, var(--surface) 82%, transparent); }
.gcount.is-pop { animation: gpop .6s var(--ease-out); }
@keyframes gpop { from { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } to { transform: scale(1); } }

/* quick maths */
.mbox { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; margin-bottom: 12px; border-radius: 16px; background: var(--board); border: 1px solid var(--board-edge); }
.mq { font-family: var(--f-led); font-size: 40px; color: var(--board-text); letter-spacing: 1px; }
.mq.is-ok { animation: mok .35s ease; }
@keyframes mok { 0% { color: var(--led-teal); transform: scale(1.06); } 100% { color: var(--board-text); transform: none; } }
.ma { min-width: 120px; padding: 6px 16px; border-radius: 10px; border: 1px solid var(--board-edge); font-family: var(--f-led); font-size: 36px; text-align: center; color: var(--led); }
.ma.is-empty { color: var(--board-muted); }
.ma.is-bad { animation: mbad .35s ease; }
@keyframes mbad { 0%, 100% { transform: none; } 25% { transform: translateX(-8px); border-color: var(--red); } 75% { transform: translateX(8px); border-color: var(--red); } }
.mpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 360px; margin: 0 auto; }
.mpad__k { min-height: 58px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); color: var(--text); font-family: var(--f-led); font-size: 26px; cursor: pointer; touch-action: manipulation; transition: background-color .1s, transform .08s; }
.mpad__k:active { transform: scale(.95); background: var(--surface-3); }
.mpad__k.is-back { grid-column: 1; grid-row: 4; display: grid; place-items: center; }
.mpad__k.is-back + .mpad__k { grid-column: 2; }
.mpad__k .ic { width: 24px; height: 24px; }

/* focus */
.fwrap { position: relative; margin: 14px auto 8px; max-width: 380px; }
.fgrid { display: grid; gap: 8px; }
.fgrid--4 { grid-template-columns: repeat(4, 1fr); }
.fgrid--3 { grid-template-columns: repeat(3, 1fr); }
.fcell { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: transparent; font-family: var(--f-led); font-size: 34px; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; transition: background-color .12s, transform .08s, border-color .12s; }
.fgrid.is-live .fcell.has-n { color: var(--text); border-color: var(--line-2); background: var(--surface-3); }
.fgrid.is-live .fcell:active { transform: scale(.94); }
.fcell.is-hit { color: var(--teal) !important; background: color-mix(in srgb, var(--teal) 14%, var(--surface-2)) !important; border-color: color-mix(in srgb, var(--teal) 50%, transparent) !important; opacity: .55; }
.fcell.is-bad { animation: fbad .4s ease; }
@keyframes fbad { 0% { background: color-mix(in srgb, var(--red) 40%, var(--surface-2)); } 100% { background: var(--surface-2); } }
.fgrid.is-shake, .mgrid.is-shake { animation: gshake .35s ease; }
@keyframes gshake { 0%, 100% { transform: none; } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* memory */
.mmsg { margin: 12px 0 0; text-align: center; font-weight: 600; min-height: 1.6em; }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mpadc { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 16px; background: color-mix(in srgb, var(--mc) 16%, var(--surface-2)); cursor: pointer; touch-action: manipulation; transition: background-color .12s, box-shadow .12s, transform .08s; }
.mpadc.is-lit { background: var(--mc); box-shadow: 0 0 24px color-mix(in srgb, var(--mc) 70%, transparent); transform: scale(1.03); }
.mgrid.is-input .mpadc { border-color: color-mix(in srgb, var(--mc) 45%, var(--line)); }
.mpadc.is-bad { background: var(--red); box-shadow: 0 0 24px color-mix(in srgb, var(--red) 70%, transparent); }
.mc-0 { --mc: #ff6a55; } .mc-1 { --mc: #ff8a1f; } .mc-2 { --mc: #ffcf4a; } .mc-3 { --mc: #3ed6bf; } .mc-4 { --mc: #b197fc; }
.mc-5 { --mc: #3aa8ff; } .mc-6 { --mc: #f472b6; } .mc-7 { --mc: #22c55e; } .mc-8 { --mc: #a3e635; }

/* word of the day */
.win.word .win__in { display: flex; flex-direction: column; align-items: stretch; }
.wlang { align-self: center; margin-bottom: 14px; }
.seg__ok { font-size: 12px; }
.wboard { display: grid; gap: 6px; justify-content: center; margin: 0 auto 16px; }
.wrow { display: grid; grid-template-columns: repeat(5, clamp(46px, 13vw, 60px)); gap: 6px; }
.wrow--sm { grid-template-columns: repeat(5, 38px); gap: 5px; }
.wrow--sm .wt { font-size: 20px; border-radius: 8px; }
.wt { aspect-ratio: 1; display: grid; place-items: center; border: 2px solid var(--line); border-radius: 10px; background: var(--w-tile); font-size: clamp(24px, 7vw, 30px); font-weight: 700; line-height: 1; color: var(--text); user-select: none; }
.wt--fill { border-color: var(--muted); }
.wt.is-pop { animation: wpop .12s ease; }
@keyframes wpop { 50% { transform: scale(1.1); } }
.wt--2, .wt--1, .wt--0 { color: #fff; }
.wt--2 { background: var(--w-ok); border-color: var(--w-ok); }
.wt--1 { background: var(--w-in); border-color: var(--w-in); }
.wt--0 { background: var(--w-no); border-color: var(--w-no); }
.wt.is-flip { animation: wflip .5s ease both; }
.wt--2.is-flip { --tc: var(--w-ok); } .wt--1.is-flip { --tc: var(--w-in); } .wt--0.is-flip { --tc: var(--w-no); }
@keyframes wflip {
  0% { transform: rotateX(0); background: var(--w-tile); border-color: var(--muted); color: var(--text); }
  49% { transform: rotateX(90deg); background: var(--w-tile); border-color: var(--muted); color: var(--text); }
  50% { transform: rotateX(90deg); background: var(--tc); border-color: var(--tc); color: #fff; }
  100% { transform: rotateX(0); background: var(--tc); border-color: var(--tc); color: #fff; }
}
.wt.is-win { animation: wbounce .9s ease both; }
@keyframes wbounce { 0%, 20% { transform: translateY(0); } 40% { transform: translateY(-22px); } 50% { transform: translateY(4px); } 60% { transform: translateY(-10px); } 80% { transform: translateY(2px); } 100% { transform: none; } }
.wrow.is-shake { animation: gshake .4s ease; }
.kb { display: grid; gap: 7px; max-width: 520px; width: 100%; margin: 0 auto; }
.kbrow { display: flex; gap: 5px; justify-content: center; }
.wk { flex: 1 1 0; min-width: 0; height: 54px; padding: 0; border: 0; border-radius: 8px; background: var(--surface-3); color: var(--text); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none; display: grid; place-items: center; transition: background-color .15s, transform .06s; }
.wk:active { transform: scale(.94); }
.wk--wide { flex: 1.6 1 0; font-size: 12.5px; }
.wk--wide .ic { width: 22px; height: 22px; }
.wk--2 { background: var(--w-ok); color: #fff; }
.wk--1 { background: var(--w-in); color: #fff; }
.wk--0 { background: var(--w-no); color: color-mix(in srgb, #fff 60%, transparent); }
:root[data-theme="light"] .wk { background: #dcd8e8; }
:root[data-theme="light"] .wk--2 { background: var(--w-ok); } :root[data-theme="light"] .wk--1 { background: var(--w-in); } :root[data-theme="light"] .wk--0 { background: var(--w-no); color: #fff; }
.wres { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.wres__msg { margin: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 18px; }
.wres__ans { font-size: 22px; letter-spacing: 2px; color: var(--accent); }
.wres__acts { display: flex; gap: 8px; }
.wres .fine { margin: 0; }
.wst__lang { margin: -6px 0 10px; text-align: center; }
.wst__row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; text-align: center; }
.wst__box { display: flex; flex-direction: column; gap: 2px; }
.wst__box b { font-size: 30px; }
.wst__box small { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.wst__h { margin: 18px 0 8px; font-size: 14px; text-align: center; }
.wdist { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.wdist li { display: grid; grid-template-columns: 16px 1fr; gap: 6px; align-items: center; font-family: var(--f-led); }
.wdist__track { display: block; }
.wdist__bar { display: block; min-width: 26px; padding: 2px 8px; border-radius: 4px; background: var(--w-no); color: #fff; text-align: end; font-size: 14px; }
.wdist__bar.is-now { background: var(--w-ok); }
.wst__next { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.wst__next > div { display: flex; flex-direction: column; }
.wst__next b { font-size: 26px; }
.whelp p { line-height: 1.75; }
.whelp ul { margin: 0 0 8px; padding-inline-start: 20px; line-height: 1.8; }
.whelp h3 { margin: 14px 0 8px; font-size: 15px; }
.wex { margin-bottom: 10px; }
.wex p { margin: 6px 0 0; font-size: 14px; }
.wswitch { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); cursor: pointer; }
.wswitch > span { display: flex; flex-direction: column; gap: 3px; }
@media (max-width: 380px) { .wk { height: 50px; font-size: 15px; } .kbrow { gap: 4px; } }
@media (prefers-reduced-motion: reduce) {
  .wt.is-flip, .wt.is-win, .wrow.is-shake, .gcount.is-pop, .fgrid.is-shake, .mgrid.is-shake { animation-duration: .01s !important; }
}
.gpage > * { min-width: 0; }
.kb, .kbrow { min-width: 0; }
.kbrow .wk { min-width: 0; display: flex; align-items: center; justify-content: center; }
@media (max-width: 520px) {
  .win.word > .win__in, .win.glive > .win__in { padding-inline: 10px; }
  .kbrow { gap: 4px; }
  .kb { gap: 6px; }
  .wk { font-size: 15px; height: 52px; border-radius: 6px; }
  .wk--wide { font-size: 11px; }
}
/* fit each game on one phone screen (board + keyboard above the bottom bar) */
.wrow { grid-template-columns: repeat(5, clamp(38px, min(13vw, 6.6vh), 60px)); }
.wt { font-size: clamp(20px, min(7vw, 3.6vh), 30px); }
.mgrid { max-width: 330px; margin: 0 auto; }
@media (max-width: 520px) {
  .gpage { gap: 10px; }
  .win.word .whead { margin-bottom: 6px; }
  .whead__title { font-size: 18px; }
  .wlang { margin-bottom: 10px; }
  .wlang .seg__btn { min-height: 32px; padding: 4px 14px; }
  .wboard { gap: 5px; margin-bottom: 12px; }
  .wrow { gap: 5px; }
  .wk { height: clamp(42px, 6.6vh, 54px); }
  .glive .gstat { padding: 6px; }
  .glive .gstat b { font-size: 19px; }
  .mbox { padding: 12px 8px; margin-bottom: 10px; }
  .mq { font-size: 34px; }
  .ma { font-size: 30px; }
  .mpad { gap: 6px; }
  .mpad__k { min-height: clamp(44px, 7vh, 58px); font-size: 23px; }
  .gbar { margin: 8px 0; }
}

.win.word .kb, .win.word .wres { scroll-margin-bottom: 100px; }

/* v9: per-game leaderboards */
.glb__head { flex-wrap: wrap; }
.glb__ctrl { display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; margin: 4px 0 6px; }
.glb__note { margin: 0 0 10px; }
.glb__blank { visibility: hidden; }
.glb__row.is-top1 .lb__pos { color: #ffcf4a; text-shadow: 0 0 10px rgba(255, 207, 74, .5); font-weight: 700; }
.glb__row.is-top2 .lb__pos { color: #cfd6e4; font-weight: 700; }
.glb__row.is-top3 .lb__pos { color: #e09a5b; font-weight: 700; }
:root[data-theme="light"] .glb__row.is-top1 .lb__pos { color: #b7860b; text-shadow: none; }
:root[data-theme="light"] .glb__row.is-top2 .lb__pos { color: #6b7385; }
.glb .lb__score small { white-space: nowrap; }

/* v10: character v3 — muscles, faces, outfits */
.av__def { fill: none; stroke: rgba(60, 25, 10, .32); stroke-width: .9; stroke-linecap: round; }
.av__cloth { stroke: rgba(0, 0, 0, .18); stroke-width: .6; stroke-linejoin: round; }
.av__metal { stroke: rgba(0, 0, 0, .25); stroke-width: .6; }
.av__cape { opacity: .95; }
.av__aura.is-glow { fill: color-mix(in srgb, #ffcf4a 38%, transparent); filter: drop-shadow(0 0 6px rgba(255, 207, 74, .6)); }
.av__lid { fill: none; stroke: #1a1424; stroke-width: 1.2; stroke-linecap: round; }
.av__lash { fill: none; stroke: #1a1424; stroke-width: .9; stroke-linecap: round; }
.av__brow.is-thin { stroke-width: .95; }
.av__mouth.is-lips { stroke: #c2445a; stroke-width: 1.5; }
.av__open { fill: #5a1f28; stroke: #3a1218; stroke-width: .6; }
.av__crown { filter: drop-shadow(0 0 3px rgba(255, 207, 74, .7)); }
.av__shoe.is-boot { fill: #d6283c; }
.av--was .av__cloth, .av--was .av__metal { opacity: .7; }
.av--locked { filter: grayscale(.85) brightness(.95); opacity: .5; }
.av--crop { overflow: hidden; }
.av--face { width: 42px; height: 42px; }
.looks__opt:has(.av--face) { padding: 2px 4px; }
.looks__opt .av--face { display: block; }

/* muscle stages */
.stages { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.stage { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); text-align: center; }
.stage .av { max-width: 96px; max-height: 170px; }
.stage b { font-size: 13.5px; }
.stage small { font-size: 11.5px; color: var(--muted); font-family: var(--f-led); }
.stage.is-now { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 22px color-mix(in srgb, var(--accent-bg) 30%, transparent); }
.stage.is-now b { color: var(--accent); }
.stage.is-past b { color: var(--teal); }
.stages__next { display: grid; gap: 6px; margin: 0 0 8px; font-weight: 600; }
@media (max-width: 520px) { .stages { gap: 5px; } .stage { padding: 6px 2px 8px; } .stage b { font-size: 12px; } }

/* wardrobe */
.wgrid { list-style: none; margin: 6px 0 14px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.wgrid--head { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
.wcard__btn { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 8px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--text); font: inherit; text-align: center; cursor: pointer; transition: border-color .15s, transform .15s; }
.wcard__btn:disabled { cursor: default; }
@media (hover: hover) { .wcard:not(.is-locked):not(.is-on) .wcard__btn:hover { border-color: var(--violet); transform: translateY(-2px); } }
.wcard.is-on .wcard__btn { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.wcard__pic { position: relative; width: 100%; display: grid; place-items: center; }
.wcard__pic .av { max-width: 96px; max-height: 150px; }
.wcard__pic.is-head .av { max-width: 70px; }
.wcard__lock { position: absolute; top: 0; inset-inline-end: 0; display: grid; place-items: center; color: var(--muted); }
.wcard__lock .ic { width: 15px; height: 15px; padding: 5px; box-sizing: content-box; border-radius: 50%; background: var(--surface-3); border: 1px solid var(--line-2); }
.wcard__btn b { font-size: 13.5px; }
.wcard__btn small { font-size: 12px; color: var(--muted); }
.wcard__btn small.is-on { color: var(--accent); font-weight: 600; }
.wcard__req { line-height: 1.4; }
.wcard__prog { width: 100%; display: grid; gap: 2px; }
.wcard__prog small { font-family: var(--f-led); }
.av--crop .av__aura { display: none; }

/* v11: reminders, notifications, streak shield */
.tag--remind { padding-inline: 7px; }
.tag--remind.is-set { border-style: solid; color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.tag--remind bdi { font-family: var(--f-led); font-size: 13px; }
.rm__q { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; }
.rm__q .ic { color: var(--accent); }
.rm-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.rm input[type="time"] { font-family: var(--f-led); font-size: 26px; text-align: center; }
.nf-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 14px; }
.nf-line .btn { margin-inline-start: auto; }
.nf-line.is-ok { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 40%, transparent); }
.nf-line.is-warn { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.hchip.is-shield { cursor: pointer; font: inherit; color: var(--muted); background: transparent; }
.hchip.is-shield.is-on { color: #8fd3ff; box-shadow: inset 0 0 0 1px rgba(58, 168, 255, .45); }
.fz-dots { display: flex; justify-content: center; gap: 14px; margin: 4px 0 10px; }
.fz-dot { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px; border: 1px dashed var(--line-2); color: var(--line-2); }
.fz-dot .ic { width: 34px; height: 34px; }
.fz-dot.is-on { border: 1px solid color-mix(in srgb, #3aa8ff 55%, transparent); color: #8fd3ff; background: color-mix(in srgb, #3aa8ff 14%, transparent); box-shadow: 0 0 20px rgba(58, 168, 255, .25); }
.fz__have { text-align: center; font-weight: 700; margin: 0 0 10px; }
.fz__how { margin: 0 0 8px; padding-inline-start: 20px; line-height: 1.8; }

/* v12: never let wide content (the activity heatmap) stretch the page on phones */
.stack > *, .win__in > * { min-width: 0; }
.hm-wrap { max-width: 100%; }
/* six tabs in the bottom bar must fit a 320px phone */
@media (max-width: 1023px) {
  .nav--bottom .nav__a { min-width: 0; padding-inline: 0; }
  .nav--bottom .nav__a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 360px) {
  .nav--bottom { inset-inline: 6px; padding: 4px; }
  .nav--bottom .nav__a span { font-size: 10px; }
  .nav--bottom .ic { width: 20px; height: 20px; }
}
.status__radar { overflow: hidden; }
/* safety net: nothing may make the page scroll sideways (clip keeps sticky headers working) */
html, body { overflow-x: clip; }
/* very small phones (320–360px): the top bar's six buttons + logo must fit */
@media (max-width: 360px) {
  .topbar { gap: 8px; }
  .topbar__tools .icon-btn { min-width: 30px; width: 30px; height: 36px; padding: 0; }
  .brand__word { font-size: 22px; }
}
@media (max-width: 1023px) { .side { overflow-x: clip; } }

/* v13: phones with large system text — every status block shrinks and wraps instead of widening the page */
@media (max-width: 1023px) {
  .main, .side, .shell { min-width: 0; max-width: 100%; }
  .main { overflow-x: clip; }
  .status__grid, .status__stats, .grid2 { grid-template-columns: minmax(0, 1fr) !important; }
  .status__id { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .status__id > div, .status__id dd, .status__id dt, .srow__name, .srow__name *, .hunter__id, .hunter__name, .hunter__title { min-width: 0; overflow-wrap: anywhere; }
  .srow { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .counts, .counts > * { min-width: 0; }
  .status__radar .radar { max-width: min(250px, 100%); }
  .hm-wrap { width: 100%; }
}

/* v14: brand — the XP-bar V + "Vyven" wordmark (replaces the LED word) */
.logo { display: inline-flex; align-items: center; gap: .32em; line-height: 1; direction: ltr; }
.logo-mark { width: 1.15em; height: 1.1em; flex: none; overflow: visible; }
.logo__word { font-family: var(--f-ui); font-weight: 800; letter-spacing: -.02em; background: linear-gradient(180deg, #fde68a, #f59e0b 70%); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .logo__word { background: linear-gradient(180deg, #f59e0b, #b45309 75%); -webkit-background-clip: text; background-clip: text; }
.brand { background: none; box-shadow: none; padding: 4px 6px; }
.logo--bar { font-size: 26px; }
.logo--splash { font-size: clamp(46px, 12vw, 84px); }
.logo--auth { font-size: clamp(48px, 13vw, 78px); }
.auth__brand { display: grid; justify-items: center; gap: 10px; padding: 18px 20px 8px; text-align: center; }
.auth__word { margin: 0; font-size: inherit; }
.splash .logo { animation: logoIn .7s var(--ease-out) both; }
@keyframes logoIn { from { opacity: 0; transform: translateY(8px) scale(.96); } to { opacity: 1; transform: none; } }
@media (max-width: 360px) { .logo--bar { font-size: 21px; } }
@media (prefers-reduced-motion: reduce) { .splash .logo { animation: none; } }

/* v15: rank crest — a shield badge in the same language as the logo (violet night + lit rank colour) */
.crest {
  --shield: polygon(50% 0, 100% 13%, 100% 62%, 50% 100%, 0 62%, 0 13%);
  position: relative; isolation: isolate;
  width: calc(var(--s) * .9); height: var(--s);
  border-radius: 0; box-shadow: none;
  clip-path: var(--shield);
  background: linear-gradient(170deg, color-mix(in srgb, var(--cl) 95%, #fff), color-mix(in srgb, var(--cl) 70%, #1e1640));
  background-size: auto;
  align-content: center; justify-items: center; gap: calc(var(--s) * .04);
}
.crest::before {
  content: ''; position: absolute; inset: max(2px, calc(var(--s) * .06)); z-index: -1;
  clip-path: var(--shield);
  background: radial-gradient(120% 80% at 50% 18%, color-mix(in srgb, var(--cl) 26%, #1e1640), #0f0f23 72%);
}
.crest b, .crest--xs b, .crest--sm b {
  font-family: var(--f-ui); font-weight: 800; letter-spacing: -.02em;
  font-size: calc(var(--s) * .5);
  color: var(--cl);
  text-shadow: 0 0 calc(var(--s) * .12) color-mix(in srgb, var(--cl) 55%, transparent);
  transform: translateY(-6%);
}
.crest.is-high b { background: linear-gradient(180deg, #fff 0%, var(--cl) 70%); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 calc(var(--s) * .08) color-mix(in srgb, var(--cl) 60%, transparent)); }
.crest--xl { border-radius: 0; }
.crest__pips { display: flex; gap: calc(var(--s) * .035); transform: translateY(-40%); }
.crest__pips i { width: calc(var(--s) * .085); height: calc(var(--s) * .07); background: var(--cl); clip-path: polygon(30% 0, 100% 0, 70% 100%, 0 100%); box-shadow: 0 0 4px var(--cl); }
.celebrate__crest, .bf__body { filter: drop-shadow(0 0 18px color-mix(in srgb, var(--cl) 45%, transparent)); }
.hchip__rank { border-radius: 0; box-shadow: none; width: 19px; height: 21px; clip-path: polygon(50% 0, 100% 13%, 100% 62%, 50% 100%, 0 62%, 0 13%); background: linear-gradient(180deg, color-mix(in srgb, var(--cl) 30%, #1e1640), #0f0f23); font-family: var(--f-ui); font-weight: 800; font-size: 11.5px; padding-bottom: 3px; }

/* v16: one brand language everywhere — the dotted LED scoreboards become "night panels" like the app icon:
   violet night gradient, crisp gold numbers in the UI font, slanted XP segments. */
:root {
  --f-led: 'Alexandria', system-ui, sans-serif;
  --f-px: 'Alexandria', system-ui, sans-serif;
  --board: #16112e;
  --board-dot: transparent;
  --board-edge: rgba(139, 92, 246, .28);
  --board-text: #f4f1ff;
  --board-muted: #b2a9d4;
  --led: #fbbf24;
  --led-glow: rgba(245, 158, 11, .28);
  --led-off: rgba(167, 139, 250, .16);
  --g-gold: linear-gradient(180deg, #fde68a, #f59e0b 75%);
}
.board {
  background-color: #120e26;
  background-image: radial-gradient(130% 110% at 100% 0%, rgba(124, 58, 237, .26), transparent 58%), linear-gradient(165deg, #1c1538, #0f0f23);
  background-size: auto; background-position: 0 0;
  box-shadow: inset 0 0 0 1px var(--board-edge), 0 6px 18px -10px rgba(76, 29, 149, .55);
}
:root[data-theme="light"] .board { box-shadow: inset 0 0 0 1px var(--board-edge), 0 6px 16px -8px rgba(76, 29, 149, .45); }
.led {
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.01em;
  text-shadow: 0 0 14px var(--led-glow);
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: 'tnum' 1, 'lnum' 1;
}
.led--dim { color: rgba(251, 191, 36, .35); }
.led--teal { text-shadow: 0 0 14px rgba(62, 214, 191, .25); }
.led--red { text-shadow: 0 0 14px rgba(255, 106, 85, .3); }
.num { font-weight: 600; letter-spacing: 0; font-size: 1em; font-variant-numeric: tabular-nums; }
.is-boot .board .led, .auth__board .led, .splash__board .led { animation: none; }

/* slanted XP segments, like the bars in the logo */
.bar {
  --cell: 7px; --gap: 3px;
  border-radius: 2px;
  -webkit-mask: repeating-linear-gradient(115deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap)));
  mask: repeating-linear-gradient(115deg, #000 0 var(--cell), transparent var(--cell) calc(var(--cell) + var(--gap)));
}
.bar--thin { --cell: 5px; --gap: 2px; }
.bar--q { --cell: 5px; --gap: 2px; }
.bar--led { background: var(--led-off); }
.bar--led .bar__fill { background: linear-gradient(90deg, #7c3aed, #f59e0b 55%, #fde68a); box-shadow: none; }
[dir="rtl"] .bar--led .bar__fill { background: linear-gradient(270deg, #7c3aed, #f59e0b 55%, #fde68a); }

/* ranks ladder (status page) */
.ladder__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ladder__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: 'crest name mark' 'crest req mark'; column-gap: 12px; row-gap: 2px; align-items: center; padding: 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.ladder__item .crest { grid-area: crest; --s: 44px; }
.ladder__name { grid-area: name; font-weight: 700; align-self: end; }
.ladder__req { grid-area: req; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--muted); align-self: start; }
.ladder__streak { display: inline-flex; align-items: center; gap: 3px; }
.ladder__streak .ic { width: 14px; height: 14px; color: #f59e0b; }
.ladder__lock, .ladder__ok, .ladder__you { grid-area: mark; }
.ladder__lock .ic { color: var(--muted); }
.ladder__ok .ic { color: var(--cl, var(--teal)); }
.ladder__you { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 22%, transparent); color: var(--text); }
.ladder__item.is-now { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.ladder__item.is-locked .crest { filter: grayscale(1) brightness(.75); opacity: .7; }
.ladder__item.is-locked .ladder__name { color: var(--muted); }
.ladder__item.is-done .ladder__ok .ic { color: var(--teal); }
@media (min-width: 900px) { .ladder__list { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); } }
.opp__nums { flex-wrap: wrap; row-gap: 4px; min-width: 0; }
.bal b { font-size: 13.5px; overflow: visible; text-overflow: clip; }
@media (max-width: 480px) { .opp__chance { min-width: 0; padding: 6px 8px 4px; } .opp__chance .led { font-size: 21px; } }
.crest:has(.crest__pips) b { transform: translateY(-14%); }
.crest__pips { transform: translateY(-10%); }
