/* box-sizing via inherit, not directly: XRExtras injects `* { box-sizing:
   inherit }` at runtime AFTER this sheet, which beat a plain `* { border-box }`
   (same specificity, later origin) and silently reverted the whole app to
   content-box. Setting it on html (element selector outranks their universal)
   and inheriting down survives their injection. */
html { box-sizing: border-box; }
* { margin: 0; padding: 0; box-sizing: inherit; }

/* Palette (mockup: "Field Lens" — void-dark forest, antique gold, aged parchment)
   void #070c11 · night #0e151c · gold #d9a441 · gold-bright #ecc878
   bronze #6b5327 · parchment #e6d6ae · ink #1d3a2f · rust #c86b3c */

html, body {
  height: 100%;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, #0e1720 0%, #070c11 70%);
  font-family: Georgia, 'Times New Roman', serif;
  -webkit-user-select: none;
  user-select: none;
}

#camerafeed {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

#hud-title {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 16px);
  /* inset past the ledger chip (ends at 132px at base sizes) so the boxes
     can never touch — the overlap checker enforces this */
  left: 136px;
  right: 136px;
  text-align: center;
  color: #f2e8d0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  z-index: 10;
}

#hud-title .title {
  font-size: 15px;
  letter-spacing: 4px; /* 5px wraps inside the 120px insets on sub-430px screens */
  font-weight: bold;
  white-space: nowrap;
  color: #ecc878;
  text-shadow: 0 0 14px rgba(217, 164, 65, 0.55), 0 2px 8px rgba(0, 0, 0, 0.9);
}

#hud-title .subtitle {
  font-size: 9px;
  letter-spacing: 4px;
  color: #d9a441;
  margin-top: 3px;
  opacity: 0.9;
}
#hud-title .subtitle::before { content: '✦  '; font-size: 7px; color: #8a6d33; }
#hud-title .subtitle::after { content: '  ✦'; font-size: 7px; color: #8a6d33; }

#hud-status {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 84px); /* clears the nav bar */
  left: 50%;
  transform: translateX(-50%);
  max-width: 86vw;
  padding: 10px 22px;
  border-radius: 18px;
  font-size: 15px;
  font-style: italic;
  text-align: center;
  line-height: 1.4;
  color: #e6d6ae;
  background: rgba(10, 16, 22, 0.86);
  border: 1px solid rgba(217, 164, 65, 0.45);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6), inset 0 0 18px rgba(217, 164, 65, 0.06);
  pointer-events: none;
  z-index: 10;
  transition: background 0.4s, border-color 0.4s;
}

/* two lines max (on the inner span, so nothing leaks into the pill padding) */
#hud-status .status-text {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

#hud-status.found {
  background: rgba(43, 30, 8, 0.9);
  border-color: #ecc878;
  color: #f4e4bc;
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 6px rgba(217, 164, 65, 0.35); }
  50% { box-shadow: 0 0 22px rgba(217, 164, 65, 0.85); }
}

/* ==========================================================================
   UI layer (journal, ledger, modals, mini-games) — palette matches the
   poster: cream #f2e8d0, ink #1d3a2f, rust #c86b3c, gold #d9a441.
   ========================================================================== */

#ui-root { position: fixed; inset: 0; pointer-events: none; z-index: 20; }
#ui-root > * { pointer-events: auto; }

/* --- HUD chips ---------------------------------------------------------- */

.hud-chip {
  position: fixed;
  padding: 12px 16px; /* ≥44px total height — touch-target guideline */
  border-radius: 999px;
  font-family: Georgia, serif;
  font-size: 13px;
  color: #e8c87a;
  background: rgba(10, 16, 22, 0.88);
  border: 1px solid rgba(217, 164, 65, 0.5);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55), inset 0 0 12px rgba(217, 164, 65, 0.07);
  cursor: pointer;
}

#ledger-chip {
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  letter-spacing: 1px;
  /* never plow through the centered title (worst case: full ledger + held
     keyword). Fixed px, not vw — the title is centered, so a chip that GROWS
     with viewport width closes the gap instead of opening it. */
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* --- bottom navigation (mockup 02) --------------------------------------- */

#bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  padding: 6px 10px calc(env(safe-area-inset-bottom, 0px) + 8px);
  background: rgba(10, 11, 15, 0.94);
  border-top: 1px solid rgba(217, 164, 65, 0.25);
  z-index: 30;
}
.nav-btn {
  flex: 1; max-width: 150px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 0 5px;
  background: none; border: none; cursor: pointer;
  font-family: Georgia, serif;
  color: #7d7460;
}
.nav-btn .nav-ico { font-size: 19px; line-height: 1; }
.nav-btn .nav-label { font-size: 9px; letter-spacing: 3px; }
.nav-btn:active { color: #ecc878; }
#hint-btn { color: #b9945a; }

/* small/standard phones: shrink the title and hard-cap the ledger chip so
   the top row never collides (measured at 320px: chip ends 104px, title
   text starts 110px; wider screens only gain clearance) */
@media (max-width: 429px) {
  #hud-title { left: 106px; right: 106px; }
  #hud-title .title { font-size: 11px; letter-spacing: 1.5px; }
  #hud-title .subtitle { font-size: 8px; letter-spacing: 2px; }
  .hud-chip { padding: 13px 12px; font-size: 12px; } /* keeps ~44px touch height */
  #ledger-chip { max-width: 92px; }
}

/* mini-chips: small secondary status row under the ledger (keyword, sync) */
.mini-chip {
  padding: 5px 10px !important;
  font-size: 10px !important;
  letter-spacing: 1px;
}
#keyword-chip {
  top: calc(env(safe-area-inset-top, 0px) + 60px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  font-style: italic;
  color: #ecc878;
}
.sync-chip {
  /* below the keyword slot; healthy state auto-hides so this is rare */
  top: calc(env(safe-area-inset-top, 0px) + 92px);
  left: calc(env(safe-area-inset-left, 0px) + 12px);
  cursor: default;
  transition: background 0.4s, border-color 0.4s, color 0.4s;
}
.sync-chip.sync-connecting { color: #a8945e; }
.sync-chip.sync-synced { color: #9fd9a4; }
.sync-chip.sync-offline { color: #b8b0a0; }
.sync-chip.sync-error { color: #e8b45a; border-color: rgba(217, 164, 65, 0.7); }

/* --- toast ---------------------------------------------------------------- */

#toast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 126px);
  left: 50%;
  transform: translateX(-50%) translateY(-12px);
  max-width: 84vw;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 14px;
  text-align: center;
  color: #f4e4bc;
  background: rgba(20, 15, 5, 0.94);
  border: 1px solid #d9a441;
  box-shadow: 0 0 22px rgba(217, 164, 65, 0.25), 0 6px 20px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.35s, transform 0.35s;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* --- modals ---------------------------------------------------------------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px 18px calc(env(safe-area-inset-bottom, 0px) + 88px);
  /* deep vignette — the room falls away, the page remains */
  background: radial-gradient(ellipse at 50% 38%, rgba(9, 15, 22, 0.72) 0%, rgba(3, 6, 10, 0.94) 100%);
  animation: fadein 0.3s ease;
}

@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  position: relative;
  width: min(480px, 94vw);
  max-height: 84vh;
  overflow-y: auto;
  padding: 28px 22px 22px;
  border-radius: 20px;
  /* modern dark sheet: charcoal card, gold hairline, soft lantern halo */
  background: linear-gradient(175deg, #17181d 0%, #101116 100%);
  color: #d8cfb8;
  border: 1px solid rgba(217, 164, 65, 0.32);
  box-shadow:
    0 0 30px rgba(217, 164, 65, 0.08),
    0 24px 60px rgba(0, 0, 0, 0.8);
  font-family: Georgia, serif;
}

.modal-title {
  font-size: 22px; font-weight: bold; text-align: center;
  letter-spacing: 2px;
  color: #f0e6cc;
  text-shadow: 0 0 18px rgba(217, 164, 65, 0.25);
}
.modal-subtitle {
  font-size: 12px; font-style: italic; text-align: center;
  color: #b9945a; margin-top: 5px; letter-spacing: 3px;
}
.modal-subtitle::before { content: '— '; color: #8a7a4e; }
.modal-subtitle::after { content: ' —'; color: #8a7a4e; }
.modal-close {
  /* ✕ glyph stays visually in the corner; padding grows the hit area to ~44px */
  position: absolute; top: 0; right: 0;
  padding: 13px 15px;
  border: none; background: none; font-size: 18px; color: #8a7a4e; cursor: pointer;
}
.modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

.btn {
  padding: 12px 24px;
  border-radius: 12px;
  font-family: Georgia, serif;
  font-size: 14px;
  letter-spacing: 1.5px;
  color: #cfc6ae;
  background: none;
  border: 1px solid rgba(217, 164, 65, 0.45);
  cursor: pointer;
}
.btn.primary {
  /* filled-gold CTA (mockup "START JOURNEY" / "VIEW IN JOURNAL") */
  color: #241c10;
  font-weight: bold;
  background: linear-gradient(180deg, #e6c078 0%, #c9973f 100%);
  border: none;
  box-shadow: 0 4px 20px rgba(217, 164, 65, 0.35);
}
.btn:disabled { opacity: 0.4; cursor: default; }

.shake { animation: shakex 0.45s ease; }
@keyframes shakex {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

/* --- story cards ------------------------------------------------------------ */

.story-body { margin-top: 16px; text-align: center; }
.story-line { font-size: 16px; line-height: 1.6; margin: 8px 0; color: #d8cfb8; }
.story-gap { height: 10px; }
.story-accent {
  color: #ecc878; font-weight: bold; font-size: 20px; margin: 8px 0;
  letter-spacing: 3px;
  text-shadow: 0 0 16px rgba(217, 164, 65, 0.55);
}
.story-sub { font-size: 13px; font-style: italic; color: #a8945e; margin-top: 12px; text-align: center; }

/* --- in-modal media (PLAN.md section 4 Phase A) ------------------------------ */

.story-audio { width: 100%; margin-bottom: 12px; }
.story-video { width: 100%; border-radius: 10px; margin-bottom: 12px; }

/* --- journal ------------------------------------------------------------------ */

.journal-tabs { display: flex; gap: 8px; margin-top: 16px; }
.journal-tab {
  flex: 1; padding: 10px 0;
  font-family: Georgia, serif; font-size: 11px; letter-spacing: 2.5px;
  text-align: center;
  color: #8a7a4e;
  background: none;
  border: 1px solid rgba(217, 164, 65, 0.25);
  border-radius: 10px;
  cursor: pointer;
}
.journal-tab.active {
  color: #241c10; font-weight: bold;
  background: linear-gradient(180deg, #e6c078, #c9973f);
  border-color: transparent;
}
.journal-count {
  margin-top: 12px; text-align: center;
  font-size: 11px; letter-spacing: 2.5px; color: #8a7a4e;
}

.journal-list { margin-top: 12px; display: flex; flex-direction: column; gap: 9px; }
.journal-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 10px 12px;
  border: 1px solid rgba(217, 164, 65, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  font-family: Georgia, serif;
  text-align: left;
  cursor: pointer;
}
.journal-row.locked { opacity: 0.4; cursor: default; }
.journal-row.done { border-color: rgba(217, 164, 65, 0.55); background: rgba(217, 164, 65, 0.07); }
.journal-row.active {
  border-color: rgba(232, 200, 120, 0.8);
  box-shadow: 0 0 12px rgba(217, 164, 65, 0.25);
}
.journal-mark { width: 22px; text-align: center; color: #c9a45c; }
.journal-row.done .journal-mark { color: #ecc878; text-shadow: 0 0 8px rgba(217, 164, 65, 0.6); }
.journal-thumb {
  width: 46px; height: 46px; flex: none;
  border-radius: 10px; object-fit: cover;
  border: 1px solid rgba(217, 164, 65, 0.3);
}
.journal-thumb-locked {
  width: 46px; height: 46px; flex: none;
  border-radius: 10px;
  border: 1px solid rgba(217, 164, 65, 0.15);
  background: rgba(255, 255, 255, 0.03);
  display: flex; align-items: center; justify-content: center;
  color: #5a5140; font-size: 15px;
}
.journal-label { display: flex; flex-direction: column; min-width: 0; }
.journal-jump {
  margin-left: auto; flex: none;
  padding: 8px 10px;
  font-size: 10px; letter-spacing: 1.5px;
  color: #9fe8b8;
  border: 1px dashed rgba(159, 232, 184, 0.5);
  border-radius: 8px;
  cursor: pointer;
}
.journal-chap { font-size: 10px; letter-spacing: 3px; color: #8a7a4e; }
.journal-title { font-size: 15px; font-weight: bold; color: #ecdfc2; letter-spacing: 0.5px; }
.journal-sub { font-size: 12px; font-style: italic; color: #9a8c6a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* --- hints ---------------------------------------------------------------------- */

.hint-body { margin-top: 14px; }
.hint-line { font-size: 15px; font-style: italic; line-height: 1.5; margin: 10px 0; color: #9a8c6a; }
.hint-line.latest { color: #ecdfc2; font-weight: bold; }

/* --- keypad ---------------------------------------------------------------------- */

.keypad { margin-top: 16px; text-align: center; }
.keypad-display {
  font-size: 34px; letter-spacing: 6px; font-weight: bold;
  padding: 10px; margin-bottom: 14px;
  color: #ecdfc2;
  border-bottom: 2px solid rgba(217, 164, 65, 0.6);
  min-height: 56px;
}
.keypad-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.keypad-key {
  padding: 14px 0; font-size: 22px; font-family: Georgia, serif;
  border: 1px solid rgba(217, 164, 65, 0.3); border-radius: 12px;
  background: rgba(255, 255, 255, 0.04); color: #ecdfc2; cursor: pointer;
}
.keypad-key:active { background: rgba(217, 164, 65, 0.18); }

/* --- keyword input ------------------------------------------------------------------ */

.keyword-body { margin-top: 14px; text-align: center; }
.keyword-input {
  width: 100%; margin-top: 12px; padding: 12px;
  font-family: Georgia, serif; font-size: 22px; letter-spacing: 4px;
  text-align: center; text-transform: uppercase;
  color: #ecdfc2; background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(217, 164, 65, 0.4); border-radius: 12px;
}
.keyword-input::placeholder { color: #5a5140; }

/* --- Ch.3 checklist -------------------------------------------------------------------- */

.checklist { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.check-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; text-align: left;
  border: 1px solid rgba(217, 164, 65, 0.22); border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  font-family: Georgia, serif; cursor: pointer;
}
.check-row.picked {
  border-color: rgba(232, 200, 120, 0.8); background: rgba(217, 164, 65, 0.1);
  box-shadow: 0 0 10px rgba(217, 164, 65, 0.2);
}
.check-mark { color: #ecc878; font-size: 18px; width: 20px; }
.check-label { display: flex; flex-direction: column; }
.check-name { font-size: 15px; font-weight: bold; color: #ecdfc2; }
.check-sketch { font-size: 12px; font-style: italic; color: #9a8c6a; }
.check-confirm { margin-top: 8px; }

/* --- cipher key -------------------------------------------------------------------------- */

.cipher-body { margin-top: 14px; text-align: center; }
.cipher-canvas { width: 100%; height: auto; border-radius: 8px; }

/* --- diary --------------------------------------------------------------------------------- */

.diary-body { margin-top: 14px; text-align: center; }
.diary-line { font-style: italic; }
.diary-digit {
  font-size: 64px; font-weight: bold; color: #ecc878;
  margin: 14px 0 4px; text-shadow: 0 0 24px rgba(217, 164, 65, 0.6);
}

/* --- constellation game (simulated night) --------------------------------------------------- */

.sky-overlay { position: fixed; inset: 0; background: #060c1c; touch-action: none; }
.sky-overlay canvas { position: absolute; inset: 0; }
.sky-caption {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 30px);
  left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-family: Georgia, serif; font-style: italic; font-size: 15px;
  color: #d9a441; text-shadow: 0 2px 10px #000;
}

/* --- finale ------------------------------------------------------------------------------------ */

.finale-overlay { position: fixed; inset: 0; background: radial-gradient(ellipse at center, #16283a 0%, #060c14 75%); overflow: hidden; }
.finale-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.finale-key {
  width: 130px;
  height: 130px;
  filter: drop-shadow(0 0 26px #d9a441);
  animation: keyrise 2.6s ease forwards;
}
.finale-key svg { width: 100%; height: 100%; }
.finale-key.settle { animation: keyfloat 3.5s ease-in-out infinite; }
@keyframes keyrise {
  from { transform: translateY(46vh) scale(0.4) rotate(-30deg); opacity: 0; }
  to { transform: translateY(0) scale(1) rotate(0); opacity: 1; }
}
@keyframes keyfloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
.finale-ember {
  position: absolute; bottom: -12px;
  width: 5px; height: 5px; border-radius: 50%;
  background: #ffcf6e; box-shadow: 0 0 8px #ffcf6e;
  animation: emberrise linear infinite;
}
@keyframes emberrise {
  from { transform: translateY(0); opacity: 0.9; }
  to { transform: translateY(-105vh); opacity: 0; }
}
.finale-story { margin-top: 26px; text-align: center; max-width: 480px; }
.finale-line { color: #f2e8d0; opacity: 0; animation: fadein 1.2s ease forwards; }
.finale-btn { opacity: 0; animation: fadein 1.2s ease forwards; margin-top: 18px; }

/* --- certificate ---------------------------------------------------------------------------------- */

.cert-body { margin-top: 14px; text-align: center; }
.cert-canvas { width: 100%; height: auto; margin-top: 12px; border: 1px solid rgba(217, 164, 65, 0.35); border-radius: 10px; }
.cert-download { display: inline-block; margin-top: 12px; text-decoration: none; }

/* --- scan reticle (ambient "lens" frame over the live camera) ------------------------------------- */

#scan-reticle {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5; /* above camera feed, below HUD (10) and UI (20) */
}
body.dev #scan-reticle { display: none; }

#scan-reticle i {
  position: absolute;
  width: 34px; height: 34px;
  border: 2px solid rgba(217, 164, 65, 0.75);
  filter: drop-shadow(0 0 6px rgba(217, 164, 65, 0.5));
}
#scan-reticle .tl { top: 16vh; left: 9vw;  border-right: none; border-bottom: none; }
#scan-reticle .tr { top: 16vh; right: 9vw; border-left: none;  border-bottom: none; }
#scan-reticle .bl { bottom: 22vh; left: 9vw;  border-right: none; border-top: none; }
#scan-reticle .br { bottom: 22vh; right: 9vw; border-left: none;  border-top: none; }
#scan-reticle .scan-cue {
  position: absolute;
  /* anchored just under the sigil ring — never in the status pill's zone */
  top: calc(50% + min(23vw, 23vh) + 14px);
  left: 50%; transform: translateX(-50%);
  white-space: nowrap;
  font-family: Georgia, serif; font-style: italic; font-size: 12px;
  letter-spacing: 1.5px;
  color: rgba(228, 182, 90, 0.85);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

/* sigil ring, breathing slowly at the center of the lens */
#scan-reticle b {
  position: absolute;
  top: 50%; left: 50%;
  width: min(46vw, 46vh); height: min(46vw, 46vh);
  margin: calc(min(46vw, 46vh) / -2) 0 0 calc(min(46vw, 46vh) / -2);
  border: 1px solid rgba(217, 164, 65, 0.35);
  border-radius: 50%;
  box-shadow: inset 0 0 24px rgba(217, 164, 65, 0.12), 0 0 18px rgba(217, 164, 65, 0.1);
  animation: sigilbreathe 4.5s ease-in-out infinite;
}
#scan-reticle b::before {
  content: '';
  position: absolute; inset: 10px;
  border: 1px dashed rgba(217, 164, 65, 0.22);
  border-radius: 50%;
}
@keyframes sigilbreathe {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.04); opacity: 1; }
}

/* --- dev panel -------------------------------------------------------------------------------------- */

#dev-panel {
  position: fixed;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 158px);
  left: 14px;
  display: flex; flex-direction: column; gap: 6px;
  max-width: 46vw;
  max-height: 38vh;
  overflow-y: auto;
}
#dev-panel .dev-btn {
  padding: 7px 10px; font-size: 12px; font-family: monospace;
  color: #9fe8b8; background: rgba(10, 24, 18, 0.88);
  border: 1px dashed rgba(159, 232, 184, 0.6); border-radius: 7px;
  cursor: pointer; text-align: left;
}
#dev-panel .dev-title { font-size: 10px; font-family: monospace; color: #9fe8b8; opacity: 0.7; }

/* --- reduced motion --------------------------------------------------------------------------------- */

/* wrong-answer feedback without the shake: a brief warning flash */
@keyframes wrongflash {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(184, 60, 40, 0.28); }
}

@media (prefers-reduced-motion: reduce) {
  /* decorative loops off (glow pulses, breathing sigil, floating key) */
  #hud-status.found, #scan-reticle b, .finale-key, .finale-key.settle { animation: none; }
  /* rising embers are pure decoration — remove rather than freeze mid-air */
  .finale-ember { display: none; }
  /* these normally start at opacity 0 and fade in via animation-forwards —
     with the animation removed they must be forced visible */
  .finale-line, .finale-btn { animation: none; opacity: 1; }
  /* shake becomes a color flash — "wrong answer" feedback must survive */
  .shake { animation: wrongflash 0.5s ease; }
  /* opacity-only fades (modal fadein, toast) are kept: not motion */
}

/* --- landscape phones -------------------------------------------------------------------------------- */

@media (orientation: landscape) and (max-height: 480px) {
  /* fill what the overlay's padding (18 top + ~88 bottom for the nav) leaves */
  .modal-card { max-height: calc(100vh - 106px); padding: 16px 20px 14px; }
  #hud-title { top: calc(env(safe-area-inset-top, 0px) + 8px); }
}
