/* The live phone scene owns its height. Detailed decisions live in dialogs. */
#game-frame .game-shell[data-phone-match='true'] #app {
  overflow: hidden;
  scroll-padding: 0;
}
.game-shell[data-phone-match='true'] .career-strip {
  display: none;
}
.game-shell[data-phone-match='true'] .game-topbar {
  height: 44px;
  min-height: 44px;
}
.game-shell[data-phone-match='true'] .notice {
  bottom: calc(var(--phone-nav-height, 60px) + 70px);
  font-size: var(--type-body);
}
#game-shell .match-screen.phone-match {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) repeat(5, auto);
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  background: var(--navy);
}
.phone-match > * {
  min-width: 0;
}
#game-shell .phone-match .match-scoreboard {
  position: relative;
  top: auto;
  z-index: 1;
  min-height: 74px;
  flex-basis: auto;
  padding: 7px 10px;
  gap: 8px;
  grid-template-columns: minmax(0, 1.15fr) auto minmax(0, 1fr);
}
.phone-match .score-team {
  min-width: 0;
  gap: 0;
}
.phone-match .score-team > div {
  min-width: 0;
}
#game-shell .phone-match .score-team .team-stamp {
  display: none;
}
#game-shell .phone-match .opponent-name {
  max-width: none;
  font-size: var(--type-caption);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#game-shell .phone-match .live-score {
  font-size: var(--type-score);
  line-height: 1.1;
  margin-top: 3px;
}
#game-shell .phone-match .live-score span {
  font-size: var(--type-number);
}
#game-shell .phone-match .score-overs {
  font-size: var(--type-caption);
  gap: 1px;
}
#game-shell .phone-match .score-overs strong {
  font-size: var(--type-name);
  line-height: 1.25;
}
#game-shell .phone-match .score-overs small {
  font-size: var(--type-caption);
}
#game-shell .phone-match .chase-equation {
  gap: 4px;
  text-align: right;
}
#game-shell .phone-match .chase-equation strong {
  font-size: var(--type-body);
  line-height: 1.25;
}
#game-shell .phone-match .chase-equation > span {
  font-size: var(--type-caption);
  line-height: 1.3;
}
#game-shell .phone-match .stadium-wrap {
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
#game-shell .phone-match .stadium-wrap canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  image-rendering: pixelated;
}
#game-shell .phone-match .pitch-label {
  position: absolute;
  top: auto;
  bottom: 4px;
  left: 6px;
  right: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 3px 5px;
  font-size: var(--type-caption);
  line-height: 1.25;
  border-radius: 2px;
  background: var(--ui-surface, #10232b);
}
.phone-match .pitch-label > b {
  font-weight: 500;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#game-shell .phone-match .pitch-label > span {
  font-size: var(--type-caption);
  white-space: nowrap;
}
#game-shell .phone-match .match-commentary {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 3px;
  min-height: 65px;
  padding: 5px 10px 4px;
  border-bottom: 1px solid #36565d;
}
#game-shell .phone-match .recent-balls {
  display: block;
  width: 100%;
  min-width: 0;
}
#game-shell .phone-match .over-feed-row {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
  font-size: var(--type-caption);
  line-height: 1.2;
}
.phone-match .over-feed-row > strong {
  font-size: var(--type-caption);
  white-space: nowrap;
}
#game-shell .phone-match .over-feed-row > div {
  display: flex;
  align-items: center;
  gap: 4px;
}
.phone-match .over-feed-row > span {
  text-align: right;
  white-space: nowrap;
  font-size: var(--type-caption);
}
#game-shell .phone-match .over-feed-row .delivery-chip {
  width: 22px;
  height: 22px;
  min-width: 22px;
  flex: 0 0 22px;
  font-size: var(--type-caption);
  line-height: 1;
}
#game-shell .phone-match .match-commentary > p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-height: 32px;
  min-height: 32px;
  overflow: hidden;
  margin: 0;
  font-size: var(--type-caption);
  line-height: 16px;
}
#game-shell .phone-match #field-status {
  padding: 4px 10px;
  margin: 0;
  font-size: var(--type-caption);
  line-height: 16px;
  background: #3b2931;
  color: var(--red);
  border-bottom: 1px solid #a56d68;
}
.phone-match #field-status:not(.illegal) {
  display: none;
}
.phone-match .phone-contestants {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  background: var(--ui-surface, #1b303b);
  border-bottom: 1px solid #36565d;
}
.phone-match .phone-player {
  display: flex;
  align-items: center;
  min-height: 58px;
  min-width: 0;
  gap: 7px;
  padding: 6px 9px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--cream);
  text-align: left;
}
.phone-match .phone-player + .phone-player {
  border-left: 1px solid #36565d;
}
.phone-match .phone-player:hover:not(:disabled) {
  background: var(--ui-raised, #29414c);
}
.phone-match .phone-player .pixel-portrait {
  width: 32px;
  height: 39px;
  flex: 0 0 32px;
  image-rendering: pixelated;
}
.phone-match .phone-player-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
  flex: 1;
}
.phone-match .phone-player-copy > strong {
  display: block;
  font-size: var(--type-caption);
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-match .phone-player-copy > span {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  gap: 6px;
  min-width: 0;
  font-size: var(--type-caption);
  line-height: 1.2;
  white-space: nowrap;
}
.phone-match .phone-player-copy b {
  font-weight: 700;
  color: var(--gold);
}
.phone-match .phone-player-copy small {
  font-size: var(--type-caption);
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
}
.phone-match .phone-match-tools {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  padding: 0 5px;
  border-bottom: 1px solid #4c6370;
}
#game-shell .phone-match .phone-match-tools .game-button {
  min-width: 0;
  min-height: 44px;
  padding: 6px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--dim);
  font-size: var(--type-caption);
}
.phone-match .phone-match-tools .game-button:hover:not(:disabled) {
  background: var(--ui-raised, #29414c);
  color: var(--cream);
}
.phone-match .phone-play-dock {
  position: relative;
  margin: 0;
  padding: 7px 10px 9px;
  background: var(--navy);
}
.phone-match .phone-play-buttons {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 8px;
}
#game-shell .phone-match .phone-play-buttons .game-button {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 9px 8px;
  font-size: var(--type-body);
}
.phone-match .phone-play-buttons [data-action='over'] {
  background: var(--gold);
  border-color: var(--gold);
  color: #17202c;
}
.phone-match .phone-play-buttons [data-action='over']:hover:not(:disabled) {
  background: #f5d69d;
  border-color: #f5d69d;
}
#game-shell .phone-match .phone-delivery-footer .stop-over:not([hidden]) {
  position: relative;
  inset: auto;
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 9px 8px;
  font-size: var(--type-body);
  z-index: 1;
}
.phone-match .phone-delivery-footer:has(.stop-over:not([hidden])) .phone-play-buttons {
  display: none;
}
.phone-match .boundary-celebration {
  bottom: 29px;
  gap: 7px;
  padding: 6px 8px 0;
}
.phone-match .boundary-score b {
  font-size: var(--type-score);
}
.phone-match .boundary-score span {
  font-size: var(--type-section);
}
.phone-match .boundary-crowd {
  width: 110px;
  height: 34px;
}
.phone-match .over-transition {
  max-width: calc(100% - 20px);
  padding: 10px 12px;
}

/* Shared native phone sheets: content may scroll while the close control remains visible. */
.phone-match-result {
  padding: 16px 12px 28px;
}
.phone-match-result .result-screen {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}
.phone-match-result .result-screen h2 {
  font-size: var(--type-display);
}
.phone-match-result .result-screen > p {
  font-size: var(--type-section);
}
.phone-match-result .result-screen > .game-button {
  min-height: 48px;
}
.phone-match-result .innings-standout {
  margin: 0;
  padding: 10px;
}
.phone-match-result .cricket-scorecard {
  margin-top: 12px;
}
.phone-match-result .scorecard-innings {
  margin-top: 12px;
}
#game-frame dialog.phone-match-sheet {
  width: calc(var(--dialog-width, 100vw) - 20px);
  padding: 0;
  border: 1px solid #70858c;
  border-radius: 5px;
  background: var(--navy);
  color: var(--cream);
  box-shadow: 0 12px 44px #0007;
  overscroll-behavior: contain;
}
#game-frame dialog.phone-match-sheet[open] {
  display: flex;
  flex-direction: column;
}
.phone-match-sheet .phone-sheet-header {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--edge);
  background: var(--navy);
  flex: 0 0 auto;
}
.phone-match-sheet .phone-sheet-header h2,
.phone-match-sheet .phone-sheet-header h3 {
  margin: 0;
  font-size: var(--type-title);
  line-height: 1.3;
  color: var(--cream);
}
.phone-match-sheet .phone-sheet-header .game-button {
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 10px;
}
.phone-match-sheet .phone-sheet-body {
  min-height: 0;
  overflow: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overscroll-behavior: contain;
  font-size: var(--type-body);
  line-height: 1.5;
}
.phone-match-sheet .phone-sheet-body > p {
  font-size: var(--type-body);
  line-height: 1.5;
  color: var(--dim);
}
.phone-match-sheet .phone-sheet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid var(--edge);
  background: var(--navy);
  flex: 0 0 auto;
}
.phone-match-sheet .phone-sheet-actions .game-button {
  flex: 1;
  min-height: 46px;
  font-size: var(--type-body);
}
.phone-match-sheet .game-button,
.phone-match-sheet .tactic-button {
  min-height: 44px;
}
.phone-match-sheet .phone-sheet-body .tactical-controls {
  position: static !important;
  display: flex !important;
  width: auto !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
  gap: 14px;
  overflow: visible !important;
}
.phone-match-sheet .phone-sheet-body .tactical-controls > .sheet-heading {
  display: none;
}
.phone-match-sheet .phone-sheet-body .tactic-row > span {
  font-size: var(--type-body);
  margin-bottom: 7px;
}
.phone-match-sheet .phone-sheet-body .tactic-row > div {
  gap: 6px;
}
.phone-match-sheet .phone-sheet-body .tactic-button {
  font-size: var(--type-caption);
  min-width: 0;
}
.phone-match-sheet .phone-sheet-body .batting-pair {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.phone-match-sheet .phone-sheet-body .batting-manager {
  display: block;
  padding-bottom: 14px;
}
.phone-match-sheet .phone-sheet-body .batting-manager-header {
  margin-bottom: 10px;
}
.phone-match-sheet .phone-sheet-body .batting-manager-header strong {
  font-size: var(--type-body);
}
.phone-match-sheet .phone-sheet-body .batting-intent {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}
.phone-match-sheet .phone-sheet-body .batting-intent .game-button {
  flex: 1;
  min-width: 0;
  padding: 6px 3px;
  font-size: var(--type-caption);
}
.phone-match-sheet .phone-sheet-body .field-quick-plans {
  display: flex;
  flex-wrap: wrap;
  padding: 0;
  gap: 6px;
  border: 0;
}
.phone-match-sheet .phone-sheet-body .field-quick-plans .game-button {
  flex: 1;
  min-width: 80px;
  font-size: var(--type-caption);
}
.phone-match-sheet .phone-sheet-body .simple-bowling {
  display: grid;
  gap: 6px;
}
.phone-match-sheet .phone-sheet-body .target-bowler-options input {
  min-height: 0;
}
.phone-match-sheet .phone-sheet-body .match-speed {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.phone-match-sheet .phone-sheet-body .match-speed > span {
  font-size: var(--type-body);
}
.phone-match-sheet .phone-sheet-body .match-speed .game-button {
  min-width: 44px;
}

@container game (max-width:360px) {
  #game-shell .phone-match .match-scoreboard {
    padding-inline: 8px;
    gap: 6px;
    grid-template-columns: minmax(0, 1.1fr) auto minmax(0, 1fr);
  }
  #game-shell .phone-match .live-score {
    font-size: var(--type-display);
  }
  #game-shell .phone-match .chase-equation strong {
    font-size: var(--type-body);
  }
  #game-shell .phone-match .match-commentary {
    padding-inline: 8px;
  }
  #game-shell .phone-match .over-feed-row {
    gap: 4px;
    grid-template-columns: 43px minmax(0, 1fr) auto;
  }
  #game-shell .phone-match .over-feed-row > div {
    gap: 3px;
  }
  #game-shell .phone-match .over-feed-row .delivery-chip {
    width: 21px;
    height: 21px;
    min-width: 21px;
    flex-basis: 21px;
  }
  .phone-match .phone-player {
    padding-inline: 7px;
    gap: 6px;
  }
  .phone-match .phone-player-copy > span {
    gap: 4px;
  }
  .phone-match .phone-player-copy small {
    font-size: var(--type-caption);
  }
}
@container game (max-height:600px) {
  #game-shell .phone-match .match-scoreboard {
    min-height: 65px;
    padding-block: 5px;
  }
  #game-shell .phone-match .live-score {
    font-size: var(--type-display);
  }
  .phone-match .phone-player {
    min-height: 54px;
    padding-block: 4px;
  }
  .phone-match .phone-play-dock {
    padding-block: 5px;
  }
}
