@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Space+Grotesk:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  --ink: #f7f8ff;
  --muted: #a6a5bc;
  --cyan: #27e5ff;
  --blue: #5574ff;
  --violet: #a34bff;
  --pink: #ff4edb;
  --panel: rgba(9, 8, 31, 0.68);
  --line: rgba(255, 255, 255, 0.15);
}

* { box-sizing: border-box; }

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #070617;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
  -webkit-touch-callout: none;
  -webkit-text-size-adjust: 100%;
}

button,
a { -webkit-tap-highlight-color: transparent; }

button { font: inherit; }

#game-shell {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  isolation: isolate;
  background: #090820;
  overflow: hidden;
  touch-action: none;
  overscroll-behavior: none;
  -webkit-touch-callout: none;
}

#game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
  touch-action: none;
  cursor: default;
}

#game-shell.playing #game-canvas { cursor: crosshair; }

#vignette {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, transparent 32%, rgba(3, 2, 16, 0.25) 72%, rgba(3, 2, 14, 0.7) 120%),
    linear-gradient(180deg, rgba(4, 3, 17, 0.1), transparent 20%, transparent 82%, rgba(3, 2, 15, 0.35));
}

.game-ui { position: relative; z-index: 3; }

#topbar {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  right: 0;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(20px, env(safe-area-inset-top)) clamp(24px, 4vw, 72px) 12px;
  pointer-events: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  pointer-events: auto;
}

.brand b { color: var(--cyan); }

.brand-mark {
  position: relative;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 2px solid var(--cyan);
  transform: rotate(45deg);
  box-shadow: 0 0 14px rgba(39, 229, 255, 0.38), inset 0 0 9px rgba(39, 229, 255, 0.2);
}

.brand-mark i {
  width: 7px;
  height: 7px;
  background: white;
  box-shadow: 0 0 10px white;
}

.progress-wrap {
  position: absolute;
  left: 50%;
  top: 22px;
  width: min(420px, 34vw);
  transform: translateX(-50%);
  opacity: 0;
  transition: opacity 300ms ease, transform 300ms ease;
}

#game-shell.playing .progress-wrap,
#game-shell.paused .progress-wrap { opacity: 1; }

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 9px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.progress-label span:last-child { color: white; }

.progress-track {
  position: relative;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.14);
}

#progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), #7f6cff, var(--pink));
  box-shadow: 0 0 14px var(--cyan);
  transition: width 80ms linear;
}

.checkpoint-mark {
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid rgba(255,255,255,.45);
  background: #171533;
  box-shadow: 0 0 0 2px rgba(8,7,27,.8);
  transform: translate(-50%, -50%) rotate(45deg);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.checkpoint-mark.reached {
  border-color: #ffe24a;
  background: #ffe24a;
  box-shadow: 0 0 9px #ffd83d, 0 0 0 2px rgba(8,7,27,.85);
}

.boost-indicator {
  position: absolute;
  top: 39px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffb34a;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .18em;
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.boost-indicator i {
  width: 18px;
  height: 2px;
  background: #ff9a3d;
  box-shadow: 0 0 10px #ff9a3d;
}

.boost-indicator kbd {
  padding: 2px 5px;
  border: 1px solid rgba(255, 179, 74, .45);
  border-radius: 2px;
  color: #ffd398;
  background: rgba(255, 154, 61, .08);
  font: inherit;
}

.boost-indicator b {
  display: none;
  padding: 2px 5px;
  border-radius: 2px;
  color: #1a0d02;
  background: #ffb34a;
  font-size: 7px;
  letter-spacing: .1em;
  box-shadow: 0 0 12px rgba(255, 154, 61, .65);
}

.boost-indicator[data-touch-locked="true"] b { display: inline; }
.boost-indicator[data-touch-locked="true"] kbd { display: none; }

#game-shell.playing.boosting .boost-indicator {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.gravity-indicator {
  position: absolute;
  top: 39px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #9f86ff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .16em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.gravity-indicator i { color: white; font-size: 13px; font-style: normal; text-shadow: 0 0 9px #a34bff; }
#game-shell.inverted:not(.boosting) .gravity-indicator { opacity: 1; transform: translateX(-50%) translateY(0); }

.ship-indicator,
.wave-indicator {
  position: absolute;
  top: 39px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--cyan);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .13em;
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}
.ship-indicator i { color: white; font-size: 13px; font-style: normal; text-shadow: 0 0 9px var(--cyan); }
.wave-indicator { color: var(--pink); }
.wave-indicator i { color: white; font-size: 12px; font-style: normal; text-shadow: 0 0 9px var(--pink); }
#game-shell.ship-mode:not(.boosting) .ship-indicator { opacity: 1; transform: translateX(-50%) translateY(0); }
#game-shell.wave-mode:not(.boosting) .wave-indicator { opacity: 1; transform: translateX(-50%) translateY(0); }

.coin-hud {
  position: absolute;
  top: 29px;
  right: clamp(122px, 10vw, 188px);
  display: flex;
  align-items: center;
  gap: 7px;
  color: #ffe468;
  font-size: 9px;
  letter-spacing: .08em;
  opacity: 0;
  transition: opacity 200ms ease;
}

#game-shell.playing .coin-hud,
#game-shell.paused .coin-hud { opacity: 1; }

.coin-hud i {
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid #ffe468;
  border-radius: 50%;
  color: white;
  font-size: 7px;
  font-style: normal;
  box-shadow: 0 0 9px rgba(255,226,74,.35);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  pointer-events: auto;
}

.volume-control {
  width: 145px;
  height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  background: rgba(9, 8, 32, 0.46);
  backdrop-filter: blur(12px);
}

.volume-control label {
  min-width: 35px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  color: #77768e;
  font-size: 5px;
  font-weight: 800;
  letter-spacing: .12em;
}

.volume-control label b { color: var(--cyan); font-size: 7px; }

.volume-control input {
  --volume-fill: 70%;
  width: 78px;
  height: 16px;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  cursor: pointer;
}

.volume-control input::-webkit-slider-runnable-track {
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(to right, var(--cyan) 0 var(--volume-fill), rgba(255,255,255,.16) var(--volume-fill) 100%);
  box-shadow: 0 0 8px rgba(39,229,255,.2);
}

.volume-control input::-webkit-slider-thumb {
  width: 11px;
  height: 11px;
  margin-top: -4px;
  border: 2px solid #090820;
  border-radius: 50%;
  appearance: none;
  -webkit-appearance: none;
  background: white;
  box-shadow: 0 0 9px var(--cyan);
}

.volume-control input::-moz-range-track { height: 3px; border: 0; border-radius: 2px; background: rgba(255,255,255,.16); }
.volume-control input::-moz-range-progress { height: 3px; border-radius: 2px; background: var(--cyan); }
.volume-control input::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #090820; border-radius: 50%; background: white; box-shadow: 0 0 9px var(--cyan); }
.volume-control:focus-within { border-color: rgba(39,229,255,.65); }

.icon-btn {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 7px;
  color: white;
  background: rgba(9, 8, 32, 0.46);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.icon-btn:hover { border-color: rgba(39, 229, 255, 0.7); background: rgba(39, 229, 255, 0.1); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 17px; fill: currentColor; }
.icon-btn .sound-off { display: none; }
.icon-btn[aria-pressed="true"] .sound-on { display: none; }
.icon-btn[aria-pressed="true"] .sound-off { display: block; }
#pause-btn { opacity: 0; pointer-events: none; }
#game-shell.playing #pause-btn { opacity: 1; pointer-events: auto; }

.touch-boost-btn {
  position: absolute;
  z-index: 7;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  min-width: 112px;
  height: 52px;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid rgba(255, 179, 74, .48);
  border-radius: 26px;
  color: #ffd5a2;
  background: rgba(21, 12, 31, .72);
  box-shadow: 0 8px 28px rgba(0,0,0,.3), inset 0 0 18px rgba(255,154,61,.05);
  backdrop-filter: blur(12px);
  cursor: pointer;
  touch-action: none;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  transition: transform 140ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.touch-boost-btn:active { transform: scale(.94); }
.touch-boost-btn b { min-width: 27px; color: #ffb34a; font-size: 7px; letter-spacing: .08em; }
.touch-boost-icon { display: flex; gap: 2px; }
.touch-boost-icon i { width: 0; height: 0; border-top: 5px solid transparent; border-bottom: 5px solid transparent; border-left: 7px solid currentColor; filter: drop-shadow(0 0 5px currentColor); }
.touch-boost-btn[aria-pressed="true"] {
  border-color: #ffb34a;
  color: #fff4e6;
  background: linear-gradient(110deg, rgba(255,125,34,.54), rgba(255,63,85,.4));
  box-shadow: 0 0 24px rgba(255,126,42,.42), inset 0 0 20px rgba(255,255,255,.08);
}
.touch-boost-btn[aria-pressed="true"] b { color: white; text-shadow: 0 0 7px white; }
#game-shell[data-touch-capable="true"].playing .touch-boost-btn { display: flex; }

.orientation-prompt {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: max(22px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(22px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
  background: rgba(4, 3, 19, .78);
  backdrop-filter: blur(14px);
}
.orientation-prompt[hidden] { display: none; }
.orientation-panel {
  width: min(350px, 100%);
  padding: 31px 25px 24px;
  border: 1px solid rgba(39,229,255,.34);
  border-radius: 8px;
  text-align: center;
  background: linear-gradient(145deg, rgba(18,17,58,.97), rgba(8,7,29,.98));
  box-shadow: 0 24px 80px rgba(0,0,0,.5), inset 0 0 45px rgba(39,229,255,.05);
}
.orientation-panel small { color: var(--cyan); font-size: 7px; font-weight: 800; letter-spacing: .2em; }
.orientation-panel h2 { margin: 9px 0 10px; font-family: "Space Grotesk", sans-serif; font-size: 25px; letter-spacing: -.02em; }
.orientation-panel p { margin: 0 auto 22px; color: var(--muted); font-size: 11px; line-height: 1.6; }
.orientation-panel .secondary-btn { width: 100%; }
.rotate-device { position: relative; width: 76px; height: 63px; margin: 0 auto 18px; }
.rotate-device span { position: absolute; left: 20px; top: 5px; width: 35px; height: 54px; border: 2px solid var(--cyan); border-radius: 6px; box-shadow: 0 0 18px rgba(39,229,255,.3); transform: rotate(-14deg); animation: rotatePhone 1.9s ease-in-out infinite; }
.rotate-device span::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 8px; height: 2px; border-radius: 2px; background: var(--cyan); transform: translateX(-50%); }
.rotate-device i { position: absolute; right: 0; top: 16px; color: #ffb34a; font-size: 23px; font-style: normal; text-shadow: 0 0 10px rgba(255,154,61,.65); }
@keyframes rotatePhone { 0%, 18%, 100% { transform: rotate(-14deg); } 52%, 72% { transform: rotate(76deg); } }

.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 320ms ease, visibility 320ms;
}

.screen.active { opacity: 1; visibility: visible; pointer-events: auto; }

#attempt-screen.active { pointer-events: none; }

#menu-screen {
  display: grid;
  grid-template-columns: minmax(340px, 0.95fr) minmax(300px, 0.72fr);
  align-items: center;
  gap: clamp(60px, 10vw, 170px);
  padding: 100px clamp(70px, 10vw, 190px) 70px;
}

.menu-copy { align-self: center; max-width: 660px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  color: var(--cyan);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
}

.eyebrow span {
  width: 25px;
  height: 1px;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
}

h1 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(66px, 7.25vw, 118px);
  font-weight: 700;
  line-height: 0.78;
  letter-spacing: -0.07em;
  text-shadow: 0 12px 38px rgba(0, 0, 0, 0.35);
}

h1 em {
  color: transparent;
  font-style: normal;
  -webkit-text-stroke: 2px var(--cyan);
  filter: drop-shadow(0 0 16px rgba(39, 229, 255, 0.2));
}

.menu-copy > p {
  margin: 30px 0 28px;
  color: var(--muted);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.75;
}

.play-btn {
  position: relative;
  width: min(410px, 100%);
  height: 75px;
  display: grid;
  grid-template-columns: 48px 1fr 34px;
  align-items: center;
  gap: 15px;
  padding: 0 21px;
  border: 1px solid rgba(39, 229, 255, 0.56);
  border-radius: 5px;
  color: white;
  background: linear-gradient(96deg, rgba(23, 156, 222, 0.2), rgba(77, 39, 155, 0.36));
  box-shadow: 0 0 0 1px rgba(39, 229, 255, 0.06) inset, 0 16px 55px rgba(17, 104, 188, 0.16);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.play-btn::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,.12) 48%, transparent 75%);
  transform: translateX(-110%);
  transition: transform 500ms ease;
}

.play-btn:hover { transform: translateY(-3px); border-color: var(--cyan); box-shadow: 0 20px 60px rgba(39, 229, 255, 0.2); }
.play-btn:hover::before { transform: translateX(110%); }
.play-btn:active { transform: scale(0.985); }

.play-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(39, 229, 255, 0.55);
  border-radius: 50%;
  background: rgba(39, 229, 255, 0.1);
}

.play-icon::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid white;
  filter: drop-shadow(0 0 5px var(--cyan));
}

.play-copy { display: flex; flex-direction: column; gap: 4px; }
.play-copy b { font-size: 14px; letter-spacing: .15em; }
.play-copy small { color: #8fcbd8; font-size: 8px; font-weight: 700; letter-spacing: .14em; }
.play-arrow { color: var(--cyan); font-size: 25px; transition: transform 180ms ease; }
.play-btn:hover .play-arrow { transform: translateX(4px); }

.shop-open-btn {
  width: min(410px, 100%);
  height: 42px;
  margin-top: 10px;
  display: grid;
  grid-template-columns: 24px auto 1fr auto;
  align-items: center;
  gap: 9px;
  padding: 0 14px;
  border: 1px solid rgba(255, 226, 74, .27);
  border-radius: 4px;
  color: #fff;
  background: rgba(255, 226, 74, .055);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.shop-open-btn > span { color: #ffe24a; font-size: 17px; text-shadow: 0 0 10px rgba(255,226,74,.7); }
.shop-open-btn b { font-size: 8px; letter-spacing: .15em; }
.shop-open-btn small { color: #77768e; font-size: 7px; font-weight: 700; letter-spacing: .12em; }
.shop-open-btn em { color: #ffe468; font-size: 9px; font-style: normal; font-weight: 800; letter-spacing: .08em; }
.shop-open-btn:hover { transform: translateY(-2px); border-color: #ffe24a; background: rgba(255,226,74,.1); }

.menu-stats {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 25px;
}

.menu-stats div { min-width: 100px; }
.menu-stats small { display: block; margin-bottom: 7px; color: #75758c; font-size: 7px; font-weight: 700; letter-spacing: .17em; }
.menu-stats strong { font-family: "Space Grotesk", sans-serif; font-size: 18px; }
.menu-stats strong em { color: #6f6e85; font-size: 9px; font-style: normal; }
.menu-stats > span { width: 1px; height: 25px; background: var(--line); }

.level-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 410px;
  margin-top: 22px;
}

.level-selector button {
  width: 38px;
  height: 29px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 3px;
  color: #8d8ca4;
  background: rgba(255,255,255,.035);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: .12em;
  cursor: pointer;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.level-selector button:hover:not(:disabled),
.level-selector button.active {
  border-color: var(--cyan);
  color: white;
  background: rgba(39,229,255,.12);
  box-shadow: 0 0 12px rgba(39,229,255,.12);
}

.level-selector button:disabled { opacity: .24; cursor: not-allowed; }

.menu-options {
  width: min(410px, 100%);
  display: flex;
  align-items: stretch;
  gap: 9px;
  margin-top: 10px;
}

.difficulty-btn {
  width: min(220px, 100%);
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 8px 12px;
  border: 1px solid rgba(92,255,122,.3);
  border-radius: 4px;
  color: white;
  background: rgba(92,255,122,.055);
  cursor: pointer;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.difficulty-btn span { display: flex; flex-direction: column; gap: 3px; }
.difficulty-btn small { color: #777f82; font-size: 6px; font-weight: 800; letter-spacing: .15em; }
.difficulty-btn b { color: #72ff91; font-size: 10px; letter-spacing: .15em; }
.difficulty-btn i { color: #72ff91; font-size: 16px; font-style: normal; transition: transform 200ms ease; }
.difficulty-btn:hover { transform: translateY(-2px); border-color: #72ff91; background: rgba(92,255,122,.1); }
.difficulty-btn:hover i { transform: rotate(100deg); }
.difficulty-btn[data-mode="normal"] { border-color: rgba(39,229,255,.34); background: rgba(39,229,255,.055); }
.difficulty-btn[data-mode="normal"] b, .difficulty-btn[data-mode="normal"] i { color: var(--cyan); }
.difficulty-btn[data-mode="hard"] { border-color: rgba(255,78,219,.36); background: rgba(255,78,219,.06); }
.difficulty-btn[data-mode="hard"] b, .difficulty-btn[data-mode="hard"] i { color: var(--pink); }

.language-toggle {
  min-width: 92px;
  min-height: 43px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  color: #747389;
  background: rgba(255,255,255,.04);
  cursor: pointer;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .12em;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}
.language-toggle i { color: #4e4d61; font-style: normal; }
.language-toggle [data-language-option] { transition: color 160ms ease, text-shadow 160ms ease; }
.language-toggle[data-language="en"] [data-language-option="en"],
.language-toggle[data-language="fr"] [data-language-option="fr"] { color: var(--cyan); text-shadow: 0 0 10px rgba(39,229,255,.55); }
.language-toggle:hover { transform: translateY(-2px); border-color: var(--cyan); background: rgba(39,229,255,.07); }

.level-card {
  position: relative;
  width: min(390px, 31vw);
  justify-self: end;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 3px;
  background: linear-gradient(145deg, rgba(19, 18, 58, .68), rgba(10, 8, 31, .56));
  box-shadow: 0 35px 90px rgba(0, 0, 0, .25), inset 0 0 55px rgba(95, 70, 230, .06);
  backdrop-filter: blur(12px);
  overflow: hidden;
  transform: perspective(900px) rotateY(-4deg);
  animation: cardFloat 5s ease-in-out infinite;
}

@keyframes cardFloat {
  0%, 100% { transform: perspective(900px) rotateY(-4deg) translateY(0); }
  50% { transform: perspective(900px) rotateY(-2deg) translateY(-9px); }
}

.level-card-top { height: 49px; display: flex; align-items: center; justify-content: space-between; padding: 0 17px; border-bottom: 1px solid rgba(255,255,255,.08); }
.level-card-top > span { color: rgba(255,255,255,.38); font-size: 9px; font-weight: 800; letter-spacing: .18em; }
.equalizer { display: flex; height: 14px; align-items: end; gap: 3px; }
.equalizer i { width: 2px; height: 4px; background: var(--cyan); box-shadow: 0 0 5px var(--cyan); animation: equalize 850ms ease-in-out infinite alternate; }
.equalizer i:nth-child(2) { height: 9px; animation-delay: -420ms; }
.equalizer i:nth-child(3) { height: 13px; animation-delay: -120ms; }
.equalizer i:nth-child(4) { height: 7px; animation-delay: -650ms; }
.equalizer i:nth-child(5) { height: 11px; animation-delay: -280ms; }
.equalizer i:nth-child(6) { animation-delay: -500ms; }
@keyframes equalize { to { height: 13px; opacity: .45; } }

.level-preview { position: relative; height: 195px; overflow: hidden; background: radial-gradient(circle at 70% 35%, rgba(73, 51, 188, .28), transparent 45%), #0d0d2a; }
.preview-grid { position: absolute; inset: 0; opacity: .16; background-image: linear-gradient(rgba(127,108,255,.45) 1px, transparent 1px), linear-gradient(90deg, rgba(127,108,255,.45) 1px, transparent 1px); background-size: 25px 25px; transform: perspective(250px) rotateX(48deg) scale(1.5) translateY(50px); }
.preview-line { position: absolute; left: 0; right: 0; bottom: 38px; height: 2px; background: linear-gradient(90deg, transparent, var(--cyan), var(--pink)); box-shadow: 0 0 13px var(--cyan); }
.preview-cube { position: absolute; width: 36px; height: 36px; left: 64px; bottom: 40px; border: 2px solid var(--cyan); background: rgba(39,229,255,.17); transform: rotate(18deg); box-shadow: 0 0 17px rgba(39,229,255,.5), inset 0 0 12px rgba(39,229,255,.2); }
.preview-cube::before, .preview-cube::after { content: ""; position: absolute; top: 10px; width: 5px; height: 5px; background: white; box-shadow: 0 0 5px white; }
.preview-cube::before { left: 7px; } .preview-cube::after { right: 7px; }
.preview-cube i { position: absolute; width: 17px; height: 2px; background: white; bottom: 7px; left: 8px; }
.preview-spike { position: absolute; width: 0; height: 0; bottom: 40px; border-left: 16px solid transparent; border-right: 16px solid transparent; border-bottom: 42px solid #825dff; filter: drop-shadow(0 0 8px #825dff); }
.preview-spike.a { left: 182px; } .preview-spike.b { left: 212px; }

.level-meta { padding: 22px 22px 24px; }
.level-meta small { color: #77768e; font-size: 7px; font-weight: 700; letter-spacing: .18em; }
.level-meta h2 { margin: 8px 0 17px; font-family: "Space Grotesk", sans-serif; font-size: 21px; letter-spacing: .05em; }
.difficulty { display: flex; align-items: center; gap: 9px; color: #b4b3c7; font-size: 8px; font-weight: 800; letter-spacing: .14em; }
.difficulty em { font-style: normal; }
.difficulty > span { display: flex; gap: 3px; }
.difficulty i { width: 5px; height: 5px; transform: rotate(45deg); background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.difficulty i:last-child { opacity: .23; box-shadow: none; }
.difficulty b { margin-left: auto; color: #77768e; font-size: 8px; }
.level-track { margin-top: 13px; color: rgba(39,229,255,.62); font-size: 7px; font-weight: 800; letter-spacing: .16em; }

.control-hint { position: absolute; right: clamp(40px, 6vw, 95px); bottom: 34px; display: flex; align-items: center; gap: 9px; color: rgba(255,255,255,.36); font-size: 7px; font-weight: 700; letter-spacing: .15em; }
.keyboard-control-hint, .touch-control-hint { display: flex; align-items: center; gap: 9px; }
.touch-control-hint { display: none; }
.control-hint kbd { padding: 6px 10px; border: 1px solid rgba(255,255,255,.17); border-radius: 3px; color: rgba(255,255,255,.7); background: rgba(255,255,255,.04); font-family: inherit; font-size: 7px; }

#shop-screen {
  display: grid;
  place-items: center;
  padding: 96px 28px 28px;
  background: rgba(4, 3, 17, .58);
  backdrop-filter: blur(13px);
}

.shop-panel {
  width: min(930px, 100%);
  max-height: calc(100vh - 124px);
  overflow: auto;
  padding: 28px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(21,18,58,.96), rgba(8,7,29,.97));
  box-shadow: 0 30px 110px rgba(0,0,0,.54), inset 0 0 80px rgba(100,60,220,.07);
  scrollbar-width: thin;
  scrollbar-color: rgba(39,229,255,.5) transparent;
}

.shop-header { display: flex; align-items: center; justify-content: space-between; gap: 30px; margin-bottom: 23px; }
.shop-header > div:first-child > small { color: var(--cyan); font-size: 7px; font-weight: 800; letter-spacing: .22em; }
.shop-header h2 { margin: 5px 0 4px; font-family: "Space Grotesk", sans-serif; font-size: clamp(25px, 3vw, 38px); letter-spacing: -.035em; }
.shop-header p { margin: 0; color: #85849b; font-size: 10px; line-height: 1.5; }

.shop-balance {
  min-width: 112px;
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 11px 14px;
  border: 1px solid rgba(255,226,74,.28);
  border-radius: 4px;
  background: rgba(255,226,74,.055);
}

.shop-balance i { grid-row: 1 / 3; color: #ffe24a; font-size: 22px; font-style: normal; text-shadow: 0 0 13px rgba(255,226,74,.7); }
.shop-balance strong { color: #fff4a8; font-family: "Space Grotesk", sans-serif; font-size: 20px; line-height: 1; }
.shop-balance small { color: #96906f; font-size: 6px; font-weight: 800; letter-spacing: .16em; }

.shop-tabs { display: flex; gap: 8px; margin: -6px 0 15px; }
.shop-tabs button {
  min-width: 105px;
  height: 34px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 3px;
  color: #77768e;
  background: rgba(255,255,255,.025);
  cursor: pointer;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .17em;
}
.shop-tabs button.active { border-color: var(--cyan); color: white; background: rgba(39,229,255,.11); box-shadow: 0 0 14px rgba(39,229,255,.1); }
.shop-category { display: none; }
.shop-category.active { display: grid; }

.skin-grid,
.aura-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
.skin-card,
.aura-card {
  position: relative;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 5px;
  background: rgba(255,255,255,.027);
  overflow: hidden;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.skin-card::after,
.aura-card::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 50% 12%, color-mix(in srgb, var(--skin, var(--aura)) 16%, transparent), transparent 50%); }
.skin-card:hover,
.aura-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--skin, var(--aura)) 65%, transparent); background: rgba(255,255,255,.045); }
.skin-card.selected,
.aura-card.selected { border-color: var(--skin, var(--aura)); box-shadow: 0 0 20px color-mix(in srgb, var(--skin, var(--aura)) 15%, transparent), inset 0 0 25px color-mix(in srgb, var(--skin, var(--aura)) 6%, transparent); }
.skin-card > small { color: var(--skin); font-size: 6px; font-weight: 900; letter-spacing: .18em; }
.aura-card > small { color: var(--aura); font-size: 6px; font-weight: 900; letter-spacing: .18em; }
.skin-card h3,
.aura-card h3 { margin: 4px 0 3px; font-family: "Space Grotesk", sans-serif; font-size: 14px; letter-spacing: .04em; }
.skin-card p,
.aura-card p { min-height: 26px; margin: 0 0 11px; color: #77768e; font-size: 8px; line-height: 1.5; }

.skin-preview { height: 77px; display: grid; place-items: center; margin: -2px -2px 9px; }
.skin-preview span {
  position: relative;
  width: 46px;
  height: 46px;
  border: 3px solid var(--skin);
  background: color-mix(in srgb, var(--skin-alt) 20%, #090820);
  box-shadow: 0 0 22px color-mix(in srgb, var(--skin) 55%, transparent), inset 0 0 13px color-mix(in srgb, var(--skin) 25%, transparent);
  transform: rotate(12deg);
}

.skin-preview span::before,
.skin-preview span::after { content: ""; position: absolute; top: 11px; width: 6px; height: 7px; background: white; box-shadow: 0 0 6px white; }
.skin-preview span::before { left: 8px; }
.skin-preview span::after { right: 8px; }
.skin-preview i { position: absolute; left: 11px; right: 11px; bottom: 8px; height: 3px; background: var(--skin); }
.skin-card.prism .skin-preview span { animation: prismSkin 2.4s linear infinite; }
@keyframes prismSkin { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }

.aura-preview { position: relative; height: 77px; margin: -2px -2px 9px; overflow: hidden; }
.aura-preview span { position: absolute; z-index: 2; top: 21px; right: 28px; width: 34px; height: 34px; border: 2px solid var(--aura); background: color-mix(in srgb, var(--aura-alt) 25%, #090820); box-shadow: 0 0 18px color-mix(in srgb, var(--aura) 58%, transparent); transform: rotate(12deg); }
.aura-preview::before { content: ""; position: absolute; top: 30px; right: 50px; width: 115px; height: 14px; border-radius: 50%; background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--aura) 18%, transparent), var(--aura)); filter: blur(4px); }
.aura-preview i { position: absolute; top: 34px; right: 61px; width: 13px; height: 5px; border-radius: 50%; background: var(--aura); box-shadow: 0 0 10px var(--aura); }
.aura-preview i:nth-of-type(2) { right: 87px; width: 9px; opacity: .62; }
.aura-preview i:nth-of-type(3) { right: 111px; width: 6px; opacity: .35; }
.aura-preview.none::before, .aura-preview.none i { opacity: .16; }
.prism-aura .aura-preview { animation: prismSkin 2.4s linear infinite; }

.skin-card button,
.aura-card button {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--skin, var(--aura)) 42%, transparent);
  border-radius: 3px;
  color: #f8f8ff;
  background: color-mix(in srgb, var(--skin, var(--aura)) 10%, transparent);
  cursor: pointer;
  font-size: 7px;
  font-weight: 900;
  letter-spacing: .13em;
}

.skin-card button:hover:not(:disabled), .aura-card button:hover:not(:disabled) { border-color: var(--skin, var(--aura)); background: color-mix(in srgb, var(--skin, var(--aura)) 18%, transparent); }
.skin-card button:disabled, .aura-card button:disabled { color: #666579; border-color: rgba(255,255,255,.08); background: rgba(255,255,255,.025); cursor: not-allowed; }
.skin-card.selected button, .aura-card.selected button { color: #090820; border-color: var(--skin, var(--aura)); background: var(--skin, var(--aura)); }

.shop-footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 18px; }
.shop-footer p { margin: 0; color: #77768e; font-size: 8px; letter-spacing: .06em; }
.shop-footer p.error { color: #ff8b9a; }
.shop-footer p.success { color: #72ff91; }
.shop-footer .secondary-btn { width: 220px; flex: 0 0 auto; margin: 0; }

#attempt-screen { display: grid; place-items: center; }
.attempt-copy { margin-top: -80px; text-align: center; text-shadow: 0 8px 26px rgba(0,0,0,.4); }
.attempt-copy small { color: var(--cyan); font-size: 9px; font-weight: 800; letter-spacing: .24em; }
.attempt-copy h2 { margin: 10px 0 14px; font-family: "Space Grotesk", sans-serif; font-size: clamp(32px, 4vw, 56px); letter-spacing: -.035em; }
.attempt-copy h2 span { color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,.58); }
.attempt-line { width: 70px; height: 2px; margin: auto; background: linear-gradient(90deg, transparent, var(--cyan), transparent); box-shadow: 0 0 12px var(--cyan); }

#death-screen,
#pause-screen,
#complete-screen { display: grid; place-items: center; background: rgba(4, 3, 17, .5); backdrop-filter: blur(10px); }

.result-panel { width: min(430px, calc(100vw - 40px)); padding: 42px 42px 32px; border: 1px solid rgba(255,255,255,.16); border-radius: 4px; text-align: center; background: linear-gradient(145deg, rgba(21,18,58,.9), rgba(8,7,29,.92)); box-shadow: 0 30px 100px rgba(0,0,0,.48), inset 0 0 70px rgba(100,60,220,.06); }
.result-panel > small { color: var(--pink); font-size: 8px; font-weight: 800; letter-spacing: .24em; }
.result-panel h2 { margin: 8px 0 13px; font-family: "Space Grotesk", sans-serif; font-size: 48px; letter-spacing: -.04em; }
.result-panel p { margin: 14px 0 27px; color: #8d8ca4; font-size: 12px; line-height: 1.6; }
.result-score { font-family: "Space Grotesk", sans-serif; font-size: 72px; font-weight: 700; color: transparent; -webkit-text-stroke: 1px var(--cyan); line-height: 1; filter: drop-shadow(0 0 13px rgba(39,229,255,.25)); }
.result-score sup { margin-left: 3px; font-size: 22px; }

.primary-btn,
.secondary-btn,
.text-btn { width: 100%; height: 53px; border-radius: 4px; cursor: pointer; font-size: 10px; font-weight: 800; letter-spacing: .15em; transition: transform 160ms ease, border-color 160ms ease, background 160ms ease; }
.primary-btn { border: 1px solid var(--cyan); color: white; background: linear-gradient(100deg, rgba(22,165,220,.36), rgba(91,47,196,.48)); box-shadow: 0 12px 35px rgba(32,153,222,.16); }
.primary-btn span { margin-right: 8px; color: var(--cyan); }
.secondary-btn { margin-top: 10px; border: 1px solid rgba(255,255,255,.16); color: #d3d2df; background: rgba(255,255,255,.04); }
.primary-btn[hidden] { display: none; }
.text-btn { height: 42px; border: 0; color: #69687e; background: transparent; font-size: 8px; }
.primary-btn:hover, .secondary-btn:hover { transform: translateY(-2px); border-color: var(--cyan); }
.text-btn:hover { color: white; }
.quick-hint { margin-top: 4px; color: rgba(255,255,255,.22); font-size: 7px; font-weight: 700; letter-spacing: .16em; }
.pause-panel > small { color: var(--cyan); }
.pause-panel h2 { margin-bottom: 27px; }
.complete-panel > small { color: var(--cyan); }
.complete-panel h2 { font-size: 43px; line-height: .92; }
.complete-glyph { width: 64px; height: 64px; display: grid; place-items: center; margin: 22px auto 12px; border: 1px solid var(--cyan); color: white; font-size: 26px; transform: rotate(45deg); box-shadow: 0 0 25px rgba(39,229,255,.34), inset 0 0 20px rgba(39,229,255,.16); }
.complete-glyph::first-letter { transform: rotate(-45deg); }

.jump-prompt { position: absolute; bottom: 11%; left: 50%; display: flex; align-items: center; gap: 11px; color: rgba(255,255,255,.7); font-size: 9px; letter-spacing: .16em; opacity: 0; transform: translateX(-50%) translateY(8px); pointer-events: none; transition: opacity 200ms ease, transform 200ms ease; }
.jump-prompt.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mouse-glyph { width: 20px; height: 28px; padding-top: 5px; display: flex; justify-content: center; border: 1px solid rgba(255,255,255,.55); border-radius: 10px; }
.mouse-glyph i { width: 2px; height: 6px; background: var(--cyan); box-shadow: 0 0 5px var(--cyan); animation: mouseWheel 1s ease infinite; }
@keyframes mouseWheel { 0% { transform: translateY(0); opacity: 1; } 80%, 100% { transform: translateY(7px); opacity: 0; } }

.unsupported { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 30px; background: #090820; }
.unsupported[hidden] { display: none; }
.unsupported strong { font-size: 24px; }
.unsupported p { color: var(--muted); }

@media (max-width: 900px) {
  #menu-screen { grid-template-columns: 1fr; padding: 95px 48px 60px; }
  .menu-copy { margin: auto; text-align: center; }
  .eyebrow, .menu-stats, .level-selector { justify-content: center; }
  .play-btn { margin-inline: auto; }
  .shop-open-btn { margin-inline: auto; }
  .menu-options { justify-content: center; margin-inline: auto; }
  .level-card { display: none; }
  .control-hint { left: 50%; right: auto; transform: translateX(-50%); white-space: nowrap; }
}

@media (max-width: 620px) {
  #game-shell { min-height: 390px; }
  #topbar { height: 68px; padding: max(14px, env(safe-area-inset-top)) 17px 7px; }
  .brand { font-size: 10px; gap: 9px; }
  .brand-mark { width: 22px; height: 22px; }
  .progress-wrap { width: 38vw; top: 18px; }
  .progress-label span:first-child { display: none; }
  .progress-label { justify-content: flex-end; margin-bottom: 6px; }
  .gravity-indicator { font-size: 0; }
  .gravity-indicator i { font-size: 13px; }
  .ship-indicator { font-size: 0; }
  .ship-indicator i { font-size: 13px; }
  .wave-indicator { font-size: 0; }
  .wave-indicator i { font-size: 13px; }
  .top-actions { position: relative; gap: 6px; }
  .volume-control { position: absolute; top: 42px; right: 0; width: 105px; height: 28px; gap: 6px; padding: 0 8px; }
  .volume-control label { min-width: 28px; }
  .volume-control label span { display: none; }
  .volume-control input { width: 55px; }
  .coin-hud { top: 23px; right: 104px; }
  .menu-stats { gap: 12px; }
  .menu-stats div { min-width: 72px; }
  .icon-btn { width: 34px; height: 34px; }
  .touch-boost-btn { right: max(14px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); min-width: 106px; height: 48px; }
  #menu-screen { padding: 80px 22px 55px; }
  h1 { font-size: clamp(58px, 22vw, 90px); }
  .menu-copy > p { margin: 24px 0; font-size: 12px; }
  .play-btn { height: 68px; }
  .control-hint { bottom: 21px; }
  .keyboard-control-hint { display: none; }
  .touch-control-hint { display: flex; }
  .result-panel { padding: 34px 25px 27px; }
  #shop-screen { padding: 75px 13px 13px; }
  .shop-panel { max-height: calc(100vh - 88px); padding: 18px; }
  .shop-header { align-items: flex-start; margin-bottom: 16px; }
  .shop-header p { display: none; }
  .shop-balance { min-width: 92px; padding: 9px 10px; }
  .skin-grid, .aura-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .skin-card, .aura-card { padding: 10px; }
  .skin-preview { height: 58px; }
  .skin-preview span { width: 38px; height: 38px; }
  .skin-preview span::before, .skin-preview span::after { top: 9px; width: 5px; height: 6px; }
  .skin-preview i { bottom: 7px; }
  .shop-footer { align-items: stretch; flex-direction: column; gap: 10px; }
  .shop-footer .secondary-btn { width: 100%; }
}

@media (max-height: 650px) and (min-width: 700px) {
  .level-selector { margin-top: 14px; }
  .menu-options { margin-top: 6px; }
  .difficulty-btn, .language-toggle { min-height: 36px; padding-block: 5px; }
}

@media (max-height: 650px) and (min-width: 700px) {
  #menu-screen { padding-top: 75px; padding-bottom: 35px; }
  h1 { font-size: 74px; }
  .menu-copy > p { margin: 19px 0; line-height: 1.5; }
  .menu-stats { margin-top: 15px; }
  .level-preview { height: 150px; }
  .level-meta { padding-block: 15px; }
  .control-hint { bottom: 15px; }
}

@media (max-height: 480px) and (orientation: landscape) {
  #game-shell { min-height: 100vh; min-height: 100dvh; }
  #menu-screen { padding: max(48px, env(safe-area-inset-top)) 32px 18px; }
  .eyebrow { margin-bottom: 7px; }
  h1 { font-size: 57px; line-height: .72; }
  .menu-copy > p, .menu-stats, .control-hint { display: none; }
  .play-btn { height: 52px; margin-top: 13px; }
  .play-icon { width: 34px; height: 34px; }
  .shop-open-btn { height: 32px; margin-top: 6px; }
  .level-selector { gap: 4px; margin-top: 7px; }
  .level-selector button { width: 32px; height: 23px; }
  .menu-options { margin-top: 6px; }
  .difficulty-btn, .language-toggle { min-height: 32px; padding-block: 4px; }
  .touch-boost-btn { right: max(12px, env(safe-area-inset-right)); bottom: max(10px, env(safe-area-inset-bottom)); height: 44px; min-width: 102px; }
}

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