/* MC Dashboard. Dark by default: it is used in dim halls at night. One warm accent (diya saffron). */
:root {
  --bg: #121014; --panel: #1c1920; --panel-2: #25212b; --line: #3a3442; --text: #f4efe8; --muted: #b5aab8; --faint: #8a8090;
  --accent: #f2a33a; --accent-ink: #1a1206; --good: #5fcf8f; --warn: #f2c94c; --bad: #ff7a6b; --now: #f2a33a;
  --radius: 14px; --tap: 48px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
body { font-size: 17px; line-height: 1.5; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; font-weight: 650; }
h2 { font-size: 20px; margin: 28px 0 10px; font-weight: 600; }
h3 { font-size: 17px; margin: 0 0 4px; font-weight: 600; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); font-size: 14px; }
.wrap { max-width: 980px; margin: 0 auto; padding: 18px 16px 120px; }
.narrow { max-width: 560px; }
header.top { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: rgba(18,16,20,.94); backdrop-filter: blur(8px); z-index: 20; }
header.top .brand { font-weight: 650; text-decoration: none; color: var(--text); display: flex; gap: 8px; align-items: center; }
header.top .brand i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 14px var(--accent); display: inline-block; }
button, .btn { font: inherit; font-size: 16px; min-height: var(--tap); padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
button:hover, .btn:hover { border-color: var(--faint); }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.ghost { background: transparent; }
button.small, .btn.small { min-height: 40px; padding: 6px 12px; font-size: 15px; }
button.danger { color: var(--bad); }
button[disabled] { opacity: .5; cursor: default; }
label { display: block; font-size: 15px; color: var(--muted); margin: 0 0 6px; }
input, select, textarea { font: inherit; font-size: 17px; width: 100%; min-height: var(--tap); padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #0f0d11; color: var(--text); }
textarea { min-height: 90px; }
input[type=checkbox] { width: 24px; height: 24px; min-height: 0; accent-color: var(--accent); }
.field { margin: 0 0 14px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.row > .grow { flex: 1 1 200px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .grid3 { grid-template-columns: 1fr 1fr; } .grid2 { grid-template-columns: 1fr; } }
.grid2 > *, .grid3 > *, .timepair > * { min-width: 0; }
input[type=datetime-local] { min-width: 0; max-width: 100%; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.cardlink { display: block; color: inherit; text-decoration: none; }
.cardlink:hover .card { border-color: var(--faint); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 999px; background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.pill.good { color: var(--good); border-color: #2f6b4b; }
.pill.warn { color: var(--warn); border-color: #6b5a22; }
.pill.bad { color: var(--bad); border-color: #6b3029; }
.pill.now { color: var(--accent-ink); background: var(--now); border-color: var(--now); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); background: #fff; color: #111; padding: 12px 18px; border-radius: 12px; z-index: 100; max-width: 92vw; box-shadow: 0 8px 30px rgba(0,0,0,.4); }
.toast.bad { background: var(--bad); }
.error { color: var(--bad); font-size: 15px; margin: 6px 0 0; }
.empty { text-align: center; padding: 28px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Studio */
.song { display: grid; grid-template-columns: 34px 1fr; gap: 12px; }
.song .num { width: 34px; height: 34px; border-radius: 50%; background: var(--panel-2); border: 1px solid var(--line); display: grid; place-items: center; font-weight: 600; }
.song .handle, .bitem .handle { cursor: grab; touch-action: none; }
.join { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: -2px 0 12px 46px; padding: 10px 12px; border-left: 3px solid var(--accent); background: rgba(242,163,58,.06); border-radius: 0 12px 12px 0; }
.join select { width: auto; min-width: 170px; }
.advice { font-size: 14px; color: var(--muted); }
.advice.good { color: var(--good); }
.advice.warn { color: var(--warn); }
.timepair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bar { position: fixed; left: 0; right: 0; bottom: 0; background: rgba(28,25,32,.97); border-top: 1px solid var(--line); padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); z-index: 30; }
.bar .inner { max-width: 980px; margin: 0 auto; display: flex; gap: 12px; align-items: center; }
.bar .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prog { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--accent); width: 0; }
audio { width: 100%; }

/* Board */
.bitem { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: start; }
.bitem.now { border-color: var(--now); box-shadow: 0 0 0 1px var(--now) inset; }
.bitem.done { opacity: .55; }
.bitem .ord { font-weight: 650; color: var(--faint); text-align: center; padding-top: 2px; }
.bitem .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.bitem .acts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.clock { display: flex; gap: 16px; flex-wrap: wrap; }
.clock b { font-size: 22px; display: block; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 140px; }
.stat.late b { color: var(--bad); }
.sortable-ghost { opacity: .35; }

/* Cue card and video overlay */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.overlay .cue-name { font-size: clamp(36px, 8vw, 84px); font-weight: 700; line-height: 1.05; }
.overlay .cue-say { font-size: clamp(20px, 3.4vw, 30px); color: var(--accent); margin: 12px 0; }
.overlay .cue-line { font-size: clamp(22px, 4vw, 40px); max-width: 1000px; line-height: 1.3; }
.overlay video { max-width: 100%; max-height: 80vh; background: #000; border-radius: 8px; }
.overlay .close { position: absolute; top: 14px; right: 14px; }

/* Screen view (projector) */
.screen { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 6vh 6vw; background: radial-gradient(circle at 50% 120%, rgba(242,163,58,.18), transparent 60%), var(--bg); }
.screen .lbl { text-transform: uppercase; letter-spacing: .14em; color: var(--accent); font-size: clamp(16px, 2vw, 26px); }
.screen .now { font-size: clamp(44px, 8vw, 120px); font-weight: 700; line-height: 1.05; margin: 8px 0 6vh; }
.screen .next { font-size: clamp(28px, 4.5vw, 64px); font-weight: 600; color: var(--muted); }
.screen .ev { position: fixed; bottom: 3vh; left: 6vw; color: var(--faint); font-size: clamp(14px, 1.6vw, 22px); }

/* Login, guest and invite */
.center { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.center .card { width: 100%; max-width: 440px; padding: 24px; }
.codebox { font-size: 28px; letter-spacing: .3em; text-align: center; }
.hp { position: absolute; left: -5000px; }
.drop { border: 2px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; color: var(--muted); }
.qr { background: #fff; padding: 16px; border-radius: 12px; display: inline-block; }
@media print { header.top, .bar, .noprint { display: none !important; } body, html { background: #fff; color: #000; } .print-only { display: block !important; } }
.print-only { display: none; }
