:root {
  color-scheme: dark;
  --sky-ink: #071632;
  --sky-deep: #09205d;
  --sky-cobalt: #103c86;
  --sky-teal: #33e1df;
  --sky-mint: #aafcf0;
  --sky-coral: #ff6f7e;
  --sky-gold: #ffd362;
  --sky-cream: #fff8d8;
  --sky-glass: rgba(8, 23, 66, 0.82);
  --sky-line: rgba(184, 242, 255, 0.24);
  --sky-shadow: 0 30px 80px rgba(0, 4, 28, 0.56);
  font-family: Inter, ui-rounded, "Avenir Next", "Trebuchet MS", system-ui, -apple-system, sans-serif;
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overscroll-behavior: none;
  background: #061536;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  color: white;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle at 15% 8%, rgba(47, 231, 222, 0.2), transparent 26rem),
    radial-gradient(circle at 90% 80%, rgba(255, 111, 126, 0.2), transparent 32rem),
    linear-gradient(150deg, #071331, #102b68 56%, #090d31);
}

button,
select,
a {
  font: inherit;
}

button,
a,
select {
  touch-action: manipulation;
}

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
canvas:focus-visible {
  outline: 4px solid var(--sky-gold);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skyworks-app {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(3, 10, 39, 0.14), rgba(3, 10, 39, 0.82)),
    url("assets/skyworks/skyworks-world.webp") center / cover fixed;
}

.skyworks-app::before,
.skyworks-app::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
}

.skyworks-app::before {
  opacity: 0.42;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.9) 0 1px, transparent 1.5px),
    radial-gradient(circle, rgba(120,252,244,.72) 0 1.5px, transparent 2px);
  background-position: 10px 14px, 48px 64px;
  background-size: 94px 94px, 137px 137px;
  animation: sky-drift 24s linear infinite;
  mask-image: linear-gradient(to bottom, #000 0 28%, transparent 65%);
}

.skyworks-app::after {
  background:
    linear-gradient(90deg, rgba(0, 3, 26, .46), transparent 16%, transparent 84%, rgba(0, 3, 26, .46)),
    linear-gradient(180deg, transparent 64%, rgba(1, 8, 35, .76));
}

@keyframes sky-drift {
  to { background-position: 104px 108px, -89px 201px; }
}

.sky-hud {
  position: relative;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) minmax(270px, 0.9fr) minmax(390px, 1fr);
  align-items: center;
  gap: clamp(12px, 2vw, 30px);
  min-height: 82px;
  padding: 10px max(18px, calc((100vw - 1500px) / 2));
  border-bottom: 1px solid rgba(195, 242, 255, .23);
  box-shadow: 0 14px 42px rgba(0, 4, 27, .26);
  background:
    linear-gradient(180deg, rgba(11, 22, 68, .97), rgba(15, 22, 66, .89)),
    radial-gradient(circle at 30%, rgba(62, 227, 220, .22), transparent 30%);
  backdrop-filter: blur(22px) saturate(1.2);
}

.brand-lockup {
  display: inline-flex;
  width: max-content;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
}

.brand-gem {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border: 3px solid #fff1a7;
  border-radius: 17px 22px 17px 22px;
  box-shadow: inset 0 3px 0 rgba(255, 255, 255, .6), 0 6px 0 #a8502a, 0 9px 18px rgba(0,0,0,.33);
  color: #15336c;
  font-size: 29px;
  font-weight: 1000;
  line-height: 1;
  transform: rotate(-3deg);
  background: linear-gradient(145deg, #ffe370, #ffad3f);
}

.brand-copy,
.stage-lockup > span:last-child {
  display: flex;
  flex-direction: column;
}

.brand-copy strong {
  font-size: 22px;
  letter-spacing: -.02em;
  line-height: 1;
}

.brand-copy small,
.stage-lockup small,
.hud-chip small,
.mission-copy small,
.coach-strip small,
.stage-banner small,
.eyebrow {
  font-weight: 950;
  letter-spacing: .12em;
}

.brand-copy small {
  margin-top: 5px;
  color: var(--sky-gold);
  font-size: 10px;
  text-transform: uppercase;
}

.stage-lockup {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 13px;
  padding: 8px 20px;
  border: 1px solid rgba(172, 248, 242, .22);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  background: rgba(2, 12, 43, .5);
}

.stage-orbit {
  position: relative;
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid rgba(98, 247, 237, .75);
  border-radius: 50%;
  box-shadow: 0 0 18px rgba(47, 235, 225, .3), inset 0 0 12px rgba(47, 235, 225, .18);
}

.stage-orbit::before,
.stage-orbit::after,
.stage-orbit i {
  display: block;
  border-radius: 50%;
  content: "";
}

.stage-orbit::before {
  width: 17px;
  height: 17px;
  background: radial-gradient(circle at 35% 30%, #fff8c2, #ffc64c 55%, #f36d5b);
}

.stage-orbit::after {
  position: absolute;
  width: 48px;
  height: 15px;
  border: 1px solid rgba(255, 220, 96, .65);
  transform: rotate(-18deg);
}

.stage-orbit i {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 6px;
  height: 6px;
  background: #fff;
  box-shadow: 0 0 8px white;
}

.stage-lockup small {
  color: #77f2eb;
  font-size: 9px;
}

.stage-lockup strong {
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.run-hud {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 8px;
}

.hud-chip,
.hud-button {
  min-height: 54px;
  border: 1px solid rgba(184, 242, 255, .2);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09);
  background: rgba(4, 14, 50, .64);
}

.hud-chip {
  display: grid;
  min-width: 73px;
  grid-template-columns: auto auto;
  grid-template-rows: 1fr 1fr;
  align-items: center;
  justify-content: center;
  column-gap: 6px;
  padding: 6px 11px;
}

.hud-chip > b:first-child {
  grid-row: 1 / -1;
  color: var(--sky-gold);
  font-size: 20px;
  text-shadow: 0 2px 8px rgba(255, 167, 40, .42);
}

.hud-chip strong,
.beacon-chip b {
  align-self: end;
  font-size: 16px;
}

.hud-chip small {
  align-self: start;
  color: #9bb9de;
  font-size: 7px;
}

.health-chip {
  grid-template-columns: 1fr;
  min-width: 92px;
  color: #ff8190;
}

.health-chip > b:first-child {
  grid-row: auto;
  letter-spacing: 2px;
  font-size: 18px;
}

.health-chip small {
  text-align: center;
}

.beacon-chip {
  grid-template-columns: 1fr;
}

.beacon-chip b {
  color: var(--sky-mint) !important;
  grid-row: auto !important;
}

.beacon-chip small { text-align: center; }

.hud-button {
  display: inline-flex;
  min-width: 94px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.hud-button:hover {
  border-color: rgba(133, 251, 243, .66);
  transform: translateY(-2px);
  background: rgba(25, 63, 114, .84);
}

.hud-button span {
  color: var(--sky-gold);
  font-size: 18px;
  font-weight: 1000;
}

.hud-button b { font-size: 12px; }

.game-shell {
  position: relative;
  z-index: 2;
  display: grid;
  width: min(1500px, 100%);
  min-height: calc(100dvh - 90px);
  margin: 0 auto;
  place-items: center;
  padding: clamp(14px, 2vw, 28px);
}

.game-card {
  position: relative;
  width: 100%;
  border: 1px solid rgba(177, 244, 242, .31);
  border-radius: 30px;
  box-shadow: var(--sky-shadow), inset 0 1px 0 rgba(255,255,255,.17);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(23, 51, 102, .92), rgba(4, 16, 54, .96)),
    rgba(3, 12, 43, .94);
}

.game-card::before {
  position: absolute;
  z-index: 4;
  inset: 0;
  border: 4px solid rgba(255,255,255,.06);
  border-radius: inherit;
  pointer-events: none;
  content: "";
}

.canvas-wrap {
  position: relative;
  width: 100%;
  /* Header + outer padding + mission deck total about 220px on desktop. */
  height: clamp(420px, calc(100dvh - 222px), 760px);
  max-height: none;
  overflow: hidden;
  background: #102663;
}

#skyworks-canvas {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  touch-action: none;
}

.canvas-glass {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(0, 9, 50, .38), inset 0 2px 0 rgba(255,255,255,.13);
  background:
    linear-gradient(180deg, rgba(255,255,255,.025), transparent 14% 78%, rgba(3,8,33,.2)),
    radial-gradient(ellipse at 50% -20%, rgba(255,255,255,.13), transparent 48%);
}

.boss-meter {
  position: absolute;
  z-index: 7;
  top: 16px;
  left: 50%;
  width: min(550px, calc(100% - 36px));
  padding: 12px 16px 13px;
  border: 1px solid rgba(255, 215, 113, .58);
  border-radius: 19px;
  box-shadow: 0 16px 45px rgba(0, 4, 34, .48), inset 0 1px 0 rgba(255,255,255,.2), inset 0 -2px 0 rgba(0,0,0,.2);
  transform: translateX(-50%);
  animation: boss-meter-in .42s cubic-bezier(.2,.85,.2,1.14);
  background:
    linear-gradient(105deg, rgba(37, 22, 71, .94), rgba(11, 32, 74, .94)),
    rgba(5, 14, 51, .95);
  backdrop-filter: blur(15px) saturate(1.25);
}

.boss-meter::before,
.boss-meter::after {
  position: absolute;
  top: 10px;
  width: 8px;
  height: calc(100% - 20px);
  border-radius: 999px;
  content: "";
  background: linear-gradient(180deg, var(--sky-gold), var(--sky-coral));
}

.boss-meter::before { left: -4px; }
.boss-meter::after { right: -4px; }

.boss-meter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.boss-meter-heading span {
  overflow: hidden;
  color: var(--sky-cream);
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: .11em;
  text-overflow: ellipsis;
  text-shadow: 0 2px 0 rgba(0,0,0,.35);
  white-space: nowrap;
}

.boss-meter-heading b {
  flex: 0 0 auto;
  padding: 5px 8px;
  border: 1px solid rgba(255, 219, 108, .34);
  border-radius: 999px;
  color: var(--sky-gold);
  font-size: 8px;
  letter-spacing: .1em;
  background: rgba(255, 192, 73, .09);
}

.boss-health {
  position: relative;
  height: 15px;
  padding: 3px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  box-shadow: inset 0 3px 5px rgba(0,0,0,.44);
  background: rgba(1, 8, 35, .77);
}

.boss-health i {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  box-shadow: 0 0 16px rgba(255, 106, 116, .56);
  transition: width .42s cubic-bezier(.16,.8,.2,1);
  background: linear-gradient(90deg, #ff786f, #ffb14c 55%, #ffe36f);
}

.boss-health i::after {
  position: absolute;
  inset: 0;
  content: "";
  transform: translateX(-110%);
  animation: boss-health-shine 2.1s ease-in-out infinite;
  background: linear-gradient(105deg, transparent 28%, rgba(255,255,255,.65), transparent 68%);
}

.boss-meter > small {
  display: block;
  margin-top: 6px;
  overflow: hidden;
  color: #c5ddf5;
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .035em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes boss-meter-in {
  from { opacity: 0; transform: translate(-50%, -16px) scale(.94); }
}

@keyframes boss-health-shine {
  55%, 100% { transform: translateX(120%); }
}

.mission-deck {
  position: relative;
  z-index: 6;
  display: grid;
  min-height: 78px;
  grid-template-columns: minmax(250px, .9fr) minmax(240px, 1.4fr) auto;
  align-items: center;
  gap: clamp(18px, 3vw, 42px);
  padding: 13px 22px 14px;
  border-top: 1px solid rgba(178, 241, 255, .22);
  background: linear-gradient(90deg, rgba(6, 26, 74, .98), rgba(11, 33, 77, .96), rgba(8, 19, 60, .98));
}

.mission-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.mission-copy small {
  color: var(--sky-teal);
  font-size: 9px;
}

.mission-copy strong {
  overflow: hidden;
  margin-top: 4px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.stage-progress {
  position: relative;
  height: 12px;
  overflow: visible;
  border: 1px solid rgba(184, 247, 244, .25);
  border-radius: 999px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.42);
  background: rgba(0, 7, 33, .58);
}

.stage-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  box-shadow: 0 0 15px rgba(51, 225, 223, .6);
  transition: width .28s ease;
  background: linear-gradient(90deg, var(--sky-teal), #a8fff0 68%, var(--sky-gold));
}

.stage-progress span {
  position: absolute;
  right: 0;
  bottom: 16px;
  color: #b8d4ed;
  font-size: 10px;
  font-weight: 900;
}

.control-hint {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 5px;
  color: #8fabd0;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .07em;
}

kbd {
  display: grid;
  min-width: 29px;
  height: 29px;
  padding: 0 6px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-bottom-width: 3px;
  border-radius: 8px;
  color: white;
  font-family: inherit;
  font-size: 10px;
  background: rgba(27, 50, 102, .85);
}

.coach-strip {
  position: absolute;
  z-index: 8;
  right: 18px;
  top: 18px;
  display: flex;
  width: min(400px, calc(100% - 36px));
  min-height: 76px;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 4px;
  border: 1px solid rgba(166, 249, 241, .46);
  border-radius: 20px;
  box-shadow: 0 15px 42px rgba(0, 7, 38, .42), inset 0 1px 0 rgba(255,255,255,.15);
  animation: coach-in .36s cubic-bezier(.2,.9,.3,1.2);
  background: linear-gradient(115deg, rgba(6, 27, 76, .93), rgba(15, 49, 94, .88));
  backdrop-filter: blur(15px);
}

.coach-strip img {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 6px 9px rgba(0,0,0,.38));
}

.coach-strip span {
  display: flex;
  flex-direction: column;
}

.coach-strip small {
  color: var(--sky-gold);
  font-size: 8px;
}

.coach-strip strong {
  margin-top: 3px;
  line-height: 1.3;
  font-size: 13px;
}

@keyframes coach-in {
  from { opacity: 0; transform: translateY(-16px) scale(.96); }
}

.stage-banner {
  position: absolute;
  z-index: 9;
  top: 48%;
  left: 50%;
  display: flex;
  min-width: min(460px, calc(100% - 32px));
  flex-direction: column;
  align-items: center;
  padding: 20px 40px;
  border: 1px solid rgba(255, 234, 139, .55);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 5, 35, .55), inset 0 1px 0 rgba(255,255,255,.2);
  text-align: center;
  transform: translate(-50%, -50%);
  animation: banner-in .5s cubic-bezier(.1,.8,.25,1.15);
  background: linear-gradient(135deg, rgba(8, 26, 73, .95), rgba(28, 49, 98, .94));
  backdrop-filter: blur(16px);
}

.stage-banner small {
  color: var(--sky-teal);
  font-size: 9px;
}

.stage-banner strong {
  margin: 3px 0;
  color: var(--sky-cream);
  font-size: clamp(25px, 3vw, 40px);
  line-height: 1;
  text-shadow: 0 3px 0 rgba(0,0,0,.25);
}

.stage-banner span {
  color: var(--sky-gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@keyframes banner-in {
  from { opacity: 0; transform: translate(-50%, -44%) scale(.86); }
}

.save-pulse {
  position: absolute;
  z-index: 8;
  bottom: 16px;
  left: 18px;
  padding: 9px 13px;
  border: 1px solid rgba(174, 255, 241, .3);
  border-radius: 999px;
  box-shadow: 0 7px 22px rgba(0,0,0,.28);
  color: #d9fff5;
  font-size: 10px;
  font-weight: 850;
  background: rgba(5, 37, 70, .83);
  backdrop-filter: blur(12px);
  animation: save-in .28s ease-out;
}

@keyframes save-in {
  from { opacity: 0; transform: translateY(8px); }
}

.touch-controls {
  display: none;
}

.game-overlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  min-height: 100dvh;
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  overflow: auto;
  background:
    radial-gradient(circle at 50% 20%, rgba(51, 225, 223, .17), transparent 42%),
    rgba(3, 8, 35, .78);
  backdrop-filter: blur(18px) saturate(.92);
}

.game-overlay[hidden] { display: none; }

.overlay-dashboard-link {
  position: fixed;
  z-index: 104;
  top: max(12px, env(safe-area-inset-top));
  left: max(12px, env(safe-area-inset-left));
  display: inline-flex;
  min-width: 112px;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 15px;
  border: 1px solid rgba(169, 246, 241, .32);
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(0, 5, 34, .35), inset 0 1px 0 rgba(255,255,255,.12);
  color: #f3fffd;
  font-size: 11px;
  font-weight: 900;
  text-decoration: none;
  background: rgba(8, 27, 72, .9);
  backdrop-filter: blur(14px);
}

.overlay-dashboard-link:focus-visible {
  outline: 4px solid rgba(255, 226, 111, .9);
  outline-offset: 3px;
}

.opening-overlay {
  place-items: start center;
}

/* Keep the shared settings affordance available without covering start,
   resume, math, or pause actions when a modal owns the screen. */
.skyworks-app:has(.game-overlay:not([hidden])) ~ .ck-settings-launcher {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  bottom: auto;
  left: auto;
}

.opening-card,
.finish-card,
.compact-card {
  position: relative;
  border: 1px solid rgba(179, 247, 245, .3);
  box-shadow: 0 36px 110px rgba(0, 3, 30, .7), inset 0 1px 0 rgba(255,255,255,.16);
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(10, 31, 81, .98), rgba(9, 20, 60, .98)),
    #0a1d52;
}

.opening-card::before,
.finish-card::before,
.compact-card::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: radial-gradient(circle at 20% 0, rgba(67, 239, 228, .14), transparent 32%), radial-gradient(circle at 100% 100%, rgba(255, 105, 121, .15), transparent 38%);
}

.opening-card {
  display: grid;
  width: min(1160px, 95vw);
  min-height: min(650px, 88dvh);
  grid-template-columns: 43% 57%;
  margin-block: auto;
  border-radius: 38px;
}

.opening-art {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  border-right: 1px solid rgba(177, 245, 243, .22);
  background:
    linear-gradient(180deg, transparent 30%, rgba(4, 18, 57, .5) 84%),
    url("assets/skyworks/skyworks-world.webp") center / cover;
}

.opening-art::before {
  position: absolute;
  z-index: 2;
  right: -12%;
  bottom: -10%;
  left: -12%;
  height: 36%;
  border-radius: 50% 50% 0 0;
  filter: blur(5px);
  content: "";
  background: radial-gradient(ellipse at 50% 25%, #fff7d4, #aee4ee 34%, rgba(72, 92, 163, .72) 69%, transparent 72%);
}

.opening-sun {
  position: absolute;
  top: 12%;
  left: 13%;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  box-shadow: 0 0 70px rgba(255, 210, 96, .62);
  background: radial-gradient(circle, #fffad8, #ffcf61 43%, rgba(255, 115, 116, .2) 70%, transparent 72%);
}

.opening-pip {
  position: absolute;
  z-index: 4;
  right: -2%;
  bottom: 4%;
  width: 94%;
  height: 90%;
  object-fit: contain;
  filter: drop-shadow(0 28px 24px rgba(0, 5, 34, .62));
  transform: rotate(-2deg);
  animation: pip-float 4.4s ease-in-out infinite;
}

.opening-mica {
  position: absolute;
  z-index: 5;
  bottom: 5%;
  left: -3%;
  width: 42%;
  max-height: 42%;
  object-fit: contain;
  filter: drop-shadow(0 17px 16px rgba(0, 5, 34, .58));
  animation: mica-float 3.6s .4s ease-in-out infinite;
}

@keyframes pip-float {
  50% { transform: translateY(-12px) rotate(-1deg); }
}

@keyframes mica-float {
  50% { transform: translateY(-10px) rotate(2deg); }
}

.opening-copy {
  position: relative;
  z-index: 3;
  display: flex;
  justify-content: center;
  flex-direction: column;
  padding: clamp(28px, 3.4vw, 48px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--sky-teal);
  font-size: 10px;
}

.opening-copy h1,
.compact-card h2,
.finish-card h2 {
  margin: 0;
  color: var(--sky-cream);
  letter-spacing: -.055em;
  line-height: .93;
  text-shadow: 0 4px 0 rgba(1, 8, 39, .28);
}

.opening-copy h1 {
  font-size: clamp(47px, 5.4vw, 72px);
}

.opening-copy h1 span {
  display: block;
  color: var(--sky-gold);
  font-size: .47em;
  letter-spacing: -.01em;
}

.opening-lede {
  max-width: 520px;
  margin: 16px 0 14px;
  color: #d8eaff;
  font-size: 15px;
  line-height: 1.55;
}

.feature-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
}

.feature-row span {
  padding: 7px 10px;
  border: 1px solid rgba(136, 245, 237, .24);
  border-radius: 999px;
  color: #d9fff8;
  font-size: 10px;
  font-weight: 850;
  background: rgba(23, 79, 119, .46);
}

.experience-picker {
  margin-bottom: 11px;
}

.experience-picker-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin: 0 2px 8px;
}

.experience-picker-heading strong {
  color: var(--sky-cream);
  font-size: 12px;
  letter-spacing: -.01em;
}

.experience-picker-heading small {
  color: #86a8ce;
  font-size: 8px;
  text-align: right;
}

.experience-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.experience-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 84px;
  grid-template-columns: 48px minmax(0, 1fr) 19px;
  align-items: center;
  gap: 10px;
  padding: 11px 10px;
  overflow: hidden;
  border: 1px solid rgba(170, 235, 255, .19);
  border-radius: 18px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
  color: white;
  cursor: pointer;
  text-align: left;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease, filter .2s ease;
  background: linear-gradient(145deg, rgba(21, 56, 105, .82), rgba(8, 24, 65, .9));
}

.experience-card::after {
  position: absolute;
  right: -22px;
  bottom: -35px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  pointer-events: none;
  content: "";
  opacity: .35;
  background: radial-gradient(circle, rgba(76, 238, 229, .55), transparent 68%);
}

.experience-card:hover {
  border-color: rgba(139, 247, 239, .5);
  filter: brightness(1.07);
  transform: translateY(-2px);
}

.experience-card[aria-pressed="true"] {
  border-color: rgba(255, 226, 116, .78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 0 0 2px rgba(255, 211, 98, .14), 0 9px 24px rgba(0, 5, 39, .28);
  background: linear-gradient(145deg, rgba(31, 94, 135, .94), rgba(22, 49, 100, .94));
}

.tower-rescue-card[aria-pressed="true"] {
  background: linear-gradient(145deg, rgba(68, 47, 116, .95), rgba(19, 44, 96, .96));
}

.experience-emblem {
  position: relative;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 16px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.32), 0 6px 12px rgba(0,0,0,.24);
}

.sky-run-card .experience-emblem {
  background: linear-gradient(145deg, #4fe1de, #3874d1);
}

.sky-run-card .experience-emblem::before,
.sky-run-card .experience-emblem::after,
.sky-run-card .experience-emblem i {
  position: absolute;
  border-radius: 999px;
  content: "";
  background: #efffff;
}

.sky-run-card .experience-emblem::before { width: 29px; height: 12px; top: 23px; left: 9px; }
.sky-run-card .experience-emblem::after { width: 16px; height: 16px; top: 16px; left: 15px; }
.sky-run-card .experience-emblem i { width: 9px; height: 9px; top: 19px; right: 8px; opacity: .88; }

.tower-rescue-card .experience-emblem {
  background: linear-gradient(145deg, #ff9a6a, #7d58d4);
}

.tower-rescue-card .experience-emblem::before {
  position: absolute;
  right: 11px;
  bottom: 7px;
  left: 11px;
  height: 32px;
  border: 3px solid #fff3bd;
  border-top-width: 6px;
  border-radius: 7px 7px 3px 3px;
  box-shadow: inset 0 -9px 0 rgba(255,255,255,.16);
  content: "";
}

.tower-rescue-card .experience-emblem::after {
  position: absolute;
  bottom: 11px;
  left: 17px;
  width: 3px;
  height: 22px;
  box-shadow: 10px 0 0 #fff3bd;
  content: "";
  background: #fff3bd;
}

.tower-rescue-card .experience-emblem i {
  position: absolute;
  z-index: 1;
  bottom: 17px;
  left: 16px;
  width: 15px;
  height: 3px;
  box-shadow: 0 7px 0 #fff3bd;
  background: #fff3bd;
}

.experience-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.experience-copy strong {
  overflow: hidden;
  font-size: 12px;
  letter-spacing: -.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.experience-copy small {
  margin-top: 4px;
  color: #a8c8e5;
  font-size: 8px;
  font-weight: 750;
  line-height: 1.25;
}

.experience-check {
  position: relative;
  z-index: 1;
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: 50%;
  color: transparent;
  font-size: 11px;
  font-weight: 1000;
  background: rgba(0, 8, 35, .4);
}

.experience-card[aria-pressed="true"] .experience-check {
  border-color: #fff2ae;
  box-shadow: 0 0 13px rgba(255, 215, 99, .38);
  color: #173060;
  background: var(--sky-gold);
}

.math-select {
  display: grid;
  grid-template-columns: 1fr minmax(170px, .85fr);
  align-items: center;
  gap: 15px;
  padding: 12px 13px;
  border: 1px solid rgba(178, 241, 255, .21);
  border-radius: 17px;
  background: rgba(3, 14, 48, .54);
}

.challenge-select {
  margin-bottom: 9px;
  border-color: rgba(255, 222, 116, .28);
  background: linear-gradient(115deg, rgba(19, 53, 98, .7), rgba(26, 34, 82, .62));
}

.tower-stage-select {
  margin-bottom: 9px;
  border-color: rgba(183, 140, 255, .4);
  background: linear-gradient(115deg, rgba(57, 38, 108, .76), rgba(20, 45, 94, .7));
}

.tower-stage-select select {
  border-color: rgba(218, 184, 255, .42);
  background: #3b357e;
}

.math-select > span {
  display: flex;
  flex-direction: column;
}

.math-select strong { font-size: 12px; }
.math-select small { margin-top: 3px; color: #99b8d9; font-size: 9px; }

.math-select select {
  width: 100%;
  min-height: 48px;
  padding: 0 34px 0 12px;
  border: 1px solid rgba(155, 247, 241, .32);
  border-radius: 13px;
  color: white;
  font-size: 11px;
  font-weight: 800;
  background: #123b78;
}

.opening-actions,
.stacked-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

.launch-button,
.resume-button,
.soft-button,
.text-link,
.math-answers button {
  min-height: 48px;
  border: 0;
  border-radius: 15px;
  cursor: pointer;
  font-weight: 950;
  transition: transform .18s ease, filter .18s ease, box-shadow .18s ease;
}

.launch-button {
  min-height: 55px;
  padding: 0 22px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.5), 0 6px 0 #b54e30, 0 12px 28px rgba(255, 115, 78, .22);
  color: #152250;
  background: linear-gradient(180deg, #ffe477, #ffb846 64%, #ff8e47);
}

.launch-button:disabled {
  cursor: wait;
  filter: grayscale(.35);
  opacity: .72;
}

.resume-button,
.soft-button {
  padding: 0 20px;
  border: 1px solid rgba(154, 246, 240, .35);
  color: #e9fffc;
  background: linear-gradient(180deg, rgba(29, 93, 137, .84), rgba(13, 54, 104, .9));
}

.text-link {
  min-height: 44px;
  padding: 0 18px;
  color: #bfe8ff;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.launch-button:hover,
.resume-button:hover,
.soft-button:hover,
.math-answers button:hover {
  filter: brightness(1.08);
  transform: translateY(-2px);
}

.device-note {
  margin: 15px 0 0;
  color: #7897bd;
  font-size: 9px;
  line-height: 1.4;
  text-align: center;
}

.compact-card {
  width: min(500px, calc(100vw - 32px));
  padding: clamp(30px, 5vw, 50px);
  border-radius: 30px;
  text-align: center;
}

.compact-card > * { position: relative; z-index: 2; }

.compact-card h2,
.finish-card h2 {
  font-size: clamp(34px, 6vw, 52px);
}

.compact-card > p:not(.eyebrow) {
  margin: 15px auto 0;
  color: #c7dcf4;
  font-size: 13px;
  line-height: 1.5;
}

.modal-icon {
  display: grid;
  width: 70px;
  height: 70px;
  margin: 0 auto 18px;
  place-items: center;
  border: 2px solid rgba(255, 235, 144, .55);
  border-radius: 24px;
  box-shadow: inset 0 2px 0 rgba(255,255,255,.35), 0 10px 25px rgba(0,0,0,.3);
  color: #193368;
  font-size: 31px;
  font-weight: 1000;
  transform: rotate(-4deg);
  background: linear-gradient(145deg, #ffe478, #ff9b49);
}

.math-question {
  margin: 23px 0 18px;
  padding: 17px;
  border: 1px solid rgba(159, 246, 239, .3);
  border-radius: 20px;
  color: var(--sky-cream);
  font-size: clamp(35px, 7vw, 55px);
  font-weight: 1000;
  letter-spacing: -.04em;
  background: rgba(3, 13, 48, .6);
}

.math-answers {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.math-answers button {
  min-height: 61px;
  border: 1px solid rgba(171, 249, 243, .32);
  color: #fff;
  font-size: 18px;
  background: linear-gradient(180deg, #225f9c, #173f7f);
}

.math-answers button.is-correct {
  border-color: #b9ffae;
  box-shadow: 0 0 24px rgba(130, 255, 163, .4);
  background: linear-gradient(180deg, #3aa86f, #147265);
}

.math-answers button.is-try-again {
  animation: answer-wiggle .33s ease;
  background: linear-gradient(180deg, #b95f83, #713b77);
}

@keyframes answer-wiggle {
  30% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
}

.skip-math { margin-top: 10px; }

.clear-card .modal-icon {
  animation: beacon-pulse 1.5s ease-in-out infinite;
}

@keyframes beacon-pulse {
  50% { box-shadow: inset 0 2px 0 rgba(255,255,255,.45), 0 0 38px rgba(255,215,95,.56); transform: rotate(4deg) scale(1.06); }
}

.finish-card {
  display: grid;
  width: min(870px, calc(100vw - 34px));
  grid-template-columns: 42% 58%;
  align-items: center;
  border-radius: 36px;
}

.finish-card > img {
  position: relative;
  z-index: 2;
  width: 112%;
  max-height: 560px;
  object-fit: contain;
  filter: drop-shadow(0 25px 24px rgba(0,0,0,.42));
}

.finish-card > div {
  position: relative;
  z-index: 3;
  padding: 42px 50px 42px 24px;
}

.finish-card p:not(.eyebrow) {
  color: #c9ddf4;
  font-size: 14px;
  line-height: 1.55;
}

.finish-score {
  display: flex;
  gap: 10px;
  margin: 22px 0;
}

.finish-score span {
  display: flex;
  min-width: 115px;
  flex: 1;
  flex-direction: column;
  padding: 12px;
  border: 1px solid rgba(172, 248, 242, .24);
  border-radius: 16px;
  color: #9db8d9;
  font-size: 10px;
  font-weight: 800;
  text-align: center;
  background: rgba(3, 14, 48, .52);
}

.finish-score b {
  color: var(--sky-gold);
  font-size: 25px;
}

@media (max-width: 1050px) {
  .sky-hud {
    grid-template-columns: auto 1fr auto;
    padding-inline: 13px;
  }

  .brand-copy small,
  .stage-lockup small,
  .control-hint { display: none; }

  .brand-copy strong { font-size: 18px; }
  .brand-gem { width: 46px; height: 46px; font-size: 25px; }
  .stage-lockup { min-width: 0; padding-inline: 12px; }
  .stage-lockup strong { max-width: 180px; }
  .mission-deck { grid-template-columns: minmax(180px, .8fr) 1.3fr; }
  .canvas-wrap { max-height: none; }
}

@media (min-width: 1100px) {
  /* Reserve a true home for the shared family-settings launcher instead of
     letting it cover the mission text on wide play screens. */
  .mission-deck {
    padding-left: 190px;
  }
}

@media (hover: none), (pointer: coarse), (max-width: 900px) {
  body { padding-bottom: 118px; }

  .skyworks-app { min-height: calc(100dvh - 118px); background-attachment: scroll; }

  .game-shell {
    min-height: 0;
    padding: 10px;
  }

  .game-card { border-radius: 24px; }

  .canvas-wrap {
    height: clamp(380px, calc(100dvh - 330px), 860px);
    max-height: none;
    aspect-ratio: auto;
  }

  .touch-controls {
    position: fixed;
    z-index: 85;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: calc(112px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(6, minmax(44px, 82px));
    align-items: center;
    justify-content: center;
    gap: clamp(7px, 1.5vw, 14px);
    padding: 10px max(18px, env(safe-area-inset-right)) calc(10px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
    border-top: 1px solid rgba(159, 241, 240, .27);
    box-shadow: 0 -14px 40px rgba(0, 5, 32, .36), inset 0 1px 0 rgba(255,255,255,.08);
    background: linear-gradient(180deg, rgba(9, 27, 70, .91), rgba(5, 15, 51, .98));
    backdrop-filter: blur(18px) saturate(1.2);
  }

  .touch-move,
  .touch-climb,
  .touch-actions {
    display: contents;
  }

  .touch-controls button {
    display: grid;
    width: 100%;
    min-width: 44px;
    min-height: 44px;
    height: 74px;
    cursor: pointer;
    place-items: center;
    border: 1px solid rgba(172, 248, 242, .33);
    border-radius: 24px;
    box-shadow: inset 0 2px 0 rgba(255,255,255,.13), 0 5px 0 rgba(0,4,31,.42);
    color: #efffff;
    font-size: 25px;
    background: linear-gradient(180deg, rgba(31, 83, 135, .95), rgba(14, 46, 100, .98));
  }

  .touch-controls button.is-pressed,
  .touch-controls button:active {
    transform: translateY(4px);
    box-shadow: inset 0 2px 7px rgba(0,0,0,.2), 0 1px 0 rgba(0,4,31,.45);
  }

  .touch-controls .jump-button {
    border-color: rgba(255, 237, 147, .62);
    color: #172b60;
    background: linear-gradient(180deg, #ffe378, #ffab45);
  }

  .touch-controls .action-button {
    color: #0b315c;
    background: linear-gradient(180deg, #9cfff0, #37d7d7);
  }

  .touch-controls .climb-button {
    border-color: rgba(204, 177, 255, .46);
    background: linear-gradient(180deg, rgba(114, 98, 188, .98), rgba(52, 61, 136, .98));
  }

  .touch-climb button,
  .touch-actions button {
    grid-template-rows: 1fr auto;
    padding: 8px 0;
  }

  .touch-climb button span,
  .touch-actions button span { line-height: 1; }

  .touch-climb button small,
  .touch-actions button small { font-size: 8px; font-weight: 950; letter-spacing: .1em; }

  /* The shared global-settings launcher is injected after the app. Keep it above
     the play controls so neither control can hide the other on a tablet. */
  .skyworks-app ~ .ck-settings-launcher {
    bottom: calc(124px + env(safe-area-inset-bottom));
    left: auto;
    right: max(12px, env(safe-area-inset-right));
  }
}

@media (max-width: 720px) {
  body { padding-bottom: 102px; }

  .sky-hud {
    min-height: 66px;
    grid-template-columns: auto 1fr;
    gap: 8px;
  }

  .brand-gem { width: 44px; height: 44px; border-radius: 14px 18px; }
  .brand-copy { display: none; }
  .brand-lockup { min-height: 46px; }
  .stage-lockup { justify-self: start; min-height: 48px; max-width: calc(100vw - 80px); }
  .stage-orbit { width: 33px; height: 33px; }
  .stage-orbit::after { width: 39px; }
  .stage-lockup strong { max-width: calc(100vw - 154px); font-size: 13px; }

  .run-hud {
    grid-column: 1 / -1;
    position: absolute;
    z-index: 12;
    top: 70px;
    right: 16px;
    gap: 5px;
    pointer-events: none;
  }

  .hud-chip {
    min-width: 51px;
    min-height: 37px;
    padding: 3px 7px;
    border-radius: 12px;
    background: rgba(3, 14, 49, .8);
  }

  .hud-chip > b:first-child { font-size: 13px; }
  .hud-chip strong, .beacon-chip b { font-size: 12px; }
  .hud-chip small { display: none; }
  .health-chip { min-width: 69px; }
  .health-chip > b:first-child { font-size: 13px; }

  .hud-button {
    min-width: 44px;
    min-height: 44px;
    pointer-events: auto;
    border-radius: 14px;
    background: rgba(3, 14, 49, .88);
  }

  .hud-button b { display: none; }

  .game-shell { padding: 7px; }
  .game-card { border-radius: 17px; }
  .canvas-wrap { min-height: min(58dvh, 410px); aspect-ratio: auto; }

  .mission-deck {
    min-height: 64px;
    grid-template-columns: minmax(150px, 1fr) minmax(110px, .8fr);
    gap: 14px;
    padding: 10px 12px;
  }

  .mission-copy strong { font-size: 11px; }
  .mission-copy small { font-size: 7px; }

  .coach-strip {
    top: auto;
    right: 10px;
    bottom: 10px;
    width: calc(100% - 20px);
    min-height: 60px;
    padding: 5px 10px 5px 2px;
    border-radius: 15px;
  }

  .coach-strip img { width: 54px; height: 54px; }
  .coach-strip strong { font-size: 11px; }

  .boss-meter {
    top: 64px;
    width: calc(100% - 20px);
    padding: 10px 13px 11px;
    border-radius: 16px;
  }

  .boss-meter-heading span { font-size: 10px; }
  .boss-meter > small { font-size: 8px; }

  .stage-banner { padding: 17px 20px; }
  .stage-banner strong { font-size: 27px; }

  .touch-controls {
    height: calc(96px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(6, minmax(44px, 84px));
    gap: 6px;
    padding-top: 8px;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .touch-controls button {
    width: 100%;
    height: 66px;
    border-radius: 20px;
  }

  .touch-move,
  .touch-climb,
  .touch-actions { gap: 0; }

  .skyworks-app ~ .ck-settings-launcher {
    bottom: calc(108px + env(safe-area-inset-bottom));
  }

  .game-overlay { align-items: start; }
  .opening-card { display: block; min-height: 0; border-radius: 27px; }

  .opening-art {
    min-height: 245px;
    border-right: 0;
    border-bottom: 1px solid rgba(177, 245, 243, .22);
  }

  .opening-sun { width: 90px; height: 90px; }
  .opening-pip { right: 5%; bottom: -7%; width: 74%; height: 110%; }
  .opening-mica { left: 2%; bottom: -1%; width: 35%; }
  .opening-copy { padding: 27px 23px 30px; }
  .opening-copy h1 { font-size: clamp(43px, 14vw, 61px); }
  .opening-lede { margin: 15px 0 13px; font-size: 12px; }
  .feature-row { margin-bottom: 13px; }
  .experience-card { min-height: 78px; }
  .math-select { grid-template-columns: 1fr; gap: 9px; }
  .opening-actions { margin-top: 13px; }
  .device-note { margin-top: 12px; }

  .finish-card { display: block; width: min(500px, calc(100vw - 28px)); text-align: center; }
  .finish-card > img { display: block; width: 65%; max-height: 250px; margin: -20px auto -15px; }
  .finish-card > div { padding: 20px 25px 31px; }
}

@media (max-width: 520px) {
  .experience-picker-heading small { display: none; }
  .experience-grid { grid-template-columns: 1fr; }
  .experience-card { min-height: 72px; }
}

@media (max-width: 390px) {
  .run-hud { right: 8px; }
  .beacon-chip { display: none; }
  .canvas-wrap { min-height: 53dvh; }
  .mission-deck { grid-template-columns: 1fr; }
  .stage-progress { display: none; }
  .touch-controls { padding-inline: 10px; }
  .touch-controls button { width: 100%; }
  .opening-card { width: calc(100vw - 22px); }
  .opening-art { min-height: 210px; }
  .opening-copy { padding: 22px 19px 25px; }
  .feature-row span { font-size: 8px; }
  .finish-score { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

html[data-codekin-motion="calm"] .skyworks-app::before,
html[data-codekin-motion="calm"] .opening-pip,
html[data-codekin-motion="calm"] .opening-mica,
html[data-codekin-motion="calm"] .clear-card .modal-icon {
  animation: none;
}

html[data-codekin-text="large"] .mission-copy strong,
html[data-codekin-text="large"] .coach-strip strong {
  font-size: 1rem;
}

html[data-codekin-text="large"] .opening-lede,
html[data-codekin-text="large"] .compact-card > p,
html[data-codekin-text="large"] .finish-card p {
  font-size: 1.05rem;
}
