/* Race Ready - shared styles. Tokens follow the hackathon logo (spec 3.0). */
:root, html { color-scheme: light only; }
:root {
  --blue: #1F55B8;
  --blue-deep: #0F2F78;
  --lime: #DCEB4F;
  --ink: #0C1B3F;
  --black: #000000;
  --tee: #EFEDEE;
  --white: #FFFFFF;
  --line: #D4D0D2;
  --muted: #55607A;
  --tint: #E8EEF9;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", Arial, sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --slant: -12deg;
  --r: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { background-color: #EFEDEE !important; color: #0C1B3F !important; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
h1, h2, h3, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 64px; }
.wrap.wide { max-width: 1240px; }

.masthead { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; }
/* The logo is a transparent PNG now: no tile background needed. */
.masthead .logo-tile { width: 96px; flex: none; }
.masthead img { display: block; width: 100%; height: auto; }
.masthead h1 { font: italic 800 clamp(26px, 7vw, 36px)/0.95 var(--display); text-transform: uppercase; }
.masthead p { color: var(--muted); font-size: 14px; margin-top: 2px; }

.display { font: italic 800 30px/0.98 var(--display); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.tag { display: inline-block; white-space: nowrap; background: var(--black); color: #fff; padding: 2px 10px 3px; transform: skewX(var(--slant)); font: italic 700 15px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.04em; }
.tag > span { display: inline-block; transform: skewX(calc(var(--slant) * -1)); }
.tag.lime { background: var(--lime); color: var(--ink); }
.tag.blue { background: var(--blue); }
.tag.ghost { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1.5px var(--line); }

.btn { display: block; width: 100%; border: 0; border-radius: 8px; background: var(--blue); color: #fff; padding: 14px 18px; font: italic 800 20px/1 var(--display); text-transform: uppercase; letter-spacing: 0.03em; cursor: pointer; box-shadow: 0 4px 0 var(--blue-deep); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--blue-deep); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.quiet { background: var(--white); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn.quiet:active { transform: none; }
.btn.lime { background: var(--lime); color: var(--ink); box-shadow: 0 4px 0 #9AA82A; }
.linklike { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-size: 15px; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; }
.card + .card, .stack > * + * { margin-top: 12px; }
.card h3 { font-size: 15px; font-weight: 600; }

.disclose { margin: 12px 0; padding: 11px 12px; background: var(--white); border: 2px solid var(--ink); border-radius: var(--r); font-size: 15.5px; }

input[type="text"], input[type="search"], input[type="url"], textarea {
  width: 100%; border: 1.5px solid var(--ink); border-radius: 8px; padding: 11px 12px;
  background: #fff; font-size: 16px;
}
textarea { resize: vertical; }
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 5px; }

/* Lap tracker: slanted segments. Done blue, current lime + checker, upcoming white. */
.lap { display: flex; gap: 4px; padding: 0 6px; margin: 10px 0 4px; }
.lap i { flex: 1; height: 12px; transform: skewX(var(--slant)); background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); }
.lap i.done { background: var(--blue); box-shadow: none; }
.lap i.now { background-color: var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink);
  background-image: conic-gradient(rgba(12,27,63,.22) 25%, transparent 0 50%, rgba(12,27,63,.22) 0 75%, transparent 0); background-size: 8px 8px; }

/* Roster search */
.roster { list-style: none; margin: 10px 0 0; padding: 0; }
.roster li { border-top: 1px solid var(--line); }
.roster li:first-child { border-top: 0; }
.roster button { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; background: none; border: 0; padding: 11px 4px; text-align: left; cursor: pointer; font-size: 16px; }
.roster button:hover { background: var(--tint); }
.roster .who b { display: block; font-weight: 600; }
.roster .who span { font-size: 13.5px; color: var(--muted); }

/* Code boxes */
.codeboxes { display: flex; gap: 8px; justify-content: center; margin: 12px 0; }
.codeboxes input { width: 52px; height: 60px; text-align: center; font-size: 26px; font-weight: 600; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; font-variant-numeric: tabular-nums; }

.nameplate { margin-top: 10px; text-align: center; }
.nameplate .tag { font-size: 22px; padding: 4px 16px 6px; }

.error { margin-top: 10px; padding: 9px 12px; background: #FBEAEA; border: 1.5px solid #B33A3A; border-radius: 8px; color: #7C2222; font-size: 14.5px; }
.notice-ok { margin-top: 10px; padding: 9px 12px; background: var(--tint); border-radius: 8px; font-size: 14.5px; }

/* Steps on the sparring page */
.appbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.appbar b { font: italic 800 24px/1 var(--display); text-transform: uppercase; }
.countdown { font-size: 13.5px; color: var(--muted); }
.countdown strong { color: var(--ink); font-variant-numeric: tabular-nums; }

.step { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); margin-top: 12px; overflow: hidden; }
.step-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; }
.step-num { flex: none; width: 28px; height: 28px; display: grid; place-items: center; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); transform: skewX(var(--slant)); font: italic 800 16px/1 var(--display); }
.step-num > span { transform: skewX(calc(var(--slant) * -1)); }
.step.now { border: 2px solid var(--ink); }
.step.now .step-num { background: var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink); }
.step.done .step-num { background: var(--blue); color: #fff; box-shadow: none; }
.step.locked { opacity: 0.6; }
.step-head h2 { font-size: 16px; font-weight: 600; flex: 1; }
.step-head .state { font-size: 13px; color: var(--muted); }
.step-body { padding: 0 14px 14px; }

/* Pulse controls */
.energy { display: flex; gap: 8px; margin: 6px 0 2px; }
.energy button { flex: 1; height: 48px; border: 1.5px solid var(--ink); border-radius: 8px; background: #fff; font-weight: 600; font-size: 18px; cursor: pointer; }
.energy button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }
.feelings { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 2px; }
.feelings button { border: 1.5px solid var(--ink); border-radius: 999px; background: #fff; padding: 8px 14px; font-size: 15px; cursor: pointer; }
.feelings button[aria-pressed="true"] { background: var(--blue); color: #fff; border-color: var(--blue); }

.tool-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-top: 8px; }
.tool-row a { display: block; text-align: center; padding: 12px 6px; border-radius: 8px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); text-decoration: none; font: italic 800 17px/1 var(--display); text-transform: uppercase; }

details.prompt-peek { margin-top: 10px; }
details.prompt-peek summary { cursor: pointer; color: var(--blue); font-size: 15px; }
details.prompt-peek pre { white-space: pre-wrap; background: var(--tint); border-radius: 8px; padding: 10px 12px; font-size: 13px; max-height: 320px; overflow: auto; }

/* Parsed preview */
.preview details { border-top: 1px solid var(--line); padding: 8px 0; }
.preview details:first-child { border-top: 0; }
.preview summary { cursor: pointer; font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; }
.preview summary .flag { font-size: 12.5px; color: #8A5A00; background: #FFF3D6; border-radius: 5px; padding: 1px 7px; }
.preview .sect-body { white-space: pre-wrap; font-size: 14.5px; margin-top: 6px; color: var(--ink); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 8px; font-size: 15px; }
.kv span { display: block; font-size: 13px; color: var(--muted); }

.next { background: var(--ink); color: #fff; border-radius: var(--r); padding: 16px; margin-top: 12px; }
.next p { color: #C9D3EA; font-size: 14px; margin: 6px 0 14px; }
.next .display { color: #fff; }

blockquote { margin: 0; padding: 10px 12px; background: var(--tint); border-left: 4px solid var(--blue); font-size: 14.5px; }

/* Founders */
.founders-bar { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; justify-content: space-between; padding: 14px 0; }
.founders-bar b { font: italic 800 26px/1 var(--display); text-transform: uppercase; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select { border: 1.5px solid var(--ink); border-radius: 8px; padding: 8px 10px; background: #fff; font-size: 15px; }
.tablewrap { overflow-x: auto; background: var(--white); border: 1px solid var(--line); border-radius: var(--r); }
table { border-collapse: collapse; width: 100%; min-width: 760px; font-size: 14px; }
th, td { padding: 9px 10px; text-align: left; border-top: 1px solid var(--line); vertical-align: middle; }
thead th { border-top: 0; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
td small { display: block; color: var(--muted); font-size: 12.5px; }
tbody tr { cursor: pointer; }
tbody tr:hover { background: var(--tint); }
.cell { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; font-size: 13.5px; }
.cell::before { content: ""; width: 14px; height: 10px; transform: skewX(var(--slant)); flex: none; }
.cell.done::before { background: var(--blue); }
.cell.now::before { background: var(--lime); box-shadow: inset 0 0 0 1.5px var(--ink); }
.cell.none::before { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); }
.cell.none { color: var(--muted); font-weight: 500; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { display: grid; grid-template-columns: 130px 1fr 32px; gap: 10px; align-items: center; padding: 5px 0; font-size: 14px; }
.bars i { display: block; height: 14px; background: var(--blue); border-radius: 0 3px 3px 0; min-width: 2px; }
.bars b { text-align: right; font-variant-numeric: tabular-nums; }
.split-bar { display: flex; height: 16px; border-radius: 4px; overflow: hidden; margin-top: 3px; }
.split-bar i { display: block; }
.split-bar .ops { background: var(--blue); }
.split-bar .new { background: var(--lime); }
.split-bar .ppl { background: var(--ink); }
.legend { display: flex; gap: 14px; font-size: 13px; color: var(--muted); margin: 6px 0 2px; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 2px; vertical-align: -1px; margin-right: 4px; }

.view-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.view-tabs button { border: 1.5px solid var(--ink); background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 15px; font-weight: 600; cursor: pointer; }
.view-tabs button[aria-pressed="true"] { background: var(--ink); color: #fff; }

.person-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
pre.raw { white-space: pre-wrap; background: var(--tint); border-radius: 8px; padding: 10px 12px; font-size: 13px; max-height: 420px; overflow: auto; }

.side-links { margin-top: 16px; }

/* ---------- Welcome screen (CR01) ---------- */
.wrap:has(#screen-welcome:not([hidden])) .masthead { display: none; }
.welcome-hero { display: flex; flex-direction: column; min-height: calc(100vh - 140px); max-width: 640px; margin: 0 auto; }
.welcome-logo { width: 210px; margin: 0 auto 14px; }
.welcome-logo img { display: block; width: 100%; height: auto; }
.welcome-lap { margin: 0 0 18px; }
.welcome-hero .tag { align-self: flex-start; }
.welcome-headline { font-size: clamp(30px, 6vw, 44px); margin-top: 12px; }
.welcome-body { margin-top: 12px; font-size: 16.5px; }
.welcome-cards { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 16px; }
.welcome-cards h3 { font: italic 800 19px/1 var(--display); text-transform: uppercase; }
.welcome-cards p { margin-top: 5px; }
.welcome-hero .disclose { margin: 16px 0 0; }
.welcome-sign { margin: 14px 0 18px; font-size: 16px; }
.welcome-hero > .welcome-anim.a5:last-child { margin-top: auto; }
@media (min-width: 700px) {
  .welcome-cards { grid-template-columns: 1fr 1fr 1fr; }
}

/* One moment of motion on arrival. Nothing loops. */
.welcome-anim { opacity: 0; transform: translateY(10px); animation: welcome-up 0.5s ease-out forwards; }
.welcome-anim.a1 { animation-delay: 0.55s; }
.welcome-anim.a2 { animation-delay: 0.7s; }
.welcome-anim.a3 { animation-delay: 0.9s; }
.welcome-anim.a4 { animation-delay: 1.05s; }
.welcome-anim.a5 { animation-delay: 1.2s; }
.welcome-lap i { opacity: 0; transform: skewX(var(--slant)) translateX(-24px); animation: lap-in 0.35s ease-out forwards; }
.welcome-lap i:nth-child(1) { animation-delay: 0.05s; }
.welcome-lap i:nth-child(2) { animation-delay: 0.15s; }
.welcome-lap i:nth-child(3) { animation-delay: 0.25s; }
.welcome-lap i:nth-child(4) { animation-delay: 0.35s; }
.welcome-lap i:nth-child(5) { animation-delay: 0.45s; }
@keyframes welcome-up { to { opacity: 1; transform: translateY(0); } }
@keyframes lap-in { to { opacity: 1; transform: skewX(var(--slant)) translateX(0); } }
@media (prefers-reduced-motion: reduce) {
  .welcome-anim, .welcome-lap i { opacity: 1; transform: skewX(0); animation: none; }
  .welcome-lap i { transform: skewX(var(--slant)); }
}

/* ---------- Claude first (CR01) ---------- */
.claude-btn { text-align: center; text-decoration: none; }
.fallback-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.mini-tool { display: inline-block; padding: 6px 12px; border-radius: 6px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 600; }
.mini-tool:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }

/* ---------- Numbers checking tables (CR01) ----------
   Grid rows: a header line plus one card-like row per line. On a laptop the
   row is a table-ish grid; on a phone each row stacks into a card. */
.num-section { margin-top: 14px; }
.num-section > h4 { font-size: 15px; font-weight: 600; margin: 0 0 6px; }
.num-head, .num-fields { display: grid; grid-template-columns: var(--cols); gap: 6px; align-items: start; }
.num-head { font-size: 12px; font-weight: 600; color: var(--muted); padding: 0 9px 4px; }
.num-row { background: var(--white); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; margin-bottom: 8px; position: relative; }
.num-row input, .num-row select { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; font-size: 14px; background: #fff; }
.num-row input:focus, .num-row select:focus { border-color: var(--ink); outline-offset: 0; }
.nf label { display: none; font-size: 12px; color: var(--muted); margin: 0 0 2px; font-weight: 500; }
.nf.ro { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; padding-top: 9px; white-space: nowrap; }
.num-remove { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; cursor: pointer; padding: 6px; justify-self: end; }
.num-remove:hover { color: #B33A3A; }
.num-row-note { font-size: 13px; color: #8A5A00; background: #FFF3D6; border-radius: 6px; padding: 6px 9px; margin-top: 6px; }
.num-row-detail { font-size: 13px; color: var(--muted); margin-top: 6px; }
.num-row-detail .linklike { font-size: 13px; }
.detail-view { background: var(--tint); border-radius: 8px; padding: 8px 10px; margin-top: 6px; font-size: 13px; overflow-x: auto; }
.detail-view table { border-collapse: collapse; font-variant-numeric: tabular-nums; }
.detail-view th, .detail-view td { padding: 3px 12px 3px 0; border: 0; text-align: left; font-size: 13px; }
.detail-view th { color: var(--muted); font-weight: 600; }
.num-add { margin-top: 2px; }
.num-currency-total { font-size: 13.5px; color: var(--muted); margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.src-mark { display: inline-block; font-size: 11px; border-radius: 4px; padding: 1px 6px; background: var(--tint); color: var(--muted); }
.unread-lines { margin-top: 10px; }
.unread-lines code { display: block; background: var(--tint); border-radius: 6px; padding: 6px 9px; margin-top: 4px; font-size: 12.5px; word-break: break-all; }
.confirm-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 14px; font-size: 15.5px; font-weight: 600; cursor: pointer; }
.confirm-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--blue); flex: none; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.file-list li:first-child { border-top: 0; }
.file-list .linklike { font-size: 13.5px; }

/* Phone: rows become cards with labelled, stacked fields. */
@media (max-width: 700px) {
  .num-head { display: none; }
  .num-fields { grid-template-columns: 1fr 1fr; }
  .nf label { display: block; }
  .nf.wide2 { grid-column: 1 / -1; }
  .nf.ro { padding-top: 0; }
  .num-row { padding: 10px 12px 12px; }
  .num-remove { position: absolute; top: 4px; right: 6px; }
}

/* ---------- Responsive layout ---------- */

/* Narrow phones */
@media (max-width: 420px) {
  .codeboxes input { width: 46px; height: 54px; }
  .tool-row { grid-template-columns: 1fr; }
}

/* Below the desktop split, the side rail's children flow inline and the
   log-out link drops to the very bottom, after the steps. */
@media (max-width: 959px) {
  .main-grid { display: flex; flex-direction: column; }
  .main-side { display: contents; }
  .side-links { order: 99; margin-top: 20px; }
}

/* Small screens: let a long step state drop to its own line under the title */
@media (max-width: 560px) {
  .step-head { flex-wrap: wrap; }
  .step-head h2 { flex: 1 1 0; min-width: 0; }
  .step-head .state:not(:empty) { flex: 1 1 100%; margin-left: 38px; margin-top: -4px; }
  .founders-bar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .kv { grid-template-columns: 1fr; }
  .person-head { flex-direction: column; align-items: flex-start; }
  .person-head .btn { width: 100%; }
  table { font-size: 13.5px; }
  th, td { padding: 8px 7px; }
}

/* Tablet and up: breathing room, hover states for pointer devices */
@media (min-width: 768px) {
  .wrap { padding: 28px 24px 72px; }
  .masthead { padding-bottom: 20px; }
  .masthead .logo-tile { width: 108px; }
  textarea#report-text { min-height: 220px; }
}
@media (hover: hover) {
  .btn:hover { filter: brightness(1.08); }
  .btn.quiet:hover { background: var(--tint); filter: none; }
  .linklike:hover { color: var(--blue-deep); }
  .energy button:hover, .feelings button:hover { background: var(--tint); }
  .energy button[aria-pressed="true"]:hover, .feelings button[aria-pressed="true"]:hover { background: var(--blue); }
  .tool-row a:hover { background: var(--tint); }
  .view-tabs button:hover { background: var(--tint); }
  .view-tabs button[aria-pressed="true"]:hover { background: var(--ink); }
}

/* Desktop: the sparring page splits into a sticky identity rail + the steps.
   The auth screens stay a centred column. */
@media (min-width: 960px) {
  /* Auth screens stay a centred column; the sparring page widens. */
  .wrap:not(.wide) { max-width: 600px; }
  .wrap:not(.wide):has(#screen-main:not([hidden])) { max-width: 1120px; }

  .main-grid { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 32px; align-items: start; }
  .main-side { position: sticky; top: 24px; }
  .main-steps { max-width: 680px; }
  .main-steps .step:first-child { margin-top: 0; }
  .appbar b { font-size: 28px; }
  .disclose { margin-bottom: 0; }

  /* Founders: a little more air in the table */
  th, td { padding: 10px 12px; }
}

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