:root {
  font-family: "Avenir Next", "Trebuchet MS", system-ui, sans-serif;
  color: #153e52;
  background: #eaf6fb;
  font-synthesis: none;
  --navy: #153e52;
  --teal: #079faa;
  --pink: #e96682;
  --muted: #557482;
  --line: #d6e7ed;
  --white: #fff;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 0;
  color: inherit;
}
button:disabled {
  cursor: default;
  opacity: 0.58;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid #ffb84e;
  outline-offset: 4px;
}
button {
  transition:
    transform 0.15s,
    box-shadow 0.15s,
    background 0.15s;
}
button:not(:disabled):active {
  transform: translateY(2px);
}
a {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
.hidden {
  display: none !important;
}
.boot {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.ball-loader {
  font-size: 64px;
  animation: bounce 1s ease-in-out infinite;
}
h1 {
  font-size: clamp(2.2rem, 3.9vw, 3.75rem);
  line-height: 1.1;
  letter-spacing: -0.045em;
  font-weight: 800;
}
h2 {
  letter-spacing: -0.025em;
}
.eyebrow {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  color: #33818e;
  margin-bottom: 12px;
}
.primary {
  background: var(--teal);
  color: white;
  font-weight: 800;
  padding: 17px 30px;
  border-radius: 32px;
  box-shadow: 0 6px 0 #087c87;
  font-size: 1.05rem;
}
.primary:hover {
  background: #008e9a;
  box-shadow: 0 7px 0 #086b77;
}
.secondary {
  background: #eaf5f8;
  border: 1px solid var(--line);
  padding: 14px 24px;
  border-radius: 20px;
  font-weight: 700;
}
.text-button {
  background: transparent;
  padding: 12px 15px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 0.95rem;
}
.text-button:hover {
  background: #dcecf2;
}
.wide {
  width: 100%;
  margin-top: 14px;
}
.setup {
  max-width: 1536px;
  min-height: 100dvh;
  margin: auto;
  padding: 0 4.3%;
  display: flex;
  flex-direction: column;
}
.setup-body {
  background:
    radial-gradient(circle at 95% 2%, #fff9 0, transparent 35%),
    linear-gradient(#e2f5fd, #f5fbfd);
  overflow-y: auto;
}
.setup-header {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-shrink: 0;
}
.brand {
  font-weight: 800;
  font-size: 1.35rem;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.04em;
}
.brand-ball {
  font-size: 32px;
  filter: drop-shadow(0 3px 2px #56869622);
}
.setup-header nav {
  display: flex;
  gap: 8px;
  color: #7794a1;
  font-size: 0.9rem;
  font-weight: 700;
}
.setup-header nav span {
  padding: 8px 18px;
  border-radius: 30px;
}
.setup-header nav .current {
  background: #153e52;
  color: white;
}
.setup-intro {
  margin: 22px 0 32px;
}
.setup-intro h1 {
  margin-bottom: 12px;
}
.setup-intro p {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.5;
  margin-bottom: 0;
}
.setup-intro.compact {
  margin: 6px 0 25px;
}
.setup-intro.compact h1 {
  font-size: 2.6rem;
}
.field-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  flex: 1;
  min-height: 365px;
  max-height: 570px;
}
.field-card {
  display: grid;
  grid-template-columns: 54% 46%;
  align-items: stretch;
  background: white;
  text-align: left;
  border-radius: 32px;
  padding: 15px;
  border: 3px solid transparent;
  box-shadow: 0 12px 32px #123e5210;
  min-height: 360px;
  overflow: hidden;
}
.field-card:hover {
  box-shadow: 0 14px 40px #123e5225;
  transform: translateY(-3px);
}
.field-card.selected {
  border-color: var(--teal);
}
.field-card[data-world="christmas"].selected {
  border-color: var(--pink);
}
.field-card img {
  width: 100%;
  height: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: 21px;
  object-position: center;
}
.field-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 30px 12px 25px 30px;
  justify-content: center;
}
.field-tag {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--teal);
  margin-bottom: 22px;
}
.field-card[data-world="christmas"] .field-tag {
  color: #c44d69;
}
.field-copy strong {
  font-size: clamp(1.8rem, 2.6vw, 2.6rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}
.field-copy > span:not(.field-tag):not(.field-check) {
  font-size: 0.98rem;
  color: var(--muted);
  line-height: 1.6;
}
.field-check {
  margin-top: 30px;
  border-radius: 24px;
  background: #e9f4f6;
  padding: 12px 20px;
  font-size: 0.9rem;
  font-weight: 800;
}
.selected .field-check {
  background: var(--teal);
  color: white;
}
.field-card[data-world="christmas"].selected .field-check {
  background: var(--pink);
}
.setup-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 30px 0 35px;
  min-height: 110px;
  color: var(--muted);
  font-size: 0.92rem;
  margin-top: auto;
}
.player-editors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.player-editor {
  background: #fff;
  border-radius: 28px;
  border: 2px solid #cce9ed;
  overflow: hidden;
  box-shadow: 0 12px 30px #123e5208;
}
.player-editor.p2 {
  border-color: #f3d1dc;
}
.player-editor > header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 22px;
  border-bottom: 1px solid #e9f1f4;
}
.player-editor h2 {
  font-size: 1.15rem;
  margin: 0;
}
.player-number {
  background: #07a5af;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-grid;
  place-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}
.p2 .player-number {
  background: var(--pink);
}
.key-tag {
  background: #f0f5f7;
  border: 1px solid #d6e4e9;
  border-bottom-width: 3px;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: auto;
}
.editor-content {
  display: grid;
  grid-template-columns: 37% 63%;
  padding: 20px 20px 22px 10px;
  gap: 4px;
}
.avatar-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  background: radial-gradient(ellipse at 50% 52%, #dff4f8 0, transparent 69%);
}
.avatar-wrap canvas {
  width: 100%;
  height: 310px;
}
.avatar-label {
  font-size: 0.72rem;
  color: #76909b;
  text-align: center;
  max-width: 110px;
  line-height: 1.5;
}
.editor-fields {
  min-width: 0;
}
.editor-fields label {
  display: block;
  font-weight: 750;
  font-size: 0.8rem;
  margin-bottom: 15px;
}
.editor-fields input,
.editor-fields select {
  display: block;
  width: 100%;
  height: 41px;
  margin-top: 7px;
  padding: 0 12px;
  background: #f8fbfc;
  border: 1px solid #d3e3e9;
  border-radius: 11px;
  color: var(--navy);
  font-size: 0.88rem;
}
.editor-fields select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23557482' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 31px;
}
.character-type {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: #edf4f7;
  border-radius: 12px;
  margin-bottom: 17px;
}
.character-type button {
  font-size: 0.75rem;
  padding: 9px 5px;
  border-radius: 9px;
  background: transparent;
  font-weight: 700;
}
.character-type button[aria-pressed="true"] {
  background: white;
  box-shadow: 0 2px 6px #153e5215;
}
.editor-fields fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  min-width: 0;
}
.editor-fields legend {
  font-size: 0.78rem;
  font-weight: 750;
  padding: 0;
  margin-bottom: 10px;
}
.editor-fields legend span {
  font-weight: 400;
  text-transform: capitalize;
  color: #6c8490;
  margin-left: 6px;
}
.swatches {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
}
.swatch {
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: var(--swatch);
  border: 3px solid white;
  box-shadow: 0 0 0 1px #d6e5e9;
}
.swatch[aria-pressed="true"] {
  box-shadow: 0 0 0 2px var(--navy);
  transform: scale(1.08);
}
.eyes .swatch {
  width: 23px;
  height: 23px;
  border-width: 2px;
}
.save-player {
  padding: 9px 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 700;
}
.special-note {
  font-size: 0.9rem;
  line-height: 1.6;
  background: #fff5d6;
  padding: 20px;
  border-radius: 15px;
  color: #7d652a;
  min-height: 150px;
}
.chosen-field {
  font-size: 0.85rem;
}
.game-body {
  overflow: hidden;
  background: #153e52;
}
.game-shell {
  height: 100dvh;
  min-height: 580px;
  display: grid;
  grid-template-rows: 68px minmax(0, 1fr) 56px;
}
.scoreboard {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 22px;
  padding: 10px 20px;
  color: #fff;
  box-shadow: 0 2px 10px #0001;
  z-index: 2;
}
.score-team {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 1rem;
  font-weight: 700;
  min-width: 160px;
}
.score-team strong {
  font-size: 2rem;
  line-height: 1;
  min-width: 30px;
  text-align: center;
}
.team-one {
  justify-content: flex-end;
  color: #89f0ed;
}
.team-two {
  color: #ffb7c7;
}
.inning-block {
  min-width: 160px;
  text-align: center;
  padding: 0 20px;
  border-inline: 1px solid #ffffff25;
}
.inning-block strong {
  font-size: 0.85rem;
}
.inning-block > span {
  display: block;
  color: #c6dbe3;
  font-size: 0.72rem;
  margin-top: 5px;
}
.inning-block i {
  font-style: normal;
  margin: 0 8px;
}
.icon-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-content: center;
  font-size: 1.2rem;
  background: #ffffff12;
  color: #fff;
}
.icon-button:hover {
  background: #ffffff25;
}
.scoreboard > .icon-button:first-child {
  margin-right: auto;
}
.scoreboard > .icon-button:nth-last-child(2) {
  margin-left: auto;
}
.play-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 7px;
  min-height: 0;
}
.player-panel {
  display: grid;
  grid-template-rows: 42px minmax(0, 1fr) 100px;
  min-width: 0;
  min-height: 0;
  background: #f4fbfd;
}
.panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 8px 20px;
  background: #f2fbfc;
  color: #28556a;
  font-size: 0.8rem;
}
.panel-heading > b {
  font-size: 0.8rem;
}
.panel-heading > strong {
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  margin-left: auto;
}
.panel-heading .key-tag {
  margin-left: 6px;
  font-size: 0.68rem;
  padding: 3px 8px;
}
.panel-heading b {
  color: #0a98a3;
  margin-right: 7px;
}
.p2 .panel-heading {
  background: #fff4f7;
}
.p2 .panel-heading b {
  color: #d45575;
}
.scene-wrap {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.scene-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.scene-message {
  position: absolute;
  top: 17px;
  left: 50%;
  transform: translateX(-50%) translateY(-7px);
  padding: 11px 20px;
  border-radius: 30px;
  background: #ffffffed;
  box-shadow: 0 4px 15px #153e5215;
  font-weight: 800;
  font-size: 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s;
  white-space: nowrap;
}
.scene-message.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.panel-controls {
  padding: 12px 18px 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  border-top: 1px solid #153e5210;
}
.panel-controls > p {
  font-size: 0.7rem;
  color: #607e8c;
  text-align: center;
  margin: 0;
  line-height: 1.4;
}
.pitch-buttons {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.pitch-buttons button {
  padding: 9px 12px;
  background: white;
  border: 1px solid #cae1e7;
  border-radius: 12px;
  font-weight: 750;
  font-size: 0.76rem;
  flex: 1;
  max-width: 140px;
}
.pitch-buttons button:hover {
  background: #d9f6f4;
  border-color: #38adb4;
}
.action-button {
  background: var(--teal);
  color: #fff;
  padding: 11px 20px;
  border-radius: 15px;
  font-weight: 800;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  white-space: nowrap;
}
.p2 .action-button {
  background: var(--pink);
}
.action-button.is-ready {
  background: #c9ebe4;
  color: #177267;
  opacity: 1;
}
.action-button kbd {
  background: #ffffff26;
  border-color: #ffffff55;
  color: inherit;
  font-size: 0.68rem;
}
.action-row {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}
.swing-feedback,
.chase-feedback {
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 800;
}
.swing-feedback.pending {
  color: #476b7c;
  background: #e5eef2;
}
.swing-feedback.green {
  color: #176244;
  background: #cff0d9;
}
.swing-feedback.yellow {
  color: #735000;
  background: #ffe7a3;
}
.swing-feedback.red {
  color: #8e293a;
  background: #ffe0e5;
}
.chase-feedback {
  color: #176244;
  background: #d5f3e7;
}
.chase-feedback strong,
.chase-feedback span {
  display: block;
}
.chase-feedback span {
  font-size: 0.875rem;
  font-weight: 600;
  margin-top: 2px;
}
.chase-button:active {
  transform: scale(0.95);
  filter: brightness(1.15);
}
.run-buttons {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.run-buttons button {
  background: var(--teal);
  color: white;
  border-radius: 13px;
  padding: 10px 13px;
  font-size: 0.81rem;
  font-weight: 750;
  white-space: nowrap;
}
.p2 .run-buttons button {
  background: var(--pink);
}
.run-buttons span {
  font-weight: 700;
  font-size: 0.78rem;
  text-align: center;
  color: #3a6476;
}
.run-buttons kbd {
  background: #ffffff26;
  color: inherit;
  border-color: #ffffff55;
}
.pitch-info {
  text-align: center;
  font-weight: 800;
}
.result-control {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 0.95rem;
}
.result-control button {
  background: #fff;
  border: 1px solid #d2e2e9;
  border-radius: 12px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.8rem;
}
.game-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  color: #fff;
  padding: 9px 18px;
  text-align: center;
  min-width: 0;
}
.game-status strong {
  font-size: 1rem;
}
.game-status span {
  font-size: 0.78rem;
  color: #bed8e2;
  max-width: 700px;
}
.game-dialog {
  border: 0;
  border-radius: 28px;
  padding: 36px;
  max-width: 720px;
  width: calc(100% - 40px);
  box-shadow: 0 30px 100px #08253570;
  color: var(--navy);
  background: #f9fdff;
}
.game-dialog::backdrop {
  background: #062838a3;
  backdrop-filter: blur(6px);
}
.game-dialog h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}
.game-dialog > p {
  color: var(--muted);
  line-height: 1.6;
}
.game-dialog[data-kind="pause"],
.game-dialog[data-kind="gameover"] {
  max-width: 440px;
  text-align: center;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 28px;
}
.help-grid h3 {
  font-size: 1rem;
  margin-bottom: 7px;
}
.help-grid p {
  font-size: 0.87rem;
  line-height: 1.7;
  color: var(--muted);
}
kbd {
  display: inline-block;
  font-family: inherit;
  background: #fff;
  border: 1px solid #ccdee6;
  border-bottom-width: 2px;
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 0.76em;
  color: #28556a;
  line-height: 1.5;
}
.trophy {
  font-size: 60px;
  margin-bottom: 20px;
}
.final-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 30px 0;
}
.final-score span {
  font-size: 0.9rem;
  font-weight: 700;
}
.final-score strong {
  display: block;
  font-size: 3rem;
  margin-top: 8px;
}
.final-score i {
  font-size: 2rem;
  font-style: normal;
  color: #a4bbc7;
}
#toast {
  position: fixed;
  bottom: 25px;
  left: 50%;
  transform: translate(-50%, 20px);
  background: #123e52;
  color: #fff;
  padding: 13px 22px;
  border-radius: 25px;
  box-shadow: 0 7px 25px #0002;
  opacity: 0;
  pointer-events: none;
  z-index: 20;
  font-size: 0.9rem;
  transition: 0.2s;
  max-width: 90vw;
  text-align: center;
}
#toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}
@keyframes bounce {
  50% {
    transform: translateY(-12px) rotate(10deg);
  }
}
@media (min-height: 900px) {
  .setup-intro {
    margin-top: 30px;
    margin-bottom: 40px;
  }
  .field-options {
    max-height: 600px;
  }
  .editor-content {
    padding-top: 28px;
    padding-bottom: 30px;
  }
  .avatar-wrap canvas {
    height: 360px;
  }
}
@media (max-width: 1100px) {
  .setup {
    padding-inline: 3%;
  }
  .setup-header {
    height: 85px;
  }
  .field-copy {
    padding: 20px 10px 20px 22px;
  }
  .field-copy strong {
    font-size: 2rem;
  }
  .field-options {
    gap: 18px;
  }
  .editor-content {
    grid-template-columns: 31% 69%;
    padding: 16px 16px 16px 4px;
  }
  .avatar-wrap canvas {
    height: 275px;
  }
  .avatar-label {
    display: none;
  }
  .swatches {
    gap: 7px;
  }
  .swatch {
    width: 27px;
    height: 27px;
  }
  .eyes .swatch {
    width: 21px;
    height: 21px;
  }
  .scoreboard {
    gap: 15px;
    padding-inline: 12px;
  }
  .score-team {
    min-width: 110px;
    gap: 13px;
  }
  .panel-controls {
    padding-inline: 10px;
  }
  .pitch-buttons button {
    font-size: 0.7rem;
    padding-inline: 5px;
  }
  .chosen-field {
    display: none;
  }
  .panel-heading {
    padding-inline: 12px;
  }
}
@media (max-width: 760px) {
  .setup-header nav {
    display: none;
  }
  .setup-header {
    height: 75px;
  }
  .brand {
    font-size: 1.1rem;
  }
  .brand-ball {
    font-size: 26px;
  }
  .setup-intro {
    margin-top: 10px;
  }
  .setup-intro h1 {
    font-size: 2.4rem;
  }
  .field-options {
    grid-template-columns: 1fr;
    max-height: none;
    gap: 18px;
  }
  .field-card {
    min-height: 280px;
    grid-template-columns: 45% 55%;
    max-height: 340px;
  }
  .field-card img {
    max-height: 305px;
  }
  .field-copy {
    padding: 15px 20px;
  }
  .field-copy strong {
    font-size: 2rem;
  }
  .field-tag {
    margin-bottom: 12px;
  }
  .field-copy > span:not(.field-tag):not(.field-check) {
    font-size: 0.88rem;
  }
  .field-check {
    margin-top: 18px;
  }
  .setup-footer {
    flex-wrap: wrap;
    padding-block: 25px;
  }
  .setup-footer > span {
    font-size: 0.77rem;
  }
  .primary {
    padding: 14px 22px;
  }
  .player-editors {
    grid-template-columns: 1fr;
  }
  .editor-content {
    grid-template-columns: 35% 65%;
    padding: 18px;
  }
  .avatar-wrap canvas {
    height: 290px;
  }
  .swatches {
    gap: 10px;
  }
  .eyes .swatch {
    width: 25px;
    height: 25px;
  }
  .scoreboard {
    gap: 7px;
    padding: 7px;
  }
  .score-team {
    min-width: 0;
    font-size: 0.75rem;
    gap: 7px;
  }
  .score-team strong {
    font-size: 1.6rem;
  }
  .inning-block {
    min-width: 110px;
    padding: 0 9px;
  }
  .inning-block strong {
    font-size: 0.7rem;
  }
  .inning-block > span {
    font-size: 0.64rem;
  }
  .icon-button {
    width: 29px;
    height: 32px;
  }
  .fullscreen {
    display: none;
  }
  .panel-heading {
    padding: 5px 8px;
    font-size: 0.67rem;
    gap: 5px;
  }
  .panel-heading > strong {
    font-size: 0.65rem;
    letter-spacing: 0;
  }
  .panel-heading .key-tag {
    display: none;
  }
  .play-panels {
    gap: 4px;
  }
  .player-panel {
    grid-template-rows: 36px minmax(0, 1fr) 140px;
  }
  .panel-controls {
    padding: 8px;
  }
  .pitch-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .pitch-buttons button {
    padding: 8px 4px;
    font-size: 0.66rem;
  }
  .panel-controls > p {
    font-size: 0.63rem;
  }
  .action-row {
    flex-direction: column;
    gap: 11px;
  }
  .swing-feedback,
  .chase-feedback {
    width: 100%;
    padding: 6px 8px;
    font-size: 0.875rem;
  }
  .action-button {
    padding: 10px;
    width: 100%;
    font-size: 0.75rem;
  }
  .run-buttons {
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
  }
  .run-buttons button {
    font-size: 0.68rem;
    padding: 9px 7px;
  }
  .run-buttons span {
    order: -1;
    width: 100%;
    font-size: 0.7rem;
  }
  .scene-message {
    font-size: 0.7rem;
    white-space: normal;
    width: 90%;
    text-align: center;
    padding: 9px;
  }
  .game-status {
    flex-direction: column;
    gap: 3px;
  }
  .game-status strong {
    font-size: 0.85rem;
  }
  .game-status span {
    font-size: 0.65rem;
  }
  .result-control {
    flex-direction: column;
    gap: 8px;
    font-size: 0.75rem;
  }
  .help-grid {
    grid-template-columns: 1fr;
  }
  .game-dialog {
    padding: 25px;
    max-height: 90dvh;
    overflow: auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
/* Keep regular controls readable in the desktop app's narrower preview pane. */
.editor-fields label,
.editor-fields legend,
.character-type button,
.save-player {
  font-size: 0.875rem;
}
.panel-heading,
.panel-heading > strong,
.pitch-buttons button,
.run-buttons button,
.run-buttons span,
.action-button,
.result-control button {
  font-size: 0.875rem;
}
.inning-block strong,
.inning-block > span,
.action-button kbd,
.key-tag {
  font-size: 0.875rem;
}
.score-team {
  max-width: 230px;
}
.score-team > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 1050px) and (min-width: 761px) {
  .player-editors {
    grid-template-columns: 1fr;
    max-width: 740px;
    width: 100%;
    margin-inline: auto;
  }
  .editor-content {
    grid-template-columns: 40% 60%;
    padding: 24px;
  }
  .avatar-wrap canvas {
    height: 360px;
  }
  .editor-fields {
    padding-left: 20px;
  }
  .swatches {
    gap: 12px;
  }
  .swatch {
    width: 34px;
    height: 34px;
  }
  .eyes .swatch {
    width: 26px;
    height: 26px;
  }
}
@media (max-width: 760px) {
  .panel-heading > span:first-child {
    max-width: 48%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .panel-heading,
  .panel-heading > strong {
    font-size: 0.75rem;
  }
  .pitch-buttons button,
  .run-buttons button {
    font-size: 0.75rem;
  }
  .inning-block > span {
    font-size: 0.75rem;
  }
}
