:root {
  --bg: #12082a;
  --ink: #fff8ff;
  --you: #39ff88;
  --cpu: #ff4fd8;
  --gold: #ffe566;
  --cyan: #3cf0ff;
  --paper: #7aa8ff;
}

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

html,
body {
  min-height: 100%;
}

body {
  font-family: Nunito, system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 10%, #3b1578 0%, transparent 42%),
    radial-gradient(circle at 90% 80%, #1a3cff 0%, transparent 40%),
    var(--bg);
  overflow-x: hidden;
}

.bg-blobs {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.55;
  animation: float 9s ease-in-out infinite;
}

.blob-a {
  width: 280px;
  height: 280px;
  left: -60px;
  top: 80px;
  background: #ff4fd8;
}

.blob-b {
  width: 320px;
  height: 320px;
  right: -80px;
  top: 20%;
  background: #3cf0ff;
  animation-delay: -3s;
}

.blob-c {
  width: 240px;
  height: 240px;
  left: 40%;
  bottom: -40px;
  background: #39ff88;
  animation-delay: -6s;
}

.app {
 position: relative;
 z-index: 1;
 max-width: 820px;
 margin: 0 auto;
 padding: 32px 20px 48px;
}

.hub-link {
 display: inline-block;
 margin-bottom: 18px;
 color: #fff8ff;
 text-decoration: none;
 font-weight: 800;
 opacity: 0.85;
}

.hub-link:hover {
 opacity: 1;
 text-decoration: underline;
}

.hero {
  text-align: center;
  margin-bottom: 28px;
}

.eyebrow {
  display: inline-block;
  background: var(--gold);
  color: #2a1200;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
  padding: 6px 12px;
  border-radius: 999px;
  animation: pop-in 0.5s cubic-bezier(0.2, 1.4, 0.3, 1);
}

h1 {
  font-family: Bungee, sans-serif;
  font-size: clamp(2.4rem, 8vw, 4.4rem);
  line-height: 1.05;
  margin: 12px 0 8px;
  background: linear-gradient(90deg, #39ff88, #3cf0ff, #ff4fd8, #ffe566);
  background-size: 280% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shine 6s linear infinite;
  text-shadow: none;
}

.subtitle {
  font-size: 1.05rem;
  opacity: 0.9;
}

.scoreboard {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 28px;
}

.score-card,
.round-card {
  border-radius: 22px;
  padding: 16px 14px;
  text-align: center;
  box-shadow: 0 12px 0 rgba(0, 0, 0, 0.25);
}

.score-card.you {
  background: linear-gradient(180deg, #6dffb0, #12d46a);
  color: #063018;
}

.score-card.cpu {
  background: linear-gradient(180deg, #ff8aea, #ff3cc8);
  color: #3a0530;
}

.round-card {
  background: linear-gradient(180deg, #fff1a8, #ffd23c);
  color: #3a2700;
  min-width: 120px;
  display: grid;
  place-content: center;
}

.score-label {
  display: block;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
}

.score-value,
.round-card strong {
  font-family: Bungee, sans-serif;
  font-size: 2.2rem;
  display: block;
  margin-top: 4px;
}

.score-value.pop {
  animation: score-pop 0.45s cubic-bezier(0.2, 1.6, 0.3, 1);
}

.arena {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.fighter {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.fighter-name {
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.8rem;
}

.move-orb {
  width: min(38vw, 180px);
  height: min(38vw, 180px);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: clamp(3rem, 10vw, 5rem);
  background: rgba(255, 255, 255, 0.12);
  border: 6px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.08);
  transition: transform 0.25s ease, background 0.25s ease;
}

.move-orb.idle {
  animation: bob 1.6s ease-in-out infinite;
}

.move-orb.thinking {
  animation: shake 0.35s linear infinite;
}

.move-orb.reveal {
  animation: slam 0.45s cubic-bezier(0.2, 1.6, 0.3, 1);
}

.move-orb.win {
  background: rgba(57, 255, 136, 0.28);
  border-color: var(--you);
  box-shadow: 0 0 40px rgba(57, 255, 136, 0.55);
}

.move-orb.lose {
  background: rgba(255, 79, 216, 0.2);
  border-color: var(--cpu);
}

.move-orb.draw {
  background: rgba(255, 229, 102, 0.22);
  border-color: var(--gold);
}

.vs-burst {
  font-family: Bungee, sans-serif;
  font-size: 1.6rem;
  color: var(--gold);
  animation: pulse 1.4s ease-in-out infinite;
}

.status {
  text-align: center;
  min-height: 2.4em;
  font-size: 1.2rem;
  font-weight: 800;
  margin-bottom: 22px;
}

.status.win {
  color: var(--you);
}

.status.lose {
  color: #ff9ae6;
}

.status.draw {
  color: var(--gold);
}

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

.choice {
  appearance: none;
  border: 0;
  cursor: pointer;
  border-radius: 24px;
  padding: 18px 10px;
  font: inherit;
  font-weight: 900;
  color: #14081f;
  background: #fff;
  box-shadow: 0 8px 0 #c9c0ff;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.choice:nth-child(1) {
  background: linear-gradient(180deg, #ffe566, #ffb347);
}

.choice:nth-child(2) {
  background: linear-gradient(180deg, #9ed0ff, #4f8cff);
}

.choice:nth-child(3) {
  background: linear-gradient(180deg, #c4ff8a, #39ff88);
}

.choice:hover:not(:disabled) {
  transform: translateY(-6px) scale(1.04);
  filter: saturate(1.2);
}

.choice:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #c9c0ff;
}

.choice:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.choice-icon {
  display: block;
  font-size: 2.4rem;
  margin-bottom: 6px;
  animation: wiggle 2.4s ease-in-out infinite;
}

.choice:nth-child(2) .choice-icon {
  animation-delay: 0.2s;
}

.choice:nth-child(3) .choice-icon {
  animation-delay: 0.4s;
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  background: rgba(8, 2, 24, 0.72);
  display: grid;
  place-items: center;
  padding: 20px;
  backdrop-filter: blur(8px);
}

.overlay.hidden {
  display: none;
}

.modal {
  width: min(92vw, 420px);
  text-align: center;
  background: linear-gradient(180deg, #2c0f66, #14082f);
  border: 4px solid #fff;
  border-radius: 32px;
  padding: 32px 24px;
  box-shadow: 0 20px 0 #ff4fd8, 0 0 80px rgba(60, 240, 255, 0.4);
  animation: slam 0.5s cubic-bezier(0.2, 1.5, 0.3, 1);
}

.modal-kicker {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 900;
  color: var(--cyan);
}

.modal h2 {
  font-family: Bungee, sans-serif;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  margin: 10px 0 8px;
}

.modal-score {
  font-size: 1.4rem;
  font-weight: 900;
  margin-bottom: 22px;
}

#restart-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  font-size: 1.1rem;
  color: #16081f;
  background: linear-gradient(90deg, #39ff88, #3cf0ff);
  padding: 14px 28px;
  border-radius: 999px;
  box-shadow: 0 8px 0 #0ea8b8;
}

#restart-btn:hover {
  transform: translateY(-2px);
}

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 6;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-30px) scale(1.08);
  }
}

@keyframes shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 280% 50%;
  }
}

@keyframes bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: rotate(-8deg) scale(1.02);
  }
  50% {
    transform: rotate(8deg) scale(0.96);
  }
}

@keyframes slam {
  0% {
    transform: scale(0.4) rotate(-12deg);
    opacity: 0;
  }
  100% {
    transform: scale(1) rotate(0);
    opacity: 1;
  }
}

@keyframes pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.18);
  }
}

@keyframes score-pop {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.35);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes pop-in {
  from {
    transform: translateY(-12px) scale(0.8);
    opacity: 0;
  }
}

@keyframes wiggle {
  0%,
  100% {
    transform: rotate(0);
  }
  30% {
    transform: rotate(-10deg);
  }
  60% {
    transform: rotate(10deg);
  }
}

@media (max-width: 560px) {
  .scoreboard {
    grid-template-columns: 1fr 1fr;
  }

  .round-card {
    grid-column: 1 / -1;
  }
}
