:root {
  --ns-bg: #0d0612;
  --ns-purple: #a020f0;
  --ns-pink: #ff2d95;
  --ns-gold: #f5c542;
  --ns-text: #ffffff;
  --ns-muted: rgba(255, 255, 255, 0.72);
  --ns-glow: 0 0 18px rgba(160, 32, 240, 0.65), 0 0 42px rgba(255, 45, 149, 0.35);
  --font: "Exo 2", "Exo 2 Fallback", "Segoe UI", sans-serif;
  --pad-x: 12px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ns-text);
  background: var(--ns-bg);
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
}

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: url("../assets/sakura-banner.webp") center center / cover no-repeat;
  transform: scale(1.02);
}

.bg-veil {
  position: fixed;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(8, 2, 14, 0.28) 0%, rgba(8, 2, 14, 0.45) 48%, rgba(8, 2, 14, 0.72) 100%),
    radial-gradient(ellipse at 70% 20%, rgba(160, 32, 240, 0.18), transparent 55%);
  pointer-events: none;
}

.header,
.main,
.promo-modal {
  position: relative;
  z-index: 2;
}

.header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px var(--pad-x) 2px;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.audio-btn {
  appearance: none;
  border: 1px solid rgba(160, 32, 240, 0.45);
  background: rgba(12, 4, 18, 0.72);
  color: var(--ns-muted);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.audio-btn__icon {
  font-size: 0.85rem;
}

.audio-btn.is-active {
  color: #fff;
  border-color: rgba(255, 45, 149, 0.75);
  background: linear-gradient(135deg, rgba(160, 32, 240, 0.55), rgba(255, 45, 149, 0.45));
  box-shadow: 0 0 10px rgba(160, 32, 240, 0.45);
}

.audio-btn:hover {
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  filter: drop-shadow(0 0 10px rgba(160, 32, 240, 0.45));
}

.brand__logo {
  height: 28px;
  width: auto;
  display: block;
}

.main {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--pad-x) 8px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 6px;
  overflow: hidden;
}

.tagline {
  flex: 0 0 auto;
  margin: 0;
  text-align: center;
  font-size: clamp(0.95rem, 2.4vh, 1.35rem);
  font-weight: 800;
  font-style: italic;
  letter-spacing: 0.02em;
  line-height: 1.15;
  text-shadow: 0 0 18px rgba(255, 45, 149, 0.45);
}

.game-shell {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: min(420px, 100%);
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(160, 32, 240, 0.55);
  box-shadow: var(--ns-glow);
  background: rgba(12, 4, 18, 0.55);
}

.game-frame {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
  background: transparent;
}

.live {
  flex: 0 0 auto;
  max-width: min(420px, 100%);
  width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  border: 1px solid rgba(160, 32, 240, 0.4);
  background: rgba(10, 3, 16, 0.72);
  box-shadow: 0 0 16px rgba(160, 32, 240, 0.2);
  padding: 6px 8px 4px;
  overflow: hidden;
}

.live__head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}

.live__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b6b;
  box-shadow: 0 0 10px #ff3b6b;
  animation: live-blink 1.4s ease-in-out infinite;
}

.live__title {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ns-muted);
}

.live__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-height: 4.8rem;
  overflow: hidden;
}

.live__item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
  font-size: 0.72rem;
  padding: 3px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  animation: live-in 0.35s ease-out;
}

.live__name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live__amount {
  color: var(--ns-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.live__result {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 3.8rem;
  text-align: right;
  white-space: nowrap;
}

.live__result--win {
  color: #5dff9a;
  text-shadow: 0 0 8px rgba(93, 255, 154, 0.35);
}

.live__result--loss {
  color: #ff6b8a;
}

.cta-wrap {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 2px 0 4px;
}

.cta {
  position: relative;
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: clamp(0.85rem, 2vh, 1.05rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #c43bff 0%, #a020f0 45%, #ff2d95 100%);
  box-shadow: var(--ns-glow);
  overflow: hidden;
  animation: cta-pulse 3.2s ease-in-out infinite;
  transition: transform 0.15s ease;
}

.cta:hover {
  transform: translateY(-1px) scale(1.02);
}

.cta:active {
  transform: scale(0.98);
}

.cta__glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.35), transparent 55%);
  opacity: 0;
  animation: cta-shine 3.2s ease-in-out infinite;
  pointer-events: none;
}

.cta__label {
  position: relative;
  z-index: 1;
}

.promo-modal[hidden] {
  display: none !important;
}

.promo-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
}

.promo-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 0, 10, 0.72);
  backdrop-filter: blur(4px);
}

.promo-modal__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 380px);
  padding: 22px 18px 18px;
  border-radius: 16px;
  border: 1px solid rgba(160, 32, 240, 0.65);
  background: linear-gradient(160deg, rgba(42, 12, 48, 0.96), rgba(18, 4, 28, 0.98));
  box-shadow: var(--ns-glow);
  text-align: center;
}

.promo-modal__close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--ns-muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.promo-modal__title {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 800;
}

.promo-modal__text {
  margin: 0 0 14px;
  color: var(--ns-muted);
  line-height: 1.4;
  font-size: 0.9rem;
}

.promo-modal__text strong {
  color: var(--ns-gold);
  letter-spacing: 0.04em;
}

.promo-modal__cta {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #fff;
  padding: 11px 16px;
  border-radius: 11px;
  width: 100%;
  background: linear-gradient(135deg, #c43bff, #ff2d95);
  box-shadow: 0 0 16px rgba(160, 32, 240, 0.55);
}

@keyframes cta-pulse {
  0%,
  100% {
    box-shadow: 0 0 14px rgba(160, 32, 240, 0.45), 0 0 28px rgba(255, 45, 149, 0.2);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 26px rgba(160, 32, 240, 0.85), 0 0 48px rgba(255, 45, 149, 0.45);
    filter: brightness(1.08);
  }
}

@keyframes cta-shine {
  0%,
  70%,
  100% {
    opacity: 0;
    transform: translateX(-30%) rotate(12deg);
  }
  80% {
    opacity: 0.35;
  }
  90% {
    opacity: 0;
    transform: translateX(40%) rotate(12deg);
  }
}

@keyframes live-blink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@keyframes live-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Short phones: keep live to 2 rows visually */
@media (max-height: 700px) {
  .live__list {
    max-height: 3.2rem;
  }

  .brand__logo {
    height: 24px;
  }

  .cta {
    padding: 8px 16px;
  }
}

@media (max-width: 420px) {
  .audio-btn__label {
    display: none;
  }
}

@media (max-height: 560px) {
  .tagline {
    font-size: 0.9rem;
  }

  .live {
    display: none;
  }
}
