/* The hunt dashboard. Palette and base come from style.css; the level tile rules
   are copied here from style.css so the page renders even if the main sheet changes. */
main.hunt { display: block; max-width: 1100px; margin: 0 auto; padding: 0 16px 40px; }
main.hunt .panel { flex: none; width: auto; display: block; margin-bottom: 18px; }
main.hunt h2 { margin: 0 0 8px; }
main.hunt h3 { margin: 14px 0 6px; font-size: 15px; }

.stats { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 4px 0 10px; }
.stat .v { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1.1; }
.stat .k { color: var(--muted); font-size: 12.5px; }
.progress { height: 12px; background: var(--panel2); border-radius: 6px; overflow: hidden; margin: 8px 0 4px; border: 1px solid rgb(90, 90, 90); }
.progress .bar { height: 100%; background: var(--accent); }
pre.cmd { background: var(--panel2); border: 1px solid rgb(90, 90, 90); border-radius: 6px; padding: 8px 10px; overflow-x: auto; font-size: 13px; white-space: pre-wrap; word-break: break-all; }

table.chunks { border-collapse: collapse; width: 100%; font-size: 13.5px; margin-top: 8px; }
table.chunks th, table.chunks td { text-align: left; padding: 4px 8px; border-bottom: 1px solid rgb(70, 70, 70); vertical-align: top; }
table.exits td .ok, #exits .hint .ok { color: var(--good); font-weight: 700; }
table.exits td .bad { color: var(--bad); font-weight: 700; }

.champs { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0; }
.champ { display: flex; flex-direction: column; gap: 4px; max-width: 260px; }
.champ-by { color: var(--muted); font-size: 13px; text-align: center; }

/* the roots table */
.rl-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 16px; margin: 10px 0 8px; }
.rl-hide { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-size: 14px; }
.rl-box { max-height: 480px; overflow: auto; border: 1px solid rgb(70, 70, 70); border-radius: 6px; }
.rl-table { margin-top: 0; font-variant-numeric: tabular-nums; }
.rl-table thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); box-shadow: inset 0 -1px rgb(90, 90, 90); white-space: nowrap; }
.rl-table th.num, .rl-table td.num { text-align: right; }
.rl-table td.seed { white-space: nowrap; }
.rl-table .ok { color: var(--good); font-weight: 700; }
.rl-sort { background: none; border: none; padding: 0; color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.rl-sort:hover { color: var(--accent); }

/* the tree explorer */
.ex-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 4px 0 12px; font-size: 14px; }
.ex-crumb { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.ex-crumb:hover { text-decoration: underline; }
.ex-here { font-weight: 700; }
.ex-sep { color: var(--muted); }
.ex-body { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }
.ex-board { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ex-board:empty { display: none; }
.ex-side { flex: 1 1 320px; min-width: 0; }
.ex-stats { margin-bottom: 10px; }
.ex-moves { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ex-move { background: var(--panel2); border: 1px solid rgb(90, 90, 90); border-radius: 8px; color: var(--text); padding: 6px 9px;
  text-align: left; cursor: pointer; font: inherit; }
.ex-move:hover { border-color: var(--accent); }
.ex-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.ex-lab { font-weight: 700; }
.ex-move .ok { color: var(--good); font-weight: 700; }
.ex-hrs { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.ex-bar { height: 6px; background: var(--panel); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.ex-bar span { display: block; height: 100%; background: var(--accent); border-radius: 0 3px 3px 0; }
h2.question { font-size: 22px; margin: 0; }

/* the leaderboard: rank, name, a bar on a shared scale, the hours (owner 2026-10-05) */
ol.leaderboard { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
ol.leaderboard li { display: grid; grid-template-columns: 2em minmax(0, 13em) minmax(40px, 1fr) 5.5em; align-items: center; gap: 12px;
  padding: 7px 10px; border-radius: 8px; background: var(--panel2); }
.lb-rank { font-weight: 800; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
ol.leaderboard li.top .lb-rank { color: var(--text); }
.lb-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-bar { height: 10px; background: var(--panel); border-radius: 5px; overflow: hidden; }
.lb-bar span { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.lb-v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 480px) { ol.leaderboard li { grid-template-columns: 1.6em minmax(0, 1fr) 5em; } .lb-bar { grid-column: 2 / 4; grid-row: 2; } }

/* review M82: one column on a phone instead of a 300 px column in a 256 px panel */
.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 12px; }
.client { background: var(--panel2); border-radius: 8px; padding: 10px 12px; border-left: 4px solid var(--accent); }
.client.paused { border-left-color: var(--muted); opacity: .8; }
.chead { margin-bottom: 6px; }
.boards { display: flex; flex-wrap: wrap; gap: 8px; }
.lvlgrid.wallboard { padding: 3px; gap: 1px; }
/* the exit cell while a block (or the player) sits on it: a thin white ring drawn over the block */
.tile.covered::after { content: ''; position: absolute; inset: 0; box-shadow: inset 0 0 0 1px #fff; z-index: 3; pointer-events: none; }

/* ---- level grid render: Pathology "Modern" theme (copied from style.css) ---- */
.lvlgrid {
  display: grid; gap: 2px;
  background: var(--bg); padding: 8px; border-radius: 4px;
  width: max-content;
  font-weight: 400;
}
.tile {
  position: relative;
  background: var(--level-grid);
  color: var(--level-grid-text);
  display: flex; align-items: center; justify-content: center;
  user-select: none;
}
.tile.visited { background: var(--level-grid-used); }
.tile.wall { background: var(--level-wall); }
.tile.exit { background: var(--level-end); }
.tile.hole {
  background: var(--level-hole);
  border-style: solid;
  border-color: var(--level-hole-border);
}
.tile .block {
  position: absolute; inset: 0;
  background: var(--level-block);
  border-color: var(--level-block-border);
}
.tile .player {
  position: absolute; inset: 0;
  background: var(--level-player);
  color: var(--level-grid-text);
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}

/* review M82: wide tables scroll inside their panel instead of widening the page; tighter padding on phones */
#exitTable, .people, .tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.stale { border-left: 4px solid var(--bad); padding: 6px 10px; background: var(--panel2); border-radius: 6px; }
.done { border-left: 4px solid var(--good); padding: 6px 10px; background: var(--panel2); border-radius: 6px; }
@media (max-width: 480px) {
  main.hunt { padding-left: 0; padding-right: 0; }
  main.hunt .panel { padding: 14px 12px; }
  table.chunks { font-size: 12.5px; }
  table.chunks th, table.chunks td { padding: 3px 5px; }
  .stat .v { font-size: 22px; }
  .champs { gap: 10px; }
}

/* per-root chart (rootschart.js) */
.rt-chart { width: 100%; overflow-x: auto; }
.rt-chart.rt-stale { opacity: .6; transition: opacity .2s; }
.rt-panel { display: block; margin: 4px 0 10px; }
.rt-title { fill: var(--text); font-size: 13px; }
.rt-tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.rt-grid { stroke: rgb(72, 72, 72); stroke-width: 1; }
.rt-base { stroke: rgb(110, 110, 110); stroke-width: 1; }
.rt-hover { fill: rgba(255, 255, 255, .28); pointer-events: none; }
.rt-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 6px 0 4px; font-size: 13px; color: var(--muted); }
.rt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.rt-swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.rt-muted { color: var(--muted); }
.rt-tip { position: fixed; z-index: 20; pointer-events: none; background: rgb(30, 30, 30); border: 1px solid rgb(90, 90, 90);
          border-radius: 6px; padding: 8px 10px; font-size: 13px; max-width: 320px; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.rt-tip .rt-value { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 2px; }
.rt-tip .rt-line { color: var(--text); display: flex; align-items: center; gap: 6px; word-break: break-all; }
.rt-tip .rt-line.rt-muted { color: var(--muted); }
.rt-tip .rt-key { display: inline-block; width: 12px; height: 2px; border-radius: 1px; }
