/* Compact career chrome and contextual phone pages. */
#game-frame .career-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  min-height: 62px;
}
#game-frame .game-shell[data-phone-match='true'] .career-strip {
  display: none;
}
.career-club {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.career-club > svg {
  flex: none;
}
.career-club > div {
  min-width: 0;
}
#game-frame .career-club .club-label {
  display: block;
  font-size: var(--type-body);
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.career-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 3px;
  color: var(--dim);
  font-size: var(--type-caption);
  line-height: 1.3;
}
.career-progress b {
  font-weight: 600;
  color: var(--cream);
}
.career-progress > span {
  padding-left: 8px;
  border-left: 1px solid var(--edge);
  white-space: nowrap;
}
#game-frame .career-store {
  flex: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  min-width: 64px;
  min-height: 44px;
  padding: 4px 10px;
  border: 0;
  border-left: 1px solid var(--edge);
  background: transparent;
}
#game-frame .career-store span {
  font-size: var(--type-caption);
  color: var(--dim);
}
#game-frame .career-store strong {
  font-size: var(--type-name);
  line-height: 1.3;
}
.store-sections {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  position: sticky;
  top: -1px;
  z-index: 2;
  padding-block: 8px;
  background: var(--night);
}
.store-sections button {
  min-height: 44px;
  min-width: 0;
  padding: 8px;
}
.store-sections [aria-pressed='true'] {
  border-bottom: 3px solid var(--gold);
  background: var(--panel);
}
.store-pack > details > summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  cursor: pointer;
  list-style: none;
  padding: 12px;
}
.store-pack > details > summary::after {
  content: '+';
  margin-left: auto;
  color: var(--gold);
  font-size: var(--type-title);
}
.store-pack > details[open] > summary::after {
  content: '−';
}
.store-pack > details > summary h3 {
  font-size: var(--type-name);
  margin: 0 0 4px;
}
.store-pack > details > summary .store-pack-icon {
  width: 48px;
  height: 44px;
  flex: none;
}
.store-pack-detail {
  padding: 0 12px 12px;
}
.store-pack-detail > p {
  margin-block: 8px;
}
#game-frame .store-pack {
  padding: 0;
  display: block;
  min-width: 0;
}
.store-panel .store-bag,
.store-panel .store-credit-section {
  margin-top: 8px;
}
.store-panel .store-remove-ads {
  margin-top: 16px;
}
.store-panel .store-fixed-packs {
  margin-top: 20px;
}
#game-frame .store-heading h2 {
  margin: 0;
}
.store-heading > div > p:empty {
  display: none;
}
#game-frame .store-heading {
  align-items: center;
  margin-bottom: 10px;
}
.store-screen .store-balance {
  padding: 10px 12px;
}
.store-screen .store-balance strong {
  font-size: var(--type-number);
}
.store-panel .store-roster summary {
  min-height: 44px;
  display: flex;
  align-items: center;
}
.phone-match #commentary.is-landmark {
  display: flex !important;
  gap: 8px;
  align-items: center;
  line-height: 1.3;
}
#commentary.is-landmark strong {
  color: var(--gold);
  font-weight: 800;
}
#commentary.is-landmark span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.match-landmarks {
  list-style: none;
  padding: 0;
  margin: 8px 0;
  display: grid;
  gap: 6px;
}
.match-landmarks li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--edge);
  font-size: var(--type-body);
}
.match-landmarks strong {
  color: var(--gold);
}
.career-landmark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--edge);
  padding: 10px 14px;
  background: var(--panel);
}
.career-landmark > div {
  display: grid;
  gap: 3px;
}
.career-landmark strong {
  font-size: var(--type-section);
  color: var(--gold);
}
.career-landmark span {
  font-size: var(--type-body);
}
.career-landmark button {
  min-width: 44px;
  min-height: 44px;
}
#game-shell .match-screen.phone-match {
  grid-template-rows: auto auto minmax(0, 1fr) repeat(5, auto);
}
#game-shell .phone-match > .pitch-label {
  position: static;
  order: 0;
  inset: auto;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 6px 10px;
  border: 0;
  border-radius: 0;
  border-bottom: 1px solid var(--edge);
  background: var(--night);
  font-size: var(--type-caption);
  line-height: 1.3;
}
#game-shell .phone-match > .pitch-label > b {
  font-weight: 500;
}
#game-shell .phone-match > .pitch-label > span {
  font-size: var(--type-caption);
  color: var(--dim);
}
#game-shell .phone-match .match-commentary {
  padding: 8px 10px 6px;
  gap: 5px;
  min-height: 64px;
}
#game-shell .phone-match .phone-contestants {
  display: block;
}
.phone-batting-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
#game-shell .phone-match .phone-player {
  padding: 8px 10px;
  min-height: 60px;
}
.phone-match .phone-player.is-striker {
  box-shadow: inset 0 -2px var(--gold);
  background: #ffffff05;
}
.phone-match .phone-player-copy > span {
  gap: 8px;
  align-items: center;
}
.phone-match .strike-bat,
.phone-match .bowling-ball {
  display: inline-flex;
  align-items: center;
  width: 18px;
  height: 18px;
  flex: none;
}
.phone-match :is(.strike-bat, .bowling-ball) .role-icons {
  display: inline-flex;
  width: 18px;
  height: 18px;
}
.phone-match :is(.strike-bat, .bowling-ball) svg {
  width: 18px;
  height: 18px;
}
#game-shell .phone-match .phone-bowler {
  display: flex;
  width: 100%;
  min-height: 44px;
  padding: 5px 10px;
  border: 0;
  border-top: 1px solid var(--edge);
  background: var(--night);
}
.phone-match .phone-bowler .pixel-portrait {
  width: 23px;
  height: 28px;
  flex-basis: 23px;
}
.phone-match .phone-bowler .phone-player-copy {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.phone-match .phone-bowler .phone-player-copy strong {
  font-size: var(--type-caption);
  min-width: 0;
  flex: 1;
}
.phone-match .phone-bowler .phone-player-copy strong small {
  display: block;
  font-size: var(--type-caption);
  font-weight: 500;
  line-height: 1.2;
}
.phone-match .phone-bowler .phone-player-copy > span {
  flex: none;
  font-size: var(--type-caption);
}
#game-shell .phone-match .boundary-celebration {
  bottom: 10px;
  padding: 7px 10px 0;
  box-shadow: none;
}
.league-phone-table {
  display: none;
}
.league-format > summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.league-screen .game-button {
  min-height: 44px;
}
@container game (max-width:700px) {
  .league-table-scroll {
    display: none;
  }
  .league-phone-table {
    display: block;
    margin-top: 12px;
  }
  .phone-table-head,
  .phone-table-team > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20px 20px 49px 27px;
    align-items: center;
    gap: 5px;
    padding: 10px 3px;
    list-style: none;
    font-size: var(--type-body);
  }
  .phone-table-head {
    color: var(--dim);
    font-size: var(--type-caption);
  }
  .phone-table-nrr {
    font-size: var(--type-caption);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    color: var(--mint);
  }
  .phone-table-head > span:not(:first-child),
  .phone-table-team > summary > span:not(:first-child),
  .phone-table-team > summary > strong {
    text-align: center;
  }
  .phone-table-team {
    border-bottom: 1px solid var(--edge);
  }
  .phone-table-team > summary {
    min-height: 54px;
    cursor: pointer;
  }
  .phone-table-team .table-club {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
  }
  .table-club > b {
    font-size: var(--type-caption);
    color: var(--dim);
    flex: 0 0 15px;
  }
  .table-club .team-name {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: var(--type-caption);
    line-height: 1.35;
    min-width: 0;
  }
  .table-club .team-badge {
    width: 23px;
    height: 28px;
    flex: none;
  }
  .phone-table-team > summary > strong {
    color: var(--gold);
  }
  .phone-table-team.your-team {
    background: var(--panel);
  }
  .phone-table-team.cutoff {
    border-bottom: 2px solid var(--gold);
  }
  .phone-table-team dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    padding: 6px 12px 12px;
    gap: 8px;
  }
  .phone-table-team dt {
    font-size: var(--type-caption);
    color: var(--dim);
  }
  .phone-table-team dd {
    margin: 3px 0 0;
    font-size: var(--type-body);
  }
  #game-frame .store-packs {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  #game-frame .store-screen {
    padding: 14px 12px 20px;
  }
  .store-section-heading {
    gap: 8px;
  }
  .store-section-heading h3 {
    font-size: var(--type-name);
  }
  #game-frame .league-screen .scene-header {
    gap: 10px;
  }
  .league-screen .scene-title {
    font-size: var(--type-number);
  }
  .league-screen .scene-subtitle {
    font-size: var(--type-body);
    line-height: 1.4;
  }
  .league-table th,
  .league-table td {
    padding: 10px 6px;
  }
  .league-screen .league-progress {
    display: none;
  }
  .league-screen .league-format {
    margin-top: 16px;
  }
}
@container game (max-width:360px) {
  #game-frame .career-strip {
    padding-inline: 9px;
    gap: 6px;
  }
  #game-frame .career-club .club-label {
    font-size: var(--type-body);
  }
  .career-progress {
    font-size: var(--type-caption);
  }
  .phone-match .phone-player-copy > strong {
    font-size: var(--type-caption);
  }
}
/* While playing on a phone, give the match the screen. Site navigation returns
   on the title and management pages; the in-game back button remains visible. */
@media (max-width: 700px) {
  .page:has(.game-shell[data-phone-match='true']) {
    padding: 0;
  }
  .page:has(.game-shell[data-phone-match='true']) > .site-header,
  .page:has(.game-shell[data-phone-match='true']) > footer {
    display: none;
  }
  :root[data-display-mode='phone'] .page:has(.game-shell[data-phone-match='true']) #game-frame {
    width: 100%;
    height: 100svh;
    min-height: 0;
    max-width: none;
  }
  #game-frame .game-shell[data-phone-match='true'] {
    border: 0;
    border-radius: 0;
    padding-top: env(safe-area-inset-top);
  }
  .game-shell[data-phone-match='true'] #navigation {
    padding-bottom: calc(4px + env(safe-area-inset-bottom));
    height: calc(var(--phone-nav-height, 60px) + env(safe-area-inset-bottom));
  }
}
@media (max-width: 700px) and (max-height: 650px) {
  #game-frame .game-shell[data-phone-match='true'] #app {
    overflow-y: auto;
    scroll-padding-block: 8px 76px;
  }
  #game-shell .match-screen.phone-match {
    height: 620px;
    min-height: 620px;
    max-height: none;
    overflow: visible;
  }
  #game-shell .phone-match .phone-play-dock {
    position: sticky;
    bottom: 0;
    z-index: 4;
  }
}
