/* ==========================================================================
   The Wild Robot · Chapter III: The Egg
   Storybook UI Design System — Palette sampled directly from official art
   ========================================================================== */

:root {
  --mist-blue: #598d9f;
  --sky-blue: #77b2cc;
  --deep-pine: #2a4042;
  --deep-pine-dark: #19292b;
  --bark: #706049;
  --sage: #969272;
  --leaf-gold: #b19d53;
  --amber-glow: #dfb464;
  --warm-sand: #e9d2a6;
  --parchment: #f6eedc;
  --stone-cream: #d2c3b3;
  --fink-orange: #df8244;
  --gosling-coral: #f0be67;

  --font-serif: "Iowan Old Style", Georgia, "Palatino Linotype", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;

  --ease-gentle: cubic-bezier(0.22, 1, 0.36, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--deep-pine-dark);
  color: var(--parchment);
  font-family: var(--font-sans);
  user-select: none;
}

.app-root {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #162426;
}

/* Canvas Stage */
#stage {
  display: block;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

/* Soft storybook vignette — disabled at bottom so 100% pure painted art shines cleanly */
.stage-vignette {
  display: none;
}

.hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* ==========================================================================
   Minimalist Top HUD
   ========================================================================== */
.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  transition: opacity 0.6s var(--ease-gentle);
  pointer-events: none;
}

.hud-left, .hud-right {
  display: flex;
  align-items: center;
  gap: 7px;
  pointer-events: auto;
}

.hud-right {
  opacity: 0.72;
  transition: opacity 0.28s ease;
}

.hud-right:hover {
  opacity: 1;
}

.chapter-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(25, 41, 43, 0.36);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(233, 210, 166, 0.18);
  font-size: 11.5px;
  letter-spacing: 0.03em;
  color: var(--parchment);
  white-space: nowrap;
}

.chapter-num {
  font-weight: 700;
  color: var(--warm-sand);
  letter-spacing: 0.06em;
}

.chapter-sep {
  opacity: 0.45;
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: 12.5px;
}

.act-dots {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(25, 41, 43, 0.28);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(233, 210, 166, 0.12);
}

.act-dots .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(233, 210, 166, 0.28);
  transition: all 0.45s var(--ease-gentle);
}

.act-dots .dot.done {
  background: var(--sky-blue);
}

.act-dots .dot.active {
  width: 14px;
  border-radius: 999px;
  background: var(--warm-sand);
}

.hud-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 29px;
  min-width: 29px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(233, 210, 166, 0.18);
  background: rgba(25, 41, 43, 0.36);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: rgba(246, 238, 220, 0.92);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.25s var(--ease-gentle);
}

.hud-btn:hover {
  background: rgba(42, 64, 66, 0.68);
  border-color: rgba(233, 210, 166, 0.45);
  transform: translateY(-1px);
}

.hud-btn:not(.active) {
  opacity: 0.56;
}

.hud-btn:not(.active) .sound-waves {
  opacity: 0.15;
}

.hud-btn-journal {
  padding: 0 10px;
  background: rgba(42, 64, 66, 0.45);
}

.journal-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--warm-sand);
  letter-spacing: 0.02em;
}

.icon-svg {
  width: 14px;
  height: 14px;
}

.icon-sm {
  width: 13px;
  height: 13px;
}

/* ==========================================================================
   Gentle Exploration Hint (Floating Whisper at Top-Center)
   ========================================================================== */
.explore-hint {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 14;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 22px;
  border-radius: 14px;
  background: rgba(18, 32, 34, 0.30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 248, 232, 0.20);
  box-shadow: 0 4px 14px rgba(15, 26, 28, 0.14);
  transition: opacity 0.45s var(--ease-gentle), transform 0.45s var(--ease-gentle);
  pointer-events: none;
  max-width: min(74vw, 820px);
  text-align: center;
}

.hint-dot {
  display: none;
}

.hint-en {
  font-family: var(--font-serif) !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 1.35 !important;
  color: #fffcf4;
  letter-spacing: 0.012em;
  text-shadow: 0 1px 4px rgba(12, 20, 22, 0.72);
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.18s ease;
}
.hint-en:hover {
  color: #ffe6a8;
  text-decoration: underline dotted rgba(255, 230, 168, 0.7);
}

.hint-cn {
  font-size: 11.5px !important;
  line-height: 1.3 !important;
  color: rgba(250, 244, 230, 0.80);
  border-left: none;
  padding-left: 0;
}

body.hide-cn .hint-cn,
body.hide-cn .dialogue-cn,
body.hide-cn .eyebrow-cn,
body.hide-cn .choice-cn,
body.hide-cn .inv-cn,
body.hide-cn .wb-cn {
  display: none !important;
}

/* Subtitle-off / Pure Listening Mode (hides dialogue & hint text, keeps Listen + Speed + Continue) */
body.hide-subtitles .dialogue-en,
body.hide-subtitles .dialogue-cn,
body.hide-subtitles .wb-en,
body.hide-subtitles .wb-cn,
body.hide-subtitles .explore-hint {
  display: none !important;
}

/* Global Typography Lock: prevent iOS/Safari auto-inflation when toggling CN off! */
html, body {
  -webkit-text-size-adjust: 100% !important;
  text-size-adjust: 100% !important;
}

.speed-pill-btn {
  min-width: 54px;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}

.soft-action-btn.is-playing {
  background: rgba(223, 180, 100, 0.28);
  border-color: rgba(233, 210, 166, 0.72);
  color: #fff6dc;
}

/* Travel Postcard Camera Flash & Album */
.shutter-flash {
  position: fixed;
  inset: 0;
  background: #fffdf5;
  opacity: 0;
  pointer-events: none;
  z-index: 99;
  transition: opacity 0.26s ease-out;
}
.shutter-flash.flash-on {
  opacity: 0.72;
  transition: opacity 0.04s ease-in;
}
.postcard-sheet {
  max-width: min(92vw, 760px);
}
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
  max-height: 58vh;
  overflow-y: auto;
  padding-right: 4px;
}
.pc-card {
  border-radius: 14px;
  overflow: hidden;
  background: rgba(25, 41, 43, 0.72);
  border: 1px solid rgba(233, 210, 166, 0.26);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
}
.pc-card img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
.pc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--parchment);
}
.pc-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pc-dl {
  color: var(--amber-glow);
  text-decoration: none;
  font-weight: 600;
}
.pc-del {
  background: none;
  border: none;
  color: rgba(246, 238, 220, 0.55);
  cursor: pointer;
  font-size: 12px;
}

/* Discovery counter pill in HUD */
.hud-pill-static {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 29px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(233, 210, 166, 0.16);
  background: rgba(25, 41, 43, 0.34);
  backdrop-filter: blur(10px);
  color: var(--warm-sand);
  font-size: 11px;
  font-weight: 600;
}
.disc-star {
  color: var(--amber-glow);
}

/* Carried Item Inventory Pill (Bottom-Left) */
.inventory-pill {
  position: absolute;
  left: 26px;
  bottom: 26px;
  z-index: 15;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px 10px 12px;
  border-radius: 18px;
  background: rgba(25, 41, 43, 0.78);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(233, 210, 166, 0.42);
  box-shadow: 0 12px 32px rgba(12, 22, 24, 0.4);
  transition: opacity 0.4s var(--ease-gentle), transform 0.4s var(--ease-gentle);
}
.inventory-pill img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}
.inv-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inv-en {
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--parchment);
}
.inv-cn {
  font-size: 12px;
  color: rgba(233, 210, 166, 0.78);
}

/* Non-blocking Floating World Observation Banner — unified at TOP sky area! */
.world-bubble {
  position: absolute;
  left: 50%;
  top: calc(52px + env(safe-area-inset-top, 0px));
  transform: translateX(-50%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 20px;
  border-radius: 14px;
  background: rgba(18, 32, 34, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 248, 232, 0.22);
  box-shadow: 0 6px 20px rgba(12, 22, 24, 0.18);
  max-width: min(86vw, 860px);
  text-align: center;
  pointer-events: none;
  transition: opacity 0.35s var(--ease-gentle);
}
.wb-speaker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber-glow);
}
.wb-en {
  font-family: var(--font-serif) !important;
  font-size: 14.5px !important;
  font-weight: 500 !important;
  letter-spacing: 0.015em;
  color: #fffcf4;
  text-shadow: 0 1px 4px rgba(12, 20, 22, 0.72);
  pointer-events: auto;
  cursor: pointer;
  transition: color 0.18s ease;
}
.wb-en:hover {
  color: #ffe6a8;
  text-decoration: underline dotted rgba(255, 230, 168, 0.7);
}
.wb-cn {
  font-size: 12px !important;
  color: rgba(250, 244, 230, 0.84);
}

.music-credit {
  margin-top: 16px;
  font-size: 11px;
  color: rgba(112, 96, 73, 0.76);
}

@keyframes pulseSoft {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.35); opacity: 1; }
}

/* ==========================================================================
   Inner Voice Choices (Floating Ethereal Whispers — NOT boxy radio cards)
   ========================================================================== */
.choice-layer {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 18;
  width: min(92vw, 720px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transition: opacity 0.5s var(--ease-gentle), transform 0.5s var(--ease-gentle);
}

.choice-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 16px;
  border-radius: 999px;
  background: rgba(25, 41, 43, 0.65);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(119, 178, 204, 0.34);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sky-blue);
}

.eyebrow-glow {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sky-blue);
  box-shadow: 0 0 10px var(--sky-blue);
}

.eyebrow-cn {
  text-transform: none;
  letter-spacing: 0.02em;
  color: rgba(246, 238, 220, 0.74);
  border-left: 1px solid rgba(119, 178, 204, 0.28);
  padding-left: 8px;
}

.choice-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.choice-bubble {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 248, 232, 0.24);
  background: rgba(18, 32, 34, 0.26);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--parchment);
  cursor: pointer;
  transition: transform 0.25s var(--ease-gentle), border-color 0.25s ease, background 0.25s ease;
  box-shadow: 0 4px 14px rgba(13, 23, 25, 0.18);
}

.choice-bubble:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 242, 205, 0.62);
  background: rgba(24, 42, 46, 0.42);
  box-shadow: 0 6px 18px rgba(13, 23, 25, 0.24);
}

.choice-bubble:active {
  transform: translateY(0);
}

.choice-en {
  display: block;
  font-family: var(--font-serif) !important;
  font-size: 15.5px !important;
  font-weight: 500 !important;
  line-height: 1.42 !important;
  letter-spacing: 0.015em;
  color: #fffcf4;
  text-shadow: 0 1px 4px rgba(12, 20, 22, 0.88), 0 2px 10px rgba(12, 20, 22, 0.65);
}

.choice-cn {
  display: block;
  margin-top: 2px;
  font-family: var(--font-sans) !important;
  font-size: 12px !important;
  color: rgba(250, 244, 230, 0.84);
  text-shadow: 0 1px 4px rgba(12, 20, 22, 0.85);
}

/* ==========================================================================
   Cinematic Bottom Storybook Dialogue Band (ZERO full-width dark mask!)
   ========================================================================== */
.dialogue-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 16;
  padding: 0 24px calc(12px + env(safe-area-inset-bottom, 0px));
  background: transparent;
  pointer-events: none;
  transition: opacity 0.4s var(--ease-gentle), transform 0.4s var(--ease-gentle);
}

.dialogue-inner {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: auto;
  padding: 4px 8px;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: none;
  box-shadow: none;
}

.dialogue-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.speaker-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: rgba(25, 41, 43, 0.42);
  backdrop-filter: blur(6px);
  color: #f6eedc;
  border: 1px solid rgba(246, 238, 220, 0.24);
}

.speaker-tag[data-speaker="roz"] {
  background: rgba(36, 88, 106, 0.5);
  color: #dff4fc;
  border-color: rgba(169, 217, 238, 0.36);
}

.speaker-tag[data-speaker="fink"] {
  background: rgba(166, 78, 24, 0.52);
  color: #ffe3cc;
  border-color: rgba(244, 178, 130, 0.38);
}

.speaker-tag[data-speaker="brightbill"] {
  background: rgba(140, 96, 22, 0.52);
  color: #fff0c7;
  border-color: rgba(250, 224, 165, 0.42);
}

.speaker-tag[data-speaker="loudwing"] {
  background: rgba(84, 70, 50, 0.5);
  color: #f4efd8;
  border-color: rgba(228, 223, 190, 0.34);
}

.mood-note {
  font-size: 11px;
  color: rgba(253, 248, 236, 0.85);
  font-style: italic;
  text-shadow: 0 1px 6px rgba(12, 22, 24, 0.78);
}

.dialogue-en {
  font-family: var(--font-serif) !important;
  font-size: 17px !important;
  font-weight: 500 !important;
  line-height: 1.46 !important;
  color: #fffcf4;
  text-shadow: 0 1px 4px rgba(12, 20, 22, 0.85), 0 2px 14px rgba(12, 20, 22, 0.65);
  letter-spacing: 0.012em;
  -webkit-text-size-adjust: 100% !important;
}

/* Interactive vocabulary words & karaoke highlight */
.dialogue-en .w-token {
  display: inline;
  transition: color 0.18s ease, background 0.18s ease;
  border-radius: 4px;
}

.dialogue-en .w-token.speaking {
  color: #ffe39b;
  background: transparent;
  text-shadow: 0 0 12px rgba(255, 220, 120, 0.7), 0 1px 4px rgba(12, 20, 22, 0.9);
}

.dialogue-en .w-vocab {
  cursor: pointer;
  color: #ffe6a8;
  font-weight: 600;
  border-bottom: 1.5px dashed rgba(255, 230, 168, 0.72);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.dialogue-en .w-vocab:hover {
  color: #fff6db;
  border-bottom-color: #fff6db;
  background: rgba(255, 230, 168, 0.16);
}

.dialogue-cn {
  font-family: var(--font-sans) !important;
  font-size: 12.5px !important;
  line-height: 1.42 !important;
  color: rgba(250, 244, 230, 0.9);
  text-shadow: 0 1px 4px rgba(12, 20, 22, 0.85), 0 2px 12px rgba(12, 20, 22, 0.6);
  -webkit-text-size-adjust: 100% !important;
}

.dialogue-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  margin-top: 3px;
}

.soft-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(246, 238, 220, 0.28);
  background: rgba(25, 41, 43, 0.42);
  backdrop-filter: blur(8px);
  color: #f6eedc;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s var(--ease-gentle);
}

.soft-action-btn:hover {
  background: rgba(25, 41, 43, 0.68);
  border-color: rgba(246, 238, 220, 0.55);
}

.primary-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 220, 0.48);
  background: rgba(235, 208, 158, 0.88);
  backdrop-filter: blur(8px);
  color: #1c3032;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(15, 26, 28, 0.22);
  transition: all 0.22s var(--ease-gentle);
}

.primary-action-btn:hover {
  transform: translateY(-1px);
  background: rgba(246, 224, 180, 0.96);
  box-shadow: 0 5px 14px rgba(15, 26, 28, 0.3);
}

/* ==========================================================================
   Word Tap Popover Card
   ========================================================================== */
.word-popover {
  position: absolute;
  z-index: 30;
  width: min(300px, 86vw);
  padding: 15px 18px;
  border-radius: 16px;
  background: rgba(246, 238, 220, 0.96);
  color: var(--deep-pine-dark);
  border: 1px solid rgba(112, 96, 73, 0.28);
  box-shadow: 0 18px 42px rgba(15, 26, 28, 0.42);
  transition: opacity 0.25s var(--ease-gentle), transform 0.25s var(--ease-gentle);
}

.wp-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.wp-word {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--deep-pine);
}

.wp-pos {
  font-size: 12px;
  color: var(--bark);
  font-style: italic;
}

.wp-speak {
  margin-left: auto;
  border: none;
  background: rgba(89, 141, 159, 0.16);
  border-radius: 999px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 13px;
}

.wp-cn {
  font-size: 14px;
  font-weight: 600;
  color: #463a2a;
  margin-bottom: 6px;
}

.wp-example {
  font-family: var(--font-serif);
  font-size: 13px;
  line-height: 1.45;
  color: #5e503d;
  border-top: 1px dashed rgba(112, 96, 73, 0.24);
  padding-top: 7px;
}

/* ==========================================================================
   Word Collected Toast
   ========================================================================== */
.word-toast {
  position: absolute;
  top: 72px;
  right: 26px;
  z-index: 25;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(246, 238, 220, 0.94);
  color: var(--deep-pine-dark);
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 26px rgba(15, 26, 28, 0.32);
  transition: opacity 0.4s var(--ease-gentle), transform 0.4s var(--ease-gentle);
}

.wt-spark {
  color: #c5912e;
}

/* ==========================================================================
   Opening Title Veil & Chapter Complete Card
   ========================================================================== */
.title-veil, .ending-veil {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: radial-gradient(circle at 50% 45%, rgba(25, 41, 43, 0.36), rgba(18, 30, 32, 0.72));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  transition: opacity 0.8s var(--ease-gentle), visibility 0.8s;
}

.title-content {
  text-align: center;
  max-width: 620px;
}

.title-kicker {
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--warm-sand);
  opacity: 0.88;
  margin-bottom: 14px;
}

.title-main {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.9vw, 34px);
  font-weight: 500;
  color: #fdf8ec;
  letter-spacing: 0.03em;
  white-space: nowrap;
  text-shadow: 0 6px 28px rgba(12, 22, 24, 0.55);
  margin-bottom: 8px;
}

.title-sub-cn {
  font-size: 15px;
  color: var(--warm-sand);
  letter-spacing: 0.14em;
  margin-bottom: 20px;
}

.title-desc {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.7;
  letter-spacing: 0.015em;
  color: rgba(246, 238, 220, 0.86);
  margin-bottom: 32px;
  text-shadow: 0 2px 14px rgba(12, 22, 24, 0.5);
}

.start-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 15px 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 246, 225, 0.65);
  background: linear-gradient(135deg, #ecd3a6, #d7b476);
  color: #1c2f31;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 38px rgba(12, 22, 24, 0.45), 0 0 28px rgba(233, 210, 166, 0.25);
  transition: all 0.35s var(--ease-gentle);
}

.start-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 46px rgba(12, 22, 24, 0.55), 0 0 36px rgba(233, 210, 166, 0.4);
}

.start-btn-cn {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  opacity: 0.78;
  border-left: 1px solid rgba(28, 47, 49, 0.26);
  padding-left: 11px;
}

/* Ending Card */
.ending-card {
  width: min(92vw, 540px);
  padding: 38px 34px;
  border-radius: 26px;
  background: rgba(246, 238, 220, 0.96);
  color: var(--deep-pine-dark);
  text-align: center;
  box-shadow: 0 24px 64px rgba(10, 19, 21, 0.52);
  border: 1px solid rgba(233, 210, 166, 0.7);
}

.ending-kicker {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--mist-blue);
  font-weight: 700;
  margin-bottom: 10px;
}

.ending-title {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--deep-pine);
  margin-bottom: 8px;
}

.ending-cn {
  font-size: 15px;
  color: var(--bark);
  margin-bottom: 24px;
}

.ending-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 26px;
}

.stat-item {
  padding: 14px;
  border-radius: 16px;
  background: rgba(89, 141, 159, 0.1);
  border: 1px solid rgba(89, 141, 159, 0.18);
}

.stat-val {
  display: block;
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--deep-pine);
}

.stat-lbl {
  font-size: 12px;
  color: var(--bark);
}

.ending-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ending-btn-primary, .ending-btn-secondary {
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s var(--ease-gentle);
}

.ending-btn-primary {
  border: none;
  background: var(--deep-pine);
  color: var(--parchment);
}

.ending-btn-primary:hover {
  background: #1f3335;
}

.ending-btn-secondary {
  border: 1px solid rgba(42, 64, 66, 0.28);
  background: transparent;
  color: var(--deep-pine);
}

.ending-btn-secondary:hover {
  background: rgba(42, 64, 66, 0.08);
}

/* ==========================================================================
   Word Journal Drawer (Parchment Sticker Book)
   ========================================================================== */
.journal-modal {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  justify-content: flex-end;
  transition: opacity 0.35s var(--ease-gentle), visibility 0.35s;
}

.journal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 28, 30, 0.56);
  backdrop-filter: blur(4px);
}

.journal-sheet {
  position: relative;
  z-index: 2;
  width: min(460px, 94vw);
  height: 100%;
  background: var(--parchment);
  color: var(--deep-pine-dark);
  padding: 28px 24px;
  overflow-y: auto;
  box-shadow: -16px 0 48px rgba(10, 19, 21, 0.42);
  border-left: 1px solid rgba(112, 96, 73, 0.22);
}

.journal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 6px;
}

.journal-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--mist-blue);
  font-weight: 700;
}

.journal-title {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--deep-pine);
}

.journal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(42, 64, 66, 0.2);
  background: transparent;
  color: var(--deep-pine);
  font-size: 15px;
  cursor: pointer;
}

.journal-close:hover {
  background: rgba(42, 64, 66, 0.08);
}

.journal-sub {
  font-size: 13px;
  color: var(--bark);
  margin-bottom: 20px;
}

.journal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.j-card {
  padding: 14px;
  border-radius: 16px;
  background: #fffaf0;
  border: 1px solid rgba(112, 96, 73, 0.2);
  text-align: left;
  cursor: pointer;
  transition: all 0.25s var(--ease-gentle);
}

.j-card:hover:not(.locked) {
  transform: translateY(-2px);
  border-color: var(--mist-blue);
  box-shadow: 0 8px 20px rgba(42, 64, 66, 0.12);
}

.j-card.locked {
  background: rgba(112, 96, 73, 0.06);
  border-style: dashed;
  opacity: 0.52;
  cursor: default;
}

.j-word {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--deep-pine);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.j-cn {
  font-size: 13px;
  color: var(--bark);
  margin-top: 3px;
}

.j-ex {
  font-family: var(--font-serif);
  font-size: 12px;
  line-height: 1.4;
  color: #6b5c47;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px dashed rgba(112, 96, 73, 0.18);
}

/* ==========================================================================
   Responsive Adjustments (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 720px) {
  .hud {
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 6px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .hud-left, .hud-right {
    gap: 5px;
    flex-wrap: wrap;
  }
  .chapter-pill {
    padding: 5px 10px;
    font-size: 11px;
    gap: 5px;
  }
  .chapter-title, .chapter-sep {
    display: none;
  }
  .hud-btn, .hud-pill-static {
    height: 30px;
    min-width: 30px;
    padding: 0 8px !important;
    font-size: 11px !important;
  }
  .icon-svg {
    width: 14px;
    height: 14px;
  }
  .act-dots {
    display: none;
  }
  .explore-hint {
    top: calc(78px + env(safe-area-inset-top, 0px));
    padding: 7px 14px;
    font-size: 12px;
    width: 92vw;
    max-width: 92vw;
    border-radius: 16px;
    flex-direction: column;
    gap: 2px;
  }
  .hint-dot {
    display: none;
  }
  .hint-en {
    font-size: 12.5px;
    line-height: 1.3;
  }
  .hint-cn {
    font-size: 11px;
    line-height: 1.3;
    border-left: none;
    padding-left: 0;
  }
  .dialogue-band {
    padding: 10px 14px calc(22px + env(safe-area-inset-bottom, 0px));
  }
  .dialogue-inner {
    gap: 4px;
  }
  .speaker-tag {
    padding: 2px 9px;
    font-size: 11px;
  }
  .mood-note {
    font-size: 11px;
  }
  .dialogue-en {
    font-size: 15.5px !important;
    line-height: 1.44 !important;
  }
  .dialogue-cn {
    font-size: 12.5px;
    line-height: 1.38;
  }
  .dialogue-actions {
    margin-top: 6px;
    gap: 6px;
  }
  .soft-action-btn, .next-btn {
    padding: 7px 12px;
    font-size: 12.5px;
  }
  .choice-layer {
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  }
  .choice-list {
    gap: 8px;
  }
  .choice-bubble {
    padding: 10px 14px;
  }
  .choice-en {
    font-size: 14.5px;
    line-height: 1.38;
  }
  .choice-cn {
    font-size: 11.5px;
  }
  .world-bubble {
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    padding: 9px 14px;
  }
  .inventory-pill {
    left: 12px;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    padding: 7px 12px 7px 9px;
  }
  .journal-grid {
    grid-template-columns: 1fr;
  }
}
