:root {
  --acid-pink: #ff00cc;
  --acid-cyan: #00f5ff;
  --acid-lime: #aaff00;
  --acid-yellow: #ffe600;
  --acid-orange: #ff5500;
  --acid-violet: #9d00ff;
  --sdv-wood-dark: #4b2313;
  --sdv-wood-mid: #8e4720;
  --sdv-wood-light: #e09f4c;
  --sdv-parchment: #ffebc1;
  --sdv-parchment-shadow: #e6ba77;
  --font-display: 'Rubik Mono One', 'Bungee Shade', Impact, sans-serif;
  --font-pixel: 'Silkscreen', 'Press Start 2P', monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #120024;
  color: #ffffff;
  font-family: var(--font-pixel);
  touch-action: none;
}

img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.pixel-icon {
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  pointer-events: none;
}

/* ====== LAYERS ====== */
#gl-canvas,
#fx-canvas,
#sprite-stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
}

#gl-canvas {
  z-index: 0;
}

#fx-canvas {
  z-index: 1;
  pointer-events: none;
}

#sprite-stage {
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
}

/* Individual animated physics sprites */
.live-sprite {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
  pointer-events: auto;
  touch-action: none;
  cursor: grab;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.75)) drop-shadow(0 0 18px rgba(255, 0, 204, 0.55));
  transition: filter 0.15s ease;
}

.live-sprite:active {
  cursor: grabbing;
}

.live-sprite.shiny-glow {
  filter: drop-shadow(0 0 10px #ffe600) drop-shadow(0 0 24px #00f5ff) drop-shadow(0 0 36px #ff00cc);
}

.live-sprite.sdv-sprite {
  filter: drop-shadow(0 0 6px rgba(0, 245, 255, 0.9)) drop-shadow(0 0 14px rgba(170, 255, 0, 0.6));
}

.live-sprite:hover {
  filter: drop-shadow(0 0 14px #fff) drop-shadow(0 0 28px #ffe600) brightness(1.18);
}

/* ====== MARQUEE BARS ====== */
.marquee-bar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 20;
  height: 28px;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(90deg, #ff00cc, #9d00ff, #00f5ff, #aaff00, #ffe600, #ff00cc);
  background-size: 300% 100%;
  animation: rainbowShift 6s linear infinite;
  border-color: #000;
  box-shadow: 0 0 22px rgba(255, 0, 204, 0.8);
  pointer-events: none;
}

.marquee-top {
  top: 0;
  padding-top: env(safe-area-inset-top, 0px);
  height: calc(28px + env(safe-area-inset-top, 0px));
  border-bottom: 3px solid #000;
}

.marquee-bottom {
  bottom: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(28px + env(safe-area-inset-bottom, 0px));
  border-top: 3px solid #000;
}

.marquee-track {
  display: flex;
  gap: 36px;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 700;
  color: #090014;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  animation: marqueeScroll 28s linear infinite;
}

.marquee-reverse {
  animation-direction: reverse;
  animation-duration: 32s;
}

@keyframes marqueeScroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes rainbowShift {
  0% { background-position: 0% 50%; }
  100% { background-position: 300% 50%; }
}

/* ====== CHAOS HUD (TOP LEFT) ====== */
.chaos-hud {
  position: fixed;
  top: calc(38px + env(safe-area-inset-top, 0px));
  left: calc(12px + env(safe-area-inset-left, 0px));
  z-index: 25;
  min-width: 195px;
  padding: 8px 11px;
  background: linear-gradient(180deg, var(--sdv-parchment), var(--sdv-parchment-shadow));
  color: var(--sdv-wood-dark);
  border: 4px solid var(--sdv-wood-dark);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 3px var(--sdv-wood-light),
    0 0 0 2px #00f5ff,
    0 6px 24px rgba(0, 0, 0, 0.55);
  pointer-events: auto;
  transition: transform 0.2s ease;
}

.chaos-hud.hud-bump {
  transform: scale(1.08) rotate(-2deg);
}

.hud-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-row img {
  width: 30px;
  height: 30px;
}

.hud-label {
  font-size: 9px;
  letter-spacing: 0.08em;
  opacity: 0.8;
}

.hud-value {
  font-size: 11px;
  font-weight: 700;
  color: #8a00a8;
  text-shadow: 0 1px 0 #fff;
}

.hud-bar-wrap {
  margin-top: 6px;
  height: 10px;
  background: #2b0f0a;
  border: 2px solid var(--sdv-wood-dark);
  border-radius: 5px;
  overflow: hidden;
}

.hud-bar-fill {
  height: 100%;
  width: 12%;
  background: linear-gradient(90deg, #aaff00, #00f5ff, #ff00cc, #ffe600);
  background-size: 200% 100%;
  animation: rainbowShift 2s linear infinite;
  transition: width 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.hud-sub {
  margin-top: 5px;
  display: flex;
  justify-content: space-between;
  font-size: 10px;
}

.hud-sub strong {
  color: #c20078;
}

/* ====== TOP RIGHT PILLS ====== */
.top-right-badges {
  position: fixed;
  top: calc(38px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.pill-btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  padding: 8px 13px;
  min-height: 36px;
  border-radius: 999px;
  border: 3px solid #fff;
  background: rgba(18, 0, 42, 0.82);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 0 16px rgba(0, 245, 255, 0.65), 0 4px 0 #000;
  transition: transform 0.14s ease, box-shadow 0.14s ease, background 0.2s ease;
}

.pill-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 0 24px #ff00cc, 0 6px 0 #000;
}

.pill-btn:active {
  transform: translateY(2px) scale(0.96);
}

.pill-btn.sound-on {
  background: linear-gradient(90deg, #ff00cc, #9d00ff, #00f5ff);
  color: #05000f;
  border-color: #ffe600;
  box-shadow: 0 0 24px #ffe600, 0 4px 0 #000;
}

.sound-pulse {
  animation: soundPulse 1.6s ease-in-out infinite;
}

@keyframes soundPulse {
  0%, 100% { box-shadow: 0 0 12px #ff00cc, 0 4px 0 #000; }
  50% { box-shadow: 0 0 28px #ffe600, 0 0 44px #00f5ff, 0 4px 0 #000; }
}

/* ====== CENTERPIECE HERO SHRINE ====== */
.center-shrine {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: calc(106px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-right, 0px)) calc(96px + env(safe-area-inset-bottom, 0px)) calc(14px + env(safe-area-inset-left, 0px));
  pointer-events: none;
}

.hero-crown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-bottom: 10px;
  pointer-events: none;
}

.crown-float {
  width: 38px;
  height: 38px;
  animation: crownBob 2s ease-in-out infinite;
  filter: drop-shadow(0 0 12px #ffe600);
}

.crown-spin {
  width: 44px;
  height: 44px;
  animation: spinSlow 4s linear infinite, crownBob 1.5s ease-in-out infinite;
  filter: drop-shadow(0 0 16px #00f5ff);
}

.crown-poke {
  height: 54px;
  width: auto;
  animation: crownBob 1.8s ease-in-out infinite reverse;
  filter: drop-shadow(0 0 14px #aaff00);
}

@keyframes crownBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-10px) scale(1.1); }
}

@keyframes spinSlow {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.spin-slow {
  animation: spinSlow 5s linear infinite;
}

.hero-card {
  position: relative;
  max-width: min(920px, 94vw);
  padding: clamp(18px, 3.2vw, 34px) clamp(16px, 3.6vw, 44px);
  border-radius: 28px;
  text-align: center;
  background: radial-gradient(circle at 50% 45%, rgba(20, 0, 48, 0.72), rgba(7, 0, 20, 0.84));
  -webkit-backdrop-filter: blur(8px) saturate(1.6);
  backdrop-filter: blur(8px) saturate(1.6);
  border: 5px solid transparent;
  background-clip: padding-box;
  box-shadow:
    0 0 0 4px #000,
    0 0 0 8px #ff00cc,
    0 0 45px rgba(0, 245, 255, 0.8),
    0 0 90px rgba(255, 0, 204, 0.65),
    inset 0 0 36px rgba(157, 0, 255, 0.45);
  pointer-events: auto;
  transform-style: preserve-3d;
  transition: transform 0.12s ease-out;
  animation: borderPrism 4s linear infinite;
}

@keyframes borderPrism {
  0% { box-shadow: 0 0 0 4px #000, 0 0 0 8px #ff00cc, 0 0 45px #00f5ff, 0 0 90px #ff00cc, inset 0 0 36px rgba(255,0,204,0.35); }
  33% { box-shadow: 0 0 0 4px #000, 0 0 0 8px #00f5ff, 0 0 45px #aaff00, 0 0 90px #00f5ff, inset 0 0 36px rgba(0,245,255,0.35); }
  66% { box-shadow: 0 0 0 4px #000, 0 0 0 8px #ffe600, 0 0 45px #ff00cc, 0 0 90px #ffe600, inset 0 0 36px rgba(170,255,0,0.35); }
  100% { box-shadow: 0 0 0 4px #000, 0 0 0 8px #ff00cc, 0 0 45px #00f5ff, 0 0 90px #ff00cc, inset 0 0 36px rgba(255,0,204,0.35); }
}

.hero-kicker {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 230, 0, 0.18);
  border: 2px solid #ffe600;
  color: #ffe600;
  font-size: clamp(9px, 1.3vw, 12px);
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px #ff00cc;
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.1rem, 7.6vw, 5.6rem);
  line-height: 1.06;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.04em 0.24em;
}

.hero-word {
  display: inline-flex;
  white-space: nowrap;
}

.hero-char {
  display: inline-block;
  color: #fff;
  -webkit-text-stroke: clamp(2px, 0.35vw, 4px) #000;
  paint-order: stroke fill;
  text-shadow:
    0 3px 0 #ff00cc,
    0 6px 0 #9d00ff,
    0 9px 0 #00f5ff,
    0 12px 24px rgba(0, 0, 0, 0.9),
    0 0 28px rgba(255, 230, 0, 0.85);
  animation: charWave 2.1s ease-in-out infinite, charHue 3.5s linear infinite;
  animation-delay: calc(var(--i) * -0.11s);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.hero-char:hover {
  transform: scale(1.38) rotate(-10deg) translateY(-10px) !important;
  filter: brightness(1.4);
}

.hero-char.char-boing {
  animation: charBoing 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
}

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

@keyframes charHue {
  0% { color: #ffe600; }
  20% { color: #aaff00; }
  40% { color: #00f5ff; }
  60% { color: #ff66ff; }
  80% { color: #ff8800; }
  100% { color: #ffe600; }
}

@keyframes charBoing {
  0% { transform: scale(1) rotate(0deg); }
  30% { transform: scale(1.6, 0.6) rotate(18deg); }
  60% { transform: scale(0.75, 1.45) rotate(-14deg) translateY(-22px); }
  100% { transform: scale(1) rotate(0deg); }
}

.hero-sub {
  margin: 14px auto 18px;
  max-width: 620px;
  font-size: clamp(10px, 1.5vw, 13px);
  line-height: 1.55;
  color: #f4f0ff;
  text-shadow: 0 2px 6px #000;
}

/* ====== CTA BUTTONS ====== */
.cta-zone {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 68px;
}

.mega-btn {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-pixel);
  font-weight: 700;
  border-radius: 16px;
  border: 4px solid #000;
  padding: 14px 24px;
  font-size: clamp(13px, 2vw, 18px);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.14s ease;
}

.mega-yes {
  color: #070014;
  background: linear-gradient(110deg, #ffe600, #aaff00, #00f5ff, #ff00cc, #ffe600);
  background-size: 300% 300%;
  animation: rainbowShift 2.5s linear infinite, yesHeartbeat 1.2s ease-in-out infinite;
  box-shadow:
    0 6px 0 #000,
    0 0 28px rgba(170, 255, 0, 0.9),
    0 0 56px rgba(255, 0, 204, 0.75);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

.mega-yes:hover {
  transform: scale(1.1) rotate(-1.5deg);
  box-shadow:
    0 8px 0 #000,
    0 0 44px #ffe600,
    0 0 80px #00f5ff;
}

.mega-yes:active {
  transform: scale(0.94) translateY(4px);
}

.btn-ico {
  width: 28px;
  height: 28px;
}

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

.mega-no {
  color: #fff;
  background: linear-gradient(180deg, #ff2a55, #99002b);
  box-shadow: 0 6px 0 #000, 0 0 18px rgba(255, 42, 85, 0.65);
  font-size: clamp(11px, 1.5vw, 14px);
  padding: 12px 18px;
  position: relative;
  z-index: 30;
}

.mega-btn.escaped {
  position: fixed;
  z-index: 45;
  margin: 0;
  max-width: calc(100vw - 32px);
  transition: left 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), top 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.18s ease;
}

/* ====== VICTORY BANNER ====== */
.victory-banner {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(170, 255, 0, 0.25), rgba(0, 245, 255, 0.25), rgba(255, 0, 204, 0.3));
  border: 3px solid #ffe600;
  box-shadow: 0 0 36px rgba(255, 230, 0, 0.85), inset 0 0 24px rgba(0, 245, 255, 0.35);
  animation: victoryPop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes victoryPop {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.victory-title {
  font-size: clamp(13px, 2.2vw, 20px);
  color: #ffe600;
  text-shadow: 0 3px 0 #000, 0 0 16px #ff00cc;
  margin-bottom: 8px;
}

.victory-text {
  font-size: clamp(10px, 1.4vw, 13px);
  line-height: 1.5;
  color: #fff;
  text-shadow: 0 2px 4px #000;
}

.victory-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.mini-victory-btn {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  padding: 9px 14px;
  border-radius: 10px;
  border: 3px solid #000;
  background: #ffe600;
  color: #090014;
  box-shadow: 0 4px 0 #000, 0 0 14px #00f5ff;
  transition: transform 0.12s ease;
}

.mini-victory-btn:hover {
  transform: scale(1.07);
  background: #aaff00;
}

/* ====== STARDEW VALLEY RPG DIALOGUE TOAST ====== */
.sdv-dialog {
  position: fixed;
  left: calc(14px + env(safe-area-inset-left, 0px));
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  max-width: min(390px, calc(100vw - 28px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px)));
  display: flex;
  align-items: stretch;
  gap: 10px;
  padding: 10px;
  background: linear-gradient(180deg, var(--sdv-parchment), var(--sdv-parchment-shadow));
  color: var(--sdv-wood-dark);
  border: 4px solid var(--sdv-wood-dark);
  border-radius: 10px;
  box-shadow:
    inset 0 0 0 3px var(--sdv-wood-light),
    0 0 24px rgba(255, 0, 204, 0.7),
    0 8px 24px rgba(0, 0, 0, 0.65);
  pointer-events: auto;
  cursor: pointer;
  animation: sdvSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sdvSlideIn {
  0% { transform: translateY(24px) scale(0.85); opacity: 0; }
  100% { transform: translateY(0) scale(1); opacity: 1; }
}

.sdv-portrait-frame {
  flex: 0 0 64px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #d99b52;
  border: 3px solid var(--sdv-wood-dark);
  border-radius: 6px;
  padding: 4px;
}

.sdv-portrait-frame img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.sdv-speaker {
  margin-top: 2px;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  color: #361508;
}

.sdv-text-box {
  flex: 1;
  display: flex;
  align-items: center;
}

.sdv-quote {
  font-size: 11px;
  line-height: 1.45;
  color: #3a190c;
  font-weight: 700;
}

/* ====== BOTTOM INTERACTIVE CONTROL DOCK ====== */
.control-dock {
  position: fixed;
  bottom: calc(36px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 28;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  max-width: calc(100vw - 16px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-radius: 999px;
  background: rgba(12, 0, 32, 0.86);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 3px solid #00f5ff;
  box-shadow: 0 0 28px rgba(255, 0, 204, 0.75), 0 6px 20px rgba(0, 0, 0, 0.7);
}

.control-dock::-webkit-scrollbar {
  display: none;
}

.dock-btn {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-family: var(--font-pixel);
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  min-height: 38px;
  min-width: 38px;
  transition: transform 0.14s ease, background 0.18s ease, border-color 0.18s ease;
}

.dock-btn:hover {
  transform: translateY(-2px) scale(1.06);
  background: rgba(255, 0, 204, 0.45);
  border-color: #ffe600;
}

.dock-btn.active {
  background: linear-gradient(90deg, #ff00cc, #00f5ff);
  color: #090014;
  border-color: #ffe600;
  box-shadow: 0 0 16px #00f5ff;
}

/* ====== GACHA MODAL ====== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 0, 26, 0.78);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  touch-action: pan-y;
}

.gacha-box {
  position: relative;
  width: min(520px, 94vw);
  max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 24px 20px;
  border-radius: 24px;
  text-align: center;
  background: linear-gradient(180deg, #25004d, #0f0024);
  border: 5px solid #ffe600;
  box-shadow: 0 0 0 4px #000, 0 0 55px #ff00cc, 0 0 90px #00f5ff;
  animation: victoryPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #000;
  background: #ff2a55;
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
}

.gacha-title {
  margin: 0 0 8px;
  font-size: clamp(14px, 2.6vw, 20px);
  color: #ffe600;
  text-shadow: 0 3px 0 #000, 0 0 16px #ff00cc;
}

.gacha-desc {
  margin: 0 0 16px;
  font-size: 11px;
  color: #d8c8ff;
}

.gacha-reels {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.reel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--sdv-parchment), var(--sdv-parchment-shadow));
  border: 4px solid var(--sdv-wood-dark);
  box-shadow: inset 0 0 0 3px var(--sdv-wood-light), 0 0 18px rgba(0, 245, 255, 0.6);
  color: #3a190c;
  min-height: 116px;
}

.reel img {
  width: 58px;
  height: 58px;
  object-fit: contain;
}

.reel span {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.reel.spinning {
  animation: reelShake 0.1s linear infinite;
  box-shadow: 0 0 28px #ffe600;
}

@keyframes reelShake {
  0% { transform: translateY(-4px) scale(1.03); }
  50% { transform: translateY(4px) scale(0.97); }
  100% { transform: translateY(-4px) scale(1.03); }
}

.gacha-result {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  margin-bottom: 16px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.45);
  border: 2px solid #00f5ff;
  font-size: 11px;
  line-height: 1.5;
  color: #aaff00;
}

.gacha-spin-btn {
  width: 100%;
}

/* ====== SCREEN SHAKE & HYPER OVERDRIVE ====== */
body.screen-shake {
  animation: screenShake 0.35s ease;
}

@keyframes screenShake {
  0% { transform: translate(0, 0) rotate(0deg); }
  20% { transform: translate(-8px, 6px) rotate(-0.8deg); }
  40% { transform: translate(8px, -6px) rotate(0.8deg); }
  60% { transform: translate(-6px, -4px) rotate(-0.5deg); }
  80% { transform: translate(5px, 4px) rotate(0.5deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

body.victory-mode .hero-card {
  animation: borderPrism 1.1s linear infinite, victoryFloat 2.2s ease-in-out infinite;
}

@keyframes victoryFloat {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-8px) scale(1.02); }
}

.hidden {
  display: none !important;
}

/* Prevent sticky hover effects on iOS / touch devices */
@media (hover: none) {
  .pill-btn:hover,
  .dock-btn:hover,
  .mega-yes:hover,
  .hero-char:hover,
  .live-sprite:hover {
    transform: none;
    filter: none;
  }
}

/* ====== RESPONSIVE MOBILE TUNING ====== */
@media (max-width: 680px) {
  .marquee-bar {
    height: 24px;
  }
  .marquee-top {
    height: calc(24px + env(safe-area-inset-top, 0px));
  }
  .marquee-bottom {
    height: calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .marquee-track {
    font-size: 10px;
  }
  .chaos-hud {
    min-width: 132px;
    max-width: 46vw;
    padding: 5px 7px;
    top: calc(30px + env(safe-area-inset-top, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    border-width: 3px;
  }
  .hud-row img {
    width: 22px;
    height: 22px;
  }
  .hud-label {
    font-size: 7px;
  }
  .hud-value {
    font-size: 8.5px;
    line-height: 1.15;
  }
  .hud-bar-wrap {
    height: 8px;
    margin-top: 4px;
  }
  .hud-sub {
    font-size: 8.5px;
  }
  .top-right-badges {
    top: calc(30px + env(safe-area-inset-top, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    gap: 5px;
    max-width: 48vw;
  }
  .pill-btn {
    font-size: 9px;
    padding: 6px 10px;
    min-height: 34px;
    border-width: 2px;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .center-shrine {
    padding: calc(108px + env(safe-area-inset-top, 0px)) 10px calc(92px + env(safe-area-inset-bottom, 0px));
  }
  .hero-crown {
    gap: 8px;
    margin-bottom: 6px;
  }
  .crown-poke {
    height: 36px;
  }
  .crown-float,
  .crown-spin {
    width: 26px;
    height: 26px;
  }
  .hero-card {
    max-width: 96vw;
    padding: 14px 12px 16px;
    border-radius: 22px;
  }
  .hero-kicker {
    font-size: 8px;
    padding: 3px 9px;
    margin-bottom: 8px;
  }
  .hero-title {
    font-size: clamp(1.75rem, 8.6vw, 3.1rem);
  }
  .hero-sub {
    font-size: 10px;
    margin: 10px auto 12px;
    line-height: 1.45;
  }
  .cta-zone {
    gap: 10px;
    min-height: 54px;
  }
  .mega-btn {
    padding: 12px 16px;
    min-height: 46px;
    font-size: 13px;
    border-width: 3px;
    border-radius: 14px;
  }
  .btn-ico {
    width: 22px;
    height: 22px;
  }
  .victory-banner {
    padding: 12px;
    margin-top: 12px;
  }
  .victory-title {
    font-size: 13px;
  }
  .victory-text {
    font-size: 10px;
  }
  .control-dock {
    bottom: calc(30px + env(safe-area-inset-bottom, 0px));
    padding: 5px 6px;
    gap: 6px;
  }
  .dock-btn {
    padding: 8px 10px;
    min-width: 42px;
    min-height: 42px;
    font-size: 15px;
  }
  .dock-label {
    display: none;
  }
  .sdv-dialog {
    bottom: calc(88px + env(safe-area-inset-bottom, 0px));
    left: calc(8px + env(safe-area-inset-left, 0px));
    right: calc(8px + env(safe-area-inset-right, 0px));
    max-width: none;
    padding: 8px;
  }
  .sdv-portrait-frame {
    flex: 0 0 48px;
  }
  .sdv-portrait-frame img {
    width: 34px;
    height: 34px;
  }
  .sdv-quote {
    font-size: 9.5px;
  }
  .gacha-box {
    padding: 18px 14px;
  }
  .reel {
    min-height: 94px;
    padding: 10px 4px;
  }
  .reel img {
    width: 46px;
    height: 46px;
  }
}

/* Very small phones (iPhone SE / 360px wide) */
@media (max-width: 380px) {
  .hero-title {
    font-size: 1.62rem;
  }
  .hero-crown {
    display: none;
  }
  .chaos-hud {
    min-width: 118px;
  }
  .hud-row img {
    display: none;
  }
}

/* Mobile landscape orientation (iPhone rotated sideways) */
@media (max-height: 520px) {
  .hero-crown,
  .hero-kicker,
  .hero-sub {
    display: none;
  }
  .center-shrine {
    padding: calc(44px + env(safe-area-inset-top, 0px)) 16px calc(76px + env(safe-area-inset-bottom, 0px));
  }
  .hero-card {
    padding: 10px 18px;
    border-radius: 18px;
  }
  .hero-title {
    font-size: clamp(1.4rem, 5.2vw, 2.5rem);
  }
  .cta-zone {
    margin-top: 8px;
    min-height: 44px;
  }
  .mega-btn {
    padding: 8px 14px;
    min-height: 40px;
    font-size: 12px;
  }
  .sdv-dialog {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  }
}
