:root {
  --bg-dark: #050510;
  --bg-card: #0c0c1e;
  --bg-mid: #141428;
  --accent-red: #ff2244;
  --accent-blue: #4488ff;
  --accent-green: #33ff66;
  --accent-purple: #cc44ff;
  --accent-orange: #ff8800;
  --accent-gold: #ffdd00;
  --accent-cyan: #00ffcc;
  --text-primary: #d0ffd0;
  --text-secondary: #6a9a7a;
  --crt-glow: rgba(0, 255, 128, 0.03);
  --scanline-color: rgba(0, 0, 0, 0.1);
  --phosphor-green: #33ff66;
}

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

body {
  background: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100vh;
  overflow-x: hidden;
  image-rendering: pixelated;
}

/* Starfield / cosmic background */
body::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(1px 1px at 10% 20%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 50% 40%, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 70% 80%, rgba(255,255,255,0.2), transparent),
    radial-gradient(1px 1px at 90% 10%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 15% 90%, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 85% 50%, rgba(255,255,255,0.35), transparent),
    radial-gradient(1px 1px at 45% 15%, rgba(255,255,255,0.25), transparent),
    radial-gradient(1px 1px at 65% 95%, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 25% 45%, rgba(255,255,255,0.15), transparent),
    radial-gradient(2px 2px at 55% 55%, rgba(0,255,128,0.3), transparent),
    radial-gradient(2px 2px at 75% 25%, rgba(255,221,0,0.2), transparent),
    repeating-linear-gradient(
      0deg,
      var(--scanline-color) 0px,
      var(--scanline-color) 1px,
      transparent 1px,
      transparent 3px
    );
  pointer-events: none;
  z-index: 2;
  opacity: 0.5;
}

/* CRT vignette + colored glow */
body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background:
    radial-gradient(ellipse at center, transparent 40%, rgba(0,0,0,0.8) 100%),
    radial-gradient(ellipse at 20% 20%, rgba(0, 255, 128, 0.06) 0%, transparent 40%),
    radial-gradient(ellipse at 80% 80%, rgba(255, 34, 68, 0.04) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(68, 136, 255, 0.03) 0%, transparent 60%);
  pointer-events: none;
  z-index: 2;
}

#root {
  position: relative;
  z-index: 3;
  text-shadow: 0.5px 0 0 rgba(255, 0, 0, 0.12), -0.5px 0 0 rgba(0, 255, 255, 0.12);
}

.font-bungee { font-family: 'Press Start 2P', cursive; font-size: 0.8em; }
.font-bungee-shade { font-family: 'Press Start 2P', cursive; }

/* Chromatic aberration text */
.crt-text {
  text-shadow:
    1.5px 0 0 rgba(255, 0, 0, 0.35),
    -1.5px 0 0 rgba(0, 255, 255, 0.35),
    0 0 12px rgba(0, 255, 128, 0.3),
    0 0 30px rgba(0, 255, 128, 0.1);
}

/* ======================== ANIMATIONS ======================== */

@keyframes crtFlicker {
  0% { opacity: 0.97; }
  5% { opacity: 1; }
  10% { opacity: 0.98; }
  15% { opacity: 1; }
  50% { opacity: 1; }
  51% { opacity: 0.96; }
  52% { opacity: 1; }
  100% { opacity: 1; }
}

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

@keyframes diceRoll {
  0% { transform: rotateX(0deg) rotateY(0deg) scale(0.2); opacity: 0; filter: blur(4px) brightness(3); }
  20% { transform: rotateX(180deg) rotateY(90deg) scale(1.3); opacity: 1; filter: blur(0) brightness(1.5); }
  40% { transform: rotateX(360deg) rotateY(180deg) scale(0.85); filter: brightness(1); }
  60% { transform: rotateX(540deg) rotateY(270deg) scale(1.15); filter: brightness(1.2); }
  80% { transform: rotateX(680deg) rotateY(340deg) scale(0.95); }
  100% { transform: rotateX(720deg) rotateY(360deg) scale(1); filter: brightness(1); }
}

@keyframes diceShake {
  0%, 100% { transform: translateX(0) translateY(0) scale(1); }
  5% { transform: translateX(-8px) translateY(-4px) rotate(-5deg) scale(1.1); }
  10% { transform: translateX(10px) translateY(3px) rotate(6deg) scale(1.15); filter: brightness(1.4); }
  15% { transform: translateX(-6px) translateY(-5px) rotate(-4deg) scale(1.08); }
  20% { transform: translateX(8px) translateY(2px) rotate(5deg) scale(1.12); filter: brightness(1.6); }
  25% { transform: translateX(-10px) translateY(-3px) rotate(-6deg) scale(1.15); }
  30% { transform: translateX(6px) translateY(4px) rotate(3deg) scale(1.1); filter: brightness(1.3); }
  40% { transform: translateX(-5px) translateY(-2px) rotate(-3deg) scale(1.05); }
  50% { transform: translateX(7px) translateY(3px) rotate(4deg) scale(1.1); filter: brightness(1.5); }
  60% { transform: translateX(-4px) translateY(-1px) rotate(-2deg) scale(1.03); }
  70% { transform: translateX(5px) translateY(2px) rotate(3deg) scale(1.05); filter: brightness(1.2); }
  80% { transform: translateX(-3px) translateY(-1px) rotate(-1deg); }
  90% { transform: translateX(2px) translateY(1px) rotate(1deg); }
}

@keyframes diceClash {
  0% { transform: translateY(0) scale(1); }
  15% { transform: translateY(-15px) scale(1.2) rotate(-5deg); filter: brightness(1.5); }
  30% { transform: translateY(5px) scale(0.9) rotate(3deg); filter: brightness(2); }
  45% { transform: translateY(-10px) scale(1.15) rotate(-3deg); filter: brightness(1.3); }
  60% { transform: translateY(3px) scale(0.95) rotate(2deg); filter: brightness(1.8); }
  75% { transform: translateY(-5px) scale(1.05) rotate(-1deg); }
  100% { transform: translateY(0) scale(1) rotate(0deg); filter: brightness(1); }
}

@keyframes captureFloat {
  0% { transform: scale(1); opacity: 1; filter: brightness(1); }
  15% { transform: scale(1.5) translateY(-5px); opacity: 1; filter: brightness(2.5) drop-shadow(0 0 25px rgba(255,221,0,1)); }
  30% { transform: scale(0.8) translateY(5px) rotate(-10deg); opacity: 1; filter: brightness(1.5); }
  45% { transform: scale(1.6) translateY(-15px) rotate(10deg); opacity: 0.9; filter: brightness(3) hue-rotate(30deg) drop-shadow(0 0 35px rgba(255,100,0,1)); }
  60% { transform: scale(1.8) translateY(-30px) rotate(20deg); opacity: 0.6; filter: brightness(4) hue-rotate(60deg) drop-shadow(0 0 40px rgba(255,221,0,1)); }
  100% { transform: scale(0.2) translateY(-70px) rotate(60deg); opacity: 0; filter: brightness(6); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px currentColor, 0 0 10px currentColor; }
  50% { box-shadow: 0 0 15px currentColor, 0 0 30px currentColor, 0 0 50px rgba(0, 255, 128, 0.15); }
}

@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; filter: blur(4px); }
  to { transform: translateY(0); opacity: 1; filter: blur(0); }
}

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

@keyframes bounceIn {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  40% { transform: scale(1.2) rotate(3deg); }
  60% { transform: scale(0.9) rotate(-2deg); }
  80% { transform: scale(1.05) rotate(1deg); }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

@keyframes confetti-fall {
  0% { transform: translateY(-100vh) rotate(0deg) scale(1); opacity: 1; }
  50% { opacity: 1; }
  100% { transform: translateY(100vh) rotate(1080deg) scale(0.5); opacity: 0; }
}

@keyframes titlePulse {
  0%, 100% {
    text-shadow:
      0 0 20px rgba(0,255,128,0.5),
      2px 0 0 rgba(255,0,0,0.4),
      -2px 0 0 rgba(0,255,255,0.4),
      0 4px 0 #050510,
      0 0 60px rgba(0,255,128,0.15);
    letter-spacing: 2px;
  }
  50% {
    text-shadow:
      0 0 40px rgba(0,255,128,0.9),
      0 0 80px rgba(0,255,128,0.4),
      0 0 120px rgba(0,255,128,0.2),
      3px 0 0 rgba(255,0,0,0.6),
      -3px 0 0 rgba(0,255,255,0.6),
      0 4px 0 #050510;
    letter-spacing: 4px;
  }
}

@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}

@keyframes crtBoot {
  0% { transform: scaleY(0.005) scaleX(0.3); opacity: 0.5; filter: brightness(15) saturate(0); }
  15% { transform: scaleY(0.005) scaleX(1); opacity: 1; filter: brightness(8) saturate(0); }
  30% { transform: scaleY(0.8) scaleX(1); opacity: 1; filter: brightness(2) saturate(0.5); }
  50% { transform: scaleY(1) scaleX(1); opacity: 1; filter: brightness(1.3) saturate(1); }
  100% { transform: scaleY(1) scaleX(1); opacity: 1; filter: brightness(1) saturate(1); }
}

@keyframes rgbSplit {
  0%, 95%, 100% { text-shadow: 0.5px 0 0 rgba(255,0,0,0.15), -0.5px 0 0 rgba(0,255,255,0.15); }
  96% { text-shadow: 3px 0 0 rgba(255,0,0,0.6), -3px 0 0 rgba(0,255,255,0.6); }
  97% { text-shadow: -2px 1px 0 rgba(255,0,0,0.5), 2px -1px 0 rgba(0,255,255,0.5); }
  98% { text-shadow: 1px -1px 0 rgba(255,0,0,0.4), -1px 1px 0 rgba(0,255,255,0.4); }
}

@keyframes impactFlash {
  0% { background: rgba(255,255,255,0); }
  15% { background: rgba(255,255,255,0.15); }
  30% { background: rgba(255,34,68,0.1); }
  100% { background: rgba(255,255,255,0); }
}

@keyframes screenShake {
  0%, 100% { transform: translate(0, 0); }
  8% { transform: translate(-5px, -3px); }
  16% { transform: translate(6px, 2px); }
  24% { transform: translate(-4px, 5px); }
  32% { transform: translate(5px, -3px); }
  40% { transform: translate(-3px, 4px); }
  48% { transform: translate(4px, -2px); }
  56% { transform: translate(-2px, 3px); }
  64% { transform: translate(3px, -1px); }
  72% { transform: translate(-1px, 2px); }
  80% { transform: translate(2px, -1px); }
  88% { transform: translate(-1px, 1px); }
}

@keyframes damageFlash {
  0% { filter: brightness(1); }
  20% { filter: brightness(2) hue-rotate(-20deg) saturate(2); }
  40% { filter: brightness(0.7) saturate(0.5); }
  60% { filter: brightness(1.5) hue-rotate(10deg); }
  100% { filter: brightness(1); }
}

@keyframes healthDrain {
  0% { transform: scaleX(1); }
  30% { transform: scaleX(1.05); }
  100% { transform: scaleX(var(--health-pct, 1)); }
}

@keyframes floatUp {
  0% { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-60px) scale(1.5); opacity: 0; }
}

@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  50% { opacity: 1; transform: scale(1) rotate(180deg); }
}

@keyframes energyPulse {
  0%, 100% { transform: scale(1); opacity: 0.3; }
  50% { transform: scale(1.5); opacity: 0.8; }
}

@keyframes victoryGlow {
  0% { text-shadow: 0 0 20px rgba(255,221,0,0.5); transform: scale(1); }
  50% { text-shadow: 0 0 60px rgba(255,221,0,1), 0 0 120px rgba(255,221,0,0.5), 0 0 200px rgba(255,221,0,0.2); transform: scale(1.05); }
  100% { text-shadow: 0 0 20px rgba(255,221,0,0.5); transform: scale(1); }
}

@keyframes defeatPulse {
  0% { text-shadow: 0 0 20px rgba(255,34,68,0.5); }
  50% { text-shadow: 0 0 60px rgba(255,34,68,1), 0 0 100px rgba(255,34,68,0.3); }
  100% { text-shadow: 0 0 20px rgba(255,34,68,0.5); }
}

@keyframes slideInLeft {
  from { transform: translateX(-60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(60px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes diceImpact {
  0% { transform: scale(1); }
  20% { transform: scale(1.3); filter: brightness(2); }
  40% { transform: scale(0.9); }
  60% { transform: scale(1.1); }
  80% { transform: scale(0.97); }
  100% { transform: scale(1); filter: brightness(1); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(0,255,128,0.15); }
  50% { border-color: rgba(0,255,128,0.4); }
}

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

@keyframes rollLand {
  0% { transform: translateY(-20px) scale(1.3); filter: brightness(2); }
  50% { transform: translateY(3px) scale(0.95); }
  100% { transform: translateY(0) scale(1); filter: brightness(1); }
}

.dice-roll { animation: diceRoll 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94); }
.dice-shake { animation: diceShake 0.7s ease-in-out infinite; }
.dice-clash { animation: diceClash 0.6s ease-in-out; }
.dice-capture { animation: captureFloat 0.7s ease-out forwards; }
.pulse-glow { animation: pulseGlow 1.5s ease-in-out infinite; }
.slide-up { animation: slideUp 0.5s ease-out; }
.fade-in { animation: fadeIn 0.4s ease-out; }
.bounce-in { animation: bounceIn 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55); }
.title-pulse { animation: titlePulse 3s ease-in-out infinite; }
.arrow-bounce { animation: arrowBounce 0.8s ease-in-out infinite; }
.crt-flicker { animation: crtFlicker 4s ease-in-out infinite; }
.glitch-text { animation: glitchShift 8s ease-in-out infinite; }
.crt-boot { animation: crtBoot 0.8s ease-out; }
.rgb-split { animation: rgbSplit 10s ease-in-out infinite; }
.impact-flash { animation: impactFlash 0.4s ease-out; }
.screen-shake { animation: screenShake 0.5s ease-out; }
.damage-flash { animation: damageFlash 0.5s ease-out; }
.dice-impact { animation: diceImpact 0.4s ease-out; }
.slide-in-left { animation: slideInLeft 0.5s ease-out; }
.slide-in-right { animation: slideInRight 0.5s ease-out; }
.victory-glow { animation: victoryGlow 2s ease-in-out infinite; }
.defeat-pulse { animation: defeatPulse 2s ease-in-out infinite; }
.roll-land { animation: rollLand 0.3s ease-out; }

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confetti-fall linear forwards;
  z-index: 999;
}

/* ======================== PARTICLES CANVAS ======================== */

#particles-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ======================== DICE STYLES ======================== */

.die-d4 { --die-color: #ff2244; --die-glow: rgba(255,34,68,0.5); --die-glow-half: rgba(255,34,68,0.25); --die-light: #ff6677; --die-dark: #991122; }
.die-d6 { --die-color: #4488ff; --die-glow: rgba(68,136,255,0.5); --die-glow-half: rgba(68,136,255,0.25); --die-light: #77aaff; --die-dark: #224488; }
.die-d8 { --die-color: #33ff66; --die-glow: rgba(51,255,102,0.5); --die-glow-half: rgba(51,255,102,0.25); --die-light: #77ff99; --die-dark: #1a8833; }
.die-d10 { --die-color: #cc44ff; --die-glow: rgba(204,68,255,0.5); --die-glow-half: rgba(204,68,255,0.25); --die-light: #dd88ff; --die-dark: #661188; }
.die-d12 { --die-color: #ff8800; --die-glow: rgba(255,136,0,0.5); --die-glow-half: rgba(255,136,0,0.25); --die-light: #ffaa44; --die-dark: #884400; }
.die-d20 { --die-color: #ffdd00; --die-glow: rgba(255,221,0,0.5); --die-glow-half: rgba(255,221,0,0.25); --die-light: #ffee66; --die-dark: #887700; }

/* Die wrapper */
.die-3d-wrapper {
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.die-3d-wrapper:hover {
  transform: translateY(-3px) scale(1.08);
  filter: brightness(1.1);
}

.die-3d-wrapper.die-selected {
  transform: translateY(-6px) scale(1.12);
  filter: brightness(1.2);
}

.die-3d-wrapper.die-selected .die-css-face {
  border-color: var(--accent-cyan) !important;
  box-shadow: 0 0 25px rgba(0,255,204,0.6), 0 0 50px rgba(0,255,204,0.3), 0 0 80px rgba(0,255,204,0.15) !important;
}

.die-3d-wrapper.die-target .die-css-face {
  border: 2px dashed var(--accent-red) !important;
}

.die-3d-wrapper.die-valid-target .die-css-face {
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 15px rgba(255,221,0,0.4), 0 0 30px rgba(255,221,0,0.2), 0 0 50px rgba(255,221,0,0.1) !important;
}

.die-3d-wrapper.die-dimmed {
  opacity: 0.3;
  filter: grayscale(0.6) brightness(0.7);
}

/* CSS Die Face */
.die-css-face {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 2px solid;
  transition: all 0.2s ease;
  overflow: hidden;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}

.die-css-face .die-shape-bg {
  position: absolute;
  inset: 0;
  opacity: 0.15;
  pointer-events: none;
}

.die-css-face .die-value-display {
  position: relative;
  z-index: 2;
  font-family: 'Press Start 2P', cursive;
  font-weight: bold;
  text-shadow: 0 0 12px currentColor, 0 2px 4px rgba(0,0,0,0.8);
  color: #fff;
}

.die-css-face .die-shine {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(255,255,255,0.12) 45%,
    rgba(255,255,255,0.2) 50%,
    rgba(255,255,255,0.12) 55%,
    transparent 60%
  );
  pointer-events: none;
  z-index: 3;
}

/* Die shapes via clip-path — all dice get distinct geometric silhouettes */
.die-shape-d4 { clip-path: polygon(50% 8%, 8% 88%, 92% 88%); border-radius: 4px; }
.die-shape-d6 { clip-path: polygon(8% 8%, 92% 8%, 92% 92%, 8% 92%); border-radius: 3px; }
.die-shape-d8 { clip-path: polygon(50% 5%, 95% 50%, 50% 95%, 5% 50%); border-radius: 4px; }
.die-shape-d10 { clip-path: polygon(50% 0%, 90% 35%, 80% 90%, 20% 90%, 10% 35%); border-radius: 4px; }
.die-shape-d12 { clip-path: polygon(50% 0%, 85% 15%, 100% 55%, 75% 95%, 25% 95%, 0% 55%, 15% 15%); border-radius: 4px; }
.die-shape-d20 { clip-path: polygon(50% 0%, 90% 25%, 90% 75%, 50% 100%, 10% 75%, 10% 25%); border-radius: 4px; }

/* Legacy die-base styles kept for any old references */
.die-base {
  background: linear-gradient(145deg, var(--die-light, #888), var(--die-color), var(--die-dark, #333));
  border: 2px solid var(--die-color);
  border-radius: 8px;
  box-shadow:
    0 0 10px var(--die-glow, rgba(0,255,128,0.3)),
    0 0 20px var(--die-glow-half, rgba(0,255,128,0.15)),
    0 4px 10px rgba(0,0,0,0.7),
    inset 0 1px 3px rgba(255,255,255,0.25),
    inset 0 -2px 4px rgba(0,0,0,0.3);
  transition: all 0.2s ease;
  cursor: pointer;
  user-select: none;
  image-rendering: pixelated;
  font-family: 'Press Start 2P', cursive;
  position: relative;
  overflow: hidden;
  gap: 2px;
}

/* Die shine effect */
.die-base::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(255,255,255,0.1) 45%,
    rgba(255,255,255,0.2) 50%,
    rgba(255,255,255,0.1) 55%,
    transparent 60%
  );
  pointer-events: none;
}

.die-base:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow:
    0 0 20px var(--die-glow, rgba(0,255,128,0.5)),
    0 0 40px var(--die-glow-half, rgba(0,255,128,0.15)),
    0 8px 20px rgba(0,0,0,0.5),
    inset 0 1px 3px rgba(255,255,255,0.3);
  filter: brightness(1.15);
}

.die-selected {
  outline: 3px solid var(--accent-cyan);
  outline-offset: 3px;
  transform: translateY(-6px) scale(1.1);
  box-shadow:
    0 0 25px rgba(0,255,204,0.6),
    0 0 50px rgba(0,255,204,0.3),
    0 0 80px rgba(0,255,204,0.15),
    0 10px 25px rgba(0,0,0,0.5);
  filter: brightness(1.2);
}

.die-target {
  outline: 3px dashed var(--accent-red);
  outline-offset: 3px;
}

.die-valid-target {
  color: var(--accent-gold);
}

.die-dimmed {
  opacity: 0.3;
  filter: grayscale(0.6) brightness(0.7);
}

/* ======================== BUTTONS ======================== */

.btn-action {
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 50%, transparent 100%);
  border: 2px solid;
  border-radius: 6px;
  padding: 10px 24px;
  font-family: 'Press Start 2P', cursive;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-shadow: 0 0 10px currentColor;
  position: relative;
  overflow: hidden;
}

.btn-action::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
  transition: left 0.5s;
}

.btn-action:hover:not(:disabled)::before {
  left: 100%;
}

.btn-action:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 0 20px rgba(0,255,128,0.2), 0 6px 20px rgba(0,0,0,0.4);
}

.btn-action:active:not(:disabled) {
  transform: translateY(-1px) scale(0.98);
}

.btn-action:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  filter: grayscale(0.6);
}

.btn-power {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background-color: rgba(255, 34, 68, 0.1);
}
.btn-power:hover:not(:disabled) {
  background-color: rgba(255, 34, 68, 0.25);
  box-shadow: 0 0 25px rgba(255, 34, 68, 0.4), 0 0 50px rgba(255, 34, 68, 0.15);
}

.btn-skill {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background-color: rgba(0, 255, 204, 0.05);
}
.btn-skill:hover:not(:disabled) {
  background-color: rgba(0, 255, 204, 0.15);
  box-shadow: 0 0 25px rgba(0, 255, 204, 0.4), 0 0 50px rgba(0, 255, 204, 0.15);
}

.btn-pass {
  border-color: var(--text-secondary);
  color: var(--text-secondary);
  background-color: rgba(106, 154, 122, 0.1);
}
.btn-pass:hover:not(:disabled) {
  background-color: rgba(106, 154, 122, 0.2);
}

/* Big fight button */
.btn-fight {
  border-color: var(--accent-red);
  color: var(--accent-red);
  background: linear-gradient(180deg, rgba(255,34,68,0.2) 0%, rgba(255,34,68,0.05) 100%);
  font-size: 16px;
  padding: 16px 40px;
  position: relative;
  box-shadow: 0 0 30px rgba(255,34,68,0.3), 0 0 60px rgba(255,34,68,0.1), inset 0 0 30px rgba(255,34,68,0.05);
  animation: pulseGlow 2s ease-in-out infinite;
}

.btn-fight:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(255,34,68,0.35) 0%, rgba(255,34,68,0.1) 100%);
  box-shadow: 0 0 40px rgba(255,34,68,0.5), 0 0 80px rgba(255,34,68,0.2), 0 0 120px rgba(255,34,68,0.1);
  transform: translateY(-4px) scale(1.05);
  letter-spacing: 4px;
}

/* ======================== CHARACTER SELECT ======================== */

.character-button {
  width: 100px;
  height: 100px;
  border-radius: 6px;
  border: 2px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  image-rendering: pixelated;
}

.character-button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.1) 0%, transparent 50%, rgba(0,0,0,0.2) 100%);
  pointer-events: none;
}

.character-button img,
.char-portrait {
  width: 100%;
  height: 100%;
  object-fit: cover;
  image-rendering: pixelated;
}

.character-button:hover {
  transform: scale(1.12) translateY(-4px);
  box-shadow: 0 0 30px var(--die-glow, rgba(0,255,128,0.3)), 0 8px 25px rgba(0,0,0,0.5);
  filter: brightness(1.15);
}

.character-button.selected {
  box-shadow: 0 0 0 3px var(--accent-gold), 0 0 30px rgba(255,221,0,0.5), 0 0 60px rgba(255,221,0,0.2);
  transform: scale(1.15) translateY(-4px);
  border-color: var(--accent-gold) !important;
}

.character-button.selected::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 16px;
  height: 16px;
  background-image: url('/api/retrodiffusion/image/16/16/mc_item?prompt=golden+star+sparkle+selection+indicator&remove_bg=true');
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  z-index: 5;
  filter: drop-shadow(0 0 6px rgba(255,221,0,0.8));
  animation: sparkle 1.5s ease-in-out infinite;
}

.tooltip {
  position: absolute;
  bottom: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid rgba(0,255,128,0.25);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 50;
  box-shadow: 0 0 20px rgba(0,255,128,0.15), 0 8px 24px rgba(0,0,0,0.6);
  font-family: 'IBM Plex Mono', monospace;
  backdrop-filter: blur(8px);
}

.tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: var(--bg-card);
}

/* ======================== BATTLE UI ======================== */

.score-bar {
  background: linear-gradient(180deg, rgba(12,12,30,0.95) 0%, rgba(8,8,20,0.95) 100%);
  border: 1px solid rgba(0,255,128,0.15);
  border-radius: 6px;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.03);
  animation: borderGlow 4s ease-in-out infinite;
}

/* ======================== DIE TYPE LABEL ======================== */

.die-type-label {
  color: rgba(255, 255, 255, 0.9);
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 1;
  text-shadow: 0 0 8px var(--die-glow, rgba(255,255,255,0.4)), 0 1px 0 rgba(0,0,0,0.6);
  font-weight: bold;
}

.die-value-num {
  line-height: 1;
  -webkit-text-stroke: 0.5px rgba(0,0,0,0.2);
}

.action-log {
  background: linear-gradient(135deg, rgba(0,0,0,0.6), rgba(0,20,10,0.4));
  border: 1px solid rgba(0,255,128,0.15);
  border-left: 4px solid var(--accent-green);
  border-radius: 6px;
  font-size: 12px;
  color: var(--phosphor-green);
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  text-shadow: 0 0 10px rgba(0,255,128,0.4);
  box-shadow: inset 0 0 30px rgba(0,255,128,0.02);
}

.captured-pile {
  background: linear-gradient(135deg, rgba(0,0,0,0.35), rgba(0,0,0,0.2));
  border: 1px dashed rgba(0,255,128,0.15);
  border-radius: 6px;
  min-height: 50px;
  padding: 8px;
}

/* Player / Enemy area */
.enemy-area {
  background: linear-gradient(135deg, rgba(255, 34, 68, 0.06), rgba(255, 34, 68, 0.02), rgba(20, 10, 15, 0.5));
  border: 1px solid rgba(255, 34, 68, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 0 40px rgba(255, 34, 68, 0.03), 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.enemy-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,34,68,0.4), transparent);
}

.player-area {
  background: linear-gradient(135deg, rgba(0, 255, 204, 0.06), rgba(0, 255, 204, 0.02), rgba(10, 20, 15, 0.5));
  border: 1px solid rgba(0, 255, 204, 0.2);
  border-radius: 8px;
  box-shadow: inset 0 0 40px rgba(0, 255, 204, 0.03), 0 4px 20px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
}

.player-area::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,255,204,0.4), transparent);
}

/* ======================== HEALTH BAR ======================== */

.health-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(0,0,0,0.6);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(255,255,255,0.1);
}

.health-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
  overflow: hidden;
}

.health-bar-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.3), transparent);
  border-radius: 3px 3px 0 0;
}

.health-bar-damage {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  background: rgba(255,34,68,0.5);
  transition: width 1s ease-out 0.3s;
  border-radius: 3px;
}

/* ======================== AI DICE TARGETING ======================== */

.ai-die-wrapper {
  position: relative;
  transition: all 0.25s ease;
}

.ai-die-wrapper.can-attack {
  cursor: crosshair;
}

.ai-die-wrapper.can-attack:hover {
  transform: scale(1.15) translateY(-3px);
  filter: brightness(1.3);
}

.ai-die-wrapper.can-attack:hover::before {
  content: '';
  width: 16px;
  height: 16px;
  background-image: url('/api/retrodiffusion/image/16/16/mc_item?prompt=crossed+swords+attack+icon&remove_bg=true');
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  filter: drop-shadow(0 0 8px rgba(255,34,68,0.9));
  animation: bounceIn 0.3s ease-out;
}

.ai-die-wrapper.valid-target-glow .die-base {
  animation: pulseGlow 1.2s ease-in-out infinite;
  color: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px rgba(255,221,0,0.4), 0 0 30px rgba(255,221,0,0.2), 0 0 50px rgba(255,221,0,0.1);
}

/* ======================== ATTACK RESULT ======================== */

.attack-result-panel {
  background: linear-gradient(135deg, rgba(0,0,0,0.75), rgba(0,10,20,0.7));
  border: 2px solid;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 12px;
  text-align: center;
  backdrop-filter: blur(8px);
  text-shadow: 0 0 8px rgba(0,255,128,0.2);
  box-shadow: 0 0 40px rgba(0,0,0,0.5), inset 0 0 40px rgba(0,255,128,0.02);
  position: relative;
  overflow: hidden;
}

.attack-result-panel::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

.attack-result-panel::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
}

/* ======================== SELECTION SUMMARY ======================== */

.selection-summary {
  background: linear-gradient(135deg, rgba(0,255,128,0.06), rgba(0,255,128,0.02));
  border: 1px solid rgba(0,255,128,0.2);
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px;
  font-family: 'IBM Plex Mono', monospace;
  box-shadow: inset 0 0 20px rgba(0,255,128,0.03);
}

/* ======================== HINT TEXT ======================== */

.hint-text {
  font-size: 11px;
  color: var(--phosphor-green);
  text-align: center;
  padding: 10px 14px;
  background: linear-gradient(135deg, rgba(0,0,0,0.4), rgba(0,20,10,0.3));
  border-radius: 6px;
  border-left: 4px solid var(--accent-green);
  font-family: 'IBM Plex Mono', monospace;
  text-shadow: 0 0 8px rgba(0,255,128,0.3);
}

/* ======================== IMPACT EFFECTS ======================== */

.impact-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 90;
  animation: impactFlash 0.4s ease-out;
}

/* Floating damage number */
.damage-number {
  position: absolute;
  font-family: 'Press Start 2P', cursive;
  font-size: 16px;
  color: var(--accent-gold);
  text-shadow: 0 0 10px rgba(255,221,0,0.8), 2px 2px 0 rgba(0,0,0,0.8);
  animation: floatUp 1.2s ease-out forwards;
  pointer-events: none;
  z-index: 20;
}

/* Energy ring around active player */
.energy-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid;
  animation: energyPulse 2s ease-in-out infinite;
  pointer-events: none;
}

/* VS Badge */
.vs-badge {
  font-family: 'Press Start 2P', cursive;
  font-size: 12px;
  color: var(--accent-gold);
  text-shadow: 0 0 15px rgba(255,221,0,0.6), 0 0 30px rgba(255,221,0,0.3);
  position: relative;
}

.vs-badge::before,
.vs-badge::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 20px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-gold));
}

.vs-badge::before {
  right: 100%;
  margin-right: 6px;
  background: linear-gradient(90deg, transparent, var(--accent-gold));
}

.vs-badge::after {
  left: 100%;
  margin-left: 6px;
  background: linear-gradient(270deg, transparent, var(--accent-gold));
}

/* ======================== ROUND INDICATOR ======================== */

.round-pip {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.3);
  transition: all 0.3s ease;
}

.round-pip.won {
  background: var(--accent-green);
  border-color: var(--accent-green);
  box-shadow: 0 0 8px rgba(51,255,102,0.5);
}

.round-pip.lost {
  background: var(--accent-red);
  border-color: var(--accent-red);
  box-shadow: 0 0 8px rgba(255,34,68,0.5);
}

.round-pip.current {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px rgba(255,221,0,0.5);
  animation: energyPulse 1.5s ease-in-out infinite;
}

.round-pip.empty {
  background: rgba(255,255,255,0.05);
}

/* ======================== CRT SCREEN ======================== */

.crt-screen {
  position: relative;
  animation: crtFlicker 4s ease-in-out infinite;
}

/* ======================== BATTLEFIELD ======================== */

.battlefield-container {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid rgba(0,255,128,0.15);
  box-shadow: 0 4px 30px rgba(0,0,0,0.5), inset 0 0 60px rgba(0,0,0,0.3);
  min-height: 420px;
}

.battlefield-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: linear-gradient(135deg, #1a1a0a, #0d1a0d, #1a0d0d);
}

.battlefield-bg img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.battlefield-grid-overlay {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(0,255,128,0.03) 0px, rgba(0,255,128,0.03) 1px, transparent 1px, transparent 40px),
    repeating-linear-gradient(90deg, rgba(0,255,128,0.03) 0px, rgba(0,255,128,0.03) 1px, transparent 1px, transparent 40px);
  pointer-events: none;
  z-index: 1;
}

.battlefield-fog-left {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  width: 80px;
  background: linear-gradient(90deg, rgba(0,200,255,0.08), transparent);
  pointer-events: none;
  z-index: 1;
}

.battlefield-fog-right {
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 80px;
  background: linear-gradient(270deg, rgba(255,34,68,0.08), transparent);
  pointer-events: none;
  z-index: 1;
}

/* Player info bars at top of battlefield */
.battlefield-player-info {
  position: absolute;
  top: 6px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.75);
  border-radius: 6px;
  padding: 6px 10px;
  backdrop-filter: blur(8px);
  max-width: 200px;
}

.battlefield-info-left {
  left: 6px;
  border: 1px solid rgba(0,255,204,0.25);
}

.battlefield-info-right {
  right: 6px;
  border: 1px solid rgba(255,34,68,0.25);
}

/* Attack prompt overlay */
.battlefield-attack-prompt {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 20;
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  color: var(--accent-red);
  text-shadow: 0 0 15px rgba(255,34,68,0.7), 0 0 30px rgba(255,34,68,0.4);
  background: rgba(0,0,0,0.7);
  padding: 8px 16px;
  border-radius: 4px;
  border: 1px solid rgba(255,34,68,0.4);
  pointer-events: none;
  white-space: nowrap;
  animation: pulseGlow 1.5s ease-in-out infinite;
}

/* Warriors arena - left vs right */
.battlefield-arena {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 380px;
  padding: 50px 12px 12px 12px;
}

.warriors-column {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  flex: 1;
  max-width: 45%;
}

.warriors-left {
  align-items: flex-start;
  padding-left: 8px;
}

.warriors-right {
  align-items: flex-end;
  padding-right: 8px;
}

.warrior-slot {
  position: relative;
  transition: all 0.25s ease;
}

.warrior-slot.warrior-active-side {
  /* subtle breathing glow for the active side */
}

.ai-warrior-slot.can-attack {
  cursor: crosshair;
}

.ai-warrior-slot.can-attack:hover {
  transform: scale(1.15);
  filter: brightness(1.3);
}

.ai-warrior-slot.can-attack:hover::before {
  content: '';
  width: 20px;
  height: 20px;
  background-image: url('/api/retrodiffusion/image/16/16/mc_item?prompt=crossed+swords+attack+icon&remove_bg=true');
  background-size: contain;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  filter: drop-shadow(0 0 8px rgba(255,34,68,0.9));
  animation: bounceIn 0.3s ease-out;
}

.warriors-empty {
  font-family: 'Press Start 2P', cursive;
  font-size: 9px;
  color: var(--text-secondary);
  opacity: 0.5;
  padding: 20px;
  text-shadow: 0 0 8px rgba(255,255,255,0.2);
}

/* Center divider */
.battlefield-center-divider {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  position: relative;
}

.battlefield-clash-icon {
  position: relative;
  z-index: 6;
  animation: energyPulse 2s ease-in-out infinite;
}

.divider-line {
  width: 2px;
  flex: 1;
  background: linear-gradient(180deg, transparent, rgba(255,221,0,0.3), rgba(255,221,0,0.1), transparent);
  margin: 8px 0;
  min-height: 60px;
}

/* Captured piles at bottom of battlefield */
.battlefield-captured {
  position: relative;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  padding: 4px 12px 8px 12px;
}

.captured-side {
  flex: 1;
  min-height: 30px;
}

.captured-left {
  padding-right: 20px;
}

.captured-right {
  padding-left: 20px;
}

.captured-pile-mini {
  background: rgba(0,0,0,0.4);
  border: 1px dashed rgba(0,255,128,0.15);
  border-radius: 4px;
  padding: 4px 6px;
  align-items: center;
}

.captured-label {
  font-family: 'Press Start 2P', cursive;
  font-size: 7px;
  color: var(--accent-gold);
  text-shadow: 0 0 6px rgba(255,221,0,0.4);
  white-space: nowrap;
  align-self: center;
}

/* ======================== WARRIOR SPRITES ======================== */

.die-warrior-wrapper {
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.die-warrior-wrapper:hover {
  transform: translateY(-4px) scale(1.08);
  filter: brightness(1.15);
}

.die-warrior-wrapper.die-selected {
  transform: translateY(-6px) scale(1.12);
}

.die-warrior-wrapper.die-selected .warrior-sprite {
  filter: brightness(1.4) drop-shadow(0 0 12px rgba(0,255,204,0.8)) !important;
}

.warrior-sprite {
  transition: all 0.2s ease;
  position: relative;
}

.warrior-sprite.warrior-selected::after,
.warrior-sprite.warrior-targetable::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  pointer-events: none;
}

.warrior-select-ring {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid;
  animation: energyPulse 1.5s ease-in-out infinite;
  pointer-events: none;
}

.warrior-target-ring {
  animation: pulseGlow 1s ease-in-out infinite;
}

.warrior-die-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 10px;
  border: 3px solid;
  font-family: 'Press Start 2P', cursive;
  font-weight: bold;
  transition: all 0.2s ease;
  position: relative;
  z-index: 3;
  margin-top: -4px;
  -webkit-text-stroke: 0.5px rgba(0,0,0,0.3);
}

.warrior-ground-shadow {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 10px;
  border-radius: 50%;
  z-index: 1;
  pointer-events: none;
}

/* Battle controls bar below battlefield */
.battle-controls-bar {
  background: linear-gradient(135deg, rgba(0, 255, 204, 0.04), rgba(0, 255, 204, 0.01), rgba(10, 20, 15, 0.5));
  border: 1px solid rgba(0, 255, 204, 0.15);
  border-radius: 8px;
  box-shadow: inset 0 0 30px rgba(0, 255, 204, 0.02), 0 4px 20px rgba(0,0,0,0.3);
}

/* Warrior valid target glow for AI warriors */
.die-warrior-wrapper.die-valid-target .warrior-sprite {
  filter: brightness(1.5) drop-shadow(0 0 15px rgba(255,221,0,0.8)) drop-shadow(0 0 30px rgba(255,221,0,0.4)) !important;
}

.die-warrior-wrapper.die-valid-target .warrior-die-badge {
  border-color: var(--accent-gold) !important;
  box-shadow: 0 0 15px rgba(255,221,0,0.5), 0 0 30px rgba(255,221,0,0.2) !important;
  animation: pulseGlow 1s ease-in-out infinite;
  color: var(--accent-gold);
}

/* ======================== RESPONSIVE ======================== */

@media (max-width: 640px) {
  .character-button {
    width: 64px;
    height: 64px;
    font-size: 8px;
  }

  .btn-action {
    padding: 8px 16px;
    font-size: 9px;
    min-height: 44px;
  }

  .die-base {
    border-radius: 4px;
  }

  .die-3d-wrapper {
    min-width: 44px;
    min-height: 44px;
  }

  .battlefield-container {
    min-height: 360px;
  }

  .battlefield-arena {
    min-height: 320px;
    padding: 46px 6px 8px 6px;
  }

  .battlefield-player-info {
    padding: 4px 6px;
    max-width: 160px;
  }

  .battlefield-attack-prompt {
    font-size: 7px;
    padding: 5px 10px;
  }

  .warrior-die-badge {
    width: 50px;
    height: 50px;
    font-size: 18px !important;
  }

  .warriors-column {
    gap: 4px;
  }

  body::before {
    /* Simplify scanlines on mobile for performance */
    background:
      radial-gradient(1px 1px at 30% 70%, rgba(255,255,255,0.3), transparent),
      radial-gradient(1px 1px at 70% 30%, rgba(255,255,255,0.3), transparent);
    opacity: 0.3;
  }
}

/* iOS Safari fixes */
@supports (-webkit-touch-callout: none) {
  body::before {
    opacity: 0.3;
  }
  .die-css-face {
    -webkit-transform: translateZ(0);
  }
}