/* Liner Clues - a record-shop counter: kraft-paper sleeves, a black disc, tomato and teal ink, liner notes in a serif. */
:root {
  --bg: #f1e9da; --card: #fffaf1; --ink: #211b14; --muted: #6a5d4c; --line: #d8c9ae; --kraft: #e3d1b0; --kraft-ink: #4a3b27;
  --tomato: #b8361f; --tomato-soft: #f7ddd3; --teal: #1f6b64; --teal-soft: #d5ebe7; --mustard: #8a5b00; --mustard-soft: #f6e5bd;
  --vinyl: #17130f; --groove: #3a332b; --hole: #f1e9da; --label-ink: #211b14;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Book Antiqua", serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --shadow: 0 1px 0 rgba(60,40,10,0.06), 0 8px 22px rgba(60,40,10,0.08);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #15120e; --card: #1f1a14; --ink: #f1e7d6; --muted: #b9a98f; --line: #3d3428; --kraft: #3a2f22; --kraft-ink: #ead9bb;
  --tomato: #ff8a6b; --tomato-soft: #3d1d14; --teal: #6fd0c4; --teal-soft: #12302c; --mustard: #f2bf55; --mustard-soft: #392b0e;
  --vinyl: #050403; --groove: #2c261f; --hole: #15120e; --label-ink: #1b150e;
  --shadow: 0 1px 0 rgba(0,0,0,0.4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; overflow-x: hidden; }
a { color: var(--tomato); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--kraft); color: var(--kraft-ink); padding: 0 4px; border-radius: 3px; }
.hidden { display: none !important; }
.small { font-size: 0.86rem; }
.muted { color: var(--muted); }

.bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; background: var(--card); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.back { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.12rem; font-family: var(--serif); }
.logo { width: 30px; height: 30px; }
.lg-sleeve { fill: var(--kraft); stroke: var(--ink); stroke-width: 1.6; }
.lg-disc { fill: var(--vinyl); }
.lg-label { fill: var(--tomato); }
.session { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pill { border: 1px solid var(--ink); background: var(--card); color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.85rem; cursor: pointer; text-decoration: none; display: inline-block; }
.pill:hover:not(:disabled) { background: var(--kraft); color: var(--kraft-ink); }
.pill.solid { background: var(--ink); color: var(--card); }
.pill.solid:hover:not(:disabled) { background: var(--tomato); color: #fff; border-color: var(--tomato); }
.pill.ghost { border-style: dashed; cursor: default; }
.pill.tiny { padding: 2px 9px; font-size: 0.78rem; }
.pill:disabled { opacity: 0.45; cursor: not-allowed; }

main { max-width: 1120px; margin: 0 auto; padding: 18px 16px 40px; }
.hero h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(1.7rem, 4.4vw, 2.6rem); line-height: 1.12; margin: 12px 0 8px; letter-spacing: -0.01em; max-width: 820px; }
.lede { max-width: 760px; margin: 0 0 12px; }
.samples { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.chip { border: 1px solid var(--ink); background: transparent; color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.86rem; cursor: pointer; }
.chip.on, .chip:hover { background: var(--ink); color: var(--card); }

.workbench { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; margin-bottom: 14px; box-shadow: var(--shadow); }
.ph { font-family: var(--serif); font-size: 1.25rem; margin: 2px 0 8px; }
.mini { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin: 14px 0 6px; }
.lbl { display: block; font-size: 0.86rem; font-weight: 600; margin: 10px 0 4px; }
input[type=text], textarea, select { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px; }
textarea { font-family: var(--mono); font-size: 0.9rem; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: var(--teal); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.drop { border: 1px dashed var(--line); border-radius: 6px; padding: 6px; }
.drop.over { border-color: var(--teal); background: var(--teal-soft); }
.drop textarea { border: 0; background: transparent; }
.drop-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filebtn { border: 1px solid var(--ink); border-radius: 999px; padding: 2px 10px; font-size: 0.8rem; cursor: pointer; }
.filebtn input { display: none; }

/* The crate preview of the list */
.crate { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px; }
.crate-item { display: flex; gap: 8px; align-items: center; background: var(--kraft); color: var(--kraft-ink); border-radius: 4px; padding: 6px 8px; border-left: 6px solid var(--ink); min-width: 0; }
.crate-item .muted { color: var(--kraft-ink); opacity: 0.85; }
.ci-n { font-family: var(--mono); font-weight: 700; }
.ci-body { display: flex; flex-direction: column; min-width: 0; }
.ci-body b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.none { color: var(--muted); font-style: italic; list-style: none; }
.flags, .recon { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 4px; }
.flags li, .recon li { font-size: 0.88rem; padding: 4px 8px; border-radius: 4px; background: var(--bg); }
.lv { display: inline-block; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; margin-right: 6px; padding: 0 5px; border-radius: 3px; }
.lv-fix .lv, .recon .warn::before { background: var(--tomato-soft); color: var(--tomato); }
.lv-warn .lv { background: var(--mustard-soft); color: var(--mustard); }
.lv-info .lv { background: var(--teal-soft); color: var(--teal); }
.recon .warn { border-left: 3px solid var(--tomato); }
.recon .info { border-left: 3px solid var(--teal); }
.note { color: var(--mustard); }
.runrow { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.btn { border: 1px solid var(--ink); background: var(--card); color: var(--ink); border-radius: 6px; padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.btn.solid { background: var(--tomato); border-color: var(--tomato); color: #fff; }
:root[data-theme="dark"] .btn.solid { color: #1b0f0a; }
.btn.ghost { border-style: dashed; }
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.gate { margin: 10px 0 0; padding: 8px 10px; background: var(--mustard-soft); color: var(--ink); border-radius: 4px; font-size: 0.9rem; }
.gate .pill { margin-left: 4px; }

.progress .steps { list-style: none; padding: 0; margin: 6px 0; }
.step { color: var(--muted); }
.step.active { color: var(--ink); font-weight: 600; }
.step.done { color: var(--teal); }
.step-ic { font-family: var(--mono); display: inline-block; width: 1.2em; }
.raw { white-space: pre-wrap; font-family: var(--mono); font-size: 0.8rem; max-height: 340px; overflow: auto; }

/* The deck summary */
.deck-head { display: flex; gap: 14px; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; }
.deck-head > div { flex: 1 1 320px; min-width: 0; }
.counts { list-style: none; padding: 0; margin: 4px 0; display: flex; gap: 10px; flex-wrap: wrap; }
.partial { background: var(--mustard-soft); padding: 6px 10px; border-radius: 4px; }
.tag { display: inline-block; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.04em; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; }
.tag.st-ready { color: var(--teal); background: var(--teal-soft); }
.tag.st-notes_only { color: var(--mustard); background: var(--mustard-soft); }
.tag.st-need_notes { color: var(--tomato); background: var(--tomato-soft); }
.tag.st-none { color: var(--muted); background: var(--bg); }

/* The record crate: one spine per round */
.spines { list-style: none; padding: 0 0 4px; margin: 0 0 14px; display: flex; gap: 4px; overflow-x: auto; }
.spine { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 84px; padding: 8px 8px 6px; border: 1px solid var(--line); border-top: 5px solid var(--muted); background: var(--kraft); color: var(--kraft-ink); border-radius: 3px; font: inherit; cursor: pointer; text-align: left; }
.spine.st-ready { border-top-color: var(--teal); }
.spine.st-notes_only { border-top-color: var(--mustard); }
.spine.st-need_notes { border-top-color: var(--tomato); }
.spine.on { background: var(--ink); color: var(--card); }
.spine.played .sp-n { text-decoration: line-through; }
.sp-n { font-family: var(--mono); font-weight: 700; font-size: 1.05rem; }
.sp-t { font-size: 0.72rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The turntable: sleeve and disc on the left, liner notes on the right */
.turntable { display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 22px; align-items: start; }
.sleeve-wrap { position: relative; width: 68%; max-width: 272px; aspect-ratio: 1 / 1; }
.cover, .disc { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.cover { border-radius: 3px; box-shadow: 0 6px 18px rgba(0,0,0,0.25); z-index: 2; }
.disc { transform: translateX(10%) scale(0.94); transition: transform 0.7s cubic-bezier(.2,.7,.2,1); z-index: 1; }
.sleeve-wrap.out .disc { transform: translateX(46%) scale(0.94) rotate(200deg); }
.dk-vinyl { fill: var(--vinyl); stroke: var(--groove); stroke-width: 2; }
:root[data-theme="dark"] .dk-vinyl { stroke: #5a4e3e; }
.dk-groove { fill: none; stroke: var(--groove); stroke-width: 1; }
.dk-hole { fill: var(--hole); }
.dk-label { fill: var(--label-ink); font-family: var(--serif); font-weight: 700; }
.dk-side { fill: var(--label-ink); font-family: var(--mono); letter-spacing: 0.1em; }
.cv-no { font: 700 26px var(--mono); }
.liner { position: relative; z-index: 3; background: var(--kraft); color: var(--kraft-ink); border-radius: 4px; padding: 14px 16px; font-family: var(--serif); min-width: 0; }
.liner-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; border-bottom: 2px solid var(--kraft-ink); padding-bottom: 4px; flex-wrap: wrap; }
.liner-head h3 { margin: 0; font-size: 1.2rem; }
.clues { list-style: none; padding: 0; margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.clue { display: grid; grid-template-columns: 54px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 0; border-bottom: 1px dotted var(--kraft-ink); }
.pts { font-family: var(--mono); font-size: 0.78rem; font-weight: 700; text-align: center; border: 1.5px solid var(--kraft-ink); border-radius: 999px; padding: 1px 0; }
.clue.open .pts { background: var(--kraft-ink); color: var(--kraft); }
.ct { font-size: 1.02rem; line-height: 1.45; }
.hid { font-style: italic; opacity: 0.7; font-family: system-ui, sans-serif; font-size: 0.9rem; }
.cmeta { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: 1px; }
.dim, .chk, .fromnotes { font: 700 0.66rem system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.08em; padding: 0 6px; border-radius: 3px; background: var(--card); color: var(--ink); }
.chk { background: var(--tomato-soft); color: var(--tomato); }
.fromnotes { background: var(--teal-soft); color: var(--teal); }
.ask { background: var(--card); color: var(--ink); padding: 8px 10px; border-left: 4px solid var(--tomato); font-family: system-ui, sans-serif; font-size: 0.92rem; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; font-family: system-ui, sans-serif; }
.players { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin: 10px 0 4px; font-family: system-ui, sans-serif; }
.players .muted { color: var(--kraft-ink); }
.pill.who { border-color: var(--teal); color: var(--teal); background: var(--card); font-weight: 600; }
.pill.who:hover:not(:disabled) { background: var(--teal); color: var(--card); }
.result { margin: 0; font-weight: 700; }
.peek { display: block; margin-top: 10px; font: 0.86rem system-ui, sans-serif; cursor: pointer; }
.peekbox { margin-top: 8px; padding: 8px 10px; background: var(--card); color: var(--ink); border-radius: 4px; font-family: system-ui, sans-serif; }
.peekbox p { margin: 4px 0; }
.navrow { display: flex; justify-content: space-between; gap: 8px; margin-top: 12px; font-family: system-ui, sans-serif; }
.navrow .pill { border-color: var(--kraft-ink); }

/* The scoreboard */
.board-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.scores { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-direction: column; gap: 4px; }
.srow { display: grid; grid-template-columns: 30px minmax(80px, 180px) minmax(0, 1fr) 54px; gap: 10px; align-items: center; padding: 6px 10px; background: var(--bg); border-radius: 4px; }
.srow.lead { background: var(--teal-soft); }
.s-place { font-family: var(--mono); font-weight: 700; color: var(--muted); }
.s-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-dots { display: flex; gap: 4px; flex-wrap: wrap; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); font: 700 0.72rem/19px var(--mono); text-align: center; color: var(--card); }
.dot.hit { background: var(--vinyl); border-color: var(--vinyl); color: #f6efe2; }
:root[data-theme="dark"] .dot.hit { background: var(--mustard); border-color: var(--mustard); color: #1b150e; }
.dot.miss { background: repeating-linear-gradient(45deg, var(--line) 0 2px, transparent 2px 5px); }
.s-score { font: 700 1.3rem var(--mono); text-align: right; }
.podium-box { margin-top: 12px; }
.podium-box h3 { margin: 4px 0; font-family: var(--serif); }
.podium { width: 100%; max-width: 460px; display: block; margin: 0 auto; }
.pd-step { fill: var(--kraft); stroke: var(--kraft-ink); stroke-width: 1.2; }
.pd-1 { fill: var(--mustard-soft); stroke: var(--mustard); }
.pd-place { fill: var(--kraft-ink); font: 700 26px var(--serif); }
.pd-1 + .pd-place { fill: var(--mustard); }
.pd-name { fill: var(--ink); font: 700 13px system-ui, sans-serif; }
.pd-score { fill: var(--muted); font: 600 11px var(--mono); }

.cardrow { display: flex; gap: 6px; flex-wrap: wrap; }
.hlist { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-direction: column; gap: 6px; }
.hrow { display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: var(--bg); border-radius: 4px; }
.hinfo { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.hinfo b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.foot { max-width: 1120px; margin: 0 auto; padding: 8px 16px 30px; color: var(--muted); font-size: 0.86rem; }
.toasts { position: fixed; right: 14px; bottom: 14px; display: flex; flex-direction: column; gap: 6px; z-index: 50; max-width: min(380px, calc(100vw - 28px)); }
.toast { background: var(--ink); color: var(--card); padding: 8px 12px; border-radius: 6px; font-size: 0.88rem; transition: opacity 0.5s; box-shadow: 0 6px 18px rgba(0,0,0,0.2); }
.toast.err { background: var(--tomato); color: #fff; }
:root[data-theme="dark"] .toast.err { color: #1b0f0a; }
.toast a { color: inherit; font-weight: 700; }
.toast.gone { opacity: 0; }

@media (max-width: 760px) {
  .turntable { grid-template-columns: minmax(0, 1fr); }
  .sleeve-wrap { width: 62%; max-width: 230px; margin: 0 auto 0 0; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .srow { grid-template-columns: 22px minmax(60px, 1fr) 44px; }
  .s-dots { grid-column: 1 / -1; grid-row: 2; }
  .bar { padding: 8px 12px; }
}
@media (prefers-reduced-motion: reduce) { .disc { transition: none; } }

/* Pre-party checklist and the stage keys hint */
.prep { margin-top: 10px; }
.prep summary { cursor: pointer; font-weight: 600; }
.keys { margin: 6px 0 0; font-family: system-ui, sans-serif; }
#addNotes { margin-top: 6px; }
