/* =========================================================
   CHROMA TO BUBBLE SHOOTER — core stylesheet
   Design tokens
   Background:   Deep-ocean seabed scene (gradient + SVG seabed)
   Panel glass:  rgba(255,255,255,.6) + blur (sea-glass)
   Accent teal:  #1a5c5c (dark teal/green for tubes)
   Accent pink:  #FF4FA8
   Accent amber: #FFC15E
   Text:         #1a5c5c / #2c7a7a (teal shades)
   Font:         rounded system stack for display, tabular for HUD numerals
   ========================================================= */

:root {
  --bg-0: #ffffff;
  --bg-1: #f8fafa;
  --bg-2: #f0f5f5;
  --panel: rgba(255, 255, 255, 0.72);
  --panel-border: rgba(26, 92, 92, 0.15);
  --teal: #2a8a8a;
  --tube-teal: #1a5c5c;
  --tube-rim: #2a7a7a;
  --pink: #ff4fa8;
  --amber: #ffc15e;
  --ink: #1a5c5c;
  --ink-dim: #4a8888;
  --ink-faint: #8ab4b4;
  --danger: #ff5a6e;
  --radius-lg: 26px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --font-display: "Segoe UI Rounded", "SF Pro Rounded", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: -apple-system, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --font-hud: "Consolas", "SF Mono", "Courier New", monospace;
  --ease-pop: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  margin: 0;
  overscroll-behavior: none;
}

body {
  background-color: #0b2f55;
  background-image:
    radial-gradient(ellipse 120% 60% at 50% -10%, rgba(64, 156, 214, 0.35) 0%, transparent 55%),
    radial-gradient(ellipse 80% 50% at 15% 110%, rgba(6, 24, 48, 0.95) 0%, transparent 70%),
    linear-gradient(180deg, #1c79b8 0%, #0f4a80 38%, #0a335c 62%, #06233f 100%);
  color: var(--ink);
  font-family: var(--font-body);
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

.app {
  position: relative;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ---------- underwater scene (static seabed, flora & light rays) ---------- */
.underwater-scene {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

/* sun shafts piercing the water from the surface */
.underwater-scene .light-shaft {
  position: absolute;
  top: -10%;
  width: 120px;
  height: 80%;
  background: linear-gradient(180deg, rgba(255, 255, 220, 0.16) 0%, rgba(255, 255, 220, 0.05) 40%, transparent 100%);
  transform: rotate(14deg) skewX(-8deg);
  filter: blur(6px);
  animation: shaftPulse 9s ease-in-out infinite alternate;
  transform-origin: top left;
}

/* gentle sandy seabed silhouette across the bottom */
.underwater-scene .sand-floor {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: -4%;
  height: 26%;
  background:
    radial-gradient(circle at 18% 30%, rgba(240, 205, 130, 0.28) 0%, transparent 38%),
    radial-gradient(circle at 60% 65%, rgba(235, 185, 100, 0.20) 0%, transparent 42%),
    radial-gradient(circle at 88% 40%, rgba(245, 215, 140, 0.24) 0%, transparent 40%),
    linear-gradient(180deg, rgba(110, 86, 46, 0.9) 0%, rgba(72, 54, 28, 0.95) 45%, rgba(38, 27, 13, 0.98) 100%);
  border-radius: 50% 50% 0 0 / 26% 26% 0 0;
  filter: blur(1px);
}

/* pebbles / fallen shells dotted on the sand */
.underwater-scene .sand-floor::before,
.underwater-scene .sand-floor::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(34, 24, 10, 0.9);
}
.underwater-scene .sand-floor::before {
  width: 46px; height: 22px;
  left: 16%; bottom: 20%;
  box-shadow:
    40px 26px 0 -9px rgba(52, 36, 16, 0.92),
    95px -8px 0 -15px rgba(40, 28, 12, 0.88),
    155px 30px 0 -11px rgba(44, 31, 14, 0.88),
    210px 10px 0 -18px rgba(48, 34, 16, 0.85),
    270px -14px 0 -12px rgba(36, 25, 12, 0.88),
    330px 24px 0 -16px rgba(50, 36, 16, 0.88);
}
.underwater-scene .sand-floor::after {
  width: 26px; height: 14px;
  right: 18%; bottom: 32%;
  box-shadow:
    -60px 12px 0 -6px rgba(42, 29, 14, 0.88),
    -120px -6px 0 -10px rgba(36, 25, 12, 0.85),
    -180px 20px 0 -8px rgba(46, 32, 16, 0.88);
}

/* waving seaweed sprigs */
.underwater-scene .seaweed {
  position: absolute;
  bottom: -2%;
  width: 26px;
  height: 34%;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  background: linear-gradient(180deg, rgba(14, 122, 84, 0.9) 0%, rgba(7, 78, 59, 0.9) 100%);
  transform-origin: bottom center;
  box-shadow: 0 0 18px rgba(10, 90, 66, 0.45);
}
.underwater-scene .seaweed::before {
  content: "";
  position: absolute;
  bottom: 8%;
  left: -38%;
  width: 24px;
  height: 42%;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  background: linear-gradient(180deg, rgba(10, 108, 76, 0.9) 0%, rgba(6, 66, 52, 0.9) 100%);
  transform: rotate(-32deg);
  transform-origin: bottom center;
}
.underwater-scene .seaweed::after {
  content: "";
  position: absolute;
  bottom: 16%;
  right: -42%;
  width: 20px;
  height: 34%;
  border-radius: 50% 50% 0 0 / 60% 60% 0 0;
  background: linear-gradient(180deg, rgba(13, 110, 82, 0.9) 0%, rgba(6, 70, 54, 0.9) 100%);
  transform: rotate(30deg);
  transform-origin: bottom center;
}

/* colorful coral silhouettes rising off the seabed */
.underwater-scene .coral {
  position: absolute;
  bottom: -1%;
  filter: drop-shadow(0 6px 10px rgba(6, 20, 40, 0.35));
}
.underwater-scene .coral.coral-branch {
  width: 46px;
  height: 130px;
  background:
    linear-gradient(180deg, transparent 0 62%, #ff6b6b 62% 100%);
  border-radius: 100% 100% 0 0 / 80% 80% 0 0;
}
.underwater-scene .coral.coral-branch::before,
.underwater-scene .coral.coral-branch::after {
  content: "";
  position: absolute;
  width: 20px;
  height: 46%;
  border-radius: 100% 100% 0 0 / 80% 80% 0 0;
  background: linear-gradient(180deg, #ff8f8f 0%, #ff5f5f 100%);
  bottom: 40%;
}
.underwater-scene .coral.coral-branch::before { left: -16px; transform: rotate(24deg); }
.underwater-scene .coral.coral-branch::after { right: -16px; transform: rotate(-24deg); }
.underwater-scene .coral.coral-branch b {
  position: absolute;
  width: 16px;
  height: 40%;
  border-radius: 100% 100% 0 0 / 80% 80% 0 0;
  background: linear-gradient(180deg, #ffa06b 0%, #ff7d50 100%);
  left: 50%;
  transform: translateX(-50%) rotate(0deg);
  transform-origin: bottom center;
  bottom: 36%;
}
.underwater-scene .coral.coral-fan {
  width: 110px;
  height: 95px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(247, 243, 96, 0.5) 0%, transparent 45%),
    linear-gradient(135deg, #ffd285 0%, #ff9f43 100%);
  opacity: 0.88;
  box-shadow: inset -10px -12px 20px rgba(200, 80, 30, 0.35);
}
.underwater-scene .coral.coral-fan::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -42px;
  transform: translateX(-50%);
  width: 14px;
  height: 46px;
  background: linear-gradient(180deg, #b8682c 0%, #8a4a20 100%);
  border-radius: 0 0 6px 6px;
}

@keyframes shaftPulse {
  0%   { opacity: 0.55; }
  100% { opacity: 1; }
}

@keyframes seaweedSway {
  0%, 100% { transform: translateX(0) rotate(-3deg); }
  50%      { transform: translateX(6px) rotate(3deg); }
}

.hidden { display: none !important; }

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- screens ---------- */
.screen {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: none;
  flex-direction: column;
}
.screen.active-screen { display: flex; }

/* ---------- home screen ---------- */
.screen-home {
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.home-card {
  width: 100%;
  max-width: 460px;
  min-height: 380px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 22px;
  text-align: center;
  padding: 40px 40px;
  background: linear-gradient(160deg, rgba(255,255,255,0.62), rgba(228,244,248,0.45));
  border: 2px solid rgba(160, 220, 255, 0.35);
  border-radius: 28px;
  box-shadow: 0 20px 60px rgba(4, 18, 38, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  overflow-y: auto;
  scrollbar-width: none;
}
.home-card::-webkit-scrollbar { display: none; }

.logo {
  font-family: var(--font-display);
  font-size: clamp(40px, 8vw, 56px);
  font-weight: 800;
  letter-spacing: 1px;
  margin: 0 0 4px;
  color: var(--ink);
  text-shadow: 0 3px 12px rgba(26, 92, 92, 0.15);
}
.logo-accent { color: var(--tube-teal); }

.tagline {
  margin: 0 0 6px;
  color: var(--ink-dim);
  font-size: 14px;
  letter-spacing: 4px;
  text-transform: uppercase;
}

.menu-actions, .continue-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}

.continue-label { color: var(--ink-dim); font-size: 13px; margin: 0; }
.continue-stats {
  display: flex;
  gap: 22px;
  font-family: var(--font-hud);
  color: var(--teal);
  font-size: 15px;
  margin: 0;
}

.home-secondary {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.menu-fullscreen-btn {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(8, 45, 58, 0.4);
  color: #eafffb;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: transform 0.15s var(--ease-pop), background 0.15s;
}
.menu-fullscreen-btn:hover { background: rgba(8, 45, 58, 0.65); transform: scale(1.08); }
.menu-fullscreen-btn:active { transform: scale(0.92); }

/* ---------- buttons ---------- */
.btn {
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 26px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s var(--ease-pop), box-shadow 0.15s, opacity 0.15s;
  width: 100%;
  max-width: 300px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.35; cursor: default; transform: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--tube-teal), #2a8a8a);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(26, 92, 92, 0.3), inset 0 1px 0 rgba(255,255,255,0.4);
}
.btn-primary:hover { filter: brightness(1.06); transform: translateY(-2px); }
.btn-secondary {
  background: #ffffff;
  color: var(--ink);
  border: 2px solid rgba(26, 92, 92, 0.2);
  box-shadow: 0 4px 12px rgba(26, 92, 92, 0.1);
}
.btn-secondary:hover { transform: translateY(-2px); border-color: var(--tube-teal); }
.btn-ghost {
  background: transparent;
  color: var(--ink-dim);
  border: 2px solid rgba(26, 92, 92, 0.2);
}
.btn-ghost:hover { color: var(--tube-teal); border-color: var(--tube-teal); }
.btn-text {
  background: transparent;
  color: var(--ink-dim);
  width: auto;
  height: auto;
  padding: 8px 12px;
  font-weight: 600;
  font-size: 14px;
}
.btn-text:hover { color: var(--tube-teal); }
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #c23648);
  color: #ffffff;
}

/* ---------- game screen / HUD ---------- */
.screen-game {
  padding: 12px 16px 16px;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  height: 100%;
}

.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 4px;
  z-index: 2;
}

.hud-btn {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(26, 92, 92, 0.1);
  backdrop-filter: blur(10px);
  flex-shrink: 0;
  font-size: 18px;
}
.hud-btn:active { transform: scale(0.9); }

.hud-right { display: flex; gap: 8px; }

.hud-center {
  display: flex;
  gap: 8px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 14px;
  padding: 6px 14px;
  backdrop-filter: blur(10px);
  flex: 1;
  justify-content: space-evenly;
  max-width: 480px;
}

.hud-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 44px;
}
.hud-stat-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.hud-stat-value {
  font-family: var(--font-hud);
  font-size: 16px;
  font-weight: 700;
  color: var(--teal);
}
.hud-stat-wide .hud-stat-value { color: var(--amber); }

/* ---------- board ---------- */
.board-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  z-index: 2;
  position: relative;
}

.board {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  align-content: flex-end;
  gap: 22px;
  padding: 10px;
  max-width: 100%;
  max-height: 100%;
}

.board-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 10px 0 4px;
  z-index: 2;
}
.board-actions .btn { width: auto; padding: 12px 22px; font-size: 14px; height: 48px; }

.hint-text {
  text-align: center;
  color: var(--ink-faint);
  font-size: 12px;
  min-height: 16px;
  margin: 6px 0 0;
  z-index: 2;
}

/* ---------- tube ---------- */
.tube {
  --tube-w: 66px;
  --tube-h: 240px;
  width: var(--tube-w);
  height: var(--tube-h);
  position: relative;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  padding: 8px 6px 12px;
  gap: 6px;
  border-radius: 14px 14px 34px 34px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.55) 0%, 
    rgba(255, 255, 255, 0.18) 50%, 
    rgba(255, 255, 255, 0.35) 100%);
  border: 3px solid var(--tube-teal);
  border-top: none;
  box-shadow:
    inset 0 0 25px rgba(255, 255, 255, 0.4),
    inset -8px 0 14px rgba(26, 92, 92, 0.1),
    0 10px 30px rgba(26, 92, 92, 0.2);
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s, border-color 0.18s;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.tube::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8px;
  width: 12px;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(180deg, 
    rgba(255, 255, 255, 0.6) 0%, 
    rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}

.tube::after {
  content: "";
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 14px;
  background: linear-gradient(180deg, var(--tube-rim), var(--tube-teal));
  border-radius: 8px 8px 0 0;
  box-shadow: 0 3px 10px rgba(26, 92, 92, 0.3);
}

.tube.selected {
  transform: translateY(-12px);
  border-color: var(--tube-teal);
  box-shadow: 0 0 0 3px rgba(26, 92, 92, 0.25), 0 16px 30px rgba(26, 92, 92, 0.25);
}

.tube.invalid-shake { animation: shake 0.35s; }
.tube.drag-over {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(42,138,138,0.35), 0 16px 30px rgba(42,138,138,0.3);
  transform: translateY(-8px) scale(1.03);
}
.tube.drag-source {
  transform: translateY(-16px);
  box-shadow: 0 0 0 3px rgba(255,193,94,0.3), 0 16px 30px rgba(255,193,94,0.25);
  border-color: var(--amber);
}
.tube.sorted-tube { border-color: var(--amber); box-shadow: 0 0 22px rgba(255,193,94,0.35), inset 0 0 18px rgba(255,193,94,0.12); }

.tube-badge {
  position: absolute;
  top: -10px;
  right: -6px;
  background: var(--amber);
  color: #241500;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 8px;
  opacity: 0;
  transform: scale(0.6);
  transition: all 0.25s var(--ease-pop);
}
.tube.sorted-tube .tube-badge { opacity: 1; transform: scale(1); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

/* ---------- ball (glossy bubble) ---------- */
.ball {
  width: calc(var(--tube-w) - 16px);
  height: calc(var(--tube-w) - 16px);
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
  cursor: grab;
  box-shadow:
    inset -5px -8px 10px rgba(0,0,0,0.28),
    inset 3px 4px 8px rgba(255,255,255,0.7),
    0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.2s var(--ease-pop);
  animation: ballFloat 2.6s ease-in-out infinite;
}
.ball:nth-child(odd) { animation-delay: 0.4s; }
.ball:nth-child(even) { animation-delay: 1.1s; }

@keyframes ballFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
.ball::after {
  content: "";
  position: absolute;
  top: 12%;
  left: 18%;
  width: 35%;
  height: 25%;
  border-radius: 50%;
  background: rgba(255,255,255,0.65);
  filter: blur(1px);
  transform: rotate(-20deg);
}
.ball::before {
  content: "";
  position: absolute;
  bottom: 12%;
  right: 15%;
  width: 15%;
  height: 12%;
  border-radius: 50%;
  background: rgba(255,255,255,0.35);
  filter: blur(1px);
}

.ball.dragging {
  transform: scale(1.15) !important;
  opacity: 0.7;
  z-index: 1000;
  position: fixed;
  pointer-events: none;
  cursor: grabbing;
}

.ball.lifted { transform: translateY(-14px) scale(1.06); filter: brightness(1.12); animation: none; }

.ball.flying {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  pointer-events: none;
  animation: none;
  cursor: grabbing;
  box-shadow:
    inset -5px -8px 10px rgba(0,0,0,0.28),
    inset 3px 4px 8px rgba(255,255,255,0.7),
    0 14px 30px rgba(26, 92, 92, 0.4),
    0 4px 10px rgba(0,0,0,0.2);
  transition: transform 0.05s linear;
}

.ball.drop-bounce { animation: dropBounce 0.32s var(--ease-out); }
@keyframes dropBounce {
  0% { transform: translateY(-10px) scale(1.05); }
  60% { transform: translateY(4px) scale(0.96); }
  100% { transform: translateY(0) scale(1); }
}

/* ---------- overlays ---------- */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(8px);
}
.overlay.active-overlay { display: flex; }

.overlay-panel {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  scrollbar-width: none;
  background: linear-gradient(180deg, #ffffff, #f8fafa);
  border: 2px solid rgba(26, 92, 92, 0.15);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
  box-shadow: 0 30px 60px rgba(26, 92, 92, 0.2);
  position: relative;
}
.overlay-panel::-webkit-scrollbar { display: none; }
.overlay-panel-narrow { max-width: 340px; text-align: center; }

.overlay-title {
  font-family: var(--font-display);
  font-size: 24px;
  margin: 0 0 6px;
  text-align: center;
}
.overlay-title-win { color: var(--teal); }

.overlay-actions { display: flex; gap: 10px; }
.overlay-actions .btn { max-width: none; }

/* how to play */
.howto-steps { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.howto-step { display: flex; gap: 12px; align-items: flex-start; text-align: left; }
.howto-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: rgba(42,138,138,0.12); color: var(--teal);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0; font-size: 14px;
}
.howto-step h3 { margin: 0 0 2px; font-size: 15px; }
.howto-step p { margin: 0; color: var(--ink-dim); font-size: 13px; line-height: 1.4; }
.howto-demo { display: flex; justify-content: center; gap: 10px; margin: 4px 0 10px; }

/* settings */
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 4px; border-bottom: 1px solid var(--panel-border);
  font-size: 15px;
}
.switch {
  width: 46px; height: 26px; border-radius: 999px; border: none;
  background: rgba(255,255,255,0.15); position: relative; transition: background 0.2s;
}
.switch[aria-checked="true"] { background: var(--teal); }
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; transition: left 0.2s var(--ease-pop); box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.switch[aria-checked="true"] .switch-knob { left: 23px; }

.confirm-text { color: var(--ink-dim); font-size: 14px; line-height: 1.5; margin: 0 0 8px; }

/* level complete */
.overlay-celebrate { overflow: visible; }

#overlay-complete .overlay-panel {
  max-width: 420px;
  overflow-y: visible;
  padding: 34px 32px;
  text-align: center;
  align-items: center;
  border-radius: 30px;
}

.next-level-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--tube-teal);
  margin: 0;
}

.complete-stats {
  display: flex; justify-content: space-around;
  width: 100%;
  margin: 10px 0 18px;
  gap: 8px;
}
.complete-stats > div {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: 1;
  background: rgba(26, 92, 92, 0.06);
  border-radius: 14px;
  padding: 12px 6px;
}
.complete-label { font-size: 10px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 1px; }
.complete-value { font-family: var(--font-hud); font-size: 22px; color: var(--amber); font-weight: 800; }

.btn-next {
  width: 100%;
  max-width: 320px;
  height: 56px;
  background: linear-gradient(135deg, var(--tube-teal), #2a8a8a);
  color: #fff;
  border: none;
  border-radius: 16px;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(26, 92, 92, 0.3);
  transition: transform 0.15s var(--ease-pop), box-shadow 0.15s;
}
.btn-next:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(26, 92, 92, 0.4); }
.btn-next:active { transform: scale(0.96); }

.confetti-canvas {
  position: absolute; inset: 0; pointer-events: none; z-index: -1;
  width: 100%; height: 100%;
}

/* pause menu buttons stack */
#overlay-pause .btn, #overlay-settings .btn { margin-top: 2px; }

/* particle layer for tube completion */
.particle-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: visible;
}
.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  opacity: 0.9;
}
