html, body {
  margin: 0;
  overflow: hidden;
}

.stage {
  box-sizing: border-box;
  min-height: 100vh;
  display: grid;
  place-items: center;
  margin: 0;
  background: #ff4d1f;
  font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
  padding: clamp(8px, 4vw, 24px);
}

.ox {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  max-width: 400px;
  height: 100%;
  max-height: 100%;
}

.ox__bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.ox__title {
  margin: 0;
  font-weight: 800;
  font-size: clamp(11px, 2.8vw, 14px);
  color: #17141a;
}

.ox__score {
  margin: 0;
  font-weight: 700;
  font-size: clamp(10px, 2.6vw, 13px);
  color: #17141a;
}

.ox__scoreLabel {
  font-weight: 700;
}

.ox__scoreNum {
  font-weight: 800;
  font-size: clamp(12px, 3.2vw, 16px);
  color: #17141a;
}

.ox__scoreMax {
  font-weight: 700;
}

.ox__card {
  display: grid;
  place-items: center;
  min-height: clamp(44px, 16vw, 84px);
  padding: clamp(8px, 2vw, 16px);
  border-radius: 16px;
  background-color: #fff7e6;
}

.ox__q {
  grid-area: 1/1;
  margin: 0;
  text-align: center;
  font-weight: 700;
  font-size: clamp(11px, 3vw, 15px);
  line-height: 1.4;
  color: #17141a;
}

.ox__q--ghost {
  opacity: 0;
}

.ox__btns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ox__btn {
  height: clamp(40px, 13vw, 64px);
  padding: 0;
  border: 0;
  border-radius: 16px;
  background-color: #fff7e6;
  color: #17141a;
  font-weight: 800;
  font-size: clamp(20px, 7vw, 34px);
  line-height: 1;
  cursor: pointer;
  transition: background-color 220ms ease-out, color 220ms ease-out, transform 220ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ox__btn:focus-visible {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.ox__btn.is-hit {
  background-color: #0a4fe8;
  color: #fff7e6;
}

.ox__btn.is-miss {
  background-color: #c2361a;
  color: #fff7e6;
}

.ox__btn.is-hint {
  box-shadow: inset 0 0 0 4px #0a4fe8;
}

.ox__dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: oxStep;
}

.ox__dot {
  counter-increment: oxStep;
  display: grid;
  place-items: center;
  width: clamp(16px, 5vw, 22px);
  aspect-ratio: 1;
  border-radius: 50%;
  background-color: #fff7e6;
  color: #17141a;
  font-weight: 700;
  font-size: clamp(8px, 2.2vw, 10px);
  line-height: 1;
}

.ox__dot::before {
  content: counter(oxStep);
}

.ox__dot.is-now {
  outline: 2px solid #17141a;
  outline-offset: 2px;
}

.ox__dot.is-hit {
  background-color: #0a4fe8;
  color: #fff7e6;
}

.ox__dot.is-miss {
  background-color: #c2361a;
  color: #fff7e6;
}

.ox__msg {
  margin: 0;
  min-height: clamp(12px, 4vw, 16px);
  text-align: center;
  font-weight: 700;
  font-size: clamp(9px, 2.4vw, 12px);
  line-height: 1.3;
  color: #17141a;
}

.ox.is-demo .ox__btn {
  animation-duration: 2s, 2s;
  animation-iteration-count: infinite, infinite;
  animation-fill-mode: backwards, backwards;
}

.ox.is-demo .ox__btn--x {
  animation-name: oxPopX, oxTintX;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1), steps(1, end);
}

.ox.is-demo .ox__btn--o {
  animation-name: oxPopO, oxTintO;
  animation-timing-function: cubic-bezier(0.2, 1.4, 0.4, 1), steps(1, end);
}

.ox.is-demo .ox__q {
  animation-name: oxCardA;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ox.is-demo .ox__q--ghost {
  animation-name: oxCardB;
}

.ox.is-demo .ox__dot:nth-child(1) {
  animation-name: oxDot1;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

.ox.is-demo .ox__dot:nth-child(2) {
  animation-name: oxDot2;
  animation-duration: 2s;
  animation-timing-function: steps(1, end);
  animation-iteration-count: infinite;
}

@keyframes oxPopX {
  0%, 8% {
    transform: scale(1);
  }
  14% {
    transform: scale(1.07);
  }
  30% {
    transform: scale(1.07);
  }
  38%, 58% {
    transform: scale(1);
  }
  64% {
    transform: scale(1.07);
  }
  80% {
    transform: scale(1.07);
  }
  88%, 100% {
    transform: scale(1);
  }
}
@keyframes oxTintX {
  0% {
    background-color: #fff7e6;
    color: #17141a;
  }
  12% {
    background-color: #0a4fe8;
    color: #fff7e6;
  }
  36% {
    background-color: #fff7e6;
    color: #17141a;
  }
  62% {
    background-color: #c2361a;
    color: #fff7e6;
  }
  86% {
    background-color: #fff7e6;
    color: #17141a;
  }
  100% {
    background-color: #fff7e6;
    color: #17141a;
  }
}
@keyframes oxPopO {
  0%, 60% {
    transform: scale(1);
  }
  68% {
    transform: scale(1.04);
  }
  82% {
    transform: scale(1.04);
  }
  88%, 100% {
    transform: scale(1);
  }
}
@keyframes oxTintO {
  0% {
    box-shadow: inset 0 0 0 0 #0a4fe8;
  }
  62% {
    box-shadow: inset 0 0 0 4px #0a4fe8;
  }
  86% {
    box-shadow: inset 0 0 0 0 #0a4fe8;
  }
  100% {
    box-shadow: inset 0 0 0 0 #0a4fe8;
  }
}
@keyframes oxCardA {
  0% {
    opacity: 1;
  }
  46% {
    opacity: 0;
  }
  88% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}
@keyframes oxCardB {
  0% {
    opacity: 0;
  }
  46% {
    opacity: 1;
  }
  88% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes oxDot1 {
  0% {
    background-color: #fff7e6;
    color: #17141a;
  }
  12% {
    background-color: #0a4fe8;
    color: #fff7e6;
  }
  86% {
    background-color: #0a4fe8;
    color: #fff7e6;
  }
  88% {
    background-color: #fff7e6;
    color: #17141a;
  }
  100% {
    background-color: #fff7e6;
    color: #17141a;
  }
}
@keyframes oxDot2 {
  0% {
    background-color: #fff7e6;
    color: #17141a;
  }
  62% {
    background-color: #c2361a;
    color: #fff7e6;
  }
  86% {
    background-color: #c2361a;
    color: #fff7e6;
  }
  88% {
    background-color: #fff7e6;
    color: #17141a;
  }
  100% {
    background-color: #fff7e6;
    color: #17141a;
  }
}
@media (max-width: 340px) {
  .ox {
    gap: 4px;
  }
  .ox__btns {
    gap: 8px;
  }
  .ox__dots {
    gap: 4px;
  }
  .ox__card {
    padding: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ox__btn {
    transition: none !important;
  }
  .ox.is-demo .ox__btn,
  .ox.is-demo .ox__q,
  .ox.is-demo .ox__dot {
    animation: none !important;
  }
  .ox.is-demo .ox__q--ghost {
    opacity: 0 !important;
  }
}
