/* style.css */

/* RTL adjustments */
html[dir="rtl"] {
  direction: rtl;
  text-align: right;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
/* Add this to your style.css */
.logo {
  width: 300px;  /* Adjust this value to make logo bigger/smaller */
  height: auto; /* Maintain aspect ratio */
  margin-right: 1px; /* Optional spacing adjustment */
}
/* --- LANDING PAGE STYLES --- */
.landing-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  width: 100%;
  gap: 20px;
  padding: 20px;
}

.landing-section {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 90%;
  text-align: center;
  transition: transform 0.3s ease-in-out;
  cursor: pointer;
}

.landing-section:hover {
  transform: translateY(-5px);
}

.landing-section h2 {
  font-size: 2.2rem;
  font-weight: bold;
  margin-bottom: 20px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.landing-section p {
  font-size: 1.1rem;
}

body {
  font-family: 'Roboto', sans-serif;
  background: linear-gradient(135deg, #1e3c72, #2a5298);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  color: #fff;
  text-align: center;
  padding: 20px;
  overflow-y: auto;
  flex-direction: column;
}

/* --- LOBBY SECTION --- */
.lobby-container {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 40px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  max-width: 450px;
  width: 90%;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease-in-out;
}

.lobby-container:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
}

.lobby-container h2 {
  font-size: 2.2rem;
  font-weight: bold;
  color: #ffffff;
  margin-bottom: 20px;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

#room-code-input {
  padding: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 10px;
  width: 85%;
  font-size: 1.1rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.3);
  color: #fff;
  outline: none;
  transition: all 0.3s ease;
  margin-bottom: 15px;
}

#room-code-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

#room-code-input:focus {
  border-color: #2ecc71;
  background: rgba(255, 255, 255, 0.4);
}

#room-code-display {
  display: block;
  margin-top: 15px;
  font-size: 1.3rem;
  font-weight: bold;
  color: #ffffff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.instructions {
  background: rgba(255, 255, 255, 0.2);
  padding: 20px;
  border-radius: 10px;
  max-width: 450px;
  width: 90%;
  margin-top: 20px;
  color: #ffffff;
  text-align: center;
}

.instructions h3 {
  font-size: 1.8rem;
  margin-bottom: 10px;
}

.instructions p {
  font-size: 1rem;
  line-height: 1.5;
}

/* Stylish Buttons */
button {
  border: none;
  border-radius: 8px;
  padding: 15px 30px;
  font-size: 1.1rem;
  font-weight: bold;
  text-transform: uppercase;
  transition: all 0.3s ease;
  color: white;
  cursor: pointer;
  width: 85%;
  max-width: 300px;
  margin-bottom: 10px;
}

#create-room-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#create-room-btn:hover {
  background: linear-gradient(135deg, #27ae60, #219a52);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

#join-room-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#join-room-btn:hover {
  background: linear-gradient(135deg, #2980b9, #2471a3);
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}
.hidden-for-opponent {
  opacity: 0;
  height: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}
/* Game Container */
.game-container {
  background-color: #ffffff;
  color: #333;
  padding: 30px;
  /* Remove or override any max-width restrictions */
  width: 100%;
  min-height: 100vh;
  margin: 0;
  border-radius: 0;
  box-sizing: border-box;
}


/* Headings */
h1 {
  font-size: 2.4rem;
  color: #2a5298;
  font-weight: 700;
  margin: 20px 0 10px 0 !important; 
}

h2 {
  font-size: 2rem;
  color: #6174ee;
  margin-bottom: 15px;
}

h3 {
  font-size: 1.3rem;
  margin: 10px 0;
  font-weight: 500;
}

/* Language Switcher */
#languageSwitcher {
  top: 20px;
  padding: 8px 16px;
  border: 2px solid #2a5298;
  border-radius: 25px;
  background: rgba(255, 255, 255, 0.9);
  color: #2a5298;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: all 0.3s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232a5298" width="18" height="18"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px;
  position: relative;
  display: block;
  z-index: 100;
  transform: translateY(-10px);
  margin: 0 auto 20px auto;
  width: 200px;
}

#languageSwitcher:hover {
  background: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


@keyframes pulse {
  0% { opacity: 0.3; }
  50% { opacity: 0.6; }
  100% { opacity: 0.3; }
}

.game-container.same-screen {
  flex-direction: row;
  justify-content: center;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
}

.game-container.same-screen .player-circle {
  display: block;
  position: relative;
  width: 300px;     /* or 250px, 350px, etc. */
  height: 300px;    
  margin: 20px;     /* spacing around each circle */
  left: auto !important;
  transform: none !important;
}

.game-container.multiplayer .player-circle {
  display: flex !important; /* Ensures they are visible */
}


/* Player Circles */
.circles-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 40px; /* Adjust spacing between circles as needed */
  width: 100%;
  margin-bottom: 60px; /* Space between circles and next content */
  padding-right: 60px;
}

/* Override any old positioning rules on player circles */
.player-circle {
  /* Remove any positioning like left or transform from previous rules */
  position: relative;
  width: 300px;  /* Adjust circle size if needed */
  height: 300px;
  margin: 0;     /* Let the container handle spacing */
  left: auto !important;
  transform: none !important;
}



.player-circle.active {
  display: block;
}

.alphabet-circle {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#player1-circle .alphabet-circle,
#player2-circle .alphabet-circle {
  border-color: #9b59b6;
}

/* Letters */
.letter {
  position: absolute;
  width: 60px;
  height: 60px;
  line-height: 60px;
  text-align: center;
  font-size: 1.6rem;
  font-weight: bold;
  color: white;
  background: linear-gradient(145deg, #483d8b, #6a5acd);
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.letter:hover:not(.used) {
  background: linear-gradient(145deg, #7b68ee, #6a5acd);
  transform: scale(1.2) translateY(-5px);
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
  z-index: 1;
}

.letter.active {
  background: linear-gradient(145deg, #9370db, #8a2be2) !important;
  transform: scale(1.3);
  box-shadow: 0 0 25px rgba(147, 112, 219, 0.6);
  animation: pulse-glow 1s infinite;
  z-index: 2;
}

.letter.correct {
  background: #2ecc71 !important;
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(46, 204, 113, 0.6);
  opacity: 0.7;
}

.letter.incorrect {
  background: #e74c3c !important;
  transform: scale(1.1);
  box-shadow: 0 5px 20px rgba(231, 76, 60, 0.6);
  opacity: 0.7;
}

.letter.used {
  filter: none !important;
  cursor: not-allowed;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 15px rgba(147, 112, 219, 0.4); }
  50% { box-shadow: 0 0 30px rgba(147, 112, 219, 0.8); }
  100% { box-shadow: 0 0 15px rgba(147, 112, 219, 0.4); }
}

/* Question Container */
#question-container {
  background-color: #ffffff;
  padding: 10px 10px;
  border-radius: 12px;
  margin: 20px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 500;
  color: #333;
  border: 2px solid #2a5298;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

#question-container:hover {
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

#question-container::before {
  content: none;
}

/* Answer Container */
.answer-container {
  margin: 4px 0;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-direction: column;
  align-items: center;
}

#answer-input {
  padding: 15px;
  border: 2px solid #3498db;
  border-radius: 6px;
  width: 100%;
  max-width: 400px;
  font-size: 1.1rem;
  min-height: 50px;
  transition: border-color 0.3s ease;
}

#answer-input:focus {
  outline: none;
  border-color: #2ecc71;
}

/* Buttons */
button {
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: white;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#submit-answer {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  padding: 15px 30px;
  font-size: 1.1rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

#submit-answer:hover {
  background: linear-gradient(135deg, #27ae60, #219a52);
  transform: translateY(-2px);
}

#skip-btn {
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  padding: 15px 30px;
  font-size: 1.1rem;
  width: 100%;
  max-width: 400px;
  margin: 10px 0;
}

#skip-btn:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-2px);
}

#pause-btn {
  background: linear-gradient(135deg, #f1c40f, #f39c12);
  padding: 12px 25px;
  font-size: 1rem;
  margin: 10px 0;
}

#pause-btn:hover {
  background: linear-gradient(135deg, #f39c12, #e67e22);
}

#restart-btn {
  background: linear-gradient(135deg, #3498db, #2980b9);
  padding: 15px 30px;
  font-size: 1.1rem;
  width: 100%;
  max-width: 400px;
  margin-top: 20px;
}

#restart-btn:hover {
  background: linear-gradient(135deg, #2980b9, #2471a3);
}

/* Result Container */
#result {
  display: none;
  padding: 25px;
  background: #f7f7f7;
  border-radius: 10px;
  margin-top: 20px;
  width: 100%;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
  z-index: 9999;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2)
}
/* Add this new rule */
#result.show {
  display: block !important;
}

/* Play Button */
.play-btn {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
  padding: 20px 40px;
  font-size: 1.3em;
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
  margin-top: 0 !important;
  position: relative;
  z-index: 1;
  margin: 0 auto !important;
}

/* Start Button Hover */
.start-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

/* Score Board */
.score-board {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  gap: 30px;
  font-size: 1.4rem;
  font-weight: bold;
  color: #2a5298;
}

/* Responsive Design */
@media (max-width: 600px) {
  body {
    padding: 10px;
  }

  .game-container {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
  }

  #answer-input {
    font-size: 1rem;
    padding: 12px;
  }

  #submit-answer,
  #skip-btn,
  #restart-btn {
    padding: 12px 24px;
    font-size: 1rem;
  }

  .alphabet-circle {
    width: 280px;
    height: 280px;
  }

  .letter {
    width: 38px;
    height: 38px;
    line-height: 38px;
    font-size: 1rem;
  }
}

/* Transition Effects */
.player-circle {
  transition: opacity 0.5s ease;
}

.player-circle:not(.active) {
  opacity: 0;
  pointer-events: none;
}

/* --- Player Containers & Timer Styles --- */
.player-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px; /* Adjust spacing as needed */
}

.player-timer h3 {
  font-size: 1.1rem;
  color: #2a5298;
  padding-left: 60px;
  margin: 0;
}

/* Animations */
@keyframes correct-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1.1); }
}

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

#waiting-message {
  color: #2a5298;
  font-size: 1.4rem;
  font-weight: bold;
  padding: 20px;
  text-align: center;
  animation: pulse-scale 1.5s infinite;
  margin-top: 20px;
}

#question {
  transition: opacity 0.3s ease;
}

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