/* Tournament Replay의 portal/admin과 headquarters 화면을 기준으로 구성합니다. */
:root {
  --ink: #0b1322;
  --ink-soft: #132239;
  --text: #263348;
  --mute: #64748b;
  --line: #dfe5ed;
  --surface: #f3f5f8;
  --card: #fff;
  --accent: #2a5fc8;
  --accent-soft: #eff6ff;
  --success: #15803d;
  --success-soft: #dcfce7;
  --radius: 9px;
  --radius-sm: 6px;
}
body { margin: 0; background: var(--surface); color: var(--text); font: 13px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, "Noto Sans KR", sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
a, button, input, select { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .45; cursor: not-allowed; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid #93c5fd; outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3 { color: var(--ink); letter-spacing: -.02em; }
.workspace { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 216px; padding: 24px 14px 16px; background: #132239; color: #d4deeb; display: flex; flex-direction: column; z-index: 70; overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 25px; color: #fff; font-size: 17px; font-weight: 800; letter-spacing: 1px; }
.brand-symbol { width: 32px; height: 34px; display: grid; place-items: center; border-radius: 7px; background: #426fdb; font-size: 21px; }
.brand small { display: block; margin-top: 4px; color: #9dafc6; font-size: 11px; font-weight: 400; letter-spacing: .3px; }
.nav-label { margin: 12px 0; padding: 0 13px; font-size: 10px; font-weight: 600; letter-spacing: 1.5px; color: #7f96b3; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 11px 13px; border-radius: 6px; color: #b7c6d9; font-size: 13px; }
.sidebar nav a:hover { background: #213653; color: #fff; }
.sidebar nav a.selected { background: #2c4e86; color: #fff; }
.sidebar nav .ico { width: 18px; height: 18px; }
.sidebar-bottom { display: grid; gap: 6px; margin-top: auto; padding: 24px 10px 0; color: #b7c6d9; font-size: 12px; }
.sidebar-bottom small { font-size: 10px; color: #7f96b3; }
.main-shell { margin-left: 216px; min-width: 0; }
.topbar { position: fixed; top: 0; left: 216px; right: 0; height: 62px; padding: 0 28px; background: #fff; border-bottom: 1px solid #dfe5ed; display: flex; align-items: center; justify-content: space-between; gap: 20px; z-index: 60; }
.breadcrumb, .topbar-right { display: flex; align-items: center; gap: 16px; font-size: 12px; }
.breadcrumb>span, .console-service { color: #778398; }
.breadcrumb strong { font-size: 14px; color: #17253b; font-weight: 600; }
.console-service { padding-left: 16px; border-left: 1px solid #e2e8f0; }
.connection { display: inline-flex; align-items: center; gap: 6px; color: #a16207; font-size: 11px; }
.connection::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.connection.online { color: #15803d; }
main { width: auto; max-width: none; margin: 0; padding: 86px 28px 28px; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h1 { margin: 0 0 5px; font-size: 22px; line-height: 1.35; font-weight: 700; }
.page-heading p { margin: 0; color: #788497; font-size: 12px; }
.primary, .secondary, .stop-btn, .ghost { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 32px; width: auto; margin: 0; padding: 7px 12px; border: 1px solid transparent; border-radius: 5px; box-shadow: none; font-size: 12px; font-weight: 600; line-height: 1.35; white-space: nowrap; }
.primary { background: #2a5fc8; border-color: #2a5fc8; color: #fff; }
.primary:hover:not(:disabled) { background: #1d4ed8; border-color: #1d4ed8; }
.secondary, .ghost { background: #fff; border-color: #d9e1ec; color: #35465e; }
.secondary:hover:not(:disabled), .ghost:hover:not(:disabled) { background: #f8faff; border-color: #9bb9e5; }
.stop-btn { border-color: #f4c9c4; color: #b42318; background: #fff; }
.stop-btn:hover:not(:disabled) { background: #fef2f2; border-color: #e8a59e; }
.stats-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 14px; margin-bottom: 22px; }
.stats-row>div { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 0; padding: 16px 18px; border: 1px solid #e2e8f0; border-radius: 7px; background: #f8fafc; }
.stat-label { color: #65768d; font-size: 12px; white-space: nowrap; }
.stats-row strong { font-size: 23px; line-height: 1.2; color: #14243a; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats-row .node-stat { flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; }
.node-stat strong { font: 12px ui-monospace, SFMono-Regular, Menlo, monospace; overflow-wrap: anywhere; white-space: normal; }
#recordingState { font-size: 15px; }
#recordingState.recording-text { color: #b42318; }
.detail-panel, .records-panel, .video-panel { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 9px; background: #fff; box-shadow: 0 2px 3px #14223903; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.panel-heading h2, .detail-panel>h2 { margin: 0; font-size: 15px; font-weight: 650; }
.panel-actions { display: flex; gap: 14px; align-items: center; }
.hint, .auto-label, .info-note { color: #788497; font-size: 12px; font-weight: 400; line-height: 1.55; }
.auto-label { font-size: 11px; white-space: nowrap; }
.count-badge { display: inline-block; margin-left: 5px; padding: 2px 6px; border-radius: 4px; background: #eef2f7; color: #65768d; font-size: 11px; font-weight: 500; vertical-align: middle; }
.status-chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 7px; border-radius: 5px; background: #f1f5f9; color: #64748b; font-size: 11px; font-weight: 600; white-space: nowrap; }
.status-chip.ok { background: #dcfce7; color: #15803d; }
.status-chip.bad { background: #fee2e2; color: #b91c1c; }
.status-chip.processing { background: #dbeafe; color: #1d4ed8; }
.status-chip.recording { background: #fef3c7; color: #92400e; }
.status-chip.neutral { background: #f1f5f9; color: #64748b; }
.monitor-layout { display: grid; grid-template-columns: minmax(0,1fr) 260px; gap: 18px; align-items: start; }
.monitor-aside { display: grid; gap: 18px; }
.live-badge { display: inline-flex; gap: 6px; align-items: center; color: #15803d; font-size: 11px; font-weight: 600; }
.live-badge i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
#livePlayer { overflow: hidden; border: 1px solid #203046; border-radius: 7px; background: #030811; }
.video-caption { display: flex; justify-content: space-between; gap: 10px; margin-top: 12px; color: #788497; font-size: 11px; line-height: 1.6; }
.monitor-placeholder { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px; background: #24374e; }
.monitor-placeholder>div { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; aspect-ratio: 16/9; background: #08111f; color: #7187a4; }
.monitor-placeholder>div>span { position: absolute; top: 10px; left: 12px; color: #b0c0d3; font-size: 11px; }
.monitor-placeholder .ico { width: 28px; height: 28px; margin-bottom: 8px; }
.monitor-placeholder small { font-size: 11px; }
.monitor-placeholder .no-node { grid-column: 1/-1; }
.channel { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid #e9edf3; }
.channel-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 5px; background: #eff4fb; color: #6281ab; font: 11px ui-monospace, monospace; }
.channel strong { display: block; color: #263348; font-size: 12px; font-weight: 600; }
.channel small { display: block; color: #8791a1; font-size: 11px; margin-top: 3px; }
.channel-dot { width: 6px; height: 6px; margin-left: auto; border-radius: 50%; background: #cbd5e1; }
.channel-dot.ok { background: #22a05a; }
.info-note { margin: 14px 0 0; font-size: 11px; }
.monitor-recording-panel .hint { margin: 10px 0 14px; }
.quick-recording-controls { display: grid; grid-template-columns: minmax(240px,1fr) minmax(150px,200px) auto; gap: 16px; align-items: end; }
.quick-recording-controls label { display: block; margin: 0; color: #334155; font-size: 12px; font-weight: 500; }
.optional { color: #8791a1; font-weight: 400; margin-left: 4px; }
.quick-recording-controls input, .quick-recording-controls select { display: block; width: 100%; min-height: 34px; margin-top: 6px; padding: 7px 10px; border: 1px solid #cbd5e1; border-radius: 5px; background: #fff; color: #263348; font-size: 13px; line-height: 1.3; }
.quick-recording-controls input::placeholder { color: #94a3b8; }
.quick-recording-controls input:focus, .quick-recording-controls select:focus { border-color: #83a5cd; outline: 2px solid #93c5fd; outline-offset: 0; }
.quick-recording-controls .record-start { min-height: 34px; }
.start-actions { display: flex; gap: 8px; align-items: center; }
.recording-form input:disabled, .recording-form select:disabled { background: #f1f5f9; color: #64748b; cursor: not-allowed; }
.record-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.camera-field { min-width: 0; margin: 18px 0 12px; padding: 11px 12px 12px; border: 1px solid #e0e6ef; border-radius: 6px; }
.camera-field legend { padding: 0 5px; color: #475569; font-size: 12px; font-weight: 500; }
.camera-picker { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.camera-choice { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; margin: 0; cursor: pointer; font-size: 12px; }
.camera-choice input { width: 14px; height: 14px; min-height: 0; padding: 0; margin: 0 2px 0 0; accent-color: var(--accent); }
.camera-choice .ico { width: 15px; height: 15px; color: #7890ae; }
.camera-choice small { color: #8791a1; font-size: 10px; }
.camera-choice.disabled { opacity: .5; cursor: default; }
#recordContext { margin: 5px 0; }
.recording-help { margin: 4px 0 0; font-size: 11px; }
.quick-recording-live { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; padding: 16px; border: 1px solid #f4c9c4; border-radius: 8px; background: #fff4f3; }
.quick-recording-live strong { color: #a42d29; font-size: 13px; }
.quick-recording-live p { margin: 6px 0 0; color: #915b59; font-size: 12px; }
.record-indicator { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #dc2626; }
.records-panel, .compare-folders { margin-top: 18px; }
.table-scroll { width: 100%; overflow-x: auto; }
.console-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 12px; white-space: nowrap; }
.console-table th { padding: 11px 12px; border-bottom: 1px solid #dfe5ed; background: #f8fafc; color: #708096; font-size: 11px; font-weight: 600; }
.console-table td { padding: 13px 12px; border-bottom: 1px solid #e9edf3; vertical-align: middle; }
.console-table small { display: block; margin-top: 4px; color: #8791a1; font-size: 11px; }
.console-table strong { color: #2c3c53; font-size: 12px; font-weight: 600; }
.console-table tr:last-child td { border-bottom: 0; }
.console-table tbody tr:hover { background: #f8faff; }
.console-table .title-cell { min-width: 180px; max-width: 340px; white-space: normal; overflow-wrap: anywhere; }
.console-table .time-cell { min-width: 110px; }
.console-table .duration-cell { font-variant-numeric: tabular-nums; }
.console-table .table-empty { padding: 34px 16px; color: #7c8797; text-align: center; white-space: normal; }
.console-table .practice-row { display: table-row; padding: 0; border: 0; border-radius: 0; background: transparent; }
.console-table .table-actions { display: flex; gap: 6px; }
.console-table .secondary, .console-table .stop-btn { padding: 5px 8px; min-height: 28px; font-size: 11px; }
.console-table .form-error { color: #b91c1c; }
.save-progress { display: grid; gap: 6px; width: 218px; white-space: normal; }
.save-progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.save-percent { color: #1d4ed8; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.save-meter { height: 6px; overflow: hidden; border-radius: 999px; background: #e3ebf8; }
.save-meter>span { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .3s ease; }
.console-table .save-progress small { margin: 0; line-height: 1.4; }
.console-table .save-progress-detail { color: #526581; }
.console-table .save-progress-note { color: #8791a1; font-size: 10px; }
@media (prefers-reduced-motion: reduce) { .save-meter>span { transition: none; } }
.recording-preview { margin-top: 18px; }
.recording-preview>div:last-child { overflow: hidden; border-radius: 7px; }
.library-panel .panel-heading { margin-bottom: 16px; }
.workspace-footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 15px; border-top: 1px solid #e0e6ef; color: #8791a1; font-size: 10px; }
.error-banner { margin-bottom: 18px; padding: 12px 14px; border: 1px solid #fecaca; border-radius: 6px; background: #fef2f2; color: #b91c1c; font-size: 12px; }
.toast { position: fixed; bottom: 24px; left: 50%; z-index: 2000; max-width: calc(100vw - 32px); transform: translateX(-50%); opacity: 1; padding: 12px 18px; border-radius: 7px; background: #132239; color: #fff; font-size: 12px; box-shadow: 0 8px 24px #13223930; }
.toast.error { background: #991b1b; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 220px; color: #788497; font-size: 12px; }
/* 판독·다시보기는 tournament-replay headquarters와 같은 어두운 영상 작업 화면입니다. */
.modal-open { overflow: hidden; }
.media-modal { --ink: #e6edf8; --text: #e6edf8; --mute: #a8b7cc; --line: #2b3e57; --card: #111f31; --surface: #0d1929; --accent: #3b82f6; --accent-soft: #172e4b; position: fixed; inset: 0; z-index: 100; overflow-y: auto; padding: 0 max(24px,calc((100vw - 1450px)/2)) 32px; background: #0a1321; color: #e6edf8; color-scheme: dark; }
.modal-header { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 0; margin-bottom: 16px; border-bottom: 1px solid #2b3e57; background: #0a1321; }
.modal-header h2 { margin: 3px 0 0; color: #e6edf8; font-size: 20px; }
.modal-context { color: #7cc9ff; font-size: 11px; }
.media-modal .secondary, .media-modal .ghost { border-color: #3c536f; background: #192b42; color: #e6edf8; }
.media-modal .secondary:hover, .media-modal .ghost:hover { border-color: #83a5cd; background: #213b5a; }
.media-modal .primary { background: #245bb2; border-color: #4784ed; color: #fff; }
.modal-body { padding: 14px 16px; }
.modal-body .card { padding: 18px; box-shadow: none; }
.modal-body .player-holder { overflow: hidden; border-radius: 9px; background: #030811; }
.modal-body .prep-box { background: #08111f; color: #a8b7cc; }
.modal-body .compare-holder { margin: 0; }
.modal-body .compare-wrap { gap: 20px; }
.modal-body .compare-link { bottom: 12px; border: 1px solid #3c536f; border-radius: 9px; background: #13253b; }
.modal-body .side-badge { background: #245bb2; color: #fff; }
.modal-body .practice-row { background: #111f31; }
.modal-body .practice-sub { color: #a8b7cc; }
.modal-body .compare-pane-head { flex-wrap: wrap; }
.modal-body .compare-pane-head strong { flex: 1; }
.modal-body .compare-pane-head .mute { flex-basis: 100%; padding-left: 34px; font-size: 11px; }
.modal-body .strip-thumb { background: #192f49; }
.sheet-backdrop { z-index: 1200; }
.sheet-backdrop .sheet { color-scheme: light; }
.player { --accent: #3b82f6; background: #08111f; color: #fff; padding-bottom: 8px; }
.player .cam-frame { background: #030811; }
.player .cam-label { padding: 3px 7px; border-radius: 4px; background: #060d1cc9; font-size: 11px; }
.player .player-time { padding-top: 8px; }
.player .player-bar { gap: 12px; margin-top: 0; }
.player .pbtn { width: 36px; height: 36px; }
.player .pbtn.main { width: 46px; height: 46px; background: #245bb2; }
.player .pbtn .ico { width: 20px; height: 20px; }
.player .pbtn.main .ico { width: 23px; height: 23px; }
.player .pbtn-sub { background: #162a43; }
.player .rate.on { border-color: #60a5fa; background: #245bb2; color: #fff; }
.player .rate-chips { gap: 5px; }
.player:fullscreen, .player.pseudo-full { padding: 0; }
/* 가변 카메라 수에도 전체화면의 모든 행을 표시합니다. */
.player:fullscreen[data-mode="grid"] .cam-grid.cams-4,
.player:-webkit-full-screen[data-mode="grid"] .cam-grid.cams-4,
.player.pseudo-full[data-mode="grid"] .cam-grid.cams-4 { grid-template-columns: repeat(2,minmax(0,calc((var(--fs-avail) - 2px * (var(--grid-rows) - 1)) / var(--grid-rows) * 16 / 9))); }
.player:fullscreen[data-mode="focus"] .cam-grid,
.player:-webkit-full-screen[data-mode="focus"] .cam-grid,
.player.pseudo-full[data-mode="focus"] .cam-grid { grid-template-columns: repeat(4,minmax(0,calc((var(--fs-avail) - 2px * var(--thumb-rows)) / (4 + var(--thumb-rows)) * 16 / 9))); }
@media (min-width: 1100px) { .modal-body .compare-wrap { flex-direction: row; align-items: flex-start; } .modal-body .compare-pane { flex: 1; min-width: 0; } }
@media (max-width: 1200px) {
  .sidebar { width: 190px; }
  .main-shell { margin-left: 190px; }
  .topbar { left: 190px; }
  main { padding: 82px 20px 24px; }
  .stats-row { gap: 10px; }
  .stats-row>div { padding: 14px; }
  .stats-row strong { font-size: 20px; }
  .node-stat strong { font-size: 11px; }
  .monitor-layout { grid-template-columns: minmax(0,1fr) 235px; gap: 16px; }
}
@media (max-width: 980px) {
  .stats-row { grid-template-columns: 1fr 1fr; }
  .stats-row .node-stat { flex-direction: row; align-items: center; }
  .monitor-layout { grid-template-columns: 1fr; }
  .monitor-aside { grid-template-columns: 1.3fr 1fr; }
  #channels { display: grid; grid-template-columns: 1fr 1fr; gap: 0 15px; }
  .quick-recording-controls { grid-template-columns: minmax(0,1fr) minmax(130px,170px); }
  .quick-recording-controls .record-start { grid-column: 1/-1; justify-self: start; }
  .video-caption>span:last-child { display: none; }
}
@media (max-width: 640px) {
  .sidebar { inset: 0 0 auto; width: 100%; height: 108px; padding: 12px 12px 8px; overflow: visible; }
  .brand { padding: 0 4px 10px; gap: 9px; font-size: 14px; }
  .brand-symbol { width: 26px; height: 28px; font-size: 18px; border-radius: 5px; }
  .brand small { display: inline; margin-left: 9px; font-size: 10px; }
  .nav-label, .sidebar-bottom { display: none; }
  .sidebar nav { display: flex; gap: 5px; }
  .sidebar nav a { flex: 1; justify-content: center; gap: 6px; padding: 9px 5px; font-size: 11px; }
  .sidebar nav .ico { width: 15px; height: 15px; }
  .main-shell { margin: 0; }
  .topbar { position: absolute; top: 108px; left: 0; height: 48px; padding: 0 16px; gap: 10px; }
  .breadcrumb { gap: 10px; }
  .breadcrumb strong { font-size: 12px; }
  .breadcrumb>span { font-size: 10px; }
  .connection { font-size: 10px; white-space: nowrap; }
  .console-service { display: none; }
  main { padding: 178px 14px 24px; }
  .page-heading { gap: 10px; margin-bottom: 16px; align-items: flex-start; }
  .page-heading h1 { font-size: 21px; }
  .page-heading p { font-size: 11px; max-width: 250px; }
  .page-heading .secondary { min-height: 30px; padding: 6px 9px; font-size: 11px; }
  .stats-row { gap: 8px; margin-bottom: 16px; }
  .stats-row>div { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .stats-row .node-stat { flex-direction: column; align-items: flex-start; }
  .stats-row strong { font-size: 21px; }
  .node-stat strong { font-size: 10px; }
  .stat-label { font-size: 11px; }
  .detail-panel, .records-panel, .video-panel { padding: 14px; }
  .panel-heading h2, .detail-panel>h2 { font-size: 14px; }
  .panel-heading { gap: 10px; }
  .auto-label { font-size: 10px; }
  .monitor-aside { grid-template-columns: 1fr; gap: 14px; }
  .monitor-recording-panel .primary { width: 100%; }
  .video-caption { margin-top: 10px; font-size: 10px; }
  .quick-recording-controls { grid-template-columns: 1fr; gap: 13px; }
  .quick-recording-controls input, .quick-recording-controls select { min-height: 39px; font-size: 14px; }
  .quick-recording-controls .record-start { grid-column: auto; width: 100%; min-height: 38px; }
  .start-actions { width: 100%; }
  .camera-picker { gap: 8px 12px; }
  .camera-choice small { display: none; }
  .camera-field { margin-top: 16px; }
  .quick-recording-live { align-items: stretch; flex-direction: column; gap: 12px; padding: 12px; }
  .quick-recording-live .stop-btn { align-self: flex-start; }
  .console-table td { padding: 12px 10px; }
  .console-table th { padding: 10px; }
  .console-table .title-cell { min-width: 155px; }
  .panel-actions { gap: 8px; }
  .panel-actions>.hint { display: none; }
  .compare-folders>.panel-heading>.hint { display: none; }
  .workspace-footer { font-size: 9px; }
  .media-modal { padding: 0 12px 24px; }
  .modal-header { padding: 14px 0; margin-bottom: 12px; }
  .modal-header h2 { font-size: 17px; }
  .modal-context { font-size: 10px; }
  .modal-body { padding: 12px 14px; }
  .modal-body .card { padding: 14px; }
  .player .player-time { gap: 6px; padding-left: 9px; padding-right: 9px; font-size: 9px; }
  .player .pin-btn { padding: 4px; font-size: 9px; }
  .player .pin-btn .ico { width: 13px; height: 13px; }
  .player .player-bar { gap: 8px; }
  .player .frame-counter { font-size: 9px; }
  .player .rate { padding: 4px 6px; font-size: 10px; }
  .player .pbtn.small { width: 27px; }
  .player .player-foot { gap: 5px; padding-left: 9px; padding-right: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; } }
