@font-face {
  font-family: 'Bungee';
  src: url('../fonts/bungee.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kalam';
  src: url('../fonts/kalam-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Kalam';
  src: url('../fonts/kalam-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --indigo: #2a1450;
  --violet: #6b1f7a;
  --rani: #e8336e;
  --marigold: #ff9a1f;
  --bulb: #ffd34d;
  --turq: #21e0c8;
  --plum: #1a0b1e;
  --aubergine: #3e1a3f;
  --cream: #fff3d6;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--indigo);
  color: var(--cream);
  font-family: 'Bungee', 'Arial Narrow', Impact, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

#game-root, #canvas-host {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#canvas-host { z-index: 1; }

#canvas-host canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

#vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  background:
    radial-gradient(ellipse at 50% 44%, rgba(26, 11, 30, 0) 38%, rgba(26, 11, 30, 0.22) 74%, rgba(26, 11, 30, 0.62) 100%),
    linear-gradient(180deg, rgba(26, 11, 30, 0.18) 0%, rgba(26, 11, 30, 0) 18%, rgba(26, 11, 30, 0) 76%, rgba(26, 11, 30, 0.35) 100%);
}

#hit-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 25;
  opacity: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(232, 51, 110, 0) 34%, rgba(232, 51, 110, 0.62) 100%);
}
#hit-vignette.pulse {
  animation: hitPulse 0.42s ease-out forwards;
}
@keyframes hitPulse {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}

#flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 26;
  opacity: 0;
  background: #fff;
}
#flash.flash {
  animation: screenFlash 0.22s ease-out forwards;
}
@keyframes screenFlash {
  0% { opacity: 0; }
  12% { opacity: 0.86; }
  100% { opacity: 0; }
}

.hidden { display: none !important; }

/* ---------- HUD ---------- */

#hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
#hud.dim { opacity: 0.32; }

.hud-tag {
  position: absolute;
  background: linear-gradient(180deg, rgba(42, 20, 80, 0.9), rgba(26, 11, 30, 0.9));
  border: 1px solid rgba(255, 211, 77, 0.68);
  border-radius: 11px;
  padding: 11px 13px 8px;
  box-shadow:
    0 6px 22px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(255, 243, 214, 0.05),
    inset 0 -8px 18px rgba(107, 31, 122, 0.22);
  color: var(--cream);
}

.tag-bar {
  position: absolute;
  top: 4px;
  left: 11px;
  right: 11px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255, 211, 77, 0), #ffd34d 14%, #ffd34d 86%, rgba(255, 211, 77, 0));
  opacity: 0.78;
  box-shadow: 0 0 8px rgba(255, 211, 77, 0.5);
}

.tag-label {
  font-size: 9px;
  line-height: 1;
  letter-spacing: 0.2em;
  color: var(--bulb);
  opacity: 0.9;
  margin-bottom: 2px;
}

.score-tag {
  top: calc(var(--safe-top) + 10px);
  left: calc(var(--safe-left) + 10px);
  min-width: 124px;
}
.score-value {
  font-size: clamp(26px, 3.2vw, 40px);
  line-height: 0.98;
  letter-spacing: 0.02em;
  color: #fff6df;
  text-shadow: 0 0 14px rgba(255, 154, 31, 0.4), 0 2px 0 rgba(62, 26, 63, 0.8);
  font-variant-numeric: tabular-nums;
}
.best-small {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.12em;
  color: #ffb347;
  opacity: 0.85;
  font-variant-numeric: tabular-nums;
}

.wave-tag {
  top: calc(var(--safe-top) + 10px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 108px;
  text-align: center;
  padding-left: 16px;
  padding-right: 16px;
}
.wave-value {
  font-size: clamp(19px, 2.1vw, 27px);
  line-height: 1;
  color: #fff6df;
  text-shadow: 0 0 12px rgba(232, 51, 110, 0.55);
}
.pips {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
}
.pips i {
  display: block;
  width: 12px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 243, 214, 0.16);
  box-shadow: inset 0 0 0 1px rgba(255, 211, 77, 0.18);
  transition: background 0.25s ease, box-shadow 0.25s ease;
}
.pips i.on {
  background: linear-gradient(90deg, #ffd34d, #ff9a1f);
  box-shadow: 0 0 8px rgba(255, 154, 31, 0.8);
}

.lives-tag {
  top: calc(var(--safe-top) + 10px);
  right: calc(var(--safe-right) + 62px);
  padding: 12px 13px 10px;
}
.lives {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
}
.life-icon {
  width: 23px;
  height: 29px;
  overflow: visible;
  filter: drop-shadow(0 0 6px rgba(255, 211, 77, 0.55));
  transition: opacity 0.2s ease;
}
.life-icon .crack { opacity: 0; }
.life-icon.lost {
  animation: iconFall 0.62s cubic-bezier(0.3, 0.7, 0.4, 1) forwards;
}
.life-icon.lost .crack { opacity: 1; }
@keyframes iconFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  28% { transform: translateY(-3px) rotate(-8deg); opacity: 1; }
  100% { transform: translateY(42px) rotate(38deg); opacity: 0; }
}

.combo-tag {
  position: absolute;
  top: calc(var(--safe-top) + 104px);
  left: calc(var(--safe-left) + 12px);
  font-size: clamp(13px, 1.7vw, 19px);
  letter-spacing: 0.08em;
  color: var(--bulb);
  text-shadow: 0 0 12px rgba(255, 154, 31, 0.6), 0 2px 0 rgba(62, 26, 63, 0.8);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, color 0.2s ease;
}
.combo-tag b { font-weight: 400; font-size: 1.18em; }
.combo-tag.show { opacity: 1; transform: translateY(0); }
.combo-tag.drain { opacity: 0; transform: translateY(-10px); transition-duration: 0.28s; }
.combo-tag.hot { animation: comboGlow 0.9s ease-in-out infinite alternate; }
@keyframes comboGlow {
  from { filter: drop-shadow(0 0 2px rgba(232, 51, 110, 0.4)); }
  to { filter: drop-shadow(0 0 12px rgba(232, 51, 110, 0.95)); }
}

.manja-tag {
  position: absolute;
  top: calc(var(--safe-top) + 132px);
  left: calc(var(--safe-left) + 12px);
  width: 126px;
  padding: 6px 8px 7px;
  border-radius: 7px;
  background: rgba(26, 11, 30, 0.78);
  border: 1px solid rgba(255, 211, 77, 0.55);
}
.manja-label {
  font-size: 8px;
  letter-spacing: 0.1em;
  color: var(--bulb);
  white-space: nowrap;
}
.manja-bar {
  margin-top: 4px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 243, 214, 0.16);
  overflow: hidden;
}
.manja-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #ffd34d, #ff9a1f, #e8336e);
  box-shadow: 0 0 8px rgba(255, 154, 31, 0.9);
}

.swoop-wrap {
  position: absolute;
  left: calc(var(--safe-left) + 14px);
  bottom: calc(var(--safe-bottom) + 16px);
  width: 68px;
  text-align: center;
}
.swoop-svg {
  width: 64px;
  height: 64px;
  display: block;
  margin: 0 auto;
  overflow: visible;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
}
.swoop-bg {
  fill: rgba(26, 11, 30, 0.68);
  stroke: rgba(255, 243, 214, 0.16);
  stroke-width: 4;
}
.swoop-progress {
  fill: none;
  stroke: #7a5a80;
  stroke-width: 5;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke 0.25s ease;
}
.swoop-wrap.ready .swoop-progress {
  stroke: var(--turq);
  stroke-width: 5.5;
  filter: drop-shadow(0 0 7px rgba(33, 224, 200, 1));
}
.swoop-arrow {
  fill: none;
  stroke: rgba(255, 243, 214, 0.82);
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.8;
  transition: stroke 0.25s ease, opacity 0.25s ease;
}
.swoop-wrap.ready .swoop-arrow {
  stroke: var(--turq);
  opacity: 1;
  filter: drop-shadow(0 0 5px rgba(33, 224, 200, 0.9));
}
.swoop-wrap.ready .swoop-svg {
  animation: swoopReady 1.5s ease-in-out infinite;
}
@keyframes swoopReady {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(33, 224, 200, 0.35)); }
  50% { filter: drop-shadow(0 0 11px rgba(33, 224, 200, 0.85)); }
}
.swoop-label {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: rgba(255, 243, 214, 0.7);
}
.swoop-wrap.ready .swoop-label { color: var(--turq); text-shadow: 0 0 8px rgba(33, 224, 200, 0.7); }

/* ---------- Mute ---------- */

.mute-btn {
  position: fixed;
  top: calc(var(--safe-top) + 10px);
  right: calc(var(--safe-right) + 10px);
  z-index: 60;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid rgba(255, 211, 77, 0.68);
  background: linear-gradient(180deg, rgba(42, 20, 80, 0.94), rgba(26, 11, 30, 0.94));
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 243, 214, 0.05);
  color: var(--cream);
  cursor: pointer;
  pointer-events: auto;
  touch-action: manipulation;
}
.mute-btn svg {
  width: 24px;
  height: 24px;
  display: block;
  margin: 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.mute-btn .speaker { fill: currentColor; stroke: none; }
.mute-btn .slash { display: none; stroke: var(--rani); stroke-width: 2.2; }
.mute-btn.muted { color: rgba(255, 243, 214, 0.48); }
.mute-btn.muted .waves { display: none; }
.mute-btn.muted .slash { display: block; }
.mute-btn:focus-visible { outline: 2px solid var(--turq); outline-offset: 2px; }

/* ---------- Banners ---------- */

.wave-banner {
  position: fixed;
  top: 26%;
  left: 50%;
  z-index: 22;
  transform: translate(-50%, -50%) scale(0.86);
  font-size: clamp(30px, 5.2vw, 64px);
  letter-spacing: 0.08em;
  color: #fff3d6;
  text-shadow:
    0 0 24px rgba(255, 154, 31, 0.85),
    0 0 52px rgba(232, 51, 110, 0.55),
    0 4px 0 rgba(62, 26, 63, 0.9);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}
.wave-banner.show { animation: waveBanner 1.35s ease-out forwards; }
@keyframes waveBanner {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
  13% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  24% { transform: translate(-50%, -50%) scale(1); }
  72% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -58%) scale(1.02); }
}

.gust-tag {
  position: fixed;
  top: 42%;
  z-index: 22;
  padding: 7px 11px;
  border-radius: 8px;
  background: rgba(26, 11, 30, 0.82);
  border: 1px solid rgba(255, 211, 77, 0.6);
  color: var(--bulb);
  font-size: 12px;
  letter-spacing: 0.16em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  white-space: nowrap;
}
.gust-tag.show { opacity: 1; }
.gust-tag.left { left: calc(var(--safe-left) + 14px); transform: translateX(0); }
.gust-tag.right { right: calc(var(--safe-right) + 14px); transform: translateX(0); }

/* ---------- Screens ---------- */

.screen {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(var(--safe-top) + 18px) calc(var(--safe-right) + 18px) calc(var(--safe-bottom) + 18px) calc(var(--safe-left) + 18px);
  pointer-events: auto;
  overflow: hidden;
}

.title-screen {
  background:
    radial-gradient(ellipse at 50% 46%, rgba(26, 11, 30, 0.24) 0%, rgba(26, 11, 30, 0.5) 48%, rgba(26, 11, 30, 0.78) 100%),
    linear-gradient(180deg, rgba(26, 11, 30, 0.5) 0%, rgba(26, 11, 30, 0.12) 30%, rgba(26, 11, 30, 0.1) 62%, rgba(26, 11, 30, 0.7) 100%);
  transition: opacity 0.26s ease;
}
.title-screen.leaving { opacity: 0; pointer-events: none; }

.title-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(1040px, 94vw);
  transform: translateY(-1.5vh);
}

.logo-wrap {
  position: relative;
  display: inline-block;
  padding-top: 12px;
}
.logo-bar {
  height: 7px;
  width: 92%;
  margin: 0 auto 7px;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 211, 77, 0), #ffd34d 10%, #ffe9a8 50%, #ffd34d 90%, rgba(255, 211, 77, 0));
  box-shadow: 0 0 16px rgba(255, 211, 77, 0.7), 0 0 42px rgba(255, 154, 31, 0.4);
}
.logo {
  margin: 0;
  font-family: 'Bungee', Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(44px, 10.4vw, 150px);
  line-height: 0.9;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff6d4 0%, #ffd34d 32%, #ff9a1f 66%, #e8336e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 211, 77, 0.95);
  filter:
    drop-shadow(0 0 3px rgba(255, 211, 77, 0.85))
    drop-shadow(0 0 20px rgba(255, 154, 31, 0.6))
    drop-shadow(0 0 46px rgba(232, 51, 110, 0.28))
    drop-shadow(0 6px 0 rgba(62, 26, 63, 0.92));
  paint-order: stroke fill;
}

.subtitle {
  margin-top: 2px;
  font-family: 'Kalam', cursive;
  font-weight: 700;
  font-size: clamp(24px, 4.6vw, 48px);
  line-height: 1;
  color: #2ff0d8;
  text-shadow: 0 0 16px rgba(33, 224, 200, 0.6), 0 0 42px rgba(33, 224, 200, 0.24), 0 3px 0 rgba(26, 11, 30, 0.7);
  transform: rotate(-1.4deg);
}

.start-prompt {
  margin-top: clamp(18px, 4vh, 40px);
  font-size: clamp(14px, 1.7vw, 22px);
  letter-spacing: 0.1em;
  color: #fff3d6;
  text-shadow: 0 0 12px rgba(255, 154, 31, 0.75), 0 2px 0 rgba(26, 11, 30, 0.8);
  animation: promptPulse 1.7s ease-in-out infinite;
}
@keyframes promptPulse {
  0%, 100% { opacity: 0.7; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}

.controls-panel {
  margin-top: clamp(16px, 3.4vh, 34px);
  width: min(560px, 92vw);
  padding: 12px 16px;
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(42, 20, 80, 0.82), rgba(26, 11, 30, 0.86));
  border: 1px solid rgba(255, 211, 77, 0.58);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255, 243, 214, 0.04);
}
.control-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
}
.control-row + .control-row { border-top: 1px solid rgba(255, 243, 214, 0.09); }
.control-keys { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.key {
  display: inline-block;
  padding: 3px 7px 2px;
  border-radius: 5px;
  border: 1px solid rgba(255, 211, 77, 0.6);
  background: rgba(255, 211, 77, 0.09);
  color: #ffe9a8;
  font-size: clamp(9px, 1.05vw, 12px);
  letter-spacing: 0.08em;
  line-height: 1.2;
  white-space: nowrap;
}
.control-label {
  font-size: clamp(9px, 1.1vw, 13px);
  letter-spacing: 0.16em;
  color: rgba(255, 243, 214, 0.92);
  white-space: nowrap;
}

.title-best {
  margin-top: 12px;
  min-height: 14px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--bulb);
  text-shadow: 0 0 10px rgba(255, 154, 31, 0.5);
}

/* ---------- Game over ---------- */

.over-screen {
  background:
    radial-gradient(ellipse at 50% 44%, rgba(26, 11, 30, 0.42) 0%, rgba(26, 11, 30, 0.78) 58%, rgba(26, 11, 30, 0.94) 100%),
    linear-gradient(180deg, rgba(42, 20, 80, 0.3), rgba(26, 11, 30, 0.55));
  animation: overIn 0.18s ease-out both;
}
@keyframes overIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.over-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: min(900px, 94vw);
  transform: translateY(-1vh);
}
.over-bar {
  height: 6px;
  width: 78%;
  margin-bottom: 8px;
  border-radius: 3px;
  background: linear-gradient(90deg, rgba(232, 51, 110, 0), #e8336e 12%, #ffd34d 50%, #e8336e 88%, rgba(232, 51, 110, 0));
  box-shadow: 0 0 18px rgba(232, 51, 110, 0.7);
}
.over-logo {
  margin: 0;
  font-family: 'Bungee', Impact, sans-serif;
  font-weight: 400;
  font-size: clamp(38px, 8.4vw, 104px);
  line-height: 0.92;
  letter-spacing: 0.01em;
  white-space: nowrap;
  background: linear-gradient(180deg, #fff6d4 0%, #ffd34d 32%, #ff9a1f 66%, #e8336e 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-stroke: 2px rgba(255, 211, 77, 0.9);
  filter:
    drop-shadow(0 0 3px rgba(255, 211, 77, 0.8))
    drop-shadow(0 0 22px rgba(232, 51, 110, 0.45))
    drop-shadow(0 5px 0 rgba(62, 26, 63, 0.92));
  paint-order: stroke fill;
}
.over-sub {
  margin-top: 4px;
  font-size: clamp(8px, 1.1vw, 12px);
  letter-spacing: 0.22em;
  color: rgba(255, 243, 214, 0.68);
}
.over-scores {
  display: flex;
  gap: clamp(22px, 5vw, 58px);
  align-items: flex-end;
  justify-content: center;
  margin-top: clamp(16px, 3.4vh, 30px);
}
.over-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.over-score span {
  font-size: 9px;
  letter-spacing: 0.2em;
  color: var(--bulb);
  opacity: 0.9;
}
.over-score strong {
  font-weight: 400;
  font-size: clamp(32px, 6.4vw, 66px);
  line-height: 1;
  color: #fff6df;
  text-shadow: 0 0 18px rgba(255, 154, 31, 0.5), 0 3px 0 rgba(62, 26, 63, 0.85);
  font-variant-numeric: tabular-nums;
}
.over-best strong { color: #ffd34d; }
.new-best {
  margin-top: 12px;
  padding: 5px 14px 4px;
  border-radius: 5px;
  background: linear-gradient(180deg, #ffe9a8, #ff9a1f);
  color: #3e1a3f;
  font-size: 11px;
  letter-spacing: 0.16em;
  box-shadow: 0 0 22px rgba(255, 154, 31, 0.65);
  transform: rotate(-2deg);
}
.retry {
  margin-top: clamp(16px, 3vh, 28px);
  font-size: clamp(11px, 1.4vw, 16px);
  letter-spacing: 0.1em;
  color: #fff3d6;
  text-shadow: 0 0 12px rgba(255, 154, 31, 0.55);
  animation: promptPulse 1.7s ease-in-out infinite;
}

/* ---------- Responsive ---------- */

@media (max-width: 620px) {
  .hud-tag { padding: 9px 10px 7px; border-radius: 9px; }
  .score-tag { min-width: 104px; }
  .score-value { font-size: 25px; }
  .best-small { font-size: 8px; }
  .wave-tag { min-width: 88px; padding-left: 10px; padding-right: 10px; }
  .wave-value { font-size: 18px; }
  .pips i { width: 9px; }
  .lives-tag { right: calc(var(--safe-right) + 60px); padding: 10px 9px 8px; }
  .life-icon { width: 19px; height: 24px; }
  .combo-tag { top: calc(var(--safe-top) + 88px); font-size: 13px; }
  .manja-tag { top: calc(var(--safe-top) + 112px); width: 112px; }
  .swoop-wrap { width: 58px; }
  .swoop-svg { width: 54px; height: 54px; }
  .mute-btn { width: 44px; height: 44px; }
  .controls-panel { padding: 9px 11px; }
  .control-row { gap: 8px; padding: 4px 0; }
  .title-inner { transform: translateY(-0.5vh); }
  .logo { font-size: clamp(44px, 12.2vw, 74px); }
  .subtitle { font-size: clamp(22px, 6.6vw, 34px); }
  .start-prompt { margin-top: 16px; }
  .controls-panel { margin-top: 14px; }
  .over-logo { font-size: clamp(34px, 10.5vw, 64px); }
  .over-scores { gap: 26px; }
}

@media (max-width: 380px) {
  .score-tag { min-width: 88px; padding-left: 8px; padding-right: 8px; }
  .score-value { font-size: 22px; }
  .wave-tag { min-width: 64px; padding-left: 6px; padding-right: 6px; }
  .wave-value { font-size: 16px; }
  .pips { gap: 3px; }
  .pips i { width: 7px; }
  .lives-tag { right: calc(var(--safe-right) + 56px); padding: 9px 6px 7px; }
  .life-icon { width: 17px; height: 22px; }
  .combo-tag { top: calc(var(--safe-top) + 82px); font-size: 12px; }
  .manja-tag { top: calc(var(--safe-top) + 104px); width: 104px; }
  .mute-btn { width: 42px; height: 42px; }
  .swoop-wrap { width: 52px; }
  .swoop-svg { width: 50px; height: 50px; }
  .title-inner { width: 96vw; }
  .logo { font-size: 43px; }
  .subtitle { font-size: 21px; }
  .control-label { display: none; }
  .controls-panel { padding: 8px 10px; }
}

@media (max-height: 520px) {
  .title-inner { transform: translateY(-1vh); }
  .logo { font-size: clamp(38px, 9.4vw, 92px); }
  .subtitle { font-size: clamp(18px, 3.4vw, 32px); }
  .start-prompt { margin-top: 10px; }
  .controls-panel { margin-top: 10px; padding: 7px 11px; }
  .control-row { padding: 3px 0; }
  .title-best { margin-top: 6px; }
  .over-logo { font-size: clamp(30px, 7vw, 64px); }
  .over-scores { margin-top: 10px; }
  .over-score strong { font-size: clamp(26px, 4.8vw, 46px); }
  .retry { margin-top: 12px; }
  .new-best { margin-top: 7px; }
}

@media (orientation: portrait) {
  .hud-tag { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .wave-tag { top: calc(var(--safe-top) + 10px); }
  .lives-tag { padding-left: 8px; padding-right: 8px; }
}
