/* The captain's over board: actual overs and player portraits carry the interface. */
.bowling-plan-launch {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 12px 0;
  color: var(--cream);
  background: none;
  border: 0;
  border-bottom: 1px solid #415a64;
  text-align: left;
}
.bowling-plan-launch strong,
.bowling-plan-launch small {
  display: block;
}
.bowling-plan-launch strong {
  font-size: var(--type-section);
}
.bowling-plan-launch small {
  color: var(--dim);
  font-size: var(--type-caption);
  margin-top: 3px;
}
.bowling-plan-launch > span:last-child {
  font-size: var(--type-body);
  color: var(--gold);
  flex-shrink: 0;
}
.bowling-planner-dialog {
  width: min(940px, calc(100cqw - 40px));
  max-width: none;
  max-height: calc(100cqh - 40px);
  padding: 0;
  border: 1px solid #61736e;
  border-radius: 14px;
  background: var(--ui-surface, #152c33);
  color: #eee6cd;
  box-shadow: 0 20px 80px #08151ca6;
  overflow: hidden;
}
.bowling-planner-dialog[open] {
  display: flex;
  flex-direction: column;
}
.bowling-planner-dialog::backdrop {
  background: var(--ui-canvas, #08171d);
}
.planner-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 20px 24px 12px;
}
.planner-heading h2 {
  font-size: var(--type-number);
  font-weight: 800;
  letter-spacing: -0.6px;
}
.planner-heading p {
  color: #b2c5c3;
  font-size: var(--type-body);
  margin-top: 3px;
}
.planner-heading .game-button {
  background: #edca82;
  color: #172d32;
  border: 0;
  min-width: 74px;
  min-height: 46px;
}
.planner-switch {
  display: flex;
  align-self: flex-start;
  margin: 0 24px;
  background: var(--ui-surface, #0c2028);
  padding: 3px;
  border-radius: 8px;
}
.planner-switch button {
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #c0d0cc;
  padding: 8px 22px;
  min-height: 44px;
  font-size: var(--type-body);
  font-weight: 700;
}
.planner-switch button[aria-pressed='true'] {
  background: #3c5758;
  color: #fff3d4;
}
.planner-help {
  font-size: var(--type-body);
  color: #c1ccc5;
  padding: 12px 24px;
}
.planner-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 0.9fr);
  gap: 22px;
  padding: 0 24px;
  min-height: 0;
  overflow: hidden;
}
.planner-overs {
  overflow: auto;
  overscroll-behavior: contain;
  padding: 3px;
  scrollbar-width: thin;
  max-height: 55cqh;
}
.planner-over-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
}
.planner-over {
  border: 0;
  border-radius: 5px;
  background: var(--ui-raised, #28454b);
  color: #f0e4bf;
  min-height: 116px;
  padding: 9px 5px;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 5px;
  text-align: center;
  min-width: 0;
  touch-action: manipulation;
  box-shadow: inset 0 -3px #0e2229;
}
.planner-over > span {
  font-weight: 800;
  font-size: var(--type-caption);
}
.planner-over svg {
  width: 27px;
  height: 32px;
  image-rendering: pixelated;
}
.planner-over > strong {
  font-size: var(--type-caption);
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.planner-over small {
  font-size: var(--type-caption);
  color: #c6d4cb;
}
.planner-over[aria-pressed='true'],
.planner-over.is-drop-target {
  outline: 3px solid #ebc577;
  outline-offset: -3px;
  background: #3b5b59;
}
.planner-over.is-played {
  opacity: 0.78;
  cursor: default;
  background: var(--ui-raised, #203840);
}
.planner-auto-symbol {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--ui-surface, #122c34);
  color: #dcbe7a;
  font-size: var(--type-title);
  font-weight: 800;
  flex-shrink: 0;
}
.planner-bowlers {
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.planner-bowlers h3 {
  font-size: var(--type-section);
  margin: 3px 0 12px;
}
.planner-players {
  overflow: auto;
  overscroll-behavior: contain;
  min-height: 0;
  scrollbar-width: thin;
  padding: 3px;
}
.planner-player {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid #35525a;
  min-height: 78px;
}
.planner-player > [data-plan-player] {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 3px;
  width: 100%;
  min-width: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
}
.planner-player svg.pixel-portrait {
  width: 34px;
  height: 41px;
  flex-shrink: 0;
  image-rendering: pixelated;
}
.planner-player-copy {
  flex: 1;
  min-width: 0;
}
.planner-player-copy strong {
  font-size: var(--type-body);
  line-height: 1.25;
  display: block;
}
.planner-player-copy small,
.planner-player-copy > span {
  font-size: var(--type-caption);
  color: #b9cbc5;
  display: block;
  margin-top: 3px;
}
.planner-quota {
  text-align: center;
  flex-shrink: 0;
}
.planner-quota > strong {
  font-size: var(--type-title);
  line-height: 1;
}
.planner-quota small,
.planner-quota > span {
  display: block;
  font-size: var(--type-caption);
}
.planner-quota > span {
  color: #dabc81;
  margin-top: 4px;
}
.planner-player.is-unavailable [data-plan-player] {
  opacity: 0.55;
}
.planner-drag {
  background: none;
  border: 0;
  color: #a8bdb5;
  width: 44px;
  min-width: 44px;
  min-height: 60px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  cursor: grab;
}
.planner-drag svg {
  width: 20px;
  height: 24px;
  pointer-events: none;
}
.planner-drag:active {
  cursor: grabbing;
}
.planner-auto-choice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 3px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #35525a;
  background: none;
  color: inherit;
  text-align: left;
  min-height: 66px;
}
.planner-auto-choice strong,
.planner-auto-choice small {
  display: block;
}
.planner-auto-choice small {
  font-size: var(--type-caption);
  color: #b9cbc5;
  margin-top: 3px;
}
.planner-footer {
  padding: 12px 24px max(16px, env(safe-area-inset-bottom));
  min-height: 58px;
  background: var(--ui-surface, #0f252c);
  border-top: 1px solid #35525a;
}
.planner-footer p {
  font-size: var(--type-body);
  line-height: 1.4;
  color: #ddcfaa;
}
.planner-footer .is-error {
  color: #ffb6a4;
}
.planner-drag-ghost {
  position: fixed;
  z-index: 10;
  pointer-events: none;
  background: #e5c27d;
  color: #172c32;
  padding: 9px 13px;
  border: 2px solid #fff0c1;
  border-radius: 4px;
  font-size: var(--type-body);
  font-weight: 800;
  max-width: 190px;
}
@container game (max-width:700px) {
  .bowling-planner-dialog {
    width: 100%;
    max-width: 100%;
    height: 94cqh;
    max-height: 94cqh;
    margin: auto 0 0;
    border-radius: 16px 16px 0 0;
    border-bottom: 0;
  }
  .planner-heading {
    padding: 16px 16px 10px;
  }
  .planner-heading h2 {
    font-size: var(--type-number);
  }
  .planner-switch {
    margin: 0 16px;
  }
  .planner-help {
    padding: 10px 16px;
    font-size: var(--type-caption);
  }
  .planner-layout {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 0 13px;
    flex: 1;
  }
  .planner-overs {
    flex: 0 0 auto;
    max-height: 22cqh;
  }
  .planner-over-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .planner-over {
    min-height: 106px;
  }
  .planner-bowlers {
    flex: 1;
  }
  .planner-bowlers h3 {
    margin: 0 3px 5px;
    font-size: var(--type-section);
  }
  .planner-footer {
    padding: 10px 16px max(12px, env(safe-area-inset-bottom));
  }
  .planner-player {
    min-height: 76px;
  }
  .planner-player-copy strong {
    font-size: var(--type-body);
  }
  .planner-quota > strong {
    font-size: var(--type-title);
  }
}
@container game (min-width:701px) and (max-width:1100px) {
  .bowling-planner-dialog {
    width: calc(100cqw - 48px);
  }
  .planner-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 1fr);
  }
  .planner-over-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
/* Match controls: one play action, a quieter continuous-play action, and a plan. */
.casual-play-buttons {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 10px;
}
.casual-play-buttons .game-button {
  min-height: 54px;
  font-size: var(--type-section);
  border-radius: 5px;
}
.casual-play-buttons [data-action='over'] {
  background: #e7c383;
  color: #162a32;
  border-color: #e7c383;
  font-weight: 800;
}
.casual-play-buttons [data-action='auto-play'] {
  background: transparent;
  color: #e7d8ad;
  border: 1px solid #7e8c83;
}
.casual-play-footer > p {
  font-size: var(--type-caption) !important;
  line-height: 1.4;
  color: #b9c8c6;
}
.casual-plans {
  gap: 0;
  background: var(--ui-surface, #122833);
  border-radius: 6px;
  padding: 3px;
}
.casual-plans .game-button {
  border: 0;
  background: transparent;
  box-shadow: none;
  border-radius: 4px;
  min-height: 48px;
}
.casual-plans [aria-pressed='true'] {
  background: #365650;
  color: #e8efd7;
}
.match-screen.is-casual .field-summary p {
  display: none;
}
.match-screen.is-casual .field-toolbar {
  border: 0;
}
.match-screen.is-casual .field-actions .game-button {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #dbca9e;
}
.match-screen.is-casual .field-actions {
  border-top: 1px solid #3b535b;
}
.match-screen.is-casual .field-summary strong {
  font-size: var(--type-caption);
  color: #bacdc8;
}
.match-screen.is-casual .casual-phase {
  font-size: var(--type-section);
}
.match-screen.is-casual .dugout {
  gap: 14px !important;
}
.play-style > span {
  color: #b4c6c8;
}
.match-screen .chase-equation strong {
  font-size: var(--type-title);
}

.planner-player [data-plan-player][aria-pressed='true'] {
  background: #294c48;
  box-shadow: inset 3px 0 #ebc577;
}
.planner-auto-choice[aria-pressed='true'] {
  color: #ebce90;
}
.play-style .game-button {
  min-height: 44px;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.play-style + .match-screen {
  height: calc(100% - 55px);
}
@container game (max-width:700px) {
  .match-screen .chase-equation strong {
    font-size: var(--type-section);
  }
  .play-style + .match-screen.is-casual {
    height: auto;
    min-height: calc(100% - 51px);
  }
}

.match-screen.is-casual .field-summary p.illegal {
  display: block;
}
.match-screen.is-casual .field-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.match-screen.is-casual .field-actions .game-button {
  flex: 1;
  width: auto;
  min-height: 44px;
  max-width: none;
  padding: 8px;
}
.match-screen.is-casual .field-actions [data-action='injury-open'] {
  flex-basis: 100%;
  color: #ffb6a4;
}
.match-screen.is-casual .field-summary {
  margin-bottom: 3px;
}
.match-screen.is-casual .field-actions {
  border-top: 0;
}
.casual-phase {
  font-weight: 600;
  color: #c4d0c8;
}

.game-shell[data-busy='true'] .casual-play-buttons {
  display: none;
}
.casual-play-footer .stop-over {
  min-height: 54px;
  font-size: var(--type-body);
}
.game-shell[data-busy='true'] .casual-play-footer > p {
  visibility: hidden;
}

@media (hover: none), (pointer: coarse) {
  .planner-drag,
  .planner-drag-help {
    display: none;
  }
}

/* Player strength uses the ball-and-fill meter; overs left remain separate. */
.planner-player-copy > .planner-ability {
  display: block;
  margin-top: 5px;
}
.planner-player-copy .selection-ability {
  display: inline-flex;
  justify-content: flex-start;
  gap: 5px;
}
