/* Cornhole - the stylesheet.
   NOTE ON [hidden]: no rule in this file sets `display` on `.help` or on `.open`.  Any class rule
   that sets display would OVERRIDE the [hidden] attribute, and the symptom is an invisible panel
   that still swallows every click on the page.  The help panel is hidden by the attribute alone
   (via the [hidden] rule at the top) and `.open` only changes opacity and transform.
   tools-harness-page.js asserts this by parsing the file rather than trusting the comment. */
:root {
  --grass: #2f4b2a;
  --grass-dk: #24391f;
  --panel: #14200f;
  --panel-2: #1d2c17;
  --ink: #eef3e9;
  --ink-dim: #b9c8ad;
  --line: #3a5232;
  --accent: #7ce49a;
  --accent-dk: #2f7a48;
  --warm: #f2b143;
  --red: #ba2d2d;
  --blue: #2851a3;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body {
  margin: 0; padding: 0;
  background: linear-gradient(180deg, #7cb0d6 0%, #b9d3e0 32%, var(--grass-dk) 33%, #101a0d 100%);
  color: var(--ink);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}
.top { padding: 14px 16px 4px; text-align: center; }
.top h1 {
  margin: 0; font-size: clamp(26px, 5.2vw, 44px); letter-spacing: 0.02em;
  text-shadow: 0 2px 0 #0b1408, 0 0 22px rgba(124, 228, 154, 0.22);
}
.tag { margin: 2px 0 0; color: #17304a; font-size: 14px; }
main { max-width: 1180px; margin: 0 auto; padding: 8px 12px 28px; }

.board { position: relative; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line); box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); background: #6fa3cb; }
#scene { display: block; width: 100%; height: min(58vh, 620px); min-height: 260px; }
.hud {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; gap: 8px; flex-wrap: wrap; align-items: stretch;
  pointer-events: none;
}
.sc {
  background: rgba(10, 18, 8, 0.72); border: 1px solid var(--line); border-radius: 8px;
  padding: 4px 10px; min-width: 62px; text-align: center;
}
.sc .lab { display: block; font-size: 10px; letter-spacing: 0.10em; text-transform: uppercase;
  color: var(--ink-dim); }
.sc b { font-size: 20px; font-variant-numeric: tabular-nums; }
.sc.turn { margin-left: auto; align-self: flex-start; }
.sc.turn b { font-size: 14px; color: var(--accent); }

.msg { margin: 10px 2px 12px; min-height: 2.6em; color: var(--ink-dim);
  background: rgba(10, 18, 8, 0.5); border-left: 3px solid var(--line);
  border-radius: 0 8px 8px 0; padding: 8px 12px; transition: color 180ms, border-color 180ms; }
.msg.live { color: var(--ink); border-left-color: var(--accent); }

.controls, .panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 12px;
}
.row { display: flex; align-items: center; gap: 10px; margin: 8px 0; flex-wrap: wrap; }
.row > label, .row .label {
  width: 92px; flex: 0 0 auto; color: var(--ink-dim); font-size: 13px;
  letter-spacing: 0.06em; text-transform: uppercase;
}
.row input[type=range] { flex: 1 1 220px; min-width: 160px; accent-color: var(--accent); }
.row output { flex: 0 0 130px; text-align: right; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.faces { gap: 8px; }
button, select {
  font: inherit; color: var(--ink); background: var(--panel-2);
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; cursor: pointer;
}
button:hover, select:hover { border-color: var(--accent-dk); }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent-dk); border-color: var(--accent); font-weight: 600; }
button.face { border-width: 2px; }
button.face small { display: block; font-size: 11px; color: var(--ink-dim); font-weight: 400; }
button.face.on { border-color: var(--warm); background: #33290f; }
button.face.on small { color: var(--warm); }
.row.buttons { gap: 8px; }
.row.buttons .lvl { width: auto; }
.note { margin: 6px 2px; color: var(--ink-dim); font-size: 13px; }
.note.live-info { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; color: var(--accent); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  margin: 6px 0; overflow-wrap: anywhere; }
.mono.small { font-size: 11.5px; color: var(--ink-dim); }

/* THE HELP PANEL.  Hidden by the [hidden] attribute only.  `.open` changes opacity and
   transform, never display, so the attribute always wins. */
.help {
  position: fixed; inset: 0; z-index: 40; overflow-y: auto;
  background: rgba(6, 12, 5, 0.94); padding: 20px 12px 40px;
  opacity: 1; transform: none;
}
.help.open { opacity: 1; transform: none; }
.help-inner { max-width: 820px; margin: 0 auto; background: var(--panel);
  border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px 26px; }
.help h2 { margin: 4px 0 12px; font-size: 22px; }
.help h3 { margin: 20px 0 6px; font-size: 16px; color: var(--accent); }
.help p, .help li { color: #dfe8d8; font-size: 14px; }
.help ul, .help ol { padding-left: 22px; }
.help li { margin: 5px 0; }
.help ol.recon li { font-size: 13.5px; }
.help strong { color: #fff; }
.help em { color: var(--ink-dim); font-style: italic; }
.close { float: right; margin: -4px -4px 8px 8px; }
.foot { text-align: center; color: #8ea283; font-size: 12px; padding: 4px 12px 28px; }
.foot a { color: var(--ink-dim); }
@media (max-width: 620px) {
  .row > label, .row .label { width: 100%; }
  .row output { flex: 1 1 auto; text-align: left; }
  #scene { height: 44vh; }
}
