/* Pole Vault - all of the styling.  One file, no framework, no external font. */
:root {
  --ink: #e8edf2;
  --dim: #9aa7b4;
  --bg: #101418;
  --bg2: #161c22;
  --bg3: #1d252d;
  --line: #2a343e;
  --accent: #f2c53d;
  --good: #63d19e;
  --bad: #e2603f;
  --pole: #4a9bea;
  --pad: 14px;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}
#wrap { max-width: 1180px; margin: 0 auto; padding: var(--pad); }
#top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 16px; margin-bottom: 10px; }
h1 { font-size: 26px; letter-spacing: 0.01em; margin: 0; font-weight: 700; }
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 15px; margin: 14px 0 4px; }
#meta { color: var(--dim); font-size: 14px; }
#meta b { color: var(--ink); font-weight: 600; }
.sep { opacity: 0.45; }
#tabs { margin-left: auto; display: flex; gap: 4px; flex-wrap: wrap; }
#tabs button, .ctl button, select {
  font: inherit; color: var(--ink); background: var(--bg2);
  border: 1px solid var(--line); border-radius: 7px; padding: 6px 11px; cursor: pointer;
}
#tabs button.on, .tab.on { background: var(--bg3); border-color: #3d4b59; color: #fff; }
.tab { white-space: nowrap; }
#tabs button:hover, .ctl button:hover { border-color: #4a5a6a; }
.ctl button.primary { background: #23405c; border-color: #35617f; font-weight: 600; }
.ctl button:disabled { opacity: 0.45; cursor: default; }
#stage { position: relative; background: #0b0f13; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
canvas { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #6d94bd;
  touch-action: manipulation; cursor: pointer; -webkit-user-select: none; user-select: none; }
#hud {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 8px 12px;
  background: linear-gradient(to top, rgba(6,9,12,0.86), rgba(6,9,12,0));
  font-variant-numeric: tabular-nums; pointer-events: none;
}
#phaseLine { font-size: 14px; color: #dfe7ee; }
#readout { font-size: 13px; color: var(--dim); margin-top: 2px; }
#readout b { color: var(--ink); }
kbd {
  font: 12px/1 ui-monospace, Menlo, Consolas, monospace; background: #2a343e; color: #eaf0f5;
  border: 1px solid #3d4b59; border-radius: 4px; padding: 2px 5px;
}
#plantBar {
  position: relative; height: 12px; margin: 6px 0; background: #223; border: 1px solid #3d4b59;
  border-radius: 6px; overflow: hidden;
}
#plantFill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--pole); }
#plantIdeal { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--accent); }
.message {
  position: absolute; left: 12px; top: 12px; padding: 8px 12px; border-radius: 8px;
  background: rgba(10,14,18,0.9); border: 1px solid var(--line); font-size: 14px; max-width: 70%;
}
.message.good { border-color: #2f6b52; color: var(--good); }
.message.bad { border-color: #6b3a2f; color: var(--bad); }
#panels { margin-top: 12px; }
.panel { display: none; background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.panel.on { display: block; }
.lede { color: var(--dim); margin: 0 0 10px; max-width: 74ch; }
.ctl { display: grid; grid-template-columns: 108px minmax(0, 1fr) 74px; gap: 6px 12px; align-items: center; margin-bottom: 10px; }
.ctl label { color: var(--dim); font-size: 14px; }
.ctl output { font-variant-numeric: tabular-nums; text-align: right; font-weight: 600; }
.ctl .hint { grid-column: 2 / span 2; color: var(--dim); font-size: 12.5px; margin-top: -2px; }
.ctl.row { grid-template-columns: none; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.ctl.row label { margin: 0; }
label.chk { display: inline-flex; align-items: center; gap: 6px; color: var(--dim); font-size: 13px; cursor: pointer; }
input[type=range] { width: 100%; accent-color: var(--pole); }
select { padding: 5px 8px; max-width: 100%; min-width: 0; }
.ctl > * { min-width: 0; }
#cardWrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: right; }
th:first-child, td:first-child { text-align: left; }
thead th { color: var(--dim); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tr.me td { background: #1b2733; }
td.marks { font-family: ui-monospace, Menlo, Consolas, monospace; letter-spacing: 0.12em; text-align: center; }
td.cleared { color: var(--good); }
td.failed { color: var(--bad); }
#eventLog { margin-top: 10px; color: var(--dim); font-size: 13px; }
#eventLog div { padding: 2px 0; }
#eventLog code { color: var(--accent); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; max-width: 620px; }
.kv .k { color: var(--dim); font-size: 13.5px; }
.kv .v { font-variant-numeric: tabular-nums; font-weight: 600; }
.kv .tot { border-top: 1px solid var(--line); padding-top: 4px; margin-top: 4px; }
.rule { margin: 0 0 10px; max-width: 84ch; }
.rule b { color: var(--accent); font-weight: 600; }
.rule .q { color: var(--dim); font-style: italic; }
.small { color: var(--dim); font-size: 12.5px; }
a { color: #7fb6f0; }
@media (max-width: 720px) {
  #wrap { padding: 8px; }
  h1 { font-size: 21px; }
  .ctl { grid-template-columns: 84px minmax(0, 1fr) 60px; gap: 6px 8px; }
  #tabs { margin-left: 0; width: 100%; }
  #hud { padding: 4px 8px; }
  #phaseLine { font-size: 12.5px; }
  #readout { font-size: 11px; line-height: 1.35; }
  .message { left: 6px; top: 6px; padding: 4px 8px; font-size: 12.5px; max-width: 80%; }
}
