/* The map page (index.html): layout, map, card, setup and the bedtime screen. */
* { box-sizing: border-box }
:root { color-scheme: light; font-family: "Trebuchet MS", system-ui, sans-serif; color: #163c45; background: #f7f5ec; --paper: #fffef9; --ink: #163c45; --muted: #577575; --line: #dbe6dd; --soft: #edf3ec; --accent: #247c6c; --shadow: #dfe6db; --rail: clamp(300px, 28vw, 390px); --edge: 26px }
html, body { margin: 0; height: 100%; overflow: hidden }
body { background: radial-gradient(ellipse at 90% 0%, #e9efdf88, transparent 50%), #f7f5ec; transition: background .4s, color .4s }
body.night { --paper: #1c303d; --ink: #e5eee9; --muted: #aec2c2; --line: #334c57; --soft: #263f49; --accent: #94d5be; --shadow: #101f2b; background: #132530; color: var(--ink); color-scheme: dark }
button, a { -webkit-tap-highlight-color: transparent }
button { font: inherit; cursor: pointer }
button, a { touch-action: manipulation }
button:disabled { opacity: .45; cursor: default }
button:focus-visible, a:focus-visible { outline: 3px solid #df9b33; outline-offset: 4px }
button { transition: background .15s, transform .15s, box-shadow .15s }
button:active:not(:disabled) { transform: translateY(2px) }
.icon { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle }
.eyebrow { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted) }
#heading { position: fixed; top: 25px; left: var(--edge); display: flex; align-items: center; gap: 13px }
.brand-mark { display: block; width: 54px; height: 54px; border-radius: 16px; box-shadow: 0 3px 10px #163c4526; transform: rotate(-5deg) }
#heading h1 { font-size: clamp(24px, 2.5vw, 37px); font-weight: 800; letter-spacing: -.055em; margin: 4px 0 0; line-height: 1.1 }
#heading .brand { font-size: 10px; font-weight: 800; letter-spacing: .15em; color: var(--accent) }
#sky { position: fixed; inset: 119px auto 104px var(--edge); width: calc(100vw - var(--rail) - 3 * var(--edge)); height: calc(100dvh - 223px); border-radius: 30px; box-shadow: 0 0 0 1px #163c4512, 0 8px 0 var(--shadow); touch-action: none; cursor: grab }
#sky.dragging { cursor: grabbing }
#map-caption { position: fixed; top: 136px; left: calc(var(--edge) + 18px); display: flex; align-items: center; gap: 10px; max-width: min(420px, calc(100vw - var(--rail) - 3 * var(--edge) - 90px)); min-height: 44px; padding: 8px 10px 8px 12px; border: 1px solid #ffffff80; border-radius: 14px; background: #fffef9eb; color: #345b59; text-align: left; box-shadow: 0 3px 0 #163c4514 }
#map-caption:hover { border-color: var(--accent) }
#map-caption > .icon { width: 18px; height: 18px; color: #247c6c }
#map-caption .place-text { display: grid; gap: 2px; min-width: 0 }
#map-caption #place { font-size: 12px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
#map-caption #place-detail { font-size: 11px; font-weight: 600; color: #577575; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
#map-caption #place-detail:empty { display: none }
#map-caption .edit { flex: 0 0 auto; margin-left: 4px; padding: 5px 9px; border-radius: 9px; background: #e3efe8; color: #1f6b5d; font-size: 11px; font-weight: 800 }
#setup-current { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--soft); font-size: 13px }
#setup-current[hidden] { display: none } #setup-current .icon { color: var(--accent) } #setup-current small { display: block; font-size: 11px; color: var(--muted) }
#map-status { position: fixed; top: 194px; left: calc(var(--edge) + 20px); font-size: 11px; padding: 6px 10px; border-radius: 9px; background: #fffef9eb; color: #456b69; pointer-events: none }
#map-status:empty { display: none }
#top { position: fixed; top: 31px; right: calc(var(--rail) + 2 * var(--edge)); display: flex; align-items: center; gap: 9px; padding: 10px 15px; border-radius: 18px; background: var(--paper); border: 1px solid var(--line) }
#top > .icon { color: var(--accent) } #count { font-size: 28px; font-weight: 800 } #top small { font-size: 11px; line-height: 1.4; max-width: 66px; color: var(--muted) }
#actions { position: fixed; top: 32px; right: var(--edge); display: flex; gap: 8px }
#actions button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; min-width: 44px; border: 1px solid var(--line); padding: 10px 12px; color: var(--ink); background: var(--paper); border-radius: 14px; font-size: 12px; font-weight: 700 }
#actions .icon { width: 18px; height: 18px }
#help { display: grid; place-items: center; min-width: 44px; min-height: 44px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--accent); font-size: 18px; font-weight: 900; text-decoration: none }
#help:hover { border-color: var(--accent) }
#lang { min-height: 44px; border: 1px solid var(--line); padding: 0 10px; color: var(--ink); background: var(--paper); border-radius: 14px; font: inherit; font-size: 12px; font-weight: 800; cursor: pointer }
#sound[aria-pressed=true] { background: var(--soft); color: var(--accent) }
#actions #sound[hidden] { display: none }
#actions button:hover { border-color: var(--accent) }
#setup { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: #163c4566; backdrop-filter: blur(3px); overflow-y: auto }
#setup[hidden] { display: none }
#setup-card { position: relative; width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; display: grid; gap: 12px; padding: 26px; border-radius: 28px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 0 var(--shadow) }
.setup-art { height: 96px; display: grid; place-items: center; border-radius: 20px; background: radial-gradient(ellipse, #d9ede080, transparent 70%) } .setup-art svg { width: 120px; height: 96px }
#setup-card h2 { font-size: 27px; line-height: 1.15; letter-spacing: -.04em; margin: 0 } #setup-card p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--muted) }
#setup-card .or { font-size: 12px; font-weight: 700; color: var(--muted); margin-top: 4px }
.search-row { display: flex; gap: 8px } .search-row input { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font: inherit; font-size: 15px }
.search-row button { min-height: 46px; padding: 0 16px; border: 0; border-radius: 14px; background: var(--soft); color: var(--accent); font-weight: 800; border: 1px solid var(--line) }
#results { display: grid; gap: 6px } #results:empty { display: none }
#results button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px; text-align: left; border: 1px solid var(--line); border-radius: 14px; background: transparent; color: var(--ink) }
#results button:hover { border-color: var(--accent); background: var(--soft) } #results b { font-size: 14px } #results small { display: block; font-size: 11px; color: var(--muted) } #results .code { margin-left: auto; font-size: 11px; font-weight: 800; color: var(--accent); background: var(--soft); padding: 3px 7px; border-radius: 7px }
#setup-status:empty { display: none }
#character { border: 0; padding: 12px 0 0; margin: 0; border-top: 1px dashed var(--line); display: grid; gap: 10px } #character legend { padding: 12px 0 0; font-size: 12px; font-weight: 800; color: var(--muted); float: left; width: 100% }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px }
.choices button { display: grid; justify-items: center; gap: 4px; padding: 8px 4px 10px; border: 2px solid var(--line); border-radius: 16px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700 }
.choices button[aria-checked=true] { border-color: var(--accent); background: var(--soft) } .choices canvas { position: static; width: 64px; height: 76px; box-shadow: none; border-radius: 0 }
.name-row { display: grid; gap: 2px; padding-top: 6px; font-size: 12px; font-weight: 800; color: var(--muted) } .name-row small { font-weight: 600 }
#kid-name { width: 100%; box-sizing: border-box; padding: 10px 14px; border: 2px solid var(--line); border-radius: 14px; background: var(--soft); color: var(--ink); font: inherit; font-size: 16px; font-weight: 800 }
.pet-row { display: grid; gap: 8px } .pet-title { font-size: 12px; font-weight: 800; color: var(--muted) }
.pets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px } .pets button { display: grid; justify-items: center; gap: 2px; padding: 6px 4px 8px; border: 2px solid var(--line); border-radius: 16px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700 }
.homes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px } .homes button { display: grid; justify-items: center; gap: 2px; padding: 6px 2px 8px; border: 2px solid var(--line); border-radius: 16px; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; min-height: 48px }
.homes button[aria-checked=true] { border-color: var(--accent); background: var(--soft) } .homes canvas { position: static; width: 64px; height: 48px; box-shadow: none; border-radius: 0 }
.pets button[aria-checked=true] { border-color: var(--accent); background: var(--soft) } .pets canvas { position: static; width: 64px; height: 48px; box-shadow: none; border-radius: 0 }
.tones { display: flex; gap: 8px; justify-content: center } .tones button { width: 32px; height: 32px; border-radius: 50%; border: 3px solid transparent; box-shadow: 0 0 0 1px var(--line) } .tones button[aria-checked=true] { border-color: var(--accent) }
#setup-card .privacy { font-size: 11px }
.install[hidden] { display: none } .install { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 14px; background: var(--soft) } .install > div { flex: 1; min-width: 0 } .install b { display: block; font-size: 13px } .install small { display: block; font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px } .install .primary-button { flex: 0 0 auto } .install .primary-button[hidden] { display: none }
.support[hidden] { display: none } .support { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12px; color: var(--muted) } .support .donate { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #e8543f; color: #fff; font-weight: 800; text-decoration: none } .support .donate[hidden], .support .mail[hidden] { display: none } .support .mail { color: var(--accent) } .support small { flex-basis: 100%; font-size: 11px; line-height: 1.4 }
#grownups { border: 0; padding: 12px 0 0; margin: 0; border-top: 1px dashed var(--line); display: grid; gap: 10px } #grownups legend { padding: 12px 0 0; font-size: 12px; font-weight: 800; color: var(--muted); float: left; width: 100% }
.switch-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer } .switch-row input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: #247c6c; flex: 0 0 auto } .switch-row b { display: block; font-size: 13px } .switch-row small { display: block; font-size: 11px; color: var(--muted); line-height: 1.4 }
.times { display: flex; flex-wrap: wrap; gap: 10px; padding-left: 32px; font-size: 12px; color: var(--muted) } .times input { min-height: 36px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); color: var(--ink); font: inherit }
#actions button.holding, #map-caption.holding { background: var(--soft) !important; box-shadow: inset 0 -4px 0 var(--accent) }
#sleep { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 24px; text-align: center; background: radial-gradient(ellipse at 50% 30%, #1d3557ee, #0b1626f5); color: #e5edf7 }
#sleep[hidden] { display: none }
#moment { position: fixed; z-index: 6; top: auto; bottom: 124px; left: calc(var(--edge) + (100vw - var(--rail) - 3 * var(--edge)) / 2); transform: translate(-50%, 12px); width: max-content; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 18px; background: #fffef9; color: #163c45; font-weight: 800; font-size: 16px; box-shadow: 0 6px 0 #163c4522, 0 10px 30px #163c4522; opacity: 0; pointer-events: none; transition: opacity .3s, transform .3s; max-width: calc(100vw - var(--rail) - 4 * var(--edge)) }
#moment.show { opacity: 1; transform: translate(-50%, 0) } #moment .em { font-size: 28px }
#airport-pick { position: fixed; z-index: 7; bottom: 120px; left: calc(var(--edge) + (100vw - var(--rail) - 3 * var(--edge)) / 2); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 12px 12px 12px 14px; max-width: calc(100vw - 32px); border-radius: 20px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 6px 0 var(--shadow), 0 10px 30px #163c4522 }
#storm-info { position: fixed; z-index: 7; bottom: 120px; left: calc(var(--edge) + (100vw - var(--rail) - 3 * var(--edge)) / 2); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; width: min(520px, calc(100vw - 32px)); border-radius: 20px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 6px 0 var(--shadow), 0 10px 30px #163c4522 }
#storm-info[hidden] { display: none } #storm-info .code { font-size: 38px } #storm-info > div { flex: 1; min-width: 0; display: grid; gap: 3px } #storm-info b { font-size: 16px } #storm-info small { font-size: 12px; color: var(--muted); line-height: 1.4 } #storm-info #storm-wind { color: var(--ink); font-weight: 700; font-size: 13px }
#iss-info { position: fixed; z-index: 7; bottom: 120px; left: calc(var(--edge) + (100vw - var(--rail) - 3 * var(--edge)) / 2); transform: translateX(-50%); display: flex; align-items: center; gap: 12px; padding: 14px 12px 14px 16px; width: min(560px, calc(100vw - 32px)); border-radius: 20px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 6px 0 var(--shadow), 0 10px 30px #163c4522 }
#iss-info[hidden], #iss-chip[hidden] { display: none } #iss-info .code { font-size: 38px } #iss-info > div { flex: 1; min-width: 0; display: grid; gap: 3px } #iss-info b { font-size: 16px } #iss-lines { display: grid; gap: 4px } #iss-lines small { font-size: 13px; color: var(--muted); line-height: 1.4 } #iss-lines small:first-child { color: var(--ink); font-weight: 700 }
#iss-chip { position: fixed; z-index: 3; right: calc(var(--rail) + 2 * var(--edge) + 70px); top: 136px; min-height: 44px; padding: 8px 14px; border: 2px solid #8a5cc2; border-radius: 22px; background: #fffef9f2; color: #4b2f73; font: 800 14px Nunito, system-ui, sans-serif; box-shadow: 0 3px 0 #8a5cc244 }
#iss-chip:hover { background: #f4edfb }
@media (max-width: 760px) { #iss-info { left: 50%; bottom: 130px; flex-wrap: wrap; max-height: calc(100dvh - 300px); overflow-y: auto } #iss-info > div { flex: 1 1 calc(100% - 110px) } #iss-sky { flex: 1 } #iss-chip { top: 246px; left: 23px; right: auto; min-height: 40px; padding: 6px 12px; font-size: 13px } body:has(#airport-open:not([hidden])) #iss-chip { top: 300px } body.card-open #iss-chip, body.sleeping #iss-chip { display: none } }
@media (min-width: 761px) and (max-width: 1150px) { #iss-chip { top: 200px; right: calc(var(--rail) + 2 * var(--edge) + 14px) } }
body.projecting #iss-chip { top: 32px; right: 110px; left: auto }
#storm-close { width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 11px; background: var(--soft); color: var(--muted); display: grid; place-items: center; align-self: flex-start }
@media (max-width: 760px) { #storm-info { left: 50%; bottom: 130px; flex-wrap: wrap } }
#airport-pick[hidden] { display: none } #airport-pick .code { font-size: 22px; font-weight: 900; color: #e8543f } #airport-pick b { display: block; font-size: 14px } #airport-pick small { display: block; font-size: 11px; color: var(--muted) } #airport-pick #pick-wx { font-size: 13px; color: var(--ink); font-weight: 700; margin-top: 3px } #airport-pick #pick-wx:empty { display: none } #airport-pick > div { min-width: 0 }
#airport-pick .primary-button { white-space: nowrap } #pick-cancel { width: 38px; height: 38px; flex: 0 0 auto; border: 0; border-radius: 11px; background: var(--soft); color: var(--muted); display: grid; place-items: center }
@media (max-width: 760px) {
  #airport-pick { left: 50%; bottom: 130px; flex-wrap: wrap; width: calc(100vw - 24px); max-width: 500px }
  /* The code, the name and ✕ on one line; the big button underneath, as wide as the card */
  #airport-pick > .code { order: -3 } #airport-pick > div:first-of-type { order: -2; flex: 1; min-width: 0 } #pick-cancel { order: -1 }
  #pick-go { order: 2; width: 100%; min-height: 48px }
}
#book-panel { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 16px; background: #163c4566; backdrop-filter: blur(3px) }
#book-panel[hidden] { display: none }
#book-panel section { width: min(640px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 24px; border-radius: 28px; background: var(--paper); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 8px 0 var(--shadow) }
#book-panel header { display: flex; align-items: center; justify-content: space-between; gap: 12px } #book-panel h2 { margin: 0; font-size: 26px; letter-spacing: -.03em } #book-panel h3 { margin: 18px 0 10px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted) }
#book-close { width: 40px; height: 40px; border: 0; border-radius: 12px; background: var(--soft); color: var(--muted); display: grid; place-items: center }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 10px }
.sticker { display: grid; justify-items: center; gap: 6px; padding: 12px 8px; border-radius: 18px; background: var(--soft); text-align: center; transform: rotate(var(--tilt, 0deg)); box-shadow: 0 3px 0 var(--shadow) }
.sticker img { width: 46px; height: 46px; object-fit: contain; background: #fff; border-radius: 12px; padding: 5px } .sticker .flag { font-size: 40px; line-height: 1.1 } .sticker .type { font-size: 20px; font-weight: 900; color: var(--accent) }
.sticker b { font-size: 13px; line-height: 1.25; overflow-wrap: anywhere } .sticker small { font-size: 12px; color: var(--muted) }
.book-empty { margin: 16px 0 0; color: var(--muted) }
.sticker .kind-big { font-size: 40px; line-height: 1.1 } .sticker.missing { background: transparent; border: 2px dashed var(--line); box-shadow: none; cursor: default } .sticker.missing .kind-big { filter: grayscale(1) brightness(0); opacity: .18 } body.night .sticker.missing .kind-big { filter: grayscale(1) brightness(0) invert(1) } .sticker.missing b { color: var(--muted) }
.flag-img { display: inline-block; height: 1em; width: auto; vertical-align: -.12em; border-radius: 3px; box-shadow: 0 0 0 1px #0000001a } .sticker .flag .flag-img { height: 34px; margin: 3px 0 }
#setup-card[data-step=place] .step-who, #setup-card[data-step=who] .step-place { display: none !important } #setup-card[data-step=who] #character > legend { display: none } #setup-card[data-step=who] #character { border-top: 0; padding-top: 0 }
.setup-nav { display: flex; gap: 8px; justify-content: space-between; align-items: center } .setup-nav[hidden] { display: none } .setup-nav .link-button { min-height: 44px; border: 0; background: none; color: var(--accent); font-weight: 800; font-size: 13px; padding: 0 4px } .setup-nav .primary-button { margin-left: auto; padding-inline: 22px }
.plane-stage .kind-art { font-size: 64px; line-height: 1 }
.plane-stage img.photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.plane-stage .credit { position: absolute; right: 8px; bottom: 6px; padding: 2px 6px; border-radius: 6px; background: #000000a0; color: #fff; font-size: 9px; text-decoration: none }
@media (max-width: 760px) { #moment { top: calc(136px + var(--skyh, 300px) - 64px); bottom: auto; left: 50%; font-size: 13px; padding: 9px 14px; max-width: calc(100vw - 40px) } #moment .em { font-size: 22px } body.card-open #moment { top: 196px } #actions .label { display: none } } #sleep .moon { font-size: 84px; line-height: 1 } #sleep h2 { font-size: clamp(26px, 4vw, 40px); margin: 18px 0 8px; letter-spacing: -.03em } #sleep p { margin: 0; color: #b8c7da; font-size: 16px }
@media (prefers-reduced-motion: no-preference) { #sleep .moon { animation: drift 6s ease-in-out infinite } @keyframes drift { 50% { transform: translateY(-8px) rotate(-6deg) } } }
#setup-close[hidden] { display: none }
#setup-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; border: 0; border-radius: 11px; background: var(--soft); color: var(--muted); display: grid; place-items: center }
#weather { position: fixed; top: 119px; right: var(--edge); width: var(--rail); min-height: 88px; display: flex; align-items: center; gap: 14px; padding: 17px 20px; border-radius: 24px; background: var(--paper); border: 1px solid var(--line) }
#weather .i { font-size: 35px; line-height: 1 } #weather b { font-size: 29px; letter-spacing: -.05em }
#weather .sun-times { grid-column: 1 / -1; font-size: 12px; font-weight: 700; letter-spacing: .01em; white-space: normal; line-height: 1.5 } #weather { flex-wrap: nowrap } #weather .weather-copy { min-width: 0 }
#weather .weather-copy { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; row-gap: 5px; flex: 1 } #weather .weather-copy b { grid-row: 1 / 3 } #weather .weather-copy strong { font-size: 12px; font-weight: 700 } #weather .weather-copy small { grid-column: 2; font-size: 11px; color: var(--muted) }
#weather .clothes { display: grid; justify-items: center; gap: 2px; font-size: 23px; line-height: 1; background: var(--soft); padding: 7px 8px 6px; border-radius: 13px } #weather .clothes small { font-size: 10px; font-weight: 800; color: var(--muted); white-space: nowrap }
#welcome, #card { position: fixed; top: max(224px, calc(136px + var(--wxh, 88px))); right: var(--edge); bottom: 104px; width: var(--rail); border: 1px solid var(--line); border-radius: 26px; background: var(--paper); box-shadow: 0 6px 0 var(--shadow); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #a9c2b5 transparent }
#welcome { display: flex; flex-direction: column; padding: 24px }
.welcome-art { flex: 0 0 auto; position: relative; display: grid; place-items: center; height: 150px; margin: 0 0 17px; border-radius: 20px; background: radial-gradient(ellipse, #d9ede080, transparent 70%); overflow: hidden }
.welcome-art svg { width: 160px; height: 130px }
.welcome-art::after { content: ''; position: absolute; width: 150px; height: 95px; border: 1px dashed #8bbaac; border-radius: 50%; transform: rotate(-22deg) }
#welcome h2 { font-size: 26px; line-height: 1.15; letter-spacing: -.04em; margin: 0 0 9px }
#welcome p { font-size: 14px; line-height: 1.6; color: var(--muted); margin: 0 0 20px }
.primary-button { display: flex; justify-content: center; align-items: center; gap: 10px; border: 0; min-height: 46px; border-radius: 14px; color: #fff; background: #287f6e; font-size: 13px; font-weight: 800; padding: 10px 15px; box-shadow: 0 3px 0 #1d6258 }
.primary-button:hover { background: #206d60 }
#nearby { margin-top: auto; padding-top: 25px }
#nearby > .eyebrow { margin-bottom: 9px; display: block }
.nearby-flight { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 0; border: 0; border-top: 1px solid var(--line); text-align: left; color: var(--ink); background: transparent }
.nearby-flight > .kind { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--soft); font-size: 17px; flex: 0 0 auto }
.nearby-flight > .icon { width: 30px; height: 30px; padding: 5px; border-radius: 9px; background: var(--soft); color: var(--accent) }
.nearby-flight span { flex: 1; display: grid; gap: 3px } .nearby-flight b { font-size: 13px } .nearby-flight small { font-size: 12px; color: var(--muted) } .nearby-flight em { font-size: 12px; color: var(--muted); font-style: normal }
#card { padding: 19px; transition: opacity .2s, transform .2s; opacity: 1 }
#card.hidden { visibility: hidden; opacity: 0; transform: translateY(8px); pointer-events: none }
body.card-open #welcome { visibility: hidden }
.card-kicker { display: flex; align-items: center; justify-content: space-between; margin: 0 0 10px }
.card-kicker .close { width: 32px; height: 32px; min-height: 32px; background: var(--soft); color: var(--muted); border: 0; border-radius: 10px }
.card-kicker .close .icon { width: 16px; height: 16px }
#card header { display: flex; align-items: center; gap: 12px }
#card header img { width: 40px; height: 40px; object-fit: contain; background: #fff; padding: 5px; border-radius: 12px }
#card header > div { flex: 1; min-width: 0 } #card header b { display: block; font-size: 24px; letter-spacing: -.03em } #card header small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
#card .fav { min-width: 44px; height: 44px; border: 0; border-radius: 14px; background: #ffe3ea; font-size: 20px }
.route .city .stamp { display: inline-block; margin-right: 6px; padding: 1px 4px; border: 2px dashed var(--accent); border-radius: 6px; background: #fff; font-size: .85em; transform: rotate(-6deg) }
.sticker { cursor: pointer } .sticker .stamp-big { font-size: 40px; line-height: 1.1 }
@media (prefers-reduced-motion: no-preference) { .sticker.wiggle { animation: wiggle .6s ease } @keyframes wiggle { 0%, 100% { transform: rotate(var(--tilt, 0deg)) scale(1) } 20% { transform: rotate(calc(var(--tilt, 0deg) - 9deg)) scale(1.12) } 45% { transform: rotate(calc(var(--tilt, 0deg) + 9deg)) scale(1.12) } 70% { transform: rotate(calc(var(--tilt, 0deg) - 4deg)) scale(1.04) } } }
.plane-stage { position: relative; display: grid; place-items: center; height: 90px; margin: 13px 0 6px; border-radius: 20px; background: linear-gradient(135deg, #eaf5eb, #dcedeb); overflow: hidden }
.plane-stage::before, .plane-stage::after { content: ''; position: absolute; width: 180px; height: 180px; border: 1px solid #afcfc460; border-radius: 50% }
.plane-stage::after { width: 260px; height: 260px }
.plane-stage svg { width: 150px; height: 95px; transform: rotate(-22deg); filter: drop-shadow(0 6px 3px #35695b22) }
.plane-stage .type-tag { position: absolute; bottom: 12px; left: 12px; padding: 5px 8px; background: #ffffffb8; border-radius: 8px; font-size: 11px; font-weight: 800; color: #35685e }
.plane-stage .distance-tag { position: absolute; right: 12px; top: 12px; font-size: 11px; font-weight: 800; color: #35685e }
.route { display: grid; grid-template-columns: 1fr 32px 1fr; align-items: center; gap: 8px; padding: 12px 4px 14px; border-bottom: 1px dashed var(--line) }
.route-note { grid-column: 1 / -1; margin-top: 2px; text-align: center; font-size: 11px; font-weight: 700; color: var(--muted) }
.route .end { min-width: 0 } .route .end:last-child { text-align: right }
.route .direction { color: var(--muted); font-size: 11px; margin-bottom: 6px }
.route .city { font-weight: 800; font-size: 18px; line-height: 1.2; letter-spacing: -.025em; overflow-wrap: anywhere }
.route .city.long .name { font-size: .82em } .route .city.longer .name { font-size: .7em }
.route .country { color: var(--muted); font-size: 12px; margin-top: 5px; overflow-wrap: anywhere }
.route .arrow { color: var(--accent); display: grid; place-items: center }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px }
.fact { display: grid; grid-template-columns: 27px 1fr; align-items: center; gap: 8px; background: var(--soft); border-radius: 14px; padding: 11px 9px }
.fact .pics { display: grid; place-items: center; color: var(--accent) } .fact .pics .icon { width: 23px; height: 23px }
.fact strong { display: block; font-size: 14px; letter-spacing: -.025em } .fact small { display: block; font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.3 }
.discovery-note { display: flex; align-items: flex-start; gap: 9px; background: #fff4d4; color: #765c29; border-radius: 14px; padding: 12px; margin-top: 13px; font-size: 13px; line-height: 1.5 }
.discovery-note .icon { width: 19px; height: 19px; margin-top: 1px } .discovery-note b { display: block }
.card-next { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 14px 0 0; border: 0; background: none; color: var(--accent); font-weight: 800; font-size: 14px }
#footer { position: fixed; bottom: 26px; left: var(--edge); right: calc(var(--rail) + 2 * var(--edge)); display: flex; align-items: center; gap: 14px }
#feed { display: flex; align-items: center; gap: 7px; border: 0; padding: 0; background: none; color: var(--muted); text-align: left; font-size: 11px; min-height: 44px }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #9baea2; box-shadow: 0 0 0 4px #9baea214; flex: 0 0 auto }
#feed[data-state=live] .status-dot { background: #338769; box-shadow: 0 0 0 4px #33876914 } #feed[data-state=offline] .status-dot { background: #c99235 }
#feed span:last-child { display: grid; gap: 4px } #feed b { font-weight: 800; color: var(--ink); font-size: 12px } #feed small { font-size: 11px }
#tools { display: flex; align-items: center; gap: 4px; padding: 5px; background: var(--paper); border: 1px solid var(--line); border-radius: 18px; margin-left: auto; box-shadow: 0 3px 0 var(--shadow) }
#tools button { display: grid; place-items: center; width: 43px; height: 43px; border: 0; border-radius: 12px; color: var(--ink); background: transparent; font-size: 24px }
#tools button:hover { background: var(--soft) } #tools button[aria-pressed=true] { background: var(--soft); color: var(--accent) } #tools .separator { width: 1px; height: 23px; background: var(--line); margin: 0 2px }
#tools .sizes-button { font: 900 19px Nunito, system-ui, sans-serif }
#size-menu { position: fixed; right: 24px; bottom: 96px; z-index: 30; display: grid; gap: 10px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 6px 0 var(--shadow), 0 12px 30px #12324a22; min-width: 260px }
#size-menu[hidden] { display: none }
#size-menu > b { font-size: 15px }
#size-menu .size-row { display: grid; grid-template-columns: 1fr 48px 52px 48px; align-items: center; gap: 6px; font-weight: 800 }
#size-menu .size-row button { width: 48px; height: 44px; border: 1px solid var(--line); border-radius: 12px; background: var(--soft); color: var(--ink); font: 900 18px Nunito, system-ui, sans-serif }
#size-menu .size-row button:disabled { opacity: .35 }
#size-menu output { text-align: center; font-weight: 900 }
#tour { position: fixed; right: var(--edge); bottom: 35px; width: var(--rail); display: flex; align-items: center; gap: 9px; border: 0; padding: 0 4px; min-height: 44px; background: none; color: var(--ink); font-size: 12px; font-weight: 700; text-align: left }
#tour .toggle { margin-left: auto; width: 34px; height: 20px; border-radius: 12px; padding: 3px; background: #a8b8ad; transition: background .2s }
#tour .toggle::before { content: ''; display: block; width: 14px; height: 14px; border-radius: 50%; background: white; box-shadow: 0 1px 3px #0002; transition: transform .2s }
#tour[aria-pressed=true] .toggle { background: #287f6e } #tour[aria-pressed=true] .toggle::before { transform: translateX(14px) }
#credit a { color: inherit }
.love { display: flex; align-items: center; gap: 6px; margin: 2px 0 0; font-size: 12px; font-weight: 700; color: #c4553f }
.love .heart { color: #e8543f; font-size: 16px; display: inline-block }
@media (prefers-reduced-motion: no-preference) { .love .heart { animation: beat 1.6s ease-in-out infinite } @keyframes beat { 0%, 100% { transform: scale(1) } 15% { transform: scale(1.25) } 30% { transform: scale(1) } 45% { transform: scale(1.18) } } }
.love-note { color: #c4553f; font-weight: 700 } .love-note .heart { color: #e8543f; display: inline-block }
@media (prefers-reduced-motion: no-preference) { .love-note .heart { animation: beat 1.6s ease-in-out infinite } }
@media (max-width: 760px) { .love { font-size: 10px; margin: 0 } }
body.projecting .love { display: none }
#setup-card .privacy a { color: var(--accent) }
#credit { position: fixed; bottom: 12px; right: var(--edge); color: var(--muted); font-size: 9px }
#notice { position: fixed; z-index: 5; bottom: 110px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 40px); width: max-content; background: #183f43; color: #fff; border: 1px solid #ffffff30; padding: 12px 18px; border-radius: 15px; font-size: 13px; box-shadow: 0 8px 24px #0002; opacity: 0; transition: opacity .2s; pointer-events: none }
@media (min-width: 1700px) { :root { --rail: 440px; --edge: 34px } #card, #welcome { padding: 26px } #card header b { font-size: 29px } .plane-stage { height: 150px } .route .city { font-size: 23px } .fact strong { font-size: 18px } .fact small { font-size: 12px } .discovery-note { font-size: 14px } .card-next { font-size: 15px } }
@media (max-width: 1150px) { #top { display: none } #heading h1 { font-size: 28px } .brand-mark { width: 46px; height: 46px } }
/* Tablets held upright and phones on their side: the computer layout with a smaller title, and the sound and
   grown-ups buttons as icons (as on phones), so the buttons at the top never cover the title */
@media (min-width: 761px) and (max-width: 1050px) { #heading h1 { font-size: 24px } #actions { gap: 6px } #actions #sound .label, #actions #back .label { display: none }
  /* "Live sky · 5 planes" goes on one line above the map buttons, and the credits get two lines of their own */
  #sky { bottom: 124px; height: calc(100dvh - 243px) } #welcome, #card { bottom: 124px } #tour { bottom: 49px }
  #footer { bottom: 36px; flex-direction: column; align-items: flex-start; gap: 2px } #feed { min-height: 26px } #feed span:last-child { display: flex; gap: 8px; align-items: center } #feed b, #feed small { display: inline; white-space: nowrap } }
@media (max-height: 790px) and (min-width: 761px) { .plane-stage { height: 80px; margin-block: 12px 5px } .plane-stage svg { height: 85px } #card { padding: 15px } .card-kicker { margin-bottom: 8px } .route { padding-block: 12px } .fact { padding: 9px 8px } .discovery-note { margin-top: 9px; padding: 9px } .welcome-art { height: 90px } .welcome-art svg { height: 90px } #nearby { padding-top: 15px } }
@media (max-width: 760px) {
  :root { --edge: 14px; --rail: calc(100vw - 28px) }
  #heading { top: 19px; gap: 9px } .brand-mark { width: 38px; height: 38px; border-radius: 11px }
  #heading .brand { font-size: 8px; letter-spacing: .12em } #heading h1 { font-size: 23px; margin-top: 3px }
  #actions { top: 79px; right: 14px; gap: 6px } #help { display: none !important } #actions button { padding: 9px 11px; min-height: 40px; min-width: 40px; font-size: 11px; border-radius: 12px }
  #actions .icon { width: 16px; height: 16px } #help { min-width: 40px; min-height: 40px; border-radius: 12px } #lang { min-height: 40px; max-width: 58px; padding: 0 6px; font-size: 11px; border-radius: 12px }
  #weather { top: 77px; right: auto; left: 14px; padding: 8px 10px; min-height: 44px; width: 98px; border-radius: 13px; gap: 7px }
  #weather .i { font-size: 22px } #weather b { font-size: 22px } #weather .weather-copy { flex: 0 } #weather .weather-copy strong, #weather .weather-copy small, #weather .clothes { display: none }
  #sky { top: 136px; height: var(--skyh); width: calc(100vw - 28px); border-radius: 24px }
  :root { --skyh: max(180px, calc(100dvh - 410px)) }
  #map-caption { top: 146px; left: 22px; max-width: calc(100vw - 100px); min-height: 40px; padding: 6px 8px 6px 10px; gap: 8px; border-radius: 11px } #map-caption > .icon { width: 15px; height: 15px } #map-caption #place { font-size: 11px } #map-caption #place-detail { font-size: 10px } #map-caption .edit { font-size: 10px; padding: 4px 7px }
  #map-status { top: 194px; left: 25px; font-size: 10px }
  #welcome, #card { top: auto; bottom: 119px; height: 230px; border-radius: 22px; padding: 14px }
  #card { z-index: 4; box-shadow: 0 -6px 24px #163c4526, 0 6px 0 var(--shadow) }
  #welcome { display: grid; grid-template-columns: 62px 1fr; align-content: center; gap: 6px 12px; height: 140px }
  .welcome-art { grid-row: 1 / 4; height: 70px; margin: 0; align-self: center } .welcome-art svg { width: 62px; height: 64px } .welcome-art::after { width: 56px; height: 40px }
  #welcome h2 { font-size: 18px; margin: 0 } #welcome p { font-size: 12px; line-height: 1.4; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden } #welcome .primary-button { min-height: 40px; font-size: 12px; border-radius: 11px; padding: 8px } #nearby { display: none }
  #card { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; align-content: start }
  .card-kicker { grid-column: 1 / -1; margin: -3px 0 0; height: 20px } .card-kicker .eyebrow { font-size: 10px } .card-kicker .close { width: 32px; height: 32px }
  #card header { grid-column: 1 / -1; gap: 8px } #card header img { width: 29px; height: 29px; padding: 3px; border-radius: 8px } #card header b { font-size: 18px } #card header small { font-size: 11px; margin: 0 }
  .plane-stage, .discovery-note, .card-next { display: none }
  .route { grid-template-columns: 1fr 20px 1fr; gap: 4px; padding: 4px 0; border: 0 } .route .direction { font-size: 10px; margin-bottom: 4px } .route .city { font-size: 14px } .route .country { font-size: 10px; margin-top: 3px } .route .arrow .icon { width: 16px }
  .facts { margin: 0; gap: 5px } .fact { gap: 4px; grid-template-columns: 16px 1fr; padding: 7px 5px; border-radius: 9px } .fact .pics .icon { width: 15px; height: 15px } .fact strong { font-size: 11px; white-space: nowrap } .fact small { font-size: 11px; margin-top: 2px }
  #footer { left: 14px; right: 14px; bottom: 51px; gap: 8px } #feed { max-width: 116px; gap: 7px } #feed b { font-size: 11px } #feed small { font-size: 10px }
  #tools { gap: 0; padding: 4px; border-radius: 15px } #tools button { width: 35px; height: 38px; border-radius: 10px } #tools .icon { width: 19px; height: 19px } #tools .separator { margin: 0 2px }
  #tour { bottom: 4px; left: 14px; width: auto; right: auto; gap: 8px; font-size: 10px } #tour > .icon { width: 16px } #tour .toggle { margin-left: 6px }
  #credit { right: 14px; bottom: 6px; max-width: calc(100vw - 200px); text-align: right; line-height: 1.35; font-size: 10px } #credit .sources { display: none } #notice { bottom: 120px; font-size: 12px }
}
@media (max-width: 370px) { #heading h1 { font-size: 21px } #heading .brand { font-size: 7px } #tools button { width: 31px } #feed { max-width: 85px } #feed small { display: none } #card { gap: 7px } .fact { grid-template-columns: 1fr } .fact .pics { display: none } }
/* Discovery controls remain readable and reachable, including on a small phone. */
.secondary-button, .sheet-toggle { min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--soft); color: var(--accent); padding: 10px 14px; font-weight: 800; font-size: 14px }
#empty-actions { display: grid; gap: 8px } #empty-actions[hidden] { display: none }
#discover[hidden] { display: none }
.sheet-toggle { display: none }
#card header b { font-size: 18px } .route .city { font-size: 22px }
#card .close, #setup-close, #book-close, #pick-cancel, #storm-close, #iss-close { width: 48px; height: 48px; min-height: 48px; flex: 0 0 auto }
.tones button { width: 48px; height: 48px }
#adult-options { border-top: 1px dashed var(--line); padding-top: 8px }
#adult-options summary, #personal-options summary { min-height: 48px; padding: 14px 0; font-size: 14px; font-weight: 800; cursor: pointer }
#personal-options .pet-row { margin-top: 12px }
#grownups { border: 0; padding-top: 0 } #grownups legend { display: none }
#traffic-scope { position: fixed; left: calc(var(--edge) + 20px); top: 225px; max-width: calc(100vw - var(--rail) - 3 * var(--edge) - 40px); padding: 7px 10px; background: #fffef9ed; color: #345b59; border-radius: 10px; font-size: 12px; pointer-events: none }
#traffic-scope:empty { display: none }
#moment.show:has(button) { pointer-events: auto }
body.card-open #moment:not(:has(button)) { display: none }
#moment button { flex: 0 0 auto; min-height: 48px; font-size: 13px }
#book-body .sticker:focus-visible { outline: 3px solid #df9b33; outline-offset: 3px }
#book-body .missions { display: grid; gap: 8px; margin-bottom: 8px }
#book-body .mission { position: relative; display: grid; grid-template-columns: 28px 1fr; gap: 2px 8px; align-items: center; padding: 10px 12px 14px; border: 2px solid #f0c35a; border-radius: 16px; background: #fffaf0; color: #17323a; overflow: hidden }  /* light card, dark words, by day and by night */
#book-body .mission span { grid-row: span 2; font-size: 22px } #book-body .mission b { font-size: 15px } #book-body .mission small { color: #8c5a12; font-weight: 800 }
#book-body .mission i { position: absolute; left: 0; bottom: 0; height: 5px; width: var(--p); background: #f0c35a }
#book-body .mission.done { border-color: #7fc49a; background: #f2fbf4 } #book-body .mission.done i { background: #7fc49a }
#book-body .book-hint { margin: 4px 0 10px; color: var(--muted); font-weight: 700 }
#tools .tool-label { display: none }
@media (max-width: 760px) {
  :root { --skyh: max(140px, calc(100dvh - 290px)) }
  #heading h1 { font-size: 22px } #heading .brand { font-size: 7px }
  #weather { top: 17px; left: auto; right: 14px; width: auto; min-width: 68px; padding: 8px; gap: 4px }
  #weather b { font-size: 20px } #weather .i { font-size: 20px }
  #actions { top: 78px; left: 14px; right: 14px; gap: 6px }
  #actions button, #lang { min-width: 48px; min-height: 48px; padding: 8px; font-size: 13px }
  #actions #book, #actions #back { flex: 1 } #actions .label { display: inline }
  #actions #sound .label { display: none }
  #actions .icon { width: 20px; height: 20px } #lang { max-width: 56px }
  #sky { top: 140px } #map-caption { top: 150px; min-height: 48px; max-width: calc(100vw - 84px) }
  #map-caption #place { font-size: 13px } #map-caption #place-detail, #map-caption .edit { font-size: 11px }
  #map-status { top: 232px; font-size: 11px } #traffic-scope { top: 204px; left: 23px; max-width: calc(100vw - 46px); font-size: 11px }
  #welcome, #card { bottom: 150px; height: auto; max-height: calc(100dvh - 292px); padding: 14px }
  #welcome { display: grid; grid-template-columns: 1fr; gap: 10px; background: var(--paper) }
  #welcome .welcome-art { display: none } #welcome h2 { font-size: 19px }
  #welcome p { display: block; font-size: 14px; line-height: 1.45; overflow: visible }
  #welcome .primary-button { min-height: 48px; font-size: 14px }
  #empty-actions { grid-template-columns: 1fr 1fr; gap: 6px } #empty-actions button { padding: 8px; font-size: 13px }
  #card { display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain }
  #card.expanded { height: min(660px, calc(100dvh - 200px)); max-height: calc(100dvh - 200px) }
  #card .card-kicker { position: sticky; top: -14px; z-index: 2; background: var(--paper); height: auto; min-height: 48px; margin: -6px 0 -10px; flex: 0 0 auto }
  #card .card-kicker .eyebrow { font-size: 11px }
  #card header { min-height: 48px; gap: 8px } #card header b { font-size: 16px } #card header small { font-size: 12px }
  #card .fav { min-width: 48px; height: 48px }
  #card .route { flex: 0 0 auto; padding: 5px 0; grid-template-columns: 1fr 24px 1fr }
  #card .route .city { font-size: 18px } #card .route .direction, #card .route .country { font-size: 12px }
  #card .sheet-toggle { display: block; flex: 0 0 auto; width: 100% }
  #card:not(.expanded) #flight-details, #card:not(.expanded) .card-next { display: none }
  #card.expanded #flight-details { display: block }
  #card.expanded .plane-stage { display: grid; height: 160px; margin: 2px 0 12px }
  #card.expanded .discovery-note { display: flex; font-size: 14px }
  #card.expanded .card-next { display: flex; min-height: 48px; flex: 0 0 auto }
  #card .facts { gap: 8px; margin-top: 10px } #card .fact { padding: 12px 9px; grid-template-columns: 24px 1fr; gap: 8px }
  #card .fact strong { font-size: 16px } #card .fact small { font-size: 13px } #card .fact .pics { display: grid }
  #footer { bottom: 49px; display: flex; flex-direction: column; gap: 5px; align-items: stretch }
  #tools { order: -1; margin: 0; justify-content: space-between; padding: 4px; gap: 0 }
  #tools button { width: 48px; height: 48px; min-width: 48px }
  #tools #sizes { display: none }  /* on phones the sizes are in the grown-ups' options */
  #size-menu { left: 14px; right: 14px; bottom: auto; top: 50%; transform: translateY(-50%) }
  #tools #next { width: auto; flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; background: var(--soft) }
  #tools .tool-label { display: inline; font-size: 12px; font-weight: 800 } #tools .separator { display: none }
  #feed { min-height: 32px; max-width: none; justify-content: center } #feed span:last-child { display: flex; gap: 8px; align-items: center }
  #feed b, #feed small { display: inline; font-size: 11px }
  #tour { bottom: 0; min-height: 48px; font-size: 12px; max-width: calc(100vw - 96px) }
  #credit { bottom: 9px; font-size: 10px; max-width: 82px } #credit .love-note { display: none }
  #moment, body.card-open #moment { top: 202px; bottom: auto; z-index: 8; max-width: calc(100vw - 40px); flex-wrap: wrap; font-size: 14px }
  body:not(.card-open) #moment { top: 306px }  /* under the Sky 360° button (sky/sky.css), never over it */
  #airport-pick, #storm-info { bottom: 150px }
  #setup-card { padding: 22px } #setup-card .setup-art { height: 64px } .setup-art svg { height: 64px }
}
@media (max-width: 350px) {
  #heading h1 { font-size: 18px } #heading .brand { letter-spacing: .02em; font-size: 6px } .brand-mark { width: 32px; height: 32px }
  #actions button { gap: 4px; font-size: 12px } #actions .icon { width: 16px; height: 16px }
  #tools .tool-label { font-size: 11px } #feed small { font-size: 10px }
}
@media (max-width: 760px) and (max-height: 650px) {
  #welcome p { display: none }
  #moment:not(:has(button)) { display: none }
}
body.projecting { background: #0d2028 }
body.projecting #sky { position: fixed; inset: 14px; width: calc(100vw - 28px); height: calc(100dvh - 28px); border-radius: 24px; box-shadow: none }
body.projecting #heading, body.projecting #top, body.projecting #weather, body.projecting #welcome, body.projecting #actions, body.projecting #tour, body.projecting #credit { display: none }
body.projecting #map-caption { position: fixed; top: 32px; left: 32px } body.projecting #map-status { position: fixed; top: 92px; left: 32px }
body.projecting #traffic-scope { top: 122px; left: 32px; max-width: calc(100vw - 64px) }
body.projecting #footer { position: fixed; left: 32px; right: 32px; bottom: 31px; padding: 9px 12px; border-radius: 19px; background: var(--paper); width: max-content; max-width: calc(100vw - 64px); transition: opacity .3s }
body.projecting #tools { box-shadow: none; border: 0 } body.projecting #card { position: fixed; top: auto; bottom: 110px; right: 32px; width: min(340px, calc(100vw - 64px)); max-height: calc(100dvh - 210px); height: auto }
body.projecting #card[data-side=left] { right: auto; left: 32px }
body.projecting .plane-stage:not(:has(img.photo)), body.projecting .discovery-note, body.projecting .card-next { display: none }
body.projecting.idle:not(:focus-within) #footer { opacity: 0; pointer-events: none } body.projecting.idle { cursor: none }
@media (max-width: 760px) {
  body.projecting #footer { left: 14px; right: 14px; width: calc(100vw - 28px); max-width: calc(100vw - 28px); padding: 4px }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important } }


/* The nearest airport, as a button on the map (it opens the small airport card) */
#airport-open { position: fixed; left: calc(var(--edge) + 20px); top: 262px; z-index: 3; min-height: 48px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); color: var(--ink); font-weight: 800; box-shadow: 0 3px 0 var(--shadow) }
#airport-open[hidden], body.card-open #airport-open, body.sleeping #airport-open { display: none }
@media(max-width:760px) { #airport-open { top: 242px; left: 24px } }

/* ---------- Sticker book, phone first: progress, folded missions, tabs, round stickers that turn over, shiny rare ones ---------- */
#book-panel section { padding: 18px 16px 22px }
#book-body .book-progress { display: flex; gap: 8px; margin: 12px 0 10px; font-size: 14px; font-weight: 800 }
#book-body .book-progress span { flex: 1; padding: 9px 10px; border-radius: 14px; background: var(--soft); text-align: center }
#book-body .book-progress b { font-size: 18px }
#book-body .book-missions { margin: 0 0 6px }
#book-body .book-missions summary { list-style: none; cursor: pointer; display: grid; gap: 4px }
#book-body .book-missions summary::-webkit-details-marker { display: none }
#book-body .book-missions .more { justify-self: end; font-size: 12px; font-weight: 800; color: var(--muted) }
#book-body .book-missions .chev { display: inline-block; transition: transform .2s }
#book-body .book-missions[open] .chev { transform: rotate(180deg) }
#book-body .book-missions .missions { margin-top: 8px }
#book-body .book-hint { margin: 6px 0 4px; font-size: 13px }
#book-body .book-tabs { position: sticky; top: -18px; z-index: 2; display: flex; gap: 6px; overflow-x: auto; margin: 4px -16px 0; padding: 8px 16px; background: var(--paper); scrollbar-width: none; scroll-snap-type: x proximity }
#book-body .book-tabs::-webkit-scrollbar { display: none }
#book-body .book-tabs button { flex: none; scroll-snap-align: start; display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 7px 13px; border: 0; border-radius: 999px; background: var(--soft); color: var(--ink); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer }
#book-body .book-tabs button small { color: var(--muted); font-size: 12px; font-weight: 800 }
#book-body .book-tabs button[aria-selected="true"] { background: var(--accent); color: var(--paper) }
#book-body .book-tabs button[aria-selected="true"] small { color: var(--paper); opacity: .85 }
#book-body .book-tabs button:focus-visible { outline: 3px solid #df9b33; outline-offset: 2px }
#book-body .stickers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; padding-top: 10px }
#book-body .stickers > .book-hint { grid-column: 1 / -1 }
#book-body .stickers[hidden] { display: none }
@media (min-width: 480px) { #book-body .stickers { grid-template-columns: repeat(4, minmax(0, 1fr)) } }
@media (min-width: 640px) { #book-body .stickers { grid-template-columns: repeat(5, minmax(0, 1fr)) } }
#book-body .sticker { position: relative; display: block; padding: 0; border: 0; border-radius: 18px; background: none; box-shadow: none; color: inherit; font: inherit; perspective: 700px; -webkit-tap-highlight-color: transparent }
#book-body .sticker .face, #book-body .sticker .back { display: grid; justify-items: center; align-content: start; gap: 5px; text-align: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .45s cubic-bezier(.3, 1.4, .5, 1) }
#book-body .sticker .back { position: absolute; inset: 0 0 auto; min-height: 100%; align-content: center; padding: 8px 6px; border-radius: 18px; background: var(--soft); font-size: 12px; font-weight: 800; line-height: 1.35; transform: rotateY(180deg) }
#book-body .sticker.flipped .face { transform: rotateY(-180deg) }
#book-body .sticker.flipped .back { transform: rotateY(0) }
#book-body .disc { position: relative; display: grid; place-items: center; width: 74px; height: 74px; border-radius: 50%; background: #fff; border: 3px solid #fff; box-shadow: 0 3px 0 #16323a14, 0 8px 16px #16323a24; font-size: 36px; line-height: 1; overflow: hidden; transform: rotate(var(--tilt, 0deg)) }
#book-body .disc img { width: 46px; height: 46px; padding: 0; border-radius: 8px; background: none; object-fit: contain }
#book-body .disc .flag { font-size: 40px; line-height: 1 } #book-body .disc .flag-img { width: 46px; height: auto; border-radius: 4px }
#book-body .disc .type { font-size: 15px; font-weight: 900; letter-spacing: -.02em; color: var(--accent) }
#book-body .sticker b { max-width: 100%; font-size: 12.5px; line-height: 1.2; overflow-wrap: anywhere }
#book-body .sticker em { position: absolute; top: -4px; left: calc(50% + 18px); min-width: 26px; padding: 2px 6px; border-radius: 999px; background: #df9b33; color: #fff; box-shadow: 0 2px 0 #0002; font-style: normal; font-size: 11px; font-weight: 900; line-height: 1.4 }
#book-body .sticker.missing { cursor: default }
#book-body .sticker.missing .disc { background: transparent; border: 2px dashed var(--line); box-shadow: none; transform: none }
#book-body .sticker.missing .disc > * , #book-body .sticker.missing .disc { color: transparent; text-shadow: 0 0 0 #9aa9ad55 }
#book-body .sticker.missing .disc::after { content: '?'; position: absolute; right: 6px; bottom: 2px; color: var(--muted); text-shadow: none; font-size: 18px; font-weight: 900 }
#book-body .sticker.missing b { color: var(--muted); font-weight: 700 }
#book-body .sticker.rare:not(.missing) .disc { border-color: #f4c95d; box-shadow: 0 0 0 3px #f4c95d66, 0 8px 18px #df9b3355 }
#book-body .sticker.rare:not(.missing) b::after { content: ' ✨' }
@media (prefers-reduced-motion: no-preference) {
  #book-body .sticker.rare:not(.missing) .disc::before { content: ''; position: absolute; inset: -30%; background: linear-gradient(115deg, transparent 42%, #ffffffcc 50%, transparent 58%); animation: book-shine 3.2s ease-in-out infinite; pointer-events: none }
  @keyframes book-shine { 0% { transform: translateX(-70%) } 55%, 100% { transform: translateX(70%) } }
  #book-body .sticker:not(.missing):active .disc { transform: rotate(var(--tilt, 0deg)) scale(.94) }
}
@media (max-width: 350px) { #book-body .disc { width: 62px; height: 62px; font-size: 30px } #book-body .disc img { width: 38px; height: 38px } #book-body .book-tabs button { font-size: 13px; padding: 6px 11px } }

/* ---------- Phones: the map first. Title and weather on top, the buttons in a bar at the bottom, within thumb reach ---------- */
#tour .short { display: none }
@media (max-width: 760px) {
  :root { --top: 66px; --tb: calc(env(safe-area-inset-bottom) + 18px + 58px); --skyh: max(200px, calc(100dvh - var(--top) - var(--tb) - 107px)) }
  #heading { top: 12px } #weather { top: 11px }
  #sky { top: var(--top) }
  #map-caption { top: calc(var(--top) + 10px) }
  #traffic-scope { top: calc(var(--top) + 64px) }
  #map-status { top: calc(var(--top) + 92px) }
  #airport-open { top: calc(var(--top) + 102px) }
  #iss-chip { top: calc(var(--top) + 106px) } body:has(#airport-open:not([hidden])) #iss-chip { top: calc(var(--top) + 160px) }
  body #tools #sky-open { top: calc(var(--top) + 100px) }
  #moment, body.card-open #moment { top: calc(var(--top) + 62px) } body:not(.card-open) #moment { top: calc(var(--top) + 166px) }
  /* The bottom bar: Game, Sticker book, Tour, language, sound, place */
  #actions { top: auto; left: 8px; right: 8px; bottom: calc(env(safe-area-inset-bottom) + 18px); z-index: 6; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 6px 20px #16323a26 }
  #actions > button, #actions > #lang { flex: 1 1 0; min-width: 48px; min-height: 50px; padding: 4px 2px; flex-direction: column; gap: 2px; border: 0; border-radius: 14px; background: transparent; box-shadow: none; font-size: 11px; font-weight: 800; line-height: 1.1 }
  #actions > button:active { background: var(--soft) }
  #actions > button { overflow: hidden }
  #actions #book, #actions #back { flex: 1 1 0 }
  #actions .label, #actions #tour .short { display: block; font-size: 11px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
  body #actions #book .label, body #actions #back .label { display: block }
  #actions #sound .label { display: none }
  #actions .icon { width: 22px; height: 22px }
  body #actions > #lang { flex: 0 0 54px; min-width: 0; max-width: 54px; min-height: 48px; align-self: center; padding: 8px 2px 8px 8px; border: 0; border-radius: 14px; background-color: var(--soft); font-size: 13px }
  body #actions > button { min-width: 48px; padding-inline: 1px }
  body #actions > #memory-open, body #actions > #book, body #actions > #tour, body #actions > #sound, body #actions > #back { flex: 1 1 0 }
  #actions #tour { position: static; width: auto; color: var(--ink) }
  #actions #tour [data-t="tour"], #actions #tour .toggle { display: none }
  #actions #tour[aria-pressed=true] { background: var(--accent); color: var(--paper) }
  /* Above the bar: the map's tools and the live status */
  #footer { bottom: calc(var(--tb) + 6px) }
  #welcome, #card { bottom: calc(var(--tb) + 107px); max-height: calc(100dvh - var(--top) - var(--tb) - 117px) }
  #card.expanded { height: min(660px, calc(100dvh - var(--top) - var(--tb) - 117px)); max-height: calc(100dvh - var(--top) - var(--tb) - 117px) }
  #airport-pick, #storm-info { bottom: calc(var(--tb) + 107px) }
  #notice { bottom: calc(var(--tb) + 104px) }
  /* Under the bar, one quiet line: the guide, privacy and the map's credit */
  #credit { left: 14px; right: 14px; bottom: env(safe-area-inset-bottom); max-width: none; text-align: center; font-size: 10px; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
  /* Who is in your sky: smaller cards, so more map shows */
  #welcome #discovery-radar h3 { display: none }
  #welcome .radar-flight { min-height: 70px; padding: 5px 4px }
  #welcome .radar-aircraft, #welcome .radar-aircraft svg { width: 48px; height: 30px }
  #welcome .radar-flight:only-child { min-height: 56px; padding: 6px 12px }
  #welcome .radar-passport { padding-top: 4px }
}
@media (max-width: 760px) and (max-height: 700px) { #welcome .radar-passport, #welcome .radar-flight small { display: none } #welcome .radar-flight { min-height: 58px } }
@media (max-width: 350px) { #actions > button, #actions > #lang { font-size: 10px } #actions .label, #actions #tour .short { font-size: 10px } body #actions > #lang { flex-basis: 48px; max-width: 48px; padding-left: 6px } #actions { gap: 1px; padding: 2px; left: 6px; right: 6px } }

/* ---------- A new sticker flies into the sticker book, which bounces ---------- */
.flying-sticker { position: fixed; left: 0; top: 0; z-index: 40; display: grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: #fff; border: 3px solid #f4c95d; box-shadow: 0 10px 24px #16323a40; font-size: 30px; line-height: 1; pointer-events: none }
.flying-sticker img { width: 38px; height: 38px; object-fit: contain }
@media (prefers-reduced-motion: no-preference) {
  #book.bounce { animation: book-bounce .7s cubic-bezier(.3, 1.6, .5, 1) }
  @keyframes book-bounce { 0% { transform: scale(1) } 30% { transform: scale(1.22) rotate(-7deg) } 60% { transform: scale(.94) rotate(3deg) } 100% { transform: scale(1) } }
}

/* ---------- How much of its journey the open plane has flown ---------- */
#card .trip { grid-column: 1 / -1; display: grid; gap: 5px; margin-top: 8px }
#card .trip .bar { position: relative; height: 10px; border-radius: 999px; background: repeating-linear-gradient(90deg, #cfe3da 0 10px, transparent 10px 16px), var(--soft) }
#card .trip .bar i { position: absolute; inset: 0 auto 0 0; border-radius: 999px; background: linear-gradient(90deg, #f4c95d, #df9b33) }
#card .trip .bar b { position: absolute; top: 50%; transform: translate(-50%, -52%) rotate(45deg); font-size: 18px; line-height: 1; color: #287f6e; text-shadow: 0 0 3px var(--paper), 0 0 6px var(--paper) }
#card .trip small { font-size: 12px; font-weight: 800; color: var(--muted); text-align: center }

/* ---------- "Where is it going?" ---------- */
#card .guess { grid-column: 1 / -1; display: grid; gap: 8px; margin-top: 10px; padding: 10px; border-radius: 16px; background: #fff7e3; border: 2px solid #f4c95d; color: #17323a }
#card .guess b { font-size: 15px; text-align: center }
#card .guess-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px }
#card .guess-option { display: grid; justify-items: center; gap: 4px; min-height: 76px; padding: 8px 4px; border: 0; border-radius: 14px; background: #fff; box-shadow: 0 3px 0 #e8d7a8; color: #17323a; font: inherit; font-size: 12px; font-weight: 800; line-height: 1.2; cursor: pointer }
#card .guess-option .art { font-size: 30px; line-height: 1 } #card .guess-option .art .flag-img { width: 40px; height: auto; border-radius: 4px }
#card .guess-option:active { transform: translateY(2px); box-shadow: 0 1px 0 #e8d7a8 }
#card .guess-option:focus-visible { outline: 3px solid #df9b33; outline-offset: 2px }
#card .guess-result { grid-column: 1 / -1; margin: 8px 0 0; padding: 8px 10px; border-radius: 12px; text-align: center; font-size: 14px; font-weight: 800 }
#card .guess-result.right { background: #e7f6ec; color: #1e6b4a } #card .guess-result.wrong { background: #fff4e0; color: #8c5a12 }
