:root {
  --bg-1: #07111c;
  --bg-2: #2c0735;
  --bg-3: #0f3d47;
  --text: #f6f0df;
  --muted: rgba(246, 240, 223, 0.78);
  --panel: rgba(7, 13, 24, 0.62);
  --border: rgba(255, 255, 255, 0.14);
  --orange: #ff6a00;
  --yellow: #ffe600;
  --cyan: #00e1ff;
  --green: #b7ff00;
  --pink: #ff4fcf;
}

* {
  box-sizing: border-box;
}

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

body {
  position: relative;
  overflow-x: hidden;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 79, 207, 0.3), transparent 30%),
    radial-gradient(circle at 78% 10%, rgba(0, 225, 255, 0.22), transparent 26%),
    radial-gradient(circle at 50% 75%, rgba(183, 255, 0, 0.16), transparent 28%),
    linear-gradient(140deg, var(--bg-1), var(--bg-2) 55%, var(--bg-3));
}

.background-grid {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at center, black 42%, transparent 90%);
  animation: drift 18s linear infinite;
  pointer-events: none;
}

.background-glow {
  position: fixed;
  width: 48vmax;
  height: 48vmax;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.3;
  pointer-events: none;
}

.glow-a {
  top: -8vmax;
  left: -8vmax;
  background: var(--pink);
  animation: floatGlow 12s ease-in-out infinite;
}

.glow-b {
  right: -10vmax;
  bottom: -8vmax;
  background: var(--cyan);
  animation: floatGlow 14s ease-in-out infinite reverse;
}

.page-shell {
  position: relative;
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.card {
  position: relative;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

.hero {
  padding: 2rem;
  min-height: 88vh;
  display: grid;
  align-content: center;
  gap: 1.2rem;
}

.eyebrow {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
}

h1,
h2 {
  margin: 0;
}

h1 {
  max-width: 10ch;
  font-family: "Bungee", cursive;
  font-size: clamp(3rem, 10vw, 6.4rem);
  line-height: 0.92;
  text-transform: uppercase;
  color: #fff2b5;
  text-shadow: 0 0 22px rgba(255, 106, 0, 0.2);
}

h2 {
  font-size: clamp(1.4rem, 2vw, 2rem);
}

.intro {
  max-width: 62ch;
  margin: 0;
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.micro-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  padding: 0.95rem 1.3rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.3);
}

.button-primary {
  color: #1b1200;
  background: linear-gradient(135deg, var(--orange), var(--yellow));
}

.button-secondary {
  color: #021920;
  background: linear-gradient(135deg, var(--cyan), #95fff2);
}

.button-accent {
  color: #240018;
  background: linear-gradient(135deg, var(--pink), #ffc8f5);
}

.button-dark {
  color: var(--text);
  background: linear-gradient(135deg, #101827, #283752);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.button-link {
  color: #07111c;
  background: linear-gradient(135deg, #f6f0df, #fff9b0);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.stat-card strong {
  display: block;
  font-size: 2rem;
  color: var(--green);
}

.ticker {
  margin: 1.3rem 0;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
}

.ticker-track {
  display: inline-block;
  padding: 0.9rem 0;
  white-space: nowrap;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  animation: ticker 18s linear infinite;
}

.content-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1rem;
}

.content-grid > .card {
  padding: 1.4rem;
}

.display-card {
  min-height: 340px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at center, rgba(255, 255, 255, 0.14), transparent 30%),
    linear-gradient(135deg, rgba(255, 106, 0, 0.24), rgba(0, 225, 255, 0.22));
}

.planet {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  opacity: 0.92;
}

.planet-a {
  width: 220px;
  height: 220px;
  background: rgba(255, 79, 207, 0.82);
  transform: translate(-120px, -30px);
  animation: bounce 6s ease-in-out infinite;
}

.planet-b {
  width: 180px;
  height: 180px;
  background: rgba(0, 225, 255, 0.8);
  transform: translate(110px, 52px);
  animation: bounce 5s ease-in-out infinite reverse;
}

.planet-c {
  width: 140px;
  height: 140px;
  background: rgba(183, 255, 0, 0.75);
  transform: translate(20px, -92px);
  animation: bounce 5.8s ease-in-out infinite;
}

.display-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.15rem;
  text-align: center;
  text-transform: uppercase;
  font-family: "Bungee", cursive;
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  line-height: 0.95;
  text-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.checklist {
  padding-left: 1.2rem;
  color: var(--muted);
}

.checklist li + li {
  margin-top: 0.55rem;
}

.meter-block {
  margin-top: 1.2rem;
}

.meter-block p {
  margin: 0.9rem 0 0.35rem;
}

.meter {
  height: 16px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.meter-fill {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--pink), var(--orange), var(--green), var(--cyan));
  background-size: 200% 100%;
  animation: shimmer 2.4s linear infinite;
  transition: width 320ms ease;
}

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

.control-card,
.soundboard-card,
.compliment-card,
.spinner-card,
.quote-card {
  min-height: 100%;
}

.control-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.control {
  display: grid;
  gap: 0.45rem;
}

.control input {
  width: 100%;
  accent-color: var(--green);
}

.soundboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 1rem;
}

.sound-duration-control {
  margin-top: 1rem;
}

.sound-pad {
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.2), rgba(0, 225, 255, 0.16));
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.sound-pad:hover {
  transform: scale(1.03) rotate(-1deg);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

.sound-status,
#complimentText,
#quoteText {
  color: var(--muted);
}

.spinner-wrap {
  display: grid;
  place-items: center;
  margin: 1rem 0;
}

.success-wheel {
  width: 210px;
  height: 210px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  border: 10px solid rgba(255, 255, 255, 0.1);
  background:
    conic-gradient(var(--orange), var(--yellow), var(--green), var(--cyan), var(--pink), var(--orange));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
  transition: transform 2.2s cubic-bezier(.2, .9, .2, 1);
}

.success-wheel span {
  position: absolute;
  font-family: "Bungee", cursive;
  font-size: 1rem;
  text-transform: uppercase;
}

.success-wheel span:nth-child(1) { transform: translateY(-76px); }
.success-wheel span:nth-child(2) { transform: translateX(72px); }
.success-wheel span:nth-child(3) { transform: translateY(76px); }
.success-wheel span:nth-child(4) { transform: translateX(-72px); }

.floating-orb {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 8;
  padding: 0.9rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(10, 16, 29, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.28);
  animation: floatBadge 3.2s ease-in-out infinite;
}

.toast-stack {
  position: fixed;
  left: 1rem;
  bottom: 1rem;
  z-index: 8;
  display: grid;
  gap: 0.7rem;
}

.toast {
  min-width: 220px;
  max-width: 320px;
  padding: 0.9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(11, 17, 29, 0.84);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
  animation: toastIn 240ms ease-out;
}

.cursor-trail {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
}

.laser-show,
.halo-ring {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 180ms ease;
}

.laser-show {
  z-index: 6;
  overflow: hidden;
}

.laser-show::before,
.laser-show::after {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    linear-gradient(115deg, transparent 44%, rgba(0, 225, 255, 0.95) 48%, transparent 52%),
    linear-gradient(65deg, transparent 44%, rgba(255, 79, 207, 0.9) 48%, transparent 52%),
    linear-gradient(145deg, transparent 44%, rgba(183, 255, 0, 0.85) 48%, transparent 52%);
  filter: blur(3px);
}

.laser-show::before {
  animation: laserSweep 700ms linear infinite;
}

.laser-show::after {
  animation: laserSweep 540ms linear infinite reverse;
}

.halo-ring {
  z-index: 5;
  display: grid;
  place-items: center;
}

.halo-ring::before {
  content: "";
  width: min(84vw, 700px);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 12px solid rgba(255, 230, 0, 0.18);
  box-shadow:
    0 0 0 12px rgba(255, 79, 207, 0.08),
    0 0 60px rgba(0, 225, 255, 0.28),
    inset 0 0 60px rgba(255, 106, 0, 0.22);
  animation: haloSpin 2s linear infinite;
}

.trail-dot {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.95), rgba(255,79,207,0.35));
  transform: translate(-50%, -50%);
  animation: fadeTrail 800ms linear forwards;
}

.disco-active body,
body.disco-active {
  animation: discoShift 1.6s linear infinite;
}

.hero.sparkle::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.18), transparent 16%),
    radial-gradient(circle at 74% 22%, rgba(255,255,255,0.18), transparent 14%),
    radial-gradient(circle at 56% 74%, rgba(255,255,255,0.12), transparent 12%);
  pointer-events: none;
}

body.flash-party::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.18);
  animation: flashParty 400ms ease-out;
}

.confetti-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  top: -10vh;
  width: 12px;
  height: 18px;
  border-radius: 4px;
  animation: fall linear forwards;
}

.chaos-mode {
  animation: pagePulse 700ms ease-out;
}

body.beat-mode .page-shell,
body.beat-mode .floating-orb {
  animation: beatThump 620ms ease-in-out infinite;
}

body.beat-mode .card {
  box-shadow: 0 0 0 rgba(255, 255, 255, 0), 0 24px 60px rgba(0, 0, 0, 0.28);
  animation: beatGlow 620ms ease-in-out infinite;
}

body.siren-mode {
  animation: sirenWash 1.2s linear infinite;
}

body.siren-mode .ticker-track {
  animation-duration: 8s;
}

body.laser-mode .laser-show,
body.siren-mode .halo-ring {
  opacity: 1;
}

body.laser-mode .planet {
  animation: jitterPlanet 180ms steps(2) infinite;
}

body.party-mode .cursor-trail .trail-dot {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle, rgba(255,255,255,1), rgba(0,225,255,0.55), rgba(255,79,207,0.25));
}

body.party-mode .success-wheel {
  animation: partySpin 1.8s linear infinite;
}

body.party-mode .background-glow {
  opacity: 0.5;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: #fff7c8;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(14px); }
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(24px, -12px) scale(1.08); }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes bounce {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(18px, -26px) scale(1.07); }
}

@keyframes shimmer {
  to { background-position: 200% 0; }
}

@keyframes fall {
  to {
    transform: translateY(120vh) rotate(720deg);
    opacity: 0.98;
  }
}

@keyframes pagePulse {
  0% { filter: hue-rotate(0deg); transform: scale(1); }
  50% { filter: hue-rotate(90deg); transform: scale(1.01); }
  100% { filter: hue-rotate(180deg); transform: scale(1); }
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeTrail {
  to {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.1);
  }
}

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

@keyframes discoShift {
  0% { filter: hue-rotate(0deg) saturate(1); }
  50% { filter: hue-rotate(120deg) saturate(1.25); }
  100% { filter: hue-rotate(240deg) saturate(1); }
}

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

@keyframes beatGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(255,255,255,0), 0 24px 60px rgba(0,0,0,0.28); }
  50% { box-shadow: 0 0 22px rgba(255, 230, 0, 0.35), 0 24px 60px rgba(0,0,0,0.34); }
}

@keyframes sirenWash {
  0% { filter: hue-rotate(0deg) saturate(1); }
  50% { filter: hue-rotate(90deg) saturate(1.22); }
  100% { filter: hue-rotate(180deg) saturate(1); }
}

@keyframes laserSweep {
  from { transform: translateX(-10%) translateY(-4%); }
  to { transform: translateX(10%) translateY(4%); }
}

@keyframes haloSpin {
  to { transform: rotate(360deg); }
}

@keyframes jitterPlanet {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(8px, -6px) scale(1.03); }
  50% { transform: translate(-8px, 6px) scale(0.98); }
  75% { transform: translate(6px, 8px) scale(1.04); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes partySpin {
  to { transform: rotate(360deg); }
}

@keyframes flashParty {
  0% { opacity: 0; }
  20% { opacity: 1; }
  100% { opacity: 0; }
}

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

  .wide-card {
    grid-column: auto;
  }

  .hero {
    min-height: auto;
  }

  .soundboard {
    grid-template-columns: 1fr 1fr;
  }

  .floating-orb,
  .toast-stack {
    position: static;
    margin-top: 1rem;
  }
}
