/* Strand — layout and chrome. Same family as /orb/: one canvas as large as
   the screen allows, a thin HUD above, four buttons below. */
:root {
  --bg: #07070b; --surface: #14141e; --border: #26263a; --text: #e8e8f2; --dim: #8a8aa6;
  --accent: #7c8cff; --accent2: #5ee8c1;
  --mono: ui-monospace, 'JetBrains Mono', Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--sans); overscroll-behavior: none; }
#app {
  height: 100vh; height: 100dvh; max-width: 760px; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 16px max(10px, env(safe-area-inset-bottom));
}
#hud { width: 100%; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; font-family: var(--mono); flex-wrap: wrap; }
.toggles { display: flex; gap: 6px; margin-left: auto; }
.tog {
  font-family: var(--mono); font-size: 11px; padding: 7px 8px; border-radius: 6px; cursor: pointer; white-space: nowrap;
  background: transparent; color: var(--dim); border: 1px solid var(--border);
}
.tog.on { color: var(--bg); background: var(--accent2); border-color: var(--accent2); }
.title { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
#lvl { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dim { color: var(--dim); font-size: 11px; }
.stats { display: flex; gap: 14px; }
.stats > div { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.lab { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }
.val { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
#orb { flex: 1; width: 100%; min-height: 0; touch-action: none; user-select: none; -webkit-user-select: none; display: block; cursor: crosshair; }
#actions { width: 100%; display: flex; gap: 8px; }
button.primary, button.ghost {
  font-family: var(--mono); font-size: 13px; font-weight: 700; letter-spacing: 0.06em;
  padding: 12px 10px; border-radius: 8px; border: 1px solid var(--border); cursor: pointer; white-space: nowrap;
}
button.primary { background: var(--accent); color: #0b0b1a; border-color: var(--accent); flex: 2; }
button.ghost { background: transparent; color: var(--dim); flex: 1; }
button.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--accent); }
button:disabled { opacity: 0.3; cursor: default; }
.foot { font-family: var(--mono); font-size: 11px; color: var(--dim); text-align: center; line-height: 1.6; margin: 0; }
.foot a { color: var(--accent2); }
.overlay {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; padding: 24px 16px; text-align: center; background: rgba(7,7,11,0.9); backdrop-filter: blur(3px); overflow-y: auto;
}
.overlay[hidden] { display: none; }
.overlay h1 { font-family: var(--mono); font-size: clamp(26px, 8vw, 40px); margin: 0; color: var(--accent); }
.overlay h2 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin: 0; }
.overlay p { margin: 0; color: var(--dim); font-size: 14px; line-height: 1.65; max-width: 32em; }
.overlay p b { color: var(--text); }
.overlay .accent { color: var(--accent2); }
.row { display: flex; gap: 10px; }
.row button { flex: none; min-width: 110px; }
#level-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; width: min(560px, 100%); }
.lv {
  display: flex; gap: 8px; align-items: center; text-align: left; font-family: var(--mono); font-size: 12px;
  padding: 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer;
}
.lv b { color: var(--dim); min-width: 2ch; }
.lv.done { border-color: var(--accent2); }
.lv.done b { color: var(--accent2); }
.lv.here { outline: 2px solid var(--accent); }
