/* ==========================================================================
   Star Letter — Base responsive
   Mobile/short-screen rules and reduced-motion rules for the base styles.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .side-rail { display: none; }
}

/* Keep the floating sound control off the letter's text column on narrow screens. */
@media (max-width: 900px) {
  body[data-scene="dawn"] .music-toggle {
    top: calc(env(safe-area-inset-top) + 14px);
    bottom: auto;
    right: calc(env(safe-area-inset-right) + 14px);
  }
}

@media (max-width: 720px) {
  .prologue-foot .foot-dot,
  .prologue-foot .foot-alt { display: none; }
  .prologue-foot { max-width: calc(100vw - 100px); }

  .chapter { top: clamp(80px, 11.5vh, 108px); }

  .masthead { gap: 8px; }
  .masthead__rule { width: 16px; }
  .masthead__label { gap: 8px; }
  .masthead__label .lat { letter-spacing: 0.28em; font-size: 8.5px; }
  .masthead__label .cn { letter-spacing: 0.24em; font-size: 9.5px; }

  .moon-wrap {
    top: clamp(78px, 11vh, 100px);
    right: 18px;
    width: clamp(76px, 21vw, 104px);
  }

  .scene--prologue { padding-top: clamp(104px, 15vh, 140px); }

  .heart-copy { margin-top: clamp(108px, 15.5vh, 150px); }

  .letter {
    width: calc(100vw - 28px);
    padding: 34px 24px 38px;
  }

  .letter__mark { width: min(210px, 74%); margin-bottom: 26px; }

  .dawn-wrap { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 560px) {
  .question-title { font-size: clamp(38px, 11vw, 52px); line-height: 1.24; }
  .question-title span:last-child { letter-spacing: 0.08em; }

  .question-actions { gap: 14px; margin-top: clamp(26px, 4.6vh, 38px); }
  .btn-primary {
    min-width: 146px;
    height: 52px;
    padding: 0 20px;
    font-size: 14.5px;
    letter-spacing: 0.16em;
  }
  .dodge-slot { width: 146px; height: 52px; }
  .btn-secondary {
    font-size: 13px;
    letter-spacing: 0.08em;
    padding: 0 8px;
  }

  .heart-title { letter-spacing: 0.07em; }
  .heart-sub { letter-spacing: 0.42em; padding-left: 0.42em; }

  .masthead__label .lat { letter-spacing: 0.22em; }

  .dawn-title { letter-spacing: 0.04em; }
  .dawn-sub { letter-spacing: 0.12em; padding-left: 0.12em; }

  .letter__sign { font-size: 17px; }

  .btn-dawn { padding: 10px 18px; font-size: 12px; letter-spacing: 0.12em; }
}

@media (max-width: 380px) {
  .poem-line { font-size: 21px; }
  .question-title { font-size: 37px; }
  .btn-primary { min-width: 140px; }
  .dodge-slot { width: 138px; }
}

@media (max-width: 340px) {
  .masthead__label .cn { display: none; }
  .masthead__label .mid { display: none; }
}

@media (max-height: 660px) and (min-width: 561px) {
  .chapter { display: none; }
  .heart-copy { margin-top: 92px; }
  .poem-line { font-size: clamp(20px, 4.5vh, 34px); line-height: 1.7; }
  .question-title { font-size: clamp(32px, 6.2vh, 54px); }
  .question-actions { margin-top: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    scroll-behavior: auto !important;
    transition-duration: 0.15s !important;
  }
  .moon-wrap, .nebula, .aurora__ribbon, .heart-glow, .question-halo,
  .question-title, .heart-sub, .btn-primary, .music-bars i {
    animation: none !important;
  }
  .poem-line.is-past { opacity: 0.4; }
}
