/* One compact pre-match board; the toss does not mount a stadium renderer. */
#game-frame .toss-screen {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  grid-template-areas: 'matchup matchup' 'coin pitch' 'conditions pitch';
  grid-template-rows: auto auto 1fr;
  gap: 14px;
  align-content: center;
  max-width: 860px;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: auto;
  padding: 18px 22px;
  background: var(--ui-surface, #111e38);
  overflow: visible;
}
#game-frame .toss-fixture.toss-matchup {
  grid-area: matchup;
  position: static;
  inset: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1fr);
  align-items: center;
  gap: 5px 10px;
  padding: 9px 12px;
  border: 1px solid #52668c;
  border-top: 3px solid #dfbb6c;
  background: var(--ui-surface, #172b45);
  box-shadow: 0 3px 0 #091324;
  text-shadow: none;
  border-radius: 0;
}
.toss-matchup .toss-team {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.toss-matchup .toss-team-away {
  flex-direction: row-reverse;
  text-align: right;
}
.toss-matchup .toss-team-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 44px;
  filter: drop-shadow(0 2px 0 #06111a80);
}
.toss-matchup .toss-team-mark svg {
  display: block;
  width: 38px;
  height: 44px;
  max-width: 38px;
  max-height: 44px;
  object-fit: contain;
}
.toss-matchup .toss-team strong {
  font-size: var(--type-section);
  line-height: 1.1;
  overflow-wrap: anywhere;
  color: #f5eed8;
  font-weight: 800;
}
.toss-matchup .toss-team-initial {
  display: grid;
  place-items: center;
  width: 32px;
  height: 36px;
  border: 2px solid #dfbb6c;
  background: var(--ui-raised, #223c58);
  color: #f5d681;
  font-size: var(--type-title);
  font-weight: 800;
}
.toss-matchup .toss-versus {
  font-size: var(--type-caption);
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #dfbb6c;
  text-align: center;
}
.toss-matchup .toss-matchup-venue {
  grid-column: 1/-1;
  margin: 0;
  padding: 0;
  color: #a9bdca;
  font-size: var(--type-caption);
  text-align: center;
  line-height: 1.2;
}
#game-frame .toss-call-board {
  grid-area: coin;
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid #52668c;
  background: var(--ui-surface, #172b45);
}
.toss-call-content {
  display: grid;
  gap: 8px;
  min-width: 0;
}
#game-frame .toss-call-content h2 {
  font-size: var(--type-name);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
  color: #f5eed8;
}
#game-frame .toss-call-content .toss-result {
  font-size: var(--type-caption);
  line-height: 1.2;
  margin: 0;
  color: #a9bdca;
}
#game-frame .toss-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  width: 100%;
  margin: 0;
  padding: 0;
  position: static;
  background: none;
}
#game-frame .toss-actions:has([data-action='toss-result']) {
  grid-template-columns: 1fr;
}
#game-frame .toss-actions .game-button {
  min-height: 42px;
  padding: 8px 7px;
  font-size: var(--type-caption);
  line-height: 1;
  border: 1px solid #d9bb77;
  background: #e6c675;
  color: #152538;
  box-shadow: 0 3px 0 #886b3d;
}
#game-frame .toss-actions .game-button:hover:not(:disabled) {
  background: #f4d996;
}
#game-frame .toss-condition-tiles {
  grid-area: conditions;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-content: start;
  gap: 7px;
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}
.toss-condition-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 3px;
  background: var(--ui-raised, #1b3346);
  border: 1px solid #416176;
  min-width: 0;
  text-align: center;
}
.toss-condition-tile :is(.toss-condition-art, .conditions-weather-art) {
  display: block;
  width: 30px;
  height: 30px;
  margin: 0;
  shape-rendering: crispEdges;
}
.toss-condition-tile dt {
  font-size: var(--type-caption);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #a9bdca;
  font-weight: 700;
}
.toss-condition-tile dd {
  margin: 0;
  font-size: var(--type-body);
  font-weight: 800;
  line-height: 1.1;
  color: #f5eed8;
}
.toss-condition-tile small {
  font-size: var(--type-caption);
  line-height: 1.15;
  color: #a4c6bf;
}
#game-frame .toss-screen > .pitch-inspection {
  grid-area: pitch;
  align-self: center;
  border: 1px solid #52668c;
  background: var(--ui-surface, #152b3b);
  padding: 0 11px;
}
#game-frame .toss-screen .pitch-inspection > :is(summary, header) {
  min-height: 31px;
  padding: 7px 0;
  font-size: var(--type-caption);
  pointer-events: none;
  cursor: default;
}
#game-frame .toss-screen .pitch-inspection > :is(summary, header) > strong {
  font-size: var(--type-caption);
  color: #e6c675;
}
#game-frame .toss-screen .pitch-inspection > :is(summary, header) > svg {
  display: none;
}
#game-frame .toss-screen .pitch-inspection-body {
  gap: 7px;
  padding-bottom: 9px;
}
#game-frame .toss-screen .pitch-inspection-art {
  max-height: 142px;
  object-fit: cover;
}
#game-frame .toss-screen .pitch-readings {
  gap: 5px;
}
#game-frame .toss-screen .pitch-readings > div {
  padding: 5px;
  border-left-width: 1px;
}
#game-frame .toss-screen .pitch-readings dt {
  font-size: var(--type-caption);
  letter-spacing: 0.03em;
}
#game-frame .toss-screen .pitch-readings dd {
  font-size: var(--type-caption);
  margin-top: 3px;
}
.toss-settings {
  position: absolute;
  z-index: 3;
  top: 5px;
  right: 6px;
}
.toss-settings > summary {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #a9bdca;
  cursor: pointer;
  list-style: none;
}
.toss-settings > summary::-webkit-details-marker {
  display: none;
}
.toss-settings > summary svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}
.toss-settings-fields {
  position: absolute;
  right: 0;
  top: 27px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  width: 260px;
  padding: 14px;
  background: var(--ui-surface, #102339);
  border: 1px solid #8ba3bc;
  box-shadow: 0 5px 0 #091324;
}
.toss-settings-fields label {
  display: grid;
  gap: 5px;
  font-size: var(--type-caption);
  color: #a9bdca;
}
.toss-settings-fields select {
  width: 100%;
  font-size: var(--type-caption);
  min-height: 34px;
}

/* The face lands from the domain's result; the finite flip does not draw again. */
.toss-coin.toss-coin-visual {
  position: relative;
  display: block;
  isolation: isolate;
  width: 64px;
  height: 64px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: #17263d;
  perspective: 500px;
  overflow: visible;
}
.toss-coin-core {
  position: absolute;
  inset: 0;
  display: block;
  transform-style: preserve-3d;
  transform: rotateX(0deg);
  will-change: transform;
}
.toss-coin-visual[data-face='tails'] .toss-coin-core {
  transform: rotateX(180deg);
}
.toss-coin-visual .toss-coin-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 3px solid #bd8a38;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 25%, #fff0ad 0, #ffe184 32%, #dfad50 72%, #bd8a38 100%);
  box-shadow:
    inset 0 0 0 2px #fff4b9,
    inset 0 0 0 6px #dc9b36,
    0 3px 0 #765124;
  transform: translateZ(1px);
}
.toss-coin-visual .toss-coin-tails {
  transform: rotateX(180deg) translateZ(1px);
  background: radial-gradient(circle at 32% 25%, #ffe3a1 0, #edc575 40%, #bd8a38 100%);
}
.toss-coin-letter {
  font-size: var(--type-display);
  line-height: 1;
  font-weight: 800;
  text-shadow: 0 1px 0 #ffefb7;
}
.toss-coin-face small {
  font-size: var(--type-caption);
  line-height: 1;
  font-weight: 800;
  letter-spacing: 1px;
  margin-top: 4px;
  color: #594024;
}
.toss-coin-rim {
  position: absolute;
  inset: 9px;
  border: 1px dashed #aa722c;
  border-radius: 50%;
  pointer-events: none;
}
.toss-coin-shadow {
  position: absolute;
  left: 4%;
  right: 4%;
  bottom: -6px;
  height: 7px;
  border-radius: 50%;
  background: #0007;
  filter: blur(3px);
  transform: scaleX(0.85);
}
.toss-coin.is-flipping .toss-coin-shadow {
  animation: toss-shadow-pulse 950ms ease-in-out both;
}
.toss-coin-announcement {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
@keyframes toss-shadow-pulse {
  0%,
  100% {
    opacity: 0.65;
    transform: scaleX(0.85);
  }
  40% {
    opacity: 0.25;
    transform: scaleX(0.45);
  }
}

#game-frame #toss-decision-dialog {
  width: min(320px, calc(100% - 32px));
  max-width: 320px;
  max-height: calc(100% - 24px);
  padding: 20px;
  overflow: auto;
  border: 2px solid #d6bb7b;
  background: var(--ui-surface, #13283b);
  box-shadow: 0 8px 0 #081524;
  color: #f5eed8;
}
.toss-decision-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 276px;
  text-align: center;
}
.toss-decision-badge {
  display: grid;
  place-items: center;
  width: 48px;
  height: 50px;
}
.toss-decision-badge svg {
  display: block;
  width: 44px;
  height: 50px;
}
.toss-decision-face {
  font-size: var(--type-caption);
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #d6bb7b;
}
#game-frame .toss-decision-card h2 {
  font-size: var(--type-number);
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin: 0;
  max-width: 100%;
}
.toss-decision-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 4px;
}
#game-frame .toss-decision-choices .game-button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 88px;
  padding: 12px 8px;
  background: var(--ui-raised, #244859);
  border: 1px solid #799d9f;
  color: #f5eed8;
  font-size: var(--type-body);
  box-shadow: 0 3px 0 #081524;
}
#game-frame .toss-decision-choices .game-button:hover {
  background: #315969;
  border-color: #e6c675;
}
.toss-decision-order {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 100%;
  padding: 9px 6px;
  font-size: var(--type-body);
  line-height: 1.2;
  color: #d9e9d1;
}
.toss-decision-order svg {
  flex: none;
  width: 32px;
  height: 32px;
}
#game-frame .toss-decision-continue {
  width: 100%;
  min-height: 44px;
  background: #e6c675;
  color: #142537;
  border-color: #e6c675;
  box-shadow: 0 3px 0 #886b3d;
  font-size: var(--type-body);
}

@container game (max-width:700px) {
  #game-frame .toss-screen {
    grid-template-columns: 1fr;
    grid-template-areas: 'matchup' 'coin' 'conditions' 'pitch';
    grid-template-rows: auto auto auto auto;
    align-content: start;
    gap: 10px;
    padding: 12px 14px;
    height: 100%;
    min-height: 0;
  }
  #game-frame .toss-fixture.toss-matchup {
    gap: 3px 7px;
    padding: 7px 9px;
  }
  .toss-matchup .toss-team {
    gap: 7px;
  }
  .toss-matchup .toss-team-mark {
    width: 30px;
    height: 35px;
  }
  .toss-matchup .toss-team-mark svg {
    width: 30px;
    height: 35px;
    max-width: 30px;
    max-height: 35px;
  }
  .toss-matchup .toss-team strong {
    font-size: var(--type-caption);
    line-height: 1.1;
  }
  .toss-matchup .toss-matchup-venue {
    font-size: var(--type-caption);
  }
  #game-frame .toss-call-board {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 13px;
    padding: 10px 12px;
  }
  #game-frame .toss-call-content h2 {
    font-size: var(--type-section);
  }
  #game-frame .toss-actions .game-button {
    min-height: 38px;
    font-size: var(--type-caption);
  }
  .toss-coin.toss-coin-visual {
    width: 52px;
    height: 52px;
  }
  .toss-coin-letter {
    font-size: var(--type-number);
  }
  .toss-coin-face small {
    font-size: var(--type-caption);
  }
  .toss-coin-rim {
    inset: 8px;
  }
  .toss-condition-tile {
    gap: 3px;
    padding: 6px 3px;
  }
  .toss-condition-tile :is(.toss-condition-art, .conditions-weather-art) {
    width: 27px;
    height: 27px;
  }
  .toss-condition-tile dd {
    font-size: var(--type-caption);
  }
  .toss-condition-tile small {
    font-size: var(--type-caption);
  }
  #game-frame .toss-screen .pitch-inspection {
    padding: 0 9px;
  }
  #game-frame .toss-screen .pitch-inspection-art {
    max-height: 86px;
    object-fit: cover;
  }
  #game-frame .toss-screen .pitch-inspection-body {
    gap: 6px;
    padding-bottom: 7px;
  }
  #game-frame .toss-screen .pitch-readings > div {
    padding: 4px 5px;
  }
  #game-frame .toss-screen .pitch-readings dd {
    font-size: var(--type-caption);
  }
}
@container game (min-width:701px) and (max-height:520px) {
  #game-frame .toss-screen {
    padding: 9px 14px;
    gap: 8px;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    align-content: stretch;
  }
  #game-frame .toss-fixture.toss-matchup {
    padding: 4px 10px;
    gap: 1px 8px;
  }
  .toss-matchup .toss-team-mark {
    height: 28px;
    width: 26px;
  }
  .toss-matchup .toss-team-mark svg {
    height: 28px;
    width: 26px;
  }
  .toss-matchup .toss-team strong {
    font-size: var(--type-caption);
  }
  .toss-matchup .toss-matchup-venue {
    font-size: var(--type-caption);
  }
  #game-frame .toss-call-board {
    padding: 7px 12px;
    gap: 12px;
    grid-template-columns: 48px minmax(0, 1fr);
  }
  .toss-coin.toss-coin-visual {
    height: 46px;
    width: 46px;
  }
  .toss-coin-letter {
    font-size: var(--type-title);
  }
  .toss-coin-face small {
    font-size: var(--type-caption);
  }
  #game-frame .toss-call-content h2 {
    font-size: var(--type-body);
  }
  #game-frame .toss-call-content .toss-result {
    font-size: var(--type-caption);
  }
  #game-frame .toss-actions .game-button {
    min-height: 34px;
    padding: 6px;
    font-size: var(--type-caption);
  }
  .toss-condition-tile {
    padding: 5px 3px;
    gap: 2px;
  }
  .toss-condition-tile :is(.toss-condition-art, .conditions-weather-art) {
    height: 22px;
    width: 22px;
  }
  .toss-condition-tile dt {
    font-size: var(--type-caption);
  }
  .toss-condition-tile dd {
    font-size: var(--type-caption);
  }
  .toss-condition-tile small {
    font-size: var(--type-caption);
  }
  #game-frame .toss-screen .pitch-inspection-art {
    max-height: 99px;
  }
  #game-frame .toss-screen .pitch-inspection > :is(summary, header) {
    min-height: 24px;
    padding: 4px 0;
    font-size: var(--type-caption);
  }
  #game-frame #toss-decision-dialog {
    width: 280px;
    padding: 14px;
    max-height: calc(100% - 16px);
  }
  .toss-decision-card {
    min-height: 232px;
    gap: 8px;
  }
  .toss-decision-badge {
    width: 36px;
    height: 38px;
  }
  .toss-decision-badge svg {
    height: 38px;
    width: 34px;
  }
  #game-frame .toss-decision-card h2 {
    font-size: var(--type-title);
  }
  #game-frame .toss-decision-choices .game-button {
    min-height: 76px;
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .toss-coin-core {
    will-change: auto;
  }
  .toss-coin.is-flipping .toss-coin-shadow {
    animation: none;
  }
}
