/* Walk the Land of Answers — WebGL explorer */
:root {
  --ink: #f3efe6; --ink-2: rgba(243, 239, 230, 0.72); --ink-3: rgba(243, 239, 230, 0.5);
  --glass: rgba(14, 16, 22, 0.62); --line: rgba(255, 255, 255, 0.14); --gold: #e3c27a;
  --map: 190px;
  --serif: 'Playfair Display', 'Noto Serif SC', 'Songti SC', serif; --sans: 'Inter', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #07090d; color: var(--ink); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; outline: none; touch-action: none; }
button { font: inherit; color: inherit; cursor: pointer; }
kbd { display: inline-block; min-width: 26px; padding: 3px 7px; margin-right: 4px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; font: 500 12px var(--sans); text-align: center; background: rgba(255, 255, 255, 0.06); }

.start { position: fixed; inset: 0; z-index: 50; display: flex; overflow-y: auto; padding: 16px; background: radial-gradient(120% 90% at 50% 20%, rgba(7, 9, 13, 0.25), rgba(7, 9, 13, 0.86)); backdrop-filter: blur(3px); }
.start-card { width: min(620px, 100%); margin: auto; padding: clamp(22px, 4vw, 40px); border: 1px solid var(--line); border-radius: 18px; background: var(--glass); backdrop-filter: blur(18px); }
.eyebrow { margin: 0 0 10px; font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold); }
.start h1 { margin: 0 0 12px; font: 400 clamp(28px, 5vw, 44px)/1.1 var(--serif); }
.start h1 em { color: var(--gold); }
.lead { margin: 0 0 20px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.keys { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 18px; margin-bottom: 22px; font-size: 13px; color: var(--ink-2); }
.keys span { margin-left: 4px; }
.start-row { display: flex; gap: 10px; align-items: center; }
.primary { padding: 12px 22px; border: 0; border-radius: 999px; background: var(--gold); color: #1a1408; font-weight: 600; font-size: 14px; }
.primary:disabled { opacity: 0.55; cursor: progress; }
.ghost, .chip { padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--glass); backdrop-filter: blur(10px); font-size: 12.5px; }
.chip:hover, .ghost:hover { border-color: var(--gold); }
.bar { height: 3px; margin-top: 18px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--gold); transition: width 0.3s; }
.fine { margin: 8px 0 0; font-size: 11.5px; color: var(--ink-3); min-height: 1.2em; }

.hud-top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.brand { color: var(--ink); text-decoration: none; font: 400 15px var(--serif); padding: 7px 14px; border-radius: 999px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(10px); white-space: nowrap; }
.brand span { color: var(--gold); }
.brand b { font-weight: 400; }
.hud-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.hour { font-size: 12px; letter-spacing: 0.08em; color: var(--ink-2); padding: 0 6px; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7); }

.list { position: fixed; top: 60px; right: 14px; bottom: 14px; z-index: 30; width: min(340px, calc(100vw - 28px)); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); backdrop-filter: blur(18px); }
.list-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; letter-spacing: 0.06em; }
.list-body { overflow-y: auto; padding: 6px 8px 12px; }
.list-realm { margin: 12px 6px 4px; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.list-realm i { width: 7px; height: 7px; border-radius: 50%; }
.list-item { display: flex; gap: 10px; align-items: baseline; width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: none; text-align: left; font-size: 13.5px; }
.list-item:hover { background: rgba(255, 255, 255, 0.08); }
.list-item small { color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 18px; }
.list-item em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.x { width: 30px; height: 30px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.08); font-size: 18px; line-height: 1; }

.card { position: fixed; left: 14px; bottom: 14px; z-index: 20; width: min(400px, calc(100vw - 28px)); padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--glass); backdrop-filter: blur(16px); }
.card-realm { font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; }
.card h2 { margin: 4px 0 4px; font: 400 22px/1.2 var(--serif); }
.card-tag { margin: 0 0 8px; font-size: 13px; color: var(--ink-2); }
.card-q { margin: 0 0 12px; font: italic 400 14.5px/1.5 var(--serif); color: var(--gold); }
.card-row { display: flex; gap: 8px; flex-wrap: wrap; }

.prompt { position: fixed; left: 50%; bottom: 22%; z-index: 20; transform: translateX(-50%); padding: 10px 18px; border-radius: 999px; background: rgba(227, 194, 122, 0.94); color: #1a1408; font-size: 13.5px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4); white-space: nowrap; }
.prompt kbd { border-color: rgba(0, 0, 0, 0.35); background: rgba(0, 0, 0, 0.08); color: inherit; }
.toast { position: fixed; left: 50%; top: 70px; z-index: 40; transform: translateX(-50%); padding: 9px 16px; border-radius: 10px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); font-size: 13px; max-width: calc(100vw - 28px); }
.crosshair { position: fixed; left: 50%; top: 50%; width: 5px; height: 5px; margin: -2.5px; border-radius: 50%; background: rgba(255, 255, 255, 0.75); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35); z-index: 10; pointer-events: none; opacity: 0; }
body.locked .crosshair { opacity: 1; }
.flash { position: fixed; inset: 0; z-index: 45; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash 0.5s ease-out; }
@keyframes flash { 0% { opacity: 0.6; } 100% { opacity: 0; } }
.snap { position: fixed; right: 14px; top: 62px; z-index: 35; width: min(300px, calc(100vw - 28px)); padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--glass); backdrop-filter: blur(14px); color: var(--ink-2); text-decoration: none; font-size: 11.5px; line-height: 1.45; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5); }
.snap:hover { border-color: var(--gold); }
.snap img { display: block; width: 100%; border-radius: 7px; }
.snap span { display: block; margin: 7px 2px 1px; overflow-wrap: anywhere; }

.minimap { position: fixed; right: calc(14px + env(safe-area-inset-right)); bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 15; width: var(--map); height: var(--map); border-radius: 50%; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45); cursor: crosshair; transition: width 0.25s, height 0.25s, border-radius 0.25s; }
.minimap.big { width: min(72vh, 86vw); height: min(72vh, 86vw); max-width: calc(100vw - 28px); border-radius: 16px; z-index: 35; }
.minimap canvas { width: 100%; height: 100%; display: block; }

.pano-ui { position: fixed; inset: 0; z-index: 25; pointer-events: none; }
.pano-ui > * { pointer-events: auto; }
.pano-top { position: absolute; top: 60px; left: 14px; right: 14px; display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; pointer-events: none; }
.pano-top > * { pointer-events: auto; }
.pano-top > div { padding: 12px 16px; border-radius: 14px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); max-width: min(460px, 70vw); }
.pano-top h2 { margin: 3px 0 2px; font: 400 20px var(--serif); }
.pano-top p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.spot { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; border: 0; background: none; padding: 0; }
.spot i { width: 34px; height: 34px; border-radius: 50%; border: 2px solid #fff; background: rgba(227, 194, 122, 0.55); box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.14), 0 6px 20px rgba(0, 0, 0, 0.5); transition: transform 0.15s; }
.spot:hover i { transform: scale(1.18); }
.spot.other i { background: rgba(120, 190, 255, 0.5); width: 26px; height: 26px; }
.spot span { font-size: 11.5px; padding: 3px 9px; border-radius: 999px; background: rgba(10, 12, 16, 0.72); white-space: nowrap; }
.pano-hint { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); font-size: 12px; color: var(--ink-2); padding: 7px 14px; border-radius: 999px; background: var(--glass); white-space: nowrap; }
body.pano .card, body.pano .minimap, body.pano .hint, body.pano #btn-help, body.pano .prompt, body.pano #btn-mode, body.pano #btn-quality, body.pano .hour, body.pano .crosshair { display: none !important; }

.modal { position: fixed; inset: 0; z-index: 60; overflow-y: auto; padding: 5vh 14px; background: rgba(4, 5, 8, 0.72); backdrop-filter: blur(6px); }
.modal-card { position: relative; max-width: 760px; margin: 0 auto; padding: clamp(20px, 4vw, 44px); border-radius: 16px; background: #10131a; border: 1px solid var(--line); }
.modal-card .x { position: absolute; top: 14px; right: 14px; }
.modal-card h1 { font: 400 clamp(26px, 4vw, 36px)/1.15 var(--serif); margin: 6px 0 6px; }
.modal-card h2 { font: 400 20px var(--serif); margin: 28px 0 8px; color: var(--gold); }
.modal-card p, .modal-card li { font-size: 15.5px; line-height: 1.8; color: var(--ink-2); }
.modal-card .qa { display: grid; gap: 10px; margin: 16px 0; padding: 14px 16px; border-left: 2px solid var(--gold); background: rgba(255, 255, 255, 0.04); border-radius: 0 10px 10px 0; }
.modal-card .qa b { display: block; font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }
.modal-card .qa span { font: italic 400 16px/1.5 var(--serif); color: var(--ink); }
.modal-card img { width: 100%; border-radius: 10px; margin: 6px 0 4px; }
.modal-pair { display: grid; grid-template-columns: 1.5fr 1fr; gap: 10px; align-items: start; }

.hud-more { display: contents; }
#btn-more, .card-toggle, .for-touch { display: none; }

/* we ask questions to the world; we find answers from inside */
.motto { margin: 0 0 14px; padding-left: 14px; border-left: 2px solid var(--gold); font: italic 400 16.5px/1.55 var(--serif); color: var(--ink); }
.card-label { margin: 8px 0 2px; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-3); }
.card-q { margin: 0 0 6px; }
.card-a { margin: 0 0 10px; font: 400 14.5px/1.55 var(--serif); color: var(--ink); animation: reveal 0.9s ease both; }
.card-hint { margin: 0 0 12px; font-size: 12px; color: var(--ink-3); }
.pano-top .card-q, .pano-top .card-a { font-size: 14.5px; }
@keyframes reveal { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* the show: a photograph and the resident who keeps it */
.card.at-print { border-color: rgba(232, 201, 138, 0.5); }
.modal-card .cast-photo { max-height: 62vh; width: auto; max-width: 100%; display: block; margin: 12px auto 10px; }
.modal-card .cast-who { color: var(--ink); margin: 4px 0 0; }
.modal-card .creed { font: italic 400 19px/1.5 var(--serif); color: var(--gold); margin: 6px 0 4px; }
.modal-card .voice { margin: 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--line); font: italic 400 16.5px/1.85 var(--serif); color: var(--ink); }
.wish { margin: 14px 0; padding: 12px 16px; border-left: 2px solid var(--line); background: rgba(255, 255, 255, 0.035); border-radius: 0 10px 10px 0; }
.wish.yes { border-left-color: var(--gold); }
.modal-card .wish p { margin: 0 0 6px; }
.modal-card .wish-who { font-size: 12.5px; color: var(--ink-3); letter-spacing: 0.02em; }
.modal-card .wish-who b { color: var(--ink); font-weight: 500; }
.wish .verdict { color: var(--ink-3); } .wish.yes .verdict { color: var(--gold); }
.modal-card .wish-text { color: var(--ink); }
.modal-card .wish-reply { font: italic 400 15.5px/1.7 var(--serif); color: var(--ink-2); margin-bottom: 0; }
.modal-card .wish-reply b { font: 500 10.5px var(--sans, inherit); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-right: 6px; font-style: normal; }
.ba { margin: 14px 0 2px; }
.ba-frame { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 3 / 2; user-select: none; -webkit-user-select: none; }
.modal-card .ba-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; border-radius: 0; pointer-events: none; }
.modal-card .ba-frame .ba-a { clip-path: inset(0 0 0 var(--cut)); }
.ba-line { position: absolute; top: 0; bottom: 0; left: var(--cut); width: 2px; margin-left: -1px; background: var(--gold); pointer-events: none; }
.ba-line::after { content: '‹ ›'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: #14110a; font: 600 15px/38px var(--sans, sans-serif); text-align: center; letter-spacing: 1px; }
.ba-tag { position: absolute; top: 10px; padding: 4px 10px; border-radius: 6px; background: rgba(0, 0, 0, 0.62); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-2); pointer-events: none; }
.ba-tag.l { left: 10px; } .ba-tag.r { right: 10px; color: var(--gold); }
.ba-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.ba-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.ba-row .chip { font-size: 12px; padding: 5px 10px; } .ba-row .chip.on { border-color: var(--gold); color: var(--gold); }
.sibs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 10px; }
.sib { display: grid; gap: 4px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.03); text-align: left; cursor: pointer; }
.sib:hover { background: rgba(255, 255, 255, 0.08); }
.sib img { width: 100%; height: 104px; object-fit: cover; border-radius: 6px; margin: 0; }
.sib b { font: 400 14px/1.3 var(--serif); color: var(--ink); }
.sib span { font-size: 11.5px; line-height: 1.4; color: var(--ink-3); }

/* a tour of the galleries, and the keys whenever they are wanted */
.card-tour { display: flex; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.card-tour .chip { flex: 1; text-align: center; }
.help { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 45; width: min(560px, calc(100vw - 28px)); border: 1px solid var(--line); border-radius: 14px; background: var(--glass); backdrop-filter: blur(18px); }
.help .keys { margin: 14px 16px 4px; }
.help .fine { margin: 6px 16px 14px; }
/* the first keys, in the gap between the card and the map; it wraps rather than run off the window */
.hint { position: fixed; left: 432px; right: 222px; bottom: 18px; width: fit-content; margin: 0 auto; z-index: 18; padding: 8px 18px; border-radius: 18px; background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(12px); font-size: 13px; line-height: 2; text-align: center; color: var(--ink-2); animation: reveal 0.8s ease both; }
.hint span { white-space: nowrap; }
.hint kbd { min-width: 22px; padding: 2px 6px; margin-right: 2px; }
@media (max-width: 900px) { .hint { display: none; } }

/* large windows: everything written on the picture grows with it */
@media (min-width: 1500px) and (min-height: 800px) {
  .hud-top, .card, .list, .help, .hint, .toast, .prompt, .start-card, .pano-top, .pano-hint, .modal-card, .snap { zoom: 1.2; }
  :root { --map: 230px; }
}
@media (min-width: 2300px) and (min-height: 1100px) {
  .hud-top, .card, .list, .help, .hint, .toast, .prompt, .start-card, .pano-top, .pano-hint, .modal-card, .snap { zoom: 1.45; }
  :root { --map: 280px; }
}

/* ── fingers instead of a keyboard: a thumb pad to walk, drag to look, three round buttons ─────────────────────── */
html { -webkit-text-size-adjust: 100%; }
body { overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
button, .chip, .brand, .list-item { touch-action: manipulation; }
body.touch .for-keys, body.touch .hint, body.touch .prompt kbd, body.touch .crosshair { display: none; }
body.touch .keys.for-touch { display: grid; }
body.touch .hud-top, body.touch .card, body.touch .pads, body.touch .minimap, body.touch .prompt { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
body.touch .chip, body.touch .ghost { padding: 10px 14px; font-size: 13px; }
kbd.pad { color: var(--gold); }
.pads { position: fixed; inset: 0; z-index: 22; pointer-events: none; }
.pads > * { pointer-events: auto; }
.stick { position: absolute; bottom: calc(22px + env(safe-area-inset-bottom)); width: 124px; height: 124px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(14, 16, 22, 0.36); backdrop-filter: blur(6px); touch-action: none; }
.stick i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; margin: -27px; border-radius: 50%; background: rgba(243, 239, 230, 0.26); border: 1px solid rgba(255, 255, 255, 0.45); pointer-events: none; }
.stick.on i { background: rgba(227, 194, 122, 0.62); }
.stick.run { border-color: var(--gold); }
.stick.left { left: calc(18px + env(safe-area-inset-left)); }
.stick.right { right: calc(18px + env(safe-area-inset-right)); }
.touch-btns { position: absolute; right: calc(14px + env(safe-area-inset-right)); bottom: calc(158px + env(safe-area-inset-bottom)); display: flex; gap: 8px; }      /* above the right pad */
.touch-btns button { width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.22); background: var(--glass); backdrop-filter: blur(10px); font-size: 14px; touch-action: none; user-select: none; -webkit-user-select: none; }
.touch-btns button:active, .touch-btns button.on { border-color: var(--gold); background: rgba(227, 194, 122, 0.3); }
body.pano .pads { display: none; }
body.touch .card { bottom: calc(160px + env(safe-area-inset-bottom)); }      /* above the thumb pad */
body.touch .prompt { bottom: calc(40px + env(safe-area-inset-bottom)); }      /* between the two pads */
/* the map moves up under the buttons of the top row: the lower corners belong to the thumbs */
body.touch .minimap { top: calc(58px + env(safe-area-inset-top)); bottom: auto; right: calc(12px + env(safe-area-inset-right)); }
body.touch { --map: 150px; }

/* ── a phone, upright or on its side: everything smaller, the card folded at the top ─────────────────────────── */
@media (max-width: 720px), (max-height: 520px) {
  :root, body.touch { --map: 96px; }
  body.touch { --map: 84px; }
  body.touch .card:not(.open) { width: calc(100vw - 32px - var(--map) - env(safe-area-inset-left) - env(safe-area-inset-right)); }
  body.touch .card.open { z-index: 24; }
  .keys { grid-template-columns: 1fr; }
  .modal-pair { grid-template-columns: 1fr; }
  .pano-hint, .hour, .brand b { display: none; }
  .start { padding: 10px; }
  .start-card { padding: 20px 18px; }
  .lead { font-size: 14px; }
  .hud-top { padding: calc(8px + env(safe-area-inset-top)) calc(10px + env(safe-area-inset-right)) 8px calc(10px + env(safe-area-inset-left)); }
  .brand { padding: 7px 11px; }
  .hud-actions { flex-wrap: nowrap; }
  #btn-more { display: inline-block; font-weight: 600; letter-spacing: 0.1em; }
  .hud-more { display: none; position: absolute; top: 100%; right: calc(10px + env(safe-area-inset-right)); flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(14, 16, 22, 0.86); backdrop-filter: blur(16px); }
  .hud-more.open { display: flex; }
  .hud-more .chip { text-align: left; white-space: nowrap; }

  .card, body.touch .card { left: calc(10px + env(safe-area-inset-left)); top: calc(54px + env(safe-area-inset-top)); bottom: auto; width: min(400px, calc(100vw - 20px - env(safe-area-inset-left) - env(safe-area-inset-right))); max-height: calc(100vh - 240px); max-height: calc(100dvh - 240px); overflow-y: auto; padding: 10px 46px 10px 14px; }
  .card h2 { margin: 2px 0; font-size: 18px; }
  .card-toggle { display: block; position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.1); font-size: 17px; line-height: 1; transition: transform 0.2s; }
  .card.open .card-toggle { transform: rotate(180deg); }
  .card.open { padding-bottom: 14px; }
  .card:not(.open) .card-tag, .card:not(.open) .card-label, .card:not(.open) .card-a, .card:not(.open) .card-hint, .card:not(.open) .card-row, .card:not(.open) .card-tour { display: none !important; }
  .card:not(.open) .card-q { margin: 2px 0 0; font-size: 13px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  .list { top: calc(54px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); bottom: calc(10px + env(safe-area-inset-bottom)); }
  .list-item { padding: 10px 8px; }
  .help { top: calc(54px + env(safe-area-inset-top)); max-height: calc(100vh - 70px); max-height: calc(100dvh - 70px); overflow-y: auto; }
  .toast { top: auto; bottom: calc(168px + env(safe-area-inset-bottom)); text-align: center; }
  body.touch .toast { bottom: calc(222px + env(safe-area-inset-bottom)); }
  .prompt, body.touch .prompt { bottom: calc(270px + env(safe-area-inset-bottom)); max-width: calc(100vw - 28px); white-space: normal; text-align: center; }
  .snap { top: calc(54px + env(safe-area-inset-top)); right: calc(10px + env(safe-area-inset-right)); width: min(240px, 60vw); }

  .pano-top { top: calc(54px + env(safe-area-inset-top)); left: calc(10px + env(safe-area-inset-left)); right: calc(10px + env(safe-area-inset-right)); }
  .pano-top > div { max-width: min(460px, 100%); padding: 10px 12px; }
  .pano-top h2 { font-size: 17px; }
  .pano-top > div:not(.open) .card-q, .pano-top > div:not(.open) .card-a { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; }
  .pano-top > div:not(.open) .card-label { margin-top: 5px; }
  #pano-exit { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); white-space: nowrap; box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45); }
  .spot span { font-size: 11px; }

  .modal { padding: calc(10px + env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom)); }
  .modal-card { padding: 18px 16px 22px; }
  .modal-card .x { position: sticky; top: 4px; float: right; margin: -6px -4px 0 10px; z-index: 2; width: 36px; height: 36px; background: #2a2f3a; }
  .modal-card p, .modal-card li { font-size: 15px; line-height: 1.75; }
  .sibs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
/* on its side there is little height: the question waits inside the card, the buttons sit beside the map */
@media (max-height: 520px) {
  .card, body.touch .card { width: min(340px, 44vw); max-height: calc(100vh - 220px); max-height: calc(100dvh - 220px); }
  .card:not(.open) .card-q { display: none; }
  body.touch .card:not(.open) { width: min(340px, 44vw); }
  .touch-btns { bottom: calc(136px + env(safe-area-inset-bottom)); }
  .toast, body.touch .toast { bottom: calc(18px + env(safe-area-inset-bottom)); max-width: calc(100vw - 330px); }
  .prompt, body.touch .prompt { bottom: calc(66px + env(safe-area-inset-bottom)); max-width: calc(100vw - 330px); }
  .start-card { padding: 14px 18px; }
  .start h1 { font-size: 26px; margin-bottom: 8px; }
  .motto { font-size: 14.5px; margin-bottom: 10px; }
  .start .keys { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 16px; margin-bottom: 12px; font-size: 12.5px; }
  .bar { margin-top: 10px; }
  .stick { width: 112px; height: 112px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .start-card .lead { display: none; }
}
/* on a touch screen the map sits in the top corner, so the proof of a snapshot hangs below it, and the menu opens over everything */
body.touch .snap { top: calc(68px + var(--map) + env(safe-area-inset-top)); }
@media (max-width: 720px), (max-height: 520px) { .hud-top { z-index: 28; } }
body.touch .snap { width: 136px; padding: 6px; font-size: 11px; }
body.touch .snap img { max-height: 190px; object-fit: cover; object-position: top; }
