* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  min-height: 100vh;
}

.game-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

h1 {
  font-size: clamp(1.5rem, 5vw, 2.3rem);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.back-button {
  padding: 0.55rem 1rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform 0.2s ease;
}

.mute-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
}

.match-goal {
  text-align: center;
  margin-bottom: 0.85rem;
}

.modes {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.mode-btn {
  min-height: 3.25rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: clamp(1rem, 3.5vw, 1.2rem);
  padding: 0.55rem 0.4rem;
}

.mode-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

.mode-hint {
  text-align: center;
  margin-bottom: 1rem;
  min-height: 1.4em;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.score-pill {
  background: #1e1e1e;
  border: 3px solid #1d4ed8;
  border-radius: 16px;
  padding: 0.7rem 0.4rem;
  text-align: center;
  box-shadow: 0 4px 0 #1e3a8a;
}

.score-label {
  display: block;
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.score-num {
  display: block;
  font-size: clamp(1.8rem, 6vw, 2.4rem);
  line-height: 1.1;
}

.arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(180deg, #1e1e1e 0%, #172554 100%);
  border-radius: 20px;
  padding: 1.25rem 0.75rem 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
  margin-bottom: 1rem;
}

.fighter {
  text-align: center;
  min-width: 0;
}

.fighter-name {
  margin-bottom: 0.35rem;
}

.hand {
  font-size: clamp(4rem, 14vw, 6.5rem);
  line-height: 1;
  min-height: 1.15em;
  filter: drop-shadow(0 8px 0 rgba(30, 58, 138, 0.55));
}

.hand.idle {
  animation: ready-bounce 1.4s ease-in-out infinite;
}

.hand.shake {
  animation: shake 0.12s linear infinite;
}

.hand.win {
  animation: pop 0.45s ease;
  filter: drop-shadow(0 0 16px rgba(96, 165, 250, 0.9));
}

.hand.lose {
  opacity: 0.45;
  transform: scale(0.9);
}

.hand-label {
  margin-top: 0.35rem;
  min-height: 1.4em;
}

.vs {
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  letter-spacing: 0.08em;
}

.result {
  text-align: center;
  min-height: 2.8em;
  margin-bottom: 1rem;
  font-size: clamp(1.05rem, 3.5vw, 1.35rem);
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.choice-btn {
  min-height: 6.5rem;
  border-radius: 18px;
  cursor: pointer;
  font-size: clamp(0.95rem, 3vw, 1.15rem);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.6rem 0.3rem;
}

.choice-btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

body.lex-games-brand .choice-btn .choice-emoji {
  color: inherit;
  -webkit-text-stroke: 0;
  filter: none;
  font-size: clamp(2.2rem, 8vw, 3rem);
  line-height: 1;
}

.rules {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  text-align: center;
}

.rules li {
  background: rgba(30, 58, 138, 0.45);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
}

.match-over {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 5;
}

.match-card {
  width: min(100%, 22rem);
  background: #12182a;
  border: 3px solid #1d4ed8;
  border-radius: 24px;
  padding: 1.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

.match-over[hidden] {
  display: none;
}

.match-title {
  text-align: center;
  font-size: clamp(1.45rem, 5vw, 2rem);
  max-width: 14em;
}

#play-again {
  min-height: 3.25rem;
  padding: 0.7rem 1.6rem;
  border-radius: 999px;
  font-size: 1.2rem;
  cursor: pointer;
}

@keyframes ready-bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes shake {
  0% {
    transform: rotate(-8deg);
  }
  100% {
    transform: rotate(8deg);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.7);
  }
  60% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .hand.idle,
  .hand.shake,
  .hand.win {
    animation: none;
  }
}
