/* ================= GLOBAL ================= */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: radial-gradient(circle at top, #141e30, #0f0f1a 60%);
  color: white;
  text-align: center;
  overflow-x: hidden;
}

/* Animated background glow */
.background-glow {
  position: fixed;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(0,255,255,0.15) 0%, transparent 60%);
  animation: glowPulse 6s infinite alternate;
  z-index: -1;
}

@keyframes glowPulse {
  from { opacity: 0.3; }
  to { opacity: 0.8; }
}

/* ================= HEADER ================= */
header {
  margin-top: 20px;
}

.title {
  font-size: 48px;
  letter-spacing: 3px;
  text-shadow: 0 0 25px cyan;
}

.round-select {
  margin-top: 15px;
  font-size: 18px;
}

.round-select select {
  padding: 10px 18px;
  border-radius: 10px;
  border: none;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(45deg,#00f2ff,#00ff88);
}

/* ================= LAYOUT ================= */
.battle {
  width: 95%;
  max-width: 1500px;
  margin: 50px auto;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  align-items: stretch;
}

/* ================= PLAYER CARDS ================= */
.player {
  position: relative; /* needed if video-wrapper is absolute */
  flex: 1;
  min-width: 350px;
  border-radius: 25px;
  overflow: hidden;  /* clip video */
}
.video-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

/* ================= VIDEO WRAPPER ================= */
.video-wrapper {
  position: relative;
  width: 100%;
  height: 100%;        /* Fill parent card */
  min-height: 380px;   /* Optional: keep min size */
  border-radius: 20px;
  overflow: hidden;
  margin: 20px auto;
  background: black;
  box-shadow: 0 0 25px rgba(0,255,255,0.3);
  display: flex;
}

.video-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;   /* ensures no black bars */
  transform: scaleX(-1);
  border-radius: inherit;
}

.video-wrapper canvas {
  position: absolute;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Scan line animation */
.scan-line {
  position: absolute;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, transparent, cyan, transparent);
  animation: scanMove 3s infinite;
}

@keyframes scanMove {
  0% { top: 0; }
  100% { top: 100%; }
}

/* ================= AI DISPLAY ================= */
.ai-display {
  font-size: 140px;
  margin: 30px 0;
  transition: transform 0.4s ease;
}

.ai-display.animate {
  animation: aiReveal 0.6s ease;
}

@keyframes aiReveal {
  0% { transform: scale(0.5) rotate(-20deg); }
  50% { transform: scale(1.4) rotate(10deg); }
  100% { transform: scale(1); }
}

/* ================= CENTER PANEL ================= */
.center-panel {
  width: 340px;
  flex-shrink: 0;
  padding: 30px;
  border-radius: 25px;
  background: rgba(0,0,0,0.6);
  box-shadow: 0 0 30px rgba(255,255,255,0.15);
}

#countdown {
  font-size: 46px;
  margin-bottom: 15px;
}

.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { text-shadow: 0 0 10px cyan; }
  50% { text-shadow: 0 0 30px cyan; }
  100% { text-shadow: 0 0 10px cyan; }
}

#result {
  min-height: 40px;
  font-size: 22px;
  margin-top: 15px;
}

/* Score board */
.score-board {
  display: flex;
  justify-content: space-around;
  font-size: 22px;
  margin-top: 20px;
}

/* Round info */
.round-info {
  margin-top: 12px;
  opacity: 0.7;
}

/* ================= BUTTON ================= */
.glow-btn {
  padding: 14px 25px;
  border-radius: 15px;
  border: none;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  background: linear-gradient(45deg,#ff416c,#ff4b2b);
  color: white;
  transition: 0.3s;
  box-shadow: 0 0 20px rgba(255,65,108,0.6);
}

.glow-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 0 35px rgba(255,65,108,1);
}

/* ================= GESTURE TEXT ================= */
.gesture-indicator {
  font-size: 22px;
  margin-top: 15px;
  color: #00ffcc;
  text-shadow: 0 0 15px #00ffcc;
  min-height: 30px;  /* reserve space so it doesn’t jump */
  transition: 0.3s;
}

.gesture-active {
  color: #00ffcc;
  text-shadow: 0 0 10px #00ffcc;
}