:root {
  --bg: #050505;
  --accent: #ff3a5e;
  --electric: #00ffd9;
  --light: #f3f3f3;
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Arial Black", "Impact", sans-serif;
  background: radial-gradient(circle at 20% 10%, #2a0733, transparent 30%),
    radial-gradient(circle at 80% 0%, #0a2b3a, transparent 35%),
    linear-gradient(140deg, #020202, #111, #070707);
  color: var(--light);
  overflow-x: hidden;
}

.grain,
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

.grain {
  opacity: 0.2;
  background-image: radial-gradient(#fff 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  animation: grainMove 0.25s steps(2) infinite;
}

.vignette {
  box-shadow: inset 0 0 180px rgba(0, 0, 0, 0.75);
}

.vignette::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.15;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 2px,
    rgba(255, 255, 255, 0.55) 3px
  );
  animation: flicker 0.16s steps(3) infinite;
}

.floating-elements {
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}

.floating-item {
  position: absolute;
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  transition: transform 0.2s ease;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .floating-item:hover {
    transform: scale(1.05) rotate(-2deg);
  }
}

.floating-item img,
.floating-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero {
  text-align: center;
  padding: 56px 16px 16px;
  position: relative;
  z-index: 10;
}

.title {
  margin: 0;
  font-size: clamp(3rem, 12vw, 8rem);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.glitch {
  position: relative;
  color: #fff;
  text-shadow: -3px 0 var(--accent), 3px 0 var(--electric);
  animation: pulse 1.6s infinite alternate;
}

.glitch::before,
.glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0.75;
}

.glitch::before {
  transform: translate(-3px, -2px);
  color: var(--accent);
  clip-path: polygon(0 4%, 100% 0, 100% 35%, 0 42%);
}

.glitch::after {
  transform: translate(4px, 3px);
  color: var(--electric);
  clip-path: polygon(0 62%, 100% 55%, 100% 100%, 0 100%);
}

.subtitle,
.mantra {
  margin: 6px 0;
}

.mantra {
  font-size: clamp(1rem, 2vw, 1.6rem);
  color: var(--accent);
  letter-spacing: 0.08em;
  min-height: 1.7em;
}

.neon-sign-board {
  margin: 22px auto 0;
  max-width: min(100%, 38rem);
  padding: 14px 18px;
  border: 3px solid rgba(255, 0, 170, 0.65);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.55);
  box-shadow:
    0 0 12px rgba(255, 0, 200, 0.45),
    inset 0 0 24px rgba(0, 255, 230, 0.08);
}

.neon-sign {
  margin: 0;
  font-size: clamp(0.75rem, 3.2vw, 1.15rem);
  line-height: 1.25;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff0f8;
  text-shadow:
    0 0 6px #ff00aa,
    0 0 14px #ff00aa,
    0 0 28px #00ffe7,
    0 0 42px rgba(0, 255, 231, 0.55);
  animation: neonPulse 2.4s ease-in-out infinite alternate;
}

@keyframes neonPulse {
  from {
    text-shadow:
      0 0 4px #ff00aa,
      0 0 10px #ff00aa,
      0 0 20px #00ffe7;
    filter: brightness(1);
  }
  to {
    text-shadow:
      0 0 8px #ff00aa,
      0 0 20px #ff00cc,
      0 0 36px #00ffe7,
      0 0 52px rgba(255, 0, 170, 0.45);
    filter: brightness(1.12);
  }
}

.collage {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
  width: min(1100px, 92vw);
  margin: 16px auto 36px;
}

.card {
  position: relative;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(10, 10, 10, 0.6);
  transform-origin: center;
  box-shadow: 0 25px 45px rgba(0, 0, 0, 0.45);
  transition: transform 0.15s linear;
}

.left {
  grid-column: 1 / span 7;
  transform: rotate(-2deg);
  animation: floatA 5s ease-in-out infinite;
}

.right {
  grid-column: 6 / span 7;
  transform: rotate(3deg);
  animation: floatB 6s ease-in-out infinite;
}

.card img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  max-height: 550px;
  object-fit: cover;
  filter: contrast(1.2) saturate(1.1);
}

.sticker {
  position: absolute;
  bottom: 14px;
  left: 14px;
  padding: 8px 12px;
  border: 2px dashed #fff;
  background: rgba(255, 58, 94, 0.8);
  text-transform: uppercase;
  transform: rotate(-6deg);
}

.ticker-wrap {
  grid-column: 1 / -1;
  overflow: hidden;
  border-top: 2px solid var(--accent);
  border-bottom: 2px solid var(--electric);
  background: rgba(0, 0, 0, 0.5);
}

.ticker {
  display: inline-flex;
  gap: 2rem;
  white-space: nowrap;
  padding: 14px 0;
  font-size: clamp(1.1rem, 3vw, 2rem);
  text-transform: uppercase;
  animation: slide 24s linear infinite;
}

.footer {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: 0 16px 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.footer > button {
  max-width: min(100%, 22rem);
  width: 100%;
}

.power-answer {
  min-height: 1.8em;
  color: var(--electric);
  letter-spacing: 0.02em;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(0.85rem, 2.8vw, 1.05rem);
  line-height: 1.35;
}

.game-shell {
  position: relative;
  z-index: 12;
  width: min(1100px, 92vw);
  margin: 0 auto 30px;
  display: none;
  grid-template-columns: 1fr 300px;
  gap: 14px;
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.48);
}

.game-shell.visible {
  display: grid;
}

.game-head {
  grid-column: 1 / -1;
}

.game-head h2,
.game-head p {
  margin: 4px 0;
}

.game-hint,
.game-controls-hint {
  font-size: clamp(0.72rem, 2.4vw, 0.9rem);
  line-height: 1.35;
  font-weight: normal;
  text-transform: none;
  letter-spacing: 0.02em;
  max-width: 40rem;
  margin-left: auto;
  margin-right: auto;
  color: rgba(255, 255, 255, 0.88);
}

.game-toast {
  min-height: 1.5em;
  margin-top: 6px;
  font-size: clamp(0.95rem, 3vw, 1.2rem);
  font-weight: bold;
  color: var(--electric);
  text-shadow: 0 0 12px rgba(0, 255, 217, 0.45);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.game-toast.is-negative {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(255, 58, 94, 0.5);
}

.game-toast.is-pop {
  animation: toastPop 0.55s ease-out;
}

@keyframes toastPop {
  0% {
    opacity: 0;
    transform: translateY(6px) scale(0.92);
  }
  35% {
    opacity: 1;
    transform: translateY(0) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.game-stage {
  position: relative;
  min-height: 320px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(17, 30, 46, 0.9), rgba(8, 8, 8, 0.96));
  touch-action: none;
}

.player,
.packet,
.pizza {
  position: absolute;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.7));
}

.player {
  width: 95px;
  height: 125px;
  bottom: 10px;
  left: 24px;
}

.packet {
  width: 60px;
  height: 76px;
  top: -90px;
}

.pizza {
  width: 74px;
  height: 74px;
  top: -90px;
}

.pizza-label {
  position: absolute;
  left: 50%;
  top: 78px;
  transform: translateX(-50%);
  font-size: 11px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.steer {
  display: none;
  position: absolute;
  bottom: 10px;
  z-index: 30;
  width: 64px;
  height: 64px;
  padding: 0;
  border-radius: 14px;
  font-size: 1.5rem;
  line-height: 1;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  background: rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  text-transform: none;
  max-width: none;
}

.steer--left {
  left: 10px;
}

.steer--right {
  right: 10px;
}

@media (hover: hover) {
  .steer:hover {
    filter: brightness(1.15);
  }
}

.reward-video {
  display: none;
  padding: 8px;
  border: 2px solid rgba(0, 255, 217, 0.5);
  border-radius: 10px;
  background: rgba(10, 10, 10, 0.7);
}

.reward-video.visible {
  display: block;
}

.reward-video video {
  width: 100%;
  border-radius: 8px;
}

button {
  border: 0;
  padding: 12px 18px;
  font-size: 1rem;
  text-transform: uppercase;
  background: linear-gradient(45deg, var(--accent), #f86827);
  color: #fff;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

@media (hover: hover) {
  button:hover {
    transform: scale(1.04) rotate(-1deg);
    filter: brightness(1.1);
  }
}

body.chaos .card {
  animation-duration: 1.5s;
}

body.chaos .ticker {
  animation-duration: 8s;
}

body.chaos .title {
  filter: hue-rotate(90deg);
}

body.burst .glitch {
  transform: skewX(-8deg);
}

body.burst .ticker {
  filter: hue-rotate(140deg);
}

@media (max-width: 800px) {
  .left,
  .right {
    grid-column: 1 / -1;
    transform: none;
  }

  .card img {
    min-height: 220px;
    max-height: 420px;
  }

  .game-shell {
    grid-template-columns: 1fr;
    width: min(100%, 100vw - 16px);
    padding: 12px;
    gap: 10px;
  }

  .game-stage {
    min-height: 280px;
  }

  .steer {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .reward-video {
    order: 3;
  }
}

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

@keyframes grainMove {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(-2px, 3px);
  }
}

@keyframes floatA {
  0%,
  100% {
    transform: translateY(0) rotate(-2deg);
  }
  50% {
    transform: translateY(-12px) rotate(-3deg);
  }
}

@keyframes floatB {
  0%,
  100% {
    transform: translateY(0) rotate(3deg);
  }
  50% {
    transform: translateY(10px) rotate(2deg);
  }
}

@keyframes pulse {
  from {
    letter-spacing: 0.1em;
  }
  to {
    letter-spacing: 0.13em;
  }
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.06;
  }
  50% {
    opacity: 0.19;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
