:root {
  color-scheme: light;
  font-family: "JiangchengYuanti", "Hiragino Sans", "Yu Gothic", "Noto Sans CJK JP", "Noto Sans SC", system-ui, sans-serif;
  color: #101010;
  background: #0e1715;
}

@font-face {
  font-family: "JiangchengYuanti";
  src: url("./assets/fonts/jiangcheng-yuanti-game.woff") format("woff");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #102117;
}

button {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

.app {
  width: min(100vw, 768px);
  height: 100vh;
  min-height: 620px;
  display: grid;
  place-items: center;
}

.game-shell,
.stage {
  width: min(100vw, 768px);
  height: min(100vh, 1024px);
  max-height: 100vh;
}

.stage {
  position: relative;
  overflow: hidden;
  background: #6ebf31;
  isolation: isolate;
  user-select: none;
}

.field {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.hud {
  position: absolute;
  left: 3.5%;
  top: 1.2%;
  z-index: 10;
  width: min(36%, 210px);
  min-height: 34px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 6px;
  color: #fff;
}

.hud > div {
  min-width: 0;
  height: 34px;
  padding: 2px 7px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  background: rgba(6, 18, 19, .64);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .2), 0 4px 10px rgba(0, 0, 0, .18);
}

.hud-label {
  font-size: clamp(11px, 2.6vw, 14px);
  font-weight: 900;
}

.hud strong {
  font-size: clamp(18px, 4vw, 24px);
  line-height: 1;
}

.icon-button {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #0c0c0c;
  background: #ffe600;
  font-size: 23px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 5px 0 #a89400, 0 10px 14px rgba(0, 0, 0, .22);
}

.top-actions {
  position: absolute;
  right: 3.5%;
  top: 1.2%;
  z-index: 10;
  display: flex;
  gap: 8px;
}

.music-button.is-muted {
  color: rgba(255, 255, 255, .92);
  background: rgba(8, 20, 22, .72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), 0 4px 10px rgba(0, 0, 0, .18);
}

.audio-prompt {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 16, 16, .46);
  backdrop-filter: blur(4px);
}

.audio-prompt.is-hidden {
  display: none;
}

.audio-panel {
  width: min(82%, 380px);
  padding: 24px 20px 20px;
  border-radius: 12px;
  color: #101010;
  background: rgba(255, 255, 255, .96);
  text-align: center;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .32);
}

.audio-panel h1 {
  margin: 0 0 22px;
  font-size: clamp(28px, 7vw, 40px);
  line-height: 1.15;
  font-weight: 950;
}

.audio-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  font-size: clamp(20px, 5vw, 28px);
  font-weight: 950;
  cursor: pointer;
}

.primary-action {
  color: #101010;
  background: #ffe600;
  box-shadow: 0 4px 0 #a89400;
}

.secondary-action {
  color: #fff;
  background: #172a2d;
  box-shadow: 0 4px 0 #071111;
}

.target-card {
  position: absolute;
  left: 50%;
  top: 7.6%;
  z-index: 4;
  width: 30%;
  height: 11.6%;
  transform: translateX(-50%);
  display: grid;
  place-items: center;
  align-content: center;
  padding: 4px 8px 7px;
  border-radius: 8px;
  background: #fff;
  color: #050505;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .08);
}

.romaji {
  font-family: "JiangchengYuanti", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: clamp(26px, 6.2vw, 46px);
  line-height: .9;
  font-weight: 950;
  letter-spacing: 0;
}

.katakana {
  font-family: "JiangchengYuanti", "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: clamp(38px, 9vw, 68px);
  line-height: .86;
  font-weight: 950;
}

.balls {
  position: absolute;
  left: 10.5%;
  right: 10.5%;
  top: 46.2%;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: auto;
}

.answer-ball,
.kick-ball {
  position: relative;
  width: clamp(118px, 30vw, 178px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 8px 7px rgba(0, 0, 0, .26));
}

.answer-ball {
  display: grid;
  place-items: center;
  padding: 0;
  transition: transform .16s ease, filter .16s ease, opacity .18s ease;
}

.answer-ball:hover {
  transform: translateY(-5px) scale(1.04);
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, .26));
}

.answer-ball:focus-visible,
.next-button:focus-visible,
.icon-button:focus-visible {
  outline: 4px solid #00a3ff;
  outline-offset: 3px;
}

.ball-skin,
.kick-ball img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.answer-ball span,
.kick-ball span {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58%;
  height: 58%;
  border-radius: 50%;
  color: #050505;
  background: rgba(255, 255, 255, .74);
  font-size: clamp(46px, 12vw, 76px);
  font-weight: 950;
  line-height: 1;
}

.answer-ball.is-wrong {
  animation: wrongShake .36s ease;
}

.answer-ball.is-right {
  animation: rightPop .38s ease;
}

.player {
  position: absolute;
  left: 50%;
  z-index: 5;
  opacity: 0;
  width: 31%;
  height: auto;
  pointer-events: none;
  transform-origin: 50% 100%;
  transition: opacity .15s ease, transform .2s ease;
}

.player-front {
  bottom: .3%;
  transform: translateX(-50%);
}

.player-back {
  bottom: -3.2%;
  width: 37%;
  transform: translateX(-50%);
}

.player.is-visible {
  opacity: 1;
}

.player-back.is-visible {
  animation: kickPose .52s ease both;
}

.kick-ball {
  position: absolute;
  left: 50%;
  top: 52%;
  z-index: 8;
  opacity: 0;
  transform: translate(-50%, -50%) scale(.9);
  cursor: default;
  pointer-events: none;
}

.kick-ball span {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.kick-ball.is-kicked {
  animation: shootBall .62s cubic-bezier(.2, .72, .18, 1) forwards;
}

.feedback {
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: 11;
  min-width: 42%;
  min-height: 42px;
  padding: 7px 16px;
  border-radius: 8px;
  transform: translate(-50%, -50%) scale(.92);
  display: grid;
  place-items: center;
  text-align: center;
  color: #fff;
  background: rgba(9, 20, 24, .78);
  font-size: clamp(22px, 6vw, 34px);
  font-weight: 950;
  opacity: 0;
  pointer-events: none;
}

.feedback.is-visible {
  animation: feedbackPop .92s ease both;
}

.next-button {
  position: absolute;
  left: 50%;
  bottom: 4%;
  z-index: 12;
  min-width: 118px;
  min-height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #101010;
  background: #ffe600;
  font-weight: 950;
  box-shadow: 0 5px 0 #a89400, 0 12px 20px rgba(0, 0, 0, .22);
  transform: translateX(-50%) translateY(90px);
  opacity: 0;
  cursor: pointer;
  transition: transform .2s ease, opacity .2s ease;
}

.next-button.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.stage.is-complete::after,
.stage.is-game-over::after {
  position: absolute;
  inset: 0;
  z-index: 9;
  display: grid;
  place-items: center;
  padding: 26% 10% 10%;
  text-align: center;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  font-size: clamp(28px, 8vw, 48px);
  font-weight: 950;
  line-height: 1.35;
  text-shadow: 0 3px 8px rgba(0, 0, 0, .35);
  white-space: pre;
}

.stage.is-complete::after {
  content: "全问进球！\A 片假名和平假名配对成功";
}

.stage.is-game-over::after {
  content: "机会用完\A 再来一轮吧";
}

@keyframes shootBall {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(.9) rotate(0deg);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, -246%) scale(.42) rotate(420deg);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -275%) scale(.34) rotate(560deg);
  }
}

@keyframes kickPose {
  0% { transform: translateX(-50%) rotate(0deg); }
  55% { transform: translateX(-50%) rotate(-3deg); }
  100% { transform: translateX(-50%) rotate(0deg); }
}

@keyframes wrongShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(9px); }
  75% { transform: translateX(-6px); }
}

@keyframes rightPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.86);
  }
  18%, 75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.96);
  }
}

@media (max-width: 420px), (max-height: 760px) {
  .hud {
    top: .8%;
    min-height: 34px;
    width: min(42%, 170px);
    grid-template-columns: 1fr 1fr;
    gap: 5px;
  }

  .hud > div,
  .icon-button {
    height: 32px;
  }

  .top-actions {
    top: .8%;
    right: 3%;
    gap: 6px;
  }

  .icon-button {
    width: 32px;
    font-size: 22px;
  }

  .target-card {
    top: 7.2%;
    width: 32%;
    height: 11.2%;
  }

  .balls {
    top: 45%;
  }

  .player {
    width: 33%;
  }

  .player-back {
    width: 39%;
  }
}
  font-family: "JiangchengYuanti", "Hiragino Sans", "Yu Gothic", sans-serif;
