:root {
  --bg: #e9f4ff;
  --card: rgba(255, 255, 255, 0.95);
  --primary: #4d88ff;
  --text: #14213d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", system-ui, sans-serif;
  background: linear-gradient(135deg, #f0f8ff 0%, #daeaff 50%, #d7ecff 100%);
  color: var(--text);
  display: flex;
  justify-content: center;
  padding: 1.5rem;
}

.container {
  width: min(100%, 980px);
  min-height: 100vh;
  background: var(--card);
  border: 1px solid rgba(77, 136, 255, 0.18);
  border-radius: 28px;
  box-shadow: 0 30px 80px rgba(20, 33, 61, 0.12);
  overflow: auto;
  position: relative;
  animation: dropIn 700ms cubic-bezier(.2,.9,.2,1) forwards;
}

header {
  padding: 2.2rem 2rem 1.8rem;
  background: radial-gradient(circle at top left, rgba(77, 136, 255, 0.25), transparent 40%),
              radial-gradient(circle at bottom right, rgba(110, 180, 255, 0.3), transparent 35%);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(77, 136, 255, 0.12);
  color: #1c3c85;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.6rem 1rem;
  border-radius: 999px;
  animation: pulse 3s ease-in-out infinite;
}

.hero {
  margin-top: 1.8rem;
}

.hero h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
  line-height: 1.02;
  margin-bottom: 0.8rem;
}

.hero p {
  max-width: 64ch;
  font-size: 1.05rem;
  line-height: 1.8;
  color: #2a3a5d;
}

.roles {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  margin: 1.8rem 0;
}

.role {
  background: linear-gradient(135deg, rgba(77, 136, 255, 0.18), rgba(158, 197, 254, 0.35));
  padding: 1rem 1.2rem;
  border-radius: 18px;
  border: 1px solid rgba(77, 136, 255, 0.15);
  font-weight: 600;
  color: #1f3c7d;
  box-shadow: 0 12px 24px rgba(77, 136, 255, 0.08);
  transition: transform 0.3s ease;
}

.role:hover {
  transform: translateY(-4px);
}

.music-card,
.rps-card {
  display: grid;
  gap: 1rem;
  padding: 1.8rem 2rem 2rem;
  border-top: 1px solid rgba(77, 136, 255, 0.12);
  background: rgba(255, 255, 255, 0.82);
}

.rps-card {
  background: linear-gradient(180deg, rgba(250,252,255,0.6), rgba(245,249,255,0.8));
  border-top-color: rgba(77, 136, 255, 0.06);
}

.rps-board {
  display:flex;
  gap:1rem;
  align-items:center;
  flex-wrap:wrap;
}

.rps-card .choices {
  display:flex;
  gap:0.6rem;
  flex-wrap:wrap;
}

.rps-card .choices button {
  background: linear-gradient(180deg,#ffffff,#e8f3ff);
  border: 1px solid rgba(77,136,255,0.14);
  padding: 0.7rem 1rem;
  border-radius: 12px;
  font-weight:700;
  cursor:pointer;
  transition: transform .14s ease, box-shadow .14s ease;
  box-shadow: 0 8px 18px rgba(77,136,255,0.06);
}

.rps-card .choices button:active {
  transform: translateY(4px) scale(.99);
}

.rps-result {
  min-width:220px;
  color:#25406f;
}

.rps-result .outcome {
  margin-top:0.4rem;
  font-weight:800;
  font-size:1.02rem;
}

.rps-result .score {
  margin-top:0.2rem;
  color:#355b9a;
  font-weight:700;
}

.audio-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: #f7fbff;
  border: 1px solid rgba(77, 136, 255, 0.14);
  padding: 1.2rem;
  border-radius: 18px;
}

audio {
  width: 100%;
  outline: none;
  display: block;
}

.note {
  color: #5570a9;
  font-size: 0.92rem;
}

#particles {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 60;
}

.star {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #fff, #ffd27a 60%, transparent 70%);
  box-shadow: 0 6px 14px rgba(77,136,255,0.12);
  opacity: 1;
  transform: translate(0,0) rotate(0deg);
  animation: starMove var(--duration, 1000ms) cubic-bezier(.15,.9,.3,1) forwards;
  will-change: transform, opacity;
  mix-blend-mode: screen;
}

@keyframes starMove {
  to {
    transform: translate(var(--dx, 0px), var(--dy, 0px)) rotate(var(--rot, 0deg));
    opacity: 0;
    filter: blur(0.6px) brightness(1.2);
  }
}

.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 18, 40, 0.68);
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: rgba(255,255,255,0.95);
  border-radius: 20px;
  padding: 1.4rem 1.6rem;
  text-align: center;
  box-shadow: 0 20px 50px rgba(20, 33, 61, 0.2);
  max-width: 320px;
}

.overlay-card p {
  margin: 0 0 1rem;
  color: #14213d;
  line-height: 1.6;
}

.overlay-card button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1.2rem;
  font-weight: 700;
  cursor: pointer;
}

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-36px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

@media (max-width: 640px) {
  body {
    padding: 1rem;
  }

  .container {
    border-radius: 22px;
  }

  .rps-board {
    flex-direction: column;
  }
}
