/* Number mount sizing; the game appearance comes from math-starship.css. */
body.number-practice-page:not(.phone-qr-gate){margin:0;min-height:100vh;min-height:100dvh}
body.number-practice-page:not(.phone-qr-gate) #number-practice-app{height:100vh;height:100dvh}
body.number-practice-page:not(.phone-qr-gate) .number-practice-shell{height:100%}
.number-practice-loading{min-height:40vh;display:grid;align-content:center;justify-items:center;gap:1rem;background:#102747;color:#fff;font-weight:700}
.number-practice-loading progress{width:min(80vw,320px)}

/* The wave is the lesson round, separate from the five character evolutions. */
.starship[data-number-practice]{height:100dvh;max-height:100dvh;overflow:clip}
.starship[data-number-practice] .starship-bar{overflow:clip}
.starship[data-number-practice] .starship-stage{min-height:180px}
.starship[data-number-practice] .starship-hud [data-level]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;width:100%;min-width:0;min-inline-size:0;height:42px;min-height:42px;max-height:42px}
.starship[data-number-practice] .number-wave{display:block;flex:0 1 auto;min-width:0;min-inline-size:0;max-width:65%;box-sizing:border-box;padding:.22rem .55rem;border:2px solid #ffe066;border-radius:999px;background:#221c52;color:#fff4b8;font-size:clamp(21px,6vw,28px);font-weight:900;line-height:1.15;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.starship[data-number-practice] .number-evolution{flex:0 1 52%;min-width:0;min-inline-size:0;font-size:.7rem;line-height:1.25;text-align:right;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* Active manual replay button in top bar for 6-7yo pure-audio listening */
.starship[data-number-practice] .number-replay-btn{flex:0 1 auto;min-block-size:44px;min-inline-size:0;min-height:44px;min-width:0;max-width:calc(100% - 124px);padding:6px 11px;border:2px solid #ffe066;border-radius:999px;background:linear-gradient(180deg,#fff7c2 0%,#ffd55a 100%);color:#2b1b54;font-size:clamp(13px,3.6vw,15px);font-weight:900;line-height:1.1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;box-shadow:0 3px 0 rgba(140,84,0,.42)}
.starship[data-number-practice] .number-replay-btn[aria-disabled="true"]{opacity:.55;cursor:default;box-shadow:none}
@media (pointer:coarse){.starship[data-number-practice] .number-replay-btn{min-block-size:48px;min-height:48px}}

/* High-contrast 2-player Duel score & clock HUD */
.starship[data-number-practice] .math-duel-hud{padding:4px 8px;gap:5px;border-radius:999px;background:rgba(24,20,68,.9);border:1.5px solid rgba(255,224,102,.58);box-shadow:0 3px 10px rgba(8,8,28,.45);font-variant-numeric:tabular-nums}
.starship[data-number-practice] .math-duel-hud [data-duel-own-score]{flex:0 1 auto;min-inline-size:0;padding:2px 8px;border-radius:999px;background:rgba(255,224,102,.18);border:1.5px solid rgba(255,224,102,.72);color:#fff4b8;font-weight:900}
.starship[data-number-practice] .math-duel-hud [data-duel-peer-score]{flex:0 1 auto;min-inline-size:0;padding:2px 8px;border-radius:999px;background:rgba(124,246,255,.15);border:1.5px solid rgba(124,246,255,.65);color:#d9f8ff;font-weight:900}
.starship[data-number-practice] .math-duel-hud [data-duel-clock]{flex:0 0 auto;color:#fff;font-weight:900}

/* Reclaim portrait sky height while keeping landscape two-handed trackpad bar & keyboard support */
@media (orientation:portrait){.starship[data-number-practice].is-playing .starship-controls{display:none}}

/* Keep the existing choices visible on short phones without changing Math. */
@media (max-height: 700px) and (orientation: portrait) {
  .starship[data-number-practice].is-selecting .starship-overlay {
    padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right))
      max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  }
  .starship[data-number-practice].is-selecting .starship-card {
    padding: 10px 8px;
  }
  .starship[data-number-practice].is-selecting .starship-card h2 {
    margin: 0 0 6px;
    font-size: clamp(16px, 4.5vw, 20px);
    line-height: 1.2;
  }
  .starship[data-number-practice].is-selecting [data-setup] {
    gap: 8px;
  }
  .starship[data-number-practice].is-selecting .starship-roles {
    gap: 7px;
  }
  .starship[data-number-practice].is-selecting .starship-roles button {
    min-height: 64px;
    padding: 6px 10px;
  }
  .starship[data-number-practice].is-selecting .starship-roles button span {
    width: 44px;
    height: 44px;
    font-size: 44px;
  }
  .starship[data-number-practice].is-selecting [data-start-choice] {
    margin-top: 0;
    gap: 8px;
  }
  .starship[data-number-practice].is-selecting [data-start-choice] button,
  .starship[data-number-practice].is-selecting [data-change-target],
  .starship[data-number-practice].is-selecting [data-open-math-duel],
  .starship[data-number-practice].is-selecting [data-overlay-back] {
    min-height: 48px;
    padding: 8px 10px;
  }
  .starship[data-number-practice].is-selecting [data-change-target] {
    flex-basis: 74px;
  }
  .starship[data-number-practice].is-selecting [data-open-math-duel] {
    flex-basis: 140px;
  }
}

/* Hide dead disabled Continue button on Ready/Game Over and compact Game Over result layout */
.starship[data-number-practice].is-selecting [data-continue]:disabled,
.starship[data-number-practice].is-result [data-continue]:disabled{display:none}
.starship[data-number-practice].is-result .starship-primary-slot,
.starship[data-number-practice].is-result [data-change-target]{display:none}
.starship[data-number-practice] .starship-result-card [data-start-choice]{width:100%;margin-top:6px}
.starship[data-number-practice].is-result .starship-roles{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin-top:6px}
.starship[data-number-practice].is-result .starship-roles button{flex-direction:column;justify-content:center;text-align:center;min-height:56px;padding:5px 4px;gap:3px}
.starship[data-number-practice].is-result .starship-roles .role-art{width:36px;height:36px;flex:0 0 36px}
.starship[data-number-practice].is-result .starship-roles .role-art img{width:100%;height:100%;object-fit:contain}
