/*
 * Mythoria portal - design system (SPEC v1.3 §7.2). Owner: WP0b.
 *
 * Tokens: light values on :root, dark values under prefers-color-scheme (unless <html data-theme="light">) and
 * again under <html data-theme="dark">. .theme-light / .theme-dark re-declare the tokens on any element (styleguide
 * previews). Components use tokens only, never raw colours (tests/Unit/Core/Ui/ContrastTest.php reads the three
 * token blocks below and checks every text/background pair the components use).
 *
 * Naming (§2.3): components unprefixed (.btn, .card, .field ...), module classes .<slug>-*, utilities .u-*.
 * No inline styles anywhere (CSP): every visual variant is a class.
 */

/* ---------------------------------------------------------------------------------------------- fonts */
@font-face {
  font-family: "Nunito";
  src: url("/assets/fonts/Nunito-Variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/Fredoka-Variable.ttf") format("truetype");
  font-weight: 300 700;
  font-stretch: 75% 125%;
  font-style: normal;
  font-display: swap;
}

/* ---------------------------------------------------------------------------------------------- tokens */
/* The dark --c-danger is slightly lighter than the §7.2.1 value: with the spec value, danger text on a selected
   card (--c-primary-soft: character or tier card notes) was 4.44:1; now 4.58:1 (WP0b deviation 10, ContrastTest). */
/* @tokens light */
:root, .theme-light {
  --c-bg: #EEF5FC;
  --c-surface: #FFFFFF;
  --c-surface-2: #F4F8FD;
  --c-parchment: #FBF3DF;
  --c-parchment-line: #EAD9B0;
  --c-ink: #1C2A3A;
  --c-ink-2: #4F6178;
  --c-line: #D5E0EC;
  --c-line-strong: #7A8EA6;
  --c-primary: #2672D8;
  --c-primary-deep: #1D5FB8;
  --c-primary-ink: #FFFFFF;
  --c-primary-soft: #DCEBFD;
  --c-gold: #F2B233;
  --c-gold-ink: #3B2A00;
  --c-gold-deep: #8A5C00;
  --c-gold-soft: #FDF0D2;
  --c-berry: #F07AA0;
  --c-berry-ink: #3A0A1C;
  --c-berry-deep: #A3305A;
  --c-berry-soft: #FDE4EC;
  --c-success: #177245;
  --c-success-ink: #FFFFFF;
  --c-success-soft: #DDF3E7;
  --c-warning: #7F5500;
  --c-warning-soft: #FCEFD0;
  --c-danger: #B02E2E;
  --c-danger-ink: #FFFFFF;
  --c-danger-soft: #FBE3E3;
  --c-focus: #FFB020;
  --c-shadow: rgba(28,42,58,.10);
  --c-shadow-2: rgba(28,42,58,.18);
  --c-press: rgba(0,0,0,.16);
  --c-overlay: rgba(14,21,34,.45);
  --sky-top: #BFDDFB;
  --sky-bottom: #EEF5FC;
  --c-link: #1D5FB8;
  --c-gold-text: #3B2A00;
  --c-cloud: #FFFFFF;
  --c-placeholder: #757575;
  --c-medal-silver: #AEBBCC;
  --c-medal-bronze: #D29A62;
  --c-art-kicker: #6E1F40;
  --c-art-ink: #1C2A3A;
  --c-art-dot: #C2466F;
  --c-hero-fallback: #A9C6E2;
  --c-btn-glow: rgba(43,123,228,.25);
  --c-btn-glow-gold: rgba(201,138,18,.28);
  --c-press-strong: rgba(0,0,0,.18);
  --cloud-opacity: .9;
  --logo-shadow: drop-shadow(0 6px 14px rgba(20,40,80,.35));
  --logo-shadow-lg: drop-shadow(0 10px 22px rgba(20,40,80,.35));
  --hero-hdr-bg: color-mix(in srgb, var(--c-surface) 72%, transparent);
  --hero-hdr-line: rgba(255,255,255,.6);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234F6178' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
  color-scheme: light;
}
/* @end */

/* @tokens dark-media */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0E1522;
    --c-surface: #172133;
    --c-surface-2: #1D293E;
    --c-parchment: #2A2418;
    --c-parchment-line: #4A3F28;
    --c-ink: #E7EEF8;
    --c-ink-2: #A7B5CA;
    --c-line: #2C3B54;
    --c-line-strong: #5E7494;
    --c-primary: #6AA8FF;
    --c-primary-deep: #8BBCFF;
    --c-primary-ink: #0B1422;
    --c-primary-soft: #1E3558;
    --c-gold: #FFC857;
    --c-gold-ink: #1E1600;
    --c-gold-deep: #FFD77F;
    --c-gold-soft: #3A2E12;
    --c-berry: #FF97BA;
    --c-berry-ink: #3A0A1C;
    --c-berry-deep: #FFB3CC;
    --c-berry-soft: #3E2030;
    --c-success: #48C987;
    --c-success-ink: #06180F;
    --c-success-soft: #123424;
    --c-warning: #F2B233;
    --c-warning-soft: #3A2C0E;
    --c-danger: #FF7070;
    --c-danger-ink: #1A0707;
    --c-danger-soft: #3D1A1A;
    --c-focus: #FFC857;
    --c-shadow: rgba(0,0,0,.45);
    --c-shadow-2: rgba(0,0,0,.6);
    --c-press: rgba(0,0,0,.28);
    --c-overlay: rgba(0,0,0,.6);
    --sky-top: #16243B;
    --sky-bottom: #0E1522;
    --c-link: #6AA8FF;
    --c-gold-text: #FFC857;
    --c-cloud: #1D2A42;
    --c-placeholder: #A7B5CA;
    --c-medal-silver: #AEBBCC;
    --c-medal-bronze: #D29A62;
    --c-art-kicker: #6E1F40;
    --c-art-ink: #1C2A3A;
    --c-art-dot: #C2466F;
    --c-hero-fallback: #16243B;
    --c-btn-glow: rgba(43,123,228,.25);
    --c-btn-glow-gold: rgba(201,138,18,.28);
    --c-press-strong: rgba(0,0,0,.18);
    --cloud-opacity: .7;
    --logo-shadow: drop-shadow(0 6px 14px rgba(20,40,80,.35));
    --logo-shadow-lg: drop-shadow(0 10px 22px rgba(20,40,80,.35));
    --hero-hdr-bg: color-mix(in srgb, var(--c-surface) 72%, transparent);
    --hero-hdr-line: var(--c-line);
    --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A7B5CA' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
/* @end */

/* @tokens dark */
:root[data-theme="dark"], .theme-dark {
  --c-bg: #0E1522;
  --c-surface: #172133;
  --c-surface-2: #1D293E;
  --c-parchment: #2A2418;
  --c-parchment-line: #4A3F28;
  --c-ink: #E7EEF8;
  --c-ink-2: #A7B5CA;
  --c-line: #2C3B54;
  --c-line-strong: #5E7494;
  --c-primary: #6AA8FF;
  --c-primary-deep: #8BBCFF;
  --c-primary-ink: #0B1422;
  --c-primary-soft: #1E3558;
  --c-gold: #FFC857;
  --c-gold-ink: #1E1600;
  --c-gold-deep: #FFD77F;
  --c-gold-soft: #3A2E12;
  --c-berry: #FF97BA;
  --c-berry-ink: #3A0A1C;
  --c-berry-deep: #FFB3CC;
  --c-berry-soft: #3E2030;
  --c-success: #48C987;
  --c-success-ink: #06180F;
  --c-success-soft: #123424;
  --c-warning: #F2B233;
  --c-warning-soft: #3A2C0E;
  --c-danger: #FF7070;
  --c-danger-ink: #1A0707;
  --c-danger-soft: #3D1A1A;
  --c-focus: #FFC857;
  --c-shadow: rgba(0,0,0,.45);
  --c-shadow-2: rgba(0,0,0,.6);
  --c-press: rgba(0,0,0,.28);
  --c-overlay: rgba(0,0,0,.6);
  --sky-top: #16243B;
  --sky-bottom: #0E1522;
  --c-link: #6AA8FF;
  --c-gold-text: #FFC857;
  --c-cloud: #1D2A42;
  --c-placeholder: #A7B5CA;
  --c-medal-silver: #AEBBCC;
  --c-medal-bronze: #D29A62;
  --c-art-kicker: #6E1F40;
  --c-art-ink: #1C2A3A;
  --c-art-dot: #C2466F;
  --c-hero-fallback: #16243B;
  --c-btn-glow: rgba(43,123,228,.25);
  --c-btn-glow-gold: rgba(201,138,18,.28);
  --c-press-strong: rgba(0,0,0,.18);
  --cloud-opacity: .7;
  --logo-shadow: drop-shadow(0 6px 14px rgba(20,40,80,.35));
  --logo-shadow-lg: drop-shadow(0 10px 22px rgba(20,40,80,.35));
  --hero-hdr-bg: color-mix(in srgb, var(--c-surface) 72%, transparent);
  --hero-hdr-line: var(--c-line);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23A7B5CA' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 9 7 7 7-7'/%3E%3C/svg%3E");
  color-scheme: dark;
}
/* @end */

/* Companion rules of the dark theme (PAR-CORE 2.1): the prototype's dark eyebrow, gold pill text and inactive tab labels
   (owner decision D5). Repeated for prefers-color-scheme, <html data-theme="dark"> and .theme-dark previews. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .eyebrow { color: var(--c-berry); }
  :root:not([data-theme="light"]) .badge--gold, :root:not([data-theme="light"]) .pill--gold { color: var(--c-gold); }
  :root:not([data-theme="light"]) .tabbar__link:not([aria-current]) { color: var(--c-primary); }
}
:root[data-theme="dark"] .eyebrow, .theme-dark .eyebrow { color: var(--c-berry); }
:root[data-theme="dark"] .badge--gold, :root[data-theme="dark"] .pill--gold, .theme-dark .badge--gold, .theme-dark .pill--gold { color: var(--c-gold); }
:root[data-theme="dark"] .tabbar__link:not([aria-current]), .theme-dark .tabbar__link:not([aria-current]) { color: var(--c-primary); }

/* Theme-independent scales (§7.2.2, §7.2.3, §7.2.5). Heading scale fixed as on the prototype boards (h1 30, h2 22). */
:root {
  --font-display: "Fredoka", "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Consolas, "Liberation Mono", monospace;
  --fs-xs: .8125rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.375rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: clamp(2rem, 1.5rem + 2.5vw, 3rem);
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;
  --r-sm: 10px; --r-md: 16px; --r-lg: 24px; --r-pill: 999px;
  --e-1: 0 1px 2px var(--c-shadow);
  --e-2: 0 6px 18px var(--c-shadow);
  --bp-sm: 480px; --bp-md: 768px; --bp-lg: 1024px;
  --container: 1120px;
  --gutter: 16px;
  --header-h: 56px;
  --tabbar-h: 68px;
  --motion: 160ms ease-out;
}
@media (min-width: 768px) { :root { --gutter: 24px; } }
@media (min-width: 1024px) { :root { --header-h: 72px; } }

/* ---------------------------------------------------------------------------------------------- base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 12px); }
/* D7: keyboard focus never lands under the fixed phone tab bar (the layout marks <html> when it prints the tab bar). */
@media (max-width: 767.98px) {
  html.has-tabbar { scroll-padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 12px); }
}
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  font-family: var(--font-body); font-size: var(--fs-md); line-height: 1.55; font-weight: 400;
  color: var(--c-ink); background-color: var(--c-bg);
  -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
h1, h2, h3, h4, .display { font-family: var(--font-display); font-weight: 600; line-height: 1.2; margin: 0; text-wrap: balance; }
h1 { font-size: var(--fs-2xl); }
h2, .h2 { font-size: var(--fs-xl); }
h3, .h3 { font-size: var(--fs-lg); }
h4, .h4 { font-size: var(--fs-md); }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding-left: 1.25em; }
img, svg, picture { max-width: 100%; }
img { height: auto; }
picture { display: block; }
strong, b { font-weight: 800; }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--c-line); margin: var(--s-5) 0; }
a { color: var(--c-link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
code, kbd, samp { font-family: var(--font-mono); font-size: .92em; }
table { border-collapse: collapse; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 2px; box-shadow: 0 0 0 1px var(--c-ink); }
::selection { background: var(--c-primary-soft); color: var(--c-ink); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------------------------------------------------------------------------------------------- utilities */
.u-visually-hidden, .sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.u-muted { color: var(--c-ink-2); }
.u-small { font-size: var(--fs-sm); }
.u-xs { font-size: var(--fs-xs); }
.u-lg { font-size: var(--fs-lg); }
.u-num { font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.u-mono { font-family: var(--font-mono); font-size: .92em; letter-spacing: 0; }
.u-strong { font-weight: 800; }
.u-center { text-align: center; }
.u-end { text-align: end; }
.u-nowrap { white-space: nowrap; }
.u-measure { max-width: 68ch; }
.u-stack { display: flex; flex-direction: column; gap: var(--s-3); }
.u-stack-sm { display: flex; flex-direction: column; gap: var(--s-2); }
.u-stack-lg { display: flex; flex-direction: column; gap: var(--s-5); }
.u-flow > * + * { margin-top: 12px; }
.u-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.u-row-between { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; justify-content: space-between; }
.u-grow { flex: 1 1 auto; min-width: 0; }
.u-mt-0 { margin-top: 0 !important; }
.u-mt-2 { margin-top: var(--s-2); }
.u-mt-4 { margin-top: var(--s-4); }
.u-mt-6 { margin-top: var(--s-6); }
.u-mb-4 { margin-bottom: var(--s-4); }
.u-danger { color: var(--c-danger); }
.u-success { color: var(--c-success); }
.u-parchment { background: var(--c-parchment); border: 1px solid var(--c-parchment-line); border-radius: var(--r-md); padding: var(--s-5); }
.u-white-tile { background: #FFFFFF; border-radius: var(--r-sm); padding: var(--s-3); }
.u-full { width: 100%; }
.divider { height: 1px; background: var(--c-line); border: 0; margin: 0; flex-shrink: 0; }
.code-link { font-weight: 700; text-decoration: none; color: var(--c-primary-deep); }
.code-link:hover { text-decoration: underline; }
/* Phone and desktop boards that need different markup render both; one of them is display: none (so assistive
   technology meets one). Tablets (768-1023 px, no board) get the phone structure. */
@media (max-width: 1023.98px) { .u-desktop-only { display: none !important; } }
@media (min-width: 1024px) { .u-phone-only { display: none !important; } }

/* ---------------------------------------------------------------------------------------------- layout */
.container { width: 100%; max-width: calc(var(--container) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.page-body { padding-block: 20px 32px; display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 1024px) { .page-body { padding-bottom: 88px; } }
.page-head { display: flex; flex-direction: column; gap: var(--s-2); }
.page-head .eyebrow + h1 { margin-top: -2px; }
.eyebrow {
  font-family: var(--font-display); font-weight: 600; font-size: 12.5px; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--c-berry-deep);
}
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.section-title .more {
  display: inline-flex; align-items: center; gap: 2px; min-height: 44px; padding: 0 2px 0 8px;
  font-size: 15px; font-weight: 800; color: var(--c-link); text-decoration: none;
}
.section-title .more .icon { width: 18px; height: 18px; stroke-width: 2.4; }
.grid { display: grid; gap: var(--s-3); }
.tier-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.char-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr)); }
.news-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); }
.split { display: grid; gap: var(--s-5); }
@media (min-width: 1024px) { .split { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
@media (max-width: 380px) { .tier-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The page background: the sky wash behind the header (§7.2.1), no cloud band. Pages opt in to the prototype's pill
   clouds with bodyClass "has-clouds" (the layout prints .sky-cloud--1..3; each page sizes and places them). */
.layout-player, .layout-bare {
  position: relative; overflow-x: clip;
  background-color: var(--c-bg);
  background-image: linear-gradient(180deg, var(--sky-top) 0, var(--sky-bottom) 420px, var(--c-bg) 421px);
  background-repeat: no-repeat;
}
.sky-cloud {
  position: absolute; z-index: 0; display: block; width: 0; height: 0;
  background: var(--c-cloud); opacity: var(--cloud-opacity); border-radius: var(--r-pill); filter: blur(.2px); pointer-events: none;
}
.sky-cloud-art { display: none; position: absolute; z-index: 0; color: var(--c-cloud); opacity: var(--cloud-opacity); pointer-events: none; }
@media (min-width: 1024px) {
  .sky-cloud-art { display: block; }
  .sky-cloud-art--l { left: 60px; top: 112px; width: 200px; height: 74px; }
  .sky-cloud-art--r { right: 70px; top: 90px; width: 260px; height: 94px; }
}
/* With the tab bar the white footer runs under it (its inner padding clears the bar), as on the phone boards. */
.layout-player.has-tabbar { padding-bottom: 0; }
.site-main { display: block; min-height: 50vh; position: relative; z-index: 1; }

/* Auth backdrop (bodyClass "has-auth-art", phones only): the castle art behind the header and the top of the card. */
.auth-art {
  position: absolute; left: 0; right: 0; top: -26px; height: 500px; overflow: hidden; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, black 0, black var(--auth-art-solid, 42%), transparent var(--auth-art-fade, 90%));
  mask-image: linear-gradient(180deg, black 0, black var(--auth-art-solid, 42%), transparent var(--auth-art-fade, 90%));
}
.auth-art picture, .auth-art img { display: block; width: 100%; height: 100%; }
.auth-art img { object-fit: cover; object-position: center top; }
.has-auth-art .page-body { position: relative; z-index: 1; }
@media (min-width: 768px) { .auth-art { display: none; } }

/* skip link */
.skip-link {
  position: absolute; left: var(--s-3); top: -60px; z-index: 100; padding: var(--s-2) var(--s-4);
  background: var(--c-surface); color: var(--c-ink); border-radius: var(--r-pill); font-weight: 800; box-shadow: var(--e-2);
}
.skip-link:focus { top: var(--s-2); }

/* site notice banner (core.site_notice) */
.site-notice { position: relative; z-index: 2; background: var(--c-warning-soft); color: var(--c-ink); font-size: var(--fs-sm); border-bottom: 1px solid var(--c-line); }
.site-notice .container { display: flex; gap: var(--s-2); align-items: flex-start; padding-block: var(--s-2); }
.site-notice .icon { color: var(--c-warning); flex-shrink: 0; margin-top: 2px; }

/* ---------------------------------------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--c-surface) 86%, transparent);
  border-bottom: 1px solid var(--c-line);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; min-height: 44px; border-radius: var(--r-sm); }
.brand__img { display: block; height: 40px; width: auto; }
.site-nav { display: none; }
.site-header__actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
@media (min-width: 768px) {
  .brand__img { height: 50px; }
  /* 768-1023 px (no board, R10): the strip may be wider than the space; auto margins centre it when it fits and resolve
     to 0 when it overflows, so the first link is never cut off out of scroll reach (justify-content: center was). */
  .site-nav { display: flex; align-items: center; gap: 2px; flex: 1 1 auto; justify-content: flex-start; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .site-nav > :first-child { margin-inline-start: auto; }
  .site-nav > :last-child { margin-inline-end: auto; }
  .site-header__actions { margin-left: 0; }
}
@media (min-width: 1024px) {
  .site-header { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
  .site-header__inner { max-width: none; padding-inline: 32px; display: grid; grid-template-columns: 1fr auto 1fr; gap: 16px; }
  .site-nav { flex: none; gap: 4px; overflow: visible; }
  .site-header__actions { justify-self: end; gap: 8px; }
  .site-header .btn--quiet { min-height: 44px; padding: 0 16px; }
}
.site-nav__link {
  display: inline-flex; align-items: center; height: 40px; padding: 0 12px; border-radius: var(--r-pill);
  color: var(--c-ink-2); font-weight: 700; font-size: .9375rem; text-decoration: none; white-space: nowrap;
  transition: background-color var(--motion), color var(--motion);
}
@media (min-width: 1024px) { .site-nav__link { height: 44px; padding: 0 16px; font-size: 15.5px; } }
.site-nav__link:hover { background: var(--c-surface-2); color: var(--c-ink); }
.site-nav__link[aria-current="page"] { background: var(--c-primary-soft); color: var(--c-primary-deep); }

.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--r-pill); border: 1px solid var(--c-line);
  background: var(--c-surface); color: var(--c-ink); display: inline-flex; align-items: center; justify-content: center;
  padding: 0; cursor: pointer; text-decoration: none; transition: background-color var(--motion);
}
.icon-btn:hover { background: var(--c-surface-2); }

/* Theme toggle: the moon in both themes, as on every board (HomeDark included). The auto/light/dark cycle and its
   labels stay in app.js. */
@media (min-width: 1024px) { .site-header .theme-toggle .icon { width: 22px; height: 22px; } }

/* menus: <details class="menu"><summary>..</summary><div class="menu__panel">..</div></details> (no JS needed) */
.menu { position: relative; }
.menu > summary { list-style: none; cursor: pointer; }
.menu > summary::-webkit-details-marker { display: none; }
.menu__panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; min-width: 240px; max-width: min(340px, calc(100vw - 2 * var(--gutter)));
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--e-2);
  padding: var(--s-2); display: flex; flex-direction: column; gap: 2px;
}
.menu__head { padding: var(--s-2) var(--s-3); color: var(--c-ink-2); font-size: var(--fs-sm); border-bottom: 1px solid var(--c-line); margin-bottom: var(--s-1); }
.menu__head strong { color: var(--c-ink); display: block; font-size: var(--fs-md); }
.menu__link, .menu__button {
  display: flex; align-items: center; gap: var(--s-3); min-height: 44px; padding: 0 var(--s-3); border-radius: var(--r-sm);
  color: var(--c-ink); text-decoration: none; font-weight: 700; background: none; border: 0; width: 100%; cursor: pointer; text-align: left;
}
.menu__link:hover, .menu__button:hover { background: var(--c-surface-2); }
.menu__link[aria-current="page"] { background: var(--c-primary-soft); color: var(--c-primary-deep); }
.menu__link .icon, .menu__button .icon { color: var(--c-ink-2); }
.menu__form { margin: 0; border-top: 1px solid var(--c-line); padding-top: var(--s-1); margin-top: var(--s-1); }
.menu__section-label { padding: var(--s-2) var(--s-3) 2px; font-size: var(--fs-xs); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--c-ink-2); }
.account-menu .menu__panel { max-height: calc(100vh - var(--header-h) - 16px); overflow-y: auto; }
@media (max-width: 767.98px) {
  .account-menu .menu__panel { position: fixed; left: var(--gutter); right: var(--gutter); top: calc(var(--header-h) + 8px); max-width: none; max-height: calc(100vh - var(--header-h) - var(--tabbar-h) - 32px); }
}

/* Account trigger: a 44 px round button with the main character's portrait on phones, the account chip on desktop.
   vertical-align: top keeps the inline-flex summary off the baseline of the block <details> line box: with the class
   art (an <img> in a <picture>) the baseline sat lower and the menu grew to 47.8 px, lifting the portrait by 2 px. */
.avatar-btn {
  width: 44px; height: 44px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center;
  padding: 0; background: transparent; color: var(--c-ink); vertical-align: top;
}
.avatar-btn__img { display: block; width: 36px; height: 36px; border-radius: var(--r-pill); border: 2px solid var(--c-primary); background: var(--c-parchment); object-fit: cover; }
.avatar-btn .avatar-btn__name, .avatar-btn .avatar-btn__chev { display: none; }
@media (min-width: 1024px) {
  .acct-chip {
    width: auto; height: 48px; gap: 8px; padding: 0 12px 0 4px; border: 1px solid var(--c-line); background: var(--c-surface);
    font-weight: 800; font-size: 15px; white-space: nowrap;
  }
  .acct-chip .avatar-btn__img { width: 40px; height: 40px; border: 0; background: var(--c-primary-soft); }
  .acct-chip .avatar { width: 40px; height: 40px; }
  .acct-chip.avatar-btn .avatar-btn__name { display: inline; }
  .acct-chip.avatar-btn .avatar-btn__chev { display: inline-block; width: 18px; height: 18px; }
  .acct-chip.is-current { border: 1.5px solid var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary-deep); }
  .acct-chip.is-current .avatar-btn__img { background: var(--c-surface); border: 1px solid var(--c-line); }
}

/* ---------------------------------------------------------------------------------------------- tab bar */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  background: var(--c-surface); border-top: 1px solid var(--c-line); box-shadow: 0 -6px 18px var(--c-shadow);
}
.tabbar__link {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 0;
  color: var(--c-ink-2); text-decoration: none; font-size: 11.5px; font-weight: 800; line-height: 1.55;
}
.tabbar__icon { width: 44px; height: 30px; border-radius: var(--r-pill); display: flex; align-items: center; justify-content: center; transition: background-color var(--motion); }
.tabbar__label { max-width: 100%; white-space: nowrap; padding: 0 2px; }
.tabbar__link[aria-current="page"] { color: var(--c-primary-deep); }
.tabbar__link[aria-current="page"] .tabbar__icon { background: var(--c-primary-soft); }
@media (min-width: 768px) { .tabbar { display: none; } }

/* ---------------------------------------------------------------------------------------------- footer */
.site-footer { position: relative; z-index: 1; margin-top: 0; background: var(--c-surface); border-top: 1px solid var(--c-line); color: var(--c-ink-2); font-size: 13.5px; }
.site-footer__inner { padding-block: 24px 32px; display: flex; flex-direction: column; gap: 12px; }
.site-footer__top, .site-footer__bottom { display: flex; flex-direction: column; gap: 12px; }
.site-footer__brand, .site-footer__inner > .divider { display: none; }
.site-footer__links { display: flex; flex-wrap: wrap; gap: 0 18px; list-style: none; padding: 0; margin: 0; }
.site-footer__links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--c-ink-2); font-weight: 700; text-decoration: none; }
.site-footer__links a:hover { color: var(--c-ink); text-decoration: underline; }
.site-footer__notice { font-size: 12.5px; line-height: 1.5; max-width: 90ch; }
@media (max-width: 767.98px) {
  .has-tabbar .site-footer__inner { padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }
}
@media (min-width: 1024px) {
  .site-footer__inner { padding-block: 40px 48px; gap: 0; }
  .site-footer__top { flex-direction: row; align-items: flex-start; justify-content: space-between; gap: 48px; padding-bottom: 24px; }
  .site-footer__brand { display: inline-flex; flex-shrink: 0; border-radius: var(--r-sm); }
  .site-footer__brand .brand__img { height: 56px; }
  .site-footer__inner > .divider { display: block; }
  .site-footer__links { max-width: 720px; justify-content: flex-end; gap: 10px 22px; font-size: 14.5px; }
  .site-footer__links a { min-height: 0; }
  .site-footer__bottom { flex-direction: row; justify-content: space-between; gap: 48px; padding-top: 20px; }
  .site-footer__bottom .site-footer__notice { max-width: 720px; text-align: right; }
}

/* ---------------------------------------------------------------------------------------------- flash */
.flash-region { display: flex; flex-direction: column; gap: var(--s-2); }
.flash-region:empty { display: none; }
.layout-player .flash-region { padding-top: var(--s-4); }
.layout-player .page-body > .flash-region { padding-top: 0; }

/* ---------------------------------------------------------------------------------------------- icons */
/* The sprite's symbols carry no stroke width: .icon sets 2, the weight modifiers the prototype's heavier strokes. */
.icon { display: inline-block; width: 1.25em; height: 1.25em; flex-shrink: 0; vertical-align: -0.25em; stroke-width: 2; }
.icon--medium { stroke-width: 2.2; }
.icon--bold { stroke-width: 2.4; }
.icon--heavy { stroke-width: 3; }
.icon--13 { width: 13px; height: 13px; }
.icon--14 { width: 14px; height: 14px; }
.icon--15 { width: 15px; height: 15px; }
.icon--16 { width: 16px; height: 16px; }
.icon--18 { width: 18px; height: 18px; }
.icon--20 { width: 20px; height: 20px; }
.icon--22 { width: 22px; height: 22px; }
.icon--24 { width: 24px; height: 24px; }
.icon--26 { width: 26px; height: 26px; }
.icon--28 { width: 28px; height: 28px; }
.icon--32 { width: 32px; height: 32px; }
.icon--40 { width: 40px; height: 40px; }
.gem { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600; font-variant-numeric: tabular-nums; }
.gem__img { width: 1.25em; height: auto; flex-shrink: 0; }
.gem--lg { font-size: 1.625rem; line-height: 1; font-weight: 700; }
.gem--lg .gem__img { width: 29px; }
picture.gem__pic { display: contents; }
/* A <picture> with display: contents leaves its <source> (display: inline by default) as an empty box of the parent:
   in a flex row with a gap it added one more gap (the account chip was 8 px wider with the class art, the tier amount
   6 px). The source only selects the file, it never needs a box. */
picture.gem__pic > source, picture.art-pic > source { display: none; }

/* game art (templates/components/art.php) */
.art { display: block; max-width: none; }
picture.art-pic { display: contents; }

/* ---------------------------------------------------------------------------------------------- buttons */
.btn {
  --btn-bg: var(--c-primary); --btn-ink: var(--c-primary-ink);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 48px; padding: 0 22px; border-radius: var(--r-pill); border: 0;
  font-family: var(--font-body); font-weight: 800; font-size: 1rem; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; white-space: nowrap; background: var(--btn-bg); color: var(--btn-ink);
  box-shadow: inset 0 -3px 0 var(--c-press), 0 4px 10px var(--c-btn-glow);
  transition: transform var(--motion), filter var(--motion), box-shadow var(--motion), background-color var(--motion);
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 var(--c-press); }
.btn .icon { width: 20px; height: 20px; }
.btn--secondary { --btn-bg: var(--c-primary-soft); --btn-ink: var(--c-primary-deep); box-shadow: inset 0 -2px 0 var(--c-shadow-2); }
.btn--ghost { --btn-bg: var(--c-surface); --btn-ink: var(--c-ink); border: 1.5px solid var(--c-line); box-shadow: none; }
.btn--ghost:hover { --btn-bg: var(--c-surface-2); filter: none; }
.btn--danger { --btn-bg: var(--c-danger); --btn-ink: var(--c-danger-ink); box-shadow: inset 0 -3px 0 var(--c-press-strong); }
.btn--success { --btn-bg: var(--c-success); --btn-ink: var(--c-success-ink); box-shadow: inset 0 -3px 0 var(--c-press-strong); }
.btn--gold { --btn-bg: var(--c-gold); --btn-ink: var(--c-gold-ink); box-shadow: inset 0 -3px 0 rgba(0,0,0,.14), 0 4px 10px var(--c-btn-glow-gold); }
.btn--quiet { --btn-bg: transparent; --btn-ink: var(--c-primary-deep); box-shadow: none; padding: 0 10px; text-decoration: none; }
.btn--quiet:hover { background: var(--c-primary-soft); filter: none; }
.btn--quiet:active { box-shadow: none; }
.btn--danger-outline { --btn-bg: var(--c-surface); --btn-ink: var(--c-danger); border: 1.5px solid var(--c-danger); box-shadow: none; }
.btn--danger-outline:hover { --btn-bg: var(--c-danger-soft); filter: none; }
.btn--ink-danger { --btn-ink: var(--c-danger); }
.btn--link {
  --btn-bg: transparent; --btn-ink: var(--c-primary-deep); box-shadow: none; padding: 0 var(--s-3);
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px;
}
.btn--link:hover { filter: none; text-decoration-thickness: 2px; }
.btn--link:active { transform: none; box-shadow: none; }
/* Small buttons keep the compact 40 px look of the prototype (.btn.sm), but their tap target is at least 44 x 44 px
   (§7.1): an invisible hit area centred on the button (it takes no space, shows nothing and belongs to the button, so
   a tap on it activates the button). ComponentsTest checks it. */
.btn--sm { position: relative; min-height: 40px; font-size: 14.5px; padding: 0 16px; }
.btn--sm::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; min-width: 44px; min-height: 44px;
  transform: translate(-50%, -50%);
}
.btn--sm .icon { width: 18px; height: 18px; }
.btn--sm.btn--quiet { padding: 0 10px; }
.btn--lg { min-height: 56px; font-size: 1.125rem; padding: 0 28px; }
.btn--lg .icon { width: 22px; height: 22px; }
.btn .icon--24 { width: 24px; height: 24px; }
.btn .icon--26 { width: 26px; height: 26px; }
.btn .icon--16 { width: 16px; height: 16px; }
.btn--block { display: flex; width: 100%; }
.btn--icon { padding: 0; width: 48px; }
.btn--sm.btn--icon { width: 40px; }
.btn[disabled], .btn[aria-disabled="true"], .btn.is-off { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.btn-row--end { justify-content: flex-end; }
form.is-submitting [type="submit"] { opacity: .7; cursor: progress; }

/* ---------------------------------------------------------------------------------------------- forms */
.form { display: flex; flex-direction: column; gap: var(--s-4); max-width: 34rem; }
.form--wide { max-width: none; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field__label { font-weight: 800; font-size: .9375rem; }
.field__req { color: var(--c-danger); font-weight: 800; margin-left: 2px; }
.field__opt { color: var(--c-ink-2); font-weight: 600; font-size: inherit; margin-left: 4px; }
.field__help { font-size: 13.5px; color: var(--c-ink-2); }
.field__error { font-size: 13.5px; color: var(--c-danger); font-weight: 700; display: flex; gap: 6px; align-items: flex-start; }
.field__error .icon { width: 16px; height: 16px; margin-top: 2px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; border-radius: 12px; border: 1.5px solid var(--c-line);
  background: var(--c-surface); color: var(--c-ink); padding: 0 14px; font-size: 1rem; line-height: 1.4;
  transition: border-color var(--motion), box-shadow var(--motion);
}
.textarea { padding: 12px 14px; min-height: 136px; line-height: 1.5; resize: vertical; }
.select {
  appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: var(--select-chevron); background-repeat: no-repeat; background-position: right 14px center; background-size: 20px;
}
.input::placeholder, .textarea::placeholder { color: var(--c-placeholder); opacity: 1; }   /* the boards keep the browser's placeholder grey */
.input:focus-visible, .select:focus-visible, .textarea:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 1px; box-shadow: none; border-color: var(--c-primary); }
.input[readonly] { background: var(--c-surface-2); font-weight: 700; }
.input[disabled], .select[disabled], .textarea[disabled] { opacity: .6; cursor: not-allowed; }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea { border-color: var(--c-danger); background-color: var(--c-danger-soft); }
.input--file { padding: 10px 12px; min-height: 52px; }
.input--file::file-selector-button {
  margin-right: 12px; border: 0; border-radius: var(--r-pill); padding: 8px 14px; font-weight: 800;
  background: var(--c-primary-soft); color: var(--c-primary-deep); cursor: pointer;
}
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap--lock .input, .input-wrap--end .input { padding-right: 44px; }
.input-wrap__lock { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--c-ink-2); pointer-events: none; }
.input-wrap--icon .input { padding-left: 46px; }
.input-wrap__icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--c-ink-2); pointer-events: none; }
/* password reveal (app.js data-reveal): a 44 px eye button (sign-up, sign-in), or the text button "Show" / "Hide"
   (Security; app.js swaps the text and the label) */
.input-wrap--eye .input { padding-right: 56px; }
.input-wrap--reveal .input { padding-right: 76px; }
.input-wrap__btn {
  position: absolute; right: 2px; top: 2px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 10px;
  background: transparent; color: var(--c-ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.input-wrap__btn--text { width: auto; min-width: 66px; padding: 0 10px; color: var(--c-primary-deep); font-size: 14.5px; font-weight: 800; }
.input-wrap__btn:hover { background: var(--c-surface-2); color: var(--c-ink); }
.input-wrap__btn--text:hover { background: var(--c-primary-soft); color: var(--c-primary-deep); }
.file-preview { max-width: 240px; max-height: 240px; border-radius: var(--r-sm); border: 1px solid var(--c-line); background: var(--c-surface-2); object-fit: contain; }
/* file field variant "dropzone": a large label over a visually hidden input */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
  min-height: 156px; padding: 18px; border-radius: 16px; border: 2px dashed color-mix(in srgb, var(--c-primary) 45%, var(--c-line));
  background: var(--c-surface-2); font-size: 14px; font-weight: 600; cursor: pointer;
}
.dropzone:focus-within { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.field.has-error .dropzone { border-color: var(--c-danger); }
.dropzone__icon { width: 56px; height: 56px; border-radius: var(--r-pill); background: var(--c-primary-soft); color: var(--c-primary-deep); display: flex; align-items: center; justify-content: center; }
.dropzone__icon .icon { width: 28px; height: 28px; }
.dropzone__title { font-family: var(--font-display); font-weight: 600; font-size: 18px; color: var(--c-primary-deep); }
.dropzone__help { font-size: var(--fs-xs); color: var(--c-ink-2); font-weight: 400; }

.check { display: flex; gap: var(--s-3); align-items: flex-start; font-size: .9375rem; line-height: 1.45; cursor: pointer; }
.check__box { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--c-primary); flex-shrink: 0; cursor: pointer; }
.check__text { min-width: 0; font-weight: 600; }
.check__text a { font-weight: 800; }
.field.has-error .check__text { color: var(--c-danger); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; font-weight: 800; font-size: .9375rem; margin-bottom: 6px; }
.choice-list { display: flex; flex-direction: column; gap: var(--s-2); }
.choice {
  display: flex; gap: var(--s-3); align-items: center; padding: 12px 14px; min-height: 52px;
  border: 1.5px solid var(--c-line); border-radius: var(--r-md); background: var(--c-surface); cursor: pointer;
}
.choice:has(input:checked) { border: 2px solid var(--c-primary); background: var(--c-primary-soft); padding: 11.5px 13.5px; }
.choice input { width: 20px; height: 20px; accent-color: var(--c-primary); flex-shrink: 0; margin: 0; }

/* one-time code inputs (§3.14.3 code_input) */
.field--code { gap: 10px; }
.code-input {
  font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; letter-spacing: .35em; text-align: center;
  min-height: 60px; padding-left: calc(14px + .35em); font-variant-numeric: tabular-nums; text-transform: uppercase;
}
.code-input--code8 { max-width: 19rem; letter-spacing: .22em; padding-left: calc(14px + .22em); }
/* digits6: ONE real input (paste, autofill, screen readers) laid transparently over six drawn cells (app.js mirrors
   the digits into the cells and marks the filled and the current one). */
.code-cells { position: relative; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code-cells__cell {
  height: 56px; border-radius: 12px; border: 1.5px solid var(--c-line); background: var(--c-surface); color: var(--c-ink);
  font-family: var(--font-display); font-weight: 600; font-size: 24px; display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums;
}
.code-cells__cell.is-filled { border-color: var(--c-primary); }
.code-cells:focus-within .code-cells__cell.is-current { border-color: var(--c-primary); outline: 3px solid var(--c-focus); outline-offset: 1px; }
.field.has-error .code-cells__cell { border-color: var(--c-danger); background: var(--c-danger-soft); }
.code-cells .code-input--digits6 {
  position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; border: 0; border-radius: 12px;
  background: transparent; color: transparent; caret-color: transparent; letter-spacing: 0; opacity: 0.01; font-size: 16px;
}
.code-cells .code-input--digits6:focus-visible { outline: none; box-shadow: none; }
html:not(.js) .code-cells__cell { display: none; }
html:not(.js) .code-cells .code-input--digits6 {
  position: static; grid-column: 1 / -1; min-height: 56px; opacity: 1; color: var(--c-ink); caret-color: auto;
  border: 1.5px solid var(--c-line); background: var(--c-surface); letter-spacing: .35em; font-size: 1.5rem; padding-left: calc(14px + .35em);
}

/* error summary (receives focus after a failed submit) */
.form-errors {
  border-radius: 14px; background: var(--c-danger-soft); color: var(--c-ink); padding: 12px 14px; font-size: 14.5px;
  display: flex; gap: var(--s-3); align-items: flex-start; border: 0;
}
/* focused by app.js so screen readers announce it; not a control, so no ring (the board: .errsum{outline:none}) */
.form-errors:focus, .form-errors:focus-visible { outline: none; box-shadow: none; }
.form-errors > .icon { color: var(--c-danger); margin-top: 1px; width: 22px; height: 22px; }
.form-errors__title { font-weight: 800; }
.form-errors__list { margin: var(--s-1) 0 0; padding-left: 18px; }
.form-errors__list a { font-weight: 800; }

.turnstile-slot { min-height: 65px; display: flex; flex-direction: column; gap: var(--s-2); }
.turnstile-slot .cf-turnstile { min-height: 65px; }
.turnstile-slot:not(:has(.cf-turnstile)) { min-height: 0; }
.turnstile-slot:not(:has(.cf-turnstile)):not(:has(.field__error)) { display: none; }
@media (min-width: 1024px) { .turnstile-slot { max-width: 320px; } }

/* ---------------------------------------------------------------------------------------------- alerts */
.alert {
  --alert-bg: var(--c-primary-soft); --alert-icon: var(--c-primary-deep);
  display: flex; gap: var(--s-3); align-items: flex-start; border-radius: 14px; padding: 12px 14px;
  background: var(--alert-bg); color: var(--c-ink); font-size: 14.5px;
}
.alert--success { --alert-bg: var(--c-success-soft); --alert-icon: var(--c-success); }
.alert--warning { --alert-bg: var(--c-warning-soft); --alert-icon: var(--c-warning); }
.alert--danger { --alert-bg: var(--c-danger-soft); --alert-icon: var(--c-danger); }
.alert__icon { color: var(--alert-icon); flex-shrink: 0; margin-top: 1px; width: 22px; height: 22px; }
.alert__art { flex-shrink: 0; display: flex; }
.alert__art img { display: block; }
.alert__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.alert__body > p { margin: 0; }
.alert__title { font-weight: 800; }
.alert__close { flex-shrink: 0; margin: -10px -8px -10px 0; width: 44px; height: 44px; border: 0; background: transparent; color: var(--c-ink-2); border-radius: var(--r-pill); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.alert__close:hover { color: var(--c-ink); }

/* ---------------------------------------------------------------------------------------------- cards and panels */
.card {
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--e-1);
  padding: 16px; display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; color: var(--c-ink);
}
.card--raised { box-shadow: var(--e-2); }
.card--parchment { background: var(--c-parchment); border-color: var(--c-parchment-line); box-shadow: none; }
.card--soft { background: var(--c-surface-2); border-color: transparent; box-shadow: none; }
.card--selected { border: 2px solid var(--c-primary); background: var(--c-primary-soft); }
.card--pad-lg { padding: 20px; }
a.card { text-decoration: none; transition: box-shadow var(--motion), transform var(--motion), border-color var(--motion); }
a.card:hover { box-shadow: var(--e-2); border-color: var(--c-line-strong); }
.card__head { display: flex; align-items: center; gap: var(--s-3); }
.card__titles { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.card__icon { width: 40px; height: 40px; border-radius: 12px; background: var(--c-primary-soft); color: var(--c-primary-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card__title { font-size: var(--fs-lg); }
.card__body { color: var(--c-ink); }
.card__footer { border-top: 1px solid var(--c-line); padding-top: var(--s-3); margin-top: auto; display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center; }
.card__chevron { color: var(--c-ink-2); flex-shrink: 0; }

.panel { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.panel__head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); flex-wrap: wrap; }
.panel__titles { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.panel__title { font-size: var(--fs-xl); }
.panel__desc { color: var(--c-ink-2); font-size: var(--fs-sm); }
.panel__actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.panel__body { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
/* panel variant "card": the heading inside a card (the prototype's account and staff panels) */
.panel--card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--e-1); padding: 20px; gap: 14px; color: var(--c-ink); }
.panel--round { border-radius: 20px; }
.panel--card > .panel__head { align-items: center; flex-wrap: nowrap; }
.panel--card .panel__title { font-size: 21px; }
.panel__lead { display: flex; align-items: center; gap: 12px; min-width: 0; }
.panel__icon { width: 36px; height: 36px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; background: var(--c-primary-soft); color: var(--c-primary-deep); overflow: hidden; }
.panel__icon--gold { background: var(--c-gold-soft); color: var(--c-gold-deep); }
.panel__icon--berry { background: var(--c-berry-soft); color: var(--c-berry-deep); }
.panel__icon--success { background: var(--c-success-soft); color: var(--c-success); }
.panel__icon img { display: block; max-width: 100%; height: auto; }
.panel__tag {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; letter-spacing: .4px;
  text-transform: uppercase; color: var(--c-berry-deep);
}
.panel__tag .icon { width: 14px; height: 14px; }

/* ---------------------------------------------------------------------------------------------- badges and pills */
.badge, .pill {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: .8125rem; font-weight: 800; line-height: 1.2; white-space: nowrap; vertical-align: middle;
  background: var(--c-surface-2); color: var(--c-ink-2); border: 0;
}
/* only the neutral (untoned) pill and badge have a border; toned ones have none (they would be 2 px wider) */
.pill--neutral, .badge--neutral, .pill:not([class*="pill--"]), .badge:not([class*="badge--"]) { border: 1px solid var(--c-line); }
.badge .icon, .pill .icon { width: 14px; height: 14px; }
.pill--sm, .badge--sm { min-height: 22px; font-size: 12px; padding: 0 8px; }
.badge--info, .pill--info, .pill--pending, .pill--starting { background: var(--c-primary-soft); color: var(--c-primary-deep); }
.badge--success, .pill--online, .pill--success { background: var(--c-success-soft); color: var(--c-success); }
.badge--warning, .pill--maintenance, .pill--warning { background: var(--c-warning-soft); color: var(--c-warning); }
.badge--danger, .pill--offline, .pill--danger { background: var(--c-danger-soft); color: var(--c-danger); }
.badge--gold, .pill--gold { background: var(--c-gold-soft); color: var(--c-gold-deep); }
.badge--berry, .pill--berry { background: var(--c-berry-soft); color: var(--c-berry-deep); }
.badge--solid-berry { background: var(--c-berry); color: var(--c-berry-ink); }
.badge--solid-gold { background: var(--c-gold); color: var(--c-gold-ink); }
.pill__dot { width: 8px; height: 8px; border-radius: var(--r-pill); background: currentColor; flex-shrink: 0; }
.pill--offline .pill__dot { background: transparent; box-shadow: inset 0 0 0 2px currentColor; }
.count {
  display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 22px; padding: 0 7px;
  border-radius: var(--r-pill); background: var(--c-berry); color: var(--c-berry-ink); font-size: .75rem; font-weight: 800; font-variant-numeric: tabular-nums;
}
.count--muted { background: var(--c-surface-2); color: var(--c-ink-2); border: 1px solid var(--c-line); }
.count--info { background: var(--c-primary-soft); color: var(--c-primary-deep); }
.count--danger { background: var(--c-danger); color: var(--c-danger-ink); }
.ribbon {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); height: 22px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 11.5px; font-weight: 800; background: var(--c-berry); color: var(--c-berry-ink); display: inline-flex; align-items: center; white-space: nowrap; z-index: 1;
}
.ribbon--gold { background: var(--c-gold); color: var(--c-gold-ink); }

/* ---------------------------------------------------------------------------------------------- stats and meters */
.stat { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; color: var(--c-ink); }
a.stat { text-decoration: none; }
a.stat:hover { border-color: var(--c-primary); }
.stat__label { font-size: 13px; color: var(--c-ink-2); font-weight: 700; }
.stat__value { font-family: var(--font-display); font-weight: 600; font-size: 1.75rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat__hint { font-size: var(--fs-xs); color: var(--c-ink-2); }
.stat--success .stat__value { color: var(--c-success); }
.stat--warning { background: var(--c-warning-soft); border-color: transparent; }
.stat--danger { background: var(--c-danger-soft); border-color: transparent; }
.stat--danger .stat__value { color: var(--c-danger); }
.stat--soft { background: var(--c-surface-2); border-color: transparent; }
.stat--soft .stat__label { font-size: 12.5px; }
.stat-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(min(160px, 100%), 1fr)); }
.meter { display: flex; flex-direction: column; gap: 6px; }
.meter__progress {
  -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 10px; border: 1px solid var(--c-line);
  border-radius: var(--r-pill); background: var(--c-surface-2); overflow: hidden; color: #F2B233;
}
.meter--lg .meter__progress { height: 12px; }
.meter__progress::-webkit-progress-bar { background: var(--c-surface-2); border-radius: var(--r-pill); }
.meter__progress::-webkit-progress-value { background: linear-gradient(90deg, #F2B233, #C98A12); border-radius: var(--r-pill); }
.meter__progress::-moz-progress-bar { background: linear-gradient(90deg, #F2B233, #C98A12); border-radius: var(--r-pill); }
.meter__head { display: flex; justify-content: space-between; gap: var(--s-3); font-size: var(--fs-sm); }
.meter__label { font-weight: 700; }
.meter__scale { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 700; color: var(--c-ink-2); }

/* ---------------------------------------------------------------------------------------------- tables (stack below 640 px) */
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--c-line); border-radius: 12px; background: var(--c-surface); }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9375rem; }
.table caption { text-align: left; padding: var(--s-3) var(--s-3) 0; font-weight: 800; }
.table th {
  text-align: left; font-size: .75rem; letter-spacing: .8px; text-transform: uppercase; color: var(--c-ink-2); font-weight: 800;
  padding: 10px 12px; background: var(--c-surface-2); border-bottom: 1px solid var(--c-line); white-space: nowrap;
}
.table td { padding: 11px 12px; border-bottom: 1px solid var(--c-line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table .is-end { text-align: right; }
.table .is-center { text-align: center; }
.table .is-num { text-align: right; font-variant-numeric: tabular-nums; }
.table__empty { padding: var(--s-5) var(--s-4); text-align: center; color: var(--c-ink-2); }
.table tr[data-href] { cursor: pointer; }
.table tr[data-href]:hover td { background: var(--c-surface-2); }
@media (max-width: 639.98px) {
  .table-wrap--stack { border: 0; background: transparent; overflow: visible; }
  .table--stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); }
  .table--stack, .table--stack tbody, .table--stack tr, .table--stack td { display: block; width: 100%; }
  .table--stack tr { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-md); box-shadow: var(--e-1); padding: 6px 14px; margin-bottom: var(--s-3); }
  .table--stack td { border-bottom: 1px solid var(--c-line); padding: 8px 0; display: flex; gap: var(--s-3); justify-content: space-between; align-items: baseline; text-align: right; }
  .table--stack td:last-child { border-bottom: 0; }
  .table--stack td::before { content: attr(data-label); flex-shrink: 0; text-align: left; font-size: .75rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--c-ink-2); }
  .table--stack td.is-primary { font-weight: 800; font-size: 1rem; }
  .table--stack td.table__empty { justify-content: center; text-align: center; }
  .table--stack td.table__empty::before { content: none; }
}

/* ---------------------------------------------------------------------------------------------- tabs, chips, pager, breadcrumbs */
/* D12: the tab strip never hides tabs off-screen; the tabs wrap onto a second row when they do not fit. */
.tabs { display: flex; flex-wrap: wrap; gap: 0 var(--s-1); border-bottom: 1px solid var(--c-line); }
.tabs__link {
  display: inline-flex; align-items: center; gap: var(--s-2); min-height: 44px; padding: 0 14px; white-space: nowrap;
  color: var(--c-ink-2); text-decoration: none; font-weight: 800; border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.tabs__link:hover { color: var(--c-ink); }
.tabs__link[aria-current="page"] { color: var(--c-primary-deep); border-bottom-color: var(--c-primary); }
@media (max-width: 767.98px) { .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; } }
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.chip {
  position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill);
  border: 1.5px solid var(--c-line); background: var(--c-surface); color: var(--c-ink); font-weight: 700; font-size: .9375rem; text-decoration: none;
}
.chip::before {
  content: ""; position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; min-width: 44px; min-height: 44px;
  transform: translate(-50%, -50%);
}
.chip:hover { background: var(--c-surface-2); }
.chip[aria-current="true"], .chip[aria-current="page"] { border-color: var(--c-primary); background: var(--c-primary-soft); color: var(--c-primary-deep); }
.chip .icon--bold { stroke-width: 2.4; }
.pager { display: flex; gap: var(--s-1); flex-wrap: wrap; align-items: center; justify-content: center; list-style: none; padding: 0; margin: 0; }
.pager__link, .pager__gap {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-width: 44px; min-height: 44px; padding: 0 12px;
  border-radius: var(--r-pill); font-weight: 800; text-decoration: none; color: var(--c-ink);
}
.pager__link { border: 1.5px solid var(--c-line); background: var(--c-surface); }
.pager__link:hover { background: var(--c-surface-2); }
.pager__link[aria-current="page"] { background: var(--c-primary); color: var(--c-primary-ink); border-color: var(--c-primary); }
.pager__link[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.pager__gap { color: var(--c-ink-2); min-width: 24px; padding: 0; }
@media (max-width: 479.98px) { .pager__num { display: none; } .pager__num[aria-current="page"] { display: inline-flex; } }
.pager-nav--prevnext { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.pager-nav--prevnext .btn { padding: 0 18px; }
.pager__of { font-size: var(--fs-sm); color: var(--c-ink-2); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; list-style: none; padding: 0; margin: 0; font-size: var(--fs-sm); font-weight: 700; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; color: var(--c-ink-2); }
.breadcrumbs__sep { width: 16px; height: 16px; color: var(--c-line); }
.breadcrumbs a { color: var(--c-ink-2); font-weight: 700; text-decoration: none; }
.breadcrumbs a:hover { color: var(--c-primary-deep); text-decoration: underline; }
.breadcrumbs [aria-current="page"] { color: var(--c-ink); font-weight: 700; }

/* ---------------------------------------------------------------------------------------------- stepper and timeline */
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; list-style: none; padding: 0; margin: 0; }
.stepper--first-wide { grid-auto-flow: row; grid-template-columns: 1.3fr 1fr 1fr 1fr; }
.stepper__step { display: flex; flex-direction: column; gap: 6px; font-size: .75rem; font-weight: 800; color: var(--c-ink-2); min-width: 0; }
.stepper__bar { height: 6px; border-radius: var(--r-pill); background: var(--c-line); }
.stepper__label { display: flex; align-items: center; gap: 4px; line-height: 1.25; overflow-wrap: anywhere; }
.stepper__label .icon { width: 13px; height: 13px; stroke-width: 3; }
.stepper__step.is-done { color: var(--c-success); }
.stepper__step.is-done .stepper__bar { background: var(--c-success); }
.stepper__step.is-current { color: var(--c-primary-deep); }
.stepper__step.is-current .stepper__bar { background: var(--c-primary); }
.stepper__step.is-error { color: var(--c-danger); }
.stepper__step.is-error .stepper__bar { background: var(--c-danger); }
.timeline { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.timeline__event { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; padding-bottom: 18px; position: relative; }
.timeline__event:last-child { padding-bottom: 0; }
.timeline__event:not(:last-child)::before { content: ""; position: absolute; left: 10px; top: 27px; bottom: 3px; width: 2px; border-radius: 2px; background: var(--c-line); }
.timeline__event.is-done:not(:last-child)::before { background: var(--c-success); }
.timeline__mark { width: 22px; height: 22px; margin-top: 1px; border-radius: var(--r-pill); border: 2px solid var(--c-line); background: var(--c-surface); display: flex; align-items: center; justify-content: center; color: var(--c-success-ink); }
.timeline__mark .icon { width: 13px; height: 13px; stroke-width: 3; }
.timeline__event.is-done .timeline__mark { border-color: var(--c-success); background: var(--c-success); }
.timeline__event.is-current .timeline__mark { border-color: var(--c-primary); background: var(--c-primary-soft); }
.timeline__event.is-current .timeline__mark::after { content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--c-primary); }
.timeline__event.is-error .timeline__mark { border-color: var(--c-danger); background: var(--c-danger); color: var(--c-danger-ink); }
.timeline__event p { margin: 0; }
.timeline__label { font-weight: 800; font-size: 15px; line-height: 1.35; }
.timeline__event.is-todo .timeline__label { color: var(--c-ink-2); font-weight: 800; }
.timeline__meta { font-size: 13px; color: var(--c-ink-2); }
.timeline__detail { font-size: 13px; color: var(--c-ink-2); }

/* ---------------------------------------------------------------------------------------------- empty states */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-2); padding: var(--s-6) var(--s-4); }
.empty__art { width: 160px; height: auto; margin-bottom: var(--s-2); }
.empty__art--game { width: auto; max-width: 112px; }
.empty__icon { width: 56px; height: 56px; border-radius: var(--r-pill); background: var(--c-primary-soft); color: var(--c-primary-deep); display: flex; align-items: center; justify-content: center; margin-bottom: var(--s-2); }
.empty__icon .icon { width: 28px; height: 28px; }
.empty > p { margin: 0; }
.empty__title { font-size: var(--fs-lg); }
.empty__body { color: var(--c-ink-2); max-width: 44ch; }
.empty__action { margin-top: var(--s-3); }

/* ---------------------------------------------------------------------------------------------- copy and qr */
.copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.copy__label { font-size: var(--fs-sm); color: var(--c-ink-2); font-weight: 700; }
.copy__row { display: flex; align-items: center; gap: var(--s-2); min-height: 48px; padding: 4px 4px 4px 14px; border-radius: 12px; background: var(--c-surface-2); border: 1px solid var(--c-line); }
.copy__value { flex: 1 1 auto; min-width: 0; font-weight: 800; font-size: 1.0625rem; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.copy__value--mono { font-family: var(--font-mono); letter-spacing: .04em; }
.copy__value--display { font-family: var(--font-display); font-weight: 700; font-size: 28px; letter-spacing: 3px; line-height: 1.15; }
.copy__btn { flex-shrink: 0; }
/* copy variant "row": key above the value, 1 px rules, a ghost copy pill on the right */
.copy--row { flex-direction: row; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--c-line); }
.copy--row + .copy--row:last-of-type, .copy--row:last-child { border-bottom: 1px solid var(--c-line); }
.copy--row .copy__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.copy--row .copy__label { font-size: 13px; font-weight: 800; }
.copy--row .copy__value { font-size: 15px; font-weight: 800; line-height: 1.35; }
.copy__pill {
  flex-shrink: 0; min-width: 92px; min-height: 44px; padding: 0 14px; border-radius: var(--r-pill); border: 1.5px solid var(--c-line);
  background: var(--c-surface); color: var(--c-primary-deep); font-size: 14.5px; font-weight: 800; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.copy__pill .icon { width: 16px; height: 16px; }
.copy__pill:hover { background: var(--c-surface-2); }
.qr { display: inline-flex; flex-direction: column; align-items: center; gap: var(--s-2); max-width: 100%; margin: 0; }
.qr__tile { background: #FFFFFF; border-radius: 18px; padding: 14px 14px 12px; border: 1px solid var(--c-line); box-shadow: var(--e-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.qr__img { display: block; width: 220px; height: 220px; max-width: 100%; image-rendering: pixelated; }
.qr--sm .qr__img { width: 160px; height: 160px; }
.qr__label { display: flex; align-items: center; gap: 6px; font-family: var(--font-display); font-weight: 600; font-size: 15px; color: var(--c-art-ink); }
.qr__label::before { content: ""; width: 8px; height: 8px; border-radius: var(--r-pill); background: var(--c-art-dot); }
.qr__caption { font-size: var(--fs-sm); color: var(--c-ink-2); text-align: center; max-width: 30ch; }

/* ---------------------------------------------------------------------------------------------- tier cards */
.tier {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; min-width: 0;
  background: var(--c-surface); border: 1.5px solid var(--c-line); border-radius: 18px; padding: 16px 10px 10px; box-shadow: var(--e-1);
  transition: border-color var(--motion), box-shadow var(--motion);
}
.tier:hover { border-color: var(--c-line-strong); box-shadow: var(--e-2); }
.tier.is-selected, .tier:has(.tier__pick:checked) { border: 2px solid var(--c-primary); background: var(--c-primary-soft); box-shadow: var(--e-2); padding: 15.5px 9.5px 9.5px; }
.tier.is-disabled { background: var(--c-surface-2); box-shadow: none; }
.tier.is-disabled .tier__amount, .tier.is-disabled .tier__price { color: var(--c-ink-2); }
.tier > p { margin: 0; }
.tier__pick { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; z-index: 0; }
.tier__pay .btn { position: relative; z-index: 1; }
.tier:has(.tier__pick:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.tier__badges { min-height: 24px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; align-items: center; }
.tier__badges .badge { min-height: 22px; padding: 0 8px; font-size: 11.5px; border: 0; }
.tier__amount { font-family: var(--font-display); font-weight: 700; font-size: 26px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-variant-numeric: tabular-nums; }
.tier__amount .gem__img, .tier__gem { width: 29px; height: auto; flex-shrink: 0; }
.tier__now { font-family: var(--font-body); font-size: 14px; font-weight: 800; color: var(--c-ink-2); align-self: flex-end; margin-bottom: 2px; }
.tier__crest { display: block; width: 62px; height: auto; margin: -2px auto 0; }
.tier__title { font-family: var(--font-display); font-weight: 600; font-size: 17px; line-height: 1.2; }
.tier__unit { font-size: 13px; color: var(--c-ink-2); font-weight: 800; margin-top: -2px; }
.tier__lines { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
.tier__bonus { font-size: 13px; font-weight: 800; line-height: 1.3; color: var(--c-success); }
.tier__note { font-size: 13px; color: var(--c-ink-2); }
.tier__renew { font-size: 12.5px; font-weight: 800; color: var(--c-ink-2); }
.tier__days { margin-top: 4px; font-size: 12.5px; font-weight: 800; line-height: 1.35; border-radius: 10px; padding: 4px 8px; color: var(--c-ink-2); background: var(--c-surface-2); }
.tier__days.is-live { color: var(--c-gold-text); background: var(--c-gold-soft); }
.tier__body { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.tier__pay { margin-top: auto; width: 100%; display: flex; flex-direction: column; align-items: center; padding-top: 10px; border-top: 1.5px dashed var(--c-line); }
.tier.is-selected .tier__pay, .tier:has(.tier__pick:checked) .tier__pay { border-top-color: color-mix(in srgb, var(--c-primary) 40%, transparent); }
.tier__price { font-family: var(--font-display); font-weight: 600; font-size: 22px; line-height: 1.2; }
.tier__usd { font-size: 12.5px; font-weight: 700; color: var(--c-ink-2); }
.tier__reason { font-size: .8125rem; font-weight: 800; color: var(--c-danger); display: inline-flex; align-items: center; gap: 4px; }
.tier__cta { width: 100%; margin-top: 10px; min-height: 44px; padding: 0 8px; font-size: 14px; line-height: 1.2; white-space: normal; border-radius: var(--r-pill); }
.tier__cta.btn--sm { min-height: 44px; font-size: 14px; }
.tier__tick { display: none; }
.tier--card .tier__days { max-width: 100%; }
@media (min-width: 1024px) {
  .tier { padding: 20px 6px 12px; gap: 3px; }
  .tier.is-selected, .tier:has(.tier__pick:checked) { padding: 19.5px 5.5px 11.5px; }
  .tier__body { margin: auto 0; gap: 3px; padding-bottom: 10px; }
  .tier__amount .gem__img, .tier__gem { width: 30px; }
  .tier__unit { font-size: 12.5px; font-weight: 700; margin-top: 0; }
  .tier__pay { margin-top: 0; padding-top: 8px; border-top: 1px dashed var(--c-line); }
  .tier.is-selected .tier__pay, .tier:has(.tier__pick:checked) .tier__pay { border-top-color: var(--c-primary); }
  .tier__price { font-size: 18px; }
  .tier__crest { width: 54px; margin-bottom: 2px; }
  .tier__tick {
    position: absolute; top: -10px; right: -10px; width: 26px; height: 26px; border-radius: var(--r-pill); border: 3px solid var(--c-surface);
    background: var(--c-primary); color: var(--c-primary-ink); box-shadow: 0 2px 6px var(--c-shadow); align-items: center; justify-content: center;
  }
  .tier.is-selected .tier__tick, .tier:has(.tier__pick:checked) .tier__tick { display: flex; }
  .tier__tick .icon { width: 14px; height: 14px; stroke-width: 3; }
  /* a tile with a pick radio buys through the page's summary button: its own button stays for no-JS use only */
  .js .tier:has(.tier__pick) .tier__cta { display: none; }
}

/* ---------------------------------------------------------------------------------------------- character cards */
.char {
  display: flex; flex-wrap: wrap; row-gap: 10px; column-gap: var(--s-3); align-items: center; min-width: 0; min-height: 76px; position: relative;
  background: var(--c-surface); border: 1.5px solid var(--c-line); border-radius: var(--r-md); padding: 10px 12px; color: var(--c-ink);
}
label.char { cursor: pointer; }
label.char:hover { border-color: var(--c-line-strong); }
.char:has(.char__radio:checked), .char.is-selected { border: 2px solid var(--c-primary); background: var(--c-primary-soft); padding: 9.5px 11.5px; }
.char:has(.char__radio:focus-visible) { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.char.is-disabled { background: var(--c-surface-2); cursor: not-allowed; }
.char__radio { position: absolute; opacity: 0; width: 1px; height: 1px; }
.char > .avatar { width: 52px; height: 52px; border-radius: 14px; }
.char > .avatar--art { background: var(--c-parchment); border: 1px solid var(--c-line); }
.char__body { display: flex; flex-direction: column; min-width: 0; flex: 1 1 0; gap: 1px; }
.char__name { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1.25; overflow-wrap: anywhere; }
.char__meta { font-size: var(--fs-sm); color: var(--c-ink-2); font-weight: 700; }
.char__notes { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 2px; font-size: .8125rem; }
.char__note { color: var(--c-ink-2); }
.char__note--gold { color: var(--c-gold-deep); font-weight: 800; }
.char__note--danger { color: var(--c-danger); font-weight: 800; }
.char__check { width: 26px; height: 26px; border-radius: var(--r-pill); border: 2px solid var(--c-line); background: var(--c-surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: transparent; }
.char:has(.char__radio:checked) .char__check, .char.is-selected .char__check { border-color: var(--c-primary); background: var(--c-primary); color: var(--c-primary-ink); }
.char__check .icon { width: 15px; height: 15px; stroke-width: 3; }
/* level box (Account) and level pill (Play) */
.char__lvbox {
  width: 52px; height: 52px; border-radius: 14px; background: var(--c-surface-2); border: 1px solid var(--c-line); flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.char__lvbox small { font-size: 11px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; color: var(--c-ink-2); }
.char__lvbox b { font-family: var(--font-display); font-weight: 600; font-size: 21px; margin-top: 3px; }
.char__lvpill {
  flex-shrink: 0; display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--c-surface-2); border: 1px solid var(--c-line); font-family: var(--font-display); font-weight: 600; font-size: 15px;
}
/* Monthly Card strip under the row */
.char__strip {
  flex-basis: 100%; display: flex; align-items: center; gap: 8px; min-height: 34px; padding: 4px 10px 4px 6px; border-radius: 10px;
  background: var(--c-gold-soft); color: var(--c-gold-text); font-size: 13px; font-weight: 800; line-height: 1.35;
}
.char__strip img { width: 28px; height: auto; flex-shrink: 0; display: block; }
/* variant "tile" (TopUpDesktop): column, the tick only when checked */
.char--tile { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; min-height: 44px; }
.char--tile:has(.char__radio:checked), .char--tile.is-selected { padding: 11.5px; }
.char--tile .char__top { display: flex; align-items: center; gap: 12px; min-width: 0; padding-right: 22px; }
.char--tile .avatar { width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(160deg, var(--c-primary-soft), var(--c-surface-2)); border: 1px solid var(--c-line); }
.char--tile .char__meta { font-size: 13.5px; font-weight: 400; }
.char--tile .char__strip { gap: 6px; align-items: flex-start; min-height: 0; padding: 6px 8px; font-size: 12.5px; font-weight: 400; color: var(--c-ink); }
.char--tile .char__strip img { width: 22px; }
.char--tile .char__check { position: absolute; top: 10px; right: 10px; width: 24px; height: 24px; border: 0; background: var(--c-primary); color: var(--c-primary-ink); display: none; }
.char--tile:has(.char__radio:checked) .char__check, .char--tile.is-selected .char__check { display: flex; }
.char--tile .char__check .icon { width: 14px; height: 14px; }

/* avatars: a monogram tile, or class art (art prop) */
.avatar {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  font-family: var(--font-display); font-weight: 600; font-size: 1.25rem; line-height: 1; text-transform: uppercase;
  background: var(--c-primary-soft); color: var(--c-primary-deep); border: 1px solid var(--c-line);
}
.avatar--round { border-radius: var(--r-pill); }
.avatar--sm { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
.avatar--sm.avatar--round { border-radius: var(--r-pill); }
.avatar--lg { width: 64px; height: 64px; font-size: 1.625rem; border-radius: 18px; }
.avatar--s24 { width: 24px; height: 24px; font-size: .75rem; border-radius: 8px; }
.avatar--s30 { width: 30px; height: 30px; font-size: .875rem; border-radius: 9px; }
.avatar--s34 { width: 34px; height: 34px; font-size: 1rem; border-radius: 10px; }
.avatar--s36 { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; }
.avatar--s40 { width: 40px; height: 40px; font-size: 1.0625rem; border-radius: 12px; }
.avatar--s52 { width: 52px; height: 52px; font-size: 1.375rem; border-radius: 14px; }
.avatar--s56 { width: 56px; height: 56px; font-size: 1.5rem; border-radius: 14px; }
.avatar--s80 { width: 80px; height: 80px; font-size: 2rem; border-radius: 20px; }
.avatar--round[class*="avatar--s"] { border-radius: var(--r-pill); }
.avatar--art { background: var(--c-parchment); }
.avatar__img { display: block; width: 100%; height: 100%; object-fit: cover; max-width: none; }
picture.avatar__pic { display: contents; }
.avatar--t1 { background: var(--c-primary-soft); color: var(--c-primary-deep); }
.avatar--t2 { background: var(--c-berry-soft); color: var(--c-berry-deep); }
.avatar--t3 { background: var(--c-success-soft); color: var(--c-success); }
.avatar--t4 { background: var(--c-gold-soft); color: var(--c-gold-deep); }
.avatar--t5 { background: var(--c-warning-soft); color: var(--c-warning); }
.avatar--t6 { background: var(--c-surface-2); color: var(--c-ink); }

/* ---------------------------------------------------------------------------------------------- steps ("Start in 3 steps") */
.steps { position: relative; }
.steps__perch { position: absolute; top: -40px; right: 16px; width: 62px; height: auto; }
.steps__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.steps__item { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: 14px; position: relative; }
.steps__item:not(:last-child)::before { content: ""; position: absolute; left: 18px; top: 42px; bottom: -16px; border-left: 2px dashed var(--c-line); }
.steps__num {
  width: 38px; height: 38px; border-radius: var(--r-pill); background: var(--c-primary-soft); color: var(--c-primary-deep);
  display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-weight: 600; font-size: 18px;
}
.steps__item:last-child .steps__num { background: var(--c-primary); color: var(--c-primary-ink); }
.steps__title { font-size: 17px; margin: 6px 0 2px; }
.steps__body { font-size: var(--fs-sm); color: var(--c-ink-2); }

/* ---------------------------------------------------------------------------------------------- bare layout (errors, confirmations) */
.layout-bare {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: var(--s-6) var(--gutter) var(--s-5);
}
.bare-brand { position: relative; z-index: 1; display: inline-flex; margin-bottom: var(--s-5); border-radius: var(--r-sm); }
.bare-brand .brand__img { height: 56px; }
.bare-notice { width: 100%; max-width: 36rem; border-radius: var(--r-md); border: 1px solid var(--c-line); margin-bottom: var(--s-4); }
.bare-card {
  position: relative; z-index: 1; width: 100%; max-width: 30rem; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--r-lg);
  box-shadow: var(--e-2); padding: var(--s-6) var(--s-5); display: flex; flex-direction: column; gap: var(--s-4);
}
@media (min-width: 480px) { .bare-card { padding: var(--s-6); } }
.bare-footer { position: relative; z-index: 1; margin-top: var(--s-6); max-width: 36rem; text-align: center; color: var(--c-ink-2); font-size: 12.5px; line-height: 1.5; display: flex; flex-direction: column; gap: var(--s-2); }
.error-page { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s-3); }
.error-page__art { width: 180px; height: auto; }
.error-page__code { font-family: var(--font-display); font-weight: 600; color: var(--c-ink-2); font-size: var(--fs-sm); letter-spacing: .12em; }
.error-page__ref { font-size: var(--fs-sm); color: var(--c-ink-2); }
.error-page__ref code { color: var(--c-ink); font-weight: 700; }

/* NotFound (bodyClass "is-error"): no card; the 404 digits with the crying Drops, the home button and the notice at the bottom */
.layout-bare.is-error { padding: 0; min-height: 100vh; min-height: 100dvh; align-items: stretch; }
.is-error .sky-cloud--1 { width: 150px; height: 40px; top: 112px; right: -44px; }
.is-error .sky-cloud--2 { width: 96px; height: 28px; top: 176px; left: -30px; opacity: calc(var(--cloud-opacity) * .8333); }
.is-error .sky-cloud--3 { width: 70px; height: 22px; top: 92px; left: 70px; opacity: calc(var(--cloud-opacity) * .6667); }
.bare-top { position: relative; z-index: 2; height: 76px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.bare-top .bare-brand { margin: 0; min-height: 44px; align-items: center; }
.bare-top .brand__img { height: 50px; }
.error-nf {
  position: relative; z-index: 2; flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 0 28px 12px;
}
.error-nf h1 { font-size: 30px; }
.error-nf__msg { max-width: 300px; font-size: 16.5px; color: var(--c-ink-2); }
.error-digits { display: flex; align-items: center; justify-content: center; gap: 6px; margin-bottom: 22px; }
.error-digits__d { font-family: var(--font-display); font-weight: 700; font-size: 128px; line-height: 1; color: var(--c-primary); text-shadow: 0 6px 0 var(--c-primary-soft); }
.error-digits__zero {
  position: relative; width: 148px; height: 148px; border-radius: var(--r-pill); background: var(--c-surface); border: 1px solid var(--c-line);
  box-shadow: 0 12px 26px var(--c-shadow), inset 0 -6px 0 var(--c-primary-soft); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.error-digits__zero img { display: block; width: 112px; height: auto; margin-top: 6px; }
.error-digits__spark { position: absolute; width: 18px; height: 18px; color: var(--c-gold); stroke-width: 0; }
.error-digits__spark--1 { top: -6px; right: 6px; color: var(--c-berry); }
.error-digits__spark--2 { bottom: 10px; left: -4px; width: 14px; height: 14px; }
.error-main { position: relative; z-index: 2; flex: 1 1 auto; display: flex; flex-direction: column; }
.error-main > .flash-region { padding: 0 16px; }
.error-bottom { flex-shrink: 0; padding: 0 16px; }
.error-legal { position: relative; z-index: 2; flex-shrink: 0; padding: 18px 16px 24px; }
.error-legal .bare-footer { margin: 0; max-width: none; width: 100%; border-top: 1px solid var(--c-line); padding-top: 16px; gap: 6px; font-size: 12.5px; line-height: 1.5; }
@media (min-width: 768px) {
  .error-bottom, .error-legal { width: 100%; max-width: 36rem; margin-inline: auto; }
}

/* ---------------------------------------------------------------------------------------------- hero helpers (home, WP6) */
.hero { position: relative; padding: var(--s-6) 0 var(--s-7); text-align: center; }
.hero__logo { display: block; width: 270px; max-width: 80vw; margin: 0 auto; filter: var(--logo-shadow); }
@media (min-width: 768px) { .hero__logo { width: 540px; filter: var(--logo-shadow-lg); } }
.hero__tagline { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-xl); margin-top: var(--s-3); }
.hero__actions { display: flex; flex-direction: column; gap: var(--s-3); margin: var(--s-5) auto 0; max-width: 22rem; }
@media (min-width: 768px) { .hero__actions { flex-direction: row; justify-content: center; max-width: none; } }
