/* ========================================
   CLASSIC MODE GAMEPLAY REDESIGN
   Professional Yet Playful Quiz Interface
   Full Display Space Utilization
   ======================================== */

/* ========================================
   MAIN GAME CONTAINER
   ======================================== */

/* Animated background overlay */

/* ========================================
   QUESTION SECTION LAYOUT
   ======================================== */

#questionSection {
  flex: 1;
  display: grid;
  grid-template-areas:
    "question-num question-num teams"
    "question-card question-card teams"
    "choices choices teams";
  grid-template-columns: 1fr 1fr 220px;
  gap: 1.5rem;
  padding: 2rem;
  position: relative;
  max-height: 100vh;
  overflow: hidden;
}

/* ========================================
   QUESTION NUMBER INDICATOR
   ======================================== */

#questionNumber {
  top: -20px; /* Adjusted for better visibility */
  grid-area: question-num;
  position: relative;
  background: linear-gradient(135deg, #ef4444, #dc2626, #b91c1c);
  border: 3px solid rgba(255, 255, 255, 0.3);
  width: 100px;
  height: 80px;
  border-radius: 10px;
  color: white;
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  justify-self: center;
  box-shadow: 0 0 40px rgba(239, 68, 68, 0.4),
    inset 0 2px 10px rgba(255, 255, 255, 0.2);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  animation: questionNumberPulse 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 10;
}

#questionNumber::before {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 10px;
  background: linear-gradient(
    45deg,
    transparent,
    rgba(239, 68, 68, 0.3),
    transparent
  );
  animation: questionNumberRotate 3s linear infinite;
  z-index: -1;
}

/* ========================================
   QUESTION CARD
   ======================================== */

#questionCard {
  grid-area: question-card;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(240, 248, 255, 0.9),
    rgba(230, 244, 255, 0.85)
  );
  backdrop-filter: blur(20px);
  border: 3px solid rgba(59, 130, 246, 0.4);
  border-radius: 24px;
  padding: 3rem 2.5rem;
  font-size: clamp(4rem, 4vw, 2.8rem);
  font-weight: 700;
  color: #1e40af;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  box-shadow: 0 25px 50px rgba(59, 130, 246, 0.15),
    0 10px 25px rgba(99, 102, 241, 0.1),
    inset 0 1px 3px rgba(255, 255, 255, 0.8), 0 0 40px rgba(59, 130, 246, 0.1);
  position: relative;
  overflow: hidden;
  width: 1500px;
  animation: questionCardSlide 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
  height: 350px; /* Fixed height for consistency */
  top: -90px; /* Adjusted for better visibility */
}

#questionCard::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(59, 130, 246, 0.1),
    transparent
  );
  animation: questionShimmer 3s ease-in-out infinite;
}

/* ========================================
   CHOICES CONTAINER
   ======================================== */

#choicesContainer {
  grid-area: choices;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  perspective: 1000px;
  animation: choicesContainerAppear 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
  margin-top: -80px;
}

/* ========================================
   CHOICE BUTTONS
   ======================================== */

.choiceBtn {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 250, 252, 0.85),
    rgba(241, 245, 249, 0.8)
  );
  backdrop-filter: blur(20px);
  border: 3px solid rgba(34, 197, 94, 0.4);
  border-radius: 16px;
  padding: 2rem 1.5rem;
  font-size: clamp(2rem, 2.5vw, 1.4rem);
  font-weight: 600;
  color: #1f2937;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.4;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(34, 197, 94, 0.12),
    0 4px 12px rgba(99, 102, 241, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: choiceAppear 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  animation-fill-mode: both;
  opacity: 0;
  width: 730px;
  height: 190px; /* Fixed height for consistency */
}

.choiceBtn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    rgba(34, 197, 94, 0.1),
    rgba(59, 130, 246, 0.1)
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

/* Staggered choice animations */
.choiceBtn:nth-child(1) {
  animation-delay: 0.5s;
}
.choiceBtn:nth-child(2) {
  animation-delay: 0.6s;
}
.choiceBtn:nth-child(3) {
  animation-delay: 0.7s;
}
.choiceBtn:nth-child(4) {
  animation-delay: 0.8s;
}

.choiceBtn:hover:not(:disabled) {
  transform: translateY(-8px) scale(1.02);
  border-color: #3b82f6;
  box-shadow: 0 20px 40px rgba(59, 130, 246, 0.2),
    0 10px 25px rgba(34, 197, 94, 0.15), 0 0 30px rgba(139, 92, 246, 0.1);
  color: white;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #06b6d4);
}

.choiceBtn:hover:not(:disabled)::before {
  opacity: 1;
}

.choiceBtn:hover:not(:disabled)::after {
  opacity: 0.8;
}

.choiceBtn:hover:not(:disabled) span {
  position: relative;
  z-index: 2;
}

.choiceBtn:active:not(:disabled) {
  transform: translateY(-4px) scale(0.98);
}

.choiceBtn:disabled {
  cursor: not-allowed;
}

/* Answer State Styles */
.choiceBtn.correct {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #2bdf34;
  color: white;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.4), 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: correctPulse 1s ease-in-out;
  transform: scale(1.05);
  opacity: 1;
}

.choiceBtn.incorrect {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  border-color: #b91c1c;
  color: white;
  box-shadow: 0 0 30px rgba(239, 68, 68, 0.3), 0 15px 30px rgba(0, 0, 0, 0.2);
  animation: incorrectShake 0.6s ease-in-out;
  opacity: 1;
}

.choiceBtn.clicked {
  pointer-events: none;
  opacity: 0.8;
}

/* ========================================
   TEAMS CONTAINER
   ======================================== */

.teams-container {
  grid-area: teams;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch;
  gap: 1rem;
  padding: 2.5rem;
  width: 300px;
  animation: teamsAppear 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.9s both;
}

/* ========================================
   TEAM CARDS
   ======================================== */

.team-info {
  background: #ffeb3b;
  border: none;
  border-radius: 0;
  padding: 1rem 1.5rem;
  min-width: auto;
  width: 80%;
  height: 120px; /* Fixed height for consistency */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;

  animation-fill-mode: both;
  transform: rotate(-2deg);
  margin-bottom: 0.5rem;
}

/* Post-it note tape effect */
.team-info::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 20%;
  right: 20%;
  height: 15px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 0 0 3px 3px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Different colored post-it notes for each team */
#teamOne {
  background: #ffeb3b; /* Yellow */
  transform: rotate(-1deg);
  animation-delay: 1s;
}

#teamTwo {
  background: #4caf50; /* Green */
  transform: rotate(1deg);
  animation-delay: 1.1s;
}

#teamThree {
  background: #ff9800; /* Orange */
  transform: rotate(-2deg);
  animation-delay: 1.2s;
}

#teamFour {
  background: #e91e63; /* Pink */
  transform: rotate(1.5deg);
  animation-delay: 1.3s;
}

/* Staggered team animations */
#teamOne {
  animation-delay: 1s;
}
#teamTwo {
  animation-delay: 1.1s;
}
#teamThree {
  animation-delay: 1.2s;
}
#teamFour {
  animation-delay: 1.3s;
}

.team-info:hover {
  transform: rotate(0deg) translateY(-3px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
  z-index: 10;
}

/* Current Team Turn Highlighting */
.team-info.current-turn {
  box-shadow: 0 0 20px rgba(255, 193, 7, 0.8), 0 8px 16px rgba(0, 0, 0, 0.3),
    inset 0 0 0 3px rgba(255, 193, 7, 0.5);
  transform: rotate(0deg) scale(1.05);
  animation: currentTeamPulse 2s ease-in-out infinite;
  z-index: 15;
}

.team-info.current-turn::before {
  background: rgba(255, 193, 7, 0.4);
  height: 20px;
}

.team-info.current-turn::after {
  content: "YOUR TURN";
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  background: #f44336;
  color: white;
  padding: 2px 8px;
  border-radius: 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(244, 67, 54, 0.4);
  animation: turnIndicatorBounce 1s ease-in-out infinite alternate;
  transform: translateX(-50%) rotate(-5deg);
}

/* Team Names */
.team-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: #2e2e2e;
  margin-bottom: 0.3rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  text-shadow: none;
}

.team-info.current-turn .team-name {
  color: #1a1a1a;
}

/* Team Scores */
.team-score {
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #2e2e2e;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.team-info.current-turn .team-score {
  color: #1a1a1a;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
}

.score-updated {
  animation: scoreIncrease 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.score-updated::after {
  content: "+1";
  position: absolute;
  top: -20px;
  right: -15px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
  animation: pointFloat 1.5s ease-out forwards;
  opacity: 0;
}

/* ========================================
   ANSWER OVERLAY MODAL
   ======================================== */

.answer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(12px);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.answer-overlay.visible {
  opacity: 1;
  visibility: visible;
}

.answer-box-content {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.9)
  );
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-radius: 24px;
  padding: 3rem 4rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  color: #1e293b;
  text-align: center;
  max-width: 80vw;
  line-height: 1.4;
  margin-bottom: 3rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2),
    0 15px 35px rgba(99, 102, 241, 0.1);
  backdrop-filter: blur(20px);
  transform: scale(0.8) translateY(40px);
  opacity: 0;
  transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.answer-overlay.visible .answer-box-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

/* Next Button */
#nextBtn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 16px;
  padding: 1rem 3rem;
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3), 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateY(30px);
  opacity: 0;
  position: relative;
  overflow: hidden;
}

.answer-overlay.visible #nextBtn {
  transform: translateY(0);
  opacity: 1;
  transition-delay: 0.3s;
}

#nextBtn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

#nextBtn:hover:not(:disabled) {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4),
    0 8px 20px rgba(0, 0, 0, 0.15);
}

#nextBtn:hover:not(:disabled)::before {
  left: 100%;
}

#nextBtn:disabled {
  background: linear-gradient(135deg, #9ca3af, #6b7280);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

#nextBtn.game-over {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  animation: gameOverPulse 2s ease-in-out infinite;
}

/* ========================================
   WINNER SCREEN
   ======================================== */

.winner-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(
    135deg,
    #0f0f23 0%,
    #1a1a3e 25%,
    #2d1b69 50%,
    #1e3a8a 100%
  );
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.winner-screen.show {
  opacity: 1;
  visibility: visible;
}

.winner-content {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.9)
  );
  border: 3px solid rgba(99, 102, 241, 0.3);
  border-radius: 32px;
  padding: 4rem 3rem;
  max-width: 90vw;
  width: 700px;
  text-align: center;
  box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3),
    0 20px 40px rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(20px);
  transform: scale(0.8) translateY(50px);
  animation: winnerAppear 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.trophy-container {
  margin-bottom: 2rem;
}

.trophy-image {
  height: 120px;
  filter: drop-shadow(0 10px 25px rgba(245, 158, 11, 0.4));
  animation: trophyFloat 3s ease-in-out infinite;
}

.winner-title {
  font-family: "Poppins", sans-serif;
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b, #d97706, #92400e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 1rem 0;
  letter-spacing: 2px;
  text-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  animation: winnerTitleGlow 2s ease-in-out infinite alternate;
}

.winner-message {
  font-size: 1.5rem;
  font-weight: 600;
  color: #334155;
  margin: 1.5rem 0;
  line-height: 1.4;
}

.winner-scores {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.winner-score-item {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid rgba(99, 102, 241, 0.2);
  border-radius: 16px;
  padding: 1.5rem 2rem;
  min-width: 140px;
  transition: all 0.3s ease;
  position: relative;
}

.winner-score-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.winner-score-item.winner {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.2),
    rgba(217, 119, 6, 0.1)
  );
  border-color: #f59e0b;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.3);
}

.winner-score-item.winner::before {
  content: "👑";
  position: absolute;
  top: -15px;
  right: -10px;
  font-size: 2rem;
  animation: crownFloat 2s ease-in-out infinite;
}

.score-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.winner-score-item.winner .score-name {
  color: #92400e;
}

.score-value {
  font-family: "Poppins", sans-serif;
  font-size: 2.5rem;
  font-weight: 800;
  color: #6366f1;
}

.winner-score-item.winner .score-value {
  color: #f59e0b;
}

.winner-buttons-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 2rem;
  flex-wrap: wrap;
}

.winner-btn {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  border: none;
  border-radius: 16px;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  min-width: 160px;
  justify-content: center;
}

.winner-btn:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 15px 35px rgba(99, 102, 241, 0.4);
}

.winner-btn.home-btn {
  background: linear-gradient(135deg, #8b5cf6, #7c3aed);
}

.btn-icon {
  font-size: 1.2rem;
}
