/* Crunch Alpha replay. The Hub's look: dark surfaces, Geist, mono labels, one orange accent.
   Every colour is a variable here, so matching the Hub exactly later is a re-skin. */

@font-face { font-family: "Geist"; src: url("vendor/Geist-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("vendor/GeistMono-Variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface-2: #232323;
  --surface-3: #2e2e2e;
  --border: #2f2f2f;
  --border-strong: #454545;
  --text: #fafafa;
  --text-2: #bdbdbd;
  --muted: #8a8a8a;
  --faint: #5c5c5c;
  --accent: #eb6924;
  --accent-2: #ff7f3f;
  --accent-soft: rgba(235, 105, 36, 0.14);
  --up: #5fd38d;
  --down: #f2706a;
  --up-soft: rgba(95, 211, 141, 0.12);
  --down-soft: rgba(242, 112, 106, 0.12);
  --radius: 6px;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.5 var(--sans); font-feature-settings: "tnum" 1; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent-2); }
h1, h2, h3 { font-weight: 500; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: 28px; font-weight: 300; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0 0 10px; color: var(--text-2); }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.up { color: var(--up); }
.down { color: var(--down); }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* The small bordered tag the Hub puts above headings */
.tag { display: inline-flex; align-items: center; gap: 6px; font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
       color: var(--text-2); border: 1px solid var(--border-strong); background: var(--surface-2); border-radius: 4px; padding: 5px 7px; }
.tag.accent { color: var(--accent-2); border-color: rgba(235, 105, 36, 0.5); background: var(--accent-soft); }
.tag.dim { color: var(--muted); }
.label { font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 28px; padding: 0 24px; height: 56px;
       background: rgba(15, 15, 15, 0.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; white-space: nowrap; }
.brand .mark { display: inline-flex; gap: 2px; align-items: center; }
.brand .mark i { display: block; width: 4px; height: 16px; background: var(--text); border-radius: 1px; }
.brand .mark i:nth-child(2) { height: 11px; }
.brand .mark i:last-child { background: var(--accent); }
.brand .sub { font: 500 10.5px/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.top nav { display: flex; gap: 4px; }
.top nav a { padding: 7px 12px; border-radius: var(--radius); color: var(--text-2); white-space: nowrap; }
.top nav a:hover { background: var(--surface-2); color: var(--text); }
.top nav a.on { background: var(--surface-2); color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }
.who { margin-left: auto; display: flex; align-items: center; gap: 12px; color: var(--muted); white-space: nowrap; }
.who form { margin: 0; }

/* Buttons and inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--radius);
       border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 500 13px/1 var(--sans); cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; }
.btn.small { height: 28px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; font: inherit; }
.link:hover { color: var(--accent-2); }
input[type=date], input[type=text], input[type=password] {
  height: 34px; padding: 0 10px; border-radius: var(--radius); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text); font: 13px var(--sans); }
input:focus, .btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=file] { color: var(--text-2); font: 13px var(--sans); }
input[type=file]::file-selector-button { height: 30px; margin-right: 10px; padding: 0 12px; border-radius: var(--radius); border: 1px solid var(--border-strong);
  background: var(--surface-3); color: var(--text); font: 500 12px var(--sans); cursor: pointer; }

/* The clock: where the user stands in the season */
.clock { border-bottom: 1px solid var(--border); background: linear-gradient(180deg, #151515, var(--bg)); }
.clock-in { max-width: 1280px; margin: 0 auto; padding: 18px 24px 16px; display: grid; grid-template-columns: auto 1fr; gap: 10px 32px; align-items: center; }
.today-date { font: 400 30px/1.05 var(--mono); letter-spacing: 0.02em; text-transform: uppercase; }
.today-sub { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.steps { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; align-items: center; }
.steps form { margin: 0; display: flex; gap: 8px; align-items: center; }
.steps .sep { width: 1px; height: 22px; background: var(--border-strong); margin: 0 4px; }
.season { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; }
.season .bar { flex: 1; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.season .bar i { display: block; height: 100%; background: var(--accent); }
.season .label { white-space: nowrap; }
.running { grid-column: 1 / -1; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid rgba(235, 105, 36, 0.4);
           background: var(--accent-soft); border-radius: var(--radius); color: var(--text); }
.running .bar { flex: 1; height: 4px; background: rgba(255, 255, 255, 0.08); border-radius: 2px; overflow: hidden; }
.running .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 0.3s; }
.spinner { width: 14px; height: 14px; border: 2px solid rgba(255, 255, 255, 0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Layout */
main { max-width: 1280px; margin: 0 auto; padding: 24px; }
.grid { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.cols-2e { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head .tag { flex: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.page-head p { margin: 6px 0 0; max-width: 760px; }
.stack > * + * { margin-top: 16px; }

/* Numbers */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.kpi { background: var(--surface); padding: 12px 14px; min-width: 0; }
.kpi .v { font: 400 21px/1.2 var(--mono); margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .s { color: var(--muted); font-size: 12px; margin-top: 2px; }
.chart { position: relative; height: 260px; }
.chart.small { height: 170px; }
.chart.tall { height: 320px; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { font: 500 10.5px/1.2 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 9px 10px;
     border-bottom: 1px solid var(--border-strong); white-space: nowrap; }
th.num, td.num { text-align: right; }
td { padding: 9px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td.num { font-family: var(--mono); font-size: 12.5px; }
tbody tr:hover td { background: var(--surface-2); }
tr.me td { background: var(--accent-soft); }
tr.me td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--text); }
th.sorted { color: var(--accent-2); }
.rank { font-family: var(--mono); color: var(--muted); width: 36px; }
.model-cell { display: flex; flex-direction: column; gap: 2px; }
.model-cell .k { font: 500 10px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--faint); }

/* Tabs */
.tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.tabs a { padding: 6px 12px; border-radius: 6px; color: var(--text-2); font-size: 13px; }
.tabs a.on { background: var(--surface-3); color: var(--text); }

/* Submissions */
.verdict { border-radius: 8px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface-2); }
.verdict.ok { border-color: rgba(95, 211, 141, 0.4); background: var(--up-soft); }
.verdict.bad { border-color: rgba(242, 112, 106, 0.4); background: var(--down-soft); }
.verdict .t { font-weight: 500; margin-bottom: 4px; }
.verdict ul { margin: 6px 0 0; padding-left: 18px; color: var(--text-2); }
.drop { border: 1px dashed var(--border-strong); border-radius: 8px; padding: 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.rules { margin: 0; padding-left: 18px; color: var(--text-2); }
.rules li { margin: 3px 0; }
.attempts td { font-size: 12.5px; }
.pill { display: inline-block; font: 500 10px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 6px; border-radius: 4px; }
.pill.ok { color: var(--up); background: var(--up-soft); }
.pill.bad { color: var(--down); background: var(--down-soft); }
.pill.dim { color: var(--muted); background: var(--surface-3); }

/* Monthly returns */
.months td.num { padding: 6px 8px; font-size: 12px; }
.months td.cell-up { background: rgba(95, 211, 141, var(--a, 0.1)); }
.months td.cell-down { background: rgba(242, 112, 106, var(--a, 0.1)); }

/* Sign in */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 0; }
.login-left { display: flex; flex-direction: column; justify-content: center; padding: 48px max(32px, 8vw); gap: 18px; }
.login-left form { display: grid; gap: 12px; max-width: 360px; }
.login-left .field { display: grid; gap: 6px; }
.login-left input { height: 40px; }
.login-left .btn { height: 40px; }
.login-right { margin: 16px; border-radius: 14px; border: 1px solid var(--border); position: relative; overflow: hidden; display: flex; align-items: center; padding: 48px;
  background:
    linear-gradient(90deg, rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(rgba(255,255,255,0.035) 1px, transparent 1px) 0 0 / 48px 48px,
    radial-gradient(120% 90% at 85% 15%, rgba(235, 105, 36, 0.20), transparent 55%),
    #141414; }
.login-right .big { font-size: clamp(40px, 5vw, 64px); font-weight: 600; line-height: 1.02; letter-spacing: -0.03em; }
.login-right .big span { display: block; }
.login-right .big span:nth-child(2) { padding-left: 1.2em; color: var(--accent); }
.login-right .foot { position: absolute; left: 48px; bottom: 32px; right: 48px; color: var(--muted); font-size: 12.5px; }
.error { color: var(--down); }

footer { max-width: 1280px; margin: 24px auto 0; padding: 18px 24px 32px; border-top: 1px solid var(--border); color: var(--faint); font-size: 11.5px; }
footer p { color: var(--faint); margin: 0 0 6px; }

/* Hover explanations */
[data-tip] { cursor: help; text-decoration: underline dotted var(--faint); text-underline-offset: 3px; text-decoration-thickness: 1px; }
th[data-tip], .label[data-tip], .tag[data-tip], summary[data-tip], .season[data-tip] { text-decoration: none; }
/* Something you can click keeps the hand cursor and no marker: the explanation still shows on hover */
.btn[data-tip], a[data-tip], button[data-tip], summary[data-tip] { cursor: pointer; text-decoration: none; }
.btn[data-tip]::after, a[data-tip]::after, summary[data-tip]::after { content: none; }
.season[data-tip] { cursor: default; }
.check { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size: 12.5px; cursor: pointer; }
.check input { accent-color: var(--accent); width: 15px; height: 15px; }
th[data-tip]::after, .tag[data-tip]::after, .label > [data-tip]::after { content: "ⓘ"; margin-left: 4px; font-size: 9px; color: var(--faint); vertical-align: 1px; }
#tip { position: fixed; z-index: 100; max-width: 320px; padding: 9px 11px; border-radius: 8px; background: #0b0b0b; border: 1px solid var(--border-strong);
       color: var(--text-2); font: 400 12.5px/1.45 var(--sans); letter-spacing: 0; text-transform: none; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5); pointer-events: none; }

/* Restart */
.restart { position: relative; }
.restart summary { list-style: none; }
.restart summary::-webkit-details-marker { display: none; }
.restart-pop { position: absolute; right: 0; top: 40px; z-index: 30; display: grid; gap: 8px; width: 260px; padding: 14px; background: var(--surface);
               border: 1px solid var(--border-strong); border-radius: 10px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5); }

.note { margin-top: 12px; padding: 10px 12px; border-radius: 8px; border: 1px dashed var(--border-strong); color: var(--muted); font-size: 12px; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: 8px; }

@media (max-width: 980px) {
  .cols-2, .cols-2e { grid-template-columns: minmax(0, 1fr); }
  .clock-in { grid-template-columns: minmax(0, 1fr); }
  .steps { justify-content: flex-start; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .top { gap: 12px; padding: 0 16px; overflow-x: auto; }
  .top .who span { display: none; }
  main { padding: 16px; }
  .login-wrap { grid-template-columns: minmax(0, 1fr); }
  .login-right { display: none; }
}
