@font-face {
  font-family: 'Noto Sans KR';
  src: url('/assets/noto-sans-kr.woff2') format('woff2');
  font-weight: 100 900;
  font-display: swap;
}
:root { font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; }
body { margin: 0; }
.overlay { background: transparent; overflow: hidden; }
.stage { position: absolute; width: 1920px; height: 1080px; transform-origin: top left; }
.title-frame { position: absolute; top: 0; left: 0; }
.caption-group { position: absolute; inset: 0; }
.caption { position: absolute; width: max-content; white-space: nowrap; transform-origin: top left; font-family: 'Noto Sans KR', sans-serif; }
.intro-heading { left: 270px; top: 77px; color: #862d53; font-size: 34px; font-weight: 800; line-height: 42px; clip-path: inset(100% 0 0); translate: 0 -9px; transition: clip-path 230ms ease, translate 230ms ease; }
.caption-group[data-mode='intro-heading'] .intro-heading { clip-path: inset(0); translate: 0; }
.contestant { left: 270px; top: 63px; display: inline-flex; align-items: center; color: #251725; font-size: 42px; font-weight: 800; line-height: 42px; transform: scale(var(--name-normal, .5476)); clip-path: inset(0); transition: transform 420ms cubic-bezier(.22, .72, .23, 1), clip-path 330ms ease; }
.contestant[hidden] { display: none; }
.participant-icon { width: 28px; height: 28px; margin-right: 9px; flex: none; color: #a2194d; }
.participant-label { position: relative; width: 0; height: 28px; overflow: hidden; flex: none; transition: width 420ms cubic-bezier(.22, .72, .23, 1); }
.participant-label > span { position: absolute; inset: 0 auto auto 0; width: 62px; border-radius: 5px; background: #f0dbe5; color: #862d53; text-align: center; font-size: 16px; line-height: 28px; font-weight: 800; visibility: hidden; }
.caption-group[data-mode='name'] .participant-label { width: 72px; }
.caption-group[data-mode='name'] .regular-label { visibility: visible; }
.track { left: 268px; top: 90px; color: #a2194d; font-size: 40px; font-weight: 900; line-height: 40px; clip-path: inset(0); transition: clip-path 340ms cubic-bezier(.22, .72, .23, 1), translate 340ms cubic-bezier(.22, .72, .23, 1); }
.song-glyph { display: inline-block; white-space: pre; }
@media (prefers-reduced-motion: no-preference) {
  .caption-group[data-mode='both']:not([data-switching]) .song-glyph {
    animation: song-wave 3.8s ease-in-out var(--wave-delay, 0ms) infinite;
  }
  @keyframes song-wave {
    0%, 29%, 100% { transform: translateY(0); }
    10% { transform: translateY(-1.6px); }
    20% { transform: translateY(.5px); }
  }
}
.caption-group[data-mode='name'] .contestant { transform: translateY(var(--name-center-offset, 12px)) scale(var(--name-large, 1)); }
.caption-group:is([data-mode='intro-heading'], [data-mode='intro-name']) .contestant { transform: translateY(var(--intro-center-offset, 12px)) scale(var(--intro-scale, 1)); }
.caption-group[data-mode='intro-heading'] .contestant { clip-path: inset(0 0 100%); }
.caption-group[data-mode='intro-name'] .contestant { transition-delay: 0ms, 100ms; }
.contestant-name { transition: translate 420ms cubic-bezier(.22, .72, .23, 1); }
.caption-group:is([data-mode='intro-heading'], [data-mode='intro-name']) .contestant-name { max-width: var(--intro-name-width); overflow: hidden; text-overflow: ellipsis; }
.caption-group[data-mode='name'] .contestant-name { translate: 0 -2px; }
.caption-group[data-mode='name'] .track { clip-path: inset(0 0 100%); translate: 0 -7px; }
.caption-group:is([data-mode='intro-heading'], [data-mode='intro-name']) .track { clip-path: inset(0 100% 0 0); translate: -8px 0; }
.caption-group[data-switching] :is(.caption, .participant-label, .contestant-name) { transition: none; }
@media (prefers-reduced-motion: reduce) { .caption-group :is(.caption, .participant-label, .contestant-name) { transition: none; } }

.operator {
  --ink: #272027;
  --muted: #716570;
  --line: #e9e1e7;
  --accent: #862d53;
  min-height: 100vh;
  color: var(--ink);
  background: #f8f6f7;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif;
}
.operator #app { display: grid; grid-template-columns: 168px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  padding: 28px 12px;
  background: #291f28;
}
.sidebar .brand {
  display: block;
  width: 132px;
  margin: 0 auto 26px;
  padding: 6px 0;
}
.brand img { display: block; width: 100%; }
.sidebar nav { display: grid; gap: 3px; }
.sidebar nav a {
  padding: 11px 14px;
  border-radius: 6px;
  color: #e4d8e0;
  font-size: 14px;
  text-decoration: none;
}
.sidebar nav a[aria-current='page'] { background: #463341; color: #fff1f7; font-weight: 700; }
.sidebar nav a:hover { background: #41313e; }
.sidebar-sync { display: grid; gap: 10px; margin-top: auto; padding: 12px 9px 0; border-top: 1px solid #53434e; color: #e3d5df; }
.sidebar-auth-button { padding: 6px 10px; border: 1px solid #75596e; border-radius: 5px; background: #463341; color: #fff1f7; cursor: pointer; }
.sidebar-auth-button:hover { background: #573e52; }
.sidebar-auth-status { font-size: 12px; color: #edc9de; }
.operator .sidebar-sync p { color: inherit; }
.sidebar-sync small { display: block; margin: 3px 0 0 14px; color: #bfb2bd; font-size: 11px; }
.operator main { box-sizing: border-box; width: min(100%, 1320px); margin: 0 auto; padding: 42px clamp(24px, 4vw, 60px) 60px; }
.page-heading { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.header-preview { display: block; width: min(100%, 288px); height: auto; aspect-ratio: 7 / 2; border: 0; border-radius: 5px; background: #2e2932; }
.operator h1 { margin: 0; font-size: clamp(31px, 4vw, 43px); font-weight: 800; letter-spacing: -.045em; }
.operator h2 { margin: 0 0 14px; font-size: 22px; font-weight: 800; letter-spacing: -.035em; }
.operator p { color: var(--muted); }
.operator section { margin-top: 27px; }
.connection-status { margin: 0; font-size: 13px; font-weight: 700; }
.connection-status::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: #ac8252; vertical-align: 1px; }
.connection-status[data-connected='true']::before { background: #387556; }
.operator a:focus-visible, .operator button:focus-visible { outline: 2px solid #be547f; outline-offset: 3px; }
.operator a { color: var(--accent); font-weight: 650; }
.operator .manage section { width: min(100%, 565px); padding: 22px; box-sizing: border-box; border: 1px solid var(--line); border-radius: 9px; background: #fff; }
.operator label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.operator input, .operator select, .operator button { font: inherit; }
.operator input, .operator select { box-sizing: border-box; padding: 10px 12px; border: 1px solid #d9cdd6; border-radius: 6px; color: inherit; background: #fff; }
.operator select { width: 100%; }
.manage select { margin-bottom: 18px; }
.manage #name { width: 100%; margin-bottom: 18px; }
.operator .manage .manage-list { width: 100%; padding: 0; border: 0; background: transparent; }
.manage-list .remove-participant { color: var(--accent); font-weight: 650; }
.manage-actions { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.manage-list .activate-participant { color: #3d644f; font-weight: 700; }
.overlay-release button { padding: 9px 12px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; }
.overlay-versions { list-style: none; padding: 0; margin: 0; }
.overlay-versions li + li { border-top: 1px solid var(--line); }
.overlay-version-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 0; }
.overlay-version-row strong, .overlay-version-row small { display: block; }
.overlay-version-row small { margin-top: 3px; color: var(--muted); }
.overlay-version-row button { flex: none; }
.overlay-versions p { margin: 0 0 10px; font-size: 13px; }
.song-edit { display: flex; gap: 8px; }
.song-edit input { min-width: 0; flex: 1; }
.song-edit button { padding: 10px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; white-space: nowrap; }
.operator button:disabled { opacity: .55; }
.operator-auth-dialog { box-sizing: border-box; width: min(360px, calc(100% - 36px)); padding: 24px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: #fff; }
.operator-auth-dialog::backdrop { background: #231a24a6; }
.operator-auth-dialog input { width: 100%; padding: 9px 10px; }
.operator-auth-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.operator-auth-actions button { padding: 7px 12px; border: 1px solid var(--line); border-radius: 5px; background: #fff; cursor: pointer; }
.operator-auth-actions button[type='submit'] { border-color: var(--accent); background: var(--accent); color: #fff; }
.operator-toast { position: fixed; z-index: 20; top: 50%; left: 50%; translate: -50% -50%; display: flex; align-items: center; gap: 12px; box-sizing: border-box; width: max-content; max-width: min(420px, calc(100vw - 32px)); padding: 12px 14px; border: 1px solid #695360; border-radius: 9px; background: #32242f; color: #fff7fc; box-shadow: 0 6px 24px #1b101b59; font-size: 14px; font-weight: 650; pointer-events: none; }
.operator-toast-icon { display: grid; flex: 0 0 24px; height: 24px; place-items: center; border-radius: 50%; background: #bfe8d1; color: #245341; }
.operator-toast[data-kind='error'] .operator-toast-icon { background: #f8cfdb; color: #94294d; }
.operator-toast span[role] { min-width: 0; overflow-wrap: anywhere; }
.operator-toast button { flex: none; padding: 1px 5px; border: 0; background: transparent; color: #eee1e9; font-size: 20px; line-height: 1; pointer-events: auto; cursor: pointer; }

.participant-list, .asset-table { width: 100%; border-collapse: collapse; table-layout: fixed; background: #fff; font-size: 14px; }
.participant-list thead th, .asset-table thead th { background: #eee9ed; color: #59434f; padding: 10px 16px; font-size: 12px; letter-spacing: .015em; }
.participant-list :is(td, th), .asset-table :is(td, th) { text-align: left; }
.participant-list td, .asset-table tbody :is(td, th) { padding: 11px 16px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.participant-list .air-column { width: 112px; }
.participant-list tbody tr:has(button[aria-pressed]) { cursor: pointer; }
.participant-list tbody tr:has(button[aria-pressed]):hover { background: #fcf5f8; }
.participant-list tbody tr[data-active='true'] { background: #f8e7ef; }
.participant-list tbody tr[data-active='true'] td:first-child { box-shadow: inset 3px 0 #a54570; }
.participant-list button { padding: 0; border: 0; background: transparent; color: inherit; text-align: left; cursor: pointer; }
.air-status { display: inline-block; min-width: 38px; padding: 2px 7px; border-radius: 4px; color: #655663; background: #f1edf0; text-align: center; font-size: 11px; font-weight: 700; white-space: nowrap; }
[data-active='true'] .air-status { color: #7d254d; background: #f0ccdf; }
.asset-table .asset-name-column { width: 26%; }
.asset-table .asset-links-column { width: 27%; }
.asset-table tbody .asset-group th { padding-block: 7px; color: #66505e; background: #f7f4f6; font-size: 12px; font-weight: 700; }
.asset-table tbody th[scope='row'] { font-weight: 650; word-break: keep-all; }
.asset-links { display: flex; flex-wrap: wrap; gap: 6px; }
.browser-source { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; }
.browser-source small { color: var(--muted); font-size: 11px; white-space: nowrap; }
.asset-links a { padding: 5px 8px; border: 1px solid #e5d5df; border-radius: 5px; background: #fff; font-size: 12px; line-height: 1.3; text-decoration: none; }
.asset-links a:hover { background: #f8e7ef; }
.asset-table iframe, .png-preview {
  display: block;
  width: min(100%, 288px);
  height: auto;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: 5px;
  background: #2e2932;
}
.asset-table iframe.detail-preview, .png-preview { aspect-ratio: 7 / 2; }
.png-preview { position: relative; }
.png-preview img { position: absolute; inset: 0; width: calc(100% - 16px); height: calc(100% - 12px); margin: auto; object-fit: contain; }
.scene-cards { display: grid; gap: 18px; }
.scene-cards h2 { margin: 0; }
.scene-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: clamp(10px, 1.5vw, 18px);
  background: #fff;
}
.scene-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}
.scene-card-header h3 { margin: 0; font-size: 17px; letter-spacing: -.025em; }
.scene-card-header p { margin: 4px 0 0; font-size: 12px; }
.scene-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1px solid #e5d5df;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.scene-link:hover { background: #f8e7ef; }
.scene-stage {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 7px;
  background: #26222b;
}
.scene-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
}
.scene-desk { position: absolute; display: block; height: auto; }

@media (max-width: 760px) {
  .operator #app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 6px; height: auto; padding: 8px 12px; }
  .sidebar .brand { width: min(145px, 100%); margin: 0; padding: 0; }
  .sidebar nav { display: flex; }
  .sidebar nav a { padding: 8px 7px; font-size: 12px; white-space: nowrap; }
  .sidebar-sync { grid-column: 1 / -1; gap: 5px; padding: 5px 0 0; }
  .sidebar-auth-button { justify-self: start; padding: 4px 8px; font-size: 12px; }
  .sidebar-connection { display: flex; gap: 8px; }
  .sidebar-sync small { margin: 0; }
  .operator main { padding: 24px 16px 40px; }
  .asset-table :is(td, th), .participant-list :is(td, th) { padding-inline: 7px; }
  .participant-list .air-column { width: 65px; }
  .asset-table :is(td, th), .participant-list :is(td, th) { font-size: 12px; }
  .asset-links a { font-size: 10px; }
}
