:root {
  --bg-dark: #0e0914;
  --bg-panel: rgba(20, 12, 26, 0.92);
  --pink: #ff3586;
  --pink-soft: #ff85b7;
  --pink-dim: #7a1945;
  --red: #ff2644;
  --cyan: #6df2e8;
  --gold: #ffd470;
  --text: #fff3f8;
  --text-dim: #bfa8b8;
  --border: rgba(255, 53, 134, 0.45);
}

* {
  box-sizing: border-box;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #07040a;
  color: var(--text);
  font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", sans-serif;
  overflow: hidden;
}

.crt-shell {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 1440px;
  max-height: 900px;
  margin: 0 auto;
  background: var(--bg-dark);
  overflow: hidden;
  border: 1px solid rgba(255, 53, 134, 0.2);
  box-shadow: 0 0 60px rgba(255, 53, 134, 0.14);
}

.scanlines {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  background: repeating-linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.015) 0px,
    rgba(255, 255, 255, 0.015) 1px,
    transparent 2px,
    transparent 4px
  );
}

.danger-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 80;
  opacity: 0;
  transition: opacity 0.35s ease;
  background: radial-gradient(circle at center, transparent 45%, rgba(255, 18, 60, 0.55) 100%);
}

.danger-vignette.active {
  opacity: 1;
  animation: pulseVignette 1.2s infinite alternate ease-in-out;
}

@keyframes pulseVignette {
  from { opacity: 0.45; }
  to { opacity: 0.95; }
}

.slash-flash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 95;
  opacity: 0;
  background: linear-gradient(125deg, transparent 44%, #fff 48%, #ff2644 51%, transparent 55%);
}

.slash-flash.go {
  animation: slashAnim 0.42s ease-out;
}

@keyframes slashAnim {
  0% { opacity: 1; transform: scale(0.95); }
  100% { opacity: 0; transform: scale(1.15); }
}

.screen {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}

.screen.active {
  display: flex;
}

.hidden {
  display: none !important;
}

.pixel-sprite {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

/* ================= TITLE SCREEN ================= */
#screen-title {
  background: radial-gradient(circle at 75% 45%, rgba(255, 53, 134, 0.18), transparent 55%),
              linear-gradient(135deg, #120918 0%, #1d0e24 55%, #0c0610 100%);
  padding: 36px 48px;
}

.title-layout {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  z-index: 2;
}

.title-left {
  flex: 1.2;
  max-width: 660px;
}

.badge-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.pill-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: rgba(255, 53, 134, 0.12);
  color: var(--pink-soft);
}

.pill-badge.accent {
  background: var(--pink);
  color: #100713;
  border-color: var(--pink);
}

.game-title {
  margin: 0 0 12px;
  font-size: clamp(36px, 4.5vw, 56px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.t-love { color: var(--pink-soft); text-shadow: 0 0 18px rgba(255, 53, 134, 0.5); }
.t-or { color: #9c8899; font-size: 0.65em; }
.t-knife { color: #fff; text-shadow: 2px 2px 0 var(--red); }
.t-sub {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  letter-spacing: 0.25em;
  color: var(--pink);
}

.title-tagline {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.title-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.btn-primary, .btn-secondary, .btn-ghost {
  cursor: pointer;
  border-radius: 6px;
  font-weight: 700;
  transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, #d91b64 100%);
  color: #fff;
  border: 1px solid #ff7cb4;
  padding: 13px 26px;
  font-size: 16px;
  box-shadow: 0 0 20px rgba(255, 53, 134, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(255, 53, 134, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 12px 20px;
  font-size: 15px;
}

.btn-secondary:hover {
  background: rgba(255, 53, 134, 0.18);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 7px 12px;
  font-size: 13px;
}

.btn-ghost:hover {
  color: #fff;
  border-color: var(--pink);
}

.title-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.stats-mini {
  font-size: 12px;
  color: var(--pink-soft);
}

.howto-box {
  background: rgba(16, 9, 22, 0.85);
  border: 1px solid rgba(255, 53, 134, 0.28);
  border-left: 4px solid var(--pink);
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-dim);
}

.title-right {
  flex: 0.85;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
}

.title-stage img {
  height: min(68vh, 540px);
  filter: drop-shadow(0 0 32px rgba(255, 53, 134, 0.25));
}

.float-anim {
  animation: floatSlow 3.6s ease-in-out infinite;
}

@keyframes floatSlow {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-8px); }
}

/* ================= TOP HUD ================= */
.top-hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  background: rgba(13, 8, 18, 0.96);
  border-bottom: 2px solid var(--border);
  z-index: 20;
}

.hud-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-day {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #fff;
}

.hud-phase {
  font-size: 12px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 4px;
  background: rgba(255, 53, 134, 0.2);
  color: var(--pink-soft);
  border: 1px solid var(--pink);
}

.hud-phase.night {
  background: rgba(255, 38, 68, 0.25);
  color: #ff8a9b;
  border-color: var(--red);
}

.hud-meters {
  display: flex;
  flex: 1;
  max-width: 520px;
  gap: 18px;
}

.meter-box {
  flex: 1;
}

.meter-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}

.heart-ico { color: var(--pink); }
.warn-ico { color: var(--red); }

.meter-num {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.meter-track {
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.meter-fill {
  height: 100%;
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.meter-fill.pink {
  background: linear-gradient(90deg, #c21863, #ff5da2);
  box-shadow: 0 0 10px rgba(255, 93, 162, 0.6);
}

.meter-fill.red {
  background: linear-gradient(90deg, #a60f28, #ff2b4a);
  box-shadow: 0 0 10px rgba(255, 43, 74, 0.7);
}

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

.stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 212, 112, 0.35);
  border-radius: 5px;
  font-weight: 800;
  font-size: 14px;
  color: var(--gold);
}

.clue-chip {
  border-color: rgba(109, 242, 232, 0.4);
  color: var(--cyan);
}

.btn-hud {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  width: 34px;
  height: 34px;
  font-size: 15px;
  display: grid;
  place-items: center;
}

.btn-hud:hover {
  border-color: var(--pink);
  background: rgba(255, 53, 134, 0.2);
}

/* ================= RELIC BAR ================= */
.relic-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 18px;
  min-height: 34px;
  background: rgba(19, 10, 26, 0.85);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  overflow-x: auto;
  z-index: 18;
}

.relic-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 4px;
  font-size: 12px;
  background: rgba(255, 53, 134, 0.12);
  border: 1px solid rgba(255, 53, 134, 0.4);
  color: #ffd7ea;
  white-space: nowrap;
  cursor: help;
}

.relic-empty {
  font-size: 12px;
  color: #776374;
}

/* ================= STAGE AREA ================= */
.stage-area {
  position: relative;
  flex: 1;
  min-height: 260px;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: flex-end;
}

.room-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
  opacity: 0.92;
  transition: filter 0.4s ease;
}

.spotlight-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  background: radial-gradient(circle at 50% 42%, transparent 18%, rgba(5, 2, 10, 0.82) 64%);
}

.heroine-wrap {
  position: relative;
  z-index: 5;
  height: 92%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.25s ease;
}

.heroine-wrap img {
  height: 100%;
  max-height: 410px;
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.65));
}

.heroine-wrap.shake {
  animation: spriteShake 0.35s ease;
}

@keyframes spriteShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.float-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 25;
}

.float-pop {
  position: absolute;
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 2px 6px #000;
  animation: floatUpFade 1.15s ease-out forwards;
}

@keyframes floatUpFade {
  0% { opacity: 0; transform: translateY(8px) scale(0.9); }
  20% { opacity: 1; transform: translateY(0px) scale(1.05); }
  100% { opacity: 0; transform: translateY(-42px) scale(1); }
}

/* Interrogation HUD */
.interrogation-hud {
  position: absolute;
  top: 14px;
  left: 18px;
  z-index: 15;
  width: 260px;
  background: rgba(14, 7, 20, 0.92);
  border: 1px solid var(--red);
  border-radius: 6px;
  padding: 10px 12px;
  box-shadow: 0 0 24px rgba(255, 38, 68, 0.25);
}

.kill-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 900;
  color: #ff697e;
  margin-bottom: 5px;
}

.kill-track {
  height: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 38, 68, 0.45);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.kill-fill {
  height: 100%;
  background: linear-gradient(90deg, #b80d2d, #ff2644);
  transition: width 0.3s ease;
}

.tokens-title {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.tokens-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.token-btn {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 4px;
  background: rgba(255, 53, 134, 0.16);
  border: 1px solid var(--pink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.token-btn:hover:not(:disabled) {
  background: var(--pink);
  color: #100713;
}

.token-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Interrogation Choices Panel */
.choices-panel {
  position: absolute;
  right: 20px;
  top: 24px;
  z-index: 16;
  width: min(360px, 42vw);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.choice-btn {
  cursor: pointer;
  text-align: left;
  padding: 12px 15px;
  border-radius: 6px;
  background: rgba(15, 7, 22, 0.94);
  border: 2px solid var(--pink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  transition: transform 0.12s ease, background 0.15s ease;
}

.choice-btn:hover:not(:disabled) {
  transform: translateX(-6px);
  background: rgba(255, 53, 134, 0.28);
}

.choice-btn.hint-glow {
  border-color: var(--cyan);
  box-shadow: 0 0 16px rgba(109, 242, 232, 0.45);
}

.choice-sub {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--pink-soft);
}

/* Dialogue Box */
.dialogue-box {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: min(860px, 92%);
  z-index: 14;
  background: rgba(12, 6, 18, 0.92);
  border: 2px solid var(--pink);
  border-radius: 6px;
  padding: 12px 18px 10px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.75);
}

.dialogue-speaker {
  display: inline-block;
  background: var(--pink);
  color: #100713;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
  padding: 2px 10px;
  border-radius: 3px;
  margin-bottom: 6px;
}

.dialogue-text {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  min-height: 44px;
  color: #fff;
}

.dialogue-hint {
  margin-top: 4px;
  font-size: 12px;
  color: var(--cyan);
}

/* ================= DECK TRAY ================= */
.deck-tray {
  background: linear-gradient(180deg, rgba(20, 10, 26, 0.96) 0%, #0b0610 100%);
  border-top: 2px solid var(--border);
  padding: 10px 18px 14px;
  z-index: 20;
}

.tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.ap-display {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 800;
}

.ap-pip {
  width: 14px;
  height: 14px;
  border-radius: 3px;
  background: var(--pink);
  box-shadow: 0 0 8px var(--pink);
}

.ap-pip.used {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.goal-hint {
  font-size: 12px;
  color: var(--text-dim);
}

.btn-end-day {
  cursor: pointer;
  padding: 7px 16px;
  border-radius: 5px;
  border: 1px solid var(--pink);
  background: rgba(255, 53, 134, 0.18);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}

.btn-end-day:hover {
  background: var(--pink);
  color: #100713;
}

.btn-end-day.ready-pulse {
  background: var(--pink);
  color: #100713;
  box-shadow: 0 0 18px rgba(255, 53, 134, 0.85);
  animation: pulseBtn 1.1s infinite alternate ease-in-out;
}

@keyframes pulseBtn {
  from { transform: scale(1); }
  to { transform: scale(1.05); }
}

.hand-container {
  display: flex;
  justify-content: center;
  gap: 12px;
  min-height: 162px;
  overflow-x: auto;
  padding: 6px 4px 2px;
}

.game-card {
  position: relative;
  width: 158px;
  min-width: 148px;
  background: linear-gradient(165deg, #251630 0%, #160d1e 100%);
  border: 2px solid rgba(255, 133, 183, 0.5);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.game-card:hover:not(.disabled) {
  transform: translateY(-8px);
  border-color: var(--pink);
  box-shadow: 0 8px 22px rgba(255, 53, 134, 0.35);
}

.game-card.curse {
  border-color: var(--red);
  background: linear-gradient(165deg, #2e111f 0%, #170811 100%);
}

.game-card.clue-card {
  border-color: var(--cyan);
}

.game-card.pinned {
  border-color: var(--red);
  opacity: 0.72;
  cursor: not-allowed;
}

.game-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 900;
}

.card-cost {
  background: var(--pink);
  color: #100713;
  padding: 1px 6px;
  border-radius: 3px;
}

.card-ico {
  font-size: 26px;
  text-align: center;
  margin: 4px 0;
}

.card-name {
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  margin-bottom: 4px;
}

.card-desc {
  font-size: 11px;
  line-height: 1.35;
  color: var(--text-dim);
  text-align: center;
}

/* Knife Pin Overlay on Card */
.knife-pin-overlay {
  position: absolute;
  inset: 0;
  background: rgba(25, 4, 12, 0.72);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.knife-pin-overlay .knife-emoji {
  font-size: 40px;
  transform: rotate(-35deg);
  filter: drop-shadow(0 0 8px #ff2644);
}

.knife-pin-overlay .pin-label {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  color: #ff697e;
  background: rgba(0, 0, 0, 0.8);
  padding: 2px 7px;
  border: 1px solid var(--red);
}

/* ================= ENDING SCREEN ================= */
#screen-ending {
  background: radial-gradient(circle at center, #220e28 0%, #09050d 75%);
  padding: 28px;
  justify-content: center;
  align-items: center;
}

.ending-card {
  width: min(980px, 96%);
  max-height: 92vh;
  background: rgba(16, 9, 22, 0.96);
  border: 2px solid var(--pink);
  border-radius: 10px;
  padding: 26px;
  display: flex;
  gap: 26px;
  overflow-y: auto;
  box-shadow: 0 0 50px rgba(255, 53, 134, 0.25);
}

.ending-visual {
  flex: 0 0 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 53, 134, 0.06);
  border: 1px solid rgba(255, 53, 134, 0.25);
  border-radius: 8px;
  padding: 12px;
}

.ending-visual img {
  max-height: 340px;
  width: auto;
}

.ending-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ending-title {
  margin: 10px 0 12px;
  font-size: 26px;
  color: #fff;
}

.ending-story {
  font-size: 14px;
  line-height: 1.75;
  color: #ecdce6;
  white-space: pre-line;
  margin-bottom: 16px;
}

.ending-final-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.ending-unlocks {
  background: rgba(109, 242, 232, 0.08);
  border: 1px solid rgba(109, 242, 232, 0.35);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--cyan);
  margin-bottom: 18px;
}

.ending-actions {
  margin-top: auto;
  display: flex;
  gap: 12px;
}

/* ================= CODEX MODAL ================= */
.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 85;
  background: rgba(6, 3, 10, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-panel {
  width: min(760px, 95%);
  max-height: 84vh;
  background: #140b1c;
  border: 2px solid var(--pink);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
}

.codex-tabs {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.codex-tab {
  flex: 1;
  cursor: pointer;
  padding: 10px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-weight: 700;
  font-size: 13px;
}

.codex-tab.active {
  background: rgba(255, 53, 134, 0.2);
  color: #fff;
  border-bottom: 2px solid var(--pink);
}

.codex-content {
  padding: 16px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.codex-item {
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
}

.codex-item.unlocked {
  border-color: rgba(255, 53, 134, 0.45);
}

.codex-item-title {
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 4px;
  color: var(--pink-soft);
}

.codex-item-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-dim);
}

@media (max-width: 860px) {
  #screen-title { padding: 20px; overflow-y: auto; }
  .title-layout { flex-direction: column; text-align: center; }
  .title-right { display: none; }
  .title-actions, .title-meta-row, .badge-row { justify-content: center; }
  .top-hud { flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .hud-meters { max-width: none; min-width: 100%; order: 3; }
  .heroine-wrap img { max-height: 250px; }
  .hand-container { justify-content: flex-start; min-height: 146px; }
  .game-card { width: 136px; min-width: 132px; padding: 8px; }
  .interrogation-hud { width: calc(100% - 24px); left: 12px; top: 8px; padding: 8px 10px; }
  .choices-panel { width: calc(100% - 24px); left: 12px; right: auto; top: auto; bottom: 112px; gap: 7px; }
  .choice-btn { padding: 9px 12px; font-size: 13px; }
  .dialogue-box { bottom: 8px; width: calc(100% - 20px); padding: 9px 12px; }
  .dialogue-text { font-size: 13px; min-height: 36px; }
  .ending-card { flex-direction: column; padding: 16px; }
  .ending-visual { flex: 0 0 auto; }
  .ending-visual img { max-height: 180px; }
}
