:root {
  /* Volu: ink, cream, paper and one accent. Gyms' public pages swap --brand / --accent / --on-accent for their own. */
  --bg: #EFE8D6; --panel: #F6F1E4; --ink: #111111; --muted: #5A5547; --line: #CFC6AF; --rule: #111111;
  --ok: #1B7A3E; --bad: #B3261E; --warn: #8A5A00; --grid: rgba(17,17,17,.055);
  --brand: #111111; --on-brand: #EFE8D6; --accent: #424FD7; --on-accent: #FFFFFF;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #111111; --panel: #1B1B19; --ink: #EFE8D6; --muted: #B0A992; --line: #34332E; --rule: #5A584F; --ok: #6FD69A; --bad: #FF8A80; --warn: #F0B45A; --grid: rgba(239,232,214,.045); } }
:root[data-theme="dark"] { --bg: #111111; --panel: #1B1B19; --ink: #EFE8D6; --muted: #B0A992; --line: #34332E; --rule: #5A584F; --ok: #6FD69A; --bad: #FF8A80; --warn: #F0B45A; --grid: rgba(239,232,214,.045); }
* { box-sizing: border-box; }
html, body { margin: 0; }
html { background-color: var(--bg); }
body { color: var(--ink); font: 15px/1.5 "IBM Plex Sans", "Segoe UI", Arial, sans-serif; }
html { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 24px 24px; min-height: 100%; }
body { background: transparent; }
html.embed { background: transparent; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 0; padding: 8px 10px; width: 100%; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
input[type=checkbox], input[type=radio] { width: auto; }
.top { background: var(--brand); color: var(--on-brand); border-bottom: 1px solid var(--rule); }
.top .in { max-width: 1100px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.logo { font-weight: 700; font-size: 21px; letter-spacing: -.5px; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.logo img { display: block; } .logo .small { display: none; }
@media (max-width: 640px) { .logo .big { display: none; } .logo .small { display: block; } }
.top nav { margin-left: auto; display: flex; gap: 10px; align-items: center; font-size: 14px; }
.top nav a, .top nav button { color: var(--on-brand); background: none; border: 1px solid color-mix(in srgb, var(--on-brand) 40%, transparent); border-radius: 0; padding: 5px 10px; text-decoration: none; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 28px; line-height: 1.15; margin: 4px 0 6px; }
h2 { font-size: 18px; margin: 0 0 10px; }
.muted { color: var(--muted); }
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 0; padding: 16px; margin-bottom: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.f span.hint { font-size: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; margin: 6px 0; }
.btn { border: 1px solid var(--rule); border-radius: 0; padding: 10px 16px; font-weight: 700; background: var(--accent); color: var(--on-accent); text-decoration: none; display: inline-block; }
.btn.alt { background: transparent; color: var(--ink); border: 1px solid var(--rule); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { text-align: left; padding: 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); font-weight: 500; }
table.t input, table.t select { padding: 6px 8px; }
/* a row of buttons in a table cell: stay a real cell (display:flex on a <td> breaks the row height and its bottom line) */
table.t td.row { display: table-cell; white-space: nowrap; }
/* item 66: team names are saved in capitals – show them that way while typing */
input[name="team_name"], #edName { text-transform: uppercase; }
table.t td.row > * + * { margin-left: 6px; }
table.t select { min-width: 110px; }
.x { background: none; border: 0; color: var(--muted); font-size: 18px; line-height: 1; padding: 4px 8px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.card { display: block; text-decoration: none; background: var(--panel); border: 1px solid var(--rule); border-radius: 0; padding: 14px 16px; }
.card:hover { border-color: var(--accent); }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 0; background: var(--line); }
.pill.live { background: var(--accent); color: var(--on-accent); } .pill.draft { background: #e7c66b; color: #3a2b00; } .pill.archived { background: var(--line); } .pill.hidden { background: #999; color: #fff; } .pill.bad { background: var(--bad); color: #fff; }
.problems { background: color-mix(in srgb, var(--bad) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); border-radius: 0; padding: 10px 14px; margin: 0 0 12px; }
.problems { list-style: disc; padding-left: 32px; position: relative; }
.problems li { margin: 2px 0; }
.problems .close { position: absolute; top: 6px; right: 8px; background: none; border: 0; font-size: 20px; color: var(--muted); cursor: pointer; }
.err { color: var(--bad); font-weight: 600; }
.okm { color: var(--ok); font-weight: 600; }
.sticky { position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); z-index: 3; }
.hero { background: var(--brand); color: var(--on-brand); }
.hero .in { max-width: 1100px; margin: 0 auto; padding: 34px 16px 28px; }
.hero h1 { font-size: 40px; }
.hero .meta { opacity: .85; }
.toast { position: fixed; right: 16px; bottom: 16px; background: #111111; color: #EFE8D6; border-left: 6px solid var(--accent); padding: 12px 16px; border-radius: 0; display: none; font-weight: 600; max-width: 420px; z-index: 30; }
.code { font-size: 28px; letter-spacing: 6px; text-align: center; }
@media (max-width: 640px) { .hero h1 { font-size: 30px; } h1 { font-size: 24px; } table.t.stack thead { display: none; } table.t.stack td { display: block; border: 0; padding: 3px 0; } table.t.stack tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; } }

.fgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 8px 0; }
details.formulas > summary { cursor: pointer; padding: 6px 0; }
.pts { display: flex; gap: 6px; flex-wrap: wrap; }
.pts label { display: flex; flex-direction: column; gap: 2px; min-width: 64px; flex: 1; }
.pts small { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pts input.custom { border-color: var(--accent); background-image: radial-gradient(circle at calc(100% - 7px) 7px, var(--accent) 3px, transparent 3.5px); }
.problems a { color: inherit; text-decoration: underline dotted; }
.flash { outline: 3px solid var(--accent) !important; transition: outline .3s; }
.byvolu { text-align: center; font-size: 12px; margin-top: 24px; } .byvolu a { color: var(--muted); }
html.embed body { background: transparent; } html.embed .wrap { padding-bottom: 12px; }
html.noheader .hero { display: none; }

/* staff pages */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: 6px 0 14px; }
.tabs a { padding: 8px 14px; text-decoration: none; border-bottom: 3px solid transparent; font-weight: 600; color: var(--muted); }
.tabs a.on { color: var(--ink); border-color: var(--accent); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--ink); padding: 7px 14px; }
.seg button.on { background: var(--accent); color: var(--on-accent); font-weight: 700; }
fieldset.person { border: 1px solid var(--line); border-radius: 0; margin: 8px 0; padding: 4px 10px; }
fieldset.person legend { font-size: 13px; color: var(--muted); padding: 0 4px; }
tr.removed td { opacity: .5; text-decoration: line-through; } tr.removed td:last-child { opacity: 1; text-decoration: none; }
tr.prize td { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.desk { display: grid; grid-template-columns: 300px 1fr; gap: 14px; align-items: start; }
@media (max-width: 800px) { .desk { grid-template-columns: 1fr; } }
.hit { display: block; width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--line); border-radius: 0; padding: 8px 10px; margin: 6px 0; color: var(--ink); }
.hit:hover, .hit:focus-visible { border-color: var(--accent); }
.climbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 6px; }
.cl { display: flex; flex-direction: column; align-items: center; border: 1px solid var(--line); border-radius: 0; padding: 4px; }
.cl small { font-size: 11px; color: var(--muted); white-space: nowrap; }
.cl input { text-align: center; font-size: 20px; font-weight: 700; padding: 4px; border: 0; background: transparent; }
.cl.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 15%, transparent); }
.cl input.bad { outline: 2px solid var(--bad); }
.big { font-size: 22px; }
h3 { font-size: 15px; margin: 14px 0 6px; }
table.grid td, table.grid th { padding: 4px 5px; text-align: center; font-size: 13px; } table.grid td:nth-child(2), table.grid th:nth-child(2) { text-align: left; white-space: nowrap; }
table.grid td.hit { background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 700; }
.vid { font-family: var(--mono); letter-spacing: .5px; white-space: nowrap; }
.vid.small { font-size: 11px; color: var(--muted); }
.bib { font-size: 1.25em; font-family: var(--mono); letter-spacing: .5px; white-space: nowrap; }
.muted.small, div.small { font-size: 11px; }
.qr svg { width: 220px; height: 220px; background: #fff; padding: 8px; border-radius: 0; }
.tip { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 11px; font-weight: 700; cursor: help; position: relative; vertical-align: 1px; margin-left: 3px; }
.tip:hover::after, .tip:focus::after { content: attr(data-tip); position: absolute; left: 50%; bottom: 125%; transform: translateX(-50%); width: 260px; background: #222; color: #fff; font-weight: 400; font-size: 12px; line-height: 1.4; padding: 8px 10px; border-radius: 0; z-index: 20; text-align: left; white-space: normal; }
@media (max-width: 640px) { .tip:hover::after, .tip:focus::after { left: auto; right: -10px; transform: none; } }
.dlist { max-height: 55vh; overflow-y: auto; }
.dlist .hit { display: grid; grid-template-columns: auto 1fr auto; column-gap: 8px; }
.dlist .hit .muted { grid-column: 2; font-size: 12px; } .dlist .hit .sc { grid-column: 3; grid-row: 1 / span 2; align-self: center; font-size: 13px; font-weight: 600; }
.hit.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--bg)); }
.scroll { overflow-x: auto; margin-top: 8px; }
table.dgrid { border-collapse: collapse; width: auto; min-width: 100%; font-size: 13px; }
table.dgrid th, table.dgrid td { padding: 4px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; }
table.dgrid .nm { text-align: left; } table.dgrid td:nth-child(3), table.dgrid th:nth-child(3) { text-align: left; }
table.dgrid th.sec { border-bottom: 2px solid var(--accent); font-size: 12px; }
table.dgrid .cn { min-width: 26px; } table.dgrid .first { border-left: 1px solid var(--line); }
table.dgrid td.got { background: color-mix(in srgb, var(--accent) 18%, transparent); font-weight: 600; }
table.dgrid td.top { background: var(--accent); color: var(--on-accent); font-weight: 700; }
table.dgrid .num { text-align: right; border-left: 1px solid var(--line); }
.card.tool { max-width: 360px; }

.mono { font-family: var(--mono); }
.pill { font-family: var(--mono); font-weight: 500; text-transform: uppercase; letter-spacing: .3px; font-size: 11px; }
h1 { letter-spacing: -.5px; }
.waiver { max-height: 180px; overflow-y: auto; border: 1px solid var(--rule); background: var(--bg); padding: 10px 12px; font-size: 13px; margin-bottom: 8px; white-space: pre-line; }
tr.more td { background: var(--bg); font-size: 13px; }
.done h2 { font-size: 26px; }
.check input { flex: none; margin-top: 4px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
tr.flag td { background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* team editor (Entrants tab) */
.edit td { background: var(--paper, #fff); }
.medit input, .medit select { min-width: 0; width: 100%; }
.medit td { vertical-align: top; }

/* Scorecards: boxes dragged on the artwork preview */
.stage .cbox { border: 2px solid #1f6feb; background: rgba(31, 111, 235, .12); cursor: move; touch-action: none; display: flex; align-items: center; padding: 0 3px; overflow: hidden; }
.stage .cbox span { font: 600 10px/1.1 "IBM Plex Sans", Arial, sans-serif; color: #0b3d91; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.stage .cbox.bar { padding: 0; background: rgba(255, 255, 255, .85); }
.stage .cbox.on { border-color: #c2364f; background: rgba(194, 54, 79, .14); z-index: 2; }
.stage .cbox.bar.on { background: rgba(255, 255, 255, .9); }
.stage .cbox .h { position: absolute; right: -6px; bottom: -6px; width: 12px; height: 12px; border-radius: 50%; background: #1f6feb; border: 2px solid #fff; cursor: nwse-resize; }
.stage .cbox.on .h { background: #c2364f; }
@media (max-width: 860px) { .cardgrid { grid-template-columns: minmax(0, 1fr) !important; } }
