/* UX audit fixes (October 2026). Loaded last so each rule wins over the older layered sheets.
   Each block names the audit item it resolves. */

/* V2: overflowing stages start at the top and scroll, instead of centring off-screen (unreachable). */
.game-shell > .main-stage { justify-content: safe center !important; }
.game-shell > .main-stage > * { flex-shrink: 0; }

/* V3: the board is drawn inside its slot (viewBox scales to fit), never past it into the score strip. */
.land-map-slot { position: relative !important; }
.land-map-slot > .candy-board {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
}

/* V5: shared-screen toggle uses the dark lobby surface (rules in shared-screen.css). */

/* V8: reveal keeps the question's A-D keys and colours. */
.reveal-option[style*="--option"] { border-left: 6px solid var(--option) !important; }
.reveal-answer { display: inline-flex; align-items: center; gap: 8px; }
.reveal-option .option-key,
.rapid-reveal-option .option-key {
  display: inline-grid; place-items: center; flex: 0 0 auto;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--option, #ff3b92) !important; color: #190b31 !important;
  font-weight: 900; font-size: 15px;
}

/* V10: result avatars sit above their labels instead of covering them. */
.land-battle-pair.is-result .land-player-identity { flex-direction: column !important; align-items: center !important; text-align: center; gap: 8px !important; }
.land-battle-pair.is-result .land-player-avatar { position: static !important; margin: 0 !important; transform: none !important; }
.land-battle-pair.is-result .land-player-copy { position: static !important; align-items: center; }

/* V11: one "(you)" marker everywhere. */
.you-label {
  font-size: .72em !important; font-weight: 700 !important; letter-spacing: 0 !important;
  text-transform: none !important; opacity: .75; white-space: nowrap; vertical-align: baseline;
}

/* V13: both order labels sit on the same axis. */
.order-end-label, .order-largest, .order-smallest { text-align: center !important; padding-inline: 0 !important; }

/* V14: headings, eyebrows and progress dots share the centred axis on every stage. */
.map-stage-heading { justify-content: center !important; text-align: center; }
.map-stage-heading .stage-title { text-align: center; }
.cinematic-reveal > .eyebrow { align-self: center !important; justify-content: center !important; text-align: center !important; width: 100%; }
.question-top .five-progress { margin-left: auto !important; margin-right: auto !important; }

/* V15: one primary style (lime) on every screen; disabled looks disabled, not olive. */
.lobby .start-game .primary {
  background: var(--lime, #d8ff36) !important; color: #1b1029 !important;
  border-color: transparent !important; box-shadow: 0 4px #809626 !important;
}
.primary:disabled, button.primary[disabled] {
  background: #3a2c4f !important; color: #9d8fb3 !important; box-shadow: none !important; opacity: 1 !important;
}

/* V16: one label style for lobby controls; open seats read as seats, not as an "add" button. */
.lobby-field-label {
  display: block; font-size: 12px !important; font-weight: 850 !important; letter-spacing: .09em !important;
  text-transform: uppercase; color: #bda9cc !important;
}
.empty-seat .empty-avatar small { font-size: 11px; font-weight: 900; letter-spacing: .12em; color: #8a709f; }
.empty-seat > span:not(.empty-avatar) { font-size: 12px; color: #8a709f; }

/* Final screen: the non-host exit (bug 14). */
.final-leave { margin-left: 12px; }

/* V4: phone lobby. Two seats per row, names readable, admin buttons wrap under the name,
   and the colour / shape labels sit above their rows instead of under the swatches. */
@media (max-width: 600px) {
  .lobby-players { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px !important; }
  .lobby-player {
    display: grid !important; grid-template-columns: 40px minmax(0, 1fr) !important; grid-auto-rows: auto;
    align-items: center !important; column-gap: 8px !important; row-gap: 4px !important;
    min-height: 58px !important; padding: 8px 36px 8px 8px !important; text-align: left;
  }
  .lobby-player > .avatar, .lobby-player > svg.avatar, .lobby-player > .empty-avatar {
    grid-row: 1 / span 2; width: 40px !important; height: 40px !important;
  }
  .lobby-player > strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px !important; }
  .lobby-player > span:not(.reroll-note):not(.empty-avatar) { display: block !important; grid-column: 2; font-size: 11px !important; min-width: 0; }
  .lobby-player > .player-mute-button { top: 6px !important; right: 6px !important; width: 26px !important; height: 26px !important; }
  .lobby-player-admin { grid-column: 1 / -1; margin-left: 0 !important; justify-content: flex-start; flex-wrap: wrap; gap: 6px !important; }
  .lobby-player-admin .quiet-button { padding: 4px 6px !important; font-size: 12px !important; min-height: 0 !important; }
  .lobby-identity-controls { grid-template-columns: minmax(0, 1fr) !important; gap: 4px !important; }
  .lobby-identity-controls > small { font-size: 11px !important; margin-top: 4px; }
}

/* Ready to skip a countdown wait: fixed just above the score strip, right side. When the battle round track is open
   (fixed on the right too, 188px wide after its ATTACKS-rail override, ending 118px off the bottom), the pill steps
   left past it — except on touch screens up to 932px, where mobile.css pins the track to the top bar instead. */
.ready-skip{position:fixed;right:var(--ready-strip-r,16px);bottom:calc(var(--ready-strip-h,0px) + 10px);z-index:30;display:flex;align-items:center;gap:10px;padding:6px 6px 6px 12px;border-radius:999px;background:#13091ff2;border:1px solid #57377b;box-shadow:0 8px 22px #0007;animation:readySkipIn .24s cubic-bezier(.16,1,.3,1) both}
body:has(.battle-round-track) .ready-skip{right:212px}
@media (hover:none) and (pointer:coarse) and (max-width:932px){body:has(.battle-round-track) .ready-skip{right:16px}}
@media (hover:none) and (pointer:coarse) and (max-width:600px){body:has(.battle-round-track) .ready-skip{right:10px}}
.ready-skip:not(:has(.ready-skip-count)){padding-left:6px}
.ready-skip-count{order:-1;display:flex;align-items:center;gap:4px;color:#bca6cf;font-size:13px;font-weight:700;font-variant-numeric:tabular-nums}
.ready-skip-count i{width:9px;height:9px;border-radius:50%;border:2px solid var(--player);background:transparent;transition:background .15s}
.ready-skip-count i.on{background:var(--player)}
.ready-skip-count i:last-of-type{margin-right:4px}
.ready-skip-button{display:inline-flex;align-items:center;gap:6px;min-height:40px;padding:8px 18px;border-radius:999px;background:var(--lime);color:#1b1029;font-weight:800;font-size:15px;border:0;box-shadow:0 3px #809626;cursor:pointer}
.ready-skip-button svg{width:17px;height:17px}
.ready-skip.is-ready .ready-skip-button{background:#2a1a40;color:var(--lime);box-shadow:inset 0 0 0 2px var(--lime)}
.ready-skip-button:active{transform:translateY(2px);box-shadow:0 1px #809626}
@keyframes readySkipIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (width<=600px){.ready-skip{right:10px;bottom:calc(var(--ready-strip-h,0px) + 8px)}}
@media (prefers-reduced-motion:reduce){.ready-skip{animation:none}}
