:root {
  color-scheme: dark;
  --bg: #090b10;
  --panel: rgba(18, 20, 29, 0.86);
  --panel-solid: #151923;
  --line: rgba(214, 189, 120, 0.24);
  --line-blue: rgba(143, 185, 232, 0.28);
  --text: #f5f0e8;
  --muted: #b9b2a7;
  --gold: #d9bd76;
  --blue: #93bce8;
  --rose: #cf8e9c;
  --danger: #d46c74;
  --good: #91c99b;
  --font-ui: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-story: "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", "KoPub Batang", serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at 20% 0%, #202c3f 0, #090b10 42%, #050608 100%);
  color: var(--text);
  font-family: var(--font-ui);
}

button {
  font: inherit;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
  min-height: 100vh;
  padding: 16px;
}

.stage-panel {
  position: relative;
  min-height: calc(100vh - 32px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0e1118;
}

.scene-bg {
  position: absolute;
  inset: 0;
  background-position: center top;
  background-size: cover;
  filter: saturate(0.94) contrast(1.04);
  transition: opacity 220ms ease, transform 800ms ease;
}

.scene-vignette {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 6, 9, 0.12), rgba(5, 6, 9, 0.2) 44%, rgba(5, 6, 9, 0.84)),
    radial-gradient(circle at 50% 12%, transparent 0, rgba(0, 0, 0, 0.36) 68%);
}

.silhouette-layer {
  pointer-events: none;
  position: absolute;
  z-index: 1;
  inset: 0;
  overflow: hidden;
}

.silhouette {
  position: absolute;
  bottom: -8vh;
  width: clamp(180px, 22vw, 310px);
  margin: 0;
  opacity: 0.18;
  filter: grayscale(0.34) sepia(0.14) blur(0.2px);
  mix-blend-mode: screen;
}

.silhouette img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
  mask-image: linear-gradient(180deg, #000 0 58%, rgba(0, 0, 0, 0.5) 76%, transparent 100%);
}

.silhouette-1 {
  left: clamp(6px, 7vw, 90px);
}

.silhouette-2 {
  right: clamp(8px, 7vw, 96px);
  opacity: 0.14;
}

.silhouette-3 {
  left: 50%;
  transform: translateX(-50%);
  opacity: 0.1;
}

.silhouette-4 {
  right: 24%;
  opacity: 0.08;
}

.topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
}

.topbar p,
.episode-select-label {
  margin: 0 0 5px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.episode-select-label {
  display: block;
}

.episode-select {
  width: min(260px, 58vw);
  margin: 0 0 6px;
  padding: 0;
  border: 0;
  color: var(--gold);
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  appearance: none;
}

.episode-select:focus-visible {
  outline: 2px solid rgba(231, 201, 121, 0.58);
  outline-offset: 4px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(23px, 4vw, 38px);
  letter-spacing: 0;
  text-shadow: 0 2px 20px rgba(0, 0, 0, 0.7);
}

.top-actions {
  display: flex;
  gap: 8px;
}

.top-actions button,
.next-button,
.choice-list button {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(16, 20, 28, 0.72);
  color: var(--text);
  cursor: pointer;
}

.top-actions button {
  min-width: 68px;
  padding: 8px 10px;
}

.character-strip {
  position: absolute;
  z-index: 2;
  left: 18px;
  top: 96px;
  display: grid;
  gap: 9px;
  width: 188px;
}

.character-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(12, 14, 20, 0.72);
  backdrop-filter: blur(12px);
  opacity: 0.62;
  transform: translateX(-2px);
  transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.character-card.active {
  border-color: rgba(217, 189, 118, 0.7);
  opacity: 1;
  transform: translateX(0);
}

.character-card img {
  width: 48px;
  height: 58px;
  border-radius: 6px;
  object-fit: cover;
  object-position: top center;
  background: #07080c;
}

.character-card strong {
  display: block;
  font-size: 13px;
}

.character-card small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.dialogue-card {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  width: min(760px, calc(100% - 36px));
  transform: translateX(-50%);
  padding: 16px;
  border: 1px solid rgba(214, 189, 120, 0.38);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(17, 20, 29, 0.92), rgba(10, 12, 18, 0.96));
  box-shadow: 0 22px 70px rgba(0, 0, 0, 0.44);
  backdrop-filter: blur(16px);
}

.speaker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#speakerName {
  color: var(--gold);
  font-weight: 900;
}

#sceneCounter {
  color: var(--muted);
  font-size: 12px;
}

#storyText {
  min-height: 76px;
  margin: 0;
  color: #fffaf3;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.68;
  word-break: keep-all;
}

.choice-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.choice-list button {
  width: 100%;
  padding: 11px 12px;
  text-align: left;
  line-height: 1.4;
  background: rgba(35, 42, 55, 0.82);
}

.choice-list button:hover,
.top-actions button:hover,
.next-button:hover {
  border-color: rgba(217, 189, 118, 0.7);
  background: rgba(53, 61, 77, 0.86);
}

.next-button {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(96, 73, 48, 0.9), rgba(42, 59, 86, 0.9));
  font-weight: 900;
}

.side-panel {
  display: grid;
  gap: 12px;
  align-content: start;
  max-height: calc(100vh - 32px);
  overflow: auto;
}

.panel-card {
  border: 1px solid var(--line-blue);
  border-radius: 10px;
  background: var(--panel);
  padding: 14px;
  backdrop-filter: blur(16px);
}

.panel-head {
  margin-bottom: 12px;
}

.panel-head span {
  display: inline-flex;
  width: fit-content;
  padding: 3px 8px;
  border: 1px solid rgba(143, 185, 232, 0.5);
  border-radius: 999px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 900;
}

.panel-head h2 {
  margin: 7px 0 0;
  font-size: 18px;
}

.stat-grid {
  display: grid;
  gap: 10px;
}

.stat {
  display: grid;
  gap: 6px;
}

.stat-label {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.meter i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--gold));
  transition: width 180ms ease;
}

.flag-list {
  display: grid;
  gap: 8px;
  min-height: 74px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.flag-list li {
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 12px;
  line-height: 1.45;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gallery-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.gallery-card.locked {
  filter: grayscale(1);
  opacity: 0.45;
}

.gallery-card img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
}

.gallery-card span {
  display: block;
  padding: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.security-card p,
.security-card dd,
.security-card dt {
  font-size: 12px;
  line-height: 1.5;
}

.security-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.security-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.security-card div {
  display: grid;
  gap: 2px;
}

.security-card dt {
  color: var(--gold);
  font-weight: 800;
}

.security-card dd {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 1080px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .side-panel {
    max-height: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 0;
  }

  .stage-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
  }

  .character-strip {
    left: 12px;
    right: 12px;
    top: 86px;
    width: auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-card {
    grid-template-columns: 36px 1fr;
    padding: 6px;
  }

  .character-card img {
    width: 36px;
    height: 44px;
  }

  .character-card small {
    display: none;
  }

  .dialogue-card {
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 14px;
  }

  .side-panel {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}

/* Text-first novel reader direction */
.app-shell.text-first {
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  background:
    radial-gradient(circle at 50% 10%, rgba(54, 73, 103, 0.28), transparent 42%),
    linear-gradient(180deg, #090b10, #050609);
}

.text-first .stage-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: calc(100vh - 32px);
}

.text-first .scene-bg {
  opacity: 0.2;
  filter: blur(9px) saturate(0.62) contrast(1.02) brightness(0.56);
  transform: scale(1.06);
}

.text-first .scene-vignette {
  background:
    linear-gradient(90deg, rgba(5, 6, 9, 0.94), rgba(5, 6, 9, 0.62) 46%, rgba(5, 6, 9, 0.94)),
    linear-gradient(180deg, rgba(5, 6, 9, 0.78), rgba(5, 6, 9, 0.42) 42%, rgba(5, 6, 9, 0.88));
}

.text-first .topbar {
  padding: 18px clamp(16px, 4vw, 42px);
}

.text-first .topbar h1 {
  font-size: clamp(24px, 3vw, 34px);
}

.text-first .character-strip {
  position: relative;
  z-index: 2;
  left: auto;
  top: auto;
  display: flex;
  flex-wrap: wrap;
  width: min(760px, calc(100% - 42px));
  margin: 0 auto;
  padding-top: 8px;
}

.text-first .character-card {
  grid-template-columns: 32px 1fr;
  width: fit-content;
  min-width: 148px;
  padding: 6px 8px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(12, 14, 20, 0.34);
  opacity: 0.38;
}

.text-first .character-card.active {
  border-color: rgba(217, 189, 118, 0.42);
  background: rgba(23, 21, 24, 0.48);
  opacity: 0.76;
}

.text-first .character-card img {
  width: 32px;
  height: 38px;
}

.text-first .dialogue-card {
  position: relative;
  align-self: center;
  left: auto;
  bottom: auto;
  width: min(920px, calc(100% - 42px));
  margin: 0 auto 28px;
  transform: none;
  padding: 0;
  border-color: rgba(245, 226, 190, 0.25);
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.text-first .speaker-row {
  align-items: baseline;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(245, 226, 190, 0.16);
}

.text-first #speakerName {
  color: #ecd39c;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-first #sceneCounter {
  color: rgba(245, 240, 232, 0.54);
}

.text-first #storyText {
  min-height: 260px;
  max-width: none;
  margin: 0 auto;
  color: #fff9ef;
  font-size: clamp(22px, 2.1vw, 29px);
  font-weight: 520;
  line-height: 2.05;
  letter-spacing: 0;
  text-align: left;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.48);
  word-break: keep-all;
  text-wrap: pretty;
}

.reader-scene {
  position: relative;
  display: grid;
  min-height: min(780px, calc(100svh - 132px));
  overflow: hidden;
  border-top: 1px solid rgba(245, 226, 190, 0.1);
  background-position: center top;
  background-size: cover;
  isolation: isolate;
}

.reader-scene:first-child {
  border-top: 0;
}

.reader-scene-bg {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  opacity: 0.3;
  filter: blur(7px) saturate(0.64) brightness(0.72);
  transform: scale(1.06);
}

.reader-scene::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background: rgba(5, 6, 9, 0.08);
}

.reader-scene-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  width: min(700px, 100%);
  margin: 0 auto;
  padding: clamp(28px, 6vh, 72px) clamp(18px, 4vw, 42px);
}

.reader-scene-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  color: rgba(236, 211, 156, 0.82);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reader-scene h2 {
  margin: 0 0 20px;
  color: #fffaf3;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(22px, 3.4vw, 34px);
  line-height: 1.25;
  letter-spacing: 0;
}

.adapted-scene {
  min-height: 100svh;
}

.adapted-copy {
  align-self: start;
}

.adapted-subtitle {
  margin: -8px 0 22px;
  color: rgba(245, 240, 232, 0.58);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.55;
}

.script-lines {
  display: grid;
  gap: 14px;
}

.script-line {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 13px 0;
  border-top: 1px solid rgba(245, 226, 190, 0.12);
}

.script-line:first-child {
  border-top: 0;
}

.script-label span {
  display: inline-flex;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid rgba(236, 211, 156, 0.24);
  border-radius: 6px;
  color: rgba(236, 211, 156, 0.88);
  background: rgba(5, 6, 9, 0.42);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.script-line p {
  margin: 0;
  color: #fff9ef;
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 560;
  line-height: 1.72;
  word-break: keep-all;
}

.script-line.stage p {
  color: rgba(245, 240, 232, 0.68);
  font-size: clamp(14px, 1.7vw, 17px);
  font-weight: 520;
}

.script-line.narration p {
  color: #fffaf3;
}

.script-line.monologue p {
  color: #f4dfb2;
}

.vn-scene {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  border-top: 1px solid rgba(245, 226, 190, 0.1);
  background-position: center top;
  background-size: cover;
  isolation: isolate;
  cursor: pointer;
}

.vn-scene::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: -20px;
  background: inherit;
  filter: saturate(0.78) contrast(1.05) brightness(0.88);
  transform: scale(1.04);
  animation: vnKenburns 9s ease-out both;
}

.vn-scene::after {
  content: "";
  position: absolute;
  z-index: 2;
  inset: 0;
  background:
    radial-gradient(circle at 52% 28%, rgba(255, 255, 255, 0.07), transparent 30%),
    linear-gradient(180deg, rgba(3, 4, 7, 0.08), rgba(3, 4, 7, 0.24) 48%, rgba(3, 4, 7, 0.88)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.86), rgba(3, 4, 7, 0.08) 50%, rgba(3, 4, 7, 0.86));
}

.vn-rain {
  position: absolute;
  z-index: 3;
  inset: -12% 0;
  opacity: 0;
  background-image:
    linear-gradient(180deg, transparent 0 14%, rgba(255, 255, 255, 0.34) 14% 42%, transparent 42% 100%),
    linear-gradient(180deg, transparent 0 22%, rgba(255, 255, 255, 0.24) 22% 55%, transparent 55% 100%),
    linear-gradient(180deg, transparent 0 8%, rgba(200, 223, 245, 0.26) 8% 36%, transparent 36% 100%),
    linear-gradient(180deg, transparent 0 30%, rgba(255, 255, 255, 0.2) 30% 62%, transparent 62% 100%);
  background-position:
    8% -120px,
    31% -40px,
    57% -190px,
    84% -90px;
  background-repeat: repeat-y;
  background-size:
    1px 230px,
    1px 310px,
    1px 270px,
    1px 360px;
  transform: translate3d(0, -4%, 0);
  animation: rainFall 900ms linear infinite;
  pointer-events: none;
}

.vn-weather-glow {
  position: absolute;
  z-index: 3;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.vn-flash {
  pointer-events: none;
  position: absolute;
  z-index: 8;
  inset: 0;
  background: rgba(255, 255, 255, 0);
}

.vn-focus {
  position: absolute;
  z-index: 4;
  inset: 0;
  opacity: 0;
  background:
    radial-gradient(circle at 51% 46%, transparent 0 17%, rgba(2, 3, 6, 0.74) 48%, rgba(2, 3, 6, 0.94) 100%);
  transition: opacity 260ms ease;
}

.vn-top {
  position: relative;
  z-index: 9;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  color: rgba(245, 240, 232, 0.8);
  background: linear-gradient(180deg, rgba(3, 4, 7, 0.72), transparent);
}

.vn-top-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vn-top > div:first-child {
  display: grid;
  gap: 4px;
}

.vn-top span {
  color: #e7c979;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.vn-top strong {
  color: #fffaf3;
  font-size: 16px;
  line-height: 1.25;
}

.vn-audio,
.vn-scrubber-toggle {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(231, 201, 121, 0.28);
  border-radius: 999px;
  color: rgba(245, 240, 232, 0.68);
  background: rgba(6, 8, 12, 0.34);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.vn-audio.on {
  color: rgba(231, 201, 121, 0.94);
  border-color: rgba(231, 201, 121, 0.44);
}

.vn-scrubber {
  position: absolute;
  z-index: 12;
  top: 72px;
  left: 18px;
  right: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(104px, 168px) 42px;
  align-items: center;
  gap: 9px;
  max-width: 760px;
  padding: 7px 9px;
  border: 1px solid rgba(245, 240, 232, 0.1);
  border-radius: 999px;
  background: rgba(5, 6, 9, 0.36);
  backdrop-filter: blur(10px);
}

.vn-scrubber-toggle {
  font-size: 16px;
}

.vn-scrubber-controls {
  display: contents;
}

.vn-scrubber input {
  width: 100%;
  accent-color: #e7c979;
}

.vn-scrubber-select {
  min-width: 0;
  padding: 4px 5px;
  border: 1px solid rgba(245, 240, 232, 0.14);
  border-radius: 7px;
  color: rgba(255, 250, 243, 0.9);
  background: rgba(5, 6, 9, 0.46);
  font-size: 11px;
  font-weight: 800;
}

.vn-scrubber span {
  color: rgba(245, 240, 232, 0.72);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
}

.vn-cutin {
  position: absolute;
  z-index: 7;
  left: 50%;
  top: 42%;
  display: grid;
  place-items: center;
  width: min(70vw, 320px);
  aspect-ratio: 16 / 9;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(255, 250, 243, 0.18), rgba(3, 4, 7, 0.06) 46%, transparent 72%);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
}

.vn-panel-stack {
  position: absolute;
  z-index: 10;
  left: 16px;
  right: 16px;
  bottom: 18px;
  display: grid;
  justify-items: stretch;
  gap: 10px;
  width: auto;
  max-width: 720px;
  margin-inline: auto;
  max-height: calc(100svh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: none;
}

.vn-panel-stack::-webkit-scrollbar {
  display: none;
}

.vn-panel-stack .vn-textbox,
.vn-panel-stack .vn-system-box,
.vn-panel-stack .vn-choice-box {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  justify-self: stretch;
}

.vn-choice-box {
  padding: 16px;
  border: 1px solid rgba(231, 201, 121, 0.3);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(20, 22, 28, 0.76), rgba(5, 6, 9, 0.9)),
    rgba(5, 6, 9, 0.84);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
}

.vn-choice-box p {
  margin: 0 0 13px;
  color: rgba(255, 250, 243, 0.9);
  font-family: var(--font-story);
  font-size: 18px;
  font-weight: 680;
  line-height: 1.62;
  word-break: keep-all;
}

.vn-choice-options {
  display: grid;
  gap: 8px;
}

.vn-choice-button {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(231, 201, 121, 0.26);
  border-radius: 9px;
  color: #fffaf3;
  background: rgba(18, 20, 27, 0.72);
  font-size: 15px;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}

.vn-choice-button:hover {
  border-color: rgba(231, 201, 121, 0.48);
  background: rgba(42, 38, 31, 0.8);
}

.vn-textbox {
  position: absolute;
  z-index: 10;
  left: 16px;
  right: 16px;
  bottom: 18px;
  padding: 17px 16px 16px;
  border: 1px solid rgba(236, 211, 156, 0.26);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(17, 18, 24, 0.72), rgba(5, 6, 9, 0.9)),
    rgba(5, 6, 9, 0.84);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(12px);
  animation: textboxIn 360ms ease-out both;
}

.vn-prev {
  position: absolute;
  z-index: 30;
  right: 8px;
  bottom: 8px;
  margin: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: rgba(245, 240, 232, 0.66);
  background: rgba(8, 10, 15, 0.58);
  font-size: 20px;
  font-weight: 760;
  line-height: 1;
  cursor: pointer;
  pointer-events: auto;
}

.vn-prev:disabled {
  cursor: default;
  opacity: 0.18;
}

.vn-speaker {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 10px;
}

.vn-speaker span {
  color: #e7c979;
  font-size: 14px;
  font-weight: 900;
}

.vn-textbox.narration .vn-speaker {
  display: none;
}

.vn-textbox p {
  min-height: 0;
  margin: 0;
  color: #fffaf3;
  font-family: var(--font-story);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.82;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.34);
  animation: textReveal 420ms ease-out both;
}

.vn-system-box {
  position: absolute;
  z-index: 10;
  left: 16px;
  right: 16px;
  bottom: 184px;
  padding: 14px 15px 13px;
  border: 1px solid rgba(245, 240, 232, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(13, 15, 20, 0.56), rgba(5, 6, 9, 0.8)),
    rgba(5, 6, 9, 0.74);
  box-shadow: 0 22px 80px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(10px);
  animation: systemBoxIn 360ms ease-out both;
}

.vn-system-label {
  margin-bottom: 8px;
  color: rgba(231, 201, 121, 0.72);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.vn-system-box p {
  min-height: 0;
  margin: 0;
  color: rgba(245, 240, 232, 0.82);
  font-family: var(--font-story);
  font-size: 19px;
  font-weight: 620;
  line-height: 1.72;
  letter-spacing: 0;
  word-break: keep-all;
  overflow-wrap: break-word;
  line-break: strict;
  text-shadow: 0 1px 18px rgba(0, 0, 0, 0.34);
  animation: textReveal 420ms ease-out both;
}

.vn-line-text.typing::after {
  content: " ";
  display: inline-block;
  width: 0.42em;
  height: 0.42em;
  margin-left: 4px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.42;
  vertical-align: 0.04em;
  animation: caretBlink 820ms ease-in-out infinite;
}

.vn-typing-char {
  display: inline;
  opacity: 0;
  filter: blur(3px);
  transform: translateY(0.16em);
  transition:
    opacity 180ms ease-out,
    filter 220ms ease-out,
    transform 220ms ease-out;
}

.vn-typing-char.visible {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.vn-textbox.stage p {
  color: rgba(245, 240, 232, 0.72);
  font-size: 15px;
  font-weight: 560;
}

.vn-textbox.monologue {
  border-color: rgba(155, 203, 244, 0.5);
  background:
    linear-gradient(180deg, rgba(33, 54, 72, 0.76), rgba(8, 15, 24, 0.9)),
    rgba(9, 20, 32, 0.84);
  box-shadow:
    0 26px 90px rgba(0, 0, 0, 0.62),
    inset 0 0 42px rgba(116, 179, 232, 0.1);
}

.vn-textbox.monologue .vn-speaker span {
  color: #b9dcff;
}

.vn-textbox.monologue p,
.vn-textbox.monologue.speaker-adelia p {
  color: #d8ecff;
  font-style: italic;
  text-shadow: 0 0 20px rgba(104, 171, 230, 0.18);
}

.vn-textbox.monologue .vn-line-text.typing::after {
  border-right-color: rgba(185, 220, 255, 0.9);
}

.vn-textbox.dialogue {
  border-color: rgba(147, 188, 232, 0.46);
}

.vn-textbox.speaker-adelia {
  border-color: rgba(244, 223, 178, 0.48);
}

.vn-textbox.speaker-adelia .vn-speaker span,
.vn-textbox.speaker-adelia p {
  color: #f5dda3;
}

.vn-textbox.speaker-marquis {
  border-color: rgba(151, 177, 205, 0.5);
  background:
    linear-gradient(180deg, rgba(14, 18, 25, 0.8), rgba(5, 7, 11, 0.92)),
    rgba(5, 6, 9, 0.84);
}

.vn-textbox.speaker-marquis .vn-speaker span,
.vn-textbox.speaker-marquis p {
  color: #d7e4f2;
}

.vn-textbox.speaker-riana {
  border-color: rgba(214, 164, 184, 0.46);
}

.vn-textbox.speaker-riana .vn-speaker span,
.vn-textbox.speaker-riana p {
  color: #f5cad8;
}

.vn-textbox.speaker-marchioness {
  border-color: rgba(190, 178, 158, 0.44);
}

.vn-textbox.speaker-marchioness .vn-speaker span,
.vn-textbox.speaker-marchioness p {
  color: #eadcca;
}

.vn-textbox.speaker-orten {
  border-color: rgba(168, 202, 174, 0.46);
}

.vn-textbox.speaker-orten .vn-speaker span,
.vn-textbox.speaker-orten p {
  color: #cfe8c9;
}

.vn-textbox.speaker-none p {
  color: #fffaf3;
}

.vn-progress {
  display: flex;
  gap: 5px;
  margin-top: 14px;
}

.vn-progress span {
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
}

.vn-progress span.active {
  background: linear-gradient(90deg, #e7c979, #93bce8);
}

.effect-black::before {
  filter: saturate(0.58) contrast(1.04) brightness(0.5);
}

.effect-black::after {
  background:
    radial-gradient(circle at 52% 28%, rgba(255, 255, 255, 0.04), transparent 30%),
    linear-gradient(180deg, rgba(3, 4, 7, 0.24), rgba(3, 4, 7, 0.24) 48%, rgba(3, 4, 7, 0.82)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.64), rgba(3, 4, 7, 0.18) 50%, rgba(3, 4, 7, 0.64));
}

.weather-rainOutdoor .vn-rain {
  opacity: 0.42;
  animation-duration: 760ms;
}

.weather-rainWindow .vn-rain {
  opacity: 0.26;
  animation-duration: 900ms;
}

.weather-rainIndoor .vn-rain {
  opacity: 0.08;
  animation-duration: 1120ms;
}

.weather-overcastIndoor .vn-rain,
.weather-overcastOutdoor .vn-rain,
.weather-sunnyIndoor .vn-rain,
.weather-sunnyOutdoor .vn-rain,
.weather-off .vn-rain {
  opacity: 0;
}

.weather-overcastIndoor::after,
.weather-rainIndoor::after {
  background:
    radial-gradient(circle at 52% 24%, rgba(185, 205, 224, 0.06), transparent 28%),
    linear-gradient(180deg, rgba(3, 4, 7, 0.12), rgba(3, 4, 7, 0.28) 50%, rgba(3, 4, 7, 0.88)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.84), rgba(3, 4, 7, 0.12) 50%, rgba(3, 4, 7, 0.84));
}

.weather-overcastOutdoor::after,
.weather-rainWindow::after,
.weather-rainOutdoor::after {
  background:
    radial-gradient(circle at 48% 22%, rgba(212, 229, 242, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(3, 4, 7, 0.06), rgba(3, 4, 7, 0.2) 48%, rgba(3, 4, 7, 0.86)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.8), rgba(3, 4, 7, 0.06) 50%, rgba(3, 4, 7, 0.8));
}

.weather-sunnyIndoor::after,
.weather-sunnyOutdoor::after {
  background:
    radial-gradient(circle at 32% 18%, rgba(255, 228, 158, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(30, 18, 6, 0.02), rgba(3, 4, 7, 0.12) 50%, rgba(3, 4, 7, 0.72)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.68), rgba(255, 221, 150, 0.08) 50%, rgba(3, 4, 7, 0.68));
}

.weather-sunnyIndoor .vn-weather-glow,
.weather-sunnyOutdoor .vn-weather-glow {
  opacity: 0.55;
  background:
    linear-gradient(112deg, transparent 0 18%, rgba(255, 226, 154, 0.12) 28%, transparent 43%),
    radial-gradient(circle at 32% 18%, rgba(255, 226, 154, 0.22), transparent 34%);
}

.effect-fade-cg .vn-flash,
.effect-cut .vn-flash {
  animation: whiteFlash 540ms ease-out both;
}

.effect-detail .vn-focus,
.effect-cut .vn-focus {
  opacity: 1;
}

.effect-detail .vn-cutin,
.effect-cut .vn-cutin {
  animation: cutinPop 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.effect-inner .vn-textbox {
  border-color: rgba(155, 203, 244, 0.56);
}

.effect-inner .vn-system-box {
  border-color: rgba(155, 203, 244, 0.42);
}

.effect-inner::after {
  background:
    radial-gradient(circle at 50% 24%, rgba(155, 203, 244, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(3, 4, 7, 0.2), rgba(3, 4, 7, 0.44) 48%, rgba(3, 4, 7, 0.9)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.94), rgba(3, 4, 7, 0.2) 50%, rgba(3, 4, 7, 0.94));
}

.effect-pressure::after {
  background:
    radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.03), transparent 22%),
    linear-gradient(180deg, rgba(3, 4, 7, 0.16), rgba(3, 4, 7, 0.46) 45%, rgba(3, 4, 7, 0.9)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.9), rgba(3, 4, 7, 0.34), rgba(3, 4, 7, 0.9));
}

.effect-pressure::before {
  filter: saturate(0.58) contrast(1.08) brightness(0.62);
  animation-duration: 13s;
}

.effect-still::before {
  filter: saturate(0.68) contrast(1.02) brightness(0.74);
  animation: none;
  transform: scale(1.03);
}

.tone-riana-soft::before {
  filter: saturate(0.92) contrast(1.01) brightness(0.98);
}

.tone-riana-soft::after {
  background:
    radial-gradient(circle at 50% 22%, rgba(255, 230, 238, 0.12), transparent 31%),
    linear-gradient(180deg, rgba(3, 4, 7, 0.02), rgba(3, 4, 7, 0.12) 52%, rgba(3, 4, 7, 0.68)),
    linear-gradient(90deg, rgba(3, 4, 7, 0.62), rgba(255, 225, 235, 0.04) 50%, rgba(3, 4, 7, 0.62));
}

.tone-riana-soft .vn-weather-glow {
  opacity: 0.28;
  background:
    radial-gradient(circle at 45% 20%, rgba(255, 222, 232, 0.22), transparent 34%),
    linear-gradient(120deg, transparent 0 20%, rgba(255, 238, 214, 0.08) 34%, transparent 48%);
}

.effect-cut .vn-textbox {
  animation: textboxIn 360ms ease-out both, subtleShake 320ms ease-out both;
}

.effect-cut .vn-system-box {
  animation: systemBoxIn 360ms ease-out both, subtleShake 320ms ease-out both;
}

@keyframes vnKenburns {
  from { transform: scale(1.08) translate3d(-1.4%, -1%, 0); }
  to { transform: scale(1.02) translate3d(1%, 0.5%, 0); }
}

@keyframes rainFall {
  to { transform: translate3d(0, 11%, 0); }
}

@keyframes textboxIn {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes systemBoxIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes textReveal {
  from { opacity: 0; filter: blur(4px); transform: translateY(4px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes caretBlink {
  50% { opacity: 0; }
}

@keyframes whiteFlash {
  0% { background: rgba(255, 255, 255, 0); }
  22% { background: rgba(255, 255, 255, 0.42); }
  100% { background: rgba(255, 255, 255, 0); }
}

@keyframes cutinPop {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.82); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.03); }
  78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(0.98); }
}

@keyframes subtleShake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-2px); }
  100% { transform: translateX(0); }
}

.reader-line {
  margin: 0;
}

.reader-line + .reader-line {
  margin-top: 18px;
}

.narration-line {
  color: #fff9ef;
}

.scene-peek {
  display: none;
  float: right;
  width: min(34%, 188px);
  margin: 2px 0 18px 22px;
  overflow: hidden;
  border: 1px solid rgba(143, 185, 232, 0.32);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
}

.scene-peek img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: top center;
}

.scene-peek figcaption {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.text-first .choice-list {
  display: none;
}

.text-first .choice-list button {
  padding: 14px 16px;
  background: rgba(26, 32, 43, 0.72);
  font-size: 15px;
}

.text-first .next-button {
  clear: both;
  width: fit-content;
  min-width: 132px;
  max-width: 700px;
  margin: 24px auto 0;
  padding: 12px 18px;
  background: rgba(236, 211, 156, 0.14);
}

.text-first .side-panel {
  gap: 10px;
}

.text-first .panel-card {
  border-color: rgba(143, 185, 232, 0.15);
  border-radius: 8px;
  background: rgba(11, 13, 18, 0.48);
}

.text-first .panel-head span {
  border-color: rgba(217, 189, 118, 0.26);
  color: rgba(217, 189, 118, 0.78);
}

.text-first .panel-head h2 {
  font-size: 16px;
}

.text-first .tension-note {
  display: grid;
  gap: 5px;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.text-first .tension-note:first-child {
  border-top: 0;
  padding-top: 0;
}

.text-first .tension-note strong {
  color: #f0d89f;
  font-size: 13px;
}

.text-first .tension-note span {
  color: rgba(245, 240, 232, 0.68);
  font-size: 12px;
  line-height: 1.55;
}

.text-first .flag-list li {
  border-color: rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.025);
}

.text-first .gallery-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.text-first .gallery-card span {
  min-height: 38px;
}

@media (max-width: 1080px) {
  .app-shell.text-first {
    grid-template-columns: 1fr;
  }

  .text-first .side-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body {
    background: #050608;
  }

  .app-shell.text-first {
    display: block;
    min-height: 100vh;
    padding: 0;
  }

  .text-first .stage-panel {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    background: #07080c;
  }

  .text-first .scene-bg {
    opacity: 0.12;
    filter: blur(12px) saturate(0.48) contrast(1.02) brightness(0.5);
    transform: scale(1.1);
  }

  .text-first .scene-vignette {
    background:
      linear-gradient(180deg, rgba(5, 6, 9, 0.92), rgba(5, 6, 9, 0.68) 34%, rgba(5, 6, 9, 0.96)),
      linear-gradient(90deg, rgba(5, 6, 9, 0.96), rgba(5, 6, 9, 0.72), rgba(5, 6, 9, 0.96));
  }

  .silhouette-layer {
    display: none;
  }

  .text-first .topbar {
    display: none;
  }

  .text-first .topbar h1 {
    font-size: 24px;
  }

  .top-actions {
    gap: 6px;
  }

  .top-actions button {
    min-width: 48px;
    padding: 7px 8px;
    font-size: 12px;
  }

  .text-first .character-strip {
    display: none;
  }

  .text-first .dialogue-card {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
  }

  .text-first .speaker-row {
    display: none;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom-color: rgba(245, 226, 190, 0.1);
  }

  .text-first #storyText {
    min-height: auto;
    max-width: none;
    font-size: 21px;
    font-weight: 560;
    line-height: 2.02;
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
  }

  .reader-scene {
    min-height: 100svh;
    border-top-color: rgba(245, 226, 190, 0.07);
    scroll-snap-align: start;
  }

  .reader-scene-bg {
    opacity: 0.38;
    filter: blur(7px) saturate(0.62) brightness(0.72);
    transform: scale(1.08);
  }

  .reader-scene::after {
    background: rgba(5, 6, 9, 0.06);
  }

  .reader-scene-copy {
    width: 100%;
    align-self: start;
    padding: 36px 18px 72px;
  }

  .reader-scene-meta {
    margin-bottom: 12px;
    font-size: 11px;
  }

  .reader-scene h2 {
    margin-bottom: 18px;
    font-size: 25px;
  }

  .adapted-copy {
    padding-top: 30px;
  }

  .script-lines {
    gap: 4px;
  }

  .script-line {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 15px 0;
  }

  .script-label span {
    font-size: 10px;
  }

  .script-line p {
    font-size: 20px;
    line-height: 1.78;
  }

  .script-line.stage p {
    font-size: 14px;
    line-height: 1.6;
  }

  .scene-peek {
    display: none;
  }

  .reader-line + .reader-line {
    margin-top: 20px;
  }

  .text-first .next-button {
    width: 100%;
    margin-top: 26px;
    padding: 14px 16px;
    border-color: rgba(236, 211, 156, 0.28);
    background: rgba(236, 211, 156, 0.1);
  }

  .text-first .side-panel {
    display: none;
  }
}

/* Reader chrome cleanup: keep only episode navigation visible. */
.app-shell.text-first {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.text-first .stage-panel {
  min-height: 100vh;
  border: 0;
  border-radius: 0;
}

.text-first .side-panel,
.text-first .top-actions,
.text-first .character-strip,
.text-first .speaker-row,
.text-first .scene-peek,
.text-first .choice-list,
.text-first .next-button,
.text-first .topbar h1 {
  display: none !important;
}

.text-first .topbar {
  position: fixed;
  z-index: 30;
  top: 10px;
  left: 10px;
  display: block !important;
  width: auto;
  padding: 0;
  pointer-events: none;
}

.text-first .topbar > div:first-child {
  pointer-events: auto;
}

.text-first .episode-select-label {
  display: none;
}

.text-first .episode-select {
  width: auto;
  max-width: min(270px, calc(100vw - 20px));
  min-height: 34px;
  padding: 7px 46px 7px 12px;
  border: 1px solid rgba(236, 211, 156, 0.24);
  border-radius: 999px;
  background: rgba(7, 8, 12, 0.58);
  color: rgba(255, 250, 243, 0.86);
  font-size: 12px;
  line-height: 1;
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
}

.text-first .vn-top {
  position: fixed;
  z-index: 28;
  top: 10px;
  left: 292px;
  right: 150px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0;
  background: transparent;
  pointer-events: none;
}

.text-first .vn-top > div:first-child {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.text-first .vn-top span {
  flex: 0 0 auto;
  font-size: 10px;
  line-height: 1;
}

.text-first .vn-top strong {
  overflow: hidden;
  min-width: 0;
  color: rgba(255, 250, 243, 0.86);
  font-size: 13px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.text-first .vn-top-status {
  position: fixed;
  top: 14px;
  right: 10px;
  pointer-events: auto;
}

.text-first .vn-top-status > span {
  display: inline-flex;
  min-width: 58px;
  justify-content: flex-end;
  color: rgba(245, 240, 232, 0.74);
  font-size: 10px;
  letter-spacing: 0;
  text-transform: none;
}

.text-first .vn-scrubber {
  position: fixed;
  top: 50px;
  right: 10px;
  left: auto;
  display: none;
  grid-template-columns: none;
  align-items: center;
  width: min(350px, calc(100vw - 20px));
  max-width: none;
  min-height: 34px;
  padding: 6px;
  gap: 6px;
  border-radius: 12px;
  background: rgba(7, 8, 12, 0.48);
}

.text-first .vn-scrubber.open {
  display: block;
}

.text-first .vn-scrubber-controls {
  display: grid;
  grid-template-columns: minmax(74px, 1fr) minmax(74px, 110px) 32px;
  align-items: center;
  gap: 6px;
  min-width: 0;
  width: 100%;
}

.text-first .vn-scrubber input {
  min-width: 74px;
}

.text-first .vn-scrubber-select {
  max-width: 110px;
  padding: 3px 18px 3px 5px;
  font-size: 10px;
}

.text-first .vn-scrubber span {
  font-size: 10px;
}

@media (max-width: 1040px) {
  .text-first .vn-top {
    left: 236px;
    right: 102px;
  }

  .text-first .episode-select {
    max-width: min(220px, calc(100vw - 20px));
  }

  .text-first .vn-scrubber.open {
    top: 50px;
    right: 10px;
    width: min(360px, calc(100vw - 20px));
    padding: 6px;
    border-radius: 12px;
  }
}

@media (max-width: 720px) {
  .text-first .topbar {
    top: max(8px, env(safe-area-inset-top));
    left: 8px;
  }

  .text-first .episode-select {
    max-width: min(208px, calc(100vw - 16px));
    min-height: 32px;
    padding: 6px 42px 6px 10px;
    font-size: 11px;
  }

  .text-first .vn-top {
    left: 8px;
    right: 8px;
    top: 44px;
    min-height: 28px;
  }

  .text-first .vn-top > div:first-child {
    gap: 6px;
  }

  .text-first .vn-top strong {
    font-size: 12px;
  }

  .text-first .vn-top-status {
    position: fixed;
    top: max(8px, env(safe-area-inset-top));
    right: 8px;
  }

  .vn-panel-stack {
    left: 12px;
    right: 12px;
    bottom: max(14px, env(safe-area-inset-bottom));
    width: auto;
    max-width: 430px;
    gap: 8px;
    max-height: calc(100svh - 96px);
  }

  .vn-textbox {
    padding: 15px 14px 14px;
    border-radius: 10px;
  }

  .vn-system-box {
    padding: 12px 13px;
    border-radius: 10px;
  }

  .vn-textbox p {
    font-size: clamp(18px, 5.15vw, 21px);
    line-height: 1.74;
  }

  .vn-system-box p {
    font-size: clamp(15px, 4.25vw, 17px);
    line-height: 1.66;
  }

  .text-first .vn-scrubber {
    display: none;
  }

  .text-first .vn-scrubber.open {
    top: 78px;
    right: 8px;
    width: min(360px, calc(100vw - 16px));
    padding: 6px;
    display: block;
  }

  .text-first .vn-scrubber.open .vn-scrubber-controls {
    grid-template-columns: minmax(78px, 1fr) minmax(88px, 120px) 34px;
  }

  .text-first .vn-scrubber-select {
    padding: 3px 4px;
    font-size: 10px;
  }

  .vn-choice-box {
    padding: 14px;
    border-radius: 10px;
  }

  .vn-choice-box p {
    font-size: 16px;
  }

  .vn-choice-button {
    min-height: 40px;
    font-size: 14px;
  }

  .vn-speaker {
    margin-bottom: 7px;
  }

  .vn-speaker span {
    font-size: 12px;
  }
}
