@font-face { font-family: 'Pretendard'; font-weight: 400; src: url('/fonts/Pretendard-Regular.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Pretendard'; font-weight: 700; src: url('/fonts/Pretendard-Bold.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Pretendard'; font-weight: 800; src: url('/fonts/Pretendard-ExtraBold.otf') format('opentype'); font-display: swap; }
@font-face { font-family: 'Pretendard'; font-weight: 900; src: url('/fonts/Pretendard-Black.otf') format('opentype'); font-display: swap; }

:root {
  --bg: #0d1226; --panel: #161d38; --panel2: #1e2748; --line: #2c3763; --text: #eef2ff; --muted: #9aa6cf;
  --accent: #ffd84d; --good: #5be08a; --bad: #ff6b6b; --blue: #4ea1ff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Pretendard, 'Malgun Gothic', sans-serif; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; border-radius: 10px; padding: 9px 16px; background: var(--panel2); color: var(--text); font-weight: 700; border: 1px solid var(--line); }
button:hover:not(:disabled) { filter: brightness(1.2); }
button:disabled { opacity: .45; cursor: not-allowed; }
button.primary { background: #3a6cff; border-color: #3a6cff; color: #fff; }
button.good { background: #1f9d55; border-color: #1f9d55; color: #fff; }
button.danger { background: #c9303e; border-color: #c9303e; color: #fff; }
button.warn { background: #d88a00; border-color: #d88a00; color: #fff; }
button.small { padding: 5px 10px; font-size: 13px; border-radius: 8px; }
input, select, textarea { background: #0b1020; color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; }
textarea { width: 100%; min-height: 160px; resize: vertical; font-family: Consolas, 'Malgun Gothic', monospace; }
.chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 800; background: var(--panel2); border: 1px solid var(--line); white-space: nowrap; }
.chip.draft { color: #b9c3e6; } .chip.confirmed { color: #7cc4ff; border-color: #2a6fb0; }
.chip.running { color: #5be08a; border-color: #1f9d55; } .chip.finished { color: #ffd84d; border-color: #9c7c00; }
.chip.cancelled { color: #ff8a8a; border-color: #a33; } .chip.test { background: #c9303e; color: #fff; border-color: #c9303e; }
.chip.queued { color: #b9c3e6; } .chip.done { color: #5be08a; } .chip.failed { color: #ff8a8a; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; vertical-align: -2px; box-shadow: inset -2px -2px 3px rgba(0,0,0,.35), inset 2px 2px 3px rgba(255,255,255,.35); }
.tag { display: inline-flex; align-items: center; gap: 6px; border-radius: 8px; padding: 2px 8px 2px 2px; background: #0b1020; border: 2px solid var(--c, #888); font-weight: 800; white-space: nowrap; }
.tag b { background: var(--c, #888); color: var(--ct, #fff); border-radius: 6px; padding: 1px 6px; font-size: .85em; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111a36; border: 1px solid var(--line); padding: 12px 20px; border-radius: 12px; z-index: 99; box-shadow: 0 8px 30px rgba(0,0,0,.4); font-weight: 700; max-width: 90vw; }
.toast.err { border-color: #c9303e; color: #ffb3b3; }

/* ── 관전 화면 ── */
.watch { max-width: 1500px; margin: 0 auto; padding: 14px 16px 40px; }
.watch header { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.watch h1 { font-size: clamp(20px, 3vw, 30px); margin: 0; font-weight: 900; }
.stage-wrap { position: relative; background: #000; border-radius: 16px; overflow: hidden; box-shadow: 0 10px 40px rgba(0,0,0,.45); }
.stage-wrap canvas { display: block; width: 100%; aspect-ratio: 16 / 9; }
.stage-wrap:fullscreen { border-radius: 0; display: flex; align-items: center; justify-content: center; }
.stage-wrap:fullscreen canvas { width: min(100vw, 177.78vh); }
.stage-ctrl { position: absolute; right: 10px; bottom: 10px; display: flex; gap: 8px; }
.stage-ctrl button { background: rgba(0,0,0,.6); border-color: rgba(255,255,255,.25); backdrop-filter: blur(4px); }
.overlay-btn { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.overlay-btn button { pointer-events: auto; font-size: 22px; padding: 14px 28px; border-radius: 999px; background: rgba(58,108,255,.92); border-color: #fff; }
@media (max-width: 600px) {
  .stage-ctrl { right: 6px; bottom: 6px; gap: 4px; }
  .stage-ctrl button { padding: 4px 8px; font-size: 12px; border-radius: 8px; }
  .overlay-btn button { font-size: 15px; padding: 8px 18px; }
  .progress { right: 150px !important; bottom: 12px !important; }
}
.progress { position: absolute; left: 10px; right: 230px; bottom: 18px; height: 6px; background: rgba(255,255,255,.25); border-radius: 3px; cursor: pointer; }
.progress i { display: block; height: 100%; background: var(--accent); border-radius: 3px; width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; }
.card h2 { font-size: 18px; margin: 0 0 10px; }
.list { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow: auto; }
.list li { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 16px; }
.list li .rk { width: 38px; text-align: center; font-weight: 900; color: var(--accent); }
.list li.win { background: rgba(255,216,77,.08); }
.list li.lose { opacity: 1; }
.rules { font-size: 14px; color: var(--muted); line-height: 1.6; }
.rotate-hint { display: none; background: #2a1f00; color: #ffd84d; border: 1px solid #6b5200; border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; font-size: 14px; }
@media (max-width: 700px) and (orientation: portrait) { .rotate-hint { display: block; } }
.podium3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.podium3 div { background: var(--panel2); border-radius: 12px; padding: 10px; text-align: center; border: 2px solid var(--line); }
.podium3 .p1 { border-color: #ffd700; } .podium3 .p2 { border-color: #d9e1ea; } .podium3 .p3 { border-color: #e0a36b; }
.podium3 .medal { font-size: 26px; }
