/* ============================================================
   Mimic site styles
   Sections: variables · base · nav · hero · reveal · showcase
             · feature rows · montage grid · closer · footer · responsive
   ============================================================ */

:root {
  color-scheme: dark;
  /* Cut paper: a black page, white ink, one hairline. Only the coin and real footage carry colour. */
  --bg: #000000;            /* the page */
  --bg-rgb: 0,0,0;       /* the page, for see-through bars and fades */
  --bg-lift: #000000;       /* a soft glow on the page */
  --bg-high: #000000;       /* the brightest the field gets (a portrait's light) */
  --surface: #000000;       /* panels, menus, pills */
  --surface-2: #000000;     /* a panel's lower half, cover placeholders */
  --surface-low: #000000;   /* the dark end of a gradient */
  --field: #000000;         /* inputs: a step below the panel they sit in */
  --on-accent: #000000;     /* ink on white buttons */
  --text: #ffffff;
  --muted: rgba(255,255,255,0.72);
  --line: rgba(255,255,255,0.26);
  --accent: #ffffff;
  --maxw: 1280px;
  --display: "Sora", -apple-system, BlinkMacSystemFont, sans-serif;
  --body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
/* a #section link (Download, Watch it move) lands below the fixed nav, the browser's own jump included */
html.landing body { visibility: hidden; }
/* Moving between pages: a short crossfade instead of a hard cut, with the nav bar held in place
   (it is the same bar on every page), so a click through the menu reads as one site. */
@view-transition { navigation: auto; }
nav { view-transition-name: site-nav; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 180ms; }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none; } }
/* a subpage paints before its script fills it: keep the footer down where it belongs meanwhile */
body.subpage main { min-height: calc(100vh - 74px); min-height: calc(100svh - 74px); }
section[id] { scroll-margin-top: 75px; }   /* nav: 74px bar + 1px border */
body {
  font-family: var(--body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }

/* film grain overlay for a richer, artistic feel */
body::after {
  content: ""; display: none; position: fixed; inset: 0; pointer-events: none; z-index: 200; opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- spotlight grid ----------
   Huly-style cursor reveal (adapted from murplz.com).
   An uneven plaid mesh sits behind the page content (z-index:-1, so it shows
   through the transparent sections). It's invisible at rest; a radial mask
   centered on the cursor (--mx/--my, set by script.js) reveals only the
   patch of grid around the pointer. */
.spotlight-grid {
  display: none; position: fixed; inset: 0; pointer-events: none; z-index: -1;
  opacity: 0; transition: opacity .5s ease;

  /* two line-grids at different scales + a half-cell offset on the minor one
     give the irregular, woven feel instead of a flat checkerboard */
  background-image:
    linear-gradient(to right,  rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.07) 1px, transparent 1px),
    linear-gradient(to right,  rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px, 29px 29px, 29px 29px;
  background-position: 0 0, 0 0, 15px 8px, 15px 8px;

  --mx: 50%; --my: 50%;
  -webkit-mask-image: radial-gradient(circle 240px at var(--mx) var(--my), #000000 0%, rgba(0,0,0, 0.55) 35%, transparent 75%);
          mask-image: radial-gradient(circle 240px at var(--mx) var(--my), #000000 0%, rgba(0,0,0, 0.55) 35%, transparent 75%);
}
.spotlight-grid.active { opacity: 1; }

/* touch / no-mouse devices — no cursor to follow, so drop it entirely */
@media (hover: none) { .spotlight-grid { display: none; } }

/* ---------- nav ---------- */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  transition: background .3s, border-color .3s, backdrop-filter .3s;
  border-bottom: 1px solid transparent;
}
nav.scrolled { background: var(--bg); border-bottom-color: var(--line); }
nav .wrap { display: flex; align-items: center; justify-content: space-between; height: 74px; }
.brand { font-family: var(--display); font-weight: 700; font-size: 1.4rem; letter-spacing: 0.5px; }
.nav-links { display: flex; gap: 34px; align-items: center; }
.nav-links a { color: var(--muted); font-size: 0.92rem; transition: color .15s; }
.nav-links a:hover { color: var(--text); }
.btn {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--display);
  padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: 0.92rem;
  border: 1px solid var(--text); color: var(--bg); background: var(--text);
  cursor: pointer; transition: transform .12s, background .12s, color .12s;
}
.btn:hover { background: var(--bg); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-outline { background: transparent; color: var(--text); border-color: var(--line); }
.btn-outline:hover { border-color: var(--text); background: transparent; color: var(--text); }

/* ---------- hero (full-bleed video) ---------- */
.hero { position: relative; height: 100vh; min-height: 640px; display: grid; place-items: center; overflow: hidden; }
.hero video, .hero .video-fallback {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0;
}
.hero .hero-star { position: absolute; z-index: 0; left: 50%; top: 50%; width: min(78vmin, 640px); aspect-ratio: 1; transform: translate(-50%, -50%); background: url(assets/pentagram.png) 0 0 / 200% 200% no-repeat; opacity: 0.22; animation: hero-star-turn 52s linear infinite, hero-star-boil 0.5s step-end infinite; pointer-events: none; }
@keyframes hero-star-turn { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes hero-star-boil { 0% { background-position: 0 0; } 25% { background-position: 100% 0; } 50% { background-position: 0 100%; } 75% { background-position: 100% 100%; } }
@media (prefers-reduced-motion: reduce) { .hero .hero-star { animation: none; } }
.hero .video-fallback { z-index: -1; }
.hero .video-fallback { background: var(--bg); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: none;
}
.hero-inner { position: relative; z-index: 2; text-align: center; padding: 0 24px; max-width: 980px; }
.hero h1 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(2.8rem, 9vw, 7rem); line-height: 0.98; letter-spacing: -2px;
}

/* staggered per-letter entrance — script.js wraps each glyph in .char and sets
   its animation-delay, so the title assembles itself letter by letter on load */
.hero h1 .char {
  display: inline-block;
  opacity: 0;
  transform: translateY(0.55em);
  filter: blur(12px);
  animation: charIn 0.75s cubic-bezier(0.22, 0.7, 0.2, 1) both;
}
@keyframes charIn {
  to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* the subtitle + buttons fade up just after the headline lands */
.hero .sub, .hero-cta {
  opacity: 0;
  transform: translateY(14px);
  animation: heroRise 0.8s cubic-bezier(0.22, 0.7, 0.2, 1) both;
}
.hero .sub  { animation-delay: 0.9s; }
.hero-cta   { animation-delay: 1.05s; }
@keyframes heroRise {
  to { opacity: 1; transform: translateY(0); }
}

/* respect users who ask for less motion — show everything, no animation */
@media (prefers-reduced-motion: reduce) {
  .hero h1 .char, .hero .sub, .hero-cta {
    animation: none; opacity: 1; transform: none; filter: none;
  }
}
.hero .sub { color: rgba(255,255,255,0.9); font-size: clamp(1.05rem, 2.2vw, 1.5rem); margin: 26px auto 0; max-width: 600px; }
.hero-cta { margin-top: 40px; display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.scroll-hint { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 2; color: var(--muted); font-size: 0.8rem; letter-spacing: 2px; animation: bob 2s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(8px); } }

/* ---------- scroll-reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(40px); transition: opacity .9s cubic-bezier(.16, 1, .3, 1), transform .9s cubic-bezier(.16, 1, .3, 1); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- big showcase ---------- */
.showcase { padding: 130px 0; }
.showcase .eyebrow { font-family: var(--display); color: var(--accent); letter-spacing: 3px; font-size: 0.82rem; text-transform: uppercase; }
.showcase h2 { font-family: var(--display); font-weight: 700; font-size: clamp(2rem, 5.5vw, 4rem); letter-spacing: -1.5px; line-height: 1.02; margin: 18px 0 0; max-width: 16ch; }
.showcase .big-frame { margin-top: 56px; }

/* shared video frame (showcase, feature rows, montage) */
.video-frame {
  position: relative; width: 100%; border-radius: 18px; overflow: hidden;
  background: var(--surface-2); border: 1px solid var(--line); aspect-ratio: 16/9;
}
.video-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-frame .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 0.9rem; text-align: center; padding: 20px; }

/* ---------- alternating feature rows ---------- */
.feature-row { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; padding: 90px 0; }
.feature-row:nth-child(even) .copy { order: 2; }
.feature-row .copy h3 { font-family: var(--display); font-weight: 700; font-size: clamp(1.6rem, 3.5vw, 2.6rem); letter-spacing: -0.8px; line-height: 1.05; }
.feature-row .copy .num { font-family: var(--display); color: var(--accent); font-size: 0.9rem; letter-spacing: 2px; margin-bottom: 14px; }
.feature-row .copy p { color: var(--muted); font-size: 1.08rem; margin-top: 16px; max-width: 42ch; }

/* ---------- montage grid ---------- */
.montage { padding: 120px 0; }
.montage .section-head { text-align: center; margin-bottom: 60px; }
.montage .section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4.5vw, 3.2rem); letter-spacing: -1px; }
.montage .section-head p { color: var(--muted); margin-top: 12px; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.grid .video-frame { aspect-ratio: 16/10; }

/* ---------- closing CTA ---------- */
.closer { padding: 88px 0 160px; text-align: center; min-height: calc(100vh - 74px); min-height: calc(100svh - 74px); display: flex; flex-direction: column; justify-content: flex-start; }
.closer .dl-soon { margin: 22px auto 0; padding: 12px 18px; max-width: 360px; border-radius: 14px; border: 1px solid var(--text); background: transparent; color: var(--text); font-size: 0.95rem; }
.closer h2 { font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, 7vw, 5.5rem); letter-spacing: -2px; line-height: 1; }
.closer p { color: var(--muted); margin: 22px auto 38px; font-size: 1.1rem; }
.closer .dl-meta { margin: 18px auto 0; font-size: 0.85rem; letter-spacing: 0.3px; opacity: 0.7; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: 0.88rem; }
footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; align-items: center; }
footer .brand { font-size: 1.1rem; }
footer a:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .nav-links { display: none; }
  .feature-row { grid-template-columns: 1fr; gap: 30px; padding: 60px 0; }
  .feature-row:nth-child(even) .copy { order: 0; }
  .grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .scroll-hint { animation: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Subpages: store + account  (added 2026-09-24)
   Sections: subpage nav · coin sprites · store head · packs
             · spend · auth · me · cards · ledger · toast · fly
   ============================================================ */

body.subpage { padding-top: 74px; }
[hidden] { display: none !important; }
.store-head-grid > *, .auth-grid > *, .me-grid > * { min-width: 0; }
nav .brand { display: inline-block; }
.nav-links a.active { color: var(--text); }
.eyebrow { font-family: var(--display); color: var(--accent); letter-spacing: 3px; font-size: 0.82rem; text-transform: uppercase; }
.hint { color: var(--muted); font-size: 0.9rem; }

/* account chip in the nav: coin + balance + @name */
.chip {
  display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; font-size: 0.9rem; line-height: 1;
  transition: border-color .15s, background .15s;
}
.chip:hover { border-color: var(--text); }
.chip #chip-bal { font-family: var(--display); font-weight: 700; }
.chip-name { color: var(--muted); padding-left: 8px; border-left: 1px solid var(--line); }
/* signed in: the balance (to the wallet) and the name (a menu with Sign out) share one pill */
#account-chip { position: relative; }
.chip-split { padding: 0 6px 0 10px; gap: 0; }
.chip-bal-link { display: inline-flex; align-items: center; gap: 8px; height: 100%; padding-right: 8px; color: inherit; text-decoration: none; }
.chip-who { display: inline-flex; align-items: center; gap: 6px; height: 100%; padding: 0 8px 0 0; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; }
.chip-who:hover .chip-name, .chip-who[aria-expanded="true"] .chip-name { color: var(--text); }
.chip-caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; opacity: .7; margin-left: 2px; }
.chip-menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; padding: 4px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); z-index: 60; display: grid; }
.chip-menu a, .chip-menu button { display: block; text-align: left; padding: 9px 12px; border: 0; border-radius: 5px; background: none; color: var(--text); font: inherit; font-size: 0.9rem; text-decoration: none; cursor: pointer; }
.chip-menu a:hover, .chip-menu button:hover, .chip-menu a:focus-visible, .chip-menu button:focus-visible { background: var(--text); color: var(--bg); }

/* ---------- coin sprites ----------
   Two sheets rendered in Blender: the coin (8x8, 64 frames of 256px, a 2s turn at 32fps) and the pack
   heaps (8x4, 32 frames, 12fps). Two step animations on the two background-position axes walk
   the grid; no JS. Sized by --s (coin) / --p (heap). */
.coin-spin, .coin-fly {
  --s: 40px; display: inline-block; width: var(--s); height: var(--s); vertical-align: middle;
  background-image: url("assets/coin/tr-coin-sheet-256.webp?v=m1");
  background-size: calc(var(--s) * 8) calc(var(--s) * 8);
  animation: coinX .25s steps(8) infinite, coinY 2s steps(8) infinite;
}
.coin-spin.big { --s: 64px; }
/* small coins are the crisp still: a 128px sprite frame turns to mush under 40px */
.coin-inline, .chip-coin {
  display: inline-block; width: 26px; height: 26px; vertical-align: middle;
  background: url("assets/coin/tr-coin.webp?v=m1") center / contain no-repeat;
}
.coin-inline { margin-right: 7px; transform: translateY(-2px); }
.chip-coin { width: 22px; height: 22px; }
@keyframes coinX { to { background-position-x: calc(var(--s) * -8); } }
@keyframes coinY { to { background-position-y: calc(var(--s) * -8); } }

.heap {
  --p: 200px; width: var(--p); height: var(--p); display: block;
  background-size: calc(var(--p) * 8) calc(var(--p) * 4);
  animation: heapX .6667s steps(8) infinite, heapY 2.6667s steps(4) infinite;
}
.heap[data-tier="10"]   { background-image: url("assets/coin/tr-hoard-10.webp?v=m1"); }
.heap[data-tier="60"]   { background-image: url("assets/coin/tr-hoard-60.webp?v=m1"); }
.heap[data-tier="150"]  { background-image: url("assets/coin/tr-hoard-150.webp?v=m1"); }
.heap[data-tier="350"]  { background-image: url("assets/coin/tr-hoard-350.webp?v=m1"); }
.heap[data-tier="800"]  { background-image: url("assets/coin/tr-hoard-800.webp?v=m1"); }
.heap[data-tier="2000"] { background-image: url("assets/coin/tr-hoard-2000.webp?v=m1"); }
/* art that arrives over the network (coin piles, the Google button) fades in once it is really there, never pops */
.fade-art { opacity: 0; transition: opacity .45s ease; }
.fade-art.loaded { opacity: 1; }
@keyframes heapX { to { background-position-x: calc(var(--p) * -8); } }
@keyframes heapY { to { background-position-y: calc(var(--p) * -4); } }
@media (prefers-reduced-motion: reduce) { .heap, .coin-spin, .coin-inline, .chip-coin { animation: none; } }

/* ---------- store head ---------- */
.store-head { padding: 90px 0 40px; position: relative; overflow: hidden; }
.store-head::before {
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: -1; pointer-events: none;
  background: none;
}
.store-head-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 40px; align-items: center; }
.store-head h1 {
  font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6.4vw, 5.2rem);
  line-height: 0.98; letter-spacing: -2px; margin-top: 18px;
}
.store-head h1 .dim { color: var(--muted); font-weight: 600; }
.store-head .sub { color: rgba(255,255,255,0.85); font-size: 1.1rem; margin-top: 24px; max-width: 52ch; }
.balance-line {
  margin-top: 30px; display: inline-flex; align-items: center; gap: 12px; padding: 10px 18px 10px 12px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
}
.balance-line b { color: var(--text); font-family: var(--display); font-size: 1.15rem; }
.balance-line.waiting { border-color: var(--accent); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 2px var(--text); } }
.store-hero-art { position: relative; display: grid; place-items: center; min-height: 380px; }
/* the hero is the 350 stack as an animated WebP (760px wide from a 1280 render), not a sprite sheet: a sheet that size would
   cost tens of MB of GPU memory, and the browser decodes an animated image frame by frame */
.coin-hero { width: min(400px, 78vw); height: auto; position: relative; z-index: 1; animation: floaty 6s ease-in-out infinite; }
@keyframes floaty { 50% { translate: 0 -14px; } }
.heap-glow { display: none; }

/* ---------- packs ---------- */
.packs { padding: 40px 0 60px; }
.section-head { text-align: center; margin-bottom: 44px; }
.section-head h2 { font-family: var(--display); font-weight: 700; font-size: clamp(1.8rem, 4.5vw, 3.2rem); letter-spacing: -1px; }
.section-head p { color: var(--muted); margin-top: 12px; }
.pack-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pack-skel { height: 380px; border-radius: 22px; border: 1px solid var(--line); animation: shimmer 1.4s ease-in-out infinite; }
@keyframes shimmer { 50% { opacity: .35; } }
.pack {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 30px 24px 26px; border-radius: 22px; border: 1px solid var(--line);
  background: var(--bg); overflow: hidden; isolation: isolate;
  transition: transform .35s cubic-bezier(.16,1,.3,1), border-color .25s, box-shadow .35s;
  --fill: 1;
}
.pack.reveal { transition-delay: calc(var(--i) * 70ms); }
.pack.reveal.in { transition-delay: 0s, 0s, 0s; }
.pack::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .35s;
  background: none;
}
.pack:hover { transform: translateY(-8px); border-color: var(--text); }
.pack:hover::before { opacity: 1; }
.pack.best { border-color: var(--text); }
.pack-art { height: 230px; display: grid; place-items: center; }
/* the hoard is wide and short inside its square cell, so the cell is drawn past the art box's
   height (transparent above and below); --pmax shrinks with the columns */
.pack { --pmax: 290px; }
.pack .heap { --p: calc(var(--pmax) * var(--fill)); }
.pack-amount { font-family: var(--display); font-weight: 800; font-size: calc(1.5rem + 0.9rem * var(--fill)); letter-spacing: -0.5px; margin-top: 8px; display: flex; align-items: center; }
.pack-amount small { font-size: 0.55em; color: var(--muted); margin-left: 6px; font-weight: 600; }
.pack-label { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.pack .buy { margin-top: 18px; min-width: 150px; justify-content: center; }
.pack .buy[data-soon] { background: transparent; color: var(--muted); border-color: var(--line); }
.ribbon {
  position: absolute; top: 16px; left: -40px; transform: rotate(-35deg); padding: 6px 48px;
  background: var(--accent); color: var(--on-accent); font-family: var(--display); font-weight: 700; font-size: 0.72rem; letter-spacing: 1.5px; text-transform: uppercase;
}
.bonus {
  position: absolute; top: 16px; right: 16px; padding: 5px 11px; border-radius: 999px;
  background: var(--bg); color: var(--text); font-family: var(--display); font-weight: 700; font-size: 0.8rem; border: 1px solid var(--text);
}
.fineprint { color: var(--muted); font-size: 0.82rem; text-align: center; margin-top: 30px; }

/* ---------- what it buys ---------- */
.spend { padding: 60px 0 120px; }
.spend-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.spend-card { padding: 30px 28px; border-radius: 20px; border: 1px solid var(--line); background: transparent; }
.spend-card .num { font-family: var(--display); color: var(--accent); font-size: 0.8rem; letter-spacing: 2.5px; margin-bottom: 14px; }
.spend-card h3 { font-family: var(--display); font-weight: 700; font-size: 1.35rem; letter-spacing: -0.4px; }
.spend-card p { color: var(--muted); margin-top: 10px; font-size: 0.98rem; }

/* ---------- auth ---------- */
.auth { padding: 80px 0 140px; }
.auth-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 60px; align-items: center; }
.auth-copy h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.4rem, 6vw, 4.6rem); letter-spacing: -2px; line-height: 1; margin-top: 18px; }
.auth-copy .sub { color: rgba(255,255,255,0.85); font-size: 1.08rem; margin-top: 22px; max-width: 48ch; }
.perks { list-style: none; margin-top: 26px; display: grid; gap: 10px; color: var(--muted); }
.perks b { color: var(--text); }
.auth-card {
  padding: 30px; border-radius: 24px; border: 1px solid var(--line);
  background: var(--bg);
}
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 999px; border: 1px solid var(--line); background: transparent; margin-bottom: 22px; }
.tab { flex: 1; padding: 10px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 600; cursor: pointer; transition: background .2s, color .2s; }
.tab.active { background: var(--text); color: var(--bg); }
.google-slot { display: flex; justify-content: center; min-height: 44px; }
/* Google draws its own black pill: on the dark panel it needs an edge to be seen */
.google-slot > div { border-radius: 999px; box-shadow: 0 0 0 1px var(--line); }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 0.82rem; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: 0.86rem; color: var(--muted); }
.form label small { color: var(--muted); opacity: .7; margin-left: 6px; }
.form input {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field);
  color: var(--text); font: inherit; font-size: 1rem; outline: none; transition: border-color .15s, box-shadow .15s;
}
.form input:focus, .form select:focus { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); outline: none; }
.btn.wide { width: 100%; justify-content: center; }
.btn:disabled, .btn:disabled:hover { opacity: .55; cursor: default; background: var(--text); color: var(--bg); }
.btn-outline:disabled, .btn-outline:disabled:hover { background: transparent; color: var(--text); }
.linkish { background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.86rem; cursor: pointer; justify-self: center; }
.linkish:hover { color: var(--text); }
.msg { min-height: 1.3em; margin-top: 14px; font-size: 0.9rem; color: var(--muted); }
.msg.bad, .msg.good { color: var(--text); }
/* no colour to lean on: a refusal carries a white block with a mark in it, a yes a drawn tick */
.msg.bad:not(:empty)::before, .avail.no:not(:empty)::before { content: "!"; display: inline-grid; place-items: center; width: 1.25em; height: 1.25em; margin-right: .55em; background: var(--text); color: var(--bg); font-weight: 800; font-size: .85em; line-height: 1; vertical-align: 1px; }
.msg.bad, .avail.no { font-weight: 600; }
.msg.good:not(:empty)::before, .avail.ok:not(:empty)::before { content: ""; display: inline-block; width: .32em; height: .62em; margin: 0 .7em 0 .25em; border: solid var(--text); border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-1px); }

/* ---------- me ---------- */
.me { padding: 60px 0 140px; }
.me-head { display: flex; align-items: center; gap: 18px; margin-bottom: 36px; }
.avatar {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.6rem;
  background: var(--text); color: var(--bg);
}
.me-id { flex: 1; }
.me-name { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 4vw, 2.4rem); letter-spacing: -1px; }
.me-email { color: var(--muted); font-size: 0.92rem; }
/* the account page: wide cards (wallet, Plus, achievements) run full width; the smaller ones
   stack in balanced columns so a short card never leaves a hole under it */
.me-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.me-cols { columns: 3; column-gap: 22px; }
.me-cols > .card { break-inside: avoid; }
.me-cols > .card:not([hidden]) ~ .card { margin-top: 22px; } /* dropped at the top of each column */
.card { padding: 28px; border-radius: 22px; border: 1px solid var(--line); background: var(--bg); }
.card-eyebrow { font-family: var(--display); color: var(--accent); letter-spacing: 2.5px; font-size: 0.78rem; text-transform: uppercase; margin-bottom: 16px; }
.card .form { margin-top: 6px; }
.wallet { grid-column: 1 / -1; display: grid; grid-template-columns: 300px 1fr; gap: 12px 40px; align-items: start; }
.wallet .card-eyebrow { grid-column: 1 / -1; }
.wallet-side { display: grid; justify-items: start; gap: 4px; }
.wallet-balance { display: flex; align-items: center; gap: 14px; font-family: var(--display); font-weight: 800; font-size: 3.4rem; letter-spacing: -2px; margin: 0 0 14px; line-height: 1; }
.wallet-balance small { font-size: 1rem; color: var(--muted); align-self: flex-end; margin-bottom: 12px; }
.own-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.own-row.active span { font-weight: 600; }
.own-row em { font-style: normal; color: #ffffff; font-size: 0.8rem; letter-spacing: 1px; text-transform: uppercase; }
.own-row:not(.active) span { color: var(--muted); }
#buy-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.big-name { font-family: var(--display); font-weight: 800; font-size: 2rem; letter-spacing: -1px; margin-bottom: 8px; }
.avail { font-size: 0.86rem; min-height: 1.2em; }
.avail.ok, .avail.no { color: var(--text); }
.found { display: flex; flex-wrap: wrap; gap: 6px; }
.pill { padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer; }
.pill:hover { border-color: var(--text); }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.stats .hint { grid-column: 1 / -1; }
.stat b { display: block; font-family: var(--display); font-size: 1.5rem; letter-spacing: -0.5px; }
.stat span { color: var(--muted); font-size: 0.85rem; }

/* ---------- ledger ---------- */
.ledger { border-top: 1px solid var(--line); }
.ledger .hint { padding-top: 12px; }
.ledger .row { display: flex; justify-content: space-between; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.row-title { font-size: 0.95rem; }
.row-note { color: var(--muted); }
.row-when { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.row-delta { font-family: var(--display); font-weight: 700; }
.row-delta.pos { color: #ffffff; } .row-delta.neg { color: var(--muted); }

/* ---------- the glitch ----------
   One username, two names. At rest it is plain text; for a beat (.on) the red and cyan copies
   slip sideways and the letters jitter, then it snaps back. */
.glitch { position: relative; display: inline-block; }
.glitch.on { animation: jitter .12s steps(2) infinite; }
.glitch.on::before, .glitch.on::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none; overflow: hidden;
  box-sizing: border-box; padding: inherit; border: inherit; border-color: transparent;   /* sit exactly on the text */
}
.glitch.on::before { color: #8a8a8a; transform: translate(-3px, -1px); clip-path: inset(0 0 55% 0); mix-blend-mode: screen; }
.glitch.on::after  { color: #ffffff; transform: translate(3px, 1px);  clip-path: inset(45% 0 0 0); mix-blend-mode: screen; }
@keyframes jitter { 0% { transform: translate(0, 0) skewX(0); } 50% { transform: translate(1px, -1px) skewX(-6deg); } 100% { transform: translate(-1px, 1px) skewX(4deg); } }
.pill.glitchy { border-color: var(--text); text-shadow: 2px 0 rgba(255,255,255,0.55), -2px 0 rgba(255,255,255,0.3); }

/* ---------- the flip ----------
   Several owned names: the current one rolls up and out, the next rolls in from below. */
.flip { position: relative; display: inline-grid; overflow: hidden; vertical-align: bottom; }
.flip .flip-in { grid-area: 1 / 1; display: inline-block; transition: transform .55s cubic-bezier(.16,1,.3,1), opacity .4s; }
.flip .flip-in.enter { transform: translateY(110%); opacity: 0; }
.flip .flip-in.leave { animation: flipOut .5s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes flipOut { to { transform: translateY(-110%); opacity: 0; } }

/* ---------- search hub ----------
   One search over everything. The title scrolls away; the bar with the search, tabs and
   filters sticks under the nav so a new search is never more than a glance up. */
.hub-head { padding: 64px 0 18px; text-align: center; }
.hub-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 5.6vw, 4.2rem); letter-spacing: -2px; line-height: 1; margin-top: 16px; }
.hub-head h1 .dim { color: var(--muted); font-weight: 600; }

.hub-bar { position: sticky; top: 74px; z-index: 60; padding: 10px 0 12px; transition: box-shadow .25s, background .25s; }
.hub-bar.stuck { background: var(--bg); border-bottom: 1px solid var(--line); }
.hub-search {
  display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding: 6px 12px 6px 18px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  transition: border-color .15s, box-shadow .15s, transform .25s;
}
.hub-search:focus-within { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); color: var(--text); }
.hub-search input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 1.15rem; padding: 12px 0; min-width: 0; }
.hub-search input::-webkit-search-cancel-button { display: none; }
.hub-search kbd { font: 600 0.75rem var(--body); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.hub-search .clear { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.hub-search .clear:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.hub-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.hub-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: transparent; flex: none; }
.htab { padding: 9px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 600; cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
.htab:hover { color: var(--text); }
.htab.active, .htab.active:hover { background: var(--text); color: var(--bg); }
.hub-filters, .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; padding: 2px; }
.scroll-x::-webkit-scrollbar { display: none; }
.chips { margin: 0 0 14px; }
.chip-f { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; transition: border-color .15s, color .15s, background .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.chip-f:hover { color: var(--text); border-color: var(--text); }
.chip-f.active { border-color: var(--text); color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--text); }
.chip-f i { width: 8px; height: 8px; border-radius: 50%; background: var(--src, var(--muted)); display: inline-block; }
.src-mangadex { --src: #ffffff; } .src-openlibrary { --src: #ffffff; } .src-gutenberg { --src: #ffffff; }
.hub { padding: 26px 0 140px; }
.hub-status { color: var(--muted); text-align: center; margin-bottom: 22px; min-height: 1.4em; }
.hub-status b { color: var(--text); }
.dot { opacity: .45; padding: 0 2px; }
.lnk { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* discover: the empty state */
.disc-row { margin: 10px 0 34px; }
.disc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.disc-head h2 { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.2px; }
.src-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.src-tile { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, transform .25s; }
.src-tile:hover { border-color: var(--text); transform: translateY(-2px); }
.src-tile b { display: block; font-family: var(--display); font-weight: 700; font-size: 0.95rem; }
.src-tile span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.src-tile em { font-style: normal; font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 0.85rem; }
.ext-icon.small { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.how-step { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 0.92rem; }
.how-step b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-family: var(--display); font-size: 0.8rem; }

/* book results */
.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.bk { position: relative; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s cubic-bezier(.16,1,.3,1), border-color .2s, box-shadow .3s; }
.bk:hover { transform: translateY(-5px); border-color: var(--text); }
.bk-cover { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--surface-2); overflow: hidden; }
.bk-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.bk:hover .bk-cover img { transform: scale(1.04); }
.bk-cover::after { content: none; }
.bk-nocover { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }
.bk-badge { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--bg); font-family: var(--display); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: #ffffff; }
.bk-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--src, var(--accent)); }
.bk-status { position: absolute; right: 10px; top: 10px; z-index: 1; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 0.68rem; text-transform: capitalize; }
.bk-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bk h3 { font-family: var(--display); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.2px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-author { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.bk-tags span { font-size: 0.72rem; color: var(--muted); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.bk .btn { margin-top: auto; justify-content: center; padding: 9px 14px; font-size: 0.85rem; }
.bk.skel { pointer-events: none; }
.bk.skel .bk-cover, .bk.skel i { background: rgba(255,255,255,0.14); animation: shimmer 1.4s ease-in-out infinite; }
.bk.skel i { display: block; height: 12px; border-radius: 6px; margin: 4px 0; }
.bk.skel i.short { width: 55%; }

/* extension cards */
.ext-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ext { display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: transparent; }
.ext.pending { opacity: .7; border-style: dashed; }
.ext.have { border-color: var(--text); }
.ext-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.3rem; background: var(--text); color: var(--bg); overflow: hidden; }
.ext-icon img { width: 100%; height: 100%; object-fit: cover; }
.ext-cat { font-family: var(--display); color: var(--accent); font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; }
.ext h3 { font-family: var(--display); font-size: 1.05rem; font-weight: 700; margin-top: 2px; }
.ext h3 small { color: var(--muted); font-weight: 500; font-size: 0.75rem; margin-left: 6px; }
.ext p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.ext-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
.ext-meta a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ext .btn { padding: 9px 16px; font-size: 0.85rem; }
.submit { margin-top: 40px; }
.form.two-col { grid-template-columns: 1fr 1fr; }
.form .span { grid-column: 1 / -1; }
.form select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; font-size: 1rem; }

/* rankings */
.rank-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.rank-grid > * { min-width: 0; }
.rank-list { list-style: none; margin-top: 14px; display: grid; gap: 6px; }
.rank-list li { padding: 10px 10px 8px; border-radius: 14px; transition: background .15s; }
.rank-list li:hover { box-shadow: inset 0 0 0 1px var(--line); }
.rk { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.rk-body b { display: block; font-family: var(--display); font-weight: 700; font-size: 0.95rem; }
.rk-body span { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 1px; }
.rk-nums { display: flex; gap: 14px; font-family: var(--display); font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.rk-nums small { color: var(--muted); font-weight: 500; font-size: 0.7rem; }
.rk-nums .up { color: var(--text); }
.rk-bar { height: 3px; border-radius: 0; background: var(--line); margin: 8px 0 0 46px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; background: var(--text); }
.medal, .pos { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 0.85rem; }
.pos { color: var(--muted); }
.medal.m1 { background: var(--text); color: var(--bg); }
.medal.m2 { border: 3px solid var(--text); color: var(--text); }
.medal.m3 { border: 1px solid var(--text); color: var(--text); }

/* achievements: plain rows, tinted by tier: the name, how to earn it, and either the unlock
   date or a progress bar. Locked ones sit dim. */
.ach-card { grid-column: 1 / -1; }
.ach-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.ach-head .card-eyebrow { margin-bottom: 4px; }
.ach-summary { font-family: var(--display); font-size: 1.1rem; }
.ach-summary b { font-weight: 800; }
.ach-total { flex: 1; max-width: 320px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-bottom: 6px; }
.ach-total i { display: block; height: 100%; width: 0; background: var(--text); transition: width .8s cubic-bezier(.16,1,.3,1); }
.ach-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ach {
  position: relative; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  padding: 14px 16px 14px 20px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--bg); overflow: hidden;
  transition: transform .25s cubic-bezier(.16,1,.3,1), border-color .2s;
}
.ach:hover { transform: translateY(-2px); border-color: var(--text); }
.ach::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--tier-a); opacity: 0; transition: opacity .2s; }
.ach.on::before { opacity: 1; }
.ach-body { min-width: 0; }
.ach-name { font-family: var(--display); font-weight: 800; font-size: 1.02rem; letter-spacing: -0.2px; }
.ach-desc { color: var(--muted); font-size: 0.86rem; margin-top: 2px; }
.ach-when { color: var(--muted); font-size: 0.76rem; margin-top: 6px; font-family: var(--display); letter-spacing: .3px; }
.ach.on .ach-when { color: var(--tier-a); }
.ach-prog { height: 4px; border-radius: 2px; background: var(--line); margin-top: 8px; overflow: hidden; }
.ach-prog i { display: block; height: 100%; background: var(--accent); }
.ach-check { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--tier-a); color: var(--tier-ink); font-weight: 800; font-size: 0.85rem; }
.ach.bronze { --tier-a: #ffffff; --tier-b: #ffffff; --tier-ink: #000000; }
.ach.silver { --tier-a: #ffffff; --tier-b: #ffffff; --tier-ink: #000000; }
.ach.gold   { --tier-a: #ffffff; --tier-b: #ffffff; --tier-ink: #000000; }
.ach:not(.on) { opacity: .6; }
.ach:not(.on):hover { opacity: .85; }
.my-ext .own-row small { margin-left: 8px; }

/* ---------- profile picture ---------- */
.avatar-btn { position: relative; border: 0; background: none; padding: 0; cursor: pointer; border-radius: 50%; }
.avatar { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; overflow: hidden; font-family: var(--display); font-weight: 800; font-size: 1.7rem; background: var(--text); color: var(--bg); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar-edit { position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--bg-rgb),0.62); color: #ffffff; font-family: var(--display); font-size: 0.72rem; font-weight: 700; letter-spacing: .5px; opacity: 0; transition: opacity .15s; }
.avatar-btn:hover .avatar-edit, .avatar-btn:focus-visible .avatar-edit { opacity: 1; }
.linkish.inline { display: inline; padding: 0; font-size: inherit; }
.chip-face { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; margin-right: 2px; }
.chip-face + .chip-coin { display: none; }   /* the face stands in for the coin */
/* the picture's hover: "Change picture", and under it a separate Remove button */
.avatar-wrap { position: relative; }
.avatar-remove { position: absolute; left: 50%; top: calc(50% + 14px); transform: translateX(-50%); padding: 5px 10px; border-radius: 4px; border: 1px solid var(--text); background: var(--bg); color: var(--text); font-family: var(--display); font-size: 11px; font-weight: 700; letter-spacing: .5px; white-space: nowrap; cursor: pointer; opacity: 0; pointer-events: none; transition: opacity .15s, background .15s; }
.avatar-remove:hover, .avatar-remove:focus-visible { background: var(--text); color: var(--bg); }
.avatar-wrap:hover .avatar-remove, .avatar-wrap:focus-within .avatar-remove { opacity: 1; pointer-events: auto; }
.avatar-wrap:hover .avatar-edit, .avatar-wrap:focus-within .avatar-edit { opacity: 1; }
.avatar-wrap.can-remove .avatar-edit { padding-bottom: 34px; box-sizing: border-box; }
@media (hover: none) {   /* no hover on a phone: the Remove button sits on the picture's foot */
  .avatar-remove { top: auto; bottom: 10px; opacity: 1; pointer-events: auto; }
}
.me-email .dot { opacity: .4; }

/* ---------- the flip ----------
   Several owned names: the current one rolls up and out, the next rolls in from below. */
.flip { position: relative; display: inline-grid; overflow: hidden; vertical-align: bottom; }
.flip .flip-in { grid-area: 1 / 1; display: inline-block; transition: transform .55s cubic-bezier(.16,1,.3,1), opacity .4s; }
.flip .flip-in.enter { transform: translateY(110%); opacity: 0; }
.flip .flip-in.leave { animation: flipOut .5s cubic-bezier(.4,0,.2,1) forwards; }
@keyframes flipOut { to { transform: translateY(-110%); opacity: 0; } }

/* ---------- search hub ----------
   One search over everything. The title scrolls away; the bar with the search, tabs and
   filters sticks under the nav so a new search is never more than a glance up. */
.hub-head { padding: 64px 0 18px; text-align: center; }
.hub-head h1 { font-family: var(--display); font-weight: 800; font-size: clamp(2.2rem, 5.6vw, 4.2rem); letter-spacing: -2px; line-height: 1; margin-top: 16px; }
.hub-head h1 .dim { color: var(--muted); font-weight: 600; }

.hub-bar { position: sticky; top: 74px; z-index: 60; padding: 10px 0 12px; transition: box-shadow .25s, background .25s; }
.hub-bar.stuck { background: var(--bg); border-bottom: 1px solid var(--line); }
.hub-search {
  display: flex; align-items: center; gap: 12px; max-width: 760px; margin: 0 auto; padding: 6px 12px 6px 18px;
  border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted);
  transition: border-color .15s, box-shadow .15s, transform .25s;
}
.hub-search:focus-within { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); color: var(--text); }
.hub-search input { flex: 1; background: none; border: 0; outline: none; color: var(--text); font: inherit; font-size: 1.15rem; padding: 12px 0; min-width: 0; }
.hub-search input::-webkit-search-cancel-button { display: none; }
.hub-search kbd { font: 600 0.75rem var(--body); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
.hub-search .clear { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--text); font-size: 1.1rem; cursor: pointer; line-height: 1; }
.hub-search .clear:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.hub-row { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 12px; flex-wrap: wrap; }
.hub-tabs { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: transparent; flex: none; }
.htab { padding: 9px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--muted); font-family: var(--display); font-weight: 600; cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
.htab:hover { color: var(--text); }
.htab.active, .htab.active:hover { background: var(--text); color: var(--bg); }
.hub-filters, .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.scroll-x { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; padding: 2px; }
.scroll-x::-webkit-scrollbar { display: none; }
.chips { margin: 0 0 14px; }
.chip-f { padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 0.85rem; cursor: pointer; transition: border-color .15s, color .15s, background .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px; }
.chip-f:hover { color: var(--text); border-color: var(--text); }
.chip-f.active { border-color: var(--text); color: var(--text); background: transparent; box-shadow: inset 0 0 0 1px var(--text); }
.chip-f i { width: 8px; height: 8px; border-radius: 50%; background: var(--src, var(--muted)); display: inline-block; }
.src-mangadex { --src: #ffffff; } .src-openlibrary { --src: #ffffff; } .src-gutenberg { --src: #ffffff; }
.hub { padding: 26px 0 140px; }
.hub-status { color: var(--muted); text-align: center; margin-bottom: 22px; min-height: 1.4em; }
.hub-status b { color: var(--text); }
.dot { opacity: .45; padding: 0 2px; }
.lnk { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* discover: the empty state */
.disc-row { margin: 10px 0 34px; }
.disc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.disc-head h2 { font-family: var(--display); font-weight: 700; font-size: 1.05rem; letter-spacing: -0.2px; }
.src-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.src-tile { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; transition: border-color .15s, transform .25s; }
.src-tile:hover { border-color: var(--text); transform: translateY(-2px); }
.src-tile b { display: block; font-family: var(--display); font-weight: 700; font-size: 0.95rem; }
.src-tile span { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.src-tile em { font-style: normal; font-family: var(--display); font-weight: 700; color: var(--accent); font-size: 0.85rem; }
.ext-icon.small { width: 40px; height: 40px; border-radius: 12px; font-size: 1rem; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.how-step { display: flex; gap: 12px; align-items: flex-start; color: var(--muted); font-size: 0.92rem; }
.how-step b { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--text); color: var(--bg); font-family: var(--display); font-size: 0.8rem; }

/* book results */
.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.bk { position: relative; border-radius: 18px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; display: flex; flex-direction: column; transition: transform .3s cubic-bezier(.16,1,.3,1), border-color .2s, box-shadow .3s; }
.bk:hover { transform: translateY(-5px); border-color: var(--text); }
.bk-cover { position: relative; display: block; aspect-ratio: 3 / 4; background: var(--surface-2); overflow: hidden; }
.bk-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.16,1,.3,1); }
.bk:hover .bk-cover img { transform: scale(1.04); }
.bk-cover::after { content: none; }
.bk-nocover { height: 100%; display: grid; place-items: center; color: var(--muted); font-size: 0.85rem; }
.bk-badge { position: absolute; left: 10px; bottom: 10px; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border-radius: 999px; background: var(--bg); font-family: var(--display); font-size: 0.68rem; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase; color: #ffffff; }
.bk-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--src, var(--accent)); }
.bk-status { position: absolute; right: 10px; top: 10px; z-index: 1; padding: 3px 8px; border-radius: 999px; background: var(--bg); color: var(--muted); font-size: 0.68rem; text-transform: capitalize; }
.bk-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.bk h3 { font-family: var(--display); font-size: 1.02rem; font-weight: 700; letter-spacing: -0.2px; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bk-author { color: var(--muted); font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.bk-tags span { font-size: 0.72rem; color: var(--muted); padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); }
.bk .btn { margin-top: auto; justify-content: center; padding: 9px 14px; font-size: 0.85rem; }
.bk.skel { pointer-events: none; }
.bk.skel .bk-cover, .bk.skel i { background: rgba(255,255,255,0.14); animation: shimmer 1.4s ease-in-out infinite; }
.bk.skel i { display: block; height: 12px; border-radius: 6px; margin: 4px 0; }
.bk.skel i.short { width: 55%; }

/* extension cards */
.ext-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.ext { display: grid; grid-template-columns: 52px 1fr auto; gap: 16px; align-items: center; padding: 18px; border-radius: 18px; border: 1px solid var(--line); background: transparent; }
.ext.pending { opacity: .7; border-style: dashed; }
.ext.have { border-color: var(--text); }
.ext-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 1.3rem; background: var(--text); color: var(--bg); overflow: hidden; }
.ext-icon img { width: 100%; height: 100%; object-fit: cover; }
.ext-cat { font-family: var(--display); color: var(--accent); font-size: 0.7rem; letter-spacing: 1.5px; text-transform: uppercase; }
.ext h3 { font-family: var(--display); font-size: 1.05rem; font-weight: 700; margin-top: 2px; }
.ext h3 small { color: var(--muted); font-weight: 500; font-size: 0.75rem; margin-left: 6px; }
.ext p { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }
.ext-meta { display: flex; gap: 14px; margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
.ext-meta a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.ext .btn { padding: 9px 16px; font-size: 0.85rem; }
.submit { margin-top: 40px; }
.form.two-col { grid-template-columns: 1fr 1fr; }
.form .span { grid-column: 1 / -1; }
.form select { width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--field); color: var(--text); font: inherit; font-size: 1rem; }

/* rankings */
.rank-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.rank-grid > * { min-width: 0; }
.rank-list { list-style: none; margin-top: 14px; display: grid; gap: 6px; }
.rank-list li { padding: 10px 10px 8px; border-radius: 14px; transition: background .15s; }
.rank-list li:hover { box-shadow: inset 0 0 0 1px var(--line); }
.rk { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; }
.rk-body b { display: block; font-family: var(--display); font-weight: 700; font-size: 0.95rem; }
.rk-body span { display: block; color: var(--muted); font-size: 0.76rem; margin-top: 1px; }
.rk-nums { display: flex; gap: 14px; font-family: var(--display); font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.rk-nums small { color: var(--muted); font-weight: 500; font-size: 0.7rem; }
.rk-nums .up { color: var(--text); }
.rk-bar { height: 3px; border-radius: 0; background: var(--line); margin: 8px 0 0 46px; overflow: hidden; }
.rk-bar i { display: block; height: 100%; background: var(--text); }
.medal, .pos { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 0.85rem; }
.pos { color: var(--muted); }
.medal.m1 { background: var(--text); color: var(--bg); }
.medal.m2 { border: 3px solid var(--text); color: var(--text); }
.medal.m3 { border: 1px solid var(--text); color: var(--text); }

/* ---------- toast ---------- */
#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 300; opacity: 0; pointer-events: none;
  padding: 12px 20px; border-radius: 999px; background: var(--surface); border: 1px solid var(--text); color: var(--text); font-size: 0.92rem; transition: opacity .25s, transform .25s;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
/* a refusal is the same slip turned over: white paper, black ink */
#toast.bad { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }

/* ---------- coin flight after a purchase ---------- */
.coin-fly { --s: 36px; position: fixed; z-index: 250; pointer-events: none; animation: coinX .25s steps(8) infinite, coinY 2s steps(8) infinite, fly var(--d) cubic-bezier(.2,.8,.3,1) forwards; }
@keyframes fly { 60% { opacity: 1; } to { translate: var(--dx) var(--dy); opacity: 0; } }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .results { grid-template-columns: repeat(3, 1fr); }
  .ext-grid, .rank-grid { grid-template-columns: 1fr; }
  .src-tiles, .how { grid-template-columns: 1fr; }
  .hub-row { justify-content: flex-start; }
  .hub-bar { top: 74px; }
  .ach-grid { grid-template-columns: 1fr; }
  .pack-grid { grid-template-columns: repeat(2, 1fr); }
  .pack { --pmax: min(290px, 40vw); }
  .me-cols { columns: 2; }
  .spend-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .store-head-grid, .auth-grid { grid-template-columns: 1fr; }
  .store-hero-art { order: -1; min-height: 260px; }
  .coin-hero { width: min(300px, 76vw); }
  .me-cols { columns: 1; }
  .wallet { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .results { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .bk-body { padding: 10px 12px 12px; }
  .bk h3 { font-size: 0.92rem; }
  .bk-tags { display: none; }
  .hub-search kbd { display: none; }
  .hub-search input { font-size: 1rem; }
  .hub-head { padding-top: 40px; }
  .form.two-col { grid-template-columns: 1fr; }
  .ext { grid-template-columns: 44px 1fr; }
  .ext .btn { grid-column: 1 / -1; justify-content: center; }
  .pack-grid { grid-template-columns: 1fr; }
  .pack { --pmax: min(290px, 76vw); }
  .chip-name { display: none; }
}

/* ---------- Mimic Plus ---------- */
.card.plus { grid-column: 1 / -1; display: grid; grid-template-columns: 300px 1fr; gap: 12px 40px; align-items: start; }
.card.plus .card-eyebrow { grid-column: 1 / -1; }
.plus-side { display: grid; justify-items: start; gap: 8px; }
.plus-price { font-family: var(--display); font-weight: 800; font-size: 3rem; letter-spacing: -2px; line-height: 1; display: flex; align-items: baseline; gap: 10px; }
.plus-price small { font-size: 1rem; color: var(--muted); letter-spacing: 0; font-weight: 600; }
.plus-line { color: var(--muted); font-size: 0.92rem; max-width: 300px; }
.plus-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.plus-actions .hint { flex-basis: 100%; }
.plus-ladder-wrap .hint { margin-top: 18px; }
.ladder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0; position: relative; padding-top: 6px; }
.ladder::before { content: ""; position: absolute; left: 8%; right: 8%; top: 13px; height: 1px; background: var(--line); }
.rung { position: relative; display: grid; justify-items: center; gap: 6px; text-align: center; }
.rung i { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--text); background: var(--bg); position: relative; z-index: 1; }
.rung b { font-family: var(--display); font-weight: 700; font-size: 0.95rem; letter-spacing: -0.3px; }
.rung span { color: var(--muted); font-size: 0.78rem; }
.rung.done i { border-color: var(--accent); background: var(--accent); }
.rung.now i { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--text); }
.rung.now b { color: var(--accent); }
.rung:last-child b { color: var(--text); }
.ladder.big { max-width: 900px; margin: 0 auto 36px; padding-top: 10px; }
.ladder.big::before { top: 21px; }
.ladder.big .rung i { width: 24px; height: 24px; }
.ladder.big .rung b { font-size: 1.5rem; letter-spacing: -0.6px; }
.ladder.big .rung span { font-size: 0.85rem; }
.ladder.big .rung.reveal { transition-delay: calc(var(--i) * 90ms); }
.plus-sec { padding: 60px 0 40px; }
.plus-cta { text-align: center; display: grid; justify-items: center; gap: 14px; }
.plus-cta .hint { max-width: 520px; }
@media (max-width: 860px) {
  .card.plus { grid-template-columns: 1fr; }
  .ladder { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 22px; }
  .ladder::before { display: none; }
}

/* ---------- notes (the server's words) + loyalty ---------- */
.note { margin: 6px 0 4px; padding: 14px 16px; border-radius: 0; border: 1px solid var(--line); border-left: 3px solid var(--text); background: transparent; max-width: 300px; }
.note b { display: block; font-family: var(--display); font-size: 0.98rem; letter-spacing: -0.2px; margin-bottom: 6px; }
.note p { color: var(--text); opacity: .85; font-size: 0.9rem; line-height: 1.5; }
.loyalty { display: grid; gap: 6px; margin: -4px 0 14px; width: 100%; max-width: 300px; }
.loyalty-level { display: flex; align-items: baseline; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.05rem; }
.loyalty-level small { color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.loyalty-bar { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.loyalty-bar i { display: block; height: 100%; background: var(--accent); border-radius: 999px; transition: width .6s ease; }

/* ---------- Be a Tanukanire ---------- */
#card-tanukanire { display: grid; gap: 14px; }
.tk-note { max-width: none; }
.tk-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 300px; }
.tk-cell { cursor: url(assets/coin/tr-coin-cursor.png?v=m1) 10 38, pointer; position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; overflow: hidden; padding: 0; transition: transform .15s ease; }
.tk-cell::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(135deg, var(--text) 0 2px, var(--bg) 2px 9px); transition: opacity .35s ease, transform .35s ease; }
.tk-cell span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; opacity: 0; transform: scale(.6); transition: opacity .35s ease, transform .35s ease; }
.tk-cell:hover { transform: translateY(-2px); }
.tk-cell.open { cursor: default; }
.tk-cell.open::after { opacity: 0; transform: translateY(-100%) rotate(-8deg); }
.tk-cell.open span { opacity: 1; transform: scale(1); }
.tk-cell.win { border-color: var(--text); box-shadow: 0 0 0 2px var(--text); }
.tk-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.tk-odds summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }
.tk-odds[open] summary { margin-bottom: 8px; }
.tk-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 8px 0; }
.tk-table th { text-align: left; color: var(--muted); font-weight: 500; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.tk-table td { padding: 5px 6px; border-bottom: 1px solid var(--line); }

/* ---------- picture crop editor (account) ----------
   The picture is always shown as a circle, so the stage darkens everything outside one: the
   ring's own box-shadow spreads the shade out to the stage edge, which clips it. The JS reads the
   ring's box for its maths, so its size lives here only. */
html.crop-open, html.crop-open body { overflow: hidden; overscroll-behavior: none; }
.crop {
  position: fixed; inset: 0; z-index: 280; display: grid; place-items: center; padding: 16px;
  background: rgba(0,0,0,0.88);
  overscroll-behavior: contain; animation: crop-fade .18s ease-out;
}
.crop[hidden] { display: none; }
.crop-sheet {
  width: min(400px, 100%); display: grid; justify-items: center; gap: 16px; padding: 24px;
  border-radius: 22px; border: 1px solid var(--text); background: var(--bg); animation: crop-rise .22s cubic-bezier(.2,.8,.3,1);
}
.crop-head { justify-self: stretch; }
.crop-head .card-eyebrow { margin-bottom: 4px; }
.crop-head h2 { font-family: var(--display); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.3px; }
.crop-stage {
  position: relative; width: min(340px, calc(100vw - 64px)); aspect-ratio: 1; border-radius: 16px; overflow: hidden;
  background: var(--bg); touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  cursor: grab; outline: none;
}
.crop-stage.dragging { cursor: grabbing; }
.crop-stage:focus-visible:not(.by-pointer) { box-shadow: 0 0 0 2px var(--text); }
.crop-stage img {
  position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; background: #ffffff;  /* a transparent png saves on white, so preview it on white */
  pointer-events: none; -webkit-user-drag: none; user-select: none;
}
.crop-ring {
  position: absolute; inset: 7%; border-radius: 50%; pointer-events: none;
  box-shadow: 0 0 0 1.5px #ffffff, 0 0 0 999px rgba(0,0,0,0.6);
}
.crop-zoom { display: flex; align-items: center; gap: 12px; width: min(340px, calc(100vw - 64px)); color: var(--muted); }
.crop-zoom svg { flex: none; width: 18px; height: 18px; }
.crop-zoom svg.big { width: 24px; height: 24px; }
.crop-zoom input {
  flex: 1; min-width: 0; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer;
  --pct: 0%;
}
.crop-zoom input::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--pct), var(--line) var(--pct)); }
.crop-zoom input::-moz-range-track { height: 4px; border-radius: 999px; background: var(--line); }
.crop-zoom input::-moz-range-progress { height: 4px; border-radius: 999px; background: var(--accent); }
.crop-zoom input::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; border: 0; background: var(--text); }
.crop-zoom input::-moz-range-thumb { width: 20px; height: 20px; border-radius: 50%; border: 0; background: var(--text); }
.crop-zoom input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--text); }
.crop-zoom input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--text); }
.crop-hint { margin-top: -8px; font-size: 0.82rem; text-align: center; }
.crop-actions { justify-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.crop-actions .btn { justify-content: center; }
@keyframes crop-fade { from { opacity: 0; } }
@keyframes crop-rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }
@media (max-width: 560px) {
  /* a bottom sheet on phones: the buttons sit under the thumb */
  .crop { place-items: end center; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); }
  .crop-sheet { padding: 16px; gap: 14px; }
  .crop-head h2 { font-size: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) { .crop, .crop-sheet { animation: none; } }

/* ---------- the reader sheet (account page) ----------
   A character sheet: calm, dark, one leaf-green, numbers that read at a glance. Three columns
   on a desk, one under the other on a phone. */
.sheet { --leaf: #ffffff; --leaf-ink: #ffffff; --leaf-dim: rgba(255,255,255,0.12); --leaf-line: rgba(255,255,255,0.28);
  display: grid; grid-template-columns: 300px minmax(0, 1fr) 320px; gap: 18px; margin-bottom: 34px; align-items: start; }
.sheet-col { display: grid; gap: 18px; min-width: 0; }
.panel { background: var(--bg); border: 1px solid var(--line); border-radius: 16px; padding: 16px 20px; }
.panel-title { font-family: var(--display); font-weight: 700; font-size: 0.8rem; letter-spacing: .4px; text-transform: uppercase; color: var(--leaf-ink); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.panel-title b { color: #ffffff; font-weight: 800; }
.xp .panel-title { text-transform: none; font-size: 0.86rem; }
.xp .panel-title b { font-size: 1.5rem; letter-spacing: -0.5px; margin-left: 2px; }
/* the portrait */
.portrait-panel { padding: 14px; display: grid; gap: 14px; }
.lvl { display: inline-flex; align-items: center; gap: 8px; align-self: start; justify-self: start; padding: 7px 12px 7px 10px; border-radius: 10px; background: var(--leaf-dim); border: 1px solid var(--leaf-line); color: var(--leaf-ink); font-family: var(--display); font-weight: 800; letter-spacing: 2px; font-size: 0.74rem; }
.lvl b { color: #ffffff; font-size: 0.9rem; letter-spacing: 0; }
.lvl-chev { color: var(--leaf); font-size: 1rem; line-height: 1; }
.portrait { display: block; width: 100%; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; border: 1px solid var(--leaf-line); }
.portrait .avatar { width: 100%; height: 100%; border-radius: 0; font-size: clamp(3rem, 9vw, 5rem);
  background: var(--bg); color: #ffffff; }
.portrait .avatar-edit { border-radius: 0; font-size: 0.8rem; }
.portrait-panel .me-name { font-size: clamp(1.3rem, 2.4vw, 1.6rem); margin-top: 2px; }
.portrait-panel .me-email { font-size: 0.82rem; }
/* today's energy rows */
.rows { display: grid; gap: 8px; }
.rows .row { display: grid; grid-template-columns: 26px auto 1fr; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 10px; background: transparent; border: 1px solid var(--line); font-size: 0.9rem; }
.rows .ico { display: grid; place-items: center; }
.rows .ico svg { width: 18px; height: 18px; fill: none; stroke: var(--leaf-ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rows .k { color: var(--muted); }
.rows b { font-family: var(--display); text-align: right; font-variant-numeric: tabular-nums; }
/* the radar */
.radar-panel { padding: 10px 10px 14px; display: grid; justify-items: center; }
#radar { width: 100%; max-width: 420px; height: auto; display: block; }
#radar .ring { fill: none; stroke: rgba(255,255,255,0.18); stroke-width: 1; }
#radar .ring.outer { stroke: var(--leaf); stroke-opacity: .55; stroke-width: 1.2; }
#radar .spoke { stroke: rgba(255,255,255,0.14); stroke-width: 1; }
#radar .shape { fill: rgba(255,255,255,0.26); stroke: var(--leaf-ink); stroke-width: 1.8; stroke-linejoin: round; }
#radar .dot { fill: #ffffff; stroke: var(--leaf); stroke-width: 1.5; }
#radar .lbl { fill: var(--muted); font-family: var(--display); font-size: 11px; letter-spacing: .4px; }
#radar .val { fill: #ffffff; font-family: var(--display); font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.radar-cap { color: var(--muted); font-size: 0.72rem; letter-spacing: .3px; }
.arc .arc-flag { color: var(--leaf); font-size: 0.7rem; }
.arc-name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; margin-bottom: 6px; }
.arc-line { color: var(--muted); font-size: 0.9rem; line-height: 1.5; font-style: italic; }
/* xp, streaks, the table */
.xp-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 2px 0 10px; }
.xp-bar i { display: block; height: 100%; width: 0; background: var(--text); transition: width .9s cubic-bezier(.16,1,.3,1); }
.xp-line { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.xp-line b { color: var(--leaf-ink); font-style: normal; }
.streaks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.streak { padding: 12px 14px; border-radius: 12px; background: var(--leaf-dim); border: 1px solid var(--leaf-line); }
.streak b { display: block; font-family: var(--display); font-size: 1.5rem; letter-spacing: -0.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.streak span { color: var(--muted); font-size: 0.78rem; }
.stat-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.stat-table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 0.72rem; letter-spacing: 1px; text-transform: uppercase; padding: 0 0 8px; }
.stat-table td { padding: 7px 0; border-top: 1px solid rgba(255,255,255,0.05); }
.stat-table td.pts { font-family: var(--display); font-weight: 700; width: 64px; font-variant-numeric: tabular-nums; }
.stat-table td.bar { width: 42%; }
.stat-table td.bar i { display: block; height: 6px; border-radius: 3px; background: var(--text); }
.sheet .btn.wide { margin-top: 2px; }
@media (max-width: 1100px) { .sheet { grid-template-columns: 260px minmax(0, 1fr); } .sheet-right { grid-column: 1 / -1; grid-template-columns: 1fr 1fr 1fr; align-items: start; } .sheet-right .btn { grid-column: 1 / -1; } }
@media (max-width: 760px) { .sheet { grid-template-columns: minmax(0, 1fr); } .sheet-right { grid-template-columns: 1fr; } .portrait { max-width: 320px; margin: 0 auto; } }

/* ---------- the account page, flat ----------
   One colour-way, the app's cut paper: the black field (--bg), black panels drawn with a hairline,
   white ink, dimmed white for labels, white bars. Titled
   boxes with a header strip, dense tables, one section at a time; no gradients, no glow, no
   grain, no reveal animation. Every padding and gap is on an 8-point rhythm (4 for half steps). */
body.flat { background: var(--bg); color: #ffffff; }
body.flat::after, body.flat .spotlight-grid { display: none; }
body.flat nav.scrolled { background: var(--surface); border-bottom-color: var(--line); }
body.flat .nav-links a { color: rgba(255,255,255,0.72); } body.flat .nav-links a:hover, body.flat .nav-links a.active { color: #ffffff; }
body.flat .chip { border-color: var(--line); background: transparent; }
body.flat .chip:hover { border-color: var(--text); }
body.flat footer { border-top: 1px solid var(--line); color: rgba(255,255,255,0.7); }
body.flat .me, body.flat .auth { padding: 0; }
.acct {
  --sl-box: var(--surface); --sl-head: var(--surface-2); --sl-field: var(--field);
  --sl-line: var(--line); --sl-row: rgba(255,255,255,0.14); --sl-track: rgba(255,255,255,0.22);
  --sl-ink: #ffffff; --sl-dim: rgba(255,255,255,0.72); --sl-label: rgba(255,255,255,0.72); --sl-bar: #ffffff; --sl-ok: #ffffff; --sl-warn: #ffffff; --sl-amber: #ffffff;
  max-width: 1280px; margin: 0 auto; padding: 32px 24px 96px; font-family: var(--body); font-size: 14px; line-height: 1.45; color: var(--sl-ink);
}
.acct-narrow { max-width: 440px; padding-top: 56px; }
.acct a { color: inherit; }
.acct .hint { color: var(--sl-dim); font-size: 13px; }
.acct .empty { padding: 16px; color: var(--sl-dim); font-size: 13px; }
.acct b, .acct .num { font-variant-numeric: tabular-nums; }

/* tabs */
.sec-tabs { display: flex; gap: 2px; margin-bottom: 20px; border-bottom: 1px solid var(--sl-line); overflow-x: auto; scrollbar-width: none; }
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tab { flex: none; margin-bottom: -1px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--sl-dim); font: inherit; font-weight: 500; cursor: pointer; white-space: nowrap; }
.sec-tab:hover { color: var(--sl-ink); }
.sec-tab.active { color: var(--sl-ink); border-bottom-color: var(--sl-bar); }
/* the last tab keeps the others' ink: its words are the warning, and it sits apart at the end */
.sec-tab-danger { margin-left: auto; }
.sec-tab-danger:hover, .sec-tab-danger.active { color: var(--sl-ink); border-bottom-color: var(--sl-bar); }
.sec-tab:focus-visible { outline: 2px solid var(--sl-bar); outline-offset: -2px; }

/* the two columns */
.acct-grid { display: grid; grid-template-columns: 248px minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.side { display: grid; gap: 20px; min-width: 0; }
.rail { position: sticky; top: 94px; }
.main { min-width: 0; }
.sec { display: none; gap: 20px; }
.sec.active { display: grid; }
.acct #card-tanukanire.sec { display: none; }
.acct #card-tanukanire.sec.active { display: grid; }

/* boxes */
.box { background: var(--sl-box); border: 1px solid var(--sl-line); border-radius: 6px; overflow: hidden; }
.box-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; padding: 8px 16px; background: var(--sl-head); border-bottom: 1px solid var(--sl-line); }
.box-h h1, .box-h h2 { font-family: var(--body); font-size: 13px; font-weight: 600; letter-spacing: .2px; margin: 0; }
.box-meta { color: var(--sl-label); font-size: 12px; text-align: right; }
.box-meta b { color: var(--sl-ink); }
.box-link { color: var(--sl-label); font-size: 12px; white-space: nowrap; }
.box-link:hover { color: var(--sl-ink); text-decoration: underline; }
.box-b { padding: 16px; }
.box-f { padding: 12px 16px; border-top: 1px solid var(--sl-row); }
.sub-h { margin: 16px 0 4px; color: var(--sl-label); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 8px 16px; text-align: left; color: var(--sl-label); font-size: 11px; font-weight: 600; letter-spacing: .6px; text-transform: uppercase; border-bottom: 1px solid var(--sl-row); }
.tbl td { padding: 9px 16px; border-top: 1px solid var(--sl-row); }
.tbl tr:first-child td { border-top: 0; }
.tbl .num { text-align: right; font-weight: 600; white-space: nowrap; }
.tbl .barcol { width: 40%; }
.tbl td.barcol i { display: block; height: 4px; border-radius: 2px; background: var(--sl-bar); min-width: 2px; }
.tbl td.empty { padding: 16px; }

/* lists: one row per thing, three columns (what, when, number) */
.list { display: grid; }
.lrow, .arow { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px 16px; align-items: center; padding: 10px 16px; border-top: 1px solid var(--sl-row); font-size: 13px; }
.list > :first-child { border-top: 0; }
.lrow-main, .arow-main { display: grid; min-width: 0; }
.lrow-title, .arow-name { font-weight: 600; }
.lrow-note, .arow-desc { color: var(--sl-dim); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow-when { color: var(--sl-dim); font-size: 12px; white-space: nowrap; }
.lrow-delta { min-width: 72px; text-align: right; font-weight: 600; white-space: nowrap; }
.lrow-delta.up { color: var(--sl-ok); } .lrow-delta.down { color: var(--sl-dim); }
.acct .pill { padding: 5px 10px; border-radius: 4px; border: 1px solid var(--sl-line); background: transparent; color: var(--sl-ink); font: inherit; font-size: 12px; cursor: pointer; }
.acct .pill:hover { border-color: #ffffff; background: #ffffff; color: #000000; }

/* achievements */
.arow { grid-template-columns: 10px minmax(0, 1fr) auto; }
.arow .tier { width: 8px; height: 8px; border-radius: 50%; background: var(--sl-line); }
.arow .tier { background: transparent; border: 1px solid var(--sl-line); box-sizing: border-box; }
.arow.on.bronze .tier { border: 2px solid #ffffff; } .arow.on.silver .tier { background: #ffffff; border-color: #ffffff; } .arow.on.gold .tier { background: #ffffff; border-color: #ffffff; border-radius: 0; transform: rotate(45deg); }
.arow:not(.on) .arow-name { color: var(--sl-dim); }
.arow-when { color: var(--sl-ok); font-size: 12px; white-space: nowrap; }
.arow-prog { display: grid; justify-items: end; gap: 4px; width: 128px; }
.arow-prog .num { color: var(--sl-dim); font-size: 12px; }
.arow-prog i { display: block; width: 100%; height: 4px; border-radius: 0; background: var(--sl-track); overflow: hidden; }
.arow-prog b { display: block; height: 100%; background: var(--sl-bar); }
.acct .ach-total { height: 4px; background: var(--sl-track); margin: 0; border-radius: 0; }
.acct .ach-total i { background: var(--sl-bar); transition: width .5s ease; }

/* the member card */
.member { padding: 16px; display: grid; gap: 8px; }
.member .avatar-wrap { justify-self: stretch; }
.member .avatar-btn { border-radius: 8px; justify-self: stretch; width: 100%; }
.member .avatar-edit { font-size: 12px; }
.member .portrait { width: 100%; aspect-ratio: 1; border-radius: 8px; border: 1px solid var(--sl-line); overflow: hidden; }
.member .portrait .avatar { width: 100%; height: 100%; border-radius: 0; background: var(--bg); color: #ffffff; font-family: var(--display); font-size: 5rem; font-weight: 700; letter-spacing: -2px; }
.member .portrait .avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.member .avatar-edit { border-radius: 0; font-size: 11px; }
.member-name { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -0.2px; margin-top: 4px; overflow-wrap: anywhere; }
.member-sub { color: var(--sl-dim); font-size: 12px; margin-top: -6px; overflow-wrap: anywhere; }
.member-level { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.lvl-pill { padding: 2px 7px; border-radius: 4px; border: 1px solid var(--sl-ink); background: transparent; color: var(--sl-ink); font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; }
.lvl-pill b { font-size: 12px; }
.xp-num { color: var(--sl-dim); font-size: 12px; } .xp-num b { color: var(--sl-ink); }
.member .xp-bar { height: 4px; border-radius: 0; background: var(--sl-track); margin: 0; overflow: hidden; }
.member .xp-bar i { display: block; height: 100%; background: var(--sl-bar); transition: width .6s ease; }
.member .xp-line { color: var(--sl-dim); font-size: 12px; font-style: normal; margin-top: -4px; }
.member .xp-line b { color: var(--sl-ink); }
.kv { display: grid; margin: 8px 0 0; border-top: 1px solid var(--sl-row); }
.kv > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--sl-row); font-size: 13px; }
.kv dt { color: var(--sl-label); }
.kv dd { margin: 0; font-weight: 600; text-align: right; }
.kv dd b { font-weight: 600; }
.acct .linkish { color: var(--sl-dim); font-size: 12px; justify-self: auto; }
.acct .linkish:hover { color: var(--sl-ink); text-decoration: underline; }

/* buttons, forms, chips */
.acct .btn { padding: 8px 14px; border-radius: 4px; font-family: var(--body); font-size: 13px; font-weight: 600; background: #ffffff; color: var(--on-accent); border-color: #ffffff; gap: 6px; }
.acct .btn.sm { padding: 5px 10px; font-size: 12px; }
.acct .btn-outline { background: transparent; color: var(--sl-ink); border-color: var(--sl-line); }
.acct .btn:hover { background: var(--bg); color: #ffffff; }
.acct .btn-outline:hover { border-color: #ffffff; background: transparent; }
.acct .form { gap: 12px; }
.acct .form label { grid-template-columns: auto 1fr; align-items: baseline; color: var(--sl-label); font-size: 12px; gap: 4px 6px; }
.acct .form label > input, .acct .form label > select { grid-column: 1 / -1; }
.acct .form label > small { margin: 0; justify-self: start; }
.acct .form label small { opacity: 1; color: var(--sl-dim); }
.acct .form input, .acct .form select { padding: 8px 10px; border-radius: 4px; border: 1px solid var(--sl-line); background: var(--sl-field); color: #ffffff; font-size: 14px; }
.acct .form input:focus, .acct .form select:focus { border-color: var(--sl-bar); box-shadow: 0 0 0 1px var(--sl-bar); outline: none; }
.acct .form input::placeholder { color: rgba(255,255,255,0.5); }
.acct .msg.bad { color: var(--sl-warn); } .acct .msg.good { color: var(--sl-ok); }
.acct .avail { font-size: 12px; } .acct .avail.ok { color: var(--sl-ok); } .acct .avail.no { color: var(--sl-warn); }
.gift-form { grid-template-columns: minmax(0, 1.2fr) minmax(0, .6fr) minmax(0, 1.4fr) auto; align-items: end; }
.gift-form .found { grid-column: 1 / -1; }
.gift-form .found:empty { display: none; }
.name-form { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.name-form .span { grid-column: 1 / -1; }
.name-form .avail:empty { display: none; }
.name-form label { grid-template-columns: auto 1fr; align-items: center; gap: 6px; font-size: 14px; color: var(--sl-dim); }
.acct .name-form label > input { grid-column: 2; }
.acct .big-name { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -0.4px; margin: 0; }
.acct .big-name + .hint { margin-top: 2px; }
.acct .own-row { padding: 8px 0; border-bottom: 1px solid var(--sl-row); font-size: 13px; }
.acct .own-row:not(.active) span { color: var(--sl-dim); }
.acct .own-row em { color: var(--sl-ok); font-size: 11px; }
.acct .chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.acct .chip-f { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px 6px 8px; border-radius: 4px; border: 1px solid var(--sl-line); background: transparent; color: var(--sl-dim); font-size: 13px; }
.acct .chip-f::before { content: ""; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--sl-line); box-sizing: border-box; }
.acct .chip-f:hover { color: var(--sl-ink); border-color: #ffffff; }
.acct .chip-f.active { color: var(--sl-ink); border-color: var(--sl-ink); background: transparent; box-shadow: none; }
.acct .chip-f.active::before { border-color: var(--sl-bar); background: var(--sl-bar) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 6.2 5.2 8.4 9 4.2' fill='none' stroke='%23000000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }

/* wallet, plus, notes, tanukanire */
.wallet-b { display: grid; gap: 12px; }
.balance { display: flex; align-items: baseline; gap: 8px; font-family: var(--display); font-weight: 700; font-size: 32px; letter-spacing: -0.8px; line-height: 1; }
.balance span { font-size: 14px; color: var(--sl-dim); font-family: var(--body); font-weight: 500; }
.acct .loyalty { margin: 0; max-width: 420px; }
.acct .loyalty-level { font-size: 14px; } .acct .loyalty-level small { color: var(--sl-dim); }
.acct .loyalty-bar { height: 4px; border-radius: 0; background: var(--sl-track); } .acct .loyalty-bar i { background: var(--sl-bar); }
.acct .note { max-width: none; margin: 4px 0 0; padding: 12px 14px; border-radius: 0; border: 1px solid var(--sl-line); border-left: 3px solid var(--sl-ink); background: transparent; }
.acct .note b { font-family: var(--body); font-size: 13px; margin-bottom: 2px; }
.acct .note p { font-size: 13px; opacity: 1; color: var(--sl-dim); }
.plus-b { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 24px; align-items: start; }
.acct .plus-price { font-size: 32px; letter-spacing: -0.8px; font-weight: 700; }
.acct .plus-price small { font-size: 14px; color: var(--sl-dim); font-family: var(--body); }
.acct .plus-line { font-size: 13px; color: var(--sl-dim); max-width: none; }
.acct .plus-ladder-wrap .hint { margin-top: 16px; }
.acct .ladder::before { background: var(--sl-line); }
.acct .rung i { border-color: var(--sl-ink); background: var(--sl-box); }
.acct .rung b { font-family: var(--body); font-size: 13px; }
.acct .rung span { font-size: 11px; color: var(--sl-dim); }
.acct .rung.done i { border-color: var(--sl-bar); background: var(--sl-bar); }
.acct .rung.now i { border-color: var(--sl-bar); background: var(--sl-bar); box-shadow: 0 0 0 3px var(--sl-box), 0 0 0 4px var(--sl-bar); }
.acct .rung.now b { color: var(--sl-bar); } .acct .rung:last-child b { color: var(--sl-ok); }
.tk-b { display: grid; gap: 12px; }
.acct .tk-cell { border-radius: 4px; border-color: var(--sl-line); background: var(--sl-field); }
.acct .tk-cell.win { border-color: var(--sl-bar); box-shadow: 0 0 0 2px var(--sl-bar); }
.acct .tk-odds summary { color: var(--sl-label); font-size: 12px; }
.acct .tk-table th, .acct .tk-table td { border-color: var(--sl-row); } .acct .tk-table th { color: var(--sl-label); }

/* signed out */
.acct .tabs { background: transparent; border: 1px solid var(--sl-line); border-radius: 4px; padding: 3px; margin-bottom: 16px; }
.acct .tab { border-radius: 3px; padding: 8px; font-family: var(--body); font-size: 13px; color: var(--sl-dim); }
.acct .tab:hover { color: var(--sl-ink); }
.acct .tab.active, .acct .tab.active:hover { background: #ffffff; color: var(--on-accent); }
.acct .or { color: var(--sl-dim); font-size: 12px; margin: 14px 0; } .acct .or::before, .acct .or::after { background: var(--sl-row); }
.auth-foot { margin-top: 16px; color: var(--sl-dim); font-size: 13px; text-align: center; }

/* phones: the card goes on top, the tabs scroll sideways, forms stack */
@media (max-width: 900px) {
  .acct { padding: 20px 16px 72px; }
  .acct-grid { grid-template-columns: minmax(0, 1fr); }
  .side { grid-template-columns: 1fr 1fr; }
  .rail { position: static; }
  .member { grid-template-columns: 128px minmax(0, 1fr); column-gap: 16px; }
  .member .portrait { width: 128px; }
  .member .avatar-wrap { grid-row: 1 / 4; }
  .member .kv, .member .xp-bar, .member .xp-line, .member-level { grid-column: 1 / -1; }
  .member-name { margin-top: 0; }
  .gift-form, .plus-b { grid-template-columns: minmax(0, 1fr); }
  .gift-form .btn { justify-self: start; }
  .lrow { grid-template-columns: minmax(0, 1fr) auto; }
  .lrow-when { grid-column: 1; grid-row: 2; }
  .lrow-delta { grid-row: 1 / 3; }
  .tbl .barcol { width: 30%; }
}
.pub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.pub-k { color: var(--sl-label); font-size: 12px; }

/* the graphs column: the phone's race and radar, drawn the same way */
.acct-grid { grid-template-columns: 248px minmax(0, 1fr) 320px; }
.race-b, .radar-b { padding: 8px 12px 10px; }
#race, #radar { width: 100%; height: auto; display: block; }
#race text, #radar text { font-family: var(--body); }
#race .guide { stroke: rgba(255,255,255,0.13); stroke-width: 1; }
#race .fig { fill: rgba(255,255,255,0.5); font-size: 9px; }
#race .tick { fill: rgba(255,255,255,0.5); font-size: 9px; }
#race .lane { fill: none; stroke-width: 1.6; stroke-opacity: .85; stroke-linejoin: round; stroke-linecap: round; }
#race .lane.me { stroke-width: 2.5; stroke-opacity: 1; }
#race .lead { stroke-width: 1; stroke-opacity: .6; }
#race .pic-ground { fill: #000000; }
#race .pic-disc { fill: #000000; }
#race .pic-ini { fill: rgba(255,255,255,0.88); font-size: 12px; font-weight: 600; }
#race .pic-ring { fill: none; stroke-width: 1.5; }
#race .pic-ring.me { stroke-width: 2; }
#race .name { fill: rgba(255,255,255,0.88); font-size: 10px; }
.race-foot { display: flex; justify-content: space-between; gap: 12px; padding: 6px 2px 0; font-size: 11px; }
.race-note { color: var(--sl-bar); } .race-rank { color: var(--sl-dim); white-space: nowrap; }
.lvl-meta { color: var(--sl-bar); font-weight: 700; font-size: 13px; }
.radar-xp { padding: 4px 2px 0; }
#radar .ring { fill: none; stroke: rgba(255,255,255,0.38); stroke-width: 1; }
#radar .ring.outer { stroke: rgba(255,255,255,0.38); stroke-opacity: 1; stroke-width: 1.2; }  /* --leaf only exists on the old .sheet; without a stroke here the outer ring drew nothing */
#radar .spoke { stroke: rgba(255,255,255,0.22); stroke-width: 1; }
#radar .shape { fill: rgba(255,255,255,0.2); stroke: var(--sl-bar); stroke-width: 2; stroke-linejoin: round; }
#radar .dot { fill: var(--sl-bar); }
#radar .lbl { fill: rgba(255,255,255,0.85); font-size: 10px; letter-spacing: .8px; }
#radar .val { fill: var(--sl-bar); font-size: 12px; font-weight: 600; }
@media (max-width: 1180px) {
  .acct-grid { grid-template-columns: 248px minmax(0, 1fr); }
  .side { grid-column: 2; grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) { .acct-grid { grid-template-columns: minmax(0, 1fr); } .side { grid-column: auto; } }
@media (max-width: 560px) { .side { grid-template-columns: 1fr; } }

/* ---------- delete account ---------- */
.btn.btn-danger { background: #000000; border: 2px solid #ffffff; color: #ffffff; text-transform: uppercase; letter-spacing: .6px; }
.btn.btn-danger:hover { background: #ffffff; border-color: #ffffff; color: #000000; }
.btn.btn-danger:disabled, .btn.btn-danger:disabled:hover { opacity: .45; cursor: not-allowed; background: #000000; color: #ffffff; }
.linkish.danger-link { color: #ffffff; text-decoration: underline; }
.del-form label span { display: inline; }
.del-form label b { color: var(--text, #ffffff); }
.del-b > p { margin-bottom: 10px; }
.del-list { margin: 0 0 14px 20px; display: grid; gap: 4px; }
.del-form { display: grid; gap: 10px; max-width: 520px; margin-top: 18px; }
.del-form input { width: 100%; box-sizing: border-box; padding: 14px 16px; font-size: 16px; min-height: 50px; }
.del-sure { display: grid; gap: 12px; padding: 14px 16px; border: 2px solid #ffffff; border-radius: 0; background: transparent; }
.del-sure p { margin: 0; font-size: 14px; }
.del-sure-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.del-form label { font-size: 14px; }
.del-form .btn { justify-self: start; }

/* bw2 */
/* ---------- black and white: what every page shares ---------- */
::selection { background: #ffffff; color: #000000; }
:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.btn:focus-visible, .chip:focus-visible, .chip-f:focus-visible, .htab:focus-visible, .tab:focus-visible { outline: 2px solid #ffffff; outline-offset: 2px; }
.form input:focus-visible, .form select:focus-visible, .hub-search input:focus-visible { outline: none; }   /* these draw their own frame */
.policy a, .hint a, .fineprint a { text-decoration: underline; text-underline-offset: 3px; }
.acct .btn:not(.btn-outline):not(.btn-danger):disabled:hover { background: #ffffff; color: var(--on-accent); }
