/* Clean Slate treatment (design-core.subako.studio), resynced 2026-09
   directly against the design-core source (subako-design-core repo), not
   just the hosted docs site. Corrected from an earlier pass that had
   rebuilt "Pixel Drift" — the notched, hard-offset, brand-tinted-shadow
   treatment — which src/config/design-modes.ts explicitly says was
   RETIRED: "Clean Slate is currently the only registered mode." Its
   actual rules:
     - No notch anywhere. --mode-notch is 0 in the only registered mode,
       so no component ever shows a cut corner.
     - Elevation is a soft neutral blur, never brand-tinted. The mode sets
       --mode-shadow-color explicitly, which overrides the pink/gold/teal
       "surface tone" a toned panel would otherwise fall back to — so even
       a panel that requests a colored shadow renders a neutral one. Dark
       ground reads elevation through a 1px inset rim light instead (a
       blurred shadow is invisible on near-black), light ground through
       the shadow itself.
     - No grid texture. --mode-grid-opacity is 0%.
     - Buttons carry no shadow at all, in any state — that's a Surface
       thing, not a Button thing, and Button never opts in.
     - Any element carrying the brand mark (the top nav) stays pinned to
       dark tokens regardless of the active theme via .brand-chrome,
       because there is no light-safe logo treatment.
   - data-pixel-theme: light/dark, resolved from system by shared/theme.ts
     and set on <html>.
   - data-shadow-style="hard" (static, set in every page's <html> tag):
     "hard" means "show this mode's elevation" as opposed to "flat",
     which zeroes it to a plain bordered panel. It is not a description
     of the shadow's edge — Clean Slate's own elevation is a soft blur.
   Inter for UI text (normal case — buttons/nav/tabs/badges are NOT
   uppercase), Georgia only for display headings, JetBrains Mono only for
   literal code/terminal content. Uppercase+tracked is reserved for
   eyebrow/label text specifically, still in Inter, weight capped at 600
   (semibold) — the system defines no bold/700 UI weight. Pink is the only
   default interactive accent; gold is this product's assigned per-tool
   accent; teal is unused. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap");

:root {
  --ink: #09090b;
  --panel: #111114;
  --panel-soft: #18181b;
  --line: #29292e;
  --muted: #a1a1aa;
  --fg: #f4f4f5;
  --white: #fff;

  --pink: #f472b6;
  --pink-bright: #f9a8d4;
  --gold: #c8c86e;
  --teal: #86c5d3;
  --success: #4ade80;
  --success-soft: #6ee7b7;
  --success-strong: #052e16;
  --warning: #fde68a;
  --warning-strong: #713f12;
  --danger: #fca5a5;
  --danger-strong: #7f1d1d;
  --info: #93c5fd;
  --info-strong: #1e3a8a;

  /* Corners belong to the design mode, not to any component. */
  --radius-xs: 0.2rem;
  --radius-sm: 0.35rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.65rem;
  --radius-xl: 0.8rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.25rem;
  --radius-pill: 10rem;
  --radius-full: 9999px;

  --shadow-panel: 0 18px 40px rgba(0, 0, 0, 0.35);
  --shadow-panel-lg: 0 24px 70px rgba(0, 0, 0, 0.3);
  --shadow-glow-pink: inset 0 0 60px rgba(244, 114, 182, 0.06);

  /* Neutral chrome shadow — dropdowns/menus/toasts. Never brand-tinted. */
  --mode-chrome-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
  --mode-chrome-shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.35);

  /* Soft, neutral surface elevation (geometry only — color composed at
     the point of use, see .pixel-shadow below). --mode-shadow-color is
     set, which overrides a toned panel's brand-color fallback, so every
     panel casts the same neutral shadow regardless of tone. */
  --mode-shadow: 0 6px 20px 0;
  --mode-shadow-hover: 0 14px 32px 0;
  --mode-shadow-press: 0 3px 10px 0;
  --mode-shadow-color: rgba(0, 0, 0, 0.44);
  --mode-lift: 2px;
  --mode-shadow-rim: inset 0 1px 0 0 rgba(255, 255, 255, 0.078);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --font-display: Georgia, "Times New Roman", serif;

  --tracking-tight: -0.025em;
  --tracking-wide: 0.025em;
  --leading-snug: 1.375;
  --leading-relaxed: 1.625;
}

/* data-shadow-style="hard" is set as a static attribute in every page's
   <html> tag (this product doesn't expose a flat/hard toggle) — this
   block is the alias indirection the guide's mechanism expects, so a
   future flat mode could zero these out the same way it does upstream. */
[data-shadow-style="hard"] {
  --surface-shadow: var(--mode-shadow);
  --surface-shadow-hover: var(--mode-shadow-hover);
  --surface-shadow-press: var(--mode-shadow-press);
  --surface-lift: var(--mode-lift);
}

[data-pixel-theme="light"] {
  --ink: #efeff1;
  --panel: #ffffff;
  --panel-soft: #e6e7ea;
  --line: #c7c9ce;
  --muted: #54565c;
  --fg: #17171a;

  --pink: #a91d59;
  --pink-bright: #7a1440;
  --gold: #715b0c;
  --teal: #0b6575;
  --success: #166534;
  --success-soft: #16a34a;
  --success-strong: #dcfce7;
  --warning: #8a5a09;
  --warning-strong: #fef3c7;
  --danger: #b91c1c;
  --danger-strong: #fee2e2;
  --info: #1d4ed8;
  --info-strong: #dbeafe;

  --shadow-panel: 0 18px 40px rgba(0, 0, 0, 0.12);
  --shadow-panel-lg: 0 24px 60px rgba(0, 0, 0, 0.14);
  --shadow-glow-pink: inset 0 0 60px rgba(169, 29, 89, 0.06);

  --mode-chrome-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
  --mode-chrome-shadow-lg: 0 20px 56px rgba(0, 0, 0, 0.12);

  /* Light ground: the drop shadow itself does the work, so the dark-mode
     rim light (invisible on light ground anyway) is switched off. */
  --mode-shadow-rim: 0 0 0 0 transparent;
  --mode-shadow-color: rgba(0, 0, 0, 0.12);
}

/* Soft elevation, composed at the point of use (not baked into a single
   :root shadow) — a custom property's var() references resolve against
   the element they're declared on, so folding a toned fallback into a
   :root-level shadow would resolve the tone against :root, where none is
   set, and every toned panel would silently render the pink fallback.
   The rim is a hairline inset highlight for dark ground, where a blurred
   shadow disappears against near-black; it defaults to transparent so a
   theme that doesn't need it (light) pays nothing extra. */
.pixel-shadow {
  box-shadow: var(--mode-shadow-rim, 0 0 0 0 transparent),
    var(--surface-shadow) var(--mode-shadow-color, var(--surface-tone, var(--pink)));
  transition: transform 150ms ease, box-shadow 150ms ease;
}

.pixel-shadow-hover:hover {
  transform: translate(calc(var(--surface-lift, 0px) * -1), calc(var(--surface-lift, 0px) * -1));
  box-shadow: var(--mode-shadow-rim, 0 0 0 0 transparent),
    var(--surface-shadow-hover) var(--mode-shadow-color, var(--surface-tone, var(--pink)));
}

.pixel-shadow-press:active {
  transform: translate(0, 0);
  box-shadow: var(--mode-shadow-rim, 0 0 0 0 transparent),
    var(--surface-shadow-press) var(--mode-shadow-color, var(--surface-tone, var(--pink)));
}

/* Any element carrying the brand mark (the top nav) stays pinned to dark
   tokens regardless of the active theme — there is no light-safe logo
   treatment yet. Matches design-core's .brand-chrome exactly. */
.brand-chrome {
  --ink: #09090b;
  --panel: #111114;
  --panel-soft: #18181b;
  --line: #29292e;
  --muted: #a1a1aa;
  --fg: #f4f4f5;
  --pink: #f472b6;
  --pink-bright: #f9a8d4;
  --gold: #c8c86e;
  --teal: #86c5d3;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--ink);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  transition: background-color 0.2s, color 0.2s;
}

a {
  color: var(--pink);
}

a:hover {
  color: var(--pink-bright);
}

button,
.btn {
  background: var(--panel-soft);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s, background-color 0.1s;
}

/* No shadow on hover/press, ever — that's a Surface thing (see
   .pixel-shadow above), and Button never opts in. */
button:hover,
.btn:hover {
  border-color: var(--pink);
  color: var(--pink);
}

button:active,
.btn:active {
  border-color: var(--pink);
  color: var(--pink);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:focus-visible,
.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px color-mix(in srgb, var(--pink) 70%, transparent);
}

.btn-primary {
  background: var(--pink);
  border-color: var(--pink);
  color: var(--ink);
}

.btn-primary:hover {
  background: var(--pink-bright);
  border-color: var(--pink-bright);
  color: var(--ink);
}

input,
select,
textarea {
  background: var(--panel-soft);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 15px;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--pink);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--pink) 70%, transparent);
}

.input-error {
  border-color: var(--danger) !important;
}

.input-error:focus {
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 30%, transparent);
}

/* Full-bleed outer wrapper — chrome (header, sidebar, footer) spans the
   viewport edge to edge; only page CONTENT is capped, via .page-width
   below, matching the real system (TopNav/AppShell have no max-width,
   only the div inside <main> does). */
.container {
  padding: 24px 16px;
}

@media (min-width: 640px) {
  .container {
    padding: 24px;
  }
}

.page-width {
  max-width: 1152px;
  margin: 0 auto;
  width: 100%;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--mode-chrome-shadow);
  padding: 16px;
}

.card-danger {
  background: var(--panel);
  border: 1px solid var(--danger);
  border-radius: var(--radius-2xl);
  box-shadow: var(--mode-chrome-shadow);
  padding: 16px;
}

.hud {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
}

.pill {
  display: inline-block;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  font-size: 13px;
}

.pill.gold {
  border-color: var(--gold);
  color: var(--gold);
}

.sync-indicator {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  transition: border-color 0.2s, color 0.2s;
}

.sync-icon {
  font-size: 13px;
  line-height: 1;
}

.sync-synced {
  border-color: var(--success);
  color: var(--success);
}

.sync-pending {
  border-color: var(--gold);
  color: var(--gold);
}

.sync-error {
  border-color: var(--danger);
  color: var(--danger);
}

.sync-offline {
  border-color: var(--line);
  color: var(--muted);
}

/* ---- Site header / primary nav ---- */

/* Carries the brand mark, so it also gets the .brand-chrome class in
   markup (dark tokens pinned in every theme — see .brand-chrome above). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 28px;
  flex-wrap: wrap;
  margin: -24px -16px 20px;
  padding: 16px;
  color: var(--fg);
  background: color-mix(in srgb, var(--ink) 90%, transparent);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

@media (min-width: 640px) {
  .site-header {
    margin: -24px -24px 20px;
    padding: 16px 24px;
  }
}

@supports not (backdrop-filter: blur(1px)) {
  .site-header {
    background: var(--ink);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
}

.brand:hover {
  color: var(--fg);
}

.brand-mark {
  width: 26px;
  height: 26px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid var(--pink);
  border-radius: var(--radius-md);
  color: var(--pink);
}

.nav-primary {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.nav-link {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  padding: 4px 0;
}

.nav-link:hover,
.nav-link.active {
  color: var(--pink);
}

.header-tail {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.page-eyebrow {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--pink);
  margin: 0 0 10px 0;
}

.auth-header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.auth-dropdown {
  position: relative;
}

.auth-dropdown summary {
  list-style: none;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.auth-dropdown summary::-webkit-details-marker {
  display: none;
}

.auth-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 220px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--mode-chrome-shadow);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
}

.auth-menu a.btn,
.auth-menu button.btn {
  text-align: left;
}

.auth-magic {
  display: flex;
  gap: 6px;
}

.auth-magic input {
  flex: 1;
  min-width: 0;
}

.auth-profile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.auth-profile label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
}

.auth-status {
  font-size: 13px;
  color: var(--muted);
  min-height: 16px;
}

/* ---- Home / Docs hero + tile grid (shared across index.html, docs/index.html) ---- */

.hero {
  position: relative;
  text-align: center;
  padding: 48px 16px 24px;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 30px;
  line-height: 1.3;
  margin: 0;
  color: var(--fg);
}

.hero p {
  color: var(--fg);
  max-width: 600px;
  margin: 16px auto 0;
  font-size: 17px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--pink);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  margin-bottom: 22px;
}

/* ---- Home page: left-aligned hero, glow blob, platform strip, dev split ---- */

/* Flat, untextured ground — the active design mode has no grid texture
   (--mode-grid-opacity is 0%), so this no longer draws one. */
.home-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 40px;
}

.home-hero-glow {
  position: absolute;
  top: -120px;
  right: -80px;
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(244, 114, 182, 0.22), transparent 60%);
  animation: rglow 6s steps(6) infinite;
  pointer-events: none;
}

@supports (color: color-mix(in srgb, red, red)) {
  .home-hero-glow {
    background: radial-gradient(circle, color-mix(in srgb, var(--pink) 22%, transparent), transparent 60%);
  }
}

@keyframes rglow {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.85;
  }
}

.home-hero-inner {
  position: relative;
  max-width: 780px;
  padding: 56px 0 40px;
}

.home-hero-inner h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 34px;
  line-height: 1.25;
  color: var(--fg);
  margin: 0 0 22px;
}

.home-hero-inner p {
  font-size: 18px;
  line-height: 1.5;
  max-width: 58ch;
  color: var(--fg);
  margin: 0 0 28px;
}

.home-hero-cta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.platform-strip {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}

.platform-strip .platform-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}

.platform-strip .platform-item .ph {
  font-size: 16px;
  color: var(--gold);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
  margin-bottom: 44px;
}

.feature-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--mode-chrome-shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.feature-card .feature-icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gold);
  border-radius: var(--radius-md);
  color: var(--gold);
  font-size: 18px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: var(--fg);
  margin: 0;
}

.feature-card p {
  font-size: 15px;
  line-height: 1.4;
  color: var(--muted);
  margin: 0;
}

/* True viewport-edge bleed (not a negative margin sized to one ancestor's
   padding) — correct regardless of how deep .stat-band sits inside the
   now page-width-capped content column. The grid itself lives in a
   nested .page-width so the band's background bleeds full-width while
   its content stays capped like everything else. */
.stat-band {
  background: var(--panel-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 32px 24px;
  margin: 0 0 44px;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

.stat-band .page-width {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
  text-align: center;
}

.stat-band .stat-band-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  color: var(--gold);
}

.stat-band .stat-band-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
  margin-top: 10px;
}

.dev-split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 30px;
  align-items: center;
  margin-bottom: 52px;
}

@media (max-width: 720px) {
  .dev-split {
    grid-template-columns: 1fr;
  }
}

.dev-split h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--fg);
  margin: 0 0 14px;
}

.dev-split p {
  font-size: 16px;
  line-height: 1.4;
  color: var(--muted);
  max-width: 46ch;
  margin: 0 0 20px;
}

/* The terminal mock stays permanently dark in both themes — a real
   terminal doesn't relight for a light-mode page — so its colors are
   named tokens declared once in :root only, not redeclared under
   [data-pixel-theme="light"]. */
:root {
  --code-terminal-bg: #111114;
  --code-terminal-bar-bg: #18181b;
  --code-terminal-text: #6ee7b7;
}

.code-terminal {
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  background: var(--code-terminal-bg);
  box-shadow: var(--mode-chrome-shadow);
  overflow: hidden;
}

.code-terminal-bar {
  background: var(--code-terminal-bar-bg);
  border-bottom: 1px solid var(--line);
  padding: 7px 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
}

.code-terminal pre {
  margin: 0;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.5;
  color: var(--code-terminal-text);
  overflow-x: auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--mode-chrome-shadow);
  padding: 18px;
  transition: border-color 0.15s;
}

.tile:hover {
  border-color: var(--pink);
}

.tile h3 {
  margin: 0 0 8px 0;
  color: var(--fg);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
}

.tile p {
  margin: 0 0 14px 0;
  font-size: 15px;
  color: var(--muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  border: 1px solid var(--line);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 10px;
}

.badge.available {
  background: color-mix(in srgb, var(--success-strong) 60%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 20%, transparent);
}

.badge.coming-soon {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* General-purpose status/rarity badge variants — usable anywhere a
   colored pill is needed beyond the docs-tile .badge.available pattern
   above (which keeps its own name for backward compatibility). */
.badge-success {
  background: color-mix(in srgb, var(--success-strong) 60%, transparent);
  color: var(--success);
  border: 1px solid color-mix(in srgb, var(--success) 20%, transparent);
}

.badge-warning {
  background: color-mix(in srgb, var(--warning-strong) 60%, transparent);
  color: var(--warning);
  border: 1px solid color-mix(in srgb, var(--warning) 20%, transparent);
}

.badge-danger {
  background: color-mix(in srgb, var(--danger-strong) 60%, transparent);
  color: var(--danger);
  border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent);
}

.badge-info {
  background: color-mix(in srgb, var(--info-strong) 60%, transparent);
  color: var(--info);
  border: 1px solid color-mix(in srgb, var(--info) 20%, transparent);
}

.badge-brand {
  background: color-mix(in srgb, var(--pink) 10%, transparent);
  color: var(--pink-bright);
  border: 1px solid color-mix(in srgb, var(--pink) 20%, transparent);
}

.badge-neutral {
  background: var(--panel-soft);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* ---- Docs shell — the guide's actual DocsShell pattern (section
   sidebar with grouped links + breadcrumb + a capped content column),
   used for the whole Developers section instead of each page rolling
   its own "← Docs" back-button header. ---- */

.docs-shell {
  display: flex;
  flex-direction: column;
}

.docs-sidebar {
  flex-shrink: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 0 20px;
  margin-bottom: 20px;
}

.docs-sidebar-title {
  margin: 0 0 12px;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--pink);
}

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.docs-nav-group-title {
  margin: 0 0 4px;
  padding: 0 12px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
}

.docs-nav-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-nav-link {
  display: block;
  border-left: 2px solid transparent;
  padding: 6px 12px;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: border-color 0.1s, background-color 0.1s, color 0.1s;
}

.docs-nav-link:hover {
  border-left-color: var(--line);
  background: var(--panel-soft);
  color: var(--fg);
}

.docs-nav-link.active {
  border-left-color: var(--pink-bright);
  background: color-mix(in srgb, var(--pink) 10%, transparent);
  color: var(--pink-bright);
}

.docs-main {
  flex: 1;
  min-width: 0;
}

.docs-main-inner {
  max-width: 1024px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}

.docs-breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}

.docs-breadcrumb a:hover {
  color: var(--fg);
}

.docs-breadcrumb .current {
  color: var(--fg);
}

@media (min-width: 768px) {
  .docs-shell {
    flex-direction: row;
    gap: 32px;
  }

  .docs-sidebar {
    width: 220px;
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding: 0 20px 0 0;
    margin-bottom: 0;
    position: sticky;
    top: 96px;
    align-self: flex-start;
    max-height: calc(100vh - 116px);
    overflow-y: auto;
  }
}

/* ---- Docs pages: "coming soon" platform tiles + prose/code articles.
   Consolidated out of per-page embedded <style> blocks in
   docs/{browser-extensions,pc-console,websites,mobile}.html (coming-soon
   group) and docs/{web-apps,web-games}.html (prose group), which had
   drifted to slightly different values per file. ---- */

.docs-coming-soon {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 48px 16px;
}

.docs-coming-soon h1 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--gold);
  font-size: 28px;
  letter-spacing: 2px;
  margin: 0 0 16px 0;
}

.docs-coming-soon p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin: 0 0 24px 0;
}

.coming-soon-badge {
  display: inline-block;
  padding: 8px 24px;
  background: var(--panel-soft);
  border: 1px solid var(--gold);
  border-radius: var(--radius-pill);
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin: 24px 0;
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 32px 0;
}

.platform-card {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
}

.platform-card h3 {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 8px 0;
}

.platform-card p {
  font-size: 12px;
  margin: 0;
}

.feature-list {
  text-align: left;
  margin: 24px 0;
}

.feature-list h3 {
  color: var(--gold);
  font-size: 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 0 0 12px 0;
}

.feature-list ul {
  padding-left: 24px;
}

.feature-list li {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.docs-prose {
  max-width: 800px;
  margin: 0 auto;
}

.docs-prose h2 {
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin: 32px 0 16px 0;
}

.docs-prose h3 {
  color: var(--fg);
  font-size: 15px;
  margin: 24px 0 12px 0;
}

.docs-prose p,
.docs-prose li {
  font-size: 14px;
  line-height: 1.6;
  color: var(--fg);
  margin: 0 0 12px 0;
}

.docs-prose ul {
  padding-left: 24px;
}

.docs-prose code {
  background: var(--panel-soft);
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 13px;
}

.docs-prose pre {
  background: var(--panel-soft);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: auto;
  font-size: 13px;
  margin: 16px 0;
}

.docs-prose pre code {
  background: none;
  padding: 0;
  border: none;
}

.note {
  background: var(--panel-soft);
  border-left: 4px solid var(--gold);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 12px 16px;
  margin: 16px 0;
  font-size: 13px;
  color: var(--muted);
}

/* ---- Stat tiles (Dashboard / View Profile / Global Achievements) ---- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.stat-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--mode-chrome-shadow);
  padding: 14px 16px;
}

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
}

.stat-value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: var(--gold);
  margin-top: 10px;
}

/* ---- Rarity tags (Global Achievements, showcase) ---- */

.rarity-tag {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  border: 1px solid var(--muted);
  color: var(--muted);
  white-space: nowrap;
}

.rarity-tag.rare {
  background: color-mix(in srgb, var(--info) 12%, transparent);
  border-color: var(--info);
  color: var(--info);
}

.rarity-tag.epic {
  background: color-mix(in srgb, var(--pink) 10%, transparent);
  border-color: var(--pink);
  color: var(--pink-bright);
}

.rarity-tag.legend {
  background: color-mix(in srgb, var(--gold) 15%, transparent);
  border-color: var(--gold);
  color: var(--gold);
}

/* ---- Settings tabs — the guide's actual Tabs component: a pill-shaped
   tablist, active trigger filled solid pink, not a sidebar list. ---- */

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  padding: 4px;
}

.tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border: none;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.1s, color 0.1s;
}

.tab:hover {
  color: var(--fg);
}

.tab.active {
  background: var(--pink);
  color: var(--ink);
}

.settings-layout {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 16px;
}

/* ---- App shell (Dashboard / Global Achievements / View Profile) — the
   guide's sidebar-nav pattern: a horizontally-scrollable pill row on
   narrow screens, a vertical sidebar from 768px up. ---- */

.app-shell {
  display: flex;
  flex-direction: column;
}

/* Below 768px this is a horizontal strip above the content, not a rail.
   It wraps rather than scrolling sideways: with four items it no longer
   fits one line on a narrow phone, and a scroller can leave the active
   item off-screen with nothing indicating it's there. */
.app-sidebar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin-bottom: 20px;
}

.app-sidebar-link {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border-left: 2px solid transparent;
  border-radius: 0;
  padding: 8px 12px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

.app-sidebar-link:hover {
  border-left-color: var(--line);
  background: var(--panel-soft);
  color: var(--fg);
}

.app-sidebar-link.active {
  border-left-color: var(--pink-bright);
  background: color-mix(in srgb, var(--pink) 10%, transparent);
  color: var(--pink-bright);
}

/* Grows to fill the space beside the sidebar; the .page-width wrapper
   placed inside it (see markup) is what actually caps and centers the
   content column — matches AppShell's `mx-auto flex max-w-6xl` inner
   div. The sidebar itself and the row it sits in stay full width. */
.app-main {
  flex: 1;
  min-width: 0;
}

@media (min-width: 768px) {
  .app-shell {
    flex-direction: row;
    gap: 24px;
  }

  .app-sidebar {
    flex-direction: column;
    width: 208px;
    flex-shrink: 0;
    border-bottom: none;
    border-right: 1px solid var(--line);
    padding: 12px 12px 0 0;
    margin-bottom: 0;
  }
}

.integration-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--mode-chrome-shadow);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.integration-tile.is-soon {
  opacity: 0.6;
}

/* Consolidated out of settings.html's embedded <style> block. */
.integration-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.integration-badge {
  font-size: 12px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 2px 8px;
}

.ra-game-icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex: none;
}

.ra-progress-row .icon {
  opacity: 0.9;
}

.ra-progress-row.locked .icon {
  opacity: 0.35;
  filter: grayscale(1);
}

.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

/* ---- Profile card + layout (View Profile) ----

   Mirrors design-core's `/templates/profile` composition: a ProfileCard
   sized as one of three grid columns, with the remaining two columns
   beside it. The template fills those two columns with an "Account
   information" card, which has no counterpart here — Achv's View Profile
   is a public, read-only page with no account fields to show — so the
   showcase / completion / activity cards fill them instead.

   Stats live *inside* the card (as in the template) rather than in a
   separate strip below it. They're stacked label/value rows rather than
   the template's horizontal 3-across strip: there are four of them here,
   and one ("Rarest unlock") holds an achievement name rather than a
   number, which does not fit a narrow column horizontally. ---- */

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

@media (min-width: 1024px) {
  .profile-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  }
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  box-shadow: var(--mode-chrome-shadow);
  padding: 24px 20px;
}

/* The card is the page's one sticky element on wide viewports: the column
   beside it is much taller, so the identity stays in view while reading. */
@media (min-width: 1024px) {
  .profile-card {
    position: sticky;
    top: 24px;
  }
}

.profile-card .avatar-badge {
  width: 88px;
  height: 88px;
  font-size: 26px;
}

.profile-card-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  color: var(--fg);
  overflow-wrap: anywhere;
}

.profile-card-meta,
.profile-card-bio {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.profile-card-bio {
  color: var(--fg);
  white-space: pre-wrap;
}

.profile-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}

.profile-card-actions > * {
  width: 100%;
  text-align: center;
}

.profile-card-stats {
  width: 100%;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.profile-card-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  text-align: left;
}

.profile-card-stat + .profile-card-stat {
  border-top: 1px solid var(--line);
}

.profile-card-stat .stat-label {
  font-size: 11px;
}

/* Overrides .stat-value's display-size/margin: these sit in a dense row,
   not a tile, and the rarest-unlock value is a name rather than a number. */
.profile-card-stat .stat-value {
  margin-top: 0;
  font-size: 15px;
  text-align: right;
  overflow-wrap: anywhere;
}

/* Circular avatars are the one shape exception in this design mode —
   every other surface is square-cornered. */
.avatar-badge {
  width: 68px;
  height: 68px;
  flex: none;
  background: var(--gold);
  color: var(--ink);
  border-radius: var(--radius-full);
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 20px;
  /* No-op on the initials <div>; makes the same class work as an <img> for
     a real avatar_url (see profile-view.html) without cropping oddly. */
  object-fit: cover;
}

.avatar-badge.small {
  width: 40px;
  height: 40px;
  font-size: 14px;
}

/* ---- Profile page ---- */

.page-profile > section {
  margin-top: 16px;
}

.page-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.5rem;
}

.push-right {
  margin-left: auto;
}

/* !important is deliberate: "hidden" must always win regardless of what
   `display` a more specific element+class rule sets elsewhere (e.g.
   `table.achievements` sets `display: block` for its own scroll-container
   purposes, which otherwise out-specifies a bare `.is-hidden`). */
.is-hidden {
  display: none !important;
}

.no-margin {
  margin: 0;
}

.muted-note {
  font-size: 14px;
  color: var(--muted);
  margin: 6px 0 14px 0;
}

.fine-print {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 0 0;
}

.account-id {
  font-size: 14px;
  color: var(--muted);
}

.row-between {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---- Stored achievements ---- */

.game-progress + .game-progress {
  margin-top: 12px;
}

.game-progress > summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.game-progress > summary::-webkit-details-marker {
  display: none;
}

.game-progress > summary:hover {
  border-color: var(--pink);
}

.game-progress[open] > summary {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.game-progress .game-name {
  font-size: 16px;
  color: var(--gold);
}

.game-progress .game-meta {
  font-size: 12px;
  color: var(--muted);
}

.game-progress .game-actions {
  margin-left: auto;
}

.progress-list {
  border: 1px solid var(--line);
  border-top: none;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  padding: 4px 0;
  overflow: hidden;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  font-size: 14px;
}

.progress-row + .progress-row {
  border-top: 1px solid var(--line);
}

.progress-row .icon {
  width: 24px;
  height: 24px;
  image-rendering: pixelated;
  flex: none;
}

.progress-row .pts {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.progress-row.locked {
  opacity: 0.55;
}

.progress-row.unlocked .a-name {
  color: var(--gold);
}

/* Reset/delete are destructive, so they read as destructive. */
.btn-danger {
  background: var(--danger-strong);
  border-color: var(--danger-strong);
  color: var(--danger);
}

.btn-danger:hover {
  background: color-mix(in srgb, var(--danger-strong) 80%, transparent);
  border-color: var(--danger);
  color: var(--danger);
}

.section-title {
  margin: 0 0 6px 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

/* Single-column on narrow screens — two side-by-side text inputs get
   unusable well before the container itself does. */
@media (max-width: 560px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

.field label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
}

.field input {
  width: 100%;
}

.field-hint {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* An inline text button; the chunky .btn styling would swamp a hint line. */
.link-btn {
  background: none;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--pink);
  text-decoration: underline;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.link-btn:hover {
  background: none;
  color: var(--pink-bright);
  border: none;
  transform: none;
  box-shadow: none;
}

/* ---- Switch (design-core's Switch: pill track, thumb slides right and
   turns pink when checked) — a plain checkbox styled with a sibling, since
   there's no Radix here; every other form control in this app is already
   a native input read directly by its page's main.ts. ---- */

.switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 24px;
  flex-shrink: 0;
}

.switch input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.switch-track {
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--panel-soft);
  transition: background-color 0.1s, border-color 0.1s;
}

.switch-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--muted);
  transition: transform 0.1s, background-color 0.1s;
}

.switch input:checked + .switch-track {
  border-color: var(--pink);
  background: color-mix(in srgb, var(--pink) 30%, transparent);
}

.switch input:checked + .switch-track .switch-thumb {
  transform: translateX(16px);
  background: var(--pink);
}

.switch input:focus-visible + .switch-track {
  box-shadow: 0 0 0 2px var(--ink), 0 0 0 4px color-mix(in srgb, var(--pink) 70%, transparent);
}

.notice {
  border: 1px solid var(--info);
  border-radius: var(--radius-md);
  background: var(--panel-soft);
  color: var(--info);
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 14px;
}

/* Read-only system handle shown under the editable username. */
.auth-meta {
  font-size: 12px;
  color: var(--muted);
  opacity: 0.8;
  word-break: break-all;
}

.auth-status.good {
  color: var(--success);
}

.auth-status.bad {
  color: var(--danger);
}

.toast-stack {
  position: fixed;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  pointer-events: none;
}

/* Achievement-unlock toast — a plain rounded panel with the system's
   soft neutral elevation (no notch: the active mode's notch is 0; no
   brand-tinted shadow: the mode fixes the shadow color to neutral).
   Celebratory identity comes through the gold left accent and text, not
   through the shadow. */
.toast {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius-lg);
  box-shadow: var(--mode-shadow-rim, inset 0 1px 0 0 transparent),
    var(--surface-shadow) var(--mode-shadow-color, rgba(0, 0, 0, 0.44));
  padding: 10px 14px;
  min-width: 240px;
  animation: pop 0.3s ease-out;
}

.toast .title {
  color: var(--gold);
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toast .name {
  font-size: 16px;
  margin-top: 4px;
  color: var(--fg);
}

.toast .desc {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

@keyframes pop {
  from {
    transform: translateX(20px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* display:block on the <table> itself becomes the scroll container;
   thead/tbody/tr/td keep their table-* display values (the UA default),
   so CSS's anonymous-table-object generation still lays them out as one
   real table — columns stay aligned — it's just the outer box that's
   now block-level and can scroll instead of forcing the whole page
   wider when column content (long descriptions, six columns) can't
   shrink to fit a narrow viewport. */
table.achievements {
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

table.achievements th,
table.achievements td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}

table.achievements th {
  background: var(--panel-soft);
  font-family: var(--font-sans);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: var(--tracking-wide);
  color: var(--muted);
}

table.achievements tbody tr:hover {
  background: color-mix(in srgb, var(--panel-soft) 60%, transparent);
}

table.achievements tr.unlocked td {
  color: var(--gold);
}

table.achievements tr.me td {
  color: var(--gold);
}

table.achievements .icon {
  width: 32px;
  height: 32px;
  image-rendering: pixelated;
}

/* Segmented "pixel bar" — a row of blocks rather than a continuous fill,
   per the guide's PixelBar (gamification progress is its worked example). */
.bar {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  height: 10px;
  position: relative;
  overflow: hidden;
}

.bar > span {
  display: block;
  height: 100%;
  width: 0%;
  background-color: var(--pink);
  background-image: repeating-linear-gradient(
    90deg,
    var(--panel-soft) 0,
    var(--panel-soft) 2px,
    transparent 2px,
    transparent 8px
  );
  transition: width 0.2s;
}

.bar.gold > span {
  background-color: var(--gold);
}

.bar.accent > span {
  background-color: var(--danger);
}

/* ---- Games (Snake, Artillery Duel) — consolidated out of per-game
   embedded <style> blocks; the canvas background color is the one real
   per-game difference (snake: black, artillery: night sky) and is kept
   as an inline style on the <canvas> tag itself rather than duplicated
   CSS. table.leaderboard was a near-duplicate of table.achievements —
   both games now reuse that table directly (class="achievements"). ---- */

.game-shell {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.game-canvas {
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  image-rendering: pixelated;
  max-width: 100%;
}

.legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-xs);
  border: 1px solid #000;
}

.side-panel {
  min-width: 220px;
  flex: 1;
}

.players {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.player-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  background: var(--panel-soft);
}

.player-card.active {
  border-color: var(--gold);
}

.player-card .row-between {
  margin-bottom: 4px;
  font-size: 12px;
}

.player-card.p1 .a-name {
  color: var(--info);
}

.player-card.p2 .a-name {
  color: var(--danger);
}

.controls-hint {
  margin-top: 12px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.controls-hint strong {
  color: var(--fg);
}

.status-locked {
  color: var(--muted);
}

.status-unlocked {
  color: var(--success);
}

/* ---- Empty state (design-core's EmptyState: dashed panel, muted icon
   tile, title + description, optional secondary action) ---- */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-2xl);
  padding: 56px 24px;
  text-align: center;
}

.empty-state-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 20px;
}

.empty-state-title {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}

.empty-state-desc {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
  max-width: 40ch;
}

/* ---- Full-page state (404) — icon tile, mono eyebrow, display heading,
   muted body copy, primary action. Rendered without the app header,
   matching design-core's standalone states/404. There is no states/500
   counterpart here on purpose: this site is statically hosted (see
   apps/web/CNAME), so there is no origin that can produce a 500. ---- */

.state-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 60vh;
  padding: 64px 16px;
  text-align: center;
}

.state-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel-soft);
  color: var(--pink);
  font-size: 24px;
}

.state-eyebrow {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.state-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  color: var(--fg);
}

.state-body {
  margin: 0;
  max-width: 36ch;
  font-size: 14px;
  color: var(--muted);
}

/* ---- Theme preferences toggle (light/dark/system) ---- */

.theme-toggle {
  position: fixed;
  bottom: 16px;
  right: 16px;
  z-index: 9997;
}

.theme-toggle-btn {
  width: 38px;
  height: 38px;
  padding: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  font-size: 16px;
  line-height: 1;
}

.theme-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--mode-chrome-shadow);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.theme-menu[hidden] {
  display: none;
}

.theme-menu-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-left: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--fg);
  box-shadow: none;
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  text-align: left;
}

.theme-menu-btn:hover {
  background: var(--panel-soft);
  color: var(--pink);
  transform: none;
  box-shadow: none;
}

.theme-menu-btn.active {
  border-left-color: var(--pink);
  color: var(--pink);
}

.theme-menu-btn .check {
  margin-left: auto;
  visibility: hidden;
}

.theme-menu-btn.active .check {
  visibility: visible;
}
