:root {
  --bg: #272729;
  --jade: #00B24C;
  --azure: #0285F0;
  --white: #fff;
  --black: #000;
  --muted: #b9bcc4;
  --line: rgba(255, 255, 255, 0.14);
  --card: rgba(0, 0, 0, 0.72);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  color: var(--white);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  background: var(--bg);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg) url("bg-stand.jpg") center/cover no-repeat;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(39, 39, 41, 0.72), rgba(39, 39, 41, 0.9));
}

body.locked { overflow: hidden; }

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

button:disabled { cursor: default; }

img { max-width: 100%; }

h1, h2, h3, p { margin: 0; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.mast {
  position: sticky;
  top: 0;
  z-index: 20;
  padding-top: env(safe-area-inset-top);
  background: rgba(39, 39, 41, 0.94);
  backdrop-filter: blur(12px);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 72px;
  padding: 10px 0;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand strong {
  display: block;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
}

.brand em {
  color: var(--jade);
  font-style: normal;
}

.brand span {
  color: var(--muted);
  font-size: 13px;
}

.actions {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.solid, .ghost {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px;
  font-weight: 700;
}

.solid {
  background: var(--jade);
  color: var(--black);
  border: 0;
  box-shadow: 0 8px 24px rgba(0, 178, 76, 0.18);
}

.ghost {
  background: transparent;
  color: var(--white);
  border: 1px solid var(--line);
}

.ghost.on, .kit-nav button.on, .ribbon button.on {
  background: var(--jade);
  color: var(--black);
  border-color: var(--jade);
}

.ticker {
  overflow: hidden;
  height: 36px;
  display: flex;
  align-items: center;
  background: var(--black);
  color: var(--white);
}

.ticker-track {
  display: flex;
  width: max-content;
  animation: tick 28s linear infinite;
}

.ticker-group {
  display: flex;
  gap: 28px;
  padding-right: 28px;
}

.ticker span {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.16em;
  font-size: 14px;
  white-space: nowrap;
}

.ticker span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--jade);
}

.ribbon {
  background: var(--black);
  border-top: 3px solid var(--jade);
  border-bottom: 3px solid var(--azure);
}

.ribbon-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0;
}

.ribbon button {
  flex: 1 0 auto;
  min-width: 108px;
  min-height: 44px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stack {
  display: grid;
  gap: 14px;
  padding-top: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-sprite {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex: 0 0 auto;
}

.page-title {
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 600;
  line-height: 0.95;
}

.eyebrow, .kicker {
  color: var(--azure);
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 13px;
}

.card-title, .metric-name, .board-q, .kit-heading {
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-weight: 600;
  line-height: 1.1;
}

.card-title { font-size: clamp(24px, 3vw, 32px); }

.metric-name, .kit-heading { font-size: 28px; }

.board-q { font-size: clamp(22px, 3vw, 30px); }

.meta, .hint, .foot, .splash-id { color: var(--muted); }

.body { line-height: 1.55; max-width: 68ch; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px;
  display: grid;
  gap: 10px;
}

.lead { box-shadow: inset 0 3px 0 var(--jade); }

.lead-title {
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 600;
  line-height: 0.95;
}

.cards {
  display: grid;
  gap: 12px;
}

.card-actions, .filters, .seq, .picks, .form-grid, .signal-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.card-actions .solid { flex: 1; }

.text-hit {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  color: inherit;
  padding: 0;
}

.filters { margin-top: 4px; }

.picks, .form-grid { display: grid; }

.pick, .metric { display: grid; gap: 8px; }

select, .notes {
  width: 100%;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 16px;
}

select { min-height: 48px; }

.jade-name { color: var(--jade); font-weight: 700; }

.azure-name { color: var(--azure); font-weight: 700; }

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.bars {
  width: 100%;
  height: 16px;
  display: block;
}

.pills { display: flex; gap: 6px; flex-wrap: wrap; }

.pill {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-weight: 600;
}

.pill-w { background: var(--jade); color: var(--black); }

.pill-d { background: var(--white); color: var(--black); }

.pill-l { background: var(--black); color: var(--white); border: 1px solid var(--white); }

.num, .score-num, .worth, .stat b, .splash-title, .round-line {
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-variant-numeric: tabular-nums;
}

.score-card { justify-items: start; }

.score-num {
  font-size: clamp(72px, 12vw, 104px);
  line-height: 0.85;
  color: var(--jade);
}

.score-cap {
  color: var(--azure);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-family: Oswald, "Arial Narrow", sans-serif;
}

.worth { color: var(--jade); font-size: 22px; }

.rail {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
}

.rail-btn, .option, .seq-btn {
  border-radius: 12px;
  min-height: 48px;
}

.rail-btn {
  border: 1px solid var(--line);
  background: var(--black);
  color: var(--white);
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: clamp(12px, 2.4vw, 18px);
  padding: 0 2px;
}

.rail-btn.current { box-shadow: inset 0 0 0 2px var(--jade); }

.rail-btn.secure { background: var(--azure); border-color: var(--azure); color: var(--white); }

.rail-btn.miss { background: var(--black); border-color: var(--white); color: var(--white); }

.options { display: grid; gap: 8px; }

.option {
  text-align: left;
  background: var(--black);
  color: var(--white);
  border: 1px solid var(--line);
  padding: 10px 12px;
}

.option.right { background: var(--jade); color: var(--black); border-color: var(--jade); }

.option.wrong { background: var(--black); color: var(--white); border-color: var(--white); }

.option:disabled, .seq-btn:disabled { opacity: 1; }

.seq-btn:disabled { opacity: 0.55; }

.day-hero {
  position: relative;
  overflow: hidden;
  background: var(--black) url("bg-field.jpg") center/cover no-repeat;
  min-height: 200px;
}

.day-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.28), rgba(0, 0, 0, 0.78));
}

.day-hero > * { position: relative; z-index: 1; }

.streak { display: grid; gap: 8px; }

.pips { display: flex; gap: 6px; }

.pip {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--black);
  border: 1px solid rgba(255, 255, 255, 0.45);
}

.pip.lit { background: var(--jade); border-color: var(--jade); }

.order-line {
  font-family: Oswald, "Arial Narrow", sans-serif;
  letter-spacing: 0.08em;
  font-size: 20px;
}

.seq { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }

.seq-btn { font-weight: 700; border: 1px solid transparent; }

.seq-jade { background: var(--jade); color: var(--black); }

.seq-azure { background: var(--azure); color: var(--white); }

.seq-black { background: var(--black); color: var(--white); border-color: var(--white); }

.badge-mini { color: var(--jade); font-weight: 700; }

.empty { justify-items: start; }

.empty img, .badge-art {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

.badge-art.locked { filter: grayscale(1) brightness(0.65); }

.foot {
  padding: 28px 0 calc(18px + env(safe-area-inset-bottom));
  font-size: 12px;
  letter-spacing: 0.04em;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.78);
  padding: 16px;
  place-items: center;
}

.overlay.open { display: grid; }

.window {
  width: min(520px, 100%);
  max-height: min(90vh, 840px);
  overflow: auto;
  background: var(--bg);
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  display: grid;
  gap: 12px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

.kit-window { width: min(720px, 100%); }

.window-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.window-bar img {
  width: 42px;
  height: 42px;
  object-fit: contain;
}

.window-bar h2 {
  flex: 1;
  font-family: Oswald, "Arial Narrow", sans-serif;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
}

.round-line {
  text-align: center;
  letter-spacing: 0.08em;
  color: var(--azure);
  font-size: 18px;
}

.signal-stage { display: grid; justify-items: center; }

#signal-pad {
  width: min(70vw, 260px);
  height: min(70vw, 260px);
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  touch-action: manipulation;
}

#signal-lamp {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  background: var(--black);
  border: 10px solid var(--white);
  box-shadow: inset 0 0 0 8px var(--bg);
}

#signal-lamp.arming {
  border-color: var(--azure);
  animation: pulse 1s ease-in-out infinite;
}

#signal-lamp.live {
  background: var(--jade);
  border-color: var(--jade);
  box-shadow: 0 0 36px rgba(0, 178, 76, 0.75);
}

#signal-lamp.bad {
  background: var(--white);
  border-color: var(--white);
}

#signal-status {
  min-height: 3.2em;
  text-align: center;
}

.signal-stats { display: grid; grid-template-columns: 1fr 1fr; }

.stat {
  background: var(--black);
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 4px;
}

.stat span { color: var(--muted); font-size: 13px; }

.stat b { font-size: 28px; color: var(--jade); font-weight: 600; }

#signal-start { width: 100%; }

.kit-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.kit-nav button {
  flex: 0 0 auto;
  min-height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--white);
  padding: 0 12px;
  font-weight: 700;
}

.notes { min-height: 220px; resize: vertical; line-height: 1.5; }

.later-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 8px 8px 12px;
}

.later-row .text-hit { font-weight: 700; }

.history { margin: 0; padding-left: 18px; display: grid; gap: 8px; }

.chart {
  width: 100%;
  height: auto;
  background: var(--black);
  border-radius: 12px;
}

#splash {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  background: var(--black) url("bg-field.jpg") center/cover no-repeat;
  transition: opacity 0.35s ease;
}

#splash.off { opacity: 0; pointer-events: none; }

.splash-card {
  position: relative;
  width: min(460px, calc(100% - 32px));
  text-align: center;
  background: rgba(0, 0, 0, 0.74);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 20px 20px;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.splash-card img {
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.splash-title {
  font-size: clamp(36px, 8vw, 56px);
  line-height: 0.95;
  font-weight: 600;
}

.splash-bar {
  width: 100%;
  height: 4px;
  margin-top: 10px;
  background: var(--black);
  border-radius: 99px;
  overflow: hidden;
}

.splash-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--jade);
  animation: load 1.5s linear forwards;
}

@media (hover: hover) {
  .solid:hover { filter: brightness(1.06); }
  .ghost:hover, .option:hover:not(:disabled), .ribbon button:hover { border-color: var(--jade); }
}

@media (min-width: 760px) {
  .cards { grid-template-columns: 1fr 1fr; }
  .lead { grid-column: 1 / -1; }
  .picks, .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
  .cards { grid-template-columns: 1fr 1fr 1fr; }
}

@media (max-width: 420px) {
  .rail { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track, #signal-lamp.arming, .splash-bar span { animation: none; }
  .splash-bar span { width: 100%; }
  #splash { transition: none; }
}

@keyframes tick {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes load {
  to { width: 100%; }
}

@keyframes pulse {
  50% { box-shadow: 0 0 24px rgba(2, 133, 240, 0.85); }
}
