:root {
  color-scheme: dark;
  --ink: #fffaf0;
  --muted: #cbd4cc;
  --night: #101812;
  --panel: rgba(20, 31, 23, 0.94);
  --line: rgba(255, 255, 255, 0.16);
  --red: #d94837;
  --red-dark: #8e281f;
  --gold: #f3c552;
  --grass: #4fa04a;
  --blue: #64b5dd;
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.5);
  font-family: "Outfit", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  color: var(--ink);
  background: #223723 url("images/fence-busters-ballpark.jpg") center / cover no-repeat;
  user-select: none;
}

button,
a,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.hidden {
  display: none !important;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  display: block;
  width: 100vw;
  height: 100vh;
  touch-action: none;
}

.setup-screen {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  overflow: hidden auto;
  padding: 32px 20px;
  background:
    linear-gradient(90deg, rgba(13, 22, 15, 0.96) 0%, rgba(13, 22, 15, 0.83) 48%, rgba(13, 22, 15, 0.13) 100%),
    linear-gradient(180deg, transparent 50%, rgba(8, 15, 10, 0.55));
}

.setup-panel {
  width: min(820px, 100%);
  margin-right: min(31vw, 430px);
  padding: 28px 32px 24px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.title-lockup {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.title-mark {
  display: grid;
  flex: 0 0 66px;
  width: 66px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  background: #f8f3e3;
  box-shadow: inset 0 0 0 7px rgba(217, 72, 55, 0.14), 0 9px 22px rgba(0, 0, 0, 0.3);
  font-size: 2rem;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--gold);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1,
h2 {
  font-family: "Roboto Slab", Georgia, serif;
}

h1 {
  margin-bottom: 2px;
  font-size: clamp(2.5rem, 5vw, 4rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h1 strong {
  color: var(--red);
  font-weight: 900;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
}

.setup-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 15px 22px;
}

.option-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.option-group legend {
  width: 100%;
  margin-bottom: 7px;
  color: #d9dfd9;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

.event-group {
  grid-row: span 3;
}

.event-option {
  position: relative;
  display: grid;
  grid-template-columns: 27px 1fr;
  align-items: center;
  gap: 11px;
  min-height: 55px;
  margin-bottom: 7px;
  padding: 8px 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.event-option:hover {
  transform: translateX(2px);
  border-color: rgba(243, 197, 82, 0.65);
}

.event-option:has(input:focus-visible),
.segmented-options label:has(input:focus-visible) span,
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.icon-btn:focus-visible,
.swing-btn:focus-visible {
  outline: 3px solid #fff4bd;
  outline-offset: 3px;
}

.event-option.selected {
  border-color: var(--gold);
  background: rgba(243, 197, 82, 0.1);
}

.event-option.selected::after {
  position: absolute;
  inset: 0 0 0 auto;
  width: 4px;
  content: "";
  background: var(--gold);
}

.event-option input,
.segmented-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.event-option svg {
  width: 22px;
  height: 22px;
  color: var(--gold);
}

.event-option span,
.event-option strong,
.event-option small {
  display: block;
}

.event-option strong {
  font-size: 0.92rem;
}

.event-option small {
  color: var(--muted);
  font-size: 0.72rem;
}

.segmented-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.23);
}

.segmented-options.two-options {
  grid-template-columns: repeat(2, 1fr);
}

.segmented-options label {
  position: relative;
  cursor: pointer;
}

.segmented-options span {
  display: grid;
  min-height: 38px;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.segmented-options input:checked + span {
  color: #241e0d;
  background: var(--gold);
  box-shadow: 0 3px 12px rgba(243, 197, 82, 0.22);
}

.option-note {
  min-height: 28px;
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
}

.mission-brief {
  display: grid;
  grid-template-columns: 165px 1fr;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding: 11px 13px;
  border: 1px solid rgba(243, 197, 82, 0.22);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}

.mission-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mission-heading > span:last-child,
.mission-heading small,
.mission-heading strong {
  display: block;
}

.mission-icon {
  display: grid;
  flex: 0 0 35px;
  width: 35px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(243, 197, 82, 0.1);
}

.mission-icon svg {
  width: 18px;
  height: 18px;
}

.mission-heading small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
}

.mission-heading strong {
  margin-top: 1px;
  font-size: 0.8rem;
}

.mission-goals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.mission-goal {
  display: flex;
  min-width: 0;
  min-height: 35px;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-left: 2px solid rgba(243, 197, 82, 0.7);
  color: #e8eee8;
  background: rgba(255, 255, 255, 0.045);
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15;
}

.mission-goal svg {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  color: var(--gold);
}

.name-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.name-fields label,
.name-fields span {
  display: block;
}

.name-fields span {
  margin: 0 0 4px 2px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
}

.name-fields input {
  width: 100%;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.25);
  font-weight: 700;
}

.name-fields input:focus {
  border-color: var(--gold);
}

.setup-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.setup-actions {
  margin-top: 19px;
}

.primary-btn,
.secondary-btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}

.primary-btn,
.secondary-btn {
  min-height: 45px;
  gap: 8px;
  padding: 0 19px;
  border-radius: 6px;
  font-weight: 900;
}

.primary-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--red), #ef6a42);
  box-shadow: 0 8px 22px rgba(217, 72, 55, 0.3);
}

.secondary-btn {
  border: 1px solid var(--line);
  color: var(--ink);
  background: rgba(255, 255, 255, 0.065);
}

.primary-btn:hover,
.secondary-btn:hover {
  filter: brightness(1.1);
}

.primary-btn svg,
.secondary-btn svg {
  width: 18px;
  height: 18px;
}

.best-record {
  margin-left: auto;
  color: var(--gold);
  font-size: 0.8rem;
  font-weight: 800;
}

.game-tools {
  position: fixed;
  z-index: 520;
  bottom: 14px;
  left: 14px;
  display: flex;
  gap: 5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 24, 16, 0.88);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(8px);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  color: var(--ink);
  background: transparent;
}

.icon-btn:hover {
  color: #201a0d;
  background: var(--gold);
}

.icon-btn svg {
  width: 19px;
  height: 19px;
}

.game-hud {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(170px, 0.78fr) minmax(165px, 0.8fr) minmax(190px, 0.9fr);
  min-height: 72px;
  align-items: center;
  padding: 8px 92px 8px 20px;
  border-bottom: 2px solid rgba(243, 197, 82, 0.45);
  background: rgba(13, 24, 15, 0.88);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(10px);
}

.hud-player,
.hud-event,
.hud-stats,
.hud-heat {
  min-width: 0;
}

.hud-kicker,
.hud-event span,
.hud-stats small {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
}

.hud-player > strong {
  display: block;
  color: var(--gold);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 2rem;
  line-height: 1;
}

.hud-event {
  text-align: center;
}

.hud-event strong {
  display: block;
  margin-top: 2px;
  font-size: 0.88rem;
}

.hud-stats {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  text-align: right;
}

.hud-stats strong {
  display: block;
  color: var(--gold);
  font-size: 1rem;
}

.hud-heat {
  display: grid;
  grid-template-columns: auto minmax(90px, 1fr);
  align-items: center;
  gap: 9px;
  padding-left: 22px;
}

.heat-copy {
  display: block;
  min-width: 48px;
  text-align: right;
}

.heat-copy small,
.heat-copy strong {
  display: block;
}

.heat-copy small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.heat-copy strong {
  color: var(--gold);
  font-size: 0.82rem;
}

.heat-track {
  position: relative;
  display: flex;
  height: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.35);
}

.heat-track i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: linear-gradient(90deg, #f3c552, #ef6a42 62%, #fff1a6);
  box-shadow: 0 0 13px rgba(239, 106, 66, 0.7);
  transition: width 280ms ease;
}

.heat-track b {
  position: relative;
  z-index: 1;
  flex: 1;
  border-right: 1px solid rgba(9, 16, 10, 0.45);
}

.hud-heat.on-fire .heat-copy strong {
  color: #fff1a6;
  text-shadow: 0 0 12px rgba(243, 197, 82, 0.75);
}

.swing-btn {
  position: fixed;
  z-index: 50;
  right: 24px;
  bottom: 24px;
  display: flex;
  width: 150px;
  height: 62px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 2px solid #fff3c5;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #d63d2f, #a7231e);
  box-shadow: 0 9px 0 #701813, 0 16px 30px rgba(0, 0, 0, 0.32);
  cursor: pointer;
  touch-action: manipulation;
}

.swing-btn:active,
.swing-btn.pressed {
  transform: translateY(6px);
  box-shadow: 0 3px 0 #701813, 0 8px 16px rgba(0, 0, 0, 0.3);
}

.swing-btn.on-fire {
  border-color: #fff1a6;
  background: linear-gradient(145deg, #ef6a42, #a91f18);
  box-shadow: 0 9px 0 #701813, 0 0 24px rgba(243, 197, 82, 0.55), 0 16px 30px rgba(0, 0, 0, 0.32);
  animation: hot-button-pulse 760ms ease-in-out infinite alternate;
}

@keyframes hot-button-pulse {
  to { filter: brightness(1.15); }
}

.swing-ball {
  font-size: 1.6rem;
}

.swing-btn strong {
  font-size: 1.05rem;
}

.pitch-readout,
.turn-banner {
  position: fixed;
  z-index: 45;
  top: 20%;
  left: 50%;
  min-width: 250px;
  transform: translateX(-50%);
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 7px;
  text-align: center;
  background: rgba(13, 24, 15, 0.86);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(7px);
}

.pitch-readout span,
.turn-banner span {
  display: block;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
}

.pitch-readout strong,
.turn-banner strong {
  display: block;
  margin-top: 1px;
  color: var(--gold);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.5rem;
}

.pitch-readout.negative strong {
  color: #ff8d77;
}

.pitch-readout.positive strong {
  color: #a6ef83;
}

.pitch-meta {
  display: block;
  min-height: 14px;
  margin-top: 3px;
  color: #eef4ef;
  font-size: 0.66rem;
  font-weight: 700;
}

.timing-gauge {
  position: relative;
  display: block;
  width: 150px;
  height: 7px;
  margin: 7px auto 1px;
  overflow: visible;
  border-radius: 4px;
  background: linear-gradient(90deg, #db7a4a, #f3c552 35%, #8bd77e 50%, #f3c552 65%, #db7a4a);
}

.timing-sweet {
  position: absolute;
  top: -2px;
  bottom: -2px;
  left: 45%;
  width: 10%;
  border: 1px solid #fffde1;
  border-radius: 3px;
}

.timing-gauge b {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(10, 18, 11, 0.8);
  transform: translateX(-50%);
}

.milestone-toast {
  position: fixed;
  z-index: 65;
  top: 88px;
  left: 18px;
  min-width: 190px;
  padding: 9px 14px;
  border-left: 4px solid var(--gold);
  border-radius: 5px;
  background: rgba(14, 24, 16, 0.92);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  animation: toast-in 220ms ease-out;
}

.milestone-toast span,
.milestone-toast strong {
  display: block;
}

.milestone-toast span {
  color: var(--gold);
  font-size: 0.6rem;
  font-weight: 900;
}

.milestone-toast strong {
  margin-top: 1px;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.1rem;
}

.big-play {
  position: fixed;
  z-index: 60;
  inset: 72px 0 auto;
  display: grid;
  place-items: center;
  padding-top: 7vh;
  text-align: center;
  pointer-events: none;
  animation: big-play-in 480ms cubic-bezier(0.2, 1.1, 0.35, 1);
}

.big-play span,
.big-play strong,
.big-play small {
  display: block;
}

.big-play span {
  padding: 4px 10px;
  border-radius: 3px;
  color: #171207;
  background: var(--gold);
  font-size: 0.66rem;
  font-weight: 900;
}

.big-play strong {
  margin-top: 4px;
  color: #fff8df;
  font-family: "Roboto Slab", Georgia, serif;
  font-size: clamp(2.8rem, 7vw, 6rem);
  line-height: 0.95;
  text-shadow: 0 5px 0 var(--red-dark), 0 13px 35px rgba(0, 0, 0, 0.48);
}

.big-play small {
  margin-top: 6px;
  color: #fff8df;
  font-size: 1rem;
  font-weight: 900;
  text-shadow: 0 3px 12px rgba(0, 0, 0, 0.75);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-20px); }
}

@keyframes big-play-in {
  from { opacity: 0; transform: scale(0.72); }
}

.countdown {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(5, 12, 7, 0.35);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: clamp(7rem, 18vw, 14rem);
  font-weight: 900;
  text-shadow: 0 9px 0 var(--red-dark), 0 18px 45px rgba(0, 0, 0, 0.42);
}

.modal-overlay {
  position: fixed;
  z-index: 700;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden auto;
  padding: 70px 16px 24px;
  background: rgba(7, 13, 8, 0.78);
  backdrop-filter: blur(10px);
}

.modal-panel {
  width: min(650px, 100%);
  padding: 28px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--gold);
  border-radius: 8px;
  text-align: center;
  background: #17241a;
  box-shadow: var(--shadow);
}

.compact-panel {
  max-width: 500px;
}

.modal-icon {
  display: grid;
  width: 54px;
  aspect-ratio: 1;
  margin: 0 auto 12px;
  place-items: center;
  border-radius: 50%;
  color: var(--gold);
  background: rgba(243, 197, 82, 0.1);
}

.modal-icon svg {
  width: 28px;
  height: 28px;
}

.modal-panel h2 {
  margin: 0 0 20px;
  font-size: 2rem;
}

.modal-actions {
  justify-content: center;
  flex-wrap: wrap;
}

.results-list {
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
}

.performance-summary {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 13px;
  margin: 5px 0 15px;
  padding: 11px 13px;
  border: 1px solid rgba(243, 197, 82, 0.22);
  border-radius: 6px;
  background: rgba(243, 197, 82, 0.055);
  text-align: left;
}

.performance-grade {
  display: grid;
  width: 58px;
  aspect-ratio: 1;
  place-items: center;
  border: 2px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(243, 197, 82, 0.1);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 2rem;
  font-weight: 900;
}

.performance-copy,
.performance-copy strong,
.performance-copy small {
  display: block;
}

.performance-copy strong {
  font-size: 1rem;
}

.performance-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.75rem;
}

.results-goals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin: -10px 0 20px;
}

.result-goal {
  display: grid;
  min-height: 48px;
  place-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 0.7rem;
  font-weight: 800;
  text-align: center;
}

.result-goal.complete {
  border-color: rgba(166, 239, 131, 0.45);
  color: #c9f6b5;
  background: rgba(113, 196, 82, 0.08);
}

.result-goal svg {
  width: 16px;
  height: 16px;
  margin-bottom: 3px;
}

.result-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 13px;
  border-left: 3px solid var(--red);
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
}

.result-rank {
  display: grid;
  width: 30px;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  background: rgba(243, 197, 82, 0.13);
  color: var(--gold);
  font-weight: 900;
}

.result-name {
  display: block;
  font-weight: 900;
}

.result-detail {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.result-score {
  color: var(--gold);
  font-family: "Roboto Slab", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 900;
}

@media (max-width: 1100px) {
  .setup-panel {
    margin-right: 13vw;
  }
}

@media (max-width: 820px) {
  .setup-screen {
    background: linear-gradient(180deg, rgba(9, 17, 10, 0.56), rgba(9, 17, 10, 0.97) 48%);
  }

  .setup-panel {
    margin-right: 0;
  }

  .game-tools {
    top: 82px;
    right: 8px;
    bottom: auto;
    left: auto;
    flex-direction: column;
  }

  .game-tools .icon-btn:first-child {
    display: none;
  }

  .game-hud {
    grid-template-columns: minmax(110px, 1fr) minmax(145px, 0.8fr) minmax(130px, 0.7fr);
  }

  .hud-heat {
    position: absolute;
    right: 58px;
    bottom: -20px;
    width: min(210px, 50vw);
    height: 19px;
    grid-template-columns: 58px 1fr;
    padding: 3px 7px;
    border-radius: 0 0 5px 5px;
    background: rgba(13, 24, 15, 0.88);
  }

  .heat-copy small {
    display: none;
  }
}

@media (max-width: 620px) {
  body {
    overflow: auto;
  }

  body.playing {
    overflow: hidden;
  }

  .setup-screen {
    display: block;
    padding: 72px 10px 24px;
  }

  .setup-panel {
    padding: 19px 15px;
  }

  .title-lockup {
    gap: 11px;
    margin-bottom: 18px;
  }

  .title-mark {
    flex-basis: 50px;
    width: 50px;
    font-size: 1.5rem;
  }

  h1 {
    font-size: 2.2rem;
  }

  .setup-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .mission-brief {
    grid-template-columns: 88px 1fr;
    gap: 7px;
  }

  .mission-heading {
    gap: 6px;
  }

  .mission-icon {
    flex-basis: 28px;
    width: 28px;
  }

  .mission-heading small {
    display: none;
  }

  .mission-heading strong {
    font-size: 0.7rem;
    line-height: 1.05;
  }

  .mission-goals {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
  }

  .mission-goal {
    min-height: 52px;
    flex-direction: column;
    gap: 3px;
    justify-content: center;
    padding: 5px;
    text-align: center;
  }

  .event-group {
    grid-row: auto;
  }

  .name-fields {
    grid-template-columns: 1fr;
  }

  .setup-actions {
    flex-wrap: wrap;
  }

  .best-record {
    width: 100%;
    margin-left: 0;
  }

  .game-hud {
    grid-template-columns: 1fr 1fr;
    min-height: 76px;
    padding: 7px 56px 7px 10px;
  }

  .hud-player > strong {
    font-size: 1.55rem;
  }

  .hud-event {
    text-align: right;
  }

  .hud-stats {
    display: none;
  }

  .hud-heat {
    width: 178px;
  }

  .swing-btn {
    right: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    width: min(180px, calc(100vw - 112px));
    transform: translateX(50%);
  }

  .swing-btn:active,
  .swing-btn.pressed {
    transform: translateX(50%) translateY(6px);
  }

  .pitch-readout,
  .turn-banner {
    top: 13%;
  }

  .milestone-toast {
    top: 102px;
    left: 8px;
    min-width: 160px;
  }

  .big-play {
    inset: 78px 0 auto;
    padding-top: 5vh;
  }

  .results-goals {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 560px) and (orientation: landscape) {
  .setup-screen {
    display: block;
    padding: 58px 86px 20px 10px;
  }

  .setup-panel {
    width: min(760px, 100%);
    margin: 0;
    padding: 16px 20px;
  }

  .title-lockup {
    margin-bottom: 12px;
  }

  .title-mark {
    flex-basis: 46px;
    width: 46px;
    font-size: 1.35rem;
  }

  h1 {
    font-size: 2.05rem;
  }

  .setup-grid {
    gap: 9px 17px;
  }

  .mission-brief {
    margin-top: 8px;
    padding-block: 7px;
  }

  .mission-goal {
    min-height: 30px;
  }

  .event-option {
    min-height: 43px;
    padding-block: 5px;
  }

  .segmented-options span {
    min-height: 32px;
  }

  .option-note {
    min-height: 20px;
  }

  .name-fields input {
    min-height: 32px;
  }

  .setup-actions {
    margin-top: 10px;
  }

  .primary-btn,
  .secondary-btn {
    min-height: 39px;
  }

  .game-hud {
    min-height: 62px;
    padding: 5px 54px 5px 12px;
  }

  .hud-heat {
    right: 54px;
    bottom: -17px;
    height: 17px;
  }

  .hud-player > strong {
    font-size: 1.55rem;
  }

  .swing-btn {
    right: 8px;
    bottom: 10px;
    width: 116px;
    height: 50px;
  }

  .game-tools {
    top: auto;
    right: auto;
    bottom: 8px;
    left: 8px;
    flex-direction: row;
  }

  .game-tools .icon-btn:first-child,
  .game-tools .icon-btn:nth-child(2) {
    display: inline-flex;
  }

  .pitch-readout,
  .turn-banner {
    top: 18%;
  }

  .milestone-toast {
    top: 70px;
    left: 8px;
  }

  .big-play {
    inset: 62px 0 auto;
    padding-top: 2vh;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
