/* GameControl Video: light, large buttons (the old panel's look) */
:root { --bg: #e9edf3; --card: #f8fafc; --line: #cfd6e0; --ink: #0f172a; --muted: #64748b; --blue: #2563eb; --red: #dc2626; --green: #16a34a; }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.4 Manrope, "Segoe UI", system-ui, sans-serif; }
a { color: var(--blue); }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.bad { color: var(--red); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; background: linear-gradient(135deg, #2b67ff, #1d49d9); color: #fff; }
.brand { color: #fff; text-decoration: none; font-weight: 900; font-size: 18px; }
.brand span { font-weight: 600; opacity: .85; }
#nav { display: flex; gap: 8px; flex-wrap: wrap; }
#nav a { color: #fff; text-decoration: none; font-weight: 800; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.18); }
main { max-width: 1500px; margin: 0 auto; padding: 16px; }
h1 { font-size: 26px; margin: 0 0 12px; font-weight: 900; color: #25344a; }
h3 { margin: 0 0 10px; font-size: 18px; font-weight: 900; color: #25344a; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.narrow { max-width: 420px; margin: 40px auto; display: flex; flex-direction: column; gap: 12px; }
.form { max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.order { text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; }
.order:hover { border-color: var(--blue); }
.score-line { font-size: 17px; }
.grow { flex: 1 1 auto; min-width: 0; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

label { display: flex; flex-direction: column; gap: 5px; font-weight: 700; font-size: 14px; color: #334155; }
label.check { flex-direction: row; align-items: center; gap: 8px; font-weight: 700; }
input, select { font: inherit; height: 42px; border-radius: 12px; border: 1px solid #cbd5e1; background: #fff; color: #1e293b; padding: 0 10px; min-width: 0; }
input[type=checkbox] { height: 20px; width: 20px; }
input:focus, select:focus { border-color: #60a5fa; box-shadow: 0 0 0 3px rgba(37,99,235,.18); outline: 0; }
fieldset { border: 1px solid #dbe2ec; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
legend { font-weight: 900; color: #25344a; padding: 0 6px; }
.out-row { display: grid; grid-template-columns: 140px 1fr 1fr auto; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid rgba(30,41,59,.16); background: #e5e7eb; color: #1e293b; font: inherit; font-weight: 800; cursor: pointer; text-decoration: none; box-shadow: 0 1px 0 rgba(255,255,255,.45) inset, 0 4px 10px rgba(15,23,42,.1); }
.btn:hover:not(:disabled) { filter: brightness(1.04); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.btn.go { background: var(--green); color: #fff; }
.btn.sm { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn.big { min-height: 52px; font-size: 16px; }
.chip { display: inline-flex; gap: 6px; align-items: center; padding: 5px 10px; border-radius: 10px; background: #e2e8f0; color: #334155; font-size: 13px; font-weight: 700; }
.chip b { color: #64748b; font-weight: 800; }
.chip.live { background: var(--red); color: #fff; }
.chip.live b { color: #fee2e2; }
.chip.ok { background: #dcfce7; color: #166534; }
.chip.bad { background: #fee2e2; color: #991b1b; }

/* Operator's screen */
.ctop { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-bottom: 12px; }
.ctop h1 { margin: 2px 0 0; font-size: 22px; }
.ctop > .row { justify-content: flex-end; }
.score { display: flex; align-items: baseline; gap: 12px; justify-content: center; flex-wrap: wrap; font-weight: 900; font-size: 20px; }
.score b { font-size: 40px; }
.score small { width: 100%; text-align: center; font-size: 15px; color: #475569; font-weight: 800; }
.score i { font-style: normal; font-variant-numeric: tabular-nums; }
.score i.run { color: var(--green); }
.cmain { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 12px; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #05080b; border-radius: 12px; overflow: hidden; }
.screen video { width: 100%; height: 100%; display: block; }
.nopv { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #94a3b8; font-weight: 700; text-align: center; padding: 20px; }
.badge { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); background: var(--red); border: 2px solid rgba(255,255,255,.75); border-radius: 999px; padding: 6px 14px; color: #fff; font-weight: 900; letter-spacing: .08em; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.err { width: 100%; padding: 8px 12px; border-radius: 10px; background: #fff7ed; border: 1px solid #fdba74; color: #7c2d12; font-weight: 700; font-size: 14px; }
.side { display: flex; flex-direction: column; gap: 12px; }
.side .card { display: flex; flex-direction: column; gap: 10px; }
.lbl { font-weight: 800; color: #334155; min-width: 76px; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.seg button { min-height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid #cbd5e1; background: #fff; font: inherit; font-weight: 800; cursor: pointer; }
.seg button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.zpad { position: relative; height: 130px; border: 2px solid #93c5fd; border-radius: 12px; cursor: crosshair; background: linear-gradient(90deg, transparent 32.5%, rgba(37,99,235,.3) 33%, transparent 33.5%, transparent 49.7%, rgba(220,38,38,.4) 50%, transparent 50.3%, transparent 66.5%, rgba(37,99,235,.3) 67%, transparent 67.5%), #f8fbff; }
.zpad i { position: absolute; width: 18px; height: 18px; margin: -9px 0 0 -9px; border-radius: 50%; background: var(--red); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(15,23,42,.4); }
.list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow: auto; }
.item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; font-size: 14px; }

#toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%) translateY(40px); opacity: 0; background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-weight: 700; transition: .2s; pointer-events: none; z-index: 10; }
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.bad { background: var(--red); }

@media (max-width: 1000px) {
  .cmain, .ctop { grid-template-columns: 1fr; }
  .ctop > .row { justify-content: flex-start; }
  .grid2, .out-row { grid-template-columns: 1fr; }
}
.url { word-break: break-all; background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 6px 8px; }
details summary { cursor: pointer; color: var(--blue); font-weight: 700; }
.log { max-height: 260px; }
.logline { display: flex; gap: 10px; padding: 5px 8px; border-left: 4px solid #cbd5e1; background: #fff; border-radius: 6px; font-size: 13px; }
.logline .mono { color: var(--muted); white-space: nowrap; }
.logline.ok { border-left-color: var(--green); }
.logline.bad { border-left-color: var(--red); background: #fef2f2; }
.logline.warn { border-left-color: #f59e0b; background: #fffbeb; }
.stage { display: flex; flex-direction: column; gap: 10px; }
.srctag { position: absolute; top: 14px; left: 14px; background: #0ea5e9; color: #fff; font-weight: 900; font-size: 13px; padding: 5px 10px; border-radius: 8px; }
