/* ============================================================
   THE 90 — Variant 03 · NIGHT HUD
   Base: reset, typography, shared components.
   Cut-corner panels, ring gauges, telemetry labels, dosed glow.
   Animations touch transform/opacity only.
   ============================================================ */

/* --- Reset --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.5;
  color: var(--text);
  background: var(--abyss);
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum';
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button, input {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
}
button { cursor: pointer; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }

::selection { background: var(--green); color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --- App shell + background grid ------------------------------------ */
.app {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--abyss);
  display: flex;
  flex-direction: column;
  position: relative;
}
.app::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
  z-index: 0;
}
.app > * { position: relative; z-index: 1; }
@media (min-width: 480px) {
  .app { border-inline: 1px solid var(--line); }
}
.app > main { flex: 1 0 auto; display: block; }
.px { padding-inline: var(--pad-page); }

@keyframes boot { from { opacity: 0; } }
.boot { animation: boot 360ms ease-out; }

/* --- Status bar (device chrome) ------------------------------------ */
.statusbar {
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--pad-page);
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex: none;
}
.statusbar .sb-icons { display: flex; align-items: center; gap: 7px; }
.statusbar svg { height: 12px; width: auto; }

/* --- Top bar -------------------------------------------------------- */
.topbar {
  height: 56px;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-inline: var(--sp-3);
  flex: none;
}
.topbar-title {
  flex: 1;
  text-align: center;
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: var(--ls-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-spacer { width: var(--tap); flex: none; }

/* --- Type helpers --------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 400; line-height: 1; }
.h1 { font-weight: 700; font-size: var(--fs-h1); line-height: 1.12; letter-spacing: -0.01em; }
.h2 { font-weight: 700; font-size: var(--fs-h2); line-height: 1.15; }
.tm {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono);
  color: var(--text-2);
}
.tm--green { color: var(--green); }
.tm--cyan { color: var(--cyan); }
.tm--white { color: var(--text); }
.tg-g { text-shadow: var(--tglow-g); }
.tg-c { text-shadow: var(--tglow-c); }
.small { font-size: var(--fs-small); }
.micro { font-size: var(--fs-micro); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* --- Wordmark -------------------------------------------------------- */
.wordmark { font-family: var(--font-display); line-height: 1; letter-spacing: 0.01em; }
.wordmark .wm-90 { color: var(--green); text-shadow: var(--tglow-g); }
.tagline {
  font-family: var(--font-mono);
  font-size: var(--fs-nano);
  text-transform: uppercase;
  letter-spacing: 0.32em;
}

/* --- Tick ruler (decorative rhythm) ------------------------------------ */
.ticks {
  flex: 1;
  height: 7px;
  background-image: repeating-linear-gradient(90deg, var(--line-strong) 0 1px, transparent 1px 7px);
}

/* --- Section head ----------------------------------------------------- */
.sec { display: flex; align-items: center; gap: 10px; margin-bottom: var(--sp-4); }
.sec-mark { width: 11px; height: 11px; flex: none; color: var(--green); }
.sec-title {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: var(--ls-mono);
  color: var(--text);
}
.sec-aside {
  font-family: var(--font-mono);
  font-size: var(--fs-nano);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  white-space: nowrap;
}

/* --- Cut-corner panel (signature container) ------------------------------ */
.hud {
  clip-path: var(--cut);
  background: var(--line-g);
  padding: 1px;
}
.hud-in {
  clip-path: var(--cut);
  background: var(--panel);
  height: 100%;
}
.hud--cyan { background: var(--line-c); }
.hud--quiet { background: var(--line-strong); }
.hud--glow { box-shadow: var(--glow-g); }
.hud--sm { clip-path: var(--cut-sm); }
.hud--sm .hud-in { clip-path: var(--cut-sm); }

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--sp-6);
  clip-path: var(--cut);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: center;
  transition: background-color var(--t-fast), color var(--t-fast), opacity var(--t-fast);
}
.btn--primary { background: var(--green); color: var(--ink); box-shadow: var(--glow-g); }
.btn--primary:active { background: #1FE000; }
.btn--panel { background: var(--panel-2); color: var(--text); }
.btn--panel:active { background: #131C40; }
.btn--cyan { background: var(--cyan); color: var(--ink); box-shadow: var(--glow-c); }
.btn--full { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 var(--sp-4); font-size: 12px; clip-path: var(--cut-sm); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.4; cursor: default; box-shadow: none; }

.iconbtn {
  width: var(--tap);
  height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  flex: none;
  clip-path: var(--cut-sm);
  transition: background-color var(--t-fast);
}
.iconbtn:active { background: var(--panel-2); }

/* --- Chips (cut corners) ------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  clip-path: var(--cut-sm);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.chip[aria-pressed="true"] {
  background: var(--green);
  color: var(--ink);
  box-shadow: var(--glow-g);
}

/* --- Status labels (mono, no box) ----------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: var(--fs-nano);
  text-transform: uppercase;
  letter-spacing: var(--ls-mono);
  color: var(--text);
  white-space: nowrap;
}
.badge::before { content: ''; width: 5px; height: 5px; background: currentColor; flex: none; }
.badge--green { color: var(--green); }
.badge--cyan { color: var(--cyan); }
.badge--dim { color: var(--text-3); }

.live-dot {
  width: 8px;
  height: 8px;
  background: var(--green);
  box-shadow: 0 0 10px rgba(36, 255, 0, 0.55);
  flex: none;
  animation: ambient var(--pulse);
}
.live-dot--ink { background: var(--ink); box-shadow: none; }
@keyframes ambient {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* --- Ring gauges (signature instrument) -------------------------------------- */
.gauge { position: relative; width: 44px; height: 44px; flex: none; }
.gauge svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.gauge .g-track { fill: none; stroke: rgba(255, 255, 255, 0.1); stroke-width: 3; }
.gauge .g-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 3;
  stroke-linecap: round;
  filter: drop-shadow(0 0 4px rgba(59, 232, 255, 0.45));
}
.gauge--green .g-fill { stroke: var(--green); filter: drop-shadow(0 0 4px rgba(36, 255, 0, 0.5)); }
.gauge .g-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
}
.gauge--md { width: 56px; height: 56px; }
.gauge--md .g-num { font-size: 12px; }
.gauge::after {
  content: '';
  position: absolute;
  inset: -8px;
  background: radial-gradient(circle, rgba(59, 232, 255, 0.12), transparent 65%);
  pointer-events: none;
  animation: ambient var(--pulse);
}
.gauge--green::after { background: radial-gradient(circle, rgba(36, 255, 0, 0.12), transparent 65%); }

/* --- Lists / rows ------------------------------------------------------------ */
.list > * + * { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 60px;
  padding-block: var(--sp-3);
}
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-weight: 500;
  font-size: var(--fs-body);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-sub { font-size: var(--fs-small); color: var(--text-2); margin-top: 3px; }

/* --- Monogram (club / user badge, no crests) ---------------------------------- */
.monogram {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1;
  color: var(--text);
  background: var(--panel-2);
  clip-path: var(--cut-sm);
  flex: none;
}
.monogram--sm { width: 32px; height: 32px; font-size: 11px; }
.monogram--lg { width: 56px; height: 56px; font-size: 18px; }
.monogram--green { background: var(--green); color: var(--ink); box-shadow: var(--glow-g); }
.monogram--line { background: rgba(5, 10, 48, 0.18); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* --- HUD stat module --------------------------------------------------------------- */
.stat-mod {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 44px;
  padding: 0 var(--sp-4);
  clip-path: var(--cut-sm);
  background: var(--panel-2);
  font-weight: 700;
  font-size: var(--fs-small);
}
.stat-mod svg { width: 16px; height: 16px; color: var(--green); }
.stat-mod .k {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--text-2);
  text-transform: uppercase;
}

/* --- Segmented control ---------------------------------------------------------- */
.seg { display: flex; gap: 6px; }
.seg-btn {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  clip-path: var(--cut-sm);
  background: var(--panel-2);
  font-family: var(--font-mono);
  font-size: var(--fs-micro);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  transition: background-color var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}
.seg-btn[aria-selected="true"] {
  background: var(--green);
  color: var(--ink);
  box-shadow: var(--glow-g);
}

/* --- Tab bar ------------------------------------------------------------------------ */
.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: auto;
  background: var(--panel);
  border-top: 1px solid var(--line);
  flex: none;
}
.tabbar-row { display: flex; padding: 6px var(--sp-2) 0; }
.tab {
  flex: 1;
  min-height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--green); }
.tab[aria-current="page"] svg { filter: drop-shadow(0 0 6px rgba(36, 255, 0, 0.5)); }
.tab[aria-current="page"]::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 2px;
  background: var(--green);
  box-shadow: 0 0 8px rgba(36, 255, 0, 0.6);
}

/* --- Device home indicator ------------------------------------------------------------ */
.home-indicator {
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: var(--text);
  opacity: 0.2;
  margin: 8px auto;
}

/* --- Sticky footer bar (detail screens) ------------------------------------------------- */
.footbar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: auto;
  background: var(--abyss);
  border-top: 1px solid var(--line);
  padding: var(--sp-3) var(--pad-page) 0;
  flex: none;
}

/* --- Prediction tiles ------------------------------------------------------------------- */
.tile-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.tile { padding: 0; clip-path: none; background: none; text-align: center; }
.tile .hud { display: block; transition: background-color var(--t-fast), box-shadow var(--t-fast); }
.tile .hud-in {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 72px;
  padding: var(--sp-2);
  transition: background-color var(--t-fast);
}
.tile-label {
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-2);
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--t-fast);
}
.tile-val { font-family: var(--font-display); font-size: 19px; line-height: 1; transition: color var(--t-fast); }
.tile[aria-pressed="true"] .hud { background: var(--green); box-shadow: var(--glow-g); }
.tile[aria-pressed="true"] .hud-in { background: #0B2406; }
.tile[aria-pressed="true"] .tile-val { color: var(--green); text-shadow: var(--tglow-g); }
.tile[aria-pressed="true"] .tile-label { color: var(--text); }

/* --- Stepper ----------------------------------------------------------------------------------------- */
.stepper { display: flex; align-items: stretch; clip-path: var(--cut-sm); background: var(--panel-2); }
.step-btn {
  width: 48px;
  min-height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  transition: background-color var(--t-fast);
}
.step-btn:active { background: #131C40; }
.step-val {
  width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 28px;
  border-inline: 1px solid var(--line);
}

/* --- Input ----------------------------------------------------------------------------------- */
.input {
  min-height: 48px;
  width: 100%;
  clip-path: var(--cut-sm);
  padding: 0 var(--sp-4);
  background: var(--panel-2);
  color: var(--text);
}
.input::placeholder { color: var(--text-3); }
.input:focus-visible { outline-offset: -2px; }

/* --- Chat bubbles -------------------------------------------------------------------------------- */
.msg { display: flex; flex-direction: column; gap: 6px; }
.msg-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  font-family: var(--font-mono);
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  padding-inline: 2px;
}
.bubble {
  max-width: 82%;
  padding: 11px 14px;
  background: var(--panel-2);
  clip-path: var(--cut-sm);
  font-size: var(--fs-body);
  line-height: 1.5;
  width: fit-content;
}
.msg--out { align-items: flex-end; }
.msg--out .bubble { background: #0D2607; }
.trans-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-block: -9px;
  font-family: var(--font-mono);
  font-size: var(--fs-nano);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--green);
}
.trans-toggle svg { width: 13px; height: 13px; }

/* --- Transactions ------------------------------------------------------------------------------------- */
.tx-amt { font-family: var(--font-mono); font-weight: 500; white-space: nowrap; }
.tx-amt--plus { color: var(--green); }

/* --- Pinned rank row ------------------------------------------------------------------------------------ */
.pin-row {
  position: sticky;
  bottom: var(--tabbar-h);
  z-index: 30;
  box-shadow: var(--glow-g), 0 0 0 6px var(--abyss);
}

/* --- Scroll strips ---------------------------------------------------------------------------------------- */
.hstrip { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; }
.hstrip::-webkit-scrollbar { display: none; }
