/* ============================================================
   THE 90 — Variant 01 · CLUB PRIME
   Base: reset, typography, shared components.
   Flat surfaces, hairline rules, sharp corners, calm motion.
   ============================================================ */

/* --- 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.45;
  color: var(--text);
  background: var(--bg);
  -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(--focus); outline-offset: 2px; }

::selection { background: var(--navy); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* --- App shell ------------------------------------------------------ */
.app {
  max-width: var(--app-max);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
}
@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); }

/* --- 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: 600;
  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-size: var(--fs-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-loose);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar .iconbtn:only-of-type ~ .topbar-spacer,
.topbar-spacer { width: var(--tap); flex: none; }

/* --- Type helpers --------------------------------------------------- */
.display { font-family: var(--font-display); font-weight: 400; line-height: 1; }
.h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h1); line-height: 1.05; text-transform: uppercase; }
.h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--fs-h2); line-height: 1.1; text-transform: uppercase; }
.label {
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-2);
}
.label--ink { color: var(--text); }
.label--green { color: var(--accent-text); }
.small { font-size: var(--fs-small); }
.micro { font-size: var(--fs-micro); }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }

/* --- Meta line (editorial kicker under header) ---------------------- */
.meta-line {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding-inline: var(--pad-page);
  margin-bottom: var(--sp-4);
}
.meta-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* --- Section head: 01 / TITLE ——————— ------------------------------- */
.section-head {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}
.sec-num {
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  color: var(--text);
  opacity: 0.22;
}
.sec-title {
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-loose);
}
.sec-rule { flex: 1; height: 1px; background: var(--line); }
.sec-aside {
  font-size: var(--fs-micro);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-2);
}

/* --- Wordmark -------------------------------------------------------- */
.wordmark { font-family: var(--font-display); line-height: 1; letter-spacing: 0.01em; }
.wordmark .wm-90 { color: var(--green); }
.wordmark-plate {
  display: inline-flex;
  align-items: center;
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-1);
  padding: 5px 8px 4px;
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1;
}
.wordmark-plate .wm-90 { color: var(--green); margin-left: 4px; }
.tagline {
  font-size: var(--fs-nano);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-wide);
}

/* --- Buttons ---------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 var(--sp-5);
  border-radius: var(--r-2);
  font-size: var(--fs-body);
  font-weight: 600;
  text-align: center;
  transition: background-color var(--t-fast), color var(--t-fast),
              border-color var(--t-fast), opacity var(--t-fast);
}
.btn--primary { background: var(--primary-bg); color: var(--primary-text); }
.btn--primary:active { opacity: 0.88; }
.btn--action { background: var(--green); color: var(--navy); font-weight: 700; }
.btn--action:active { background: #1FE000; }
.btn--ghost { border: 1px solid var(--line-strong); color: var(--text); background: transparent; }
.btn--ghost:active { background: var(--line-soft); }
.btn--full { width: 100%; }
.btn--sm { min-height: 44px; padding: 0 var(--sp-4); font-size: 14px; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: 0.45; cursor: default; }

.iconbtn {
  width: var(--tap);
  height: var(--tap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-2);
  color: var(--text);
  flex: none;
  transition: background-color var(--t-fast);
}
.iconbtn:active { background: var(--line-soft); }

/* --- Chips (selectable) ------------------------------------------------ */
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: var(--tap);
  padding: 0 var(--sp-4);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.chip[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.chip[aria-pressed="true"]::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--green);
  flex: none;
}

/* --- Badges (outlined) -------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  font-size: var(--fs-nano);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  white-space: nowrap;
}
.badge--ink { color: var(--text); border-color: var(--text); }
.badge--green { color: var(--accent-text); border-color: currentColor; }

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--green);
  flex: none;
  animation: livepulse 1.6s ease-in-out infinite;
}
@keyframes livepulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --- Cards ----------------------------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.card--ink {
  background: var(--hero);
  color: var(--hero-text);
  border-color: transparent;
  position: relative;
  overflow: hidden;
}
.card--ink .label { color: var(--hero-text-2); }
.card--ink .muted, .card--ink .faint { color: var(--hero-text-2); }

/* --- Lists / rows ------------------------------------------------------------ */
.list > * + * { border-top: 1px solid var(--line); }
.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  min-height: 56px;
  padding-block: var(--sp-3);
}
.row-main { flex: 1; min-width: 0; }
.row-title {
  font-weight: 600;
  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: 2px; }

/* --- 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;
  letter-spacing: 0.02em;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-1);
  flex: none;
}
.monogram--sm { width: 32px; height: 32px; font-size: 11px; }
.monogram--lg { width: 56px; height: 56px; font-size: 18px; }
.monogram--ink { background: var(--navy); border-color: var(--navy); color: #fff; }
.card--ink .monogram {
  background: transparent;
  color: var(--hero-text);
  border-color: rgba(255, 255, 255, 0.4);
}

/* --- Stat strip ------------------------------------------------------------------ */
.stat-strip {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
}
.stat-cell { flex: 1; padding: var(--sp-3) var(--sp-4); min-width: 0; }
.stat-cell + .stat-cell { border-left: 1px solid var(--line); }
.stat-kicker {
  font-size: var(--fs-nano);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-2);
  margin-bottom: 6px;
  white-space: nowrap;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* --- Segmented control ---------------------------------------------------------- */
.seg {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 3px;
  background: var(--surface);
}
.seg-btn {
  flex: 1;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  border-radius: var(--r-1);
  transition: background-color var(--t-fast), color var(--t-fast);
}
.seg-btn[aria-selected="true"] { background: var(--navy); color: #fff; }

/* --- Tab bar ------------------------------------------------------------------------ */
.tabbar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: auto;
  background: var(--surface);
  border-top: 1px solid var(--line);
  flex: none;
}
.tabbar-row { display: flex; padding: 4px var(--sp-2) 0; }
.tab {
  flex: 1;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--fs-nano);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-2);
  position: relative;
  border-radius: var(--r-1);
}
.tab svg { width: 22px; height: 22px; }
.tab[aria-current="page"] { color: var(--text); font-weight: 700; }
.tab[aria-current="page"]::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 2px;
  background: var(--green);
}

/* --- Device home indicator ------------------------------------------------------------ */
.home-indicator {
  width: 134px;
  height: 5px;
  border-radius: 3px;
  background: var(--text);
  opacity: 0.18;
  margin: 8px auto;
}

/* --- Sticky footer bar (detail screens) ------------------------------------------------- */
.footbar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  margin-top: auto;
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: var(--sp-3) var(--pad-page) 0;
  flex: none;
}

/* --- Progress ----------------------------------------------------------------------------- */
.progress {
  height: 6px;
  background: var(--line-soft);
  overflow: hidden;
  flex: 1;
}
.progress-fill {
  height: 100%;
  background: var(--navy);
  transition: width var(--t-med);
}
.progress--done .progress-fill { background: var(--green); }

/* --- Input ----------------------------------------------------------------------------------- */
.input {
  min-height: 48px;
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  padding: 0 var(--sp-4);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--t-fast);
}
.input::placeholder { color: var(--text-3); }
.input:focus-visible { outline-offset: 0; }

/* --- Chat bubbles -------------------------------------------------------------------------------- */
.msg { display: flex; flex-direction: column; gap: 6px; }
.msg-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-2);
  font-size: var(--fs-nano);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: var(--ls-label);
  color: var(--text-2);
}
.bubble {
  max-width: 82%;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  font-size: var(--fs-body);
  line-height: 1.45;
  width: fit-content;
}
.msg--out { align-items: flex-end; }
.msg--out .bubble {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.trans-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin-block: -8px;
  font-size: var(--fs-nano);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-text);
}
.trans-toggle svg { width: 13px; height: 13px; }

/* --- Prediction option cells (1 X 2 etc.) ------------------------------------------------------------ */
.opt-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--sp-2); }
.opt-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 64px;
  padding: var(--sp-2);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--surface);
  overflow: hidden;
  transition: background-color var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}
.opt-label {
  font-size: var(--fs-nano);
  font-weight: 700;
  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);
}
.opt-val { font-family: var(--font-display); font-size: 17px; line-height: 1; }
.opt-cell[aria-pressed="true"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.opt-cell[aria-pressed="true"] .opt-label { color: rgba(255, 255, 255, 0.62); }
.opt-cell[aria-pressed="true"]::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--green);
}
.theme-dark .opt-cell[aria-pressed="true"] {
  background: #fff;
  border-color: #fff;
  color: var(--navy);
}
.theme-dark .opt-cell[aria-pressed="true"] .opt-label { color: var(--grey-steel); }

/* --- Stepper ----------------------------------------------------------------------------------------- */
.stepper {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-2);
  background: var(--surface);
}
.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: var(--line-soft); }
.step-val {
  width: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 30px;
  border-inline: 1px solid var(--line);
}

/* --- Timer bar (live window) ----------------------------------------------------------------------------- */
.timerbar {
  height: 4px;
  background: var(--hero-line);
  position: relative;
  overflow: hidden;
}
.timerbar-fill {
  position: absolute;
  inset: 0;
  background: var(--green);
  transform-origin: left center;
}

/* --- Transactions ------------------------------------------------------------------------------------------- */
.tx-amt { font-weight: 700; white-space: nowrap; }
.tx-amt--plus { color: var(--accent-text); }

/* --- Pinned rank row ------------------------------------------------------------------------------------------ */
.pin-row {
  position: sticky;
  bottom: var(--tabbar-h);
  z-index: 30;
  background: var(--navy);
  color: #fff;
  border-radius: var(--r-2);
  box-shadow: 0 0 0 4px var(--bg);
}

/* --- Decorative pitch lines ------------------------------------------------------------------------------------- */
.pitch-deco {
  position: absolute;
  pointer-events: none;
  color: var(--hero-line);
}
