:root {
  --bg: #040713;
  --bg2: #090d20;

  --cyan: #22f7ff;
  --blue: #126fff;
  --deepBlue: #071b72;

  --red1: #ff4646;
  --red2: #e0182f;
  --red3: #930b19;

  --purple: #8d35ff;
  --pink: #ff2bd6;

  --textLight: #ffffff;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

.page {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 18px 0;
  background:
    radial-gradient(900px 700px at 18% 10%, rgba(34, 247, 255, .14), transparent 55%),
    radial-gradient(900px 700px at 82% 24%, rgba(255, 70, 70, .13), transparent 55%),
    radial-gradient(900px 700px at 50% 92%, rgba(141, 53, 255, .12), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg2));
}

.posterWrap {
  width: min(560px, 100vw);
  border-radius: 18px;
  overflow: hidden;
  background: #000;
  box-shadow:
    0 30px 120px rgba(0, 0, 0, .68),
    0 0 44px rgba(34, 247, 255, .10),
    0 0 38px rgba(255, 70, 70, .10);
  position: relative;

  /* กันปุ่ม fixed ทับเนื้อหาด้านล่าง */
  padding-bottom: 124px;
}

.posterImg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* CTA — MEGASPIN Premium Esports */
.cta {
  position: fixed;
  left: 50%;
  bottom: 16px;
  width: min(540px, 92vw);
  height: 76px;
  z-index: 50;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  border-radius: 999px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;

  font-weight: 1000;
  font-size: 28px;
  letter-spacing: .25px;

  color: var(--textLight);
  text-shadow:
    0 2px 0 rgba(0, 0, 0, .55),
    0 0 14px rgba(255, 255, 255, .35),
    0 0 18px rgba(34, 247, 255, .30);

  background:
    radial-gradient(120% 180% at 18% 0%, rgba(255,255,255,.18), transparent 44%),
    linear-gradient(
      90deg,
      #071b72 0%,
      #104cff 24%,
      #191033 50%,
      #e0182f 76%,
      #ff4646 100%
    );

  border: 2px solid rgba(34, 247, 255, .92);

  box-shadow:
    0 18px 70px rgba(0, 0, 0, .70),
    0 0 0 1px rgba(255,255,255,.10) inset,
    0 0 0 3px rgba(34, 247, 255, .18) inset,
    0 0 0 7px rgba(255, 70, 70, .13) inset,
    0 0 24px rgba(34, 247, 255, .40),
    0 0 42px rgba(255, 70, 70, .28);

  transform: translateX(-50%);
  transition: transform .22s ease, opacity .22s ease, filter .22s ease;
}

.cta span {
  position: relative;
  z-index: 2;
}

.spark {
  font-size: 30px;
  line-height: 1;
  color: #ffffff;
  text-shadow:
    0 0 8px rgba(255, 255, 255, .95),
    0 0 16px rgba(34, 247, 255, .75),
    0 0 24px rgba(255, 70, 70, .55);
  animation: sparkBlink 1.35s ease-in-out infinite;
}

/* แสงวิ่งบนปุ่ม */
.cta::before {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 999px;
  background: linear-gradient(
    110deg,
    transparent 0%,
    rgba(34, 247, 255, .12) 16%,
    rgba(255, 255, 255, .70) 30%,
    rgba(255, 70, 70, .20) 44%,
    transparent 64%
  );
  transform: translateX(-70%);
  opacity: .70;
  filter: blur(1px);
  animation: shineEsport 2.05s ease-in-out infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* Glow ด้านนอก */
.cta::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      rgba(34, 247, 255, .80),
      rgba(141, 53, 255, .55),
      rgba(255, 70, 70, .80),
      rgba(34, 247, 255, .62)
    );
  opacity: .25;
  filter: blur(13px);
  z-index: -1;
  animation: auraEsport 2.75s ease-in-out infinite;
}

@keyframes shineEsport {
  0% {
    transform: translateX(-70%);
    opacity: .24;
  }

  42% {
    opacity: .98;
  }

  100% {
    transform: translateX(72%);
    opacity: .34;
  }
}

@keyframes auraEsport {
  0% {
    opacity: .16;
    transform: scale(.98);
  }

  50% {
    opacity: .35;
    transform: scale(1.035);
  }

  100% {
    opacity: .16;
    transform: scale(.98);
  }
}

@keyframes sparkBlink {
  0%, 100% {
    opacity: 1;
    transform: scale(1) rotate(-6deg);
  }

  45% {
    opacity: .78;
    transform: scale(1.13) rotate(3deg);
  }

  60% {
    opacity: 1;
    transform: scale(1.03) rotate(-2deg);
  }
}

@keyframes esportPulse {
  0% {
    transform: translateX(-50%) scale(1);
    filter: brightness(1);
  }

  50% {
    transform: translateX(-50%) scale(1.035);
    filter: brightness(1.13);
  }

  100% {
    transform: translateX(-50%) scale(1);
    filter: brightness(1);
  }
}

.cta.pulse {
  animation: esportPulse 2.55s ease-in-out infinite;
}

.cta.is-down {
  transform: translateX(-50%) translateY(10px) scale(.985);
  opacity: .92;
}

.cta.is-up {
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
}

.cta:active {
  transform: translateX(-50%) scale(.985);
  filter: brightness(1.12);
}

@media (prefers-reduced-motion: reduce) {
  .cta::before,
  .cta::after,
  .cta.pulse,
  .spark {
    animation: none;
  }
}