/* Small tweaks for narrow, short and landscape screens. Everything must fit without scrolling. */

@media (max-width: 599px) {
  .site-shell { padding-inline: 18px; }
  .quiz-card { padding-inline: 18px; }
  .primary-button, .secondary-button { padding-inline: 20px; letter-spacing: .12em; }
}

/* short screens (small phones, browser toolbars): drop the optional bits first */
@media (max-height: 620px) {
  .bouquet-kicker { display: none; }
}

/* Phones held sideways (and any very short screen): compact side-by-side layouts */
@media (max-height: 540px) and (orientation: landscape) {
  .site-shell { --corner: clamp(52px, 24vh, 100px); padding: calc(var(--corner) * .5 + 8px) clamp(48px, 9vw, 96px); }
  .music-control { top: 6px; }
  .float-music { width: 36px; height: 36px; font-size: 1.1rem; }
  /* cover: heading on the left, the rest on the right */
  .screen--welcome { display: grid; grid-template-columns: 1fr 1fr; align-items: center; column-gap: clamp(16px, 4vw, 48px); }
  .cover-art .eyebrow { letter-spacing: .14em; }
  .display-heading { font-size: clamp(1.9rem, min(6vw, 13vh), 4rem); }
  .emblem { width: clamp(36px, 14vh, 60px); }
  .lead { margin-bottom: clamp(6px, 2.4vh, 14px); }
  .quiz-card { padding-block: clamp(8px, 2.6vh, 20px); }
  .answer-list { grid-template-columns: 1fr 1fr; }
  /* end page: the bouquet on the left, her note and "the end" on the right */
  .card-page--end { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: minmax(0, 1fr); align-items: center; column-gap: clamp(16px, 4vw, 40px); }
  .card-page--end .mini-fit { height: 100%; }
}

/* very short landscape screens: the bouquet gets all the height (it still drags, and stops turning by itself) */
@media (max-height: 420px) and (orientation: landscape) {
}

@media (max-height: 340px) and (orientation: landscape) {
  .end-note { font-size: .85rem; line-height: 1.3; }
  .eyebrow { display: none; }
  .cover-art .eyebrow { display: block; }
  .fine-print { display: none; }
  .wish-area { align-items: flex-start; }
}

/* extremely narrow screens (for example a phone zoomed in to 200%) */
@media (max-width: 260px) {
  .page-nav { gap: 4px; }
  .nav-button { padding: 0 8px; letter-spacing: .04em; font-size: .8rem; }
  .page-dot { width: 14px; }
  .site-shell { padding-inline: 12px; }
}

/* landscape phones with no room for the extra bouquets: the end page is just the note */
@media (orientation: landscape) and (max-height: 340px), (orientation: landscape) and (max-height: 400px) and (max-width: 800px) {
  .mini-fit { display: none !important; }
  .card-page--end { grid-template-columns: 1fr; }
}

/* minimal look: no corner flowers, so landscape phones keep more room */
@media (max-height: 540px) and (orientation: landscape) {
  html[data-theme="minimal"] .site-shell { padding: max(10px, env(safe-area-inset-top)) clamp(24px, 6vw, 64px) max(8px, env(safe-area-inset-bottom)); }
  html[data-theme="minimal"] .display-heading { font-size: clamp(1.15rem, min(4.4vw, 9.5vh), 2.4rem); }
  html[data-theme="minimal"] .music-control { top: 6px; }
  html[data-theme="minimal"] .float-music { width: 34px; height: 34px; }
  html[data-theme="minimal"] .volume-panel { height: 34px; }
}
