:root {
  --green: #39ff68;
  --green-soft: #9dffb8;
  --gold: #f8d77a;
  --gold-deep: #9a6a19;
  --black: #030503;
  --panel: rgba(8, 14, 10, 0.84);
  --glass: rgba(255, 255, 255, 0.08);
  --shadow-green: 0 0 18px rgba(57, 255, 104, 0.88), 0 0 48px rgba(57, 255, 104, 0.32);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--black);
  color: #fff7d7;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-x: hidden;
}

body {
  min-height: 100svh;
}

button {
  font: inherit;
}

.stage {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: clamp(14px, 2.4vw, 26px);
  place-items: center;
  padding: max(18px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
  isolation: isolate;
  background:
    radial-gradient(circle at 50% 15%, rgba(57, 255, 104, 0.18), transparent 28%),
    radial-gradient(circle at 18% 85%, rgba(248, 215, 122, 0.16), transparent 28%),
    linear-gradient(145deg, #010201 0%, #061006 48%, #010201 100%);
}

.ambient {
  position: fixed;
  z-index: -1;
  width: 42vw;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(70px);
  opacity: 0.22;
  animation: drift 9s ease-in-out infinite alternate;
}

.ambient-one {
  left: -18vw;
  top: 12vh;
  background: var(--green);
}

.ambient-two {
  right: -12vw;
  bottom: 6vh;
  background: var(--gold);
  animation-delay: -3s;
}

.hero {
  text-align: center;
  padding-top: clamp(6px, 1.4vw, 14px);
}

.eyebrow,
.subtitle,
.label,
.micro-copy,
.lid-action,
.display-header,
.tech-strip {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0;
  color: var(--green-soft);
  font-size: clamp(0.66rem, 1.6vw, 0.78rem);
  opacity: 0.85;
}

.box-shell {
  position: relative;
  width: min(1020px, 94vw);
  min-height: min(620px, 78svh);
  perspective: 1600px;
  transform-style: preserve-3d;
}

.box-lid,
.box-base {
  border-radius: clamp(22px, 4vw, 42px);
  border: 2px solid rgba(157, 255, 184, 0.82);
  box-shadow:
    var(--shadow-green),
    inset 0 0 36px rgba(57, 255, 104, 0.2),
    0 28px 80px rgba(0, 0, 0, 0.55);
}

.box-lid {
  position: absolute;
  z-index: 3;
  inset: 0;
  display: grid;
  padding: clamp(14px, 2vw, 24px);
  transform-origin: top center;
  transition: transform 1.05s cubic-bezier(0.19, 1, 0.22, 1), filter 1s ease, opacity 0.8s ease;
  transform: rotateX(0deg) translateZ(22px);
  background:
    linear-gradient(180deg, rgba(57, 255, 104, 0) 0%, rgba(57, 255, 104, 0) 96%, rgba(57, 255, 104, 0.55) 97.6%, rgba(57, 255, 104, 0) 100%),
    linear-gradient(135deg, #030503 0%, #0a1a0c 50%, #030503 100%);
}

.box-lid::after {
  content: "";
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: 6px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(57, 255, 104, 0.7), transparent);
  filter: blur(1px);
  opacity: 0.85;
  pointer-events: none;
}

.box-shell.is-open .box-lid {
  transform: rotateX(-92deg) translateY(-58px) translateZ(0);
  filter: brightness(0.42) saturate(0.7);
  opacity: 0.25;
  pointer-events: none;
}

.box-base {
  position: absolute;
  inset: 0;
  z-index: 1;
  padding: clamp(18px, 3vw, 32px);
  background: linear-gradient(135deg, #020402 0%, #061106 50%, #020402 100%);
  opacity: 0;
  transform: scale(0.985);
  transition: opacity 0.6s ease 0.45s, transform 0.6s ease 0.45s;
}

.box-shell.is-open .box-base {
  opacity: 1;
  transform: scale(1);
}

.led-frame {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100%;
  border-radius: clamp(16px, 3vw, 30px);
  border: 3px solid var(--green);
  padding: clamp(14px, 3vw, 34px);
  overflow: hidden;
  box-shadow: inset var(--shadow-green), var(--shadow-green);
}

.led-frame::before,
.led-frame::after {
  content: "";
  position: absolute;
  inset: -25%;
  pointer-events: none;
}

.led-frame::before {
  background: conic-gradient(from 0deg, transparent 0 28%, rgba(157, 255, 184, 0.52) 35%, transparent 43% 100%);
  animation: scan 5.5s linear infinite;
}

.led-frame::after {
  background:
    linear-gradient(90deg, transparent, rgba(57, 255, 104, 0.16), transparent),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 5px);
  mix-blend-mode: screen;
}

.flags {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.flag {
  width: 62px;
  height: 40px;
  border: 1px solid rgba(248, 215, 122, 0.55);
  border-radius: 8px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(248, 215, 122, 0.18), rgba(3, 5, 3, 0.92));
  color: var(--gold);
  cursor: pointer;
  font-family: Cinzel, Georgia, serif;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-shadow: 0 0 12px rgba(248, 215, 122, 0.28);
  box-shadow: 0 0 0 rgba(57, 255, 104, 0), inset 0 0 12px rgba(0, 0, 0, 0.5);
  transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.18s ease, color 0.18s ease;
}

.flag:hover {
  transform: translateY(-2px);
  border-color: rgba(248, 215, 122, 0.95);
  box-shadow: 0 0 22px rgba(248, 215, 122, 0.45), inset 0 0 12px rgba(0, 0, 0, 0.5);
}

.flag.is-active {
  border-color: var(--green);
  color: #fffce0;
  background: linear-gradient(180deg, rgba(57, 255, 104, 0.32), rgba(3, 16, 5, 0.92));
  box-shadow: 0 0 24px rgba(57, 255, 104, 0.55), inset 0 0 16px rgba(57, 255, 104, 0.4);
}

.title-stack {
  position: relative;
  z-index: 1;
  align-self: center;
  display: grid;
  gap: clamp(4px, 0.9vw, 12px);
  text-align: center;
  font-family: Cinzel, Georgia, serif;
  font-size: clamp(1.85rem, 6vw, 5.2rem);
  font-weight: 900;
  line-height: 0.92;
  letter-spacing: 0.005em;
  text-transform: uppercase;
}

.title-stack span:nth-child(3) {
  font-size: 0.92em;
  letter-spacing: -0.012em;
}

.title-stack span {
  color: transparent;
  background: linear-gradient(180deg, #fffbd2, var(--gold) 55%, var(--gold-deep));
  background-clip: text;
  -webkit-background-clip: text;
  filter: drop-shadow(0 0 12px rgba(248, 215, 122, 0.24)) drop-shadow(0 0 18px rgba(57, 255, 104, 0.32));
}

.lid-footer {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 12px;
  place-items: center;
}

.micro-copy {
  color: rgba(157, 255, 184, 0.82);
  font-size: clamp(0.62rem, 1.8vw, 0.8rem);
}

.lid-action {
  position: relative;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid rgba(157, 255, 184, 0.92);
  border-radius: 999px;
  color: #031005;
  background: linear-gradient(180deg, #d8ffe2, var(--green));
  font-size: clamp(0.72rem, 1.8vw, 0.86rem);
  font-weight: 900;
  cursor: pointer;
  overflow: hidden;
  box-shadow: var(--shadow-green);
  transition: transform 0.18s ease, filter 0.18s ease;
}

.lid-action-text {
  position: relative;
  z-index: 1;
}

.lid-action-pulse {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 rgba(57, 255, 104, 0.85);
  animation: ctaPulse 2.2s ease-out infinite;
}

.lid-action:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.box-shell.is-open .lid-action-pulse {
  animation: none;
}

.inner-display {
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 12px;
  border: 1px solid rgba(57, 255, 104, 0.44);
  border-radius: 28px;
  padding: clamp(14px, 2.5vw, 22px);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent),
    var(--panel);
  box-shadow: inset 0 0 42px rgba(57, 255, 104, 0.16);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.mini-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  flex: 1;
}

.mini-flag {
  min-width: 44px;
  padding: 5px 10px;
  border: 1px solid rgba(248, 215, 122, 0.42);
  border-radius: 999px;
  background: rgba(3, 5, 3, 0.55);
  color: var(--gold);
  font-family: Cinzel, Georgia, serif;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.mini-flag:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 215, 122, 0.85);
}

.mini-flag.is-active {
  background: rgba(57, 255, 104, 0.16);
  border-color: var(--green);
  color: #fffce0;
  box-shadow: 0 0 12px rgba(57, 255, 104, 0.4);
}

.display-header,
.track-panel,
.tech-strip {
  display: flex;
  align-items: center;
  gap: 12px;
}

.display-header {
  justify-content: space-between;
  color: rgba(255, 247, 215, 0.72);
  font-size: clamp(0.62rem, 1.6vw, 0.78rem);
}

.signal {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: var(--shadow-green);
  animation: pulse 1.4s ease-in-out infinite;
}

.cinema-frame {
  position: relative;
  min-height: 260px;
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(248, 215, 122, 0.22), transparent 28%),
    linear-gradient(180deg, #071108, #010301 72%);
  border: 1px solid rgba(255, 247, 215, 0.12);
}

.dance-video,
.dancer-fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.dance-video {
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.dance-video.has-source {
  opacity: 1;
}

.dancer-fallback {
  display: grid;
  place-items: center;
  transition: opacity 0.4s ease;
}

.cinema-frame:has(.dance-video.has-source) .dancer-fallback,
.dancer-fallback.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.moon {
  position: absolute;
  top: 9%;
  right: 12%;
  width: min(92px, 18vw);
  aspect-ratio: 1;
  border-radius: 999px;
  background: radial-gradient(circle at 38% 34%, #fffbd5, #f7dc8b 44%, #7d581c 100%);
  box-shadow: 0 0 54px rgba(248, 215, 122, 0.42);
}

.dancer {
  position: relative;
  width: 132px;
  height: 240px;
  transform-origin: 50% 80%;
  animation: dancerIdle 3.4s ease-in-out infinite;
}

.is-playing .dancer {
  animation: dancerMove 1.2s ease-in-out infinite;
}

.dancer span {
  position: absolute;
  display: block;
  background: linear-gradient(180deg, #fff5cf, #d6a537 54%, #5b3608);
  box-shadow: 0 0 18px rgba(248, 215, 122, 0.24);
}

.head {
  width: 34px;
  height: 34px;
  left: 49px;
  top: 20px;
  border-radius: 999px;
}

.body {
  width: 22px;
  height: 92px;
  left: 55px;
  top: 58px;
  border-radius: 16px 16px 26px 26px;
}

.arm,
.leg {
  width: 15px;
  height: 86px;
  border-radius: 999px;
  transform-origin: top center;
}

.arm-left {
  left: 50px;
  top: 66px;
  transform: rotate(58deg);
}

.arm-right {
  right: 50px;
  top: 66px;
  transform: rotate(-58deg);
}

.leg-left {
  left: 58px;
  top: 140px;
  transform: rotate(28deg);
}

.leg-right {
  right: 58px;
  top: 140px;
  transform: rotate(-28deg);
}

.is-playing .arm-left {
  animation: armLeft 1.2s ease-in-out infinite;
}

.is-playing .arm-right {
  animation: armRight 1.2s ease-in-out infinite;
}

.is-playing .leg-left {
  animation: legLeft 1.2s ease-in-out infinite;
}

.is-playing .leg-right {
  animation: legRight 1.2s ease-in-out infinite;
}

.floor-glow {
  position: absolute;
  bottom: 10%;
  width: min(380px, 70%);
  height: 34px;
  border-radius: 999px;
  background: radial-gradient(ellipse, rgba(57, 255, 104, 0.48), transparent 68%);
  filter: blur(7px);
}

.track-panel {
  justify-content: space-between;
  border-radius: 20px;
  padding: 16px 20px;
  background: var(--glass);
  border: 1px solid rgba(57, 255, 104, 0.22);
}

.track-info {
  min-width: 0;
}

.track-controls {
  display: flex;
  align-items: center;
  gap: 18px;
}

.label {
  margin: 0 0 6px;
  color: var(--green-soft);
  font-size: 0.68rem;
}

h2 {
  margin: 0;
  font-family: Cinzel, Georgia, serif;
  color: var(--gold);
  font-size: clamp(1.15rem, 3vw, 2rem);
  text-shadow: 0 0 16px rgba(248, 215, 122, 0.32);
}

#trackMeta {
  margin: 4px 0 0;
  color: rgba(255, 247, 215, 0.72);
  font-size: 0.9rem;
}

.equalizer {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 28px;
}

.equalizer span {
  width: 4px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--green), rgba(57, 255, 104, 0.35));
  box-shadow: 0 0 10px rgba(57, 255, 104, 0.55);
  transform-origin: bottom;
  transform: scaleY(0.28);
}

.box-shell.is-playing .equalizer span {
  animation: eq 0.95s ease-in-out infinite;
}

.equalizer span:nth-child(1) { animation-delay: -0.1s; }
.equalizer span:nth-child(2) { animation-delay: -0.4s; }
.equalizer span:nth-child(3) { animation-delay: -0.7s; }
.equalizer span:nth-child(4) { animation-delay: -0.25s; }
.equalizer span:nth-child(5) { animation-delay: -0.55s; }

.ghost-action {
  min-height: 38px;
  padding: 0 16px;
  border: 1px solid rgba(255, 247, 215, 0.32);
  border-radius: 999px;
  color: rgba(255, 247, 215, 0.82);
  background: rgba(3, 5, 3, 0.55);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.ghost-action:hover {
  border-color: var(--green);
  color: #fffce0;
  background: rgba(57, 255, 104, 0.12);
}

@keyframes eq {
  0%, 100% { transform: scaleY(0.25); }
  50%      { transform: scaleY(1); }
}

@keyframes ctaPulse {
  0%   { box-shadow: 0 0 0 0 rgba(57, 255, 104, 0.85); }
  70%  { box-shadow: 0 0 0 18px rgba(57, 255, 104, 0); }
  100% { box-shadow: 0 0 0 0 rgba(57, 255, 104, 0); }
}

.tech-strip {
  flex-wrap: wrap;
  justify-content: center;
  color: rgba(255, 247, 215, 0.62);
  font-size: clamp(0.62rem, 1.6vw, 0.78rem);
}

.tech-strip span {
  border: 1px solid rgba(57, 255, 104, 0.26);
  border-radius: 999px;
  padding: 8px 11px;
  background: rgba(255, 255, 255, 0.04);
}

@keyframes scan {
  to {
    transform: rotate(360deg);
  }
}

@keyframes drift {
  to {
    transform: translate3d(5vw, -4vh, 0) scale(1.15);
  }
}

@keyframes pulse {
  50% {
    opacity: 0.45;
    transform: scale(0.78);
  }
}

@keyframes dancerIdle {
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@keyframes dancerMove {
  0%,
  100% {
    transform: translateX(-12px) translateY(-4px) rotate(-8deg);
  }

  50% {
    transform: translateX(12px) translateY(-18px) rotate(8deg);
  }
}

@keyframes armLeft {
  50% {
    transform: rotate(96deg);
  }
}

@keyframes armRight {
  50% {
    transform: rotate(-96deg);
  }
}

@keyframes legLeft {
  50% {
    transform: rotate(-8deg);
  }
}

@keyframes legRight {
  50% {
    transform: rotate(8deg);
  }
}

@media (max-width: 720px) {
  .stage {
    justify-content: start;
    gap: 14px;
  }

  .hero {
    padding-top: 2px;
  }

  .box-shell {
    width: 96vw;
    min-height: 560px;
  }

  .box-shell.is-open .box-lid {
    transform: rotateX(-96deg) translateY(-22px) translateZ(0);
  }

  .box-base {
    padding: 10px;
  }

  .led-frame {
    padding: 16px 14px;
    grid-template-rows: auto 1fr auto;
    row-gap: 10px;
  }

  .track-panel {
    align-items: stretch;
    flex-direction: column;
    gap: 12px;
    padding: 14px 16px;
  }

  .track-controls {
    justify-content: space-between;
  }

  .flag {
    width: 56px;
    height: 36px;
    font-size: 0.78rem;
  }

  .title-stack {
    font-size: clamp(1.7rem, 7.6vw, 3.2rem);
    gap: 4px;
  }

  .title-stack span:nth-child(3) {
    font-size: 0.86em;
    letter-spacing: -0.018em;
  }

  .cinema-frame {
    min-height: 220px;
  }

  .dancer {
    transform: scale(0.85);
  }
}

@media (max-width: 420px) {
  .title-stack {
    font-size: clamp(1.55rem, 8.2vw, 2.6rem);
  }

  .flag {
    width: 50px;
    height: 32px;
    font-size: 0.74rem;
  }

  .lid-action {
    min-height: 46px;
    padding: 0 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.001ms !important;
  }
}
