/* ============================================
   ZANTRI.FUN — Chaotic Creative Playground
   ============================================ */

:root {
  --lime: #B6FF4D;
  --black: #0B0B0F;
  --bg: #F6F7F9;
  --text: #121212;
  --pink: #FF4FD8;
  --font-heading: 'Space Grotesk', 'Bungee', sans-serif;
  --font-display: 'Bungee', 'Space Grotesk', sans-serif;
  --font-body: 'Inter', 'DM Sans', sans-serif;
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.5;
  min-height: 100vh;
}

body.chaos-mode {
  animation: bodyGlitch 0.3s ease;
}

body.layout-shift-1 .section { transform: skewX(-1deg); }
body.layout-shift-2 .section:nth-child(even) { background: var(--black); color: var(--lime); }
body.layout-shift-3 .portal-section { order: 5; }
body.inverted { filter: invert(1) hue-rotate(180deg); }
body.inverted img, body.inverted .glitch-card { filter: invert(1) hue-rotate(180deg); }

.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;
}

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background: var(--lime);
  color: var(--black);
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
}

.skip-link:focus {
  top: 1rem;
}

/* ---- Dice Navigation ---- */
.dice-nav {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
}

.dice-btn {
  width: 56px;
  height: 56px;
  border: 3px solid var(--black);
  border-radius: 12px;
  background: var(--lime);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  transition: transform 0.2s var(--ease-bounce);
  box-shadow: 4px 4px 0 var(--black);
}

.dice-btn:hover {
  transform: rotate(15deg) scale(1.1);
}

.dice-btn:active {
  transform: scale(0.95);
  box-shadow: 2px 2px 0 var(--black);
}

.dice-btn.rolling {
  animation: diceRoll 0.6s ease;
}

@keyframes diceRoll {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(90deg) scale(1.2); }
  50% { transform: rotate(180deg); }
  75% { transform: rotate(270deg) scale(0.9); }
  100% { transform: rotate(360deg); }
}

.dice-menu {
  position: absolute;
  top: calc(100% + 0.75rem);
  right: 0;
  list-style: none;
  min-width: 180px;
  background: var(--black);
  border: 2px solid var(--lime);
  border-radius: 8px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  animation: menuPop 0.4s var(--ease-elastic);
}

.dice-menu[hidden] {
  display: none;
}

@keyframes menuPop {
  from { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  to { opacity: 1; transform: scale(1) rotate(0); }
}

.dice-menu a {
  display: block;
  padding: 0.6rem 1rem;
  color: var(--lime);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 700;
  border-radius: 4px;
  transition: background 0.15s, transform 0.15s;
}

.dice-menu a:hover,
.dice-menu a:focus-visible {
  background: var(--pink);
  color: var(--black);
  transform: translateX(-4px);
  outline: none;
}

/* ---- Sections ---- */
.section {
  padding: 4rem 1.5rem;
  position: relative;
  transition: transform 0.5s ease, background 0.5s ease;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 5vw, 3rem);
  text-align: center;
  margin-bottom: 0.5rem;
  color: var(--black);
}

.section-sub {
  text-align: center;
  color: #555;
  margin-bottom: 2.5rem;
  font-size: 1.05rem;
}

.glitch-text {
  position: relative;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
}

/* ---- Section 1: Randomizer Portal ---- */
.portal-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--lime);
  overflow: hidden;
}

.portal-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(182, 255, 77, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 79, 216, 0.12) 0%, transparent 50%);
  animation: portalPulse 4s ease-in-out infinite;
}

@keyframes portalPulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.portal-tagline {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 3vw, 1.4rem);
  margin-bottom: 2rem;
  z-index: 1;
  animation: float 3s ease-in-out infinite;
}

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

.wheel-container {
  position: relative;
  z-index: 1;
  text-align: center;
}

.spin-wheel {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: transform 0.1s;
}

.spin-wheel:focus-visible {
  outline: 3px solid var(--pink);
  outline-offset: 8px;
  border-radius: 50%;
}

.wheel-svg {
  width: min(85vw, 400px);
  height: min(85vw, 400px);
  filter: drop-shadow(0 0 20px rgba(182, 255, 77, 0.4));
}

.wheel-segments {
  transform-origin: 200px 200px;
  animation: wheelSpin 20s linear infinite;
}

.wheel-segments.spinning-fast {
  animation: wheelSpinFast 2s cubic-bezier(0.17, 0.67, 0.12, 0.99) forwards;
}

@keyframes wheelSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes wheelSpinFast {
  from { transform: rotate(0deg); }
  to { transform: rotate(var(--spin-deg, 1440deg)); }
}

.wheel-hub {
  fill: var(--pink);
  stroke: var(--lime);
  stroke-width: 3;
}

.wheel-hub-text {
  fill: var(--black);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: bold;
  pointer-events: none;
}

.spin-result {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 2rem);
  min-height: 2.5rem;
  color: var(--pink);
  animation: resultPop 0.5s var(--ease-bounce);
}

@keyframes resultPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ---- Section 2: Chaos Grid ---- */
.chaos-grid-section {
  background: var(--bg);
}

.chaos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 1rem;
  max-width: 1100px;
  margin: 0 auto;
  min-height: 400px;
}

.chaos-tile {
  background: var(--lime);
  border: 3px solid var(--black);
  border-radius: 12px;
  padding: 1.25rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease-elastic), width 0.4s, height 0.4s;
  box-shadow: 4px 4px 0 var(--black);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

.chaos-tile:hover {
  transform: scale(1.05) rotate(2deg);
  z-index: 2;
}

.chaos-tile.flipped {
  transform: rotateY(180deg);
  background: var(--pink);
}

.chaos-tile.moving {
  animation: tileWiggle 0.5s ease;
}

@keyframes tileWiggle {
  0%, 100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-3deg) scale(1.05); }
  75% { transform: rotate(3deg) scale(0.95); }
}

.chaos-tile-icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.chaos-tile-text {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
}

.chaos-tile.wide { grid-column: span 2; }
.chaos-tile.tall { grid-row: span 2; min-height: 200px; }

/* ---- Section 3: Fun Engine ---- */
.fun-engine-section {
  background: var(--black);
  color: var(--lime);
}

.fun-engine-section .section-title { color: var(--lime); }
.fun-engine-section .section-sub { color: #888; }

.fun-engine {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
}

.engine-body {
  background: linear-gradient(180deg, #1a1a22 0%, #0B0B0F 100%);
  border: 4px solid var(--lime);
  border-radius: 20px;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
}

.engine-pipes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 8px;
  background: repeating-linear-gradient(90deg, var(--pink) 0px, var(--pink) 20px, var(--lime) 20px, var(--lime) 40px);
  animation: pipeFlow 2s linear infinite;
}

@keyframes pipeFlow {
  from { background-position: 0 0; }
  to { background-position: 40px 0; }
}

.engine-gauge {
  height: 24px;
  background: #222;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
  border: 2px solid var(--lime);
}

.gauge-fill {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--lime), var(--pink));
  border-radius: 10px;
  transition: width 0.5s var(--ease-elastic);
}

.gauge-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--black);
  mix-blend-mode: difference;
}

.engine-screen {
  background: #0a2a0a;
  border: 2px solid var(--lime);
  border-radius: 8px;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 1.1rem;
  min-height: 80px;
  color: var(--lime);
  text-shadow: 0 0 10px var(--lime);
  animation: screenFlicker 4s infinite;
}

@keyframes screenFlicker {
  0%, 95%, 100% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
  98% { opacity: 0.6; }
}

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

.lever {
  background: #222;
  border: 3px solid var(--lime);
  border-radius: 12px;
  padding: 1rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  transition: transform 0.2s;
}

.lever:hover { transform: translateY(-4px); }
.lever:active .lever-handle { transform: rotate(45deg); }
.lever:focus-visible { outline: 3px solid var(--pink); outline-offset: 2px; }

.lever-handle {
  width: 8px;
  height: 48px;
  background: var(--pink);
  border-radius: 4px;
  transition: transform 0.2s var(--ease-bounce);
  position: relative;
}

.lever-handle::after {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 12px;
  background: var(--lime);
  border-radius: 4px;
}

.lever-label {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--lime);
}

.engine-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.burst-particle {
  position: absolute;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  animation: burstFly 1s ease-out forwards;
}

@keyframes burstFly {
  to {
    transform: translate(var(--bx), var(--by)) scale(0);
    opacity: 0;
  }
}

/* ---- Section 4: Glitch Gallery ---- */
.glitch-gallery-section {
  background: var(--bg);
}

.glitch-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
}

.glitch-card {
  aspect-ratio: 1;
  border: 3px solid var(--black);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  animation: glitchShift 3s infinite;
}

.glitch-card:nth-child(2n) { animation-delay: 0.5s; }
.glitch-card:nth-child(3n) { animation-delay: 1s; }

@keyframes glitchShift {
  0%, 90%, 100% { transform: translate(0, 0); filter: none; }
  92% { transform: translate(-3px, 2px); filter: hue-rotate(90deg); }
  94% { transform: translate(3px, -2px); filter: saturate(2); }
  96% { transform: translate(-2px, -3px); filter: contrast(1.5); }
}

.glitch-card:hover,
.glitch-card:focus-visible {
  animation: none;
  transform: none !important;
  filter: none !important;
  outline: 3px solid var(--lime);
  outline-offset: 4px;
}

.glitch-card-inner {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 700;
}

.glitch-card:nth-child(1) .glitch-card-inner { background: var(--lime); }
.glitch-card:nth-child(2) .glitch-card-inner { background: var(--pink); color: var(--black); }
.glitch-card:nth-child(3) .glitch-card-inner { background: var(--black); color: var(--lime); }
.glitch-card:nth-child(4) .glitch-card-inner { background: #FFE66D; }
.glitch-card:nth-child(5) .glitch-card-inner { background: #4ECDC4; }
.glitch-card:nth-child(6) .glitch-card-inner { background: #FF6B6B; color: white; }

.glitch-card-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.glitch-card-title { font-size: 0.9rem; }

/* ---- Section 5: Idea Explosion Field ---- */
.idea-field-section {
  background: var(--black);
  color: var(--lime);
  min-height: 500px;
}

.idea-field-section .section-title { color: var(--lime); }
.idea-field-section .section-sub { color: #888; }

.idea-canvas {
  position: relative;
  height: 450px;
  max-width: 1100px;
  margin: 0 auto;
  border: 2px dashed var(--lime);
  border-radius: 16px;
  overflow: hidden;
  background: radial-gradient(circle at center, rgba(182,255,77,0.05) 0%, transparent 70%);
}

.idea-particle {
  position: absolute;
  padding: 0.6rem 1rem;
  background: var(--lime);
  color: var(--black);
  border: 2px solid var(--black);
  border-radius: 20px;
  font-family: var(--font-heading);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s, box-shadow 0.2s;
  animation: ideaFloat var(--float-dur, 6s) ease-in-out infinite;
  animation-delay: var(--float-delay, 0s);
  z-index: 1;
}

.idea-particle:hover,
.idea-particle:focus-visible {
  transform: scale(1.15) !important;
  box-shadow: 0 0 20px var(--pink);
  z-index: 5;
  outline: none;
}

@keyframes ideaFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(10px, -15px) rotate(2deg); }
  50% { transform: translate(-8px, 10px) rotate(-2deg); }
  75% { transform: translate(5px, 5px) rotate(1deg); }
}

.idea-expanded {
  position: absolute;
  inset: 10%;
  background: var(--pink);
  border: 4px solid var(--lime);
  border-radius: 16px;
  padding: 2rem;
  z-index: 10;
  animation: expandPop 0.4s var(--ease-elastic);
  display: flex;
  flex-direction: column;
}

.idea-expanded[hidden] { display: none; }

@keyframes expandPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.idea-close {
  align-self: flex-end;
  background: var(--black);
  color: var(--lime);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
}

.idea-expanded-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--black);
}

.idea-expanded-content h3 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* ---- Section 6: Mini Games ---- */
.mini-games-section {
  background: var(--bg);
  overflow-x: auto;
}

.game-strip {
  display: flex;
  gap: 1.25rem;
  padding: 1rem 0 2rem;
  max-width: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.game-card {
  flex: 0 0 220px;
  scroll-snap-align: start;
  background: white;
  border: 3px solid var(--black);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 5px 5px 0 var(--black);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.game-card h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.game-desc {
  font-size: 0.85rem;
  color: #666;
  flex: 1;
}

.game-btn {
  background: var(--lime);
  border: 2px solid var(--black);
  padding: 0.6rem 1.2rem;
  font-family: var(--font-heading);
  font-weight: 700;
  cursor: pointer;
  border-radius: 8px;
  transition: transform 0.15s;
}

.game-btn:hover { transform: scale(1.05); }
.game-btn:active { transform: scale(0.95); }
.game-btn:focus-visible { outline: 3px solid var(--pink); }

.game-score, .game-output {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
}

.color-box {
  width: 100%;
  height: 60px;
  border-radius: 8px;
  border: 2px solid var(--black);
  background: var(--lime);
  transition: background 0.1s;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.memory-card {
  aspect-ratio: 1;
  background: var(--black);
  border: 2px solid var(--lime);
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: transform 0.3s;
  transform-style: preserve-3d;
}

.memory-card.flipped,
.memory-card.matched {
  background: var(--lime);
  transform: rotateY(180deg);
}

.reaction-area {
  position: relative;
  height: 80px;
  background: #eee;
  border-radius: 8px;
  border: 2px solid var(--black);
}

.reaction-target {
  position: absolute;
  width: 40px;
  height: 40px;
  background: var(--pink);
  border-radius: 50%;
  border: 2px solid var(--black);
  cursor: pointer;
  animation: targetPulse 0.5s ease infinite;
}

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

/* ---- Section 7: Sticky Notes ---- */
.sticky-section {
  background: linear-gradient(135deg, #e8e9ec 0%, var(--bg) 100%);
  min-height: 500px;
  overflow: hidden;
}

.sticky-universe {
  position: relative;
  height: 420px;
  max-width: 1100px;
  margin: 0 auto;
}

.sticky-note {
  position: absolute;
  width: 140px;
  min-height: 120px;
  padding: 1rem;
  font-family: 'DM Sans', cursive, sans-serif;
  font-size: 0.85rem;
  line-height: 1.4;
  cursor: grab;
  box-shadow: 3px 3px 8px rgba(0,0,0,0.15);
  transition: transform 0.2s, box-shadow 0.2s;
  animation: noteDrift var(--drift-dur, 8s) ease-in-out infinite;
  animation-delay: var(--drift-delay, 0s);
  z-index: 1;
}

.sticky-note:hover {
  transform: scale(1.08) rotate(0deg) !important;
  z-index: 10;
  box-shadow: 6px 6px 16px rgba(0,0,0,0.2);
}

.sticky-note:active { cursor: grabbing; }

.sticky-note.yellow { background: #FFF9C4; }
.sticky-note.pink { background: #F8BBD9; }
.sticky-note.green { background: #C8E6C9; }
.sticky-note.blue { background: #BBDEFB; }
.sticky-note.orange { background: #FFE0B2; }

@keyframes noteDrift {
  0%, 100% { transform: translate(0, 0) rotate(var(--note-rot, 3deg)); }
  33% { transform: translate(8px, -6px) rotate(calc(var(--note-rot, 3deg) + 2deg)); }
  66% { transform: translate(-6px, 4px) rotate(calc(var(--note-rot, 3deg) - 2deg)); }
}

/* ---- Section 8: Sound Toy Room ---- */
.sound-section {
  background: var(--black);
  color: var(--lime);
}

.sound-section .section-title { color: var(--lime); }
.sound-section .section-sub { color: #888; }

.sound-toy-room {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  max-width: 700px;
  margin: 0 auto 2rem;
}

.sound-pad {
  width: 72px;
  height: 72px;
  border: 3px solid var(--lime);
  border-radius: 12px;
  background: linear-gradient(145deg, #1a1a22, #0B0B0F);
  color: var(--lime);
  font-family: var(--font-display);
  font-size: 1.1rem;
  cursor: pointer;
  transition: transform 0.1s, background 0.1s, box-shadow 0.1s;
  box-shadow: 0 4px 0 var(--lime);
}

.sound-pad:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--lime);
}

.sound-pad:active,
.sound-pad.playing {
  transform: translateY(4px);
  box-shadow: 0 0 0 var(--lime);
  background: var(--lime);
  color: var(--black);
}

.sound-pad.drum {
  background: linear-gradient(145deg, #2a1a2a, #1a0a1a);
  border-color: var(--pink);
  color: var(--pink);
  box-shadow: 0 4px 0 var(--pink);
}

.sound-pad.drum:active,
.sound-pad.drum.playing {
  background: var(--pink);
  color: var(--black);
}

.sound-visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 60px;
  max-width: 400px;
  margin: 0 auto;
}

.viz-bar {
  width: 8px;
  background: var(--lime);
  border-radius: 4px 4px 0 0;
  transition: height 0.1s;
}

/* ---- Section 9: Reality Break Zone ---- */
.reality-section {
  background: var(--lime);
  overflow: hidden;
  position: relative;
}

.reality-zone {
  position: relative;
  min-height: 350px;
  max-width: 900px;
  margin: 0 auto;
}

.reality-text {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 2rem);
  position: absolute;
  cursor: default;
  transition: transform 0.2s, filter 0.2s;
  user-select: none;
}

.reality-text:hover {
  transform: scale(1.2) rotate(5deg);
  filter: invert(1);
  z-index: 5;
}

.overlap-1 { top: 10%; left: 5%; color: var(--pink); transform: rotate(-5deg); }
.overlap-2 { top: 30%; right: 10%; color: var(--black); transform: rotate(3deg); }
.overlap-3 { bottom: 40%; left: 25%; color: #fff; text-shadow: 2px 2px var(--black); transform: rotate(-2deg); }

.reality-btn {
  position: absolute;
  bottom: 15%;
  right: 15%;
  background: var(--black);
  color: var(--lime);
  border: 3px solid var(--pink);
  padding: 1rem 2rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  cursor: pointer;
  border-radius: 0;
  transform: rotate(7deg);
  z-index: 3;
  transition: transform 0.2s;
}

.reality-btn:hover {
  transform: rotate(-7deg) scale(1.1);
  background: var(--pink);
  color: var(--black);
}

.reality-blocks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.reality-block {
  position: absolute;
  width: 40px;
  height: 40px;
  border: 2px solid var(--black);
  animation: blockChaos 2s ease infinite;
}

@keyframes blockChaos {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(20px, -20px) rotate(180deg); }
}

.reality-section.broken .reality-text {
  animation: textGlitch 0.5s infinite;
}

@keyframes textGlitch {
  0%, 100% { transform: translate(0); }
  20% { transform: translate(-5px, 3px); }
  40% { transform: translate(5px, -3px); }
  60% { transform: translate(-3px, -5px); }
  80% { transform: translate(3px, 5px); }
}

/* ---- Section 10: Final Laugh ---- */
.final-section {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--lime);
  text-align: center;
  gap: 2rem;
}

.final-headline {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 5vw, 2.5rem);
  max-width: 600px;
}

.spin-zantri-btn {
  background: var(--lime);
  color: var(--black);
  border: 4px solid var(--pink);
  padding: 1.25rem 3rem;
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 4vw, 1.8rem);
  cursor: pointer;
  border-radius: 50px;
  box-shadow: 0 0 30px rgba(182, 255, 77, 0.5);
  transition: transform 0.2s var(--ease-bounce), box-shadow 0.2s;
  animation: btnPulse 2s ease infinite;
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 30px rgba(182, 255, 77, 0.5); }
  50% { box-shadow: 0 0 60px rgba(255, 79, 216, 0.6); }
}

.spin-zantri-btn:hover {
  transform: scale(1.1) rotate(-2deg);
}

.spin-zantri-btn:active {
  transform: scale(0.95);
}

.final-sub {
  color: #888;
  font-size: 0.95rem;
}

/* ---- Footer ---- */
.footer {
  background: var(--black);
  color: var(--lime);
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 3px solid var(--lime);
}

.footer-logo {
  font-family: var(--font-display);
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.footer-logo .dot { color: var(--pink); }

.footer-tag {
  color: #888;
  margin-bottom: 1rem;
}

.footer-copy {
  font-size: 0.8rem;
  color: #555;
}

/* ---- Chaos Overlay ---- */
.chaos-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s;
}

.chaos-overlay.active {
  opacity: 1;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(182, 255, 77, 0.1) 2px,
    rgba(182, 255, 77, 0.1) 4px
  );
  animation: overlayGlitch 0.2s steps(3) 3;
}

@keyframes overlayGlitch {
  0% { transform: translate(0); }
  33% { transform: translate(-5px, 3px); }
  66% { transform: translate(5px, -3px); }
  100% { transform: translate(0); }
}

@keyframes bodyGlitch {
  0%, 100% { filter: none; }
  50% { filter: hue-rotate(90deg) saturate(1.5); }
}

/* ---- Reduced Motion ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .wheel-segments {
    animation: none;
  }

  html { scroll-behavior: auto; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .section { padding: 3rem 1rem; }

  .dice-nav { top: 0.75rem; right: 0.75rem; }
  .dice-btn { width: 48px; height: 48px; font-size: 1.5rem; }

  .chaos-tile.wide { grid-column: span 1; }
  .chaos-tile.tall { grid-row: span 1; min-height: 120px; }

  .idea-canvas { height: 350px; }
  .sticky-universe { height: 350px; }
  .sticky-note { width: 120px; min-height: 100px; font-size: 0.75rem; }

  .reality-text { font-size: 1rem; }
  .overlap-1 { top: 5%; left: 2%; }
  .overlap-2 { top: 25%; right: 2%; }
  .overlap-3 { bottom: 50%; left: 10%; }

  .sound-pad { width: 60px; height: 60px; font-size: 0.9rem; }
}

@media (max-width: 480px) {
  .engine-levers { grid-template-columns: 1fr 1fr; }
  .game-card { flex: 0 0 180px; }
}
