/* Active play occupies the game surface; career navigation returns on leaving. */
.milestone-celebration {
  position: absolute;
  z-index: 5;
  top: 50%;
  bottom: auto;
  left: 50%;
  right: auto;
  transform: translate(-50%, -50%);
  width: min(340px, calc(100% - 24px));
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 340px;
  margin: auto;
  padding: 10px 14px;
  border: 2px solid var(--gold);
  background: var(--night);
  box-shadow: 3px 3px 0 #09112a;
  pointer-events: none;
  color: var(--cream);
}
.milestone-celebration > div {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  min-width: 0;
}
.milestone-celebration strong {
  grid-row: 1/3;
  color: var(--gold);
  font-size: var(--type-score);
  line-height: 1.1;
}
.milestone-celebration span {
  font-size: var(--type-body);
}
.milestone-celebration b {
  font-size: var(--type-body);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#game-frame .game-shell[data-phone-match='true'] #game-header,
#game-frame .game-shell[data-phone-match='true'] #navigation {
  display: none;
}
#game-frame .game-shell[data-phone-match='true'] #app {
  overflow: hidden;
  scroll-padding: 0;
}
#game-shell .match-screen.phone-match {
  grid-template-rows: 81px minmax(0, 1fr) auto auto auto auto;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}
#game-shell .phone-match .match-commentary {
  min-height: 0;
  padding: 5px 10px;
  gap: 3px;
}
#game-shell .phone-match .match-commentary > p {
  min-height: 16px;
  max-height: 32px;
  line-height: 16px;
}
#game-shell .phone-match .phone-player {
  min-height: 52px;
  padding: 6px 9px;
}
#game-shell .phone-match .phone-bowler {
  min-height: 44px;
  padding: 5px 9px;
}
#game-shell .phone-match .phone-play-dock {
  position: relative;
  display: grid;
  gap: 4px;
  padding: 5px 8px calc(5px + env(safe-area-inset-bottom));
  bottom: auto;
}
.phone-match .phone-quick-plans {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}
#game-frame .phone-match .phone-quick-plans .game-button {
  min-width: 0;
  min-height: 44px;
  padding: 5px 3px;
  border: 1px solid #71829e;
  border-radius: 2px;
  background: var(--ui-surface, #182139);
  color: #f8f3df;
  box-shadow: none;
  font-size: var(--type-body);
  line-height: 15px;
}
#game-frame .phone-match .phone-quick-plans .game-button[aria-pressed='true'] {
  background: var(--brand-cobalt);
  border-color: var(--gold);
  box-shadow: inset 0 -3px 0 var(--gold);
}
#game-frame .phone-match .phone-quick-plans .game-button:hover:not(:disabled) {
  background: #354974;
}
.phone-match .venue-board {
  position: absolute;
  z-index: 2;
  top: 7px;
  left: auto;
  right: 65px;
  max-width: 44%;
  text-align: right;
  pointer-events: none;
  font-size: var(--type-caption);
  line-height: 15px;
  color: #f8f3df;
}
.phone-match .venue-board > b {
  display: inline-block;
  max-width: 100%;
  padding: 3px 7px;
  background: #1c2f28;
  border: 2px solid #9aab7c;
  box-shadow: 2px 2px 0 #15251d;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-ground-tools {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}
#game-frame .phone-ground-tools .game-button {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  pointer-events: auto;
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  padding: 3px;
  border: 1px solid #99a9b8;
  border-radius: 2px;
  background: var(--ui-surface, #182139);
  color: #f8f3df;
  box-shadow: 0 2px 0 #101526;
  font-size: var(--type-caption);
  line-height: 14px;
}
#game-frame .phone-ground-tools .game-button:active:not(:disabled) {
  background: #354974;
  box-shadow: none;
  transform: translateY(1px);
}
.phone-ground-tools [data-action='phone-tactics'] {
  bottom: 7px;
  left: 7px;
}
.phone-ground-tools [data-action='scorecard'] {
  top: 7px;
  right: 7px;
}
.phone-ground-tools [data-action='analysis'] {
  bottom: 7px;
  right: 7px;
}
.game-shell[data-phone-match='true'] .notice {
  bottom: 65px;
}
#game-frame dialog.match-menu {
  border-radius: 2px;
  max-width: 350px;
}
.match-menu .phone-sheet-body {
  gap: 8px;
  padding: 12px;
}
#game-frame .match-menu .phone-sheet-body > .game-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 10px 12px;
  font-size: var(--type-section);
  border-radius: 2px;
}
.match-menu .phone-sheet-body > .game-button svg {
  width: 22px;
  height: 22px;
}
.match-menu .menu-back {
  margin-top: 8px;
}
.match-menu .menu-setting-state {
  color: var(--gold);
  font-size: var(--type-body);
}
@media (max-width: 700px) {
  #game-frame .game-shell[data-phone-match='true'] {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}
@media (max-width: 700px) and (max-height: 460px) {
  #game-frame .game-shell[data-phone-match='true'] #app {
    overflow-y: auto;
  }
  #game-shell .match-screen.phone-match {
    min-height: 460px;
    max-height: none;
    overflow: visible;
  }
}

/* Wides/no-balls occupy physical chips without consuming a legal-ball slot. */
#game-frame .over-feed-row > .over-deliveries {
  flex-wrap: wrap;
  min-width: 0;
}
#game-frame .delivery-chip[data-illegal='true'] {
  min-width: 30px;
  width: auto;
  padding-inline: 3px;
  font-size: var(--type-caption);
}

.delivery-incident {
  display: inline-block;
  font-size: 0.85em;
  margin-right: 6px;
  color: var(--gold);
  font-weight: 800;
}
.player-of-match {
  padding: 16px;
  margin: 14px 0;
  border: 1px solid var(--gold);
  border-left: 4px solid var(--gold);
  border-radius: 5px;
  background: var(--panel);
}
.player-of-match > strong {
  display: block;
  margin: 6px 0;
  font-size: var(--type-title);
  color: var(--gold);
}
.player-of-match > p {
  font-size: var(--type-body);
  line-height: 1.5;
}
