/* ==========================================================================
   Broadcast-Grade iPad Announcer Teleprompter
   Presenter: 마케팅 에이전시 에프알코퍼레이션 대표 김현태
   - OLED Pure Black (#000000) to prevent facial glare on stage
   - Upper-Third Optical Eyeline Guide Band + Smooth 60fps Auto-Scroll
   - Touch-Optimized for iPad Portrait (820x1180) & Landscape (1180x820)
   ========================================================================== */

@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css");

:root {
  --bg: #000000;
  --panel: #111116;
  --panel-hi: #1b1b22;
  --line: rgba(255, 255, 255, 0.14);
  --ink: #f8f8fa;
  --ink-dim: #a1a1aa;
  --blue: #0a84ff;
  --green: #30d158;
  --amber: #ffd60a;
  --red: #ff453a;
  --indigo: #7d7aff;
  --hud-top-h: 64px;
  --hud-bot-h: 118px;
  --font-size: 38px;
  --line-height: 1.66;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "맑은 고딕", sans-serif;
  overflow: hidden;
  letter-spacing: -0.02em;
  word-break: keep-all;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.num {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   TOP BROADCAST HUD
   ========================================================================== */
.hud-top {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: calc(var(--hud-top-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) 16px 0;
  background: rgba(10, 10, 14, 0.90);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hud-left,
.hud-center,
.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(10, 132, 255, 0.45);
  background: rgba(10, 132, 255, 0.16);
  color: #ffffff;
  font-size: 13.5px;
  white-space: nowrap;
}
.hud-pill span {
  color: #93c5fd;
  font-weight: 700;
}
.dot-live {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #636366;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
body.is-playing .dot-live {
  background: var(--red);
  box-shadow: 0 0 10px rgba(255, 69, 58, 0.9);
}

.timer-pill {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-hi);
  color: #ffffff;
  white-space: nowrap;
}
.timer-phase {
  font-size: 11.8px;
  font-weight: 800;
  color: var(--green);
}
.timer-pill.is-warn .timer-phase {
  color: var(--amber);
}
.timer-pill.is-qna .timer-phase {
  color: var(--blue);
}
.timer-pill.is-over .timer-phase,
.timer-pill.is-over strong {
  color: var(--red);
}
.timer-pill strong {
  font-size: 18px;
  font-weight: 850;
}
.timer-total {
  font-size: 12px;
  color: var(--ink-dim);
  font-weight: 700;
}

.hud-btn,
.hud-icon-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: #f5f5f7;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 13px;
  border-radius: 999px;
  white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}
.hud-icon-btn {
  padding: 8px 11px;
  font-size: 15px;
}
.hud-btn:hover,
.hud-icon-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.hud-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
}
.hud-btn.is-green {
  background: rgba(48, 209, 88, 0.22);
  border-color: rgba(48, 209, 88, 0.60);
  color: #86efac;
}

.mode-switch {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}
.ms-btn {
  border: 0;
  background: transparent;
  color: var(--ink-dim);
  font-size: 12.6px;
  font-weight: 750;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.ms-btn.active {
  background: #ffffff;
  color: #000000;
}

/* ==========================================================================
   OPTICAL EYELINE GUIDE BAND + SOFT VIGNETTES
   ========================================================================== */
.eyeline-band {
  position: fixed;
  top: 29%;
  left: 0;
  right: 0;
  height: 78px;
  transform: translateY(-50%);
  z-index: 30;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(255, 214, 10, 0.03) 0%,
    rgba(255, 214, 10, 0.10) 50%,
    rgba(255, 214, 10, 0.03) 100%
  );
  border-top: 1px solid rgba(255, 214, 10, 0.24);
  border-bottom: 1px solid rgba(255, 214, 10, 0.24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
}
body.card-mode .eyeline-band,
body.card-mode .fade-top,
body.card-mode .fade-bottom {
  display: none;
}
.eyeline-arrow {
  color: var(--amber);
  font-size: 20px;
  font-weight: 900;
  text-shadow: 0 0 12px rgba(255, 214, 10, 0.7);
}
.eyeline-line {
  flex: 1;
}

.fade-top {
  position: fixed;
  top: calc(var(--hud-top-h) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  height: 82px;
  z-index: 25;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0) 100%);
}
.fade-bottom {
  position: fixed;
  bottom: calc(var(--hud-bot-h) + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  height: 110px;
  z-index: 25;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.96) 0%, rgba(0, 0, 0, 0) 100%);
}

/* ==========================================================================
   MAIN TELEPROMPTER VIEWPORT
   ========================================================================== */
.prompter-viewport {
  position: fixed;
  top: calc(var(--hud-top-h) + env(safe-area-inset-top));
  left: 0;
  right: 0;
  bottom: calc(var(--hud-bot-h) + env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: auto;
  background: var(--bg);
}

.prompter-track {
  max-width: 860px;
  margin: 0 auto;
  padding: 21vh 52px 58vh;
  transition: transform 0.2s ease;
}

/* Mirror Mode for Physical Teleprompter Beam-Splitter Glass */
body.is-mirrored .prompter-track {
  transform: scaleX(-1);
}

.stage-block {
  margin-bottom: 84px;
  padding-bottom: 56px;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.16);
}
body.card-mode .prompter-track {
  padding: 28px 44px 48px;
}
body.card-mode .stage-block {
  display: none;
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 16px;
}
body.card-mode .stage-block.active-card {
  display: block;
}

.sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 18px;
  border-radius: 14px;
  background: rgba(10, 132, 255, 0.14);
  border: 1px solid rgba(10, 132, 255, 0.36);
  margin-bottom: 20px;
}
.sb-header.is-green {
  background: rgba(48, 209, 88, 0.13);
  border-color: rgba(48, 209, 88, 0.38);
}
.sb-header.is-indigo {
  background: rgba(125, 122, 255, 0.16);
  border-color: rgba(125, 122, 255, 0.42);
}
.sb-num {
  font-size: 16px;
  font-weight: 900;
  color: #93c5fd;
}
.sb-header.is-green .sb-num {
  color: #86efac;
}
.sb-header.is-indigo .sb-num {
  color: #c4b5fd;
}
.sb-title {
  font-size: 17px;
  font-weight: 800;
  color: #ffffff;
}
.sb-clock {
  font-size: 14px;
  font-weight: 800;
  color: var(--amber);
  font-variant-numeric: tabular-nums;
}

/* Non-Spoken Broadcast Action Cue Box (NEVER read out loud!) */
.cue-box {
  margin: 0 0 22px;
  padding: 13px 18px;
  border-radius: 13px;
  background: rgba(255, 214, 10, 0.13);
  border-left: 4px solid var(--amber);
  color: #fef08a;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.5;
}
.cue-box strong {
  color: var(--amber);
  margin-right: 6px;
}

/* Spoken Announcer Paragraphs (Huge, Effortless Breath-Grouped Korean) */
.spoken-body {
  font-size: var(--font-size);
  line-height: var(--line-height);
  font-weight: 600;
  color: var(--ink);
}
.spoken-body p {
  margin: 0 0 0.9em;
}
.spoken-body .hl {
  color: #ffd60a;
  font-weight: 800;
}
.spoken-body .em-blue {
  color: #7cc0ff;
  font-weight: 800;
}
.spoken-body .em-green {
  color: #6ee7b7;
  font-weight: 800;
}
.inline-cue {
  display: inline-block;
  vertical-align: middle;
  margin: 0 6px;
  padding: 2px 11px;
  border-radius: 8px;
  background: rgba(255, 69, 58, 0.22);
  border: 1px solid rgba(255, 69, 58, 0.55);
  color: #fca5a5;
  font-size: 0.46em;
  font-weight: 850;
  line-height: 1.45;
  letter-spacing: 0;
}
.inline-cue.is-pause {
  background: rgba(10, 132, 255, 0.22);
  border-color: rgba(10, 132, 255, 0.55);
  color: #bfdbfe;
}

/* ==========================================================================
   BOTTOM BROADCAST CONTROL DOCK
   ========================================================================== */
.hud-bottom {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  height: calc(var(--hud-bot-h) + env(safe-area-inset-bottom));
  padding: 0 16px env(safe-area-inset-bottom);
  background: rgba(12, 12, 16, 0.94);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

.next-ticker {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-dim);
  padding: 0 4px;
}
.nt-label {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(48, 209, 88, 0.20);
  color: #86efac;
  font-size: 11px;
  font-weight: 900;
  flex-shrink: 0;
}
.next-ticker strong {
  color: #e5e5ea;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nt-slides-link {
  margin-left: auto;
  color: #7cc0ff;
  font-weight: 750;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.dock-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.ctrl-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: 999px;
}

.dock-btn {
  border: 0;
  background: rgba(255, 255, 255, 0.09);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 750;
  padding: 9px 14px;
  border-radius: 999px;
  white-space: nowrap;
}
.dock-btn:active {
  transform: scale(0.96);
  background: rgba(255, 255, 255, 0.22);
}

.readout {
  min-width: 48px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--amber);
}

.play-btn {
  flex: 1;
  max-width: 310px;
  border: 0;
  background: var(--blue);
  color: #ffffff;
  font-size: 16px;
  font-weight: 850;
  padding: 13px 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  box-shadow: 0 8px 26px rgba(10, 132, 255, 0.42);
  transition: background 0.18s ease, transform 0.12s ease;
}
.play-btn:active {
  transform: scale(0.98);
}
body.is-playing .play-btn {
  background: var(--red);
  box-shadow: 0 8px 26px rgba(255, 69, 58, 0.42);
}

/* ==========================================================================
   MODALS: 21-STAGE TOC & 14-INDUSTRY LIVE Q&A CHEAT SHEET
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(0, 0, 0, 0.84);
  backdrop-filter: blur(14px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-backdrop.open {
  display: flex;
}
.modal-sheet {
  width: 100%;
  max-width: 920px;
  max-height: 86vh;
  background: #131318;
  border: 1px solid var(--line);
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-sheet.is-wide {
  max-width: 980px;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-head strong {
  display: block;
  font-size: 16.5px;
  color: #ffffff;
}
.modal-head span {
  display: block;
  font-size: 12.6px;
  color: var(--ink-dim);
  margin-top: 2px;
}

.toc-grid {
  padding: 16px 20px 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.toc-card {
  text-align: left;
  padding: 13px 14px;
  border-radius: 13px;
  background: #1c1c24;
  border: 1px solid rgba(255, 255, 255, 0.10);
  color: #ffffff;
}
.toc-card.active {
  border-color: var(--blue);
  background: rgba(10, 132, 255, 0.22);
}
.toc-card span {
  display: block;
  font-size: 11.6px;
  font-weight: 800;
  color: #8cc8ff;
  margin-bottom: 4px;
}
.toc-card strong {
  display: block;
  font-size: 13.6px;
  line-height: 1.38;
}

.qna-chips {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  background: #0d0d12;
}
.qna-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: #d1d1d6;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 13px;
  border-radius: 999px;
}
.qna-chip.active {
  background: var(--green);
  border-color: var(--green);
  color: #000000;
  font-weight: 850;
}

.qna-script-box {
  padding: 22px 26px 28px;
  overflow-y: auto;
}
.qs-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.qs-title {
  margin: 0;
  font-size: 24px;
  font-weight: 850;
  color: #ffffff;
}
.qs-anxiety {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 69, 58, 0.18);
  color: #fca5a5;
  font-size: 13px;
  font-weight: 800;
}
.qs-ask {
  padding: 13px 16px;
  border-radius: 13px;
  background: rgba(255, 214, 10, 0.14);
  border-left: 4px solid var(--amber);
  color: #fef08a;
  font-size: 16.5px;
  font-weight: 750;
  margin-bottom: 16px;
}
.qs-spoken {
  font-size: 23px;
  line-height: 1.65;
  color: #f8f8fa;
  font-weight: 600;
  margin: 0 0 18px;
}
.qs-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.qs-card {
  padding: 13px 14px;
  border-radius: 12px;
  background: #1c1c24;
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 13.5px;
  line-height: 1.55;
  color: #d4d4d8;
}
.qs-card strong {
  display: block;
  margin-bottom: 5px;
  color: #8cc8ff;
}

.toast {
  position: fixed;
  top: calc(var(--hud-top-h) + 16px);
  left: 50%;
  transform: translate(-50%, -12px);
  opacity: 0;
  pointer-events: none;
  z-index: 150;
  padding: 9px 18px;
  border-radius: 999px;
  background: rgba(28, 28, 34, 0.96);
  border: 1px solid var(--line);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 750;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ==========================================================================
   IPAD PORTRAIT & MOBILE RESPONSIVE
   ========================================================================== */
@media (max-width: 960px) {
  :root {
    --hud-top-h: 62px;
    --hud-bot-h: 126px;
  }
  .timer-phase,
  .timer-total,
  #btnWake,
  .nt-slides-link {
    display: none;
  }
  .toc-grid,
  .qs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .prompter-track {
    padding: 20vh 30px 58vh;
  }
}

@media (max-width: 680px) {
  :root {
    --hud-top-h: 58px;
    --hud-bot-h: 156px;
    --font-size: 28px;
  }
  #btnMirror,
  #hudStageTime {
    display: none;
  }
  .hud-btn,
  .hud-pill {
    padding: 7px 10px;
    font-size: 12px;
  }
  .dock-controls {
    flex-wrap: wrap;
    justify-content: center;
  }
  .play-btn {
    order: -1;
    flex: 1 1 100%;
    max-width: none;
    padding: 11px 16px;
    font-size: 15px;
  }
  .dock-btn {
    padding: 7px 10px;
    font-size: 12.2px;
  }
  .toc-grid,
  .qs-grid {
    grid-template-columns: 1fr;
  }
  .prompter-track {
    padding: 18vh 18px 56vh;
  }
}
