/* Cheese Steaks style guide v1.0 — hot gold, cool charcoal, cream pages,
 * loud Bungee headlines, friendly Nunito Sans details, thick ink outlines. */
:root {
  --gold: #F5AD18; --gold-light: #FFD66B; --charcoal: #343942; --ink: #171A20;
  --cream: #FFF8E7; --field: #50704B; --alert: #b74343;
  --cream-dim: rgba(255, 248, 231, .72);
  --display: "Bungee", Impact, "Arial Black", sans-serif;
  --body: "Nunito Sans", Arial, system-ui, sans-serif;
  --radius-card: 18px; --radius-pill: 999px;
  --shadow-hard: 4px 4px 0 var(--ink);
  --row-h: 72px; --dock-h: 156px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--body); font-weight: 700; }
body { min-height: 100dvh; overscroll-behavior: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; touch-action: manipulation; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  max-width: 640px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 14px 10px;
  background: var(--cream); border-bottom: 3px solid var(--ink);
}
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.mascot { width: 78px; height: auto; transform: rotate(-5deg); flex: 0 0 auto; }
.team {
  font-family: var(--display); font-size: 21px; line-height: .95; text-transform: uppercase; max-width: 7ch;
  color: var(--gold); -webkit-text-stroke: 1.5px var(--ink); paint-order: stroke fill;
  text-shadow: 3px 3px 0 var(--ink);
}
.sub { font-size: 12px; font-weight: 900; letter-spacing: .16em; text-transform: uppercase; color: var(--charcoal); margin-top: 6px; }
.top-actions { display: flex; gap: 6px; flex: 0 0 auto; }
.icon-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 54px; min-height: 48px; padding: 5px 8px; border-radius: 14px;
  background: var(--charcoal); color: var(--cream); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font-size: 19px;
}
.icon-btn span { font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.loadbar { position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; background: var(--ink); }
.loadbar::after { content: ""; position: absolute; inset: 0; width: calc(var(--p, 0) * 100%); background: var(--gold); transition: width .2s; }

/* ---------- lineup ---------- */
main { max-width: 640px; margin: 0 auto; padding: 12px 14px calc(var(--dock-h) + env(safe-area-inset-bottom) + 16px); }
.lineup { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.row {
  position: relative; display: grid; grid-template-columns: 30px 60px 1fr 44px; align-items: center; gap: 8px;
  min-height: var(--row-h); padding: 0 2px 0 10px; border-radius: var(--radius-card);
  background: var(--charcoal); color: var(--cream); border: 3px solid var(--ink); box-shadow: var(--shadow-hard);
  overflow: hidden; user-select: none; -webkit-user-select: none;
}
.row:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.slot { font-family: var(--display); font-size: 15px; color: var(--gold); text-align: center; }
.num { font-family: var(--display); font-size: 24px; letter-spacing: -.01em; white-space: nowrap; }
.who { min-width: 0; }
.name { font-family: var(--display); font-size: 19px; line-height: 1.05; text-transform: uppercase; }
.song { color: var(--cream-dim); font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 3px; }
.chip {
  display: inline-block; font-size: 10px; font-weight: 900; letter-spacing: .14em; padding: 3px 9px; margin-top: 4px;
  border-radius: var(--radius-pill); border: 2px solid var(--ink); transform: rotate(-2deg); white-space: nowrap;
}
.chip:empty { display: none; }
.who:has(.chip:not(:empty)) .song { display: none; }
.handle { height: 100%; min-height: var(--row-h); font-size: 22px; color: var(--cream-dim); touch-action: none; cursor: grab; }
.bar { position: absolute; left: 0; bottom: 0; height: 5px; width: calc(var(--p, 0) * 100%); background: var(--gold); }

.row.cursor { border-color: var(--gold); box-shadow: 4px 4px 0 var(--gold); }
.row.cursor .chip { background: var(--gold); color: var(--ink); }
.row.playing { background: var(--gold); color: var(--ink); }
.row.playing .slot, .row.playing .song, .row.playing .handle { color: var(--ink); opacity: .7; }
.row.playing .chip { background: var(--ink); color: var(--gold); border-color: var(--ink); animation: pulse 1s ease-in-out infinite alternate; }
.row.playing .bar { background: var(--ink); }
.row.noaudio { background: var(--cream); color: var(--charcoal); border-style: dashed; box-shadow: none; }
.row.noaudio .song { color: var(--charcoal); opacity: .7; }
.row.noaudio .handle { color: var(--charcoal); }
.row.noaudio .chip { background: transparent; color: var(--charcoal); border-color: var(--charcoal); }
.row.loading .name::after { content: " …"; opacity: .6; }
.ghost { opacity: .35; }
.chosen { box-shadow: 8px 8px 0 var(--ink); }
@keyframes pulse { from { opacity: 1; } to { opacity: .5; } }

.hint { color: var(--charcoal); font-size: 13px; text-align: center; margin: 20px 12px 0; }

/* ---------- dock ---------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  padding: 10px max(12px, calc((100vw - 640px) / 2 + 12px)) calc(env(safe-area-inset-bottom) + 10px);
  background: var(--charcoal); border-top: 3px solid var(--ink);
}
.sfx-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.sfx-strip::-webkit-scrollbar { display: none; }
.sfx {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 68px; min-height: 52px; padding: 5px 8px; border-radius: 14px;
  background: var(--cream); color: var(--ink); border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink);
  font-size: 11px; font-weight: 900; letter-spacing: .02em;
}
.sfx .emoji { font-size: 22px; line-height: 1.1; }
.sfx:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.sfx.live { background: var(--gold); }
.controls { display: grid; grid-template-columns: 1fr 96px; gap: 10px; }
.stop {
  height: 60px; border-radius: var(--radius-card); background: var(--alert); color: var(--cream);
  border: 3px solid var(--ink); box-shadow: var(--shadow-hard);
  font-family: var(--display); font-size: 21px; letter-spacing: .02em; text-transform: uppercase;
}
.stop:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.reset {
  height: 60px; border-radius: var(--radius-card); background: var(--gold); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: var(--shadow-hard);
  font-family: var(--display); font-size: 15px;
}
.reset:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

/* ---------- sheets ---------- */
.sheet {
  width: min(520px, calc(100vw - 28px)); margin: auto; padding: 20px; border-radius: var(--radius-card);
  background: var(--cream); color: var(--ink); border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink);
}
.sheet::backdrop { background: rgba(23, 26, 32, .7); }
.sheet h2 { font-family: var(--display); text-transform: uppercase; margin: 0 0 12px; font-size: 22px; color: var(--charcoal); }
.sheet h3 { font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; color: var(--charcoal); margin: 0 0 8px; }
.sheet p { font-size: 16px; }
.sheet section { padding: 12px 0; border-top: 2px solid var(--charcoal); }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.primary, .ghost {
  min-height: 48px; padding: 12px 18px; border-radius: var(--radius-pill);
  border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--ink); font-weight: 900;
}
.primary { background: var(--gold); color: var(--ink); }
.primary:disabled { opacity: .4; box-shadow: none; }
.ghost { background: var(--cream); color: var(--ink); }
.ghost.danger { color: var(--alert); width: 100%; border-radius: var(--radius-card); }
.primary:active, .ghost:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.preview { display: block; max-height: 180px; max-width: 100%; margin: 0 auto 10px; border-radius: 12px; border: 2px solid var(--ink); }
.result { margin: 0; padding-left: 0; list-style: none; max-height: 40vh; overflow: auto; font-size: 16px; }
.result li { padding: 7px 0; border-top: 1px solid rgba(52, 57, 66, .3); }
.result li b { display: inline-block; width: 28px; font-family: var(--display); color: var(--charcoal); }
.result li.dim { color: var(--charcoal); opacity: .75; }
.result small { font-weight: 700; }
.segmented { display: flex; gap: 8px; flex-wrap: wrap; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: inline-block; min-height: 44px; padding: 10px 16px; border-radius: var(--radius-pill); background: var(--cream); border: 2px solid var(--ink); font-weight: 900; }
.segmented input:checked + span { background: var(--gold); box-shadow: 3px 3px 0 var(--ink); }
.toggle { display: flex; gap: 12px; align-items: center; font-size: 15px; }
.toggle input { width: 24px; height: 24px; accent-color: var(--gold); flex: 0 0 auto; }
