/* Bruce Jeet: clean arcade companion. See docs/DESIGN.md for the approved direction.
   Order: fonts, tokens, base, then one block per page section with its own breakpoints.
   Breakpoints: 1600 (wide), 1100 (tablet), 1000 (hero columns), 700 (mobile), 380 (small phones). */

@font-face { font-family: Pixel; src: url('assets/fonts/pixelify.woff2') format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Space; src: url('assets/fonts/space.woff2') format('woff2'); font-weight: 300 700; font-display: swap; }
@font-face { font-family: Oxanium; src: url('assets/fonts/oxanium.woff2') format('woff2'); font-weight: 200 800; font-display: swap; }

:root {
  --bg: #151716;
  --panel: #202321;
  --yellow: #f5d547;
  --text: #eeeee8;
  --muted: #adb3ad;
  --line: #414640;
  --positive: #4ade80;
  --negative: #e5a18f;
  --ko: #dab8aa;
  /* Over the hero video */
  --hud-text: #e0e4db;
  --hud-border: rgba(218, 229, 213, .27);
  --hud-rule: rgba(218, 229, 213, .16);
  /* Fight record frame */
  --ledger-line: #626a5e;
  /* On the yellow dojo */
  --dojo-bg: #e8b73a;
  --dojo-ink: #252710;
  --dojo-rule: #7a6a28;
  --dojo-muted: #4f4520;
  --body: Space, Arial, sans-serif;
  --pixel: Pixel, monospace;
  color-scheme: dark;
}

/* Base */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 28px; scrollbar-color: var(--yellow) var(--bg); }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.65 var(--body); }
::selection { background: var(--yellow); color: var(--bg); }
a { color: inherit; text-decoration: none; text-underline-offset: 5px; }
a:focus-visible, summary:focus-visible { outline: 2px solid var(--yellow); outline-offset: 6px; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
h2 { font-size: clamp(36px, 4.3vw, 60px); line-height: 1.12; letter-spacing: -.04em; font-weight: 500; text-wrap: balance; }
h3 { font-size: 29px; font-weight: 500; letter-spacing: -.03em; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; flex-shrink: 0; }
.skip { position: fixed; top: -100px; left: 20px; z-index: 20; padding: 10px; background: var(--yellow); color: var(--bg); }
.skip:focus { top: 10px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.muted { color: var(--muted); }
.status { display: inline-block; font-size: 12px; color: var(--muted); }

.section { max-width: 1600px; margin: auto; padding: 105px 6%; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 40px; margin-bottom: 48px; }
.section-heading > p { font-size: 15px; color: var(--muted); }

@media (max-width: 1100px) {
  .section { padding: 75px 5%; }
}
@media (max-width: 700px) {
  h2 { font-size: 37px; }
  .section { padding: 60px 6%; }
  .section-heading { flex-direction: column; align-items: flex-start; gap: 16px; margin-bottom: 30px; }
  .section-heading > p { font-size: 14px; }
}

/* Top bar */
.nav { display: flex; align-items: center; gap: 32px; height: 82px; padding: 0 4%; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: flex-end; gap: 5px; font: 600 33px/1 var(--pixel); color: var(--yellow); }
.brand-square { display: block; width: 7px; height: 7px; margin-bottom: 5px; background: currentColor; }
.nav-title { flex: 1; font-size: 13px; color: var(--muted); }
.nav-dojo { display: flex; align-items: center; gap: 25px; font-size: 14px; }
.nav-dojo:hover { color: var(--yellow); }

@media (max-width: 700px) {
  .nav { height: 68px; gap: 20px; padding: 0 6%; }
  .nav .brand { font-size: 28px; }
  .nav-title { max-width: 150px; font-size: 11px; line-height: 1.4; }
  .nav-dojo { gap: 8px; margin-left: auto; font-size: 12px; }
  .nav-dojo svg { width: 17px; }
}
@media (max-width: 380px) {
  .nav { gap: 12px; }
  .nav-title { max-width: 115px; font-size: 10px; }
  .nav-dojo svg { display: none; }
}

/* Hero: full-bleed video with a HUD panel either side of an open centre. */
.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: max(720px, calc(100svh - 82px));
  padding: 44px 4% 0;
  overflow: hidden;
  background: var(--bg) url('assets/bruce-jeet-hero-poster.webp') center / cover no-repeat;
}
.hero-video, .hero-scrim { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; pointer-events: none; }
.hero-video { object-fit: cover; object-position: center; }
/* Cross-fade into the idle loop; the clips are frame-matched (scripts/encode_hero_media.py). */
.hero-idle { opacity: 0; transition: opacity .35s linear; }
.hero-idle.is-on { opacity: 1; }
.hero-scrim {
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(10, 13, 11, .84), rgba(10, 13, 11, .08) 40%, rgba(10, 13, 11, .08) 64%, rgba(10, 13, 11, .78)),
    linear-gradient(0deg, rgba(10, 13, 11, .86), transparent 45%, rgba(10, 13, 11, .24));
}

.hero-heading { display: flex; justify-content: space-between; align-items: center; gap: 40px; margin-bottom: 34px; }
.hero h1 {
  position: relative;
  z-index: 1;
  font: 650 clamp(64px, 7vw, 108px)/.98 Oxanium, var(--body);
  letter-spacing: -.035em;
  text-align: left;
  white-space: nowrap;
  color: var(--yellow);
  text-shadow: 0 2px 16px #0005;
}
.hero-doctrine { flex-shrink: 0; width: 280px; padding-bottom: 4px; font-size: 18px; line-height: 1.55; }

.character-layout {
  flex: 1;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 280px;
  align-content: center;
  align-items: stretch;
  gap: 36px;
  min-height: 0;
  padding-bottom: 32px;
}
.hero-stage-space { min-height: 0; }

.hero-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  align-self: stretch;
  min-width: 0;
  padding: 24px;
  background: rgba(15, 21, 19, .43);
  border: 1px solid var(--hud-border);
  border-radius: 10px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.hero-panel::before, .hero-panel::after { content: ''; position: absolute; width: 20px; height: 20px; border-color: rgba(245, 213, 71, .8); border-style: solid; pointer-events: none; }
.hero-panel::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-top-left-radius: 10px; }
.hero-panel::after { right: -1px; bottom: -1px; border-width: 0 1px 1px 0; border-bottom-right-radius: 10px; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hero-panel { background: rgba(15, 21, 19, .475); }
}
/* Shared panel header and footer rows. */
.character-line, .fighter-quote {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  margin-bottom: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--hud-rule);
  font-size: 20px;
  line-height: 1.5;
  letter-spacing: -.025em;
}
.character-line { max-width: 27ch; }
.menu-foot, .start { min-height: 52px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--hud-rule); }

.character-menu nav { display: flex; flex-direction: column; gap: 3px; }
.character-menu nav a { position: relative; display: block; padding: 11px 0 11px 22px; font-size: 18px; line-height: 1.15; transition: color .15s, background .15s; }
.character-menu nav a:hover, .character-menu nav a:focus-visible { color: var(--yellow); background: rgba(245, 213, 71, .08); }
.selector { position: absolute; top: 16px; left: 0; width: 8px; height: 8px; border: 1px solid var(--muted); }
.character-menu nav a:hover .selector, .character-menu nav a:focus-visible .selector { background: var(--yellow); border-color: var(--yellow); }
.menu-description { display: block; margin-top: 5px; font-size: 12px; color: var(--hud-text); }
.menu-foot { font-size: 12px; color: var(--hud-text); }

.fighter-note { display: flex; flex-direction: column; width: 100%; }
.fighter-note dl { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 20px; width: 100%; padding: 9px 0; }
.fighter-note dt { margin-bottom: 5px; font-size: 12px; color: var(--hud-text); }
.fighter-note dd { font-size: 18px; line-height: 1.4; }
.start { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; color: var(--yellow); }

.stage-bottom { display: flex; justify-content: space-between; align-items: center; gap: 30px; padding: 22px 0; border-bottom: 1px solid; border-color: #ffffff40; font-size: 12px; color: var(--hud-text); }
.hero-controls { display: flex; flex-shrink: 0; gap: 10px; }
.hero-controls[hidden] { display: none; }
.hero-controls button { min-height: 44px; padding: 12px 15px; font: inherit; font-size: 12px; line-height: 1.2; color: var(--text); background: #151716b8; border: 1px solid var(--muted); cursor: pointer; }
.hero-controls button:hover { color: var(--bg); background: var(--yellow); border-color: var(--yellow); }
.hero-controls button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 4px; }

@media (min-width: 1600px) {
  .hero { padding-left: max(4%, calc((100vw - 1472px) / 2)); padding-right: max(4%, calc((100vw - 1472px) / 2)); }
}
@media (max-width: 1100px) {
  .fighter-note { gap: 35px; }
  .fighter-note dl { flex-wrap: wrap; align-items: baseline; }
  .stage-bottom { font-size: 11px; }
}
@media (max-width: 1000px) and (min-width: 701px) {
  .hero h1 { font-size: clamp(56px, 7vw, 76px); }
  .hero-doctrine { width: 245px; font-size: 16px; }
  .character-layout { grid-template-columns: 245px minmax(0, 1fr) 245px; gap: 20px; }
  .hero-panel { padding: 20px; }
  .character-line, .fighter-quote { font-size: 18px; }
  .fighter-note dd { font-size: 16px; }
}
@media (max-width: 700px) {
  /* The open video area leads; panels stack full width below it. */
  .hero { min-height: calc(100svh - 68px); padding: 28px 6% 0; }
  .hero-video { object-position: 52% center; }
  .hero-scrim { background: linear-gradient(0deg, rgba(10, 13, 11, .95), rgba(10, 13, 11, .8) 34%, rgba(10, 13, 11, .08) 66%, rgba(10, 13, 11, .4)); }
  .hero-heading { display: block; margin: 0; }
  .hero h1 { font-size: clamp(44px, 12.5vw, 82px); line-height: 1.05; }
  .hero-doctrine { display: none; }
  .character-layout { display: flex; flex-direction: column; gap: 24px; padding-top: 18px; }
  .hero-stage-space { order: -1; width: 100%; min-height: 190px; }
  .hero-panel { width: 100%; padding: 22px; }
  .character-line, .fighter-quote { min-height: 0; }
  .character-line { max-width: none; }
  .character-menu nav { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
  .character-menu nav a { padding: 12px 0 12px 19px; border-top: 1px solid; border-color: #ffffff40; font-size: 17px; }
  .selector { top: 18px; width: 7px; height: 7px; }
  .menu-foot { display: none; }
  .fighter-note { flex-wrap: wrap; gap: 0; }
  .fighter-note dl { gap: 16px; padding: 0; }
  .fighter-note dl > div { display: grid; grid-template-columns: 70px 1fr; align-items: baseline; gap: 14px; }
  .fighter-note dt { margin: 0; }
  .fighter-note dd { font-size: 14px; }
  .start { min-height: 44px; margin-top: 20px; font-size: 12px; }
  .stage-bottom { flex-direction: column; align-items: flex-start; gap: 16px; padding: 20px 0; font-size: 12px; line-height: 1.5; }
  .stage-bottom > span { max-width: 40ch; }
}

/* Dossier: framed portrait beside the character copy. */
.dossier-layout { display: grid; grid-template-columns: 1fr 1.3fr; align-items: start; gap: 70px; margin-top: 40px; }
.portrait { position: relative; align-self: start; aspect-ratio: 1; min-width: 0; min-height: 0; padding: 9px; border: 1px solid var(--line); }
.portrait img { display: block; width: 100%; height: auto; max-width: 100%; aspect-ratio: 1; object-fit: cover; object-position: center 30%; filter: saturate(.8); }
.portrait figcaption { position: absolute; bottom: 9px; left: 9px; right: 9px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 18px; background: #151716eb; font-size: 12px; }
.portrait figcaption span:first-child { font-size: 17px; }
.portrait-corner { position: absolute; width: 25px; height: 25px; border-color: var(--yellow); border-style: solid; }
.corner-one { top: -2px; left: -2px; border-width: 3px 0 0 3px; }
.corner-two { bottom: -2px; right: -2px; border-width: 0 3px 3px 0; }
.dossier-copy { max-width: 650px; }
.dossier-copy > p { margin-bottom: 20px; color: var(--muted); }
.dossier-copy > p:last-of-type { color: var(--text); }
.dossier-copy > .statement { margin-bottom: 26px; font-size: 27px; line-height: 1.4; letter-spacing: -.025em; color: var(--yellow); }
.roles { margin-top: 35px; }
.roles > div { display: grid; grid-template-columns: 120px 1fr; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14px; }
.roles dd { color: var(--muted); }

@media (min-width: 1101px) {
  .dossier { padding-top: 110px; }
}
@media (max-width: 1100px) {
  .dossier-layout { gap: 40px; }
}
@media (max-width: 700px) {
  .dossier-layout { grid-template-columns: 1fr; gap: 30px; margin-top: 27px; }
  .portrait { padding: 7px; }
  .portrait figcaption { bottom: 7px; left: 7px; right: 7px; padding: 10px; font-size: 11px; }
  .portrait figcaption span:first-child { font-size: 15px; }
  .dossier-copy > p { font-size: 16px; }
  .dossier-copy > .statement { font-size: 23px; }
  .roles > div { grid-template-columns: 100px 1fr; font-size: 13px; }
}

/* Move list: native disclosures styled as arcade command inputs. */
.forms { border-top: 1px solid var(--line); }
.forms-layout { display: grid; grid-template-columns: 1fr 1.5fr; gap: 90px; }
.forms-intro > p:first-child { font-size: 23px; line-height: 1.4; letter-spacing: -.025em; }
.forms-intro > .muted { max-width: 30ch; margin: 20px 0 30px; font-size: 16px; }
.form-list details { border-top: 1px solid var(--line); }
summary { display: grid; grid-template-columns: 66px 1fr 20px; align-items: center; gap: 20px; padding: 22px 0; font-size: 26px; letter-spacing: -.025em; list-style: none; cursor: pointer; }
summary::-webkit-details-marker { display: none; }
summary small { display: block; margin-top: 5px; font-size: 13px; letter-spacing: 0; color: var(--muted); }
summary:hover { color: var(--yellow); }
.move-command { display: flex; gap: 5px; }
.move-command i { display: block; width: 13px; height: 13px; border: 1px solid var(--yellow); }
.move-command i:last-child { background: var(--yellow); }
.expand { position: relative; width: 16px; height: 16px; }
.expand::before, .expand::after { content: ''; position: absolute; top: 7px; left: 1px; width: 14px; height: 1px; background: var(--muted); }
.expand::after { transform: rotate(90deg); }
details[open] .expand::after { transform: rotate(0); }
.form-body { padding: 0 35px 24px 86px; font-size: 16px; color: var(--muted); }
.form-body > span { display: block; margin-top: 18px; font-size: 12px; }
.small-note { padding-top: 20px; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }

@media (max-width: 1100px) {
  .forms-layout { gap: 50px; }
}
@media (max-width: 700px) {
  .forms-layout { grid-template-columns: 1fr; gap: 27px; margin-top: 27px; }
  .forms-intro > p:first-child { font-size: 20px; }
  .forms-intro > .muted { max-width: 40ch; margin-bottom: 15px; }
  summary { grid-template-columns: 48px 1fr 16px; gap: 15px; font-size: 25px; }
  .move-command { gap: 4px; }
  .move-command i { width: 10px; height: 10px; }
  .form-body { padding-left: 0; padding-right: 0; font-size: 15px; }
}

/* Fight record: live Candle ledger, chart, positions, partner link, dust drawer. */
.record { max-width: none; background: var(--panel); }
.record > * { max-width: 1408px; margin-left: auto; margin-right: auto; }
.ledger { border: 1px solid var(--ledger-line); }
.ledger-header { display: flex; justify-content: space-between; gap: 20px; padding: 17px 28px; border-bottom: 1px solid var(--ledger-line); font-size: 12px; color: var(--muted); }
.ledger-row { display: grid; grid-template-columns: 1fr 1fr 70px; align-items: center; gap: 25px; padding: 20px 28px; border-bottom: 1px solid var(--line); }
.ledger-row > span:first-child { font-size: 23px; letter-spacing: -.025em; }
.ledger-row > span:nth-child(2) { font-size: 14px; color: var(--muted); }
.ledger-row strong { font: 500 37px var(--pixel); font-variant-numeric: tabular-nums; text-align: right; color: var(--yellow); }
.pnl-row { grid-template-columns: minmax(170px, .75fr) minmax(260px, 1.25fr) minmax(150px, .6fr); }
.pnl-breakdown { display: flex; align-items: center; gap: 28px; font-size: 12px !important; color: var(--muted); }
.pnl-breakdown span { display: flex; flex-direction: column; gap: 2px; }
.pnl-breakdown b { font: 500 16px/1.4 var(--body); font-variant-numeric: tabular-nums; color: var(--text); }
.ledger-value { min-width: 150px; }
/* Sign colours set by app.js; they win over the ledger's default value colours. */
.positive { color: var(--positive) !important; }
.negative { color: var(--negative) !important; }
.neutral { color: var(--text) !important; }

.chart { padding: 22px 28px 26px; border-bottom: 1px solid var(--line); }
.chart-head { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; margin-bottom: 16px; }
.chart-head > span:first-child { font-size: 23px; letter-spacing: -.025em; }
.chart-legend { display: flex; gap: 18px; margin-right: auto; font-size: 12px; color: var(--muted); }
.chart-legend span::before { content: ''; display: inline-block; width: 14px; height: 2px; margin: 0 7px 3px 0; vertical-align: middle; background: var(--muted); }
.chart-legend .legend-total::before { background: var(--yellow); }
.chart-ranges { display: flex; border: 1px solid var(--ledger-line); }
.chart-ranges button { min-width: 48px; min-height: 36px; padding: 6px 12px; border: 0; background: none; font: 500 13px var(--pixel); color: var(--muted); cursor: pointer; }
.chart-ranges button + button { border-left: 1px solid var(--ledger-line); }
.chart-ranges button:hover { color: var(--text); }
.chart-ranges button[aria-pressed=true] { background: var(--yellow); color: var(--bg); }
.chart-ranges button:focus-visible { outline: 2px solid var(--yellow); outline-offset: 3px; }
.chart-plot { position: relative; height: 240px; }
.chart-plot svg { width: 100%; height: 100%; overflow: visible; }
.chart-plot svg[hidden] { display: none; }
.chart-zero { stroke: var(--line); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-realized { stroke: var(--muted); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.chart-total { stroke: var(--yellow); stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-label { position: absolute; right: 0; font: 12px var(--pixel); color: var(--muted); }
.chart-max { top: -18px; }
.chart-min { bottom: -18px; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; font-size: 14px; text-align: center; color: var(--muted); }
.chart-empty[hidden] { display: none; }

.positions-block { border-bottom: 1px solid var(--line); }
.positions-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 20px 28px; }
.positions-heading > div { display: flex; flex-direction: column; gap: 2px; }
.positions-heading span { font-size: 23px; letter-spacing: -.025em; }
.positions-heading small { font-size: 12px; color: var(--muted); }
.positions-heading > strong { font: 500 30px/1 var(--pixel); color: var(--yellow); }
/* Positions, dust and tape lists scroll in place after about six rows. Each keeps right padding so a
   scrollbar never sits on the figures. The bottom 40px fades out to show there's more; each list ends
   in 40px of padding so the last row is clear once scrolled down. */
.token-list { max-height: 460px; margin: 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-width: thin; scrollbar-color: var(--ledger-line) transparent; -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 40px), transparent); }
.token-list:focus-visible { outline: 2px solid var(--yellow); outline-offset: -2px; }
.positions-list { padding: 0 28px 40px; }
.position-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto minmax(150px, auto); align-items: center; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.token-avatar { position: relative; display: grid; place-items: center; width: 42px; height: 42px; overflow: hidden; border: 1px solid var(--ledger-line); border-radius: 50%; background: var(--bg); font: 500 11px/1 var(--pixel); color: var(--yellow); }
.token-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: var(--bg); }
.token-link { min-width: 0; font-size: 16px; font-weight: 500; overflow-wrap: anywhere; }
.token-link:hover { color: var(--yellow); text-decoration: underline; }
.position-value { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; color: var(--muted); }
.position-pnl { font-size: 16px; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.token-empty { padding: 18px 0; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.token-error { color: var(--negative); }
.tape-jump { display: inline-block; margin: 0 28px 20px; font-size: 13px; color: var(--muted); }
.tape-jump:hover { color: var(--yellow); }

.platform { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 28px; }
.platform > p { font-size: 19px; line-height: 1.4; }
.platform > div { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.button { display: flex; align-items: center; justify-content: space-between; gap: 30px; min-height: 48px; padding: 13px 18px; border: 1px solid var(--yellow); font-size: 14px; color: var(--yellow); }
.button[aria-disabled=true] { border-color: #737b66; color: #bdc49b; cursor: not-allowed; }
.button[href]:hover { background: var(--yellow); color: var(--bg); }
#platform-note { font-size: 12px; color: var(--muted); }

.dust { display: grid; grid-template-columns: 1fr 1.3fr; gap: 100px; margin-top: 65px; }
.dust-title { display: flex; align-items: center; align-self: start; gap: 23px; }
.ko { font: 500 66px/1 var(--pixel); color: var(--ko); }
.dust > div > p:first-child { font-size: 21px; }
.dust .muted { margin: 12px 0 18px; font-size: 15px; }
.dust-list { max-height: 440px; padding: 0 14px 40px 0; }
.dust-item { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.dust-name { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.dust-tag { padding: 1px 6px; border: 1px solid var(--line); font-size: 11px; color: var(--muted); }
.dust-loss { font: 500 15px var(--pixel); font-variant-numeric: tabular-nums; text-align: right; color: var(--ko); }

@media (min-width: 1600px) {
  .record { padding-left: max(6%, calc((100vw - 1408px) / 2)); padding-right: max(6%, calc((100vw - 1408px) / 2)); }
}
@media (max-width: 1100px) {
  .dust { gap: 50px; }
}
@media (max-width: 700px) {
  .ledger-header { flex-direction: column; align-items: flex-start; gap: 5px; padding: 15px 18px; font-size: 12px; }
  .ledger-row { grid-template-columns: 1fr 35px; gap: 4px 15px; padding: 18px; }
  .ledger-row > span:first-child { font-size: 20px; }
  .ledger-row > span:nth-child(2) { grid-row: 2; font-size: 12px; }
  .ledger-row strong { grid-row: 1 / 3; grid-column: 2; }
  .pnl-row { grid-template-columns: 1fr auto; }
  .pnl-breakdown { grid-row: 2; grid-column: 1 / -1; align-items: flex-start; gap: 18px; }
  .pnl-row .ledger-value { grid-row: 1; }
  .ledger-value { min-width: 0; }
  .chart { padding: 18px; }
  .chart-head > span:first-child { font-size: 20px; }
  .chart-ranges { width: 100%; }
  .chart-ranges button { flex: 1; }
  .chart-plot { height: 180px; }
  .positions-heading { padding: 18px; }
  .positions-heading span { font-size: 20px; }
  .positions-list { padding: 0 18px 40px; }
  .position-item { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 2px 12px; padding: 13px 0; }
  .position-item .token-avatar { grid-row: 1 / 3; }
  .position-value { grid-column: 2; grid-row: 2; font-size: 12px; text-align: left; }
  .position-pnl { grid-column: 3; grid-row: 1 / 3; font-size: 14px; }
  .token-empty { font-size: 12px; }
  .tape-jump { margin: 0 18px 18px; }
  .platform { flex-direction: column; align-items: flex-start; gap: 20px; padding: 22px 18px; }
  .platform > p { font-size: 18px; }
  .platform > div { align-items: flex-start; width: 100%; }
  .button { width: 100%; }
  .dust { grid-template-columns: 1fr; gap: 20px; margin-top: 45px; }
  .ko { font-size: 52px; }
  .dust-title h3 { font-size: 27px; }
  .dust > div > p:first-child { font-size: 19px; }
  .dust .muted { font-size: 14px; }
  .dust-item { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 12px; }
  .dust-loss { font-size: 13px; }
}

/* The tape: live trade feed from /api/activity. */
.tape-board { border: 1px solid var(--ledger-line); }
.tape-list { max-height: 440px; padding: 0 28px 40px; }
.tape-item { display: grid; grid-template-columns: 76px 56px 42px minmax(0, 1fr) auto 36px; grid-template-areas: "time side avatar token usd tx"; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.tape-item:first-child { border-top: 0; }
.tape-item.is-new { animation: tape-in .45s ease-out; }
@keyframes tape-in { from { opacity: 0; transform: translateY(-8px); } }
.tape-time { grid-area: time; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tape-side { grid-area: side; padding: 2px 0; border: 1px solid currentColor; font: 500 12px var(--pixel); text-align: center; }
.tape-side.buy { color: var(--yellow); }
.tape-side.sell { color: var(--text); }
.tape-item .token-avatar { grid-area: avatar; }
.tape-item .token-link { grid-area: token; }
.tape-usd { grid-area: usd; font-variant-numeric: tabular-nums; text-align: right; }
.tape-tx { grid-area: tx; font-size: 12px; text-align: right; color: var(--muted); }
.tape-tx:hover { color: var(--yellow); text-decoration: underline; }

@media (max-width: 700px) {
  .tape-list { padding: 0 18px 40px; }
  .tape-item { grid-template-columns: 42px 48px minmax(0, 1fr) auto; grid-template-areas: "avatar side token usd" "avatar time time tx"; gap: 4px 12px; }
}

/* Dojo: the yellow community block. */
.dojo { max-width: none; background: var(--dojo-bg); color: var(--dojo-ink); }
.dojo-layout { display: grid; grid-template-columns: 1.5fr 1fr; gap: 100px; max-width: 1408px; margin: auto; }
.dojo h2 { font-size: clamp(40px, 5vw, 72px); }
.dojo-layout > div > p { margin-top: 26px; font-size: 17px; }
.community { display: flex; justify-content: space-between; gap: 20px; max-width: 490px; margin-top: 38px; padding-top: 20px; border-top: 1px solid var(--dojo-rule); font-size: 13px; }
.community a { text-decoration: underline; text-underline-offset: 4px; }
.coin { padding-left: 60px; border-left: 1px solid var(--dojo-rule); }
.token-name { font-size: 20px; }
.coin strong { display: block; margin: 10px 0; font: 500 110px/1 var(--pixel); }
.coin .status { margin-top: 26px; color: var(--dojo-muted); }
.continue { max-width: 1408px; margin: auto; padding-top: 90px; font: 500 clamp(35px, 6.3vw, 90px)/1 var(--pixel); letter-spacing: -.025em; }
.continue span { color: var(--dojo-rule); }

@media (min-width: 1101px) {
  .dojo { padding-top: 90px; padding-bottom: 35px; }
}
@media (min-width: 1600px) {
  .dojo { padding-left: max(6%, calc((100vw - 1408px) / 2)); padding-right: max(6%, calc((100vw - 1408px) / 2)); }
}
@media (max-width: 1100px) {
  .dojo-layout { gap: 50px; }
  .coin { padding-left: 40px; }
  .coin strong { font-size: 90px; }
}
@media (max-width: 700px) {
  .dojo-layout { grid-template-columns: 1fr; gap: 38px; margin-top: 0; }
  .dojo h2 { font-size: 44px; }
  .dojo-layout > div > p { font-size: 16px; }
  .dojo-layout > .coin > p { margin-top: 14px; }
  .community { font-size: 12px; }
  .coin { padding: 30px 0 0; border-left: 0; border-top: 1px solid var(--dojo-rule); }
  .continue { padding-top: 48px; font-size: clamp(26px, 6.9vw, 45px); }
}
@media (max-width: 380px) {
  .community { font-size: 11px; }
}

/* Footer */
footer { display: flex; justify-content: space-between; align-items: center; gap: 25px; padding: 29px 4%; }
footer p { font-size: 14px; color: var(--muted); }
footer > span { font-size: 12px; color: var(--muted); }

@media (max-width: 700px) {
  footer { flex-wrap: wrap; gap: 16px; padding: 26px 6%; }
  footer p { font-size: 12px; }
  footer > span { width: 100%; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
