:root {
  --game-bg: linear-gradient(180deg, #b3e5fc 0%, #81d4fa 45%, #c8e6c9 78%, #81c784 100%);
  --game-accent: #1b5e20;
}

.sing-field {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px 16px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.4s ease;
}

.sing-field.theme-train {
  background: linear-gradient(180deg, #b3e5fc 0%, #81d4fa 46%, #c8e6c9 76%, #66bb6a 100%);
}

.sing-field.theme-balloon {
  background: linear-gradient(180deg, #7e57c2 0%, #64b5f6 42%, #b3e5fc 78%, #e1f5fe 100%);
}

.sing-field.theme-boat {
  background: linear-gradient(180deg, #fff59d 0%, #81d4fa 44%, #29b6f6 74%, #0288d1 100%);
}

/* --- Top HUD (Stage Tabs + Vowel Prompt + Voice Meter) ------------------ */

.top-hud {
  width: 100%;
  max-width: 680px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 20;
}

.stage-tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.stage-tab {
  background: rgba(255, 255, 255, 0.85);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 6px 16px;
  font-size: 1rem;
  font-weight: 800;
  color: #1e3a4c;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.15s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.stage-tab:hover {
  transform: translateY(-1px);
}

.stage-tab.active {
  background: #ff8f00;
  color: #ffffff;
  border-color: #ffe082;
  box-shadow: 0 4px 12px rgba(255, 143, 0, 0.35);
  transform: scale(1.04);
}

.vowel-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 22px;
  padding: 8px 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.vowel-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #ec407a 0%, #d81b60 100%);
  color: #ffffff;
  border: 3px solid #f8bbd0;
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(216, 27, 96, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vowel-badge:active {
  transform: scale(0.95);
}

.vowel-badge.singing-pulse {
  animation: vowel-glow 0.55s ease-in-out infinite alternate;
}

@keyframes vowel-glow {
  from {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(216, 27, 96, 0.3);
  }
  to {
    transform: scale(1.08);
    box-shadow: 0 0 20px rgba(236, 64, 122, 0.65);
  }
}

.vowel-info {
  flex: 1 1 auto;
  min-width: 0;
}

.stage-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #1e3a4c;
  line-height: 1.2;
}

.stage-prompt {
  font-size: 0.92rem;
  font-weight: 600;
  color: #455a64;
  margin-top: 2px;
  line-height: 1.25;
}

/* --- Voice Level Meter -------------------------------------------------- */

.voice-meter-box {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 6px 14px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.meter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.meter-title {
  color: #37474f;
}

.meter-status {
  color: #2e7d32;
  transition: color 0.2s ease;
}

.meter-status.status-loud {
  color: #d84315;
}

.meter-track {
  position: relative;
  width: 100%;
  height: 16px;
  border-radius: 10px;
  background: #eceff1;
  overflow: hidden;
  display: flex;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.meter-zone-quiet {
  width: 12%;
  height: 100%;
  background: rgba(144, 164, 174, 0.28);
}

.meter-zone-sweet {
  width: 66%;
  height: 100%;
  background: rgba(102, 187, 106, 0.28);
  border-left: 2px dashed rgba(46, 125, 50, 0.45);
  border-right: 2px dashed rgba(216, 67, 21, 0.45);
}

.meter-zone-loud {
  width: 22%;
  height: 100%;
  background: rgba(239, 83, 80, 0.25);
}

.meter-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 0%;
  background: linear-gradient(90deg, #42a5f5 0%, #43a047 55%, #ffb300 85%, #e53935 100%);
  border-radius: 10px;
  transition: width 0.08s linear;
}

/* --- Scenic Journey Stage ----------------------------------------------- */

.journey-stage {
  position: relative;
  width: 100%;
  max-width: 760px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 14px;
  z-index: 10;
}

.sky-decor {
  position: absolute;
  top: 6px;
  left: 0;
  right: 0;
  height: 70px;
  pointer-events: none;
}

.decor-sun {
  position: absolute;
  top: 0;
  right: 16px;
  font-size: 2.5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 10px rgba(255, 193, 7, 0.4));
}

.decor-cloud {
  position: absolute;
  font-size: 2.1rem;
  line-height: 1;
  opacity: 0.88;
}

.cloud-a {
  top: 6px;
  left: 8%;
  animation: cloud-drift 16s ease-in-out infinite alternate;
}

.cloud-b {
  top: 14px;
  left: 52%;
  animation: cloud-drift 20s ease-in-out infinite alternate-reverse;
}

@keyframes cloud-drift {
  from { transform: translateX(-14px); }
  to { transform: translateX(14px); }
}

/* --- 6 Blooming Milestones ---------------------------------------------- */

.milestones-row {
  position: relative;
  width: 82%;
  margin: 0 auto 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 12;
  pointer-events: none;
}

.milestone-item {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  border: 2px dashed rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  line-height: 1;
  filter: grayscale(0.85) opacity(0.55);
  transform: scale(0.82);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.3s ease, background 0.3s ease;
}

.milestone-item.bloomed {
  filter: none;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #ffd54f;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(255, 193, 7, 0.35);
}

/* --- Journey Track & Moving Hero ---------------------------------------- */

.journey-track {
  position: relative;
  width: 100%;
  height: 108px;
  display: flex;
  align-items: center;
  padding: 0 44px;
}

.track-line {
  position: relative;
  width: 100%;
  height: 18px;
  background: rgba(255, 255, 255, 0.68);
  border-radius: 12px;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.12), 0 4px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.journey-progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #66bb6a 0%, #ffee58 50%, #ffa726 100%);
  border-radius: 10px;
  transition: width 0.08s linear;
}

.endpoint-marker {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.5rem;
  line-height: 1;
  z-index: 11;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.18));
}

.start-marker {
  left: 4px;
}

.goal-marker {
  right: 4px;
}

.hero-wrapper {
  position: absolute;
  top: 50%;
  left: 44px;
  transform: translate(-50%, -62%);
  z-index: 16;
  will-change: left;
}

.hero-actor {
  position: relative;
  background: transparent;
  border: none;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  outline: none;
}

.hero-actor.hero-moving {
  animation: hero-bob 0.42s ease-in-out infinite alternate;
}

@keyframes hero-bob {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-7px) rotate(2deg); }
}

.hero-actor.hero-too-loud {
  animation: game-shake 0.35s ease;
}

.hero-note-aura {
  position: absolute;
  top: -18px;
  right: -8px;
  font-size: 1.5rem;
  line-height: 1;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hero-actor.hero-moving .hero-note-aura {
  opacity: 1;
  transform: scale(1.1);
}

.hero-passenger {
  font-size: 1.85rem;
  line-height: 1;
  margin-bottom: -10px;
  z-index: 2;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.hero-vehicle {
  font-size: 3.8rem;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.22));
}

.hero-vehicle.face-right {
  transform: scaleX(-1);
}

.hero-puff-layer {
  position: absolute;
  top: -36px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 22;
}

.steam-cloud {
  position: absolute;
  left: -18px;
  top: 0;
  font-size: 2.3rem;
  line-height: 1;
  animation: steam-pop 0.95s ease-out forwards;
}

@keyframes steam-pop {
  0% {
    transform: translate(0, 8px) scale(0.4);
    opacity: 1;
  }
  100% {
    transform: translate(var(--dx, -12px), -54px) scale(1.5);
    opacity: 0;
  }
}

/* --- Particles Layer ---------------------------------------------------- */

.particles-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 25;
}

.sing-particle {
  position: absolute;
  font-size: 1.65rem;
  line-height: 1;
  pointer-events: none;
  animation: particle-rise 0.9s ease-out forwards;
}

@keyframes particle-rise {
  0% {
    transform: translate(0, 0) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx, 0px), var(--ty, -48px)) scale(1.2);
    opacity: 0;
  }
}

/* --- Bottom Singing Controls -------------------------------------------- */

.sing-controls {
  width: 100%;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  z-index: 20;
}

.ctrl-btn {
  border: none;
  border-radius: 32px;
  padding: 12px 20px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
  touch-action: none;
}

.ctrl-btn:active {
  transform: scale(0.95);
}

.mic-btn {
  background: linear-gradient(135deg, #546e7a 0%, #37474f 100%);
  border: 2px solid #b0bec5;
}

.mic-btn[aria-pressed="true"] {
  background: linear-gradient(135deg, #00897b 0%, #00695c 100%);
  border-color: #80cbc4;
  box-shadow: 0 6px 18px rgba(0, 137, 123, 0.38);
}

.hold-sing-btn {
  flex: 1 1 220px;
  max-width: 320px;
  min-height: 56px;
  font-size: 1.2rem;
  background: linear-gradient(135deg, #43a047 0%, #2e7d32 100%);
  border: 3px solid #a5d6a7;
  box-shadow: 0 8px 20px rgba(46, 125, 50, 0.35);
}

.hold-sing-btn.holding {
  background: linear-gradient(135deg, #ec407a 0%, #c2185b 100%);
  border-color: #f8bbd0;
  transform: scale(1.04);
  box-shadow: 0 0 24px rgba(236, 64, 122, 0.55);
}

.puff-demo-btn {
  background: linear-gradient(135deg, #fb8c00 0%, #ef6c00 100%);
  border: 2px solid #ffe082;
}

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

@media (max-width: 520px) {
  .sing-field {
    padding: 6px 10px 12px;
  }

  .stage-tab {
    padding: 5px 12px;
    font-size: 0.9rem;
  }

  .vowel-card {
    padding: 6px 10px;
    gap: 8px;
  }

  .vowel-badge {
    padding: 6px 10px;
    font-size: 1.05rem;
  }

  .stage-title {
    font-size: 0.95rem;
  }

  .stage-prompt {
    font-size: 0.82rem;
  }

  .milestone-item {
    width: 34px;
    height: 34px;
    font-size: 1.25rem;
  }

  .hero-vehicle {
    font-size: 3.1rem;
  }

  .hero-passenger {
    font-size: 1.5rem;
  }

  .endpoint-marker {
    font-size: 2rem;
  }

  .journey-track {
    padding: 0 34px;
    height: 90px;
  }

  .ctrl-btn {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .hold-sing-btn {
    min-height: 50px;
    font-size: 1.08rem;
  }
}

@media (max-height: 620px) {
  .top-hud {
    gap: 5px;
  }

  .sky-decor {
    display: none;
  }

  .milestones-row {
    margin-bottom: 6px;
  }

  .journey-track {
    height: 76px;
  }

  .hero-vehicle {
    font-size: 2.8rem;
  }

  .hero-passenger {
    font-size: 1.35rem;
  }
}
