.novel-layer {
  --novel-cyan: 154, 245, 224;
  position: absolute;
  z-index: 30;
  inset: 0;
  overflow: hidden;
  color: #f4fffb;
  background: transparent;
  opacity: 0;
  visibility: hidden;
  transition: opacity 260ms ease, visibility 260ms step-end;
}

.novel-layer[hidden] {
  display: none;
}

.novel-layer.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 420ms ease, visibility 0ms step-start;
}

body.novel-open .experience > .masthead,
body.novel-open .experience > .status,
body.novel-open .experience > .guide,
body.novel-open .experience > .mode-caption,
body.novel-open .experience > .signal-console-main,
body.novel-open .experience > .mode-nav,
body.novel-open .experience > .actions,
body.novel-open .japan-heading,
body.novel-open .map-scope-switch,
body.novel-open .japan-observation,
body.novel-open .signal-console-map,
body.novel-open .map-mode-bank,
body.novel-open .japan-layer-switch,
body.novel-open .japan-instruction,
body.novel-open .japan-poi-card,
body.novel-open .japan-close,
body.novel-open .japan-credits {
  opacity: 0;
  pointer-events: none;
}

.novel-veil,
.novel-scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.novel-veil {
  background:
    radial-gradient(circle at 70% 42%, rgba(var(--accent-rgb), 0.05), transparent 28%),
    linear-gradient(180deg, rgba(1, 5, 9, 0.62), rgba(1, 6, 10, 0.28) 36%, rgba(1, 5, 9, 0.78)),
    linear-gradient(90deg, rgba(1, 5, 9, 0.82), transparent 50%, rgba(1, 5, 9, 0.4));
  backdrop-filter: blur(1.2px) saturate(0.82);
}

.novel-scanlines {
  opacity: 0.24;
  background-image: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 3px,
    rgba(216, 255, 245, 0.045) 4px
  );
  mix-blend-mode: soft-light;
}

.novel-topbar {
  position: absolute;
  z-index: 4;
  top: max(24px, env(safe-area-inset-top));
  right: max(28px, env(safe-area-inset-right));
  left: max(28px, env(safe-area-inset-left));
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  pointer-events: none;
}

.novel-topbar > div {
  display: grid;
  gap: 6px;
  color: rgba(220, 249, 242, 0.56);
  font-family: Consolas, "Courier New", monospace;
  font-size: 7px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.novel-topbar > div strong {
  color: rgba(238, 255, 250, 0.88);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

.novel-topbar nav {
  display: flex;
  gap: 7px;
  pointer-events: auto;
}

.novel-topbar button,
.novel-title-actions button,
.novel-choices button,
.novel-log-panel button {
  border: 1px solid rgba(var(--novel-cyan), 0.22);
  color: rgba(236, 255, 250, 0.7);
  background: rgba(2, 13, 17, 0.64);
  backdrop-filter: blur(14px);
  cursor: pointer;
  font-family: Consolas, "Courier New", monospace;
  letter-spacing: 0.12em;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.novel-topbar button {
  min-width: 58px;
  height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 7px;
}

.novel-topbar #novel-close-button {
  min-width: 34px;
  padding: 0;
  font-size: 17px;
}

.novel-topbar button:hover,
.novel-topbar button:focus-visible,
.novel-topbar button.is-active,
.novel-title-actions button:hover,
.novel-title-actions button:focus-visible,
.novel-choices button:hover,
.novel-choices button:focus-visible,
.novel-log-panel button:hover,
.novel-log-panel button:focus-visible {
  color: #fff;
  border-color: rgba(var(--novel-cyan), 0.62);
  background: rgba(var(--accent-rgb), 0.16);
  outline: none;
}

.novel-progress {
  position: absolute;
  z-index: 4;
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  overflow: hidden;
  background: rgba(208, 255, 244, 0.08);
}

.novel-progress i {
  display: block;
  width: 2%;
  height: 100%;
  background: rgb(var(--novel-cyan));
  box-shadow: 0 0 16px rgba(var(--novel-cyan), 0.8);
  transition: width 500ms ease;
}

.novel-title-screen {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: clamp(32px, 8vw, 130px);
  width: min(760px, 74vw);
  transform: translateY(-46%);
}

.novel-title-screen[hidden],
.novel-runtime[hidden],
.novel-chapter-card[hidden],
.novel-dialogue[hidden],
.novel-log-panel[hidden] {
  display: none;
}

.novel-title-screen > p:first-of-type {
  margin: 0 0 22px;
  color: rgba(var(--novel-cyan), 0.68);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.27em;
}

.novel-title-screen h2 {
  max-width: 720px;
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(42px, 6.7vw, 96px);
  font-weight: 500;
  letter-spacing: -0.08em;
  line-height: 1.12;
  text-shadow: 0 3px 40px rgba(0, 0, 0, 0.8);
}

.novel-title-sub {
  margin: 22px 0 0;
  color: rgba(235, 252, 247, 0.7);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 12px;
  letter-spacing: 0.13em;
}

.novel-title-note {
  max-width: 600px;
  margin: 34px 0 0;
  padding-left: 18px;
  border-left: 1px solid rgba(var(--novel-cyan), 0.34);
  color: rgba(223, 241, 236, 0.52);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 10px;
  letter-spacing: 0.05em;
  line-height: 2;
}

.novel-title-actions {
  display: flex;
  gap: 10px;
  margin-top: 34px;
}

.novel-title-actions button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 2px;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 10px;
  font-weight: 700;
}

.novel-title-orbit {
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 68%;
  width: min(44vw, 590px);
  aspect-ratio: 1;
  border: 1px solid rgba(var(--novel-cyan), 0.12);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: novel-orbit-drift 18s linear infinite;
}

.novel-title-orbit::before,
.novel-title-orbit::after,
.novel-title-orbit i {
  position: absolute;
  border: 1px solid rgba(var(--novel-cyan), 0.1);
  border-radius: 50%;
  content: "";
}

.novel-title-orbit::before { inset: 15%; }
.novel-title-orbit::after { inset: 32%; }
.novel-title-orbit i:nth-child(1) { inset: -6% 32%; }
.novel-title-orbit i:nth-child(2) { inset: 28% -8%; }
.novel-title-orbit i:nth-child(3) { inset: 44%; background: rgba(var(--accent-rgb), 0.26); box-shadow: 0 0 90px rgba(var(--accent-rgb), 0.32); }

.novel-runtime {
  position: absolute;
  z-index: 3;
  inset: 0;
}

.novel-cast {
  position: absolute;
  z-index: 2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.novel-character {
  position: absolute;
  bottom: clamp(205px, 27vh, 300px);
  width: clamp(270px, 29vw, 450px);
  aspect-ratio: 1;
  margin: 0;
  opacity: 0;
  filter: saturate(0.72) brightness(0.52);
  transform: translateY(18px) scale(0.94);
  transform-origin: 50% 100%;
  transition:
    opacity 420ms ease,
    filter 420ms ease,
    transform 520ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.novel-character--sora {
  right: clamp(300px, 29vw, 500px);
}

.novel-character--minamo {
  right: clamp(-72px, 1vw, 18px);
}

.novel-character-portrait {
  position: absolute;
  inset: 0;
  background-position: 0 0;
  background-repeat: no-repeat;
  background-size: 200% 200%;
  filter: drop-shadow(0 24px 34px rgba(0, 0, 0, 0.44));
  -webkit-mask-image:
    linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%),
    linear-gradient(to bottom, #000 0, #000 78%, transparent 100%);
  mask-image:
    linear-gradient(to right, transparent 0, #000 8%, #000 92%, transparent 100%),
    linear-gradient(to bottom, #000 0, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-composite: intersect;
}

.novel-character--sora .novel-character-portrait {
  background-image: url("./assets/characters/sora-expression-sheet-alpha-v1.png");
}

.novel-character--minamo .novel-character-portrait {
  background-image: url("./assets/characters/minamo-expression-sheet-alpha-v1.png");
}

.novel-character[data-expression="teasing"] .novel-character-portrait,
.novel-character[data-expression="startled"] .novel-character-portrait {
  background-position: 100% 0;
}

.novel-character[data-expression="worried"] .novel-character-portrait,
.novel-character[data-expression="exasperated"] .novel-character-portrait {
  background-position: 0 100%;
}

.novel-character[data-expression="sad"] .novel-character-portrait,
.novel-character[data-expression="soft"] .novel-character-portrait {
  background-position: 100% 100%;
}

.novel-character.is-changing .novel-character-portrait {
  animation: novel-expression-in 420ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.novel-cast[data-speaker="sora"] .novel-character--sora,
.novel-cast[data-speaker="minamo"] .novel-character--minamo {
  z-index: 2;
  opacity: 0.98;
  filter: saturate(1) brightness(1);
  transform: translateY(0) scale(1);
}

.novel-cast[data-speaker="sora"] .novel-character--minamo,
.novel-cast[data-speaker="minamo"] .novel-character--sora {
  z-index: 1;
  opacity: 0.26;
}

.novel-cast[data-speaker="choice"] .novel-character {
  opacity: 0.16;
  filter: saturate(0.62) brightness(0.52);
}

.novel-character figcaption {
  position: absolute;
  right: 10%;
  bottom: 4%;
  display: grid;
  gap: 5px;
  justify-items: end;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 260ms ease 120ms, transform 320ms ease 120ms;
}

.novel-character figcaption b {
  color: rgba(242, 255, 252, 0.9);
  font: 700 9px/1 Consolas, monospace;
  letter-spacing: 0.22em;
}

.novel-character figcaption span {
  color: rgba(227, 246, 241, 0.56);
  font: 600 7px/1.6 "Yu Gothic", sans-serif;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.novel-cast[data-speaker="sora"] .novel-character--sora figcaption,
.novel-cast[data-speaker="minamo"] .novel-character--minamo figcaption {
  opacity: 1;
  transform: translateY(0);
}

.novel-dialogue {
  position: absolute;
  z-index: 5;
  right: clamp(28px, 8vw, 130px);
  bottom: clamp(64px, 10vh, 120px);
  left: clamp(28px, 8vw, 130px);
  min-height: 176px;
  padding: 30px 44px 34px;
  border: 1px solid rgba(var(--novel-cyan), 0.24);
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.055), transparent 44%),
    rgba(1, 10, 14, 0.84);
  box-shadow: 0 20px 80px rgba(0, 0, 0, 0.38), inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(22px) saturate(0.86);
  cursor: pointer;
}

.novel-dialogue::before {
  position: absolute;
  top: -1px;
  left: -1px;
  width: 120px;
  height: 2px;
  content: "";
  background: rgb(var(--novel-cyan));
  box-shadow: 0 0 18px rgba(var(--novel-cyan), 0.55);
}

.novel-dialogue:focus-visible {
  border-color: rgba(var(--novel-cyan), 0.54);
  outline: none;
}

.novel-speaker {
  min-height: 18px;
  margin: 0 0 13px;
  color: rgb(var(--novel-cyan));
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.18em;
}

.novel-text {
  max-width: min(1180px, 100%);
  margin: 0;
  color: rgba(247, 255, 252, 0.91);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(15px, 1.3vw, 20px);
  font-weight: 500;
  letter-spacing: 0.055em;
  line-height: 2.05;
  line-break: strict;
  overflow-wrap: normal;
  word-break: normal;
  word-break: auto-phrase;
  text-wrap: pretty;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.78);
}

.novel-text.is-revealing {
  will-change: opacity, transform, filter;
  animation: novel-text-reveal 520ms cubic-bezier(0.2, 0.75, 0.25, 1) both;
}

.novel-cursor {
  display: inline-block;
  margin-left: 3px;
  color: rgba(var(--novel-cyan), 0.75);
  animation: novel-cursor-blink 680ms steps(1) infinite;
}

.novel-continue {
  position: absolute;
  right: 23px;
  bottom: 17px;
  color: rgba(var(--novel-cyan), 0.72);
  font-size: 10px;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.novel-continue.is-visible {
  opacity: 1;
  transform: translateY(0);
  animation: novel-continue 1.2s ease-in-out infinite;
}

.novel-avatar {
  position: absolute;
  z-index: 2;
  top: 46%;
  right: clamp(80px, 13vw, 220px);
  width: clamp(150px, 20vw, 300px);
  aspect-ratio: 1;
  transform: translateY(-55%);
  opacity: 0.72;
  transition: opacity 400ms ease, transform 500ms ease;
}

.novel-avatar[hidden] {
  display: none;
}

.novel-avatar-rings,
.novel-avatar-rings i,
.novel-avatar-core {
  position: absolute;
  border-radius: 50%;
}

.novel-avatar-rings { inset: 0; animation: novel-rings-spin 14s linear infinite; }
.novel-avatar-rings::before,
.novel-avatar-rings::after,
.novel-avatar-rings i { border: 1px solid rgba(var(--novel-cyan), 0.2); content: ""; }
.novel-avatar-rings::before { position: absolute; inset: 7%; border-radius: 50%; }
.novel-avatar-rings::after { position: absolute; inset: 24%; border-radius: 50%; }
.novel-avatar-rings i:nth-child(1) { inset: 0 34%; }
.novel-avatar-rings i:nth-child(2) { inset: 31% -4%; }
.novel-avatar-rings i:nth-child(3) { inset: 13%; border-style: dashed; }

.novel-avatar-core {
  inset: 34%;
  display: grid;
  border: 1px solid rgba(var(--novel-cyan), 0.44);
  background: rgba(var(--accent-rgb), 0.24);
  box-shadow: 0 0 70px rgba(var(--accent-rgb), 0.34), inset 0 0 34px rgba(var(--novel-cyan), 0.16);
  place-items: center;
}

.novel-avatar-core span {
  color: rgba(244, 255, 252, 0.92);
  font-family: Georgia, serif;
  font-size: clamp(26px, 3vw, 48px);
  text-shadow: 0 0 24px rgba(var(--novel-cyan), 0.8);
}

.novel-avatar[data-speaker="narrator"] { opacity: 0.26; transform: translateY(-55%) scale(0.82); }
.novel-avatar[data-speaker="sora"] { --novel-cyan: 188, 218, 255; }
.novel-avatar[data-speaker="minamo"] { --novel-cyan: 143, 255, 221; }
.novel-avatar[data-speaker="aoi"] { --novel-cyan: 255, 204, 147; }
.novel-avatar[data-speaker="earth"] { --novel-cyan: 175, 223, 255; transform: translateY(-55%) scale(1.18); }
.novel-avatar[data-speaker="choice"] { --novel-cyan: 220, 191, 255; }

.novel-signal-caption {
  position: absolute;
  z-index: 4;
  top: clamp(100px, 15vh, 170px);
  left: clamp(28px, 8vw, 130px);
  display: grid;
  gap: 9px;
  max-width: 390px;
  pointer-events: none;
}

.novel-signal-caption span {
  width: max-content;
  padding: 5px 8px;
  border: 1px solid rgba(var(--novel-cyan), 0.24);
  color: rgba(var(--novel-cyan), 0.8);
  background: rgba(1, 10, 14, 0.44);
  font-family: Consolas, "Courier New", monospace;
  font-size: 7px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.novel-signal-caption span[data-kind="DERIVED"] { color: #f7c98b; border-color: rgba(247, 201, 139, 0.34); }
.novel-signal-caption span[data-kind="SCENARIO"] { color: #d7b9ff; border-color: rgba(215, 185, 255, 0.34); }

.novel-signal-caption strong {
  color: rgba(232, 248, 244, 0.52);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.8;
}

.novel-choices {
  position: absolute;
  z-index: 8;
  top: 47%;
  left: 50%;
  display: grid;
  gap: 10px;
  width: min(620px, calc(100vw - 56px));
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%) translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.novel-choices.is-visible {
  pointer-events: auto;
  opacity: 1;
  transform: translate(-50%, -50%);
}

.novel-choices button {
  min-height: 52px;
  padding: 13px 22px;
  border-radius: 2px;
  color: rgba(245, 255, 252, 0.8);
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-align: left;
}

.novel-choices button::before {
  margin-right: 13px;
  color: rgba(var(--novel-cyan), 0.7);
  content: "◇";
}

.novel-footer {
  position: absolute;
  z-index: 6;
  right: clamp(28px, 8vw, 130px);
  bottom: max(25px, env(safe-area-inset-bottom));
  left: clamp(28px, 8vw, 130px);
  display: flex;
  justify-content: space-between;
  color: rgba(214, 240, 233, 0.36);
  font-family: Consolas, "Courier New", monospace;
  font-size: 7px;
  letter-spacing: 0.15em;
  pointer-events: none;
}

.novel-chapter-card {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  display: grid;
  gap: 18px;
  width: min(780px, calc(100vw - 56px));
  padding: 52px 46px;
  border-top: 1px solid rgba(var(--novel-cyan), 0.34);
  border-bottom: 1px solid rgba(var(--novel-cyan), 0.18);
  background: rgba(1, 9, 13, 0.76);
  backdrop-filter: blur(22px);
  transform: translate(-50%, -50%);
  text-align: center;
  animation: novel-chapter-in 1.45s ease both;
}

.novel-chapter-card span {
  color: rgba(var(--novel-cyan), 0.67);
  font-family: Consolas, "Courier New", monospace;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.3em;
}

.novel-chapter-card strong {
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(22px, 3vw, 42px);
  font-weight: 500;
  letter-spacing: 0.05em;
}

.novel-log-panel {
  position: absolute;
  z-index: 20;
  top: 0;
  right: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(560px, 92vw);
  height: 100%;
  border-left: 1px solid rgba(var(--novel-cyan), 0.22);
  background: rgba(1, 9, 13, 0.96);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(24px);
}

.novel-log-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 34px 32px 24px;
  border-bottom: 1px solid rgba(var(--novel-cyan), 0.12);
}

.novel-log-panel header div { display: grid; gap: 7px; }
.novel-log-panel header span { color: rgba(var(--novel-cyan), 0.58); font: 700 7px/1 Consolas, monospace; letter-spacing: 0.2em; }
.novel-log-panel header strong { font: 600 18px/1.4 "Yu Gothic", sans-serif; letter-spacing: 0.04em; }
.novel-log-panel header button { width: 34px; height: 34px; border-radius: 50%; font-size: 16px; }

#novel-log-content {
  padding: 26px 32px 70px;
  overflow: auto;
}

#novel-log-content article {
  padding: 0 0 22px 18px;
  border-left: 1px solid rgba(var(--novel-cyan), 0.18);
}

#novel-log-content article[data-kind="DERIVED"] { border-color: rgba(247, 201, 139, 0.4); }
#novel-log-content article[data-kind="SCENARIO"] { border-color: rgba(215, 185, 255, 0.4); }
#novel-log-content article p:first-child { margin: 0 0 7px; color: rgba(var(--novel-cyan), 0.58); font: 700 7px/1.4 Consolas, monospace; letter-spacing: 0.13em; }
#novel-log-content article p:last-child { margin: 0; color: rgba(235, 249, 245, 0.7); font: 500 11px/1.9 "Yu Gothic", sans-serif; }

.japan-story-button {
  margin-top: 8px;
}

.story-icon {
  font-family: Georgia, serif;
}

@keyframes novel-cursor-blink { 50% { opacity: 0; } }
@keyframes novel-text-reveal {
  0% {
    opacity: 0;
    filter: blur(3px);
    transform: translateY(5px);
  }
  55% {
    filter: blur(0);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}
@keyframes novel-continue { 50% { transform: translateY(4px); } }
@keyframes novel-expression-in {
  0% { opacity: 0.38; transform: translateY(5px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes novel-orbit-drift { to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes novel-rings-spin { to { transform: rotate(360deg); } }
@keyframes novel-chapter-in {
  0% { opacity: 0; transform: translate(-50%, calc(-50% + 12px)); }
  22%, 76% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(-50%, calc(-50% - 8px)); }
}

@media (max-width: 720px) {
  .novel-topbar {
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    left: 14px;
  }

  .novel-topbar > div span { display: none; }
  .novel-topbar > div strong { max-width: 130px; font-size: 7px; line-height: 1.5; }
  .novel-topbar nav { gap: 4px; }
  .novel-topbar button { min-width: 42px; height: 32px; padding: 0 7px; font-size: 6px; }
  .novel-topbar #novel-restart-button { display: none; }
  .novel-topbar #novel-close-button { min-width: 32px; }

  .novel-title-screen {
    top: 46%;
    left: 20px;
    width: calc(100vw - 40px);
  }

  .novel-title-screen > p:first-of-type { margin-bottom: 16px; font-size: 7px; }
  .novel-title-screen h2 { font-size: clamp(36px, 12.5vw, 58px); line-height: 1.2; }
  .novel-title-sub { margin-top: 18px; font-size: 10px; line-height: 1.8; }
  .novel-title-note { margin-top: 24px; font-size: 9px; line-height: 1.8; }
  .novel-title-actions { display: grid; margin-top: 24px; }
  .novel-title-actions button { min-height: 44px; }
  .novel-title-orbit { top: 35%; left: 72%; width: 88vw; opacity: 0.64; }

  .novel-signal-caption {
    top: 72px;
    left: 18px;
    max-width: calc(100vw - 170px);
    gap: 5px;
  }

  .novel-signal-caption strong { font-size: 7px; line-height: 1.55; }
  .novel-avatar { top: 34%; right: 12px; width: 150px; opacity: 0.54; }

  .novel-character {
    right: -34px;
    bottom: 265px;
    width: min(76vw, 310px);
  }

  .novel-cast[data-speaker="sora"] .novel-character--minamo,
  .novel-cast[data-speaker="minamo"] .novel-character--sora,
  .novel-cast:not([data-speaker="sora"]):not([data-speaker="minamo"]) .novel-character {
    opacity: 0;
  }

  .novel-character figcaption {
    right: 14%;
    bottom: 3%;
  }

  .novel-character figcaption span { display: none; }

  .novel-dialogue {
    right: 14px;
    bottom: max(54px, calc(env(safe-area-inset-bottom) + 45px));
    left: 14px;
    min-height: 235px;
    padding: 25px 22px 30px;
  }

  .novel-speaker { margin-bottom: 10px; font-size: 10px; }
  .novel-text { font-size: 15px; line-height: 1.95; }
  .novel-choices { top: 42%; width: calc(100vw - 28px); gap: 8px; }
  .novel-choices button { min-height: 50px; padding: 12px 15px; font-size: 10px; line-height: 1.55; }

  .novel-footer {
    right: 18px;
    bottom: max(16px, env(safe-area-inset-bottom));
    left: 18px;
    font-size: 6px;
  }

  .novel-footer span:last-child { display: none; }
  .novel-chapter-card { padding: 42px 24px; }
  .novel-log-panel { width: 100%; }
  .novel-log-panel header { padding: 24px 20px 18px; }
  #novel-log-content { padding: 22px 20px 60px; }
}

@media (prefers-reduced-motion: reduce) {
  .novel-layer,
  .novel-progress i,
  .novel-choices,
  .novel-continue,
  .novel-avatar,
  .novel-character,
  .novel-character figcaption {
    transition-duration: 0.01ms;
  }

  .novel-title-orbit,
  .novel-avatar-rings,
  .novel-cursor,
  .novel-text,
  .novel-character-portrait,
  .novel-continue,
  .novel-chapter-card {
    animation: none;
  }
}
