html, body { margin: 0; height: 100%; background: #000; overflow: hidden; color: #fff; overscroll-behavior: none; touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { font-family: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.idle { cursor: none; }

#veil { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #000; transition: opacity 2.4s ease; pointer-events: none; z-index: 5; text-align: center; }
#veil.gone { opacity: 0; }
#veil-title { font-size: clamp(26px, 5vw, 64px); letter-spacing: 0.5em; margin-right: -0.5em; text-transform: uppercase; font-weight: 400; opacity: 0.92; }
#veil-sub { margin-top: 1.6em; padding: 0 24px; font-size: 13px; letter-spacing: 0.35em; text-transform: uppercase; opacity: 0.45; animation: breathe 2.4s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.15; } }

#title { position: fixed; left: calc(clamp(20px, 4vw, 56px) + env(safe-area-inset-left, 0px)); right: 24px; bottom: calc(clamp(24px, 6vh, 64px) + env(safe-area-inset-bottom, 0px)); opacity: 0; transform: translateY(8px); transition: opacity 2s ease, transform 2s ease; pointer-events: none; text-shadow: 0 1px 18px rgba(0,0,0,0.55), 0 0 2px rgba(0,0,0,0.5); z-index: 3; }
#title.show { opacity: 1; transform: none; }
#title-name { font-size: clamp(22px, 3.2vw, 44px); letter-spacing: 0.08em; font-style: italic; }
#title-after { margin-top: 0.35em; font-size: clamp(13px, 1.4vw, 18px); letter-spacing: 0.06em; font-style: italic; opacity: 0.85; }
#title-after:empty { display: none; }
#title-line { margin-top: 0.45em; max-width: 44ch; font: italic 400 clamp(15px, 1.5vw, 19px)/1.35 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: 0.01em; opacity: 0.92; }
#title-line:empty { display: none; }
#title-meta { margin-top: 0.5em; font-size: 11px; letter-spacing: 0.34em; text-transform: uppercase; opacity: 0.7; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }

#hud { position: fixed; right: calc(clamp(12px, 3vw, 40px) + env(safe-area-inset-right, 0px)); bottom: calc(clamp(16px, 4vh, 40px) + env(safe-area-inset-bottom, 0px)); display: flex; gap: 14px; align-items: center; padding: 10px 16px; border-radius: 999px; background: rgba(10, 12, 18, 0.42); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border: 1px solid rgba(255,255,255,0.14); font: 11px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0; pointer-events: none; transition: opacity 0.6s ease; z-index: 4; }
body.active #hud { opacity: 1; pointer-events: auto; }
#hud label, #panel label.slide { display: flex; align-items: center; gap: 8px; opacity: 0.85; white-space: nowrap; }
#hud button { all: unset; cursor: pointer; padding: 6px 7px; border-radius: 8px; opacity: 0.85; display: flex; align-items: center; justify-content: center; }
#hud button:hover, #hud button:focus-visible { opacity: 1; background: rgba(255,255,255,0.12); }
#hud #b-gentle.on { opacity: 1; background: rgba(150,215,255,0.26); }
#hud #b-pilot.on { opacity: 1; background: rgba(255,215,150,0.3); }
body.piloting #view { cursor: crosshair; }
/* the pilot's score (targets.js): shown only while the viewer has the jet */
#score { display: none; position: fixed; top: calc(clamp(12px, 2.4vh, 26px) + env(safe-area-inset-top, 0px)); left: calc(clamp(16px, 3vw, 40px) + env(safe-area-inset-left, 0px)); z-index: 4; pointer-events: none; color: #fff; text-shadow: 0 1px 12px rgba(0,0,0,0.75), 0 0 2px rgba(0,0,0,0.7); font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
body.piloting #score { display: block; }
#score-row { display: flex; align-items: baseline; gap: 12px; }
#score-n { display: inline-block; font-size: clamp(28px, 3.6vw, 46px); font-weight: 700; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; line-height: 1; transform-origin: left center; }
#score-n.bump { animation: score-bump 0.22s ease-out; }
#score-x { font-size: clamp(18px, 2.1vw, 26px); font-weight: 700; color: #ffd34a; }
#shield { display: flex; align-items: center; gap: 9px; margin-top: 8px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }
#shield-t { display: block; width: clamp(120px, 15vw, 200px); height: 8px; border-radius: 4px; background: rgba(8,10,16,0.55); box-shadow: 0 0 0 1px rgba(255,255,255,0.35); overflow: hidden; }
#shield-f { display: block; height: 100%; width: 100%; background: #5fe08a; transition: width 0.18s ease-out, background 0.3s; }
#shield-f.mid { background: #ffd34a; }
#shield-f.low { background: #ff4a3a; }
#rockets { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; }
#rockets > span:first-child { margin-right: 3px; }
#rockets .pip { display: block; width: 30px; height: 7px; border-radius: 3px; background: rgba(8,10,16,0.55); box-shadow: 0 0 0 1px rgba(255,255,255,0.35); overflow: hidden; }
#rockets .pip i { display: block; height: 100%; width: 0; background: #7de8ff; }
.lockon { display: none; position: fixed; z-index: 4; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 2px solid #ff5a3a; transform: rotate(45deg); pointer-events: none; box-shadow: 0 0 10px rgba(255,90,58,0.85), inset 0 0 6px rgba(255,90,58,0.5); }
body.piloting .lockon.on { display: block; animation: lockon 0.6s ease-in-out infinite; }
@keyframes lockon { 0%, 100% { transform: rotate(45deg) scale(1); } 50% { transform: rotate(45deg) scale(1.18); } }
#hurt { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(ellipse at center, rgba(255,40,20,0) 45%, rgba(255,40,20,0.55) 100%); }
#hurt.on { animation: hurt 0.45s ease-out; }
#hurt.good { animation: hurt 0.7s ease-out; background: radial-gradient(ellipse at center, rgba(60,255,130,0) 50%, rgba(60,255,130,0.42) 100%); }
body.piloting.lowhp #hurt:not(.on):not(.good) { animation: lowhp 1.4s ease-in-out infinite; }   /* low on health (pilot.js, _low) */
body.piloting.lowhp2 #hurt:not(.on):not(.good) { animation-duration: 0.7s; }
@keyframes lowhp { 0%, 100% { opacity: 0.1; } 50% { opacity: 0.55; } }
#callout { display: none; position: fixed; top: 15vh; left: 50%; transform: translateX(-50%); z-index: 4; pointer-events: none; opacity: 0; white-space: nowrap; font: 700 clamp(13px, 1.5vw, 18px)/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.28em; text-transform: uppercase; color: #ff7a66; text-shadow: 0 1px 10px rgba(0,0,0,0.85), 0 0 2px rgba(0,0,0,0.8); }
body.piloting #callout { display: block; }
body.freefly #score, body.freefly #guide, body.freefly #callout, body.freefly #hurt, body.freefly .lockon, body.freefly .score-pop { display: none !important; }   /* free flight: no game on the screen */
body.battle #guide { display: none !important; }   /* the fight in free flight: no route to point back to */
.foe-arrow { display: none; position: fixed; z-index: 21; width: 0; height: 0; margin: -9px 0 0 -8px; border-left: 16px solid #ff4a3a; border-top: 9px solid transparent; border-bottom: 9px solid transparent; pointer-events: none; filter: drop-shadow(0 0 5px rgba(255,60,40,0.9)); }
.foe-arrow.goal { margin: -13px 0 0 -12px; border-left: 24px solid #ffd34a; border-top-width: 13px; border-bottom-width: 13px; filter: drop-shadow(0 0 7px rgba(255,210,80,0.95)); }   /* the wave's objective (arena.js) */
.foe-arrow.aid { border-left-color: #35e06a; filter: drop-shadow(0 0 5px rgba(60,255,120,0.9)); }
body.piloting .foe-arrow.on { display: block; }
#crash { display: none; position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%); z-index: 30; max-width: min(760px, 92vw); padding: 10px 14px; border-radius: 10px; background: rgba(20,8,8,0.9); box-shadow: 0 0 0 1px rgba(255,120,100,0.6), 0 8px 30px rgba(0,0,0,0.5); color: #ffe9e4; font: 500 13px/1.45 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; }
#crash.on { display: block; }
#crash button { margin-left: 10px; padding: 4px 10px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.45); background: rgba(255,255,255,0.1); color: inherit; font: inherit; cursor: pointer; }
#guide { display: none; position: fixed; z-index: 4; pointer-events: none; transform: translate(-50%, -50%); text-align: center; opacity: 0; transition: opacity 0.25s; }
body.piloting #guide { display: block; }
#guide.on { opacity: 1; }
#guide-a { display: block; width: 0; height: 0; margin: 0 auto 6px; border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 30px solid #cfe8ff; filter: drop-shadow(0 0 8px rgba(120,190,255,0.9)); animation: guide 0.9s ease-in-out infinite; }
#guide-w { font: 700 11px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.3em; text-transform: uppercase; color: #cfe8ff; text-shadow: 0 1px 6px rgba(0,0,0,0.9); }
@keyframes guide { 0%, 100% { opacity: 1; } 50% { opacity: 0.45; } }
#callout.on { animation: callout 2.4s ease-out; }
@keyframes callout { 0% { opacity: 0; letter-spacing: 0.5em; } 12% { opacity: 1; letter-spacing: 0.28em; } 22% { opacity: 0.35; } 32% { opacity: 1; } 78% { opacity: 1; } 100% { opacity: 0; } }
@keyframes hurt { from { opacity: 1; } to { opacity: 0; } }
#score-s { margin-top: 7px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.92; }
#score-b { margin-top: 3px; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.62; }
.score-pop { position: fixed; z-index: 4; pointer-events: none; font: 700 clamp(15px, 1.7vw, 21px)/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,0.8), 0 0 2px rgba(0,0,0,0.8); transform: translate(-50%, -50%); animation: score-pop 0.85s ease-out forwards; }
.score-pop.aid { color: #5dff8f; font-size: clamp(19px, 2.2vw, 27px); }
.score-pop.gold { color: #ffd34a; font-size: clamp(19px, 2.2vw, 27px); }
@keyframes score-bump { from { transform: scale(1.22); } to { transform: scale(1); } }
@keyframes score-pop { from { opacity: 1; transform: translate(-50%, -50%) scale(0.7); } 18% { opacity: 1; transform: translate(-50%, -90%) scale(1.15); } to { opacity: 0; transform: translate(-50%, -260%) scale(1); } }
#toast.tap { pointer-events: auto; cursor: pointer; }
.i { width: 17px; height: 17px; display: block; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
/* two-state buttons carry both pictures: .a normally, .b when the button is .on */
button .i.b, button.on .i.a { display: none; }
button.on .i.b { display: block; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 84px; height: 2px; background: rgba(255,255,255,0.35); border-radius: 2px; outline: none; margin: 0; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: #fff; cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 50%; background: #fff; cursor: pointer; }

#debug { position: fixed; left: 8px; top: 8px; font: 11px/1.4 ui-monospace, Menlo, monospace; color: #cfe; background: rgba(0,0,0,0.5); padding: 6px 8px; border-radius: 6px; white-space: pre; display: none; z-index: 6; pointer-events: none; }

#panel { position: fixed; right: calc(clamp(12px, 3vw, 40px) + env(safe-area-inset-right, 0px)); bottom: calc(clamp(16px, 4vh, 40px) + env(safe-area-inset-bottom, 0px) + 58px); width: min(340px, calc(100vw - 24px)); max-height: calc(100% - 120px); overflow-y: auto; box-sizing: border-box; display: grid; gap: 10px; padding: 16px 18px; border-radius: 18px; background: rgba(10, 12, 18, 0.55); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); border: 1px solid rgba(255,255,255,0.14); font: 11px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; z-index: 4; transition: opacity 0.4s ease; }
#panel[hidden] { display: none; }
body.idle #panel { opacity: 0; pointer-events: none; }
#panel label { display: flex; align-items: center; justify-content: space-between; gap: 12px; opacity: 0.9; }
#panel label.slide input { flex: 1; }
#panel select { font: inherit; letter-spacing: 0.06em; text-transform: none; color: #fff; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: 8px; padding: 5px 8px; min-width: 160px; }
#panel select option { color: #111; }
#panel .row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
#panel .check { justify-content: flex-start; gap: 8px; cursor: pointer; }
#panel .note { margin-top: -6px; text-align: right; font-size: 10px; letter-spacing: 0.08em; text-transform: none; opacity: 0.55; min-height: 1.2em; }
#panel button { all: unset; cursor: pointer; padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.18); opacity: 0.9; }
#panel button:hover, #panel button:focus-visible { background: rgba(255,255,255,0.12); opacity: 1; }
#kinds { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; max-width: 240px; }
#kinds button { padding: 4px 8px; font-size: 10px; letter-spacing: 0.1em; opacity: 0.45; }
#kinds button.on { opacity: 1; background: rgba(255,255,255,0.16); }
#kinds button.calm { flex-basis: 100%; border-style: dashed; }
#kinds button.calm.on { border-style: solid; background: rgba(150,215,255,0.26); }
body.notitles #title { display: none; }
#toast { position: fixed; left: 50%; bottom: 18vh; transform: translateX(-50%); max-width: calc(100vw - 48px); box-sizing: border-box; text-align: center; padding: 9px 16px; border-radius: 999px; background: rgba(10,12,18,0.6); font: 11px/1.4 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0; transition: opacity 0.5s ease; pointer-events: none; z-index: 6; }
#toast.show { opacity: 1; }

/* touch screens: controls a finger can hit; 16px form text so the page does not zoom when a menu opens */
@media (pointer: coarse) {
  #hud { gap: 6px; padding: 6px 10px; }
  #hud button { padding: 11px; }
  .i { width: 20px; height: 20px; }
  input[type=range] { height: 3px; }
  input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; }
  input[type=range]::-moz-range-thumb { width: 22px; height: 22px; }
  #panel { gap: 12px; font-size: 12px; }
  #panel select { font-size: 16px; padding: 8px 10px; }
  #panel button { padding: 9px 12px; }
  #kinds button { padding: 8px 10px; font-size: 11px; }
  #panel .check input { width: 20px; height: 20px; }
}
/* narrow windows (a phone held upright): the bar spans the screen and the two sliders live in the options panel */
@media (max-width: 700px) {
  #hud { left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); justify-content: space-around; }
  #panel { left: calc(12px + env(safe-area-inset-left, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); width: auto; bottom: calc(clamp(16px, 4vh, 40px) + env(safe-area-inset-bottom, 0px) + 64px); }
  #panel select { min-width: 0; flex: 0 1 190px; }
  #title { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
  #kinds { max-width: none; }
}
/* short windows (a phone held sideways): the panel goes two columns wide so it fits the height */
@media (max-height: 480px) {
  #panel { width: min(620px, calc(100vw - 24px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px))); left: auto; grid-template-columns: 1fr 1fr; column-gap: 22px; max-height: calc(100% - 92px); bottom: calc(clamp(16px, 4vh, 40px) + env(safe-area-inset-bottom, 0px) + 64px); }
  #panel .row { grid-column: 1 / -1; }
  #panel select { min-width: 0; flex: 0 1 150px; }
  #panel select#s-order { flex-basis: 190px; }
  #panel .note { text-align: left; margin-top: 0; align-self: center; }
  #title { bottom: calc(clamp(16px, 4vh, 40px) + env(safe-area-inset-bottom, 0px) + 64px); }
}
@media (prefers-reduced-motion: reduce) { #veil-sub { animation: none; } }

/* the hidden index of worlds (src/ui/atlas.js) */
body.atlas-open { cursor: auto !important; }
#atlas { position: fixed; inset: 0; z-index: 8; display: flex; flex-direction: column; background: rgba(6, 8, 14, 0.9); backdrop-filter: blur(22px) saturate(1.1); -webkit-backdrop-filter: blur(22px) saturate(1.1); font: 13px/1.3 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: #fff; padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px); }
#atlas[hidden] { display: none; }
.atlas-head { display: flex; align-items: center; gap: 12px; padding: 18px clamp(14px, 4vw, 48px) 14px; border-bottom: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap; }
.atlas-titles { margin-right: auto; }
.atlas-head h2 { margin: 0; font: italic 400 clamp(22px, 3vw, 34px)/1.1 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: 0.04em; }
.atlas-count { margin-top: 5px; font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.7; }
.atlas-head input, .atlas-head select { font: inherit; font-size: 16px; color: #fff; background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.18); border-radius: 10px; padding: 8px 12px; min-width: 0; outline: none; }
.atlas-head input { width: min(240px, 44vw); }
.atlas-head input::placeholder { color: rgba(255,255,255,0.5); }
.atlas-head input:focus-visible, .atlas-head select:focus-visible { border-color: rgba(255,255,255,0.5); }
.atlas-head select option { color: #111; }
.atlas-x { all: unset; cursor: pointer; width: 40px; height: 40px; border-radius: 50%; text-align: center; font-size: 26px; line-height: 38px; opacity: 0.8; }
.atlas-x:hover, .atlas-x:focus-visible { opacity: 1; background: rgba(255,255,255,0.12); }
.atlas-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 4px clamp(14px, 4vw, 48px) 24px; }
.atlas-h { margin: 34px 0 14px; padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,0.14); font: italic 400 clamp(22px, 2.6vw, 28px)/1.15 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: 0.03em; }
.atlas-h-n { font: 500 13px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.6; }
.atlas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(200px, 44%), 1fr)); gap: 14px; }
.atlas-card { display: block; color: inherit; text-decoration: none; border-radius: 12px; outline: none; }
.atlas-pic { position: relative; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); transition: transform 0.25s ease, border-color 0.25s ease; }
.atlas-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.atlas-card:hover .atlas-pic, .atlas-card:focus-visible .atlas-pic { transform: scale(1.03); border-color: rgba(255,255,255,0.6); }
.atlas-card.here .atlas-pic { border-color: #ffd98a; }
.atlas-new, .atlas-here { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; background: rgba(10,12,18,0.7); }
.atlas-new { color: #9ff0c0; }
.atlas-here { color: #ffd98a; left: auto; right: 8px; }
.atlas-name { margin-top: 8px; font: italic 16px/1.2 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: 0.03em; }
.atlas-kind { margin-top: 4px; font-size: 12px; line-height: 1.35; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.74; }
.atlas-line { margin-top: 5px; font: italic 13px/1.35 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; opacity: 0.8; }
.atlas-none { opacity: 0.6; padding: 30px 0; }
.atlas-foot { margin: 0; padding: 10px clamp(14px, 4vw, 48px) calc(12px + env(safe-area-inset-bottom, 0px)); font-size: 11px; letter-spacing: 0.06em; opacity: 0.5; border-top: 1px solid rgba(255,255,255,0.08); }
@media (prefers-reduced-motion: reduce) { .atlas-pic { transition: none; } }

.atlas-report { font: inherit; letter-spacing: inherit; color: inherit; background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }

/* the gallery's marks: a heart on each card (a button laid over the picture's corner, beside the link, so that pressing it does not start the world) and a tick on the worlds seen */
.atlas-cell { position: relative; }
.atlas-over { position: absolute; left: 0; top: 0; width: 100%; aspect-ratio: 16 / 9; pointer-events: none; }
.atlas-heart { all: unset; position: absolute; right: 6px; bottom: 6px; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; cursor: pointer; pointer-events: auto; background: rgba(10,12,18,0.5); opacity: 0.6; transition: opacity 0.2s ease, background 0.2s ease; }
.atlas-heart .i { width: 16px; height: 16px; }
.atlas-heart:hover, .atlas-heart:focus-visible { opacity: 1; background: rgba(10,12,18,0.82); }
.atlas-heart.on { opacity: 1; background: rgba(10,12,18,0.7); }
.atlas-heart.on .i { fill: currentColor; }
.atlas-seen { position: absolute; left: 7px; bottom: 7px; width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(10,12,18,0.62); opacity: 0.9; }
.atlas-seen .i { width: 12px; height: 12px; stroke-width: 2; }
.atlas-favs:empty { display: none; }
/* the journeys' shelf at the head of the list: wide cards, each a strip of four pictures over its title and line */
.atlas-journeys { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(420px, 100%), 1fr)); gap: 18px; }
.atlas-journey { display: block; color: inherit; text-decoration: none; border-radius: 12px; outline: none; }
.atlas-strip { position: relative; display: flex; gap: 2px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(255,255,255,0.12); transition: transform 0.25s ease, border-color 0.25s ease; }
.atlas-strip-pic { position: relative; flex: 1 1 0; aspect-ratio: 4 / 5; min-width: 0; }
.atlas-strip-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.atlas-journey:hover .atlas-strip, .atlas-journey:focus-visible .atlas-strip { transform: scale(1.015); border-color: rgba(255,255,255,0.6); }
.atlas-journey.here .atlas-strip { border-color: #ffd98a; }
.atlas-journey-name { margin-top: 10px; font: italic 21px/1.2 "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif; letter-spacing: 0.03em; }
.atlas-journey-line { margin-top: 5px; font-size: 14px; line-height: 1.4; opacity: 0.86; max-width: 56ch; }
@media (prefers-reduced-motion: reduce) { .atlas-strip { transition: none; } }
.atlas-about { all: unset; cursor: pointer; padding: 8px 12px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.18); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.85; }
.atlas-about:hover, .atlas-about:focus-visible { opacity: 1; background: rgba(255,255,255,0.12); }
@media (pointer: coarse) { .atlas-heart { width: 38px; height: 38px; right: 3px; bottom: 3px; opacity: 0.75; } .atlas-heart .i { width: 19px; height: 19px; } }
@media (max-width: 560px) { .atlas-head select { max-width: 46vw; } .atlas-head .atlas-show { max-width: 64vw; } }

/* the share menu: a small panel over the bar (src/main.js, "sharing") */
#share { position: fixed; right: calc(clamp(12px, 3vw, 40px) + env(safe-area-inset-right, 0px)); bottom: calc(clamp(16px, 4vh, 40px) + env(safe-area-inset-bottom, 0px) + 58px); display: grid; gap: 2px; padding: 8px; border-radius: 16px; background: rgba(10, 12, 18, 0.55); backdrop-filter: blur(18px) saturate(1.2); -webkit-backdrop-filter: blur(18px) saturate(1.2); border: 1px solid rgba(255,255,255,0.14); font: 11px/1.2 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.14em; text-transform: uppercase; z-index: 4; transition: opacity 0.4s ease; }
#share[hidden] { display: none; }
body.idle #share { opacity: 0; pointer-events: none; }
#share button { all: unset; cursor: pointer; padding: 9px 12px; border-radius: 9px; opacity: 0.9; white-space: nowrap; }
#share button:hover, #share button:focus-visible { background: rgba(255,255,255,0.12); opacity: 1; }
#panel .row[hidden] { display: none; }
#panel .row.checks { flex-wrap: wrap; row-gap: 10px; }
#panel .row.foot { justify-content: flex-end; }
@media (pointer: coarse) { #share { font-size: 12px; } #share button { padding: 13px 14px; } }
@media (max-width: 700px), (max-height: 480px) { #share { bottom: calc(clamp(16px, 4vh, 40px) + env(safe-area-inset-bottom, 0px) + 64px); } }
@media (max-width: 700px) {
  #share { right: calc(12px + env(safe-area-inset-right, 0px)); }
  /* the bar's buttons share its width evenly, so that the heart and the share button fit a narrow phone with the rest */
  #hud button { flex: 1 1 0; min-width: 0; padding-left: 0; padding-right: 0; }
}
@media (max-width: 430px) {
  #hud { left: calc(6px + env(safe-area-inset-left, 0px)); right: calc(6px + env(safe-area-inset-right, 0px)); gap: 0; padding-left: 4px; padding-right: 4px; }
  .atlas-head { gap: 8px; } .atlas-about { padding: 8px 9px; }   /* the filter, About and the close button stay on one line */
}

/* the About (src/ui/share.js): a card over everything */
#about { position: fixed; inset: 0; z-index: 9; display: flex; align-items: center; justify-content: center; box-sizing: border-box; padding: calc(16px + env(safe-area-inset-top, 0px)) calc(16px + env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) calc(16px + env(safe-area-inset-left, 0px)); background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); cursor: auto; }
#about[hidden] { display: none; }
.about-card { position: relative; width: min(560px, 100%); max-height: 100%; overflow-y: auto; box-sizing: border-box; padding: 26px 30px 20px; border-radius: 18px; background: rgba(12, 14, 22, 0.94); border: 1px solid rgba(255,255,255,0.14); font-size: 16px; line-height: 1.55; }
.about-card h2 { margin: 0 0 14px; font-weight: 400; font-style: italic; font-size: clamp(26px, 4vw, 34px); line-height: 1.1; letter-spacing: 0.06em; }
.about-card p { margin: 0 0 12px; opacity: 0.88; }
.about-x { all: unset; cursor: pointer; position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; text-align: center; font: 26px/38px ui-sans-serif, system-ui, sans-serif; opacity: 0.8; }
.about-x:hover, .about-x:focus-visible { opacity: 1; background: rgba(255,255,255,0.12); }
.about-film { all: unset; cursor: pointer; display: block; position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 2px 0 16px; border-radius: 12px; overflow: hidden; background: #000; }
.about-film img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0.85; }
.about-play { position: absolute; left: 50%; top: 50%; width: 64px; height: 64px; margin: -32px 0 0 -32px; border-radius: 50%; background: rgba(10,12,18,0.6); border: 1px solid rgba(255,255,255,0.55); box-sizing: border-box; }
.about-play::after { content: ''; position: absolute; left: 25px; top: 19px; border-style: solid; border-width: 12px 0 12px 19px; border-color: transparent transparent transparent #fff; }
.about-film:hover .about-play, .about-film:focus-visible .about-play { background: rgba(10,12,18,0.85); }
.about-video { display: block; width: 100%; aspect-ratio: 16 / 9; margin: 2px 0 16px; border-radius: 12px; background: #000; }
@media (max-height: 480px) { .about-card { padding: 18px 24px 12px; font-size: 14px; } .about-card h2 { margin-bottom: 8px; } }

/* ---------- STAR CAT (a local addition: ui/starcat-ui.js) ---------- */
/* while the title scene or the take-off plays, and while the board is up, the site's own bar, world card and messages are out of the way */
body.sc-stage #hud, body.sc-stage #title, body.sc-stage #toast, body.sc-ended #hud, body.sc-ended #title, body.sc-ended #toast { display: none !important; }
body.sc-stage #view { cursor: default; }
#sc-title, #sc-over { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; color: #fff; }
#sc-title { position: fixed; inset: 0; z-index: 6; pointer-events: none; }
#sc-title[hidden], #sc-over[hidden], #sc-form[hidden] { display: none; }
#sc-left { position: absolute; left: calc(clamp(24px, 4vw, 64px) + env(safe-area-inset-left, 0px)); top: clamp(20px, 5vh, 56px); }
#sc-logo { font: italic 900 clamp(52px, 9vw, 132px)/0.86 "Arial Black", "Segoe UI Black", Impact, ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: -0.02em; transform: skewX(-7deg); transform-origin: left top;
  background: linear-gradient(180deg, #fff6c2 0%, #ffc640 42%, #ff7a1c 78%, #d9480f 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 0 #6b2400) drop-shadow(0 0 28px rgba(255, 150, 40, 0.5)); }
#sc-logo span { display: block; }
#sc-logo-b { margin-left: 0.62em; }
#sc-tag { margin-top: clamp(12px, 2.2vh, 22px); font-size: clamp(11px, 1.15vw, 15px); letter-spacing: 0.34em; text-transform: uppercase; opacity: 0.85; text-shadow: 0 1px 8px rgba(0,0,0,0.8); }
#sc-right { position: absolute; right: calc(clamp(16px, 2.6vw, 44px) + env(safe-area-inset-right, 0px)); top: clamp(14px, 3vh, 36px); bottom: clamp(14px, 3vh, 36px); width: min(390px, 37vw); display: flex; flex-direction: column; gap: 10px; overflow-y: auto; pointer-events: auto; scrollbar-width: thin; }
.sc-card { background: rgba(8, 10, 18, 0.66); border: 1px solid rgba(255,255,255,0.13); border-radius: 12px; padding: 11px 15px 12px; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.sc-card h3 { margin: 0 0 7px; font-size: 11px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: #ffc24a; }
.sc-card ul { margin: 0; padding-left: 16px; font-size: 12.5px; line-height: 1.42; }
.sc-card li { margin-bottom: 3px; }
.sc-card dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 14px; margin: 0; font-size: 12.5px; line-height: 1.4; }
.sc-card dt { font-weight: 700; white-space: nowrap; }
.sc-card dd { margin: 0; opacity: 0.85; }
#sc-best table, #sc-over-rows table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
#sc-best th, #sc-over-rows th { text-align: left; font-size: 10px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.55; padding: 0 6px 3px 0; }
#sc-best td, #sc-over-rows td { padding: 2px 6px 2px 0; }
#sc-best td:nth-child(n+3), #sc-best th:nth-child(n+3), #sc-over-rows td:nth-child(n+3), #sc-over-rows th:nth-child(n+3) { text-align: right; }
.sc-none { font-size: 12.5px; opacity: 0.7; }
tr.sc-you td { color: #ffd34a; font-weight: 700; }
#sc-foot { position: absolute; left: calc(clamp(24px, 4vw, 64px) + env(safe-area-inset-left, 0px)); bottom: clamp(56px, 10vh, 96px); pointer-events: auto; }
#sc-start, #sc-again { font: italic 900 clamp(20px, 2.4vw, 32px)/1 "Arial Black", "Segoe UI Black", Impact, ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; letter-spacing: 0.08em; padding: 14px 48px 15px; border: 0; border-radius: 999px; cursor: pointer;
  color: #2a1200; background: linear-gradient(180deg, #ffe07a, #ff8a1c); box-shadow: 0 6px 0 #8a3a00, 0 0 34px rgba(255, 150, 40, 0.5); animation: sc-pulse 1.6s ease-in-out infinite; }
#sc-row { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
#sc-battle { font: 700 clamp(11px, 1.05vw, 14px)/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.2em; text-transform: uppercase; padding: 13px 20px; cursor: pointer; color: #ffd9a0; background: rgba(20, 10, 4, 0.55); border: 1.5px solid rgba(255, 170, 70, 0.75); border-radius: 999px; -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
#sc-battle:hover { background: rgba(255, 150, 40, 0.24); color: #fff; }
#sc-battle:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
#sc-start:hover, #sc-again:hover { filter: brightness(1.08); }
#sc-start:active, #sc-again:active { transform: translateY(3px); box-shadow: 0 3px 0 #8a3a00, 0 0 34px rgba(255, 150, 40, 0.5); }
#sc-start:focus-visible, #sc-again:focus-visible, #sc-home:focus-visible, #sc-save:focus-visible, #sc-name:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@keyframes sc-pulse { 0%, 100% { box-shadow: 0 6px 0 #8a3a00, 0 0 26px rgba(255, 150, 40, 0.4); } 50% { box-shadow: 0 6px 0 #8a3a00, 0 0 46px rgba(255, 170, 60, 0.75); } }
.sc-hint, #sc-hint { margin-top: 14px; font-size: 11px; letter-spacing: 0.3em; text-transform: uppercase; opacity: 0.7; text-shadow: 0 1px 8px rgba(0,0,0,0.8); }
#sc-credit { position: absolute; left: calc(clamp(24px, 4vw, 64px) + env(safe-area-inset-left, 0px)); bottom: 12px; max-width: min(56vw, 760px); font-size: 10.5px; line-height: 1.4; opacity: 0.6; pointer-events: auto; text-shadow: 0 1px 6px rgba(0,0,0,0.9); }
#sc-credit a { color: inherit; }
#sc-over { position: fixed; inset: 0; z-index: 7; display: flex; align-items: center; justify-content: center; background: rgba(4, 6, 12, 0.5); }
#sc-over-box { width: min(430px, 92vw); max-height: 92vh; overflow-y: auto; box-sizing: border-box; padding: 22px 26px 24px; text-align: center; background: rgba(10, 12, 20, 0.9); border: 1px solid rgba(255,255,255,0.14); border-radius: 16px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
#sc-over-box h2 { margin: 0; font: italic 900 clamp(24px, 3vw, 34px)/1.05 "Arial Black", "Segoe UI Black", Impact, ui-sans-serif, system-ui, sans-serif; text-transform: uppercase; color: #ffb53a; }
#sc-tally { margin: 10px 0 14px; font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums; }
#sc-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; margin-bottom: 12px; }
#sc-form label { flex-basis: 100%; font-size: 10.5px; letter-spacing: 0.26em; text-transform: uppercase; opacity: 0.7; }
#sc-name { width: 12.5em; padding: 9px 12px; font: 700 18px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.12em; text-transform: uppercase; text-align: center; color: #fff; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.3); border-radius: 10px; }
#sc-save, #sc-home { padding: 10px 18px; font: 700 13px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; color: #fff; background: rgba(255,255,255,0.12); border: 1px solid rgba(255,255,255,0.28); border-radius: 10px; cursor: pointer; }
#sc-save:hover, #sc-home:hover { background: rgba(255,255,255,0.2); }
#sc-note { min-height: 1.3em; margin-bottom: 8px; font-size: 13px; color: #ffd34a; }
#sc-over-rows { text-align: left; margin-bottom: 18px; }
#sc-over-foot { display: flex; gap: 14px; align-items: center; justify-content: center; flex-wrap: wrap; }
#sc-again { font-size: clamp(16px, 1.8vw, 22px); padding: 12px 30px 13px; }
/* a phone held upright: the name on top, the two in the middle of the picture, how to play in a short strip that scrolls, the buttons under it */
@media (max-width: 760px) and (orientation: portrait) {
  #sc-logo { font-size: 18vw; }
  #sc-right { left: 12px; right: 12px; top: auto; bottom: calc(168px + env(safe-area-inset-bottom, 0px)); width: auto; max-height: 21vh; }
  #sc-foot { left: 14px; right: 14px; bottom: calc(70px + env(safe-area-inset-bottom, 0px)); }
  #sc-row { justify-content: center; gap: 12px; }
  #sc-start { padding: 12px 30px 13px; }
  #sc-battle { padding: 12px 14px; letter-spacing: 0.12em; }
  #sc-hint { text-align: center; margin-top: 10px; }
  #sc-credit { left: 12px; right: 12px; max-width: none; font-size: 9px; line-height: 1.3; bottom: calc(6px + env(safe-area-inset-bottom, 0px)); }
}
/* a phone held sideways: not much height */
@media (max-height: 520px) {
  #sc-left { top: 10px; }
  #sc-logo { font-size: clamp(38px, 15vh, 66px); }
  #sc-tag { margin-top: 6px; font-size: 10px; }
  #sc-right { top: 8px; bottom: 8px; width: min(330px, 41vw); gap: 6px; }
  .sc-card { padding: 7px 11px 8px; }
  .sc-card h3 { margin-bottom: 4px; font-size: 10px; }
  .sc-card ul, .sc-card dl, #sc-best table, #sc-over-rows table, .sc-none { font-size: 11px; line-height: 1.32; }
  #sc-foot { bottom: calc(40px + env(safe-area-inset-bottom, 0px)); }
  #sc-start { padding: 10px 30px 11px; font-size: 20px; }
  #sc-battle { padding: 10px 14px; font-size: 10px; }
  #sc-hint { display: none; }
  #sc-credit { font-size: 8.5px; line-height: 1.25; max-width: 54vw; bottom: 5px; }
  #sc-over-box { padding: 12px 18px 14px; }
  #sc-over-box h2 { font-size: 20px; }
  #sc-tally { margin: 6px 0 8px; font-size: 15px; }
  #sc-name { padding: 6px 10px; font-size: 16px; }
  #sc-over-rows { margin-bottom: 10px; }
}

/* ---------- THE JET ON A PHONE (ui/touch.js): a stick for the left thumb, buttons for the right ---------- */
#touch { display: none; position: fixed; inset: 0; z-index: 5; pointer-events: none; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
body.touch.piloting #touch { display: block; }
body.touch.piloting, body.touch.piloting #view { touch-action: none; overscroll-behavior: none; }
#t-pad { position: absolute; left: 0; top: 16%; bottom: 0; width: 46%; pointer-events: auto; touch-action: none; }
#t-base, #t-knob { position: absolute; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
#t-base { width: 27vmin; height: 27vmin; border: 2px solid rgba(255,255,255,0.3); background: rgba(255,255,255,0.05); }
#t-knob { width: 12vmin; height: 12vmin; background: rgba(255,255,255,0.3); border: 2px solid rgba(255,255,255,0.55); }
#t-pad.on #t-base { border-color: rgba(255,200,120,0.7); } #t-pad.on #t-knob { background: rgba(255,190,100,0.55); }
.t-btn { position: absolute; display: flex; align-items: center; justify-content: center; box-sizing: border-box; border-radius: 50%; pointer-events: auto; touch-action: none; -webkit-tap-highlight-color: transparent;
  font: 700 clamp(9px, 2.5vmin, 13px)/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  background: rgba(10, 12, 20, 0.4); border: 1.5px solid rgba(255,255,255,0.42); }
.t-btn.on { background: rgba(255, 170, 60, 0.55); border-color: #fff; }
#t-fire { right: calc(5vmin + env(safe-area-inset-right, 0px)); bottom: calc(9vmin + env(safe-area-inset-bottom, 0px)); width: 25vmin; height: 25vmin; border-color: rgba(255,170,70,0.85); background: rgba(60, 24, 4, 0.42); }
#t-rocket { right: calc(33vmin + env(safe-area-inset-right, 0px)); bottom: calc(6vmin + env(safe-area-inset-bottom, 0px)); width: 17vmin; height: 17vmin; border-color: rgba(125,232,255,0.8); }
#t-boost { right: calc(7vmin + env(safe-area-inset-right, 0px)); bottom: calc(38vmin + env(safe-area-inset-bottom, 0px)); width: 17vmin; height: 17vmin; }
#t-brake { right: calc(29vmin + env(safe-area-inset-right, 0px)); bottom: calc(27vmin + env(safe-area-inset-bottom, 0px)); width: 15vmin; height: 15vmin; }
#t-roll { right: calc(53vmin + env(safe-area-inset-right, 0px)); bottom: calc(5vmin + env(safe-area-inset-bottom, 0px)); width: 14vmin; height: 14vmin; }
#t-flip { right: calc(48vmin + env(safe-area-inset-right, 0px)); bottom: calc(22vmin + env(safe-area-inset-bottom, 0px)); width: 14vmin; height: 14vmin; }
#t-turn { right: calc(27vmin + env(safe-area-inset-right, 0px)); bottom: calc(45vmin + env(safe-area-inset-bottom, 0px)); width: 14vmin; height: 14vmin; }
#t-menu { right: calc(3vmin + env(safe-area-inset-right, 0px)); top: calc(3vmin + env(safe-area-inset-top, 0px)); width: 11vmin; height: 11vmin; font-size: clamp(14px, 5vmin, 22px); letter-spacing: 0; }
/* the jet's captions on a touch screen: out from under the thumbs, and clear of the score */
body.touch.piloting #toast { bottom: calc(3vmin + env(safe-area-inset-bottom, 0px)); max-width: min(34vw, 300px); border-radius: 14px; padding: 7px 12px; font-size: 10px; letter-spacing: 0.1em; }
@media (max-height: 520px) { #callout { top: 48vh; font-size: 12px; } }
/* a phone held upright while flying: the buttons climb the right edge, clear of the stick */
@media (orientation: portrait) {
  #callout { top: 30vh; width: 88vw; white-space: normal; text-align: center; font-size: 12px; line-height: 1.5; }
  body.touch.piloting #toast { bottom: calc(86vmin + env(safe-area-inset-bottom, 0px)); max-width: 80vw; }
  #t-pad { top: 30%; width: 50%; }
  #t-roll { right: calc(44vmin + env(safe-area-inset-right, 0px)); bottom: calc(42vmin + env(safe-area-inset-bottom, 0px)); }
  #t-flip { right: calc(9vmin + env(safe-area-inset-right, 0px)); bottom: calc(59vmin + env(safe-area-inset-bottom, 0px)); }
  #t-turn { right: calc(27vmin + env(safe-area-inset-right, 0px)); bottom: calc(46vmin + env(safe-area-inset-bottom, 0px)); }
}
