:root {
  --game-bg: linear-gradient(180deg, #90caf9 0%, #e1f5fe 48%, #c8e6c9 78%, #66bb6a 100%);
  --game-accent: #1565c0;
}

.pitch-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 12px 14px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.4s ease;
}

.pitch-field.mode-contrast {
  background: linear-gradient(180deg, #81d4fa 0%, #e1f5fe 46%, #c8e6c9 76%, #66bb6a 100%);
}

.pitch-field.mode-slide {
  background: linear-gradient(180deg, #7e57c2 0%, #42a5f5 42%, #b3e5fc 76%, #81c784 100%);
}

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

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

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

.mode-tab {
  background: rgba(255, 255, 255, 0.86);
  border: 2px solid rgba(255, 255, 255, 0.95);
  border-radius: 22px;
  padding: 6px 16px;
  font-size: 0.98rem;
  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;
}

.mode-tab.active {
  background: #fb8c00;
  color: #ffffff;
  border-color: #ffe082;
  box-shadow: 0 4px 12px rgba(251, 140, 0, 0.35);
  transform: scale(1.04);
}

.cue-card {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  padding: 7px 14px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.1);
  text-align: center;
}

.cue-icon {
  flex: 0 0 auto;
  font-size: 1.5rem;
  line-height: 1;
}

.cue-text {
  font-size: 0.96rem;
  font-weight: 800;
  color: #1e3a4c;
  line-height: 1.25;
}

/* --- Pitch Meter Bar ---------------------------------------------------- */

.pitch-meter-box {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 18px;
  padding: 5px 12px 7px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

.pitch-meter-label {
  color: #37474f;
}

.pitch-status {
  color: #1565c0;
}

.pitch-bar-track {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pitch-end-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.pitch-bar-rail {
  position: relative;
  flex: 1 1 auto;
  height: 14px;
  background: linear-gradient(90deg, #8d6e63 0%, #ffb74d 35%, #81c784 65%, #29b6f6 100%);
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.pitch-fill {
  height: 100%;
  width: 50%;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.22);
}

.pitch-thumb {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.15rem;
  line-height: 1;
  background: #ffffff;
  border: 2px solid #1565c0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  transition: left 0.08s linear;
}

/* --- Main Vertical Pitch Stage ------------------------------------------ */

.pitch-stage {
  position: relative;
  width: 100%;
  max-width: 740px;
  flex: 1 1 auto;
  min-height: 180px;
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin: 6px 0;
  z-index: 10;
}

.character-anchors {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 6px 0;
  z-index: 15;
}

.char-anchor {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #ffffff;
  border-radius: 20px;
  padding: 8px 10px;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.14);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease;
}

.char-anchor:active {
  transform: scale(0.94);
}

.bird-anchor {
  border-color: #4fc3f7;
}

.bear-anchor {
  border-color: #ffb74d;
}

.char-anchor.char-singing {
  transform: scale(1.08);
  box-shadow: 0 0 20px rgba(255, 213, 79, 0.85);
}

.char-emoji {
  font-size: 2.3rem;
  line-height: 1;
}

.char-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: #1e3a4c;
  white-space: nowrap;
}

/* --- Flight Arena ------------------------------------------------------- */

.arena-track {
  position: relative;
  flex: 1 1 auto;
  background: rgba(255, 255, 255, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.68);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: inset 0 4px 14px rgba(255, 255, 255, 0.35);
}

.high-lane-decor,
.low-lane-decor {
  position: absolute;
  left: 16px;
  right: 16px;
  display: flex;
  justify-content: space-around;
  pointer-events: none;
  opacity: 0.55;
  font-size: 1.7rem;
  line-height: 1;
}

.high-lane-decor {
  top: 8px;
}

.low-lane-decor {
  bottom: 8px;
}

/* Rainbow SVG Arch (shown in Rainbow Slide mode) */
.rainbow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.pitch-field.mode-slide .rainbow-svg {
  opacity: 0.85;
}

.rainbow-band {
  fill: none;
  stroke-linecap: round;
}

.rb-outer {
  stroke: #ff5252;
  stroke-width: 12;
}

.rb-mid {
  stroke: #ffd740;
  stroke-width: 10;
}

.rb-inner {
  stroke: #40c4ff;
  stroke-width: 8;
}

/* Collectible Treats / Stars */
.targets-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 12;
}

.pitch-target {
  position: absolute;
  width: 46px;
  height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.82);
  border: 2px dashed rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.65rem;
  line-height: 1;
  transition: transform 0.25s ease, opacity 0.25s ease, box-shadow 0.25s ease;
}

.pitch-target.target-active {
  background: #ffffff;
  border: 3px solid #ffca28;
  box-shadow: 0 0 18px rgba(255, 193, 7, 0.85);
  animation: target-pulse 0.7s ease-in-out infinite alternate;
}

@keyframes target-pulse {
  from { transform: translate(-50%, -50%) scale(0.96); }
  to { transform: translate(-50%, -50%) scale(1.14); }
}

.pitch-target.target-collected {
  transform: translate(-50%, -50%) scale(0.2);
  opacity: 0;
}

/* Musical Bee Elevator */
.bee-wrapper {
  position: absolute;
  left: 14%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 18;
  will-change: left, top;
}

.bee-actor {
  position: relative;
  background: rgba(255, 255, 255, 0.92);
  border: 3px solid #ffd54f;
  border-radius: 50%;
  width: 62px;
  height: 62px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  padding: 0;
  outline: none;
}

.bee-emoji {
  font-size: 2.35rem;
  line-height: 1;
}

.bee-note {
  position: absolute;
  top: -14px;
  right: -8px;
  font-size: 1.3rem;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.bee-actor.bee-singing .bee-note {
  opacity: 1;
}

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

.pitch-spark {
  position: absolute;
  font-size: 1.55rem;
  line-height: 1;
  pointer-events: none;
  animation: spark-pop 0.85s ease-out forwards;
}

@keyframes spark-pop {
  0% {
    transform: translate(-50%, -50%) scale(0.5);
    opacity: 1;
  }
  100% {
    transform: translate(calc(-50% + var(--tx, 0px)), calc(-50% + var(--ty, -40px))) scale(1.25);
    opacity: 0;
  }
}

/* --- Bottom Pitch Controls ---------------------------------------------- */

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

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

.pitch-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;
}

.low-sing-btn {
  flex: 1 1 170px;
  min-height: 52px;
  background: linear-gradient(135deg, #8d6e63 0%, #5d4037 100%);
  border: 3px solid #ffe0b2;
}

.low-sing-btn.holding {
  background: linear-gradient(135deg, #fb8c00 0%, #e65100 100%);
  transform: scale(1.04);
  box-shadow: 0 0 22px rgba(251, 140, 0, 0.6);
}

.high-sing-btn {
  flex: 1 1 170px;
  min-height: 52px;
  background: linear-gradient(135deg, #039be5 0%, #0277bd 100%);
  border: 3px solid #b3e5fc;
}

.high-sing-btn.holding {
  background: linear-gradient(135deg, #ec407a 0%, #c2185b 100%);
  transform: scale(1.04);
  box-shadow: 0 0 22px rgba(236, 64, 122, 0.6);
}

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

@media (max-width: 540px) {
  .pitch-field {
    padding: 6px 8px 10px;
  }

  .mode-tab {
    padding: 5px 12px;
    font-size: 0.88rem;
  }

  .cue-card {
    padding: 5px 10px;
  }

  .cue-text {
    font-size: 0.84rem;
  }

  .char-anchor {
    padding: 6px 7px;
  }

  .char-emoji {
    font-size: 1.8rem;
  }

  .char-label {
    font-size: 0.68rem;
  }

  .pitch-target {
    width: 38px;
    height: 38px;
    font-size: 1.35rem;
  }

  .bee-actor {
    width: 50px;
    height: 50px;
  }

  .bee-emoji {
    font-size: 1.9rem;
  }

  .pitch-ctrl-btn {
    padding: 10px 12px;
    font-size: 0.92rem;
  }

  .low-sing-btn,
  .high-sing-btn {
    min-height: 46px;
    flex: 1 1 135px;
  }
}

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

  .char-emoji {
    font-size: 1.65rem;
  }

  .bee-actor {
    width: 46px;
    height: 46px;
  }

  .bee-emoji {
    font-size: 1.75rem;
  }
}
