
/* Top Bar */
.portal{
  padding:20px 40px;
}

.portal h1{
  color:#2196f3;
  margin-bottom:20px;
}

/* Setup Screen */
#setup{
  background:white;
  max-width:500px;
  margin:20px auto;
  padding:25px;
  border-radius:20px;
  box-shadow:0 10px 25px rgba(0,0,0,0.08);
}

#setup input,
#setup select,
#setup button{
  width:100%;
  padding:15px;
  margin-bottom:15px;
  border-radius:12px;
  border:1px solid #ddd;
  font-size:16px;
}

/* Game Layout */
.grid-container{
  display:grid;
  grid-template-columns: 1fr 1.4fr 1fr;
  gap:25px;
  padding:20px 40px 40px;
}

/* Player Cards */
.player-column{
  background:white;
  border-radius:20px;
  box-shadow:0 10px 25px rgba(0,0,0,0.08);
  padding:20px;
}

/* Player Headers */
.player-column h2{
  padding:15px;
  border-radius:15px;
  color:white;
  margin:0 0 20px 0;
  background-color: #7e208f;
  text-transform: uppercase;
  text-align:center;
}
.battle-video{
  transition: opacity 0.4s ease;
}

#player1-column h2{ background:#2196f3; }
#player2-column h2{ background:#f44336; }

/* Question */
.question-box{
  font-size:17px;
  font-weight:600;
  margin:20px 0;
  color:#333;
  line-height: 26px;
}

/* Calculator Display */
.calc-display{
  font-size:26px;
  background:#222;
  color:white;
  padding:15px;
  border-radius:12px;
  margin-bottom:10px;
}

/* Calculator Pad */
.pad{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:10px;
}

.pad button{
  padding:20%;
  border:none;
  border-radius:12px;
  background:#2196f3;
  color:white;
  font-size:20px;
  cursor:pointer;
  font-weight:bold;
  transition:0.2s;
}

.pad button:hover{
  transform:scale(1.05);
}

/* MCQ Options */
.player-column label{
  display:block;
  width:100%;
  background:#131212;
  border-radius:15px;
  padding:18px;
  margin-bottom:12px;
  cursor:pointer;
  font-size:18px;
  text-align:left;
  transition:0.2s;
  box-sizing:border-box;
}

.player-column label:hover{
  transform:scale(1.02);
}

.player-column input{
  display:none;
}

/* Battlefield */
.rope-column{
  background:white;
  border-radius:20px;
  box-shadow:0 10px 25px rgba(0,0,0,0.08);
  padding:20px;
}

.battlefield{
  background:#ffffff;
  border-radius:20px;
  height:50vh;
  display:flex;
  align-items:center;
  justify-content:center;
  overflow: hidden;
}

/* Score */
#score-display{
  font-size:22px;
  font-weight:bold;
  margin-top:15px;
}


.calc-btn{
  padding:18px;
  border:none;
  border-radius:12px;
  background:#2196f3;
  color:white;
  font-size:20px;
  font-weight:bold;
  cursor:pointer;
  transition:0.2s;
  width:100%;
  margin-top:10px;
}

.calc-btn:hover{
  transform:scale(1.05);
}


/* Option Cards */
.option-card{
  display:block;
  width:100%;
  background:#2c2d31;
  border-radius:15px;
  padding:18px;
  margin-bottom:12px;
  cursor:pointer;
  font-size:18px;
  text-align:left;
  transition:0.2s;
  border:2px solid transparent;
  box-sizing:border-box;
}

/* Hover Effect */
.option-card:hover{
  transform:scale(1.02);
}

/* Hide radio */
.option-card input{
  display:none;
}

/* SELECTED STATE 🔥 */
.option-card.selected{
  background:#2196f3;
  color:white;
  border:2px solid #1976d2;
}

.option-card.selected{
  background:#2196f3;
  color:white;
  border:2px solid #1976d2;
  animation:pulse 0.3s ease;
}

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


.option-card.correct-answer{
  background:#4caf50 !important;
  color:white;
  border:2px solid #2e7d32;
  animation:glow 0.6s ease infinite alternate;
}

@keyframes glow{
  from{ box-shadow:0 0 5px #4caf50; }
  to{ box-shadow:0 0 20px #4caf50; }
}


.option-card.wrong-answer{
  background:#f44336 !important;
  color:white;
  border:2px solid #c62828;
  animation:shake 0.3s ease;
}

@keyframes shake{
  0%{ transform:translateX(0); }
  25%{ transform:translateX(-5px); }
  50%{ transform:translateX(5px); }
  75%{ transform:translateX(-5px); }
  100%{ transform:translateX(0); }
}



/* Battlefield Scoreboard Strip */
.battle-scoreboard{
  display:flex;
  justify-content:space-between;
  align-items:center;
  background:#1c1919;
  border-radius:15px;
  padding:12px 20px;
  margin-bottom:15px;
  box-shadow:0 4px 10px rgba(0,0,0,0.05);
  font-weight:bold;
  font-size:18px;
  margin-top: 4%;
}

/* Player score blocks */
.battle-player{
  display:flex;
  align-items:center;
  gap:10px;
}

/* Left / Right colors */
.left-score span:last-child{
  color:#2196f3;
  font-size:22px;
}

.right-score span:first-child{
  color:#f44336;
  font-size:22px;
}

/* Timer styling */
.battle-timer{
  color:#2196f3;
  font-size:20px;
}


.battlefield{
  position:relative;
  display:flex;
  justify-content:center;
  align-items:center;
  /*height:180px;  adjust height if needed */
  overflow:hidden;
}

/* MP4 background */
.battle-video{
  position:absolute;
   /* width:260px;     adjust size */
  max-width:100%;
  opacity:0.95;
  pointer-events:none;
  z-index:1;
}

/* Health bars above video */
.health-container{
  position:relative;
  display:flex;
  gap:20px;
  align-items:center;
  z-index:2;
}




.score-pop{
  animation: scorePop 0.35s ease;
}

@keyframes scorePop{
  0%   { transform: scale(1); }
  50%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.timer-warning{
  animation: timerPulse 0.8s infinite;
  color:#f44336;
}

@keyframes timerPulse{
  0%  { transform: scale(1); }
  50% { transform: scale(1.15); }
  100%{ transform: scale(1); }
}
.rope-animate{
  transition: all 0.35s cubic-bezier(.34,1.56,.64,1);
}
.winner-flash{
  animation: winnerFlash 0.6s ease 3;
}

@keyframes winnerFlash{
  0%  { background:#fff; }
  50% { background:#4caf50; }
  100%{ background:#fff; }
}
.battle-result{
  font-size:28px;
  font-weight:bold;
  text-align:center;
  margin:10px 0;
  height:40px;
  color:#4caf50;
  animation: winnerPulse 1s infinite;
  line-height: 28px;
}

@keyframes winnerPulse{
  0%  { transform: scale(1); }
  50% { transform: scale(1.08); }
  100%{ transform: scale(1); }
}

.victory-mode{
  animation: victoryFlash 0.6s ease 3;
}

@keyframes victoryFlash{
  0%  { background:#fff; }
  50% { background:#ffe082; }
  100%{ background:#fff; }
}

/* Rope snap */

.rope-snap{
  transition: all 0.6s cubic-bezier(.34,1.56,.64,1);
}

/* Character celebration */

.character-win{
  animation: winnerBounce 0.6s infinite;
}

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

/* Confetti */

.confetti{
  position:absolute;
  width:10px;
  height:10px;
  background:red;
  animation: confettiFall 1.2s linear forwards;
}

@keyframes confettiFall{
  from { transform: translateY(-50px) rotate(0deg); opacity:1; }
  to   { transform: translateY(300px) rotate(360deg); opacity:0; }
}


.health-container{
  width:100%;
  padding:20px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:20px;
}

.health-bar{
  width:40%;
  height:22px;
  background:#2c2c2c;
  border-radius:20px;
  overflow:hidden;
  box-shadow: inset 0 0 5px rgba(0,0,0,.5);
  margin-top: 40%;
}

.health-fill{
  height:100%;
  width:100%;
  background:linear-gradient(90deg,#00ff87,#60efff);
  transition: width 0.4s ease;
}

.player2 .health-fill{
  background:linear-gradient(90deg,#ff512f,#dd2476);
}

.vs-text{
  font-size:22px;
  font-weight:bold;
}
.health-hit{
  animation: healthFlash 0.3s;
}

@keyframes healthFlash{
  0%{ filter:brightness(2); }
  100%{ filter:brightness(1); }
}
/* ===============================
   WINNER BANNER
================================ */

.winner-banner{
  position:absolute;
  top:17%;
  left:50%;
  transform:translate(-50%,-50%) scale(0.6);
  font-size:35px;
  font-weight:bold;
  color:#fff;
  text-shadow:0 0 15px gold, 0 0 30px red;
  opacity:0;
  pointer-events:none;
  z-index:50;
  transition:all 0.5s ease;
}

.winner-banner.show{
  transform:translate(-50%,-50%) scale(1);
  opacity:1;
}

/* ===============================
 HEALTH EXPLOSION
================================ */

.explosion{
  position:absolute;
  width:120px;
  height:120px;
  border-radius:50%;
  background:radial-gradient(circle, orange 0%, red 40%, transparent 70%);
  animation:explode 0.6s ease-out forwards;
  pointer-events:none;
  z-index:40;
}

@keyframes explode{
  0%{
      transform:scale(0.3);
      opacity:1;
  }
  100%{
      transform:scale(2.5);
      opacity:0;
  }
}


/* ================= FLOATING CONTROLS ================= */

.floating-controls{
  position:fixed;
  bottom:20px;
  right:20px;
  display:flex;
  flex-direction:column;
  gap:12px;
  z-index:9999;
}

.float-btn{
  padding:12px 16px;
  border:none;
  border-radius:50px;
  font-weight:bold;
  cursor:pointer;
  font-size:14px;
  background:linear-gradient(135deg,#4caf50,#2e7d32);
  color:white;
  box-shadow:0 6px 20px rgba(0,0,0,0.3);
  transition:0.2s;
}

.float-btn:hover{
  transform:translateY(-3px);
  box-shadow:0 10px 25px rgba(0,0,0,0.4);
}

.home-btn{
  background:linear-gradient(135deg,#1976d2,#0d47a1);
}

/* Hide in print */
@media print{
  .floating-controls{display:none;}
}

/* ================= FLOATING CONTROLS ================= */

.floating-controls{
  position:fixed;
  bottom:20px;
  right:20px;
  z-index:9999;
}

.music-panel{
  display:flex;
  flex-direction:column;
  gap:10px;
  background:rgba(0,0,0,0.6);
  padding:14px;
  border-radius:16px;
  backdrop-filter:blur(10px);
}

.float-btn{
  padding:10px 14px;
  border:none;
  border-radius:40px;
  font-weight:bold;
  cursor:pointer;
  font-size:13px;
  background:linear-gradient(135deg,#4caf50,#2e7d32);
  color:white;
  box-shadow:0 6px 18px rgba(0,0,0,0.3);
  transition:0.2s;
}

.float-btn:hover{
  transform:translateY(-2px);
}

.home-btn{
  background:linear-gradient(135deg,#1976d2,#0d47a1);
}

.sfx-btn{
  background:linear-gradient(135deg,#ff9800,#e65100);
}

#volumeSlider{
  width:120px;
}

/* 📱 Mobile - move to left */
@media(max-width:768px){
  .floating-controls{
      right:auto;
      left:15px;
      bottom:15px;
  }
}

@media print{
  .floating-controls{display:none;}
}


.setup-container{
  text-align:center;
  max-width:600px;
  margin:auto;
}

.subject-cards{
  display:flex;
  justify-content:center;
  gap:20px;
  margin:20px 0 30px;
  flex-wrap:wrap;
}

.subject-card{
  width:150px;
  height:130px;
  background:linear-gradient(145deg,#1f2937,#111827);
  color:white;
  border-radius:15px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  font-size:40px;
  cursor:pointer;
  transition:0.3s ease;
  box-shadow:0 10px 20px rgba(0,0,0,0.3);
}

.subject-card span{
  font-size:16px;
  margin-top:10px;
}

.subject-card:hover{
  transform:translateY(-5px) scale(1.05);
}

.subject-card.active{
  background:linear-gradient(145deg,#2563eb,#1d4ed8);
  box-shadow:0 0 20px rgba(37,99,235,0.8);
}

.group-section{
  display:flex;
  gap:15px;
  justify-content:center;
  margin-bottom:20px;
}

.group-section input{
  padding:12px;
  border-radius:8px;
  border:none;
  width:180px;
  font-size:14px;
}

.duration-section{
  margin-bottom:20px;
}

.duration-section input{
  padding:10px;
  width:120px;
  border-radius:8px;
  border:none;
  text-align:center;
}

#startBtn{
  padding:14px 30px;
  font-size:16px;
  border:none;
  border-radius:10px;
  background:#16a34a;
  color:white;
  cursor:pointer;
  transition:0.3s;
}

#startBtn:disabled{
  background:#6b7280;
  cursor:not-allowed;
}

#startBtn:hover:not(:disabled){
  transform:scale(1.05);
}


#countdown-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.85);
  display:flex;
  align-items:center;
  justify-content:center;
  z-index:9999;
  opacity:0;
  pointer-events:none;
  transition:opacity 0.3s ease;
}

#countdown-overlay.show{
  opacity:1;
  pointer-events:auto;
}

#countdown-number{
  font-size:120px;
  font-weight:bold;
  color:white;
  animation:pop 0.8s ease;
}

@keyframes pop{
  0%{ transform:scale(0.5); opacity:0; }
  50%{ transform:scale(1.3); }
  100%{ transform:scale(1); opacity:1; }
}
