:root {
  color-scheme: light;
  font-family: Arial, "Noto Sans KR", sans-serif;
  --ink: #202020;
}
* { box-sizing: border-box; }
body {
  min-width: 440px;
  min-height: 300px;
  margin: 0;
  overflow: hidden;
  background: transparent;
  color: var(--ink);
}
.game {
  position: fixed;
  z-index: 20;
  bottom: 14px;
  left: 14px;
  width: 306px;
  height: 154px;
  overflow: visible;
  user-select: none;
  outline: none;
}
.game header {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  height: 30px;
  padding: 0 3px;
  border-bottom: 2px solid var(--ink);
  font-size: 8px;
}
.board {
  display: flex;
  gap: 7px;
}
.field {
  position: relative;
  height: 124px;
  overflow: visible;
  cursor: crosshair;
}
.message {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  width: max-content;
  transform: translate(-50%, -50%);
  font-size: 11px;
  font-weight: 700;
}
.game.is-started .message { display: none; }
.game:not(.is-started) {
  overflow: hidden;
  border: 2px solid var(--ink);
}
.game:not(.is-started) header { display: none; }
.game:not(.is-started) .field {
  height: 100%;
  cursor: pointer;
}
.game:not(.is-started) .player,
.game:not(.is-started) .plate { display: none; }
.hit-distance {
  position: absolute;
  z-index: 12;
  left: 42px;
  bottom: 78px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
}
.hit-distance.is-visible {
  animation: hit-distance-pop 1.3s ease-out forwards;
}
@keyframes hit-distance-pop {
  0% { transform: translateY(5px) scale(.85); opacity: 0; }
  18% { transform: translateY(0) scale(1); opacity: 1; }
  72% { transform: translateY(-3px) scale(1); opacity: 1; }
  100% { transform: translateY(-10px) scale(.96); opacity: 0; }
}

.player {
  position: absolute;
  z-index: 3;
  bottom: 4px;
  width: 38px;
  height: 72px;
  color: var(--ink);
}
.batter { left: 5px; }
.pitcher { right: 2px; }
.player svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}
.pose {
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pose circle {
  fill: currentColor;
  stroke: none;
}
.pose-two { display: none; }
.player.frame-two .pose-one { display: none; }
.player.frame-two .pose-two { display: inline; }
.bat-shape { stroke-width: 6; }
.flight-ball,
.trail-ball {
  border-radius: 50%;
  background: var(--ink);
}
.ball {
  position: absolute;
  z-index: 7;
  display: none;
  left: 260px;
  top: 66px;
  width: 12px;
  height: 12px;
  overflow: visible;
  background: transparent;
  shape-rendering: geometricPrecision;
  opacity: 1;
  filter: none;
  will-change: left, top;
}
.ball circle {
  fill: var(--ink);
}
.plate {
  position: absolute;
  left: 38px;
  bottom: 3px;
  width: 17px;
  height: 4px;
  border-radius: 4px;
  background: var(--ink);
}
.flight-ball {
  position: fixed;
  z-index: 9999;
  width: 10px;
  height: 10px;
  pointer-events: none;
}
.trail-ball {
  position: fixed;
  z-index: 9998;
  width: 6px;
  height: 6px;
  opacity: 0;
  pointer-events: none;
}

.record-flag {
  position: fixed;
  z-index: 9997;
  width: 3px;
  height: 34px;
  pointer-events: none;
  background: var(--ink);
  transform: translate(-1px, -31px);
}
.record-flag::before {
  position: absolute;
  top: 0;
  left: 3px;
  width: 18px;
  height: 12px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 25%, 70% 100%, 0 80%);
  content: "";
}
.record-flag::after {
  position: absolute;
  bottom: -2px;
  left: -4px;
  width: 11px;
  height: 4px;
  border-radius: 50%;
  background: var(--ink);
  content: "";
}
