* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, sans-serif;
}
html, body { overflow-x: hidden; width: 100%; }
.container { width: 100% !important; max-width: 400px !important; }

body {
  min-height: 100vh;
  background: linear-gradient(140deg, #eef4ff, #f8f8f8);
  color: #101827;
}

.hidden {
  display: none !important;
}

body.in-game {
  background: linear-gradient(145deg, #0f172a, #111827 55%, #1e293b);
  color: #e5e7eb;
}

.bg-scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

body.in-game .bg-scene {
  opacity: 0.92;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.5;
}

.orb-one {
  width: 320px;
  height: 320px;
  left: -80px;
  top: -70px;
  background: radial-gradient(circle, rgba(255, 93, 93, 0.42), rgba(255, 93, 93, 0));
  animation: drift-one 16s ease-in-out infinite alternate;
}

body.in-game .orb-one {
  background: radial-gradient(circle, rgba(255, 60, 60, 0.32), rgba(255, 60, 60, 0));
}

.orb-two {
  width: 360px;
  height: 360px;
  right: -90px;
  top: 20%;
  background: radial-gradient(circle, rgba(76, 147, 255, 0.4), rgba(76, 147, 255, 0));
  animation: drift-two 18s ease-in-out infinite alternate;
}

body.in-game .orb-two {
  background: radial-gradient(circle, rgba(70, 120, 255, 0.3), rgba(70, 120, 255, 0));
}

.orb-three {
  width: 280px;
  height: 280px;
  left: 30%;
  bottom: -120px;
  background: radial-gradient(circle, rgba(255, 211, 92, 0.34), rgba(255, 211, 92, 0));
  animation: drift-three 14s ease-in-out infinite alternate;
}

.orb-four {
  width: 260px;
  height: 260px;
  right: 25%;
  bottom: -90px;
  background: radial-gradient(circle, rgba(71, 85, 105, 0.34), rgba(71, 85, 105, 0));
  animation: drift-four 20s ease-in-out infinite alternate;
}

body.in-game .orb-four {
  background: radial-gradient(circle, rgba(30, 41, 59, 0.5), rgba(30, 41, 59, 0));
}

.grid-flow {
  position: absolute;
  inset: -20%;
  opacity: 0.2;
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.18) 1px, transparent 1px);
  background-size: 46px 46px;
  transform: perspective(500px) rotateX(55deg) translateY(20%);
  animation: grid-slide 18s linear infinite;
}

#canvas-container {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: auto;
  /* Allow interaction with Three.js canvas */
}

.hero-transition {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.88), rgba(3, 7, 18, 0.98));
  overflow: hidden;
}

.hero-transition::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: repeating-linear-gradient(120deg,
      rgba(255, 255, 255, 0.04) 0px,
      rgba(255, 255, 255, 0.04) 2px,
      transparent 2px,
      transparent 24px);
  animation: transition-streaks 1.8s linear infinite;
}

.hero-transition::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0));
  opacity: 0;
  transform: scale(0.7);
}

.hero-transition.impact::after {
  animation: transition-flash 650ms ease-out forwards;
}

.transition-symbol {
  position: absolute;
  opacity: 0;
  transform: scale(0.3) rotateY(0deg);
  will-change: transform, opacity, filter;
}

.bat-icon {
  font-size: 90px;
  filter: drop-shadow(0 0 18px rgba(203, 213, 225, 0.45));
}

.diamond-shape {
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #e11d48, #2563eb);
  border: 3px solid #facc15;
  transform: rotate(45deg);
  box-shadow: 0 0 26px rgba(248, 113, 113, 0.4);
}

.s-glyph {
  color: #fff7cc;
  font-weight: 900;
  font-size: 44px;
  transform: rotate(-45deg);
}

.hero-transition.show-batman .batman-symbol {
  animation: hero-reveal-batman 2.5s ease-in-out forwards;
}

.hero-transition.show-superman .superman-symbol {
  animation: hero-reveal-superman 2.5s ease-in-out forwards;
}

body.cinematic-shake {
  animation: camera-shake 420ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.start-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 20px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.start-screen * {
  pointer-events: auto;
}

.start-card {
  width: min(620px, 94vw);
  background: rgba(10, 15, 30, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.6);
  text-align: center;
  backdrop-filter: blur(10px);
}

.start-card h1 {
  margin-bottom: 8px;
  font-size: 34px;
  color: #fff;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.start-card p {
  margin-bottom: 20px;
  color: #9ca3af;
}

.choice-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.choice-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}

.superman-btn {
  background: linear-gradient(135deg, #ef4444, #2563eb);
}

.batman-btn {
  background: linear-gradient(135deg, #111827, #374151);
}

.game-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  padding: 20px;
  place-items: center;
  align-content: center;
  position: relative;
  z-index: 2;
}

.scoreboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 220px));
  gap: 12px;
  justify-content: center;
}

.score-card {
  --iconScale: 1;
  --iconGlow: 0.4;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 10px 22px rgba(16, 24, 39, 0.08);
  transition: box-shadow 260ms ease;
  text-align: center;
  backdrop-filter: blur(4px);
}

.superman-card {
  border: 2px solid rgba(239, 68, 68, 0.22);
}

.batman-card {
  border: 2px solid rgba(17, 24, 39, 0.26);
}

.score-card h3 {
  margin-top: 8px;
  margin-bottom: 4px;
}

.score-card p {
  margin: 2px 0;
  color: #344054;
}

.chance {
  font-weight: 700;
}

.duel-pulse {
  animation: duel-pulse 540ms ease;
}

.duel-avatar {
  position: relative;
  width: 66px;
  height: 82px;
  margin: 0 auto;
  overflow: visible;
}

.score-card .duel-avatar .mini-character {
  transform-origin: center bottom;
  scale: var(--iconScale);
  filter: drop-shadow(0 0 calc(8px * var(--iconGlow)) rgba(255, 208, 76, 0.6));
  transition: scale 240ms ease, filter 240ms ease;
}

.batman-card .duel-avatar .mini-character {
  filter: drop-shadow(0 0 calc(8px * var(--iconGlow)) rgba(80, 104, 170, 0.6));
}

.container {
  text-align: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(16, 24, 39, 0.1);
  padding: 22px;
  width: max-content;
  margin-inline: auto;
  backdrop-filter: blur(5px);
}

body.in-game .container,
body.in-game .score-card {
  background: rgba(15, 23, 42, 0.62);
  color: #e5e7eb;
  border-color: rgba(148, 163, 184, 0.3);
}

body.in-game .score-card p {
  color: #cbd5e1;
}

body.in-game .cell {
  background: rgba(226, 232, 240, 0.96);
}

h2 {
  margin-bottom: 10px;
}

#status {
  margin-bottom: 14px;
  font-size: 18px;
  font-weight: 700;
}

.board {
  display: grid;
  grid-template-columns: repeat(3, 90px);
  grid-template-rows: repeat(3, 90px);
  gap: 8px;
  justify-content: center;
  margin-bottom: 14px;
  position: relative;
}

.cell {
  position: relative;
  width: 90px;
  height: 90px;
  border: 2px solid #334155;
  border-radius: 10px;
  background: #fafcff;
  cursor: pointer;
  transition: background .2s, transform .12s, box-shadow .2s;
  overflow: hidden;
}

.cell:hover {
  background: #f0f6ff;
}

.cell:active {
  transform: scale(.97);
}

.mini-character,
.mini-character * {
  position: absolute;
  box-sizing: border-box;
}

.mini-character {
  width: 42px;
  height: 54px;
  left: 18px;
  top: 18px;
  z-index: 2;
  transform-origin: center center;
}

.mini-character .head {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  left: 14px;
  top: 2px;
  background: #f5cfb2;
}

.mini-character .body {
  width: 18px;
  height: 22px;
  left: 12px;
  top: 14px;
  border-radius: 6px;
}

.mini-character .arm {
  width: 14px;
  height: 6px;
  right: -4px;
  top: 19px;
  border-radius: 6px;
  transform-origin: left center;
}

.mini-character .leg {
  width: 16px;
  height: 14px;
  left: 13px;
  bottom: 0;
  border-radius: 0 0 6px 6px;
}

.mini-character .cape {
  width: 20px;
  height: 24px;
  left: 2px;
  top: 14px;
  border-radius: 8px 2px 10px 10px;
  z-index: -1;
}

.superman .body {
  background: #2563eb;
  border: 2px solid #ffd447;
}

.superman .arm,
.superman .leg {
  background: #e11d48;
}

.superman .cape {
  background: linear-gradient(180deg, #dc2626, #991b1b);
}

.batman .head {
  background: #171717;
}

.batman .body {
  background: #1f2937;
  border: 2px solid #facc15;
}

.batman .arm,
.batman .leg {
  background: #111827;
}

.batman .cape {
  background: linear-gradient(180deg, #111827, #030712);
}

.batman .ear {
  width: 5px;
  height: 8px;
  top: -2px;
  background: #111827;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.batman .ear-left {
  left: 14px;
}

.batman .ear-right {
  left: 23px;
}

/* Characters face each other in scoreboard */
.superman-card .mini-character {
  transform: scaleX(1);
  left: 12px;
  top: 12px;
}

.batman-card .mini-character {
  transform: scaleX(-1);
  left: 12px;
  top: 12px;
}

/* In board: Superman faces right, Batman faces left */
.cell .superman {
  transform: scaleX(1);
}

.cell .batman {
  transform: scaleX(-1);
}

.cell.mark-superman .mini-character {
  animation: superman-enter 720ms cubic-bezier(0.22, 0.92, 0.24, 1) forwards;
}

.cell.mark-superman .mini-character .arm {
  animation: superman-punch-arm 500ms ease-out 340ms forwards;
}

.cell.mark-superman .mini-character .cape {
  animation: cape-wave 650ms ease-out;
}

.cell.mark-batman .mini-character {
  animation: batman-enter 760ms cubic-bezier(0.22, 0.88, 0.24, 1) forwards;
}

.cell.mark-batman .mini-character .arm {
  animation: batman-throw-arm 540ms ease-out 300ms forwards;
}

.cell.mark-batman .mini-character .cape {
  animation: cape-wave 680ms ease-out;
}

.action {
  position: absolute;
  z-index: 3;
  pointer-events: none;
}

.action-punch {
  left: 52px;
  top: 34px;
  width: 18px;
  height: 18px;
  background: radial-gradient(circle, #fde047 20%, #f97316 70%);
  clip-path: polygon(50% 0%, 63% 34%, 100% 50%, 63% 66%, 50% 100%, 37% 66%, 0% 50%, 37% 34%);
  opacity: 0;
  animation: punch-blast 620ms ease-out 360ms forwards;
}

.action-batarang {
  left: 38px;
  top: 35px;
  width: 16px;
  height: 10px;
  border: 2px solid #111827;
  border-left: none;
  border-right: none;
  border-radius: 999px;
  opacity: 0;
  transform-origin: center;
  animation: batarang-fly 760ms ease-out 320ms forwards;
}

.win-cell {
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.86);
}

.win-superman {
  background: linear-gradient(145deg, #fffbe8, #ffe99f);
  animation: win-cell-pulse-light 900ms ease-in-out infinite;
}

.win-batman {
  background: linear-gradient(145deg, #36405a, #1f2937);
  color: #fff;
  animation: win-cell-pulse-dark 900ms ease-in-out infinite;
}


.victory-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 25;
  pointer-events: none;
  opacity: 1;
  transition: opacity 500ms ease;
}

.victory-overlay.superman {
  background: radial-gradient(circle at center, rgba(255, 243, 186, .18), rgba(255, 255, 255, 0));
}

.victory-overlay.batman {
  background: radial-gradient(circle at center, rgba(33, 42, 64, .28), rgba(0, 0, 0, .06));
}

.victory-overlay.exit {
  opacity: 0;
}

.victory-burst {
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
}

.victory-overlay.superman .victory-burst {
  background: radial-gradient(circle, rgba(255, 248, 189, .95) 0%, rgba(255, 228, 90, .35) 38%, rgba(255, 221, 77, 0) 70%);
}

.victory-overlay.batman .victory-burst {
  background: radial-gradient(circle, rgba(69, 82, 110, .8) 0%, rgba(26, 33, 51, .42) 38%, rgba(10, 14, 25, 0) 70%);
}

.victory-actor {
  position: absolute;
  width: 62px;
  height: 80px;
  left: 50%;
  top: 50%;
  margin-left: -31px;
  margin-top: -40px;
  animation-fill-mode: forwards;
}

.victory-actor .mini-character {
  width: 62px;
  height: 80px;
  left: 0;
  top: 0;
}

.victory-actor .mini-character .head {
  width: 18px;
  height: 18px;
  left: 22px;
  top: 4px;
}

.victory-actor .mini-character .body {
  width: 26px;
  height: 34px;
  left: 18px;
  top: 20px;
}

.victory-actor .mini-character .arm {
  width: 18px;
  height: 8px;
  right: -6px;
  top: 30px;
}

.victory-actor .mini-character .leg {
  width: 20px;
  height: 20px;
  left: 20px;
  bottom: 0;
}

.victory-actor .mini-character .cape {
  width: 28px;
  height: 36px;
  left: 2px;
  top: 22px;
}

.victory-overlay.superman .victory-actor {
  animation: actor-spawn-superman 2300ms ease forwards;
}

.victory-overlay.batman .victory-actor {
  animation: actor-spawn-batman 2300ms ease forwards;
}

.victory-overlay .actor-1 {
  --sx: -220px;
  --sy: -100px;
}

.victory-overlay .actor-2 {
  --sx: 220px;
  --sy: -95px;
}

.victory-overlay .actor-3 {
  --sx: -200px;
  --sy: 90px;
}

.victory-overlay .actor-4 {
  --sx: 205px;
  --sy: 96px;
}

.victory-overlay .actor-5 {
  --sx: 0px;
  --sy: -170px;
}

.reset-btn {
  padding: 10px 16px;
  border: none;
  border-radius: 8px;
  background: #0077ff;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
}

.reset-btn:hover {
  background: #005fd1;
}

/* Draw Cinematic Base */
.draw-cinematic {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: opacity 1s ease;
}

.draw-actor {
  position: absolute;
  transform: scale(2);
  top: 50%;
  width: 100px;
  height: 100px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: -50px;
}

.draw-superman {
  left: -100px;
  animation: slideInSuperman 1s ease forwards, moveToCenterSuper 1.5s ease-in 2.5s forwards;
}

.draw-batman {
  right: -100px;
  animation: slideInBatman 1s ease forwards, moveToCenterBat 1.5s ease-in 2.5s forwards;
}

.draw-superbat {
  left: 50%;
  transform: translate(-50%, -50%) scale(2);
}

/* The SuperBat character styles: a half-and-half design */
.superbat .head {
  background: linear-gradient(90deg, #f5cfb2 50%, #171717 50%);
}

.superbat .body {
  background: linear-gradient(90deg, #2563eb 50%, #1f2937 50%);
  border: 2px solid;
  border-image: linear-gradient(90deg, #ffd447 50%, #facc15 50%) 1;
}

.superbat .arm {
  background: linear-gradient(90deg, #e11d48 50%, #111827 50%);
}

.superbat .leg {
  background: linear-gradient(90deg, #e11d48 50%, #111827 50%);
}

.superbat .cape {
  background: linear-gradient(90deg, #dc2626 50%, #030712 50%);
}

.superbat.flip-grow {
  transform-origin: center center;
  animation: superbatFlipGrow 3s ease-in-out forwards;
}

@keyframes superman-enter {
  0% {
    opacity: 0;
    transform: translateX(-52px) translateY(-18px) scale(.52) rotate(-14deg);
  }

  60% {
    opacity: 1;
    transform: translateX(4px) translateY(0) scale(1.06) rotate(4deg);
  }

  100% {
    opacity: 1;
    transform: translateX(8px) translateY(0) scale(1.02) rotate(0);
  }
}

@keyframes superman-punch-arm {
  0% {
    transform: rotate(0) scaleX(1);
  }

  65% {
    transform: rotate(-8deg) scaleX(1.15);
  }

  100% {
    transform: rotate(-4deg) scaleX(1.08);
  }
}

@keyframes batman-enter {
  0% {
    opacity: 0;
    transform: translateY(20px) scale(.55) rotate(12deg);
  }

  45% {
    opacity: 1;
    transform: translateY(0) scale(1.03) rotate(0);
  }

  72% {
    transform: translateX(-3px) scale(1.03) rotate(-8deg);
  }

  100% {
    opacity: 1;
    transform: translateX(0) scale(1) rotate(0);
  }
}

@keyframes batman-throw-arm {
  0% {
    transform: rotate(0) scaleX(1);
  }

  60% {
    transform: rotate(-38deg) scaleX(1.15);
  }

  100% {
    transform: rotate(-12deg) scaleX(1.05);
  }
}

@keyframes punch-blast {
  0% {
    opacity: 0;
    transform: scale(.3) translateX(-8px);
  }

  35% {
    opacity: 1;
    transform: scale(1.15) translateX(8px);
  }

  100% {
    opacity: 0;
    transform: scale(.8) translateX(14px);
  }
}

@keyframes batarang-fly {
  0% {
    opacity: 0;
    transform: translateX(0) rotate(0) scale(.55);
  }

  10% {
    opacity: 1;
    transform: translateX(6px) rotate(120deg) scale(1);
  }

  70% {
    opacity: 1;
    transform: translateX(42px) rotate(920deg) scale(.95);
  }

  100% {
    opacity: 0;
    transform: translateX(54px) rotate(1140deg) scale(.42);
  }
}

@keyframes cape-wave {
  0% {
    transform: skewY(0);
  }

  35% {
    transform: skewY(12deg);
  }

  70% {
    transform: skewY(-7deg);
  }

  100% {
    transform: skewY(0);
  }
}

@keyframes win-cell-pulse-light {

  0%,
  100% {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .92), 0 0 14px rgba(255, 215, 66, .5);
  }

  50% {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .95), 0 0 22px rgba(255, 215, 66, .95);
  }
}

@keyframes win-cell-pulse-dark {

  0%,
  100% {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .15), 0 0 14px rgba(24, 39, 72, .55);
  }

  50% {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .2), 0 0 22px rgba(24, 39, 72, .95);
  }
}

@keyframes duel-pulse {
  0% {
    box-shadow: 0 10px 22px rgba(16, 24, 39, 0.08);
  }

  50% {
    box-shadow: 0 14px 26px rgba(16, 24, 39, 0.16);
  }

  100% {
    box-shadow: 0 10px 22px rgba(16, 24, 39, 0.08);
  }
}

@keyframes actor-spawn-superman {
  0% {
    opacity: 0;
    transform: translate(var(--sx), var(--sy)) scale(.15) rotate(-16deg);
  }

  28% {
    opacity: 1;
    transform: translate(calc(var(--sx) * .48), calc(var(--sy) * .48)) scale(.95) rotate(0);
  }

  56% {
    opacity: 1;
    transform: translate(calc(var(--sx) * .15), calc(var(--sy) * .15)) scale(.86) rotate(0);
  }

  78% {
    opacity: 1;
    transform: translate(0, 0) scale(.78) rotate(0);
  }

  100% {
    opacity: 0;
    transform: translate(0, -280px) scale(.2) rotate(8deg);
  }
}

@keyframes actor-spawn-batman {
  0% {
    opacity: 0;
    transform: translate(var(--sx), var(--sy)) scale(.15) rotate(14deg);
  }

  30% {
    opacity: 1;
    transform: translate(calc(var(--sx) * .52), calc(var(--sy) * .52)) scale(.96) rotate(0);
  }

  58% {
    opacity: 1;
    transform: translate(calc(var(--sx) * .2), calc(var(--sy) * .2)) scale(.84) rotate(0);
  }

  80% {
    opacity: 1;
    transform: translate(0, 0) scale(.76) rotate(0);
  }

  100% {
    opacity: 0;
    transform: translate(0, -240px) scale(.2) rotate(-8deg);
  }
}

@keyframes drift-one {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(80px, 45px);
  }
}

@keyframes drift-two {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-70px, 70px);
  }
}

@keyframes drift-three {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(-90px, -55px);
  }
}

@keyframes drift-four {
  0% {
    transform: translate(0, 0);
  }

  100% {
    transform: translate(70px, -70px);
  }
}

@keyframes grid-slide {
  from {
    background-position: 0 0, 0 0;
  }

  to {
    background-position: 0 110px, 110px 0;
  }
}

@keyframes transition-streaks {
  from {
    transform: translateX(-60px);
  }

  to {
    transform: translateX(60px);
  }
}

@keyframes hero-reveal-batman {
  0% {
    opacity: 0;
    transform: scale(0.2) rotateY(0deg);
    filter: blur(2px);
  }

  20% {
    opacity: 1;
    transform: scale(0.75) rotateY(180deg);
    filter: blur(0);
  }

  62% {
    opacity: 1;
    transform: scale(2.4) rotateY(980deg);
    filter: drop-shadow(0 0 28px rgba(226, 232, 240, 0.8));
  }

  100% {
    opacity: 0;
    transform: scale(4.1) rotateY(1320deg);
    filter: blur(2px);
  }
}

@keyframes hero-reveal-superman {
  0% {
    opacity: 0;
    transform: scale(0.2) rotateY(0deg);
    filter: blur(2px);
  }

  20% {
    opacity: 1;
    transform: scale(0.72) rotateY(180deg);
    filter: blur(0);
  }

  62% {
    opacity: 1;
    transform: scale(2.4) rotateY(980deg);
    filter: drop-shadow(0 0 30px rgba(250, 204, 21, 0.85));
  }

  100% {
    opacity: 0;
    transform: scale(4.1) rotateY(1320deg);
    filter: blur(2px);
  }
}

@keyframes transition-flash {
  0% {
    opacity: 0;
    transform: scale(0.4);
  }

  26% {
    opacity: 0.92;
    transform: scale(1);
  }

  100% {
    opacity: 0;
    transform: scale(1.7);
  }
}

@keyframes camera-shake {
  0% {
    transform: translate(0, 0);
  }

  20% {
    transform: translate(-3px, 2px);
  }

  40% {
    transform: translate(3px, -2px);
  }

  60% {
    transform: translate(-2px, -1px);
  }

  80% {
    transform: translate(2px, 1px);
  }

  100% {
    transform: translate(0, 0);
  }
}

@keyframes slideInSuperman {
  to {
    left: 20%;
  }
}

@keyframes slideInBatman {
  to {
    right: 20%;
  }
}

@keyframes moveToCenterSuper {
  to {
    left: 50%;
    transform: translateX(-50%) scale(2);
    opacity: 0;
  }
}

@keyframes moveToCenterBat {
  to {
    right: 50%;
    transform: translateX(50%) scale(2);
    opacity: 0;
  }
}

@keyframes superbatFlipGrow {
  0% {
    transform: translate(-50%, -50%) scale(2) rotateY(0deg);
    opacity: 0;
  }

  10% {
    transform: translate(-50%, -50%) scale(2) rotateY(0deg);
    opacity: 1;
    filter: brightness(2);
  }

  20% {
    transform: translate(-50%, -50%) scale(2) rotateY(0deg);
    opacity: 1;
    filter: drop-shadow(0 0 40px #fff);
  }

  50% {
    transform: translate(-50%, -50%) scale(4) rotateY(720deg);
    opacity: 1;
  }

  100% {
    transform: translate(-50%, -50%) scale(80) rotateY(1800deg);
    opacity: 1;
    background-color: rgba(0, 0, 0, 1);
  }
}

@media (max-width: 980px) {
  .game-shell {
    grid-template-columns: 1fr;
  }

  .scoreboard {
    grid-template-columns: 1fr 1fr;
    width: min(460px, 94vw);
  }
}

/* Splash Screen with 3 Second Timing */
.splash-screen { position: fixed; inset: 0; background: #0f172a; z-index: 9999; display: grid; place-items: center; animation: fadeOutSplash 0.5s ease 2.5s forwards; }
.bunny-logo { text-align: center; animation: popInBounce 0.8s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards; }
.logo-crown { font-size: 50px; margin-bottom: -15px; animation: glowCrown 1.5s alternate infinite; display: block; filter: drop-shadow(0 0 15px rgba(250, 204, 21, 0.8)); }
.logo-text { font-size: 60px; font-weight: 900; color: #fff; letter-spacing: 2px; }
@keyframes fadeOutSplash { to { opacity: 0; visibility: hidden; } }
@keyframes popInBounce { 0% { transform: scale(0); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes glowCrown { 
  0% { transform: translateY(0) rotate(-10deg); filter: drop-shadow(0 0 10px #fbbf24); } 
  50% { transform: translateY(-10px) rotate(10deg); filter: drop-shadow(0 0 45px #fef08a); }
  100% { transform: translateY(0) rotate(-10deg); filter: drop-shadow(0 0 10px #fbbf24); }
}

/* Mobile Optimization Overrides For Game 1 */
@media (max-width: 600px) {
  .board { grid-template-columns: repeat(3, min(24vw, 80px)); grid-template-rows: repeat(3, min(24vw, 80px)); gap: 4px; }
  .cell { width: 100%; height: 100%; }
  .mini-character { transform: scale(0.65); left: 6px; top: 6px; }
  .action-punch { transform: scale(0.7); left: 30px; top: 20px; }
  .action-batarang { transform: scale(0.7); left: 20px; top: 20px; }
  .scoreboard { grid-template-columns: 1fr 1fr; width: 100%; gap: 6px; }
  .score-card { padding: 5px; }
  .score-card h3 { font-size: 14px; margin-top: 4px; }
  .score-card p { font-size: 12px; }
  .duel-avatar { width: 50px; height: 60px; }
  .superman-card .mini-character { transform: scaleX(0.7) scaleY(0.7); left: 8px; top: 8px; }
  .batman-card .mini-character { transform: scaleX(-0.7) scaleY(0.7); left: 8px; top: 8px; }
  .start-card { padding: 15px; }
  .start-card h1 { font-size: 24px; }
  h2 { font-size: 20px; }
  .draw-actor { width: 60px; height: 60px; transform: scale(1.2); }
  #status { font-size: 16px; }
  .container { padding: 12px; }
}