:root {
  --bg:#0b0c10; --panel:#151821; --panel-light:#1b2030;
  --text:#e9eef7; --sub:#b0bac8; --brand:#7aa2ff; --accent:#b388ff;
  --radius:14px; --header-h: 50px;
}
* { box-sizing:border-box; -webkit-tap-highlight-color: transparent; }
html, body { height:100%; overflow:hidden; }
body{ 
  margin:0; background:var(--bg); color:var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  display: flex; flex-direction: column;
}

.screen { display: flex; flex: 1; overflow-y: auto; overflow-x: hidden; flex-direction: column; height: 100%; }

header{ 
  flex: 0 0 var(--header-h); z-index:50;
  background: rgba(11,12,16,0.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid #1b1f2a;
  display:flex; align-items:center; justify-content: space-between; padding:0 16px;
  position: relative !important; z-index: 3000 !important; pointer-events: auto !important;
}
.brand { font-weight:800; font-size:18px; letter-spacing:-0.5px; color:#fff; }
.brand span { color:var(--brand); }
.header-right { display:flex; gap:12px; }
.header-btn { background:none; border:none; color:var(--sub); padding:8px; font-size:22px; cursor:pointer; }

#topInputSection {
  width:100%; background:var(--panel); border-bottom:1px solid #242a3a;
  padding: 12px; transition: all 0.3s ease; overflow:hidden; flex-shrink: 0;
}
#topInputSection.collapsed { padding:0; height:0; border:none; }
.input-row { display:flex; gap:8px; width:100%; max-width:1100px; margin:0 auto; }
input[type="text"] {
  flex:1; background:#0f1320; border:1px solid #2a334d; color:#fff;
  padding:10px 12px; border-radius:10px; font-size:14px; outline:none;
}

/* --- 무대 공통 --- */
.stage-wrap { width:100%; max-width:1100px; margin:0 auto; padding:10px 12px 0; flex-shrink: 0; }
.stage { 
  width:100%; aspect-ratio: 16/9;
  background:#000; border-radius:12px; overflow:hidden; 
  box-shadow: 0 4px 24px rgba(0,0,0,0.4);
  /* IMPORTANT: allow absolutely-positioned gesture layers to stay inside the stage */
  position: relative;
  touch-action: pan-y;
  transition: aspect-ratio 0.3s ease;
}
.stage.vertical-mode { aspect-ratio: 9/16; }
/* split 모드에서 9:16은 aspect-ratio 강제 없이 height만 늘림 */
#stageSplit.vertical-mode { aspect-ratio: unset !important; min-height: 80vh; }

/* ── Split ↕ 상하분할 (split-v-mode) ──────────────────────────
   vertical-mode와 완전 분리. aspect-ratio 건드리지 않음.
   ─────────────────────────────────────────────────────────── */
#stageSplit.split-v-mode {
  grid-template-columns: 1fr !important;
  grid-template-rows: var(--split-val, 50%) 14px 1fr;
}
#stageSplit.split-v-mode #splitLeft,
#stageSplit.split-v-mode #splitRight {
  width: 100% !important;
  height: 100% !important;
}
#stageSplit.split-v-mode #resizer {
  width: 100% !important;
  height: 14px !important;
  cursor: row-resize !important;
}
#stageSplit.split-v-mode #gestureZoneSplit {
  width: 100% !important;
  height: var(--split-val, 50%) !important;
  top: 0 !important;
  bottom: auto !important;
}

/* --- [오버레이 모드 전용] --- */
#stageOverlay { position: relative; display: block; }
#stageOverlay .layer { position:absolute; inset:0; display:grid; place-items:center; pointer-events:none; opacity: 0; transition: opacity 0.25s ease; }
#stageOverlay.ready .layer { opacity: 1; }

/* [수정] 내 모습(userWrap)을 유튜브 위로 올림 */
#ytWrap { 
    position:absolute; inset:0; 
    width:100%; height:100%; 
    pointer-events:none; 
    z-index: 1; /* 뒤쪽 */
    transform-origin: center center; 
    will-change: transform;
}
#userWrap {
    z-index: 2; /* 앞쪽 (오버레이) */
    width: 100%;
    height: 100%;
    display: block;
}

/* 오버레이 내부 비디오들 */
#ytWrap iframe, #ytWrap video,
#userWrap video { 
    width:100%; height:100%; border:0; background:transparent; display:block; 
}
#stageOverlay .overlay video { 
    opacity:var(--overlay, .6); object-fit: cover;
}

/* --- [스플릿 모드 전용] --- */
#stageSplit {
    display: grid; 
    grid-template-columns: var(--split-val, 50%) 14px 1fr; 
    gap: 0; 
    user-select: none;
}
.cell { position:relative; background:#000; overflow:hidden; width:100%; height:100%; }
.inner { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; overflow:hidden; }

/* [수정] 스플릿 모드에서도 줌이 되도록 transform:none 제거 */
.inner iframe, .inner video, .inner .innerYT { 
    width:100% !important; height:100% !important; 
    object-fit: contain !important; 
}

/* --- 미러링 공통 클래스 --- */
#stageSplit .innerYT { width:100%; height:100%; display:block; }

/* --- 제스처 존 ---
   IMPORTANT:
   - Default: do NOT intercept clicks (keeps links/buttons in the page clickable)
   - Enable only when body has .stage-active (JS toggles)
*/
.gesture-zone { position:absolute; inset:0; z-index: 100; pointer-events: none; touch-action: none; }
.stage-active .gesture-zone { pointer-events: auto !important; }
.gesture-zone.disabled { pointer-events: none !important; }

/* 스플릿 제스처 존 (왼쪽만 덮기) */
#gestureZoneSplit {
    width: var(--split-val, 50%) !important; 
    right: auto !important; left: 0 !important;
    z-index: 500 !important; 
}

/* 리사이저 */
.resizer {
    background: #2a334d; cursor: col-resize;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 2000 !important; 
    transition: background 0.2s;
}
.resizer:hover, .resizer.active { background: var(--brand); }
.handle-icon { color: #fff; font-size: 10px; pointer-events: none; }

/* 탭 피드백 */
.tap-feedback {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.5);
    font-size: 32px; color: rgba(255,255,255,0.9); font-weight: 700;
    background: rgba(0,0,0,0.6); padding: 16px 24px; border-radius: 50px;
    opacity: 0; pointer-events: none; z-index: 200; white-space: nowrap;
}
.tap-feedback.animate { animation: popFade 0.5s ease-out forwards; }
@keyframes popFade {
  0%{ opacity:0; transform:translate(-50%,-50%) scale(0.5); }
  20%{ opacity:1; transform:translate(-50%,-50%) scale(1.1); }
  100%{ opacity:0; transform:translate(-50%,-50%) scale(1.2); }
}

/* --- 컨트롤 패널 --- */
.main-controls { 
    width:100%; max-width:1100px; margin:0 auto; padding:10px 12px; flex-shrink: 0; 
    position: relative !important; z-index: 3000 !important; pointer-events: auto !important;
}
.progress-bar-area { display:flex; align-items:center; gap:8px; margin-bottom:12px; width:100%; }
.time-badge { font-variant-numeric: tabular-nums; font-size:11px; color:var(--sub); min-width:42px; text-align:center; }
input[type=range] { flex:1; height:4px; appearance:none; background:#2a334d; border-radius:4px; outline:none; cursor:pointer;}
input[type=range]::-webkit-slider-thumb { appearance:none; width:16px; height:16px; border-radius:50%; background:var(--brand); border:2px solid #0b0c10; margin-top:-6px;}
input[type=range]::-webkit-slider-runnable-track { height: 4px; background: #2a334d; }
.marker-track { position:relative; width:100%; height:0; }
.marker { position:absolute; top:-12px; width:2px; height:8px; background:var(--accent); }

.action-deck { 
  display:grid; grid-template-columns: repeat(5, 1fr); gap:8px; 
  background: var(--panel-light); padding:10px; border-radius:16px;
  align-items:center; justify-items:center; margin-bottom: 8px;
}
.act-btn { width:100%; height:44px; border-radius:12px; border:none; background:#262c40; color:#fff; font-size:18px; display:flex; align-items:center; justify-content:center; }
.act-btn.primary { background:var(--brand); color:var(--bg); font-size:20px; box-shadow: 0 4px 12px rgba(122,162,255,0.3); }

.toggle-row { display:grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap:8px; margin-bottom: 12px; }
.toggle-btn { background: transparent; border: 1px solid #242a3a; color: var(--sub); border-radius: 8px; font-size: 11px; height: 32px; font-weight: 600; }
.toggle-btn.active { background: var(--brand); color: #000; border-color: var(--brand); }
.toggle-btn.mirror-on { background: var(--accent); color: #fff; border-color: var(--accent); }

.sub-deck { display:flex; flex-direction:column; gap:12px; background:var(--panel); padding:12px; border-radius:14px; overflow:visible; }
.slider-row { display:flex; gap:12px; }
.slider-col { flex:1; display:flex; flex-direction:column; gap:6px; min-width:0; }
.slider-label { font-size:11px; color:var(--sub); display:flex; justify-content:space-between; }
.speed-presets { display: flex; gap: 4px; margin-bottom: 6px; overflow-x: auto; padding-bottom: 2px; }
.speed-btn { flex: 0 0 auto; background: #262c40; border: 1px solid #3b4d7a; color: #ccc; font-size: 10px; padding: 4px 6px; border-radius: 6px; min-width: 32px; text-align: center; cursor: pointer; }
.speed-btn.active { background: var(--brand); color: #000; border-color: var(--brand); font-weight: bold; }
.tempo-block { border-top:1px solid #242a3a; padding-top:12px; }
.tempo-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.tempo-label { font-size:12px; font-weight:700; color:var(--sub); }
.bpm-value { font-size:13px; font-weight:800; color:var(--brand); }
#beatVisual { height:6px; background:#1b2030; margin-top:10px; border-radius:3px; transition:background 0.05s; }

.ad-section { width: 100%; max-width: 960px; margin: 10px auto; padding: 0 12px; display: flex; justify-content: center; flex-shrink: 0; }
.content-section { width: 100%; max-width: 960px; margin: 0 auto; padding: 0 12px 100px; }
.info-card { background: #151821; border-radius: 14px; padding: 20px; margin-bottom: 16px; border: 1px solid #242a3a; }
.info-title { font-size: 16px; font-weight: 800; color: #fff; margin-bottom: 12px; display:flex; align-items:center; gap:6px;}
.info-text { font-size: 14px; color: #c8d7ff; line-height: 1.6; margin-bottom: 10px; }

details { margin-bottom: 8px; background: #1b2030; border-radius: 8px; overflow: hidden; }
summary { padding: 12px; cursor: pointer; font-size: 14px; font-weight: 600; color: #ddd; list-style: none; display: flex; justify-content: space-between; align-items: center; }
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; font-size: 18px; color: var(--sub); }
details[open] summary::after { content: '-'; }
.details-content { padding: 12px; border-top: 1px solid #242a3a; font-size: 13px; color: #9aa4b2; line-height: 1.5; }

/* --- 사이드바 및 오버레이 --- */
.sidebar-overlay { position:fixed; inset:0; background:rgba(0,0,0,0.5); z-index:999; opacity:0; pointer-events:none; transition:opacity 0.3s; }
.sidebar-overlay.active { opacity:1; pointer-events:auto; }
.sidebar { 
    position:fixed !important; top:0; right:0; bottom:0; width:180px; z-index:4000 !important;
    background: rgba(21, 12, 16, 0.95); backdrop-filter: blur(12px); border-left: 1px solid rgba(255,255,255,0.1); 
    transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 12px; display:flex; flex-direction:column; gap:12px; overflow-y: auto; 
}
.sidebar.open { transform: translateX(0); }
.sidebar-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:4px; }
.sidebar-title { font-size:14px; font-weight:700; color:var(--text); }
.btn-close { background:none; border:none; color:var(--sub); font-size:20px; padding:4px; }
.tool-card { background:#151821; border:1px solid #242a3a; padding:10px; border-radius:10px; display:flex; flex-direction:column; gap:8px; }
.tool-label { font-size:12px; color:var(--sub); font-weight:700; }
.btn-sm { font-size:11px; padding:8px; border-radius:6px; background:#262c40; border:none; color:#ddd; width:100%; font-weight:600; }
.btn-brand-sm { background:var(--brand); color:#000; }

/* === 화질 선택 버튼 === */
.quality-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.btn-quality {
  font-size: 11px;
  font-weight: 700;
  padding: 8px 4px;
  border-radius: 7px;
  border: 1.5px solid #2a334d;
  background: #1b2030;
  color: #8899cc;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
}
.btn-quality:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: rgba(122,162,255,0.08);
}
.btn-quality.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #000;
  box-shadow: 0 0 10px rgba(122,162,255,0.35);
}
.btn-quality.loading {
  opacity: 0.55;
  pointer-events: none;
  animation: qualityPulse 0.8s ease infinite;
}
@keyframes qualityPulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 0.85; }
}

/* === 고화질 호출 버튼 === */
.btn-boost-quality {
  width: 100%;
  padding: 10px 8px;
  border-radius: 8px;
  border: 1.5px solid var(--brand);
  background: rgba(122,162,255,0.1);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  letter-spacing: 0.3px;
}
.btn-boost-quality:hover { background: rgba(122,162,255,0.2); }
.btn-boost-quality:disabled { opacity: 0.6; cursor: not-allowed; }
.quality-hint {
  font-size: 11px;
  color: var(--sub);
  background: #0d1119;
  border-radius: 5px;
  padding: 4px 8px;
  text-align: center;
  letter-spacing: 0.2px;
}
.quality-note {
  font-size: 10px;
  color: #4a5a80;
  line-height: 1.5;
  text-align: center;
  margin-top: 2px;
}

.help-modal { display:none; position:fixed; inset:0; z-index:2000; align-items:center; justify-content:center; padding:20px; background:rgba(0,0,0,0.6); backdrop-filter:blur(4px); }
.help-modal.open { display:flex; }
.help-content { background:#1b2030; border:1px solid #2a334d; width:100%; max-width:320px; border-radius:16px; padding:20px; box-shadow:0 10px 40px rgba(0,0,0,0.5); }
.help-title { font-size:16px; font-weight:800; color:#fff; margin-bottom:12px; }
.help-item { margin-bottom:12px; font-size:13px; color:#c8d7ff; line-height:1.5; }
.help-item strong { color:var(--brand); display:block; margin-bottom:2px; }
.help-btn-close { width:100%; padding:12px; background:var(--brand); color:#000; font-weight:bold; border-radius:10px; border:none; margin-top:8px; }

/* --- 전체화면 및 버튼 --- */
.stage-toolbar {
    display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px;
    position: relative; z-index: 2002; padding: 4px 8px;
    pointer-events: auto !important;
}

#mainStageWrap:fullscreen, #mainStageWrap:-webkit-full-screen {
    width: 100vw !important; height: 100vh !important;
    background: #000; display: flex; flex-direction: column; padding: 0 !important; margin: 0 !important;
    max-width: none !important; justify-content: stretch;
}
#mainStageWrap:fullscreen .stage, #mainStageWrap:-webkit-full-screen .stage {
    flex: 1; width: 100% !important; height: auto !important;
    aspect-ratio: unset !important; border-radius: 0; margin: 0;
}
#mainStageWrap:fullscreen #stageSplit { grid-template-columns: var(--split-val, 50%) 14px 1fr; }

/* 풀스크린 + split-v-mode: 상하분할 */
#mainStageWrap:fullscreen #stageSplit.split-v-mode,
#mainStageWrap:-webkit-full-screen #stageSplit.split-v-mode {
  grid-template-columns: 1fr !important;
  grid-template-rows: var(--split-val, 50%) 14px 1fr !important;
}
#mainStageWrap:fullscreen #stageSplit.split-v-mode #splitLeft,
#mainStageWrap:fullscreen #stageSplit.split-v-mode #splitRight,
#mainStageWrap:-webkit-full-screen #stageSplit.split-v-mode #splitLeft,
#mainStageWrap:-webkit-full-screen #stageSplit.split-v-mode #splitRight {
  width: 100% !important;
  height: 100% !important;
}
#mainStageWrap:fullscreen #stageSplit.split-v-mode #resizer,
#mainStageWrap:-webkit-full-screen #stageSplit.split-v-mode #resizer {
  width: 100% !important;
  height: 14px !important;
  cursor: row-resize !important;
}
#mainStageWrap:fullscreen #stageSplit.split-v-mode #gestureZoneSplit,
#mainStageWrap:-webkit-full-screen #stageSplit.split-v-mode #gestureZoneSplit {
  width: 100% !important;
  height: var(--split-val, 50%) !important;
  top: 0 !important;
  bottom: auto !important;
}

#mainStageWrap:fullscreen .stage-toolbar, #mainStageWrap:-webkit-full-screen .stage-toolbar {
    padding: 15px 20px; background: #151821;      
    position: relative; z-index: 2147483647; 
    flex-shrink: 0; border-top: 1px solid #333;
    width: 100%; justify-content: center;
}

/* --- Progress bar: 항상 main-controls 전체 폭을 채움 --- */
.main-controls {
  /* padding 안쪽까지 재생바가 꽉 차도록 box-sizing 확인 */
  box-sizing: border-box;
}
.progress-bar-area,
#progressBarArea {
  width: 100% !important;
  box-sizing: border-box;
  margin-left: 0 !important;
  margin-right: 0 !important;
}
#progressBarArea .time-badge { min-width: 36px; }
#progressShell {
  flex: 1 1 0%;
  min-width: 0;
  width: 100%;
}
/* range input이 flex 컨테이너 안에서 꽉 차도록 */
#progressShell input[type=range] {
  width: 100%;
  flex: 1;
}



/* =========================
   FIX: YouTube frame fit (NO CROP, contain only)
   Overlay / Split / Fullscreen unified
========================= */

/* Overlay */
#ytWrap {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
}

#ytWrap .innerYT {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  display:flex;
  align-items:center;
  justify-content:center;
  transform-origin:center center;
  will-change:transform;
}

#ytWrap iframe {
  width:100%;
  height:100%;
  object-fit:contain;
}

/* Split */
#stageSplit .inner {
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
}

#stageSplit .inner .innerYT {
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  transform-origin:center center;
}

#stageSplit iframe {
  width:100%;
  height:100%;
  object-fit:contain;
}



/* ===============================
   TOUCH FIX – UI Click Enable
   =============================== */

/* gesture layers should NOT block UI */
#gestureZone,
#gestureZoneSplit {
  pointer-events: none;
}

/* stage layers only receive touch when explicitly enabled */
.stage-active #gestureZone,
.stage-active #gestureZoneSplit {
  pointer-events: auto;
}

/* ensure header & controls always clickable */
header,
.controls,
button,
input,
a {
  pointer-events: auto !important;
}



/* =========================
   FIX: Split Fullscreen (fill height)
========================= */
#mainStageWrap:fullscreen #stageSplit,
#mainStageWrap:-webkit-full-screen #stageSplit{
  height: 100% !important;
  align-content: stretch !important;
}

#mainStageWrap:fullscreen .stage,
#mainStageWrap:-webkit-full-screen .stage{
  height: 100% !important;
  aspect-ratio: unset !important;
}

#mainStageWrap:fullscreen #stageSplit .cell,
#mainStageWrap:-webkit-full-screen #stageSplit .cell,
#mainStageWrap:fullscreen #stageSplit .inner,
#mainStageWrap:-webkit-full-screen #stageSplit .inner{
  height: 100% !important;
}

#mainStageWrap:fullscreen #stageSplit .inner video,
#mainStageWrap:-webkit-full-screen #stageSplit .inner video{
  object-fit: cover !important; /* fill the cell */
}


/* ===== Split + Zoom UI (v3.1) ===== */
.zoom-badge{
  position:absolute;
  top:10px;
  left:10px;
  z-index:1200;
  padding:6px 10px;
  font-size:12px;
  line-height:1;
  border-radius:999px;
  background:rgba(0,0,0,.45);
  border:1px solid rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color:#fff;
  opacity:0;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
  pointer-events:none;
}
.zoom-badge.show{
  opacity:1;
  transform: translateY(0);
}

.stage.split .cell{
  position:relative;
}
.split-label{
  position:absolute;
  top:8px;
  padding:5px 9px;
  font-size:12px;
  border-radius:999px;
  background:rgba(0,0,0,.35);
  border:1px solid rgba(255,255,255,.10);
  color:#fff;
  opacity:.85;
  pointer-events:none;
  z-index:950;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.split-label.left{ left:8px; }
.split-label.right{ right:8px; }


/* =========================
   Camera Zoom (CAMERA ZOOM)
   - Uses CSS var --camZoom on the <video> element
   - Default 1.0
========================= */
#userWrap video,
#stageSplit .inner video{
  transform: scale(var(--camZoom, 1));
  transform-origin: center center;
  will-change: transform;
}
.mirror-cam{
  transform: scaleX(-1) scale(var(--camZoom, 1)) !important;
  transform-origin: center center;
}


/* =========================
   Fullscreen Exit (X) Button
========================= */
#mainStageWrap{ position: relative; }
.fs-exit{
  position: absolute;
  top: 10px;
  right: 10px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(0,0,0,.45);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  z-index: 9999999;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
}


/* Clean fullscreen (hide 16:9 / FULL bar) */
#mainStageWrap:fullscreen .stage-toolbar,
#mainStageWrap:-webkit-full-screen .stage-toolbar{
  display:none !important;
}
#mainStageWrap.is-fullscreen .fs-exit{ display:flex; }

/* ===========================
   랜딩 화면 스타일
   =========================== */
#landingScreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 24px;
  transition: opacity 0.4s ease, transform 0.4s ease;
}
#landingScreen.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-20px);
}

#landingInner {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.landing-logo {
  font-size: 36px;
  font-weight: 900;
  letter-spacing: -1px;
  color: #fff;
}
.landing-logo span { color: var(--brand); }

.landing-sub {
  font-size: 15px;
  color: var(--sub);
  margin: 0;
  text-align: center;
}

.landing-input-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.landing-paste-hint {
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  animation: hintPulse 2s ease-in-out infinite;
}
@keyframes hintPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.landing-input-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

#landingInput {
  flex: 1;
  background: #0f1320;
  border: 2px solid var(--brand);
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  box-shadow: 0 0 16px rgba(122, 162, 255, 0.25);
  transition: border-color 0.2s, box-shadow 0.2s;
}
#landingInput:focus {
  border-color: var(--accent);
  box-shadow: 0 0 24px rgba(179, 136, 255, 0.35);
}
#landingInput::placeholder {
  color: #444;
  font-size: 13px;
}

#landingLoadBtn {
  background: var(--brand);
  color: #000;
  border: none;
  padding: 14px 22px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s, transform 0.1s;
}
#landingLoadBtn:hover { background: #a0beff; }
#landingLoadBtn:active { transform: scale(0.97); }

.landing-tips {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.landing-tips span {
  background: #1b2030;
  border: 1px solid #2a334d;
  color: var(--sub);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
}

/* ===========================
   인앱 브라우저 경고 배너
   =========================== */
#inappBanner {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 99999;
  background: linear-gradient(135deg, #ff6b35, #ff4757);
  color: #fff;
  padding: 12px 16px;
  display: none;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 20px rgba(255, 71, 87, 0.5);
  animation: bannerSlideDown 0.4s ease;
}
@keyframes bannerSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

#inappBannerInner {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
}

#inappMsg {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

#inappActions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
}

#inappCopyBtn {
  background: #fff;
  color: #ff4757;
  border: none;
  padding: 9px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.1s;
  white-space: nowrap;
}
#inappCopyBtn:active { transform: scale(0.96); }

#inappDismiss {
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
}
#inappDismiss:active { background: rgba(255,255,255,0.3); }

/* 헤더 모드 버튼 - 텍스트 버전 */
#btnToggleMode {
  font-size: 12px !important;
  font-weight: 700 !important;
  letter-spacing: -0.3px;
  color: var(--brand) !important;
  padding: 6px 10px !important;
  border: 1px solid #2a334d;
  border-radius: 8px;
  background: #1b2030 !important;
  min-width: 58px;
}

/* ===========================
   재생바 폭 완전 고정 패치
   - JS가 width를 건드리지 않으므로 CSS만으로 100% 보장
   =========================== */
#progressBarArea {
  display: flex !important;
  align-items: center;
  gap: 8px;
  width: 100% !important;
  min-width: 0;
  box-sizing: border-box;
}
#progressShell {
  flex: 1 1 auto !important;
  min-width: 0 !important;
  position: relative;
}
#progressShell > input[type=range] {
  width: 100% !important;
  display: block;
}

/* ===========================
   토스트 알림 애니메이션
   =========================== */
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(16px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to   { opacity: 0; transform: translateX(-50%) translateY(8px); }
}

/* ===========================
   스플릿 오른쪽 — 카메라 없을 때 안내
   =========================== */
.split-cam-hint {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #060810;
  z-index: 10;
  pointer-events: auto;
  transition: opacity 0.3s ease;
}
.split-cam-hint.hidden {
  opacity: 0;
  pointer-events: none;
}
.split-cam-hint-icon {
  font-size: 36px;
  opacity: 0.5;
}
.split-cam-hint-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  opacity: 0.7;
}
.split-cam-hint-btn {
  background: var(--brand);
  color: #000;
  border: none;
  padding: 10px 22px;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  margin-top: 4px;
}
.split-cam-hint-btn:hover { background: #a0beff; }
.split-cam-hint-btn:active { transform: scale(0.96); }
.split-cam-hint-sub {
  font-size: 11px;
  color: var(--sub);
  opacity: 0.6;
}
