.pitchWings{
  --ink:#182132;
  --muted:rgba(24,33,50,.68);
  --line:rgba(24,33,50,.14);
  --sky:#dff5ff;
  --leaf:#dff4d2;
  --sun:#ffd45f;
  --coral:#f36b4f;
  --blue:#2f89d8;
  --green:#42a768;
  --plum:#7653a7;
  display:grid;
  grid-template-rows:minmax(0, 1fr);
  padding:8px;
  padding-top:calc(8px + env(safe-area-inset-top));
  padding-bottom:calc(8px + env(safe-area-inset-bottom));
  background:linear-gradient(180deg, #e8f8ff 0%, #fbfff1 58%, #fff5db 100%);
  color:var(--ink);
}

.pitchGameArea{
  min-height:0;
  display:grid;
  grid-template-rows:auto minmax(0, 1fr) auto;
  gap:8px;
}

.pitchTopPanel,
.pitchControlsPanel{
  border-radius:8px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.92);
  box-shadow:0 14px 32px rgba(24,33,50,.13);
}

.pitchTopPanel{
  display:grid;
  grid-template-columns:minmax(270px, .92fr) minmax(0, 1.08fr);
  gap:12px;
  align-items:center;
  padding:10px 14px;
}

#appRoot:fullscreen .pitchTopPanel,
#appRoot:-webkit-full-screen .pitchTopPanel{
  padding-left:max(14px, min(190px, 28vw));
}

.pitchWings .levelLabel,
.pitchWings .meterLabel{
  width:max-content;
  max-width:100%;
  min-height:30px;
  display:inline-flex;
  align-items:center;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(47,137,216,.24);
  background:rgba(47,137,216,.12);
  color:#163f70;
  font-size:13px;
  font-weight:1000;
  line-height:1;
  text-transform:uppercase;
  letter-spacing:0;
}

.pitchWings .mainPrompt{
  color:var(--ink);
  font-size:clamp(30px, 4.7vw, 60px);
  line-height:1.02;
  font-weight:1100;
  text-wrap:balance;
}

.pitchWings .feedbackLine{
  min-height:25px;
  color:var(--muted);
  font-size:clamp(15px, 1.45vw, 21px);
  line-height:1.2;
  font-weight:900;
}

.pitchWings .feedbackLine.good{ color:#1d7f4b; }
.pitchWings .feedbackLine.bad{ color:#b7362b; }
.pitchWings .feedbackLine.ready{ color:#906200; }

.pitchTargetPanel{
  min-width:0;
  display:grid;
  gap:8px;
  padding:10px;
  border-radius:8px;
  border:1px solid rgba(24,33,50,.13);
  background:linear-gradient(180deg, rgba(255,255,255,.92), rgba(240,251,255,.88));
}

.targetHeader{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.gateText{
  color:var(--muted);
  font-size:16px;
  font-weight:1000;
  white-space:nowrap;
}

.gateChoices{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
}

.gateChoices.twoChoices{
  grid-template-columns:repeat(2, minmax(0, 1fr));
}

.gateChoice{
  min-height:64px;
  display:grid;
  place-items:center;
  padding:8px;
  border-radius:8px;
  border:2px solid rgba(24,33,50,.12);
  background:#ffffff;
  box-shadow:0 8px 18px rgba(24,33,50,.10);
  color:var(--ink);
  font-size:clamp(18px, 2vw, 28px);
  line-height:1;
  font-weight:1100;
}

.gateChoice.high,
.gateChoice.higher{ border-color:rgba(118,83,167,.34); background:#f3effb; }
.gateChoice.middle{ border-color:rgba(47,137,216,.32); background:#edf7ff; }
.gateChoice.low,
.gateChoice.lower{ border-color:rgba(66,167,104,.34); background:#effaf2; }

.progressTrack{
  height:15px;
  overflow:hidden;
  border-radius:999px;
  border:1px solid rgba(24,33,50,.10);
  background:rgba(24,33,50,.08);
}

.progressFill{
  width:0%;
  height:100%;
  border-radius:inherit;
  background:linear-gradient(90deg, var(--plum), var(--blue), var(--green), var(--sun));
  transition:width .25s ease;
}

.pitchPlayWrap{
  min-height:0;
  position:relative;
  border-radius:8px;
  border:1px solid var(--line);
  background:#dff5ff;
  overflow:hidden;
  box-shadow:0 18px 38px rgba(24,33,50,.16);
}

.phaserMount{
  position:absolute;
  inset:0;
}

.phaserMount canvas{
  display:block;
  width:100% !important;
  height:100% !important;
}

.runCallout{
  position:absolute;
  inset:0;
  z-index:8;
  display:grid;
  place-items:center;
  pointer-events:none;
  color:var(--ink);
  font-size:clamp(42px, 8vw, 110px);
  line-height:1;
  font-weight:1100;
  text-align:center;
  text-shadow:0 6px 22px rgba(255,255,255,.88), 0 8px 28px rgba(24,33,50,.20);
  animation:pitch-callout-pop .42s ease-out;
}

.runCallout.good{ color:#1d7f4b; }
.runCallout.bad{ color:#b7362b; }
.runCallout.ready{ color:#906200; }

@keyframes pitch-callout-pop{
  0%{ opacity:0; transform:scale(.78); }
  60%{ opacity:1; transform:scale(1.05); }
  100%{ opacity:1; transform:scale(1); }
}

.pitchControlsPanel{
  display:grid;
  grid-template-columns:minmax(0, 1fr) minmax(170px, .34fr) auto;
  gap:10px;
  align-items:center;
  padding:10px;
}

.flapControls{
  min-width:0;
  display:grid;
}

.flapBtn{
  min-height:76px;
  padding:12px;
  border-radius:8px;
  border:2px solid rgba(47,137,216,.36);
  background:linear-gradient(180deg, rgba(255,255,255,.95), rgba(223,245,255,.95));
  color:#123f70;
  box-shadow:0 10px 24px rgba(24,33,50,.12);
  cursor:pointer;
  user-select:none;
  touch-action:manipulation;
  font-size:clamp(25px, 3vw, 38px);
  line-height:1;
  font-weight:1100;
}

.flapBtn:active{ transform:scale(.99); }

.pitchWings .pill{
  background:rgba(255,255,255,.82);
  border-color:rgba(24,33,50,.12);
  box-shadow:0 8px 20px rgba(24,33,50,.10);
}

.pitchWings .pill .label{ color:var(--muted); }
.pitchWings .pill .value{ color:var(--ink); }

.pitchWings .btn{
  border-radius:8px;
  color:var(--ink);
  background:rgba(255,255,255,.82);
  border-color:rgba(24,33,50,.14);
  box-shadow:0 8px 20px rgba(24,33,50,.10);
}

.pitchWings .btn.primary{
  color:#123f70;
  background:rgba(47,137,216,.16);
  border-color:rgba(47,137,216,.40);
}

.pitchWings .btn.ghost{
  background:rgba(255,255,255,.68);
}

.levelGrid{
  width:min(980px, 98%);
  margin:12px auto 4px;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
  text-align:left;
}

.levelChoice{
  min-height:132px;
  display:grid;
  align-content:start;
  gap:7px;
  padding:12px;
  border-radius:8px;
  border:2px solid rgba(24,33,50,.14);
  background:#ffffff;
  color:var(--ink);
  box-shadow:0 10px 24px rgba(24,33,50,.12);
  cursor:pointer;
  text-align:left;
}

.levelChoice strong{
  font-size:20px;
  line-height:1.05;
}

.levelChoice span{
  color:rgba(24,33,50,.70);
  font-size:14px;
  font-weight:900;
  line-height:1.25;
}

.levelChoice small{
  width:max-content;
  max-width:100%;
  display:inline-flex;
  align-items:center;
  padding:5px 8px;
  border-radius:999px;
  background:rgba(47,137,216,.12);
  color:#163f70;
  font-size:12px;
  font-weight:1000;
}

.levelChoice.active{
  border-color:rgba(47,137,216,.58);
  box-shadow:0 0 0 4px rgba(47,137,216,.13), 0 10px 24px rgba(24,33,50,.12);
}

@media (max-width:1120px){
  .pitchControlsPanel{
    grid-template-columns:1fr;
  }
  .pitchControlsPanel .hudLeft,
  .pitchControlsPanel .hudRight{
    justify-content:center;
  }
}

@media (max-width:920px){
  .pitchTopPanel{
    grid-template-columns:1fr;
  }
  .levelGrid{
    grid-template-columns:1fr;
  }
}

@media (max-width:680px){
  .pitchWings{
    padding:6px;
  }
  .pitchGameArea{
    gap:6px;
  }
  .gateChoices,
  .gateChoices.twoChoices{
    grid-template-columns:1fr;
  }
  .gateChoice{
    min-height:48px;
  }
  .flapBtn{
    min-height:64px;
  }
}

@media (max-height:720px){
  .pitchWings .mainPrompt{
    font-size:clamp(25px, 4vw, 46px);
  }
  .pitchGameArea{
    gap:6px;
  }
  .flapBtn{
    min-height:58px;
  }
}
