.ball-practice-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 7px;
}
.ball-practice-options .ball-training-quick { margin: 0; }
#dialog[data-kind="ball-guide"] :is(.dialog-close, .ball-training-quick button, .ball-tier-actions button) {
  min-width: 46px;
  min-height: 46px;
}
.shootout-invite {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 7px 10px;
  text-align: left;
  color: #fff7d9;
  background: #234e50;
  border: 1px solid #123a3d;
  border-radius: 9px;
}
.shootout-invite > span:nth-child(2) { display: grid; gap: 3px; }
.shootout-invite strong { font-size: 14px; line-height: 1.2; }
.shootout-invite small { color: #d6e9e2; font-size: 11px; line-height: 1.3; }
.shootout-invite > .glyph { width: 18px; height: 18px; color: #ffda88; }
.shootout-invite:hover:enabled { background: #2c5f60; }
.shootout-invite:disabled { opacity: .68; }
.so-invite-mark {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
  width: 32px;
  height: 22px;
  padding: 4px 3px 0;
  border: 2px solid #f8f4d7;
  border-bottom: 0;
}
.so-invite-mark i { background: repeating-linear-gradient(0deg, #8bafb2 0 2px, transparent 2px 5px); }
.so-invite-mark i:last-child { background: #ffcd73; }

#dialog:is([data-kind="shootout-guide"], [data-kind="shootout-result"]) {
  width: min(94vw, 566px, calc(100% - var(--phone-left, 0px) - var(--phone-right, 0px)));
  background: #faf9ec;
  border-color: #2d4949;
}
#dialog:is([data-kind="shootout-guide"], [data-kind="shootout-result"]) .dialog-content {
  padding: clamp(15px, 3vw, 25px);
}
#dialog[data-kind="shootout-guide"] .dialog-close {
  min-width: 46px;
  min-height: 46px;
  color: #23484b;
  border-color: #a6c7bc;
  background: #e5eee0;
}
:is(.so-brief, .so-results) header h2 { margin-bottom: 5px; color: #1f4549; }
:is(.so-brief, .so-results) header p { color: #435b58; margin-bottom: 13px; }
.so-brief header p { max-width: 46ch; padding-right: 28px; }
.so-plays { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.so-plays article {
  min-width: 0;
  padding: 5px 5px 8px;
  border: 1px solid #c2cfc1;
  background: #fffef5;
  border-radius: 12px;
  overflow: hidden;
}
.so-plays h3 {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 7px 4px 2px;
  color: #204647;
  font-size: 16px;
}
.so-plays h3 .glyph, .so-brief-controls .glyph, .so-start-row .glyph, .so-reward .glyph { width: 18px; height: 18px; flex: none; }
.dialog-content .so-plays p { margin: 0 4px; color: #425a57; font-size: 13px; line-height: 1.5; }
.so-diagram {
  position: relative;
  overflow: hidden;
  height: clamp(53px, 7.5vh, 74px);
  border-radius: 7px;
  background: repeating-linear-gradient(90deg, #244e50 0 14%, #285454 14% 28%);
}
.so-net {
  position: absolute;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 66%;
  height: 46%;
  left: 17%;
  top: 12%;
  border: 2px solid #edeecb;
  border-bottom: 1px solid #adbab0;
  background:
    repeating-linear-gradient(90deg, transparent 0 8px, #93b5b044 8px 9px),
    repeating-linear-gradient(0deg, transparent 0 5px, #93b5b044 5px 6px);
}
.so-net i { position: relative; }
.so-net i + i { border-left: 1px dashed #c8d9c694; }
.so-diagram[data-role="shoot"] .so-net i:first-child::before,
.so-diagram[data-role="defend"] .so-net i:last-child::before {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 4px solid #a7dfff;
  background: #8bbbd354;
}
.so-pass {
  position: absolute;
  left: 49%;
  bottom: 16%;
  width: 27%;
  height: 51%;
  background: #ffdb83;
  clip-path: polygon(0 90%, 76% 19%, 63% 14%, 100% 0, 88% 36%, 84% 25%, 5% 100%);
}
.so-ball {
  position: absolute;
  left: calc(49% - 2px);
  bottom: 13%;
  width: 9px;
  height: 9px;
  border: 1px solid #353e43;
  border-radius: 2px;
  transform: rotate(13deg);
  background: #ffedb4;
}
.so-diagram[data-role="defend"] .so-ball { left: calc(76% - 3px); bottom: 62%; background: #c4eaff; }
.so-diagram[data-role="defend"] .so-pass {
  clip-path: polygon(0 90%, 70% 23%, 58% 18%, 96% 6%, 84% 43%, 78% 31%, 5% 100%);
}
.dialog-content .so-brief-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 9px 0;
  color: #294e4c;
  font-size: 13px;
}
.so-start-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 9px;
  border-top: 1px solid #cbd7c6;
}
.so-start-row > span, .so-start-row button, .so-reward { display: inline-flex; align-items: center; gap: 6px; }
.so-start-row > span { flex-wrap: wrap; color: #435d57; font-size: 13px; font-weight: 750; }
.so-start-row .primary, .so-results .dialog-actions button { min-width: 48px; min-height: 46px; }
.so-start-row .primary, .so-results .dialog-actions .primary {
  color: #123d40;
  background: #ffda87;
  border-color: #385451;
  box-shadow: 0 3px 0 #385451;
}
.so-results header p { margin-bottom: 9px; }
.so-tally {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  align-items: center;
  gap: 6px;
  padding: 11px 15px;
  color: #f1faee;
  background: #224c50;
  border-radius: 11px;
}
.so-tally > div { display: grid; gap: 1px; }
.so-tally > div + div { padding-left: 12px; border-left: 1px solid #779b98; }
.so-tally span { color: #d3e6db; font-size: 12px; font-weight: 750; }
.so-tally :is(strong, b) { line-height: 1.1; font-variant-numeric: tabular-nums; }
.so-tally strong { color: #ffe39a; font-size: clamp(28px, 4vw, 39px); }
.so-tally b { font-size: clamp(21px, 3vw, 28px); }
.so-tally small { font-size: 12px; font-weight: 750; }
.so-history { width: 100%; margin: 10px 0; border-collapse: collapse; text-align: left; font-size: 13px; }
.so-history th, .so-history td { padding: 5px 8px; border-bottom: 1px solid #d8dfd1; }
.so-history thead { color: #49615e; background: #e6ecdf; font-size: 12px; }
.so-history tbody th { color: #3c5452; }
.so-attempt { display: inline-flex; gap: 4px; align-items: center; color: #745347; font-weight: 750; }
.so-attempt .glyph { width: 15px; height: 15px; }
.so-earned { color: #166547; }
.dialog-content .so-reward, .dialog-content .so-threshold { margin: 0 0 4px; color: #41604c; font-size: 13px; }
.so-results .dialog-actions { margin-top: 11px; }

/* The fixed view keeps screen left and right constant for both positions. */
#app[data-ball-shootout] #race:not([hidden]) { display: block; padding: 0; }
#app[data-ball-shootout] #race .race-top { display: contents; }
#app[data-ball-shootout] #race .race-top > :not(.race-view-actions),
#app[data-ball-shootout] #race :is(#live-camera, #ball-coach, #ball-radar, .touch-actions, .joystick, .keyboard-guide, #countdown) {
  display: none;
}
#app[data-ball-shootout] #race .race-view-actions {
  position: absolute;
  right: max(13px, calc(var(--safe-right) + 8px));
  top: max(10px, calc(var(--safe-top) + 5px));
  z-index: 2;
}
#app[data-ball-shootout] #race .race-pause { width: 47px; height: 47px; }
#shootout-hud {
  position: absolute;
  inset: 0;
  color: #f6f7df;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
  --so-left-edge: max(13px, calc(var(--safe-left) + 8px));
  --so-right-edge: max(13px, calc(var(--safe-right) + 8px));
  --so-bottom: max(13px, calc(var(--safe-bottom) + 8px));
}
.so-board, .so-pad, .so-kick-box { position: absolute; }
.so-board {
  top: max(10px, calc(var(--safe-top) + 5px));
  left: 50%;
  width: clamp(245px, 29vw, 362px);
  transform: translateX(-50%);
  border: 1px solid #a9c8b8;
  border-radius: 10px;
  background: #193c40f5;
  box-shadow: 0 3px 0 #153333aa;
}
.so-board-head, .so-board-cue, .so-pad-heading { display: flex; align-items: center; gap: 7px; }
.so-board-head { min-height: 30px; padding: 3px 7px; border-radius: 9px 9px 0 0; background: #295356; }
.so-role {
  padding: 2px 6px;
  border-radius: 4px;
  color: #303c32;
  background: #f9d886;
  font-size: 13px;
  white-space: nowrap;
}
#shootout-hud[data-role="defend"] .so-role { color: #183b4b; background: #bbddf4; }
.so-round, .so-points { white-space: nowrap; font-size: 12px; font-weight: 750; }
.so-points { margin-left: auto; }
.so-points b { color: #ffe39a; font-size: 16px; }
.so-points small { font-size: 11px; }
.so-board-cue { justify-content: space-between; min-height: 25px; padding: 4px 9px; }
.so-cue { font-size: clamp(12px, 1.4vw, 15px); line-height: 1.35; }
.so-clock { flex-shrink: 0; color: #ffdc89; font-size: 12px; font-weight: 800; }
.so-pad { left: var(--so-left-edge); bottom: var(--so-bottom); }
.so-pad-heading, .so-action-tip {
  width: fit-content;
  margin: 0 0 5px;
  padding: 3px 7px;
  color: #f8fbe8;
  background: #193c40ed;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.25;
}
.so-pad-heading span { color: #d9eee2; }
.so-lanes { display: flex; gap: 5px; }
#shootout-hud button {
  min-width: 47px;
  min-height: 49px;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  border-radius: 8px;
  font-weight: 850;
}
.so-lane {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 4px;
  padding: 5px 6px;
  width: clamp(47px, 5.6vw, 67px);
  color: #f1f6e5;
  border: 1px solid #a7beb5;
  box-shadow: 0 3px 0 #1e393a;
  background: #21464aef;
  font-size: 14px;
  white-space: nowrap;
}
.so-lane[aria-pressed="true"] {
  border: 2px solid #fff0b4;
  color: #293d37;
  background: #f9d589;
}
.so-stripes { display: flex; justify-content: center; gap: 3px; }
.so-stripes i { width: 3px; height: 6px; background: currentColor; }
.so-kick-box { right: var(--so-right-edge); bottom: var(--so-bottom); display: grid; justify-items: end; }
.so-action-tip { font-weight: 740; }
.so-action-tip:empty { display: none; }
#shootout-hud[data-role="defend"] .so-action-tip:not(:empty) { display: flex; align-items: center; gap: 6px; }
#shootout-hud[data-role="defend"] .so-action-tip:not(:empty)::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}
#shootout-hud[data-dive-now] .so-action-tip {
  color: #163d36;
  background: #c1f5d7;
  box-shadow: 0 0 0 1px #244a43;
}
#shootout-hud[data-dive-now] .so-action-tip:not(:empty)::before {
  border-radius: 1px;
  background: currentColor;
  transform: rotate(45deg);
}
#shootout-hud:is([data-action-phase="passed"],[data-action-phase="spent"]) .so-action-tip:not(:empty)::before {
  height: 2px;
  border: 0;
  border-radius: 1px;
  background: currentColor;
}
.so-kick {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: clamp(92px, 13vw, 146px);
  padding: 7px 11px;
  color: #283d35;
  background: #ffdc89;
  border: 2px solid #fff1b7;
  box-shadow: 0 3px 0 #433c2d;
  font-size: clamp(18px, 2.4vw, 24px);
}
.so-kick kbd { margin: 0; color: #35473f; background: #fff0bc; border-color: #776a49; }
#shootout-hud[data-action-phase="wait"] .so-kick:enabled {
  color: #e8f6ed;
  background: #315459;
  border-color: #a8c5ba;
  box-shadow: 0 3px 0 #1b393c;
}
#shootout-hud[data-dive-now] .so-kick:enabled {
  color: #173e36;
  background: #bcffdc;
  border-color: #ebfff3;
  box-shadow: 0 3px 0 #25654e;
}
.so-kick:disabled { border: 1px dashed #bfd3c6; color: #dbe4d7; background: #365354f5; box-shadow: 0 3px 0 #253f40; }
.so-kick:disabled kbd { color: #dce8de; background: #3b5757; border-color: #90a79c; }
#shootout-hud button:focus-visible { outline: 3px solid #fff3cb; outline-offset: 3px; box-shadow: 0 0 0 6px #263e4b; }
#shootout-hud button:enabled:active { transform: translateY(2px); }

@media (max-width: 520px) {
  .ball-practice-options { grid-template-columns: minmax(0, 1fr); }
  .shootout-invite { min-height: 46px; }
  .shootout-invite > span:nth-child(2) { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 7px; }
  .so-board {
    left: var(--so-left-edge);
    width: min(312px, calc(100% - var(--so-left-edge) - var(--so-right-edge) - 55px));
    transform: none;
  }
}
@media (max-width: 390px) {
  .so-plays { gap: 5px; }
  .so-plays article { padding: 4px 3px 7px; }
  .so-history th, .so-history td { padding-inline: 5px; }
  .so-results .dialog-actions { gap: 5px; }
  .so-results .dialog-actions button { padding-inline: 7px; }
}
@media (orientation: landscape) and (max-height: 490px) {
  #dialog:is([data-kind="shootout-guide"], [data-kind="shootout-result"]) .dialog-content { padding: 11px 17px; }
  :is(.so-results, .so-brief) header h2 { font-size: 27px; margin-bottom: 3px; }
  :is(.so-results, .so-brief) header p { margin-bottom: 6px; }
  .so-diagram { height: 43px; }
  .so-plays article { padding-bottom: 5px; }
  .so-plays h3 { margin-top: 3px; }
  .dialog-content .so-brief-controls { margin: 6px 0; }
  .so-start-row { padding-top: 6px; }
  .so-tally { padding-block: 6px; }
  .so-history { margin: 6px 0; }
  .so-history td, .so-history th { padding-block: 3px; }
  .so-results .dialog-actions { margin-top: 6px; }
  .so-board { width: 274px; }
}
@media (orientation: landscape) and (max-height: 365px) {
  #dialog[data-kind="shootout-guide"] .dialog-content { padding: 8px 12px 9px; }
  #dialog[data-kind="shootout-guide"] .so-brief header h2 { margin-bottom: 2px; font-size: 25px; line-height: 1.12; }
  #dialog[data-kind="shootout-guide"] .so-brief header p {
    max-width: none;
    padding: 0 46px 0 0;
    margin: 0 0 7px;
    font-size: 12px;
    line-height: 1.35;
  }
  .so-plays { gap: 6px; }
  .so-plays article {
    display: grid;
    grid-template-columns: clamp(48px, 12vw, 76px) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    align-content: start;
    column-gap: 6px;
  }
  .so-plays .so-diagram { grid-row: 1 / span 2; align-self: center; height: 39px; }
  .so-plays h3 { margin: 0 1px 2px; font-size: 14px; line-height: 1.2; }
  .so-plays h3 .glyph { width: 15px; height: 15px; }
  #dialog .so-plays p { margin: 0 1px; font-size: 12px; line-height: 1.35; }
  #dialog .so-brief-controls { margin: 6px 0; font-size: 12px; line-height: 1.3; }
}
@media (forced-colors: active) {
  .so-lane[aria-pressed="true"] { outline: 2px solid Highlight; }
  .so-stripes i, .so-invite-mark i { background: ButtonText; }
}
