:root {
  --ink: #e8edf0;
  --dim: #8b979f;
  --amber: #ffb13b;
  --panel: rgba(10, 14, 18, 0.78);
  --line: rgba(255, 255, 255, 0.09);
  --font: "Bahnschrift", "DIN Alternate", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b0f13; color: var(--ink); font-family: var(--font); user-select: none; }
#stage, #stage canvas { position: fixed; inset: 0; display: block; }
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 2; }
#fps { position: fixed; right: 10px; bottom: 6px; font-size: 11px; color: rgba(255, 255, 255, 0.35); z-index: 3; }
.hidden { display: none !important; }

/* ---------- screens */
.screen { position: fixed; inset: 0; z-index: 10; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px;
  background: radial-gradient(ellipse at 50% 35%, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.55)); }
#loading { background: #0b0f13; }
#pause, #crash, #result, #options { background: radial-gradient(ellipse at 50% 50%, rgba(5, 8, 11, 0.35), rgba(5, 8, 11, 0.8)); backdrop-filter: blur(5px) saturate(0.8); }
.brand { text-align: center; }
.logo { font-size: 64px; font-weight: 700; letter-spacing: 0.22em; color: #fff; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.5); }
.logo span { color: var(--amber); }
.brand.big .logo { font-size: 96px; }
.tag { margin-top: 6px; color: #dfe6ea; letter-spacing: 0.12em; font-size: 15px; text-transform: uppercase; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7); }
.small { font-size: 13px; color: #c3ccd2; text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.kicker { color: var(--amber); font-size: 12px; font-weight: 700; letter-spacing: 0.28em; text-transform: uppercase; }
.kicker.warn { color: #ff8a6a; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* title: a cinematic lower-left card over the plane on the runway */
#title { align-items: flex-start; justify-content: flex-end; padding: 0 0 clamp(64px, 11svh, 120px) 7vw;
  background: linear-gradient(90deg, rgba(4, 8, 12, 0.88) 0%, rgba(4, 8, 12, 0.55) 34%, rgba(4, 8, 12, 0) 62%),
              linear-gradient(0deg, rgba(4, 8, 12, 0.75) 0%, rgba(4, 8, 12, 0) 45%); }
.title-card { display: flex; flex-direction: column; gap: clamp(8px, 1.8svh, 14px); max-width: 620px; animation: rise 0.7s ease-out both; }
/* the logo sizes to the shorter of width and height, so it never crowds a laptop screen */
.title-card .logo { font-size: clamp(56px, min(7.4vw, 13svh), 118px); line-height: 0.95; letter-spacing: 0.12em; margin-left: -4px; }
.title-card .tag { margin: 0; font-size: clamp(16px, 2.4svh, 19px); letter-spacing: 0.02em; text-transform: none; color: #e6ecef; font-weight: 400; }
.title-card .press { margin-top: clamp(4px, 1.8svh, 18px); display: flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase; color: #fff; }
.title-card .press kbd { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border-radius: 20px; background: var(--amber); color: #15100a; font: 700 17px var(--font);
  letter-spacing: 0.04em; box-shadow: 0 0 0 6px rgba(255, 177, 59, 0.18), 0 0 26px rgba(255, 177, 59, 0.45); animation: pulse 1.8s ease-in-out infinite; }
.title-card .pair { font-size: 14px; line-height: 1.5; color: #c9d2d8; max-width: 520px; padding-left: 14px; border-left: 2px solid rgba(255, 177, 59, 0.55); }
.title-card .pair b { color: var(--amber); }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

.panel { background: linear-gradient(180deg, rgba(16, 21, 27, 0.86), rgba(9, 12, 16, 0.9)); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 22px 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06); backdrop-filter: blur(14px); }
.panel h2 { margin: 0 0 12px; font-weight: 600; letter-spacing: 0.04em; }
.panel p { color: #c3ccd2; line-height: 1.45; margin: 8px 0; }

.menu-panel { width: min(1000px, 94vw); display: flex; flex-direction: column; gap: clamp(6px, 1.2svh, 10px); max-height: 100%; }
.menu-panel::-webkit-scrollbar { width: 6px; }
.menu-panel::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); border-radius: 3px; }
.menu-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 2px clamp(6px, 1.4svh, 12px); border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.logo.sm { font-size: clamp(24px, 4svh, 30px); letter-spacing: 0.18em; text-shadow: none; flex: none; }
.menu-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.menu-col { display: flex; flex-direction: column; gap: clamp(5px, 1.1svh, 8px); }
#missionList { display: flex; flex-direction: column; gap: 6px; }
.col-h { display: flex; align-items: baseline; gap: 8px; color: var(--amber); text-transform: uppercase; letter-spacing: 0.2em; font-size: 12px; font-weight: 700; margin: clamp(2px, 0.8svh, 6px) 0 2px 2px; }
.col-h::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(255, 177, 59, 0.35), transparent); align-self: center; }
@media (max-width: 760px) { .menu-cols { grid-template-columns: 1fr; } }
.status { font-size: 13px; color: #c3ccd2; display: flex; gap: 8px; align-items: center; line-height: 1.4; text-align: right; }
.status b { color: var(--amber); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #5b656c; display: inline-block; flex: none; }
.dot.on { background: #3ddc84; box-shadow: 0 0 10px #3ddc84; }
.dot.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }

.btn { position: relative; font: inherit; color: var(--ink); background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 10px;
  padding: clamp(8px, 1.5svh, 12px) 16px; text-align: left; cursor: pointer; display: flex; flex-direction: column; gap: 3px; transition: background 0.14s, border-color 0.14s, transform 0.14s, box-shadow 0.14s; }
.btn::before { content: ''; position: absolute; left: -1px; top: 10px; bottom: 10px; width: 3px; border-radius: 3px; background: var(--amber); opacity: 0; transition: opacity 0.14s; }
.btn b { font-size: 17px; font-weight: 600; letter-spacing: 0.02em; }
.btn span { font-size: 12.5px; color: #9aa6ae; line-height: 1.35; }
.btn em { font-style: normal; color: var(--amber); }
.btn:hover, .btn.focus { background: linear-gradient(180deg, rgba(255, 177, 59, 0.16), rgba(255, 177, 59, 0.07)); border-color: rgba(255, 177, 59, 0.7);
  box-shadow: 0 0 0 1px rgba(255, 177, 59, 0.25), 0 10px 28px rgba(0, 0, 0, 0.35); transform: translateX(3px); }
.btn:hover::before, .btn.focus::before { opacity: 1; }
.btn:hover span, .btn.focus span { color: #d5dce0; }
.btn.primary { background: linear-gradient(180deg, rgba(255, 177, 59, 0.12), rgba(255, 177, 59, 0.04)); border-color: rgba(255, 177, 59, 0.3); }
.btn.primary b { color: #fff; }
.btn.slim { padding: 8px 14px; font-size: 13px; color: var(--dim); align-items: center; }
.list-panel { width: min(440px, 92vw); display: flex; flex-direction: column; gap: clamp(6px, 1.2svh, 9px); padding: clamp(18px, 3.6svh, 26px) 28px clamp(16px, 3.4svh, 24px); max-height: 100%; }
.list-panel h2 { font-size: clamp(28px, 4.6svh, 34px); margin: 2px 0 clamp(6px, 1.6svh, 12px); }
.list-panel .btn { align-items: center; font-size: 16px; font-weight: 600; letter-spacing: 0.06em; padding: clamp(9px, 1.7svh, 13px) 16px; }
.list-panel .btn:hover, .list-panel .btn.focus { transform: none; }
.list-panel .btn::before { display: none; }
.list-panel .btn.primary { background: var(--amber); color: #15100a; border-color: var(--amber); }
.list-panel .btn.primary.focus, .list-panel .btn.primary:hover { background: #ffc566; box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85), 0 10px 30px rgba(255, 177, 59, 0.35); }
.warn { color: #ff7a5c; }
.reason { font-size: 19px; color: #fff !important; margin: 0 0 2px !important; }

.key { color: var(--amber); }
.phone-wrap { height: 150px; display: flex; align-items: center; justify-content: center; }
#phoneArt { width: 70px; height: 140px; border-radius: 14px; border: 3px solid #cfd6db; background: linear-gradient(160deg, #1d2730, #0d1318);
  transform: perspective(500px) rotateX(60deg); transition: transform 0.06s linear; position: relative; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); }
#phoneArt .notch { position: absolute; top: 6px; left: 50%; width: 22px; height: 4px; margin-left: -11px; border-radius: 3px; background: #4a555e; }
#phoneArt .arrow-up { position: absolute; top: 30px; width: 100%; text-align: center; color: var(--amber); font-size: 26px; }
.tilt { font-size: 14px; color: var(--dim); margin-top: 6px; min-height: 18px; }
.keys { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px 22px; text-align: left; margin: 14px auto; max-width: 440px; }
.keys div { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.keys b { color: #fff; font-weight: 600; }
.keys span { color: var(--dim); }

.opt-panel { width: min(620px, 94vw); max-height: 100%; padding-top: clamp(14px, 3svh, 22px); padding-bottom: clamp(14px, 3svh, 22px); display: flex; flex-direction: column; }
.opt-panel h2 { margin-bottom: clamp(6px, 1.4svh, 12px); }
#optRows { display: flex; flex-direction: column; gap: clamp(1px, 0.5svh, 4px); margin-bottom: clamp(6px, 1.4svh, 10px); }
.opt { display: flex; justify-content: space-between; align-items: center; padding: clamp(3px, 0.9svh, 8px) 12px; border-radius: 8px; border: 1px solid transparent; cursor: pointer; }
.opt.focus, .opt:hover { background: rgba(255, 177, 59, 0.1); border-color: rgba(255, 177, 59, 0.5); }
.opt .ol { font-size: 15px; }
.opt .ov { display: flex; align-items: center; gap: 10px; min-width: 170px; justify-content: flex-end; }
.opt .ov em { font-style: normal; color: var(--amber); min-width: 100px; text-align: center; font-weight: 600; }
.opt .arrow { color: var(--dim); font-size: 22px; line-height: 1; padding: 0 4px; }
.opt .ol, .opt .ov em { line-height: 1.25; }
.opt-panel .btn { align-items: center; }

.result-panel { width: min(500px, 92vw); }
.res-head { display: flex; gap: 18px; align-items: center; margin-bottom: 10px; }
.res-head .score { font-size: clamp(48px, 9svh, 64px); font-weight: 700; color: var(--amber); min-width: 90px; text-align: center; }
.res-head h2 { margin: 0; }
#resRows { width: 100%; border-collapse: collapse; margin-bottom: 12px; font-size: 14px; }
#resRows td { padding: clamp(3px, 0.9svh, 6px) 4px; border-bottom: 1px solid var(--line); }
#resRows td:nth-child(2) { color: #fff; text-align: right; }
#resRows td:nth-child(3) { color: var(--amber); text-align: right; width: 70px; }

/* ---------- in-flight overlays */
#legend { position: fixed; top: 14px; right: 14px; z-index: 3; background: rgba(8, 11, 14, 0.78); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 12px; min-width: 200px; pointer-events: none; }
.lg-title { color: var(--amber); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; margin-bottom: 6px; }
#legendRows div { display: flex; justify-content: space-between; gap: 14px; padding: 2px 0; }
#legendRows b { color: #fff; font-weight: 600; }
#legendRows span { color: #b9c4cb; }
#soundHint { position: fixed; left: 14px; bottom: 14px; z-index: 4; font-size: 12px; color: #c3ccd2; background: rgba(8, 11, 14, 0.6); border: 1px solid var(--line); padding: 6px 10px; border-radius: 8px; }
#toast { position: fixed; top: 92px; left: 50%; transform: translate(-50%, -8px); z-index: 4; background: rgba(8, 11, 14, 0.72); border: 1px solid var(--line);
  padding: 8px 16px; border-radius: 8px; font-size: 15px; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; max-width: 80vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#coach { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 4; display: flex; gap: 10px; align-items: baseline;
  background: rgba(8, 11, 14, 0.72); border: 1px solid var(--line); border-left: 3px solid var(--amber); padding: 8px 16px; border-radius: 8px;
  font-size: 15px; max-width: max(320px, calc(100vw - 660px)); pointer-events: none; transition: opacity 0.3s; }
#coach b { color: var(--amber); font-size: 11px; letter-spacing: 0.14em; }
#coach.hidden { display: none; }
#coach.quiet { opacity: 0.6; }

/* ---------- objective + G vignette */
#objective { position: fixed; top: 14px; left: 14px; z-index: 4; background: rgba(8, 11, 14, 0.66); border: 1px solid var(--line); border-left: 3px solid #5ad1ff;
  border-radius: 8px; padding: 8px 14px 9px; min-width: 230px; max-width: 290px; pointer-events: none; }
#objective .ob-title { color: #5ad1ff; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; }
#objective .ob-text { font-size: 16px; margin-top: 2px; }
#objective .ob-nav { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 14px; color: #c3ccd2; }
#objective .ob-arrow { display: inline-block; color: var(--amber); font-size: 20px; line-height: 1; transform-origin: 50% 50%; transition: transform 0.15s linear; }
#objective .ob-arrow svg { display: block; } /* notched arrow: a plain triangle reads the same every 120 deg */
#objective .ob-arrow::before { content: ''; }
#objective .ob-dist { color: #fff; font-weight: 600; min-width: 56px; }
#vignette { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity 0.15s; }

/* ---------- turbulence chip (rough air is always announced) */
#turbChip { position: fixed; top: 60px; left: 50%; transform: translateX(-50%); z-index: 4; font-size: 11px; letter-spacing: 0.16em; color: #ffd28a;
  background: rgba(40, 24, 4, 0.7); border: 1px solid rgba(255, 177, 59, 0.45); padding: 4px 10px; border-radius: 999px; pointer-events: none; animation: pulse 2.4s ease-in-out infinite; }

/* ---------- skim meter (right rail): low-flying chain, multiplier, callouts */
#skim { position: fixed; right: 18px; top: 50%; transform: translateY(-50%); z-index: 4; width: clamp(168px, 12vw, 232px); pointer-events: none; text-align: right; --low: 0;
  padding: 10px 14px 12px; border-radius: 12px; background: rgba(8, 11, 14, 0.62); border: 1px solid var(--line); border-right: 3px solid rgba(255, 177, 59, calc(0.3 + 0.7 * var(--low)));
  transition: box-shadow 0.2s, border-color 0.2s; }
#skim.live { box-shadow: 0 0 calc(30px * var(--low)) rgba(255, 140, 40, calc(0.45 * var(--low))); }
#skim .sk-mult { font-size: 13px; font-weight: 700; letter-spacing: 0.16em; color: var(--dim); }
#skim.live .sk-mult { font-size: clamp(32px, 2.6vw, 46px); line-height: 1; letter-spacing: 0.02em; font-style: italic; color: var(--amber); text-shadow: 0 0 14px rgba(255, 140, 40, 0.6); }
#skim .sk-pts { font-size: clamp(24px, 1.9vw, 34px); font-weight: 700; font-variant-numeric: tabular-nums; color: #fff; margin-top: 2px; }
#skim .sk-sub { font-size: 11px; letter-spacing: 0.1em; color: var(--dim); text-transform: uppercase; }
#skim .sk-bar { height: 4px; border-radius: 2px; background: rgba(255, 255, 255, 0.1); margin-top: 8px; overflow: hidden; }
#skim .sk-bar i { display: block; height: 100%; background: var(--amber); transform-origin: 100% 50%; transform: scaleX(0); transition: transform 0.08s linear; }
#skim .sk-total { font-size: 12px; color: #c3ccd2; margin-top: 6px; min-height: 0; }
#skim .sk-total:empty, #skim:not(.live) .sk-bar { display: none; }
#pops { position: absolute; right: 0; top: calc(100% + 10px); display: flex; flex-direction: column-reverse; align-items: flex-end; gap: 6px; }
.pop { font-size: clamp(15px, 1.1vw, 19px); font-weight: 700; white-space: nowrap; color: #fff; padding: 5px 11px; border-radius: 8px; background: rgba(8, 11, 14, 0.72); border: 1px solid rgba(255, 177, 59, 0.5);
  animation: popIn 1.9s ease-out forwards; }
.pop.mult { color: var(--amber); font-size: 20px; font-style: italic; }
.pop.banked { color: #3ddc84; border-color: rgba(61, 220, 132, 0.5); }
.pop.lost { color: #ff6b5b; border-color: rgba(255, 77, 61, 0.5); }
.pop.roll, .pop.loop, .pop.inverted { color: #5ad1ff; border-color: rgba(90, 209, 255, 0.5); }
@keyframes popIn { 0% { opacity: 0; transform: translateX(20px) scale(0.9); } 10% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; transform: translateY(-14px); } }
#missionList .btn.hot { border-color: rgba(255, 177, 59, 0.45); }

/* ---------- real world: menu column, location screen, loading, goal card, attribution */
.menu-panel { width: min(1180px, 96vw); padding-top: clamp(14px, 2.6svh, 22px); padding-bottom: clamp(14px, 2.6svh, 22px); }
.menu-cols { grid-template-columns: 1.55fr 1fr; }
.col-sub { font-size: 11px; color: var(--dim); letter-spacing: 0.06em; text-transform: none; margin-left: 6px; }
.place-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.btn.place { padding: clamp(6px, 1.2svh, 9px) 12px; }
.btn.place b { font-size: 16px; }
.btn.place span { font-size: 11.5px; line-height: 1.3; }
#missionList .btn { padding: clamp(5px, 1svh, 7px) 12px; }
#missionList .btn b { font-size: 15px; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
#missionList .best { font-size: 12px; font-weight: 600; letter-spacing: 0.04em; }
#missionList .best.none { color: var(--dim); font-weight: 400; }
.place-grid .ap-search:nth-child(odd) { grid-column: 1 / -1; }
#missionList .btn span { font-size: 11px; }
.ap-search { display: flex; gap: 8px; position: relative; z-index: 2; }
.ap-search input { flex: 1; font: inherit; font-size: 14px; color: var(--ink); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line); border-radius: 10px; padding: clamp(6px, 1.1svh, 8px) 12px; outline: none; }
.ap-search input:focus { border-color: rgba(255, 177, 59, 0.6); }
.ap-search > .btn.slim { width: 72px; justify-content: center; }
/* search results drop down over the menu instead of pushing it off the screen */
#apHits { position: absolute; top: calc(100% + 4px); right: 0; width: max(100%, 440px); display: flex; flex-direction: column; gap: 4px; }
#apHits:not(:empty) { padding: 6px; border-radius: 12px; background: rgba(9, 12, 16, 0.97); border: 1px solid rgba(255, 177, 59, 0.35); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6); }
#apHits .small { padding: 4px 6px; text-shadow: none; }
.btn.hit { flex-direction: row; gap: 8px; justify-content: flex-start; text-align: left; }
.btn.hit b { font-size: 13px; color: #fff; white-space: nowrap; }
.btn.hit i { font-style: normal; color: var(--dim); margin-left: auto; }
.place-panel { width: min(880px, 94vw); display: flex; flex-direction: column; gap: clamp(5px, 1.1svh, 8px); max-height: 100%; padding-top: clamp(14px, 3svh, 22px); padding-bottom: clamp(14px, 3svh, 22px); }
.pl-head h2 { margin: 2px 0 2px; font-size: clamp(24px, 4.4svh, 30px); letter-spacing: 0.04em; }
.pl-head p { margin: clamp(3px, 0.8svh, 6px) 0 4px; color: #c3ccd2; font-size: 14px; }
#plList { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; gap: clamp(4px, 1svh, 7px); }
@media (max-width: 760px) { #plList { grid-template-columns: 1fr; } }
.place-panel .row { display: flex; justify-content: flex-end; }
.place-panel .row .btn { width: 160px; align-items: center; }
.rwload-panel { width: min(560px, 92vw); }
.bar { height: 8px; background: rgba(255, 255, 255, 0.08); border-radius: 99px; overflow: hidden; margin: 6px 0; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb13b, #ffd28a); transition: width 0.3s; }
#goalCard { position: fixed; left: 50%; top: 30%; transform: translate(-50%, -50%); z-index: 5; text-align: center; pointer-events: none;
  background: rgba(8, 11, 14, 0.74); border: 1px solid rgba(255, 177, 59, 0.5); border-radius: 14px; padding: 14px 26px 16px; max-width: min(760px, 90vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45); animation: goalIn 0.5s ease-out; }
#goalCard .gc-k { color: var(--amber); font-size: 11px; letter-spacing: 0.22em; }
#goalCard .gc-t { font-size: 26px; font-weight: 600; margin: 4px 0 6px; color: #fff; }
#goalCard .gc-s { font-size: 13px; color: #c3ccd2; }
@keyframes goalIn { from { opacity: 0; transform: translate(-50%, -40%); } }
#attrib { position: fixed; left: 8px; bottom: 8px; z-index: 11; font-size: 10px; color: rgba(255, 255, 255, 0.62); max-width: calc(100vw - 90px);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9); pointer-events: auto; line-height: 1.35; }
#attrib a { color: rgba(255, 255, 255, 0.8); }
/* in flight the credit sits in the corner beside the instruments, short; menus show the full one */
#attrib.fly { left: auto; right: 8px; text-align: right; max-width: min(300px, calc(50vw - 380px)); min-width: 200px; }
#attrib.fly .long, #attrib:not(.fly) .short { display: none; }

/* ---------- Mimic family: the same badge and device hint bar in every Mimic game ---------- */
.mimic-badge { position: fixed; top: 14px; right: 16px; z-index: 60; display: flex; align-items: center; gap: 8px; padding: 7px 13px 7px 11px; border-radius: 999px;
  background: rgba(8, 10, 14, 0.66); border: 1px solid rgba(255, 255, 255, 0.16); color: #e9edf2; pointer-events: none; backdrop-filter: blur(6px);
  font: 600 12px/1 Bahnschrift, "DIN Alternate", "Segoe UI", system-ui, sans-serif; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; }
.mimic-badge b { font-weight: 700; color: #fff; padding-right: 9px; border-right: 1px solid rgba(255, 255, 255, 0.2); letter-spacing: 0.2em; }
.mimic-badge i { width: 8px; height: 8px; border-radius: 50%; background: #8a929c; flex: none; }
.mimic-badge.on i { background: #4ee6a8; box-shadow: 0 0 8px #4ee6a8; }
.mimic-badge.warn i { background: #ffb13b; box-shadow: 0 0 8px #ffb13b; }
.mimic-badge.warn span { color: #ffd38a; }
.mimic-badge.hidden, .mimic-hint.hidden { display: none; }
.mimic-hint { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 18px; padding: 8px 16px; border-radius: 999px;
  background: rgba(8, 10, 14, 0.66); border: 1px solid rgba(255, 255, 255, 0.14); color: #c9d0d8; pointer-events: none; backdrop-filter: blur(6px);
  font: 500 13px/1 Bahnschrift, "DIN Alternate", "Segoe UI", system-ui, sans-serif; letter-spacing: 0.04em; white-space: nowrap; }
.mimic-hint span { display: flex; align-items: center; gap: 7px; }
.mimic-hint kbd { font: 700 11px/1 Bahnschrift, "DIN Alternate", "Segoe UI", system-ui, sans-serif; letter-spacing: 0.1em; text-transform: uppercase; color: #0b0d10;
  background: #e9edf2; border-radius: 4px; padding: 4px 6px 3px; }
.island-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(5px, 1.1svh, 8px); }
.island-grid .btn.learn { grid-column: 1 / -1; }

/* ---------- controller guide (bottom left) and the first-flight lesson card (top centre) */
#guide { position: fixed; left: 14px; bottom: 14px; z-index: 4; width: clamp(230px, 19vw, 300px); pointer-events: none; padding: 8px 10px 10px; border-radius: 14px;
  background: rgba(8, 11, 14, 0.66); border: 1px solid var(--line); }
#guide .g-dev { font-size: 10px; letter-spacing: 0.16em; color: var(--dim); text-transform: uppercase; margin: 0 0 4px 2px; }
#guide svg { display: block; width: 100%; height: auto; }
#guide .g-body { fill: rgba(255, 255, 255, 0.04); stroke: rgba(255, 255, 255, 0.22); stroke-width: 2; }
#guide .g-key, #guide .g-kk rect { fill: rgba(255, 255, 255, 0.08); stroke: rgba(255, 255, 255, 0.28); stroke-width: 1.5; transition: fill 0.08s; }
#guide .g-stick { fill: rgba(255, 255, 255, 0.05); }
#guide .g-dot { fill: #e8edf0; }
#guide text { fill: #c9d0d6; font: 700 11px var(--font); text-anchor: middle; pointer-events: none; }
#guide .g-small { font-size: 8px; fill: var(--dim); letter-spacing: 0.08em; }
#guide .g-arrow { fill: rgba(255, 255, 255, 0.12); }
#guide .on, #guide .g-kk.on rect { fill: rgba(255, 255, 255, 0.55) !important; }
#guide .hl, #guide .g-kk.hl rect { stroke: var(--amber) !important; stroke-width: 3 !important; animation: ghl 1s ease-in-out infinite; }
#guide .g-arrow.hl { fill: var(--amber); stroke: none !important; }
@keyframes ghl { 50% { filter: drop-shadow(0 0 6px rgba(255, 177, 59, 0.9)); } }
#guide .g-cap { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 12px; }
#guide .g-cap b { display: inline-block; width: 50px; font-size: 10px; letter-spacing: 0.12em; color: var(--dim); }
#guide .g-cap i { font-style: normal; color: #fff; }
#guide .g-pow { display: flex; align-items: center; gap: 6px; }
#guide .g-pow em { flex: 1; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
#guide .g-pow u { display: block; height: 100%; background: #3ddc84; transform-origin: 0 50%; }
#guide .g-pow i { width: 36px; text-align: right; }
#tutorial { position: fixed; top: 14px; left: 50%; transform: translateX(-50%); z-index: 5; width: min(560px, 60vw); pointer-events: none; padding: 12px 18px 14px; border-radius: 14px;
  background: rgba(8, 11, 14, 0.8); border: 1px solid rgba(255, 177, 59, 0.45); box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45); }
#tutorial .tu-k { font-size: 11px; letter-spacing: 0.16em; color: var(--amber); text-transform: uppercase; }
#tutorial .tu-t { font-size: 24px; font-weight: 700; margin-top: 2px; }
#tutorial .tu-x { font-size: 16px; color: #dfe5ea; margin-top: 4px; line-height: 1.35; }
#tutorial .tu-bar { height: 5px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); margin-top: 10px; overflow: hidden; }
#tutorial .tu-bar i { display: block; height: 100%; background: var(--amber); transform-origin: 0 50%; transform: scaleX(0); transition: transform 0.12s linear; }
#tutorial.ok { border-color: rgba(61, 220, 132, 0.8); }
#tutorial.ok .tu-bar i { background: #3ddc84; }
/* menus clear the Mimic badge (top right) and the hint bar (bottom centre) */
#menu, #options, #pause, #crash, #result, #place, #rwload { justify-content: center; padding: 54px 16px 60px; }
body:has(#attrib:not(.hidden)) .mimic-hint { bottom: 52px; }
body:has(#attrib:not(.hidden)) #place, body:has(#attrib:not(.hidden)) #rwload { padding-bottom: 96px; }
/* laptop screens under browser chrome: drop the secondary lines */
@media (max-height: 780px) {
  .btn.place span { display: none; }
  .col-sub { display: none; }
  .opt-panel > p.small { display: none; }
  #plBlurb { display: none; }
}
@media (max-height: 620px) {
  .title-card .pair { display: none; }
}
@media (max-height: 680px) {
  .island-grid .btn span { display: none; }
  #legend { font-size: 11px; padding: 8px 10px; }
  #legendRows div { padding: 1px 0; }
}
/* options in two columns where there is room (13 rows no longer fit a 600 px screen in one); filled
   down each column so D-pad up/down still walks the list in order */
@media (min-width: 1000px) {
  .opt-panel { width: min(1000px, 94vw); }
  #optRows { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: 1fr; column-gap: 22px; }
  .opt .ov { min-width: 0; }
  .opt .ov em { min-width: 92px; }
}
