/* Star Lander: the canvas fills the stage; HUD, banners and menus are HTML over it */
.sl { display: flex; flex-direction: column; color: #dfe9ff; --sl-hud: 50px; }
.sl-stage { position: relative; width: 100%; height: min(78vh, 680px); min-height: 360px; background: #04060f; overflow: hidden;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; touch-action: none; }
@media (max-width: 600px) { .sl-stage { height: auto; aspect-ratio: 4 / 5; max-height: 76vh; min-height: 0; } }
#sl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; cursor: pointer; }

/* HUD */
.sl-hud { position: absolute; left: 0; right: 0; top: 0; height: var(--sl-hud); display: flex; align-items: center; gap: 12px; padding: 0 8px 0 14px; z-index: 3; pointer-events: none;
  background: linear-gradient(180deg, rgba(4,6,15,0.72), rgba(4,6,15,0)); }
.sl-hud > button { pointer-events: auto; }
.sl-stat { display: flex; flex-direction: column; line-height: 1.05; min-width: 46px; }
.sl-k { font-size: 10px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #8aa3c4; }
.sl-stat b { font-size: 21px; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; display: inline-block; transform-origin: left center; transition: transform .18s cubic-bezier(.3,1.6,.5,1), color .18s; }
.sl-stat b.sl-pop { transform: scale(1.2); color: #ffd166; }
.sl-streak { display: flex; flex-direction: column; align-items: center; line-height: 1; padding: 5px 10px 4px; border-radius: 12px; border: 1px solid rgba(255,209,102,0.5); background: rgba(40,28,4,0.6);
  opacity: 0; transform: scale(.8); transition: opacity .2s, transform .25s cubic-bezier(.3,1.6,.5,1); }
.sl-streak.on { opacity: 1; transform: none; }
.sl-streak.sl-pop { transform: scale(1.25); }
.sl-streak b { font-size: 18px; font-weight: 900; color: #ffd166; text-shadow: 0 0 12px rgba(255,209,102,0.7); font-variant-numeric: tabular-nums; }
.sl-streak span { font-size: 9px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: #d9b96a; margin-top: 2px; }
.sl-streak.hot { border-color: #ff6b81; background: rgba(50,10,24,0.66); } .sl-streak.hot b { color: #ff9fb0; text-shadow: 0 0 14px rgba(255,107,129,0.9); }
.sl-leg { font-size: 12.5px; font-weight: 700; color: #bcd0ee; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; text-shadow: 0 1px 6px rgba(4,6,15,0.9); }
.sl-leg i { font-style: normal; color: #8aa3c4; font-weight: 600; }
.sl-sp { flex: 1 1 auto; }
.sl-craft { display: flex; gap: 4px; align-items: center; flex: none; }
.sl-craft svg { width: 17px; height: 17px; color: #dfe9ff; filter: drop-shadow(0 0 4px rgba(85,214,255,0.6)); }
.sl-craft svg.lost { color: #33456b; filter: none; }
.sl-leg u { text-decoration: none; }
.sl-craft em { display: none; font-style: normal; font-size: 13px; font-weight: 800; color: #dfe9ff; font-variant-numeric: tabular-nums; }
.sl-tool { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; border: 1px solid #1c2b4a; background: rgba(11,19,40,0.8);
  color: #bfe0ff; cursor: pointer; touch-action: manipulation; padding: 0; transition: border-color .15s, color .15s, opacity .15s; }
.sl-tool svg { width: 19px; height: 19px; }
@media (hover: hover) { .sl-tool:hover:not(:disabled) { border-color: #55d6ff; color: #fff; } }
.sl-tool:focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }
.sl-tool:disabled { opacity: 0.35; cursor: default; }
#sl-pause .pl { display: none; } #sl-pause.is-paused .pl { display: inline; } #sl-pause.is-paused .pz { display: none; }
#sl-sound .off { display: none; } #sl-sound[aria-pressed="true"] { color: #6f84a3; } #sl-sound[aria-pressed="true"] .on { display: none; } #sl-sound[aria-pressed="true"] .off { display: inline; }

/* coach line and world card */
.sl-coach[hidden], .sl-grade[hidden], .sl-jets[hidden] { display: none; }
.sl-coach { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; top: calc(var(--sl-hud) + 10px); z-index: 2; max-width: calc(100% - 24px); box-sizing: border-box; text-align: center; pointer-events: none;
  padding: 8px 16px; border-radius: 14px; background: rgba(4,6,15,0.66); border: 1px solid rgba(85,214,255,0.28); font-size: 15px; font-weight: 700; color: #fff; animation: sl-in .25s ease-out; }
.sl-coach small { display: block; font-size: 12px; font-weight: 600; color: #a9c0e2; margin-top: 2px; }
.sl-coach b { color: #ffd166; }
.sl-coach.sl-world { padding: 10px 22px; border-color: rgba(255,209,102,0.4); }
.sl-coach.sl-world span { display: block; font-size: 10.5px; letter-spacing: 0.18em; text-transform: uppercase; color: #ffd166; font-weight: 800; }
.sl-coach.sl-world strong { display: block; font-size: 22px; font-weight: 900; letter-spacing: 0.01em; line-height: 1.15; }

/* landing banner */
.sl-grade { position: absolute; left: 50%; top: 27%; transform: translate(-50%, -50%); z-index: 2; text-align: center; pointer-events: none; width: max-content; max-width: calc(100% - 20px); animation: sl-bang .34s cubic-bezier(.2,1.5,.4,1); }
.sl-grade h3 { margin: 0; font-size: clamp(30px, 8vw, 50px); font-weight: 900; letter-spacing: 0.05em; line-height: 1; color: #fff; text-shadow: 0 0 24px rgba(85,214,255,0.8), 0 3px 0 rgba(4,6,15,0.7); }
.sl-grade.g3 h3 { background: linear-gradient(90deg, #ffd166, #fff6cf 40%, #ff9fd0 75%, #55d6ff); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; filter: drop-shadow(0 0 16px rgba(255,209,102,0.75)) drop-shadow(0 3px 0 rgba(4,6,15,0.7)); }
.sl-grade.g2 h3 { color: #9dffb0; text-shadow: 0 0 22px rgba(157,255,176,0.7), 0 3px 0 rgba(4,6,15,0.7); }
.sl-grade.g1 h3 { color: #bff0ff; }
.sl-grade.g0 h3 { color: #ffc9a0; text-shadow: 0 0 20px rgba(255,160,90,0.6), 0 3px 0 rgba(4,6,15,0.7); }
.sl-grade.bad h3 { color: #ff8a9c; text-shadow: 0 0 22px rgba(255,107,129,0.75), 0 3px 0 rgba(4,6,15,0.7); }
.sl-grade .sl-pts { margin: 6px 0 0; font-size: clamp(20px, 5vw, 28px); font-weight: 900; color: #ffd166; font-variant-numeric: tabular-nums; text-shadow: 0 2px 10px rgba(4,6,15,0.9); }
.sl-grade .sl-pts em { font-style: normal; font-size: 0.72em; color: #fff; margin-left: 8px; padding: 2px 9px; border-radius: 999px; background: rgba(255,107,129,0.9); vertical-align: 2px; }
.sl-grade .sl-why { margin: 8px auto 0; display: inline-flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; padding: 6px 14px; border-radius: 12px; background: rgba(4,6,15,0.7); font-size: 12.5px; font-weight: 600; color: #bcd0ee; }
.sl-grade .sl-why b { color: #fff; font-variant-numeric: tabular-nums; }
.sl-grade .sl-extra { margin: 8px 0 0; font-size: 14px; font-weight: 800; color: #9dffb0; text-shadow: 0 2px 8px rgba(4,6,15,0.9); }
.sl-grade .sl-next { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: #a9c0e2; text-shadow: 0 1px 6px rgba(4,6,15,0.9); }
@keyframes sl-bang { from { opacity: 0; transform: translate(-50%, -50%) scale(.6); } }
@keyframes sl-in { from { opacity: 0; } }

/* optional side jets */
.sl-jets { position: absolute; left: 0; right: 0; bottom: 78px; z-index: 2; display: flex; justify-content: space-between; padding: 0 12px; pointer-events: none; }
.sl-jet { pointer-events: auto; width: 60px; height: 60px; border-radius: 18px; border: 1px solid rgba(85,214,255,0.4); background: rgba(11,19,40,0.72); color: #bff3ff; display: grid; place-items: center; padding: 0; cursor: pointer; touch-action: none; }
.sl-jet svg { width: 26px; height: 26px; }
.sl-jet.is-down { background: rgba(85,214,255,0.32); border-color: #55d6ff; transform: scale(.94); }
.sl-jet:focus-visible { outline: 2px solid #55d6ff; outline-offset: 2px; }

/* menus */
.sl-overlay[hidden] { display: none; }
.sl-overlay { position: absolute; left: 0; right: 0; bottom: 0; top: 0; display: flex; align-items: center; justify-content: center; padding: calc(var(--sl-hud) + 4px) 12px 12px;
  background: radial-gradient(ellipse at center, rgba(4,6,15,0.4), rgba(4,6,15,0.8)); z-index: 4; overflow: auto; }
.sl-overlay.sl-ov-title { background: radial-gradient(ellipse at center, rgba(4,6,15,0.15), rgba(4,6,15,0.55)); padding-top: 12px; z-index: 5; }
.sl-panel { width: min(100%, 380px); margin: auto; text-align: center; padding: 22px 20px 20px; border: 1px solid #1c2b4a; border-radius: 18px;
  background: rgba(8,13,30,0.88); box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(85,214,255,0.06) inset; animation: sl-panel-in .28s cubic-bezier(.2,.9,.25,1.1); }
@keyframes sl-panel-in { from { opacity: 0; transform: scale(.94) translateY(8px); } }
.sl-logo { margin: 0 0 4px; font-size: clamp(30px, 8.5vw, 40px); font-weight: 900; letter-spacing: 0.05em; line-height: 1.05;
  background: linear-gradient(90deg, #55d6ff, #dfe9ff 45%, #ffd166 80%, #ff9fd0); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 14px rgba(85,214,255,0.35)); }
.sl-tag { margin: 0 0 14px; color: #a9c0e2; font-size: 13.5px; line-height: 1.45; }
.sl-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 13px; background: #050a18; border: 1px solid #1c2b4a; margin: 0 0 8px; }
.sl-mode { font: inherit; font-size: 13.5px; font-weight: 700; color: #8aa3c4; background: transparent; border: 0; border-radius: 9px; min-height: 40px; cursor: pointer; touch-action: manipulation; transition: background .15s, color .15s; }
.sl-mode[aria-checked="true"] { background: #13234a; color: #fff; box-shadow: inset 0 0 0 1px rgba(85,214,255,0.45), 0 0 16px rgba(85,214,255,0.18); }
@media (hover: hover) { .sl-mode:hover { color: #fff; } }
.sl-mode:focus-visible, .sl-wbtn:focus-visible, .sl-switch:focus-visible { outline: 2px solid #55d6ff; outline-offset: 1px; }
.sl-desc { margin: 0 0 10px; font-size: 12.5px; color: #a9c0e2; min-height: 2.8em; line-height: 1.4; }
.sl-desc b { color: #ffd166; font-variant-numeric: tabular-nums; }
.sl-worlds { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; margin: 0 0 6px; }
.sl-wbtn { font: inherit; font-size: 14px; font-weight: 800; min-height: 40px; border-radius: 10px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; cursor: pointer; padding: 0; touch-action: manipulation; }
.sl-wbtn[aria-checked="true"] { border-color: #ffd166; color: #ffd166; box-shadow: 0 0 14px rgba(255,209,102,0.25); }
.sl-wbtn:disabled { color: #33456b; cursor: default; background: #070c1a; }
.sl-wname { margin: 0 0 12px; font-size: 12.5px; color: #a9c0e2; min-height: 1.4em; } .sl-wname b { color: #fff; }
.sl-actions { display: flex; flex-direction: column; gap: 8px; }
.sl-row { display: flex; gap: 8px; } .sl-row > * { flex: 1 1 0; }
.sl-btn { font: inherit; font-weight: 700; font-size: 14.5px; padding: 11px 14px; min-height: 46px; border-radius: 12px; cursor: pointer; touch-action: manipulation;
  border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; transition: background .15s, border-color .15s, transform .1s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
@media (hover: hover) { .sl-btn:hover { border-color: #55d6ff; } }
.sl-btn:active { transform: translateY(1px); }
.sl-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.sl-btn-primary { background: linear-gradient(135deg, #55d6ff, #9be9ff); color: #03141c; border-color: transparent; font-size: 16px; font-weight: 800; box-shadow: 0 6px 24px rgba(85,214,255,0.3); }
@media (hover: hover) { .sl-btn-primary:hover { border-color: transparent; filter: brightness(1.08); } }
.sl-keys { margin: 12px 0 0; font-size: 11.5px; color: #8aa3c4; }
.sl-head { margin: 0 0 4px; font-size: 13px; font-weight: 800; letter-spacing: 0.18em; text-transform: uppercase; color: #a9c0e2; }
.sl-big { margin: 0; font-size: 52px; font-weight: 900; color: #fff; line-height: 1.05; font-variant-numeric: tabular-nums; text-shadow: 0 0 24px rgba(85,214,255,0.45); }
.sl-sub { margin: 4px 0 0; font-size: 12.5px; color: #a9c0e2; } .sl-sub b { color: #ffd166; font-variant-numeric: tabular-nums; }
.sl-newbest { display: inline-block; margin: 6px 0 2px; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase;
  color: #1a1200; background: linear-gradient(90deg, #ffd166, #fff1b8, #ffd166); background-size: 200% 100%; animation: sl-shine 1.6s linear infinite; box-shadow: 0 0 22px rgba(255,209,102,0.55); }
@keyframes sl-shine { to { background-position: -200% 0; } }
.sl-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 12px 0 12px; }
.sl-stats div { padding: 8px 4px; border-radius: 10px; background: #050a18; border: 1px solid #16223d; }
.sl-stats span { display: block; font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: #8aa3c4; font-weight: 700; }
.sl-stats b { display: block; margin-top: 2px; font-size: 17px; color: #dfe9ff; font-variant-numeric: tabular-nums; }
.sl-stats .gold b { color: #ffd166; }
.sl-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 5px; margin: 0 0 12px; }
.sl-badges span { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; background: rgba(255,209,102,0.12); border: 1px solid rgba(255,209,102,0.45); color: #ffd166; }
.sl-badges i { font-style: normal; font-size: 11.5px; color: #8aa3c4; align-self: center; }

/* how to play and settings */
.sl-how { list-style: none; margin: 10px 0 14px; padding: 0; text-align: left; display: grid; gap: 9px; }
.sl-how li { display: grid; grid-template-columns: 34px 1fr; gap: 10px; align-items: center; font-size: 13.5px; line-height: 1.4; color: #cfdcf5; }
.sl-how li svg { width: 34px; height: 34px; }
.sl-how b { color: #fff; }
.sl-opts { display: grid; gap: 6px; margin: 10px 0 14px; text-align: left; }
.sl-switch { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 7px 12px; border-radius: 12px; border: 1px solid #1c2b4a; background: #0b1328; color: #dfe9ff; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; text-align: left; touch-action: manipulation; }
.sl-switch small { display: block; font-size: 11.5px; font-weight: 500; color: #8aa3c4; margin-top: 1px; }
.sl-switch i { width: 40px; height: 22px; border-radius: 999px; background: #1c2b4a; position: relative; transition: background .15s; }
.sl-switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #8aa3c4; transition: transform .15s, background .15s; }
.sl-switch[aria-checked="true"] i { background: #1d6f8c; } .sl-switch[aria-checked="true"] i::after { transform: translateX(18px); background: #55d6ff; }

.sl-toast[hidden] { display: none; }
.sl-toast { position: absolute; left: 0; right: 0; margin: 0 auto; width: fit-content; max-width: calc(100% - 24px); box-sizing: border-box; top: 57%; z-index: 4; padding: 8px 14px; border-radius: 999px; background: #dfe9ff; color: #04060f; font-size: 13px; font-weight: 700; animation: sl-in .2s ease-out; pointer-events: none; white-space: nowrap; }
.sl-sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* short stages (phone sideways): tighter menus */
.sl-short .sl-panel { padding: 12px 16px 12px; width: min(100%, 520px); }
.sl-short .sl-logo { font-size: 26px; }
.sl-short .sl-tag, .sl-short .sl-keys { display: none; }
.sl-short .sl-desc { margin-bottom: 6px; min-height: 0; } .sl-short .sl-wname { margin-bottom: 6px; }
.sl-short .sl-big { font-size: 36px; }
.sl-short .sl-stats { margin: 6px 0 8px; } .sl-short .sl-stats div { padding: 4px; }
.sl-short .sl-btn { min-height: 42px; padding: 8px 12px; }
.sl-short .sl-actions.sl-wide { flex-direction: row; } .sl-short .sl-actions.sl-wide > * { flex: 1 1 0; }
.sl-short .sl-how { grid-template-columns: 1fr 1fr; gap: 6px 14px; margin: 6px 0 8px; } .sl-short .sl-how li { font-size: 12.5px; }
.sl-short .sl-opts { grid-template-columns: 1fr 1fr; margin: 6px 0 8px; } .sl-short .sl-switch small { display: none; }
.sl-short .sl-grade { top: 34%; } .sl-short .sl-grade .sl-why { display: none; }
.sl-short .sl-badges { margin-bottom: 8px; }

.sl-help { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px 14px; }
.sl-help .hint-touch { display: none; }
@media (hover: none) and (pointer: coarse) { .sl-help .hint-kb { display: none; } .sl-help .hint-touch { display: inline; } }
.stage .sl-help { padding: 10px 14px 12px; }
@media (max-width: 430px) { .sl-hud { gap: 8px; padding-left: 10px; } .sl-stat b { font-size: 19px; } .sl-leg { font-size: 11.5px; } .sl-leg i, .sl-leg u { display: none; } .sl-craft svg { width: 14px; height: 14px; } .sl-craft { gap: 2px; margin-left: auto; } .sl-sp { display: none; } .sl-streak { padding: 5px 7px; } .sl-streak span { display: none; } .sl-craft.sl-many svg:not(:first-child) { display: none; } .sl-craft.sl-many em { display: inline; } }

/* full screen: the sky takes every pixel */
.stage.is-immersive .stage-body > .sl { min-height: 0; }
.stage.is-immersive .sl-stage { flex: 1 1 auto; height: auto; aspect-ratio: auto; max-height: none; min-height: 0; }
.stage.is-immersive .sl-help { display: none; }
@media (prefers-reduced-motion: reduce) { .sl-panel, .sl-toast, .sl-grade, .sl-coach, .sl-newbest { animation: none; } .sl-stat b, .sl-streak { transition: none; } }

/* title screen: the demo flight plays behind the menu, with only the sound button left in the bar */
.sl-attract .sl-hud { z-index: 6; background: none; border-color: transparent; }
.sl-attract .sl-hud > :not(.sl-tool):not(.sl-sp) { visibility: hidden; }
.sl-attract #sl-pause { visibility: hidden; }
/* the coach line sits under the docked craft, clear of the carrier */
.sl-coach { top: 31%; }
.sl-short .sl-coach { top: 36%; }
.sl-coach.sl-fly { top: calc(var(--sl-hud) + 6px); background: rgba(8,14,30,0.62); }
