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

body {
  font-family: "Inter", sans-serif;
  background: linear-gradient(135deg, #0a0e27 0%, #1a1d3a 100%);
  color: #fff;
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Grid Background */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to right, hsl(240 10% 20%) 1px, transparent 1px),
    linear-gradient(to bottom, hsl(240 10% 20%) 1px, transparent 1px);
  background-size: 50px 50px;
  pointer-events: none;
  z-index: 0;
}

/* Radial Gradient Overlay */
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 50% 50%,
      rgba(124, 58, 237, 0.1) 0%,
      transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.game-header {
  padding: 1.5rem 5%;
  backdrop-filter: blur(10px);
  background: rgba(10, 14, 39, 0.8);
  border-bottom: 1px solid rgba(124, 58, 237, 0.2);
  position: relative;
  z-index: 10;
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.logo:hover {
  transform: scale(1.05);
}

.logo img {
  height: 40px;
  width: auto;
  max-width: 150px;
  object-fit: contain;
}

.score-display {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(124, 58, 237, 0.2);
  padding: 0.5rem 1.5rem;
  border-radius: 20px;
  border: 1px solid rgba(124, 58, 237, 0.3);
}

.score-label {
  color: #94a3b8;
  font-size: 0.9rem;
}

.score-value {
  font-size: 1.5rem;
  font-weight: bold;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Mode Selection Popup */
.popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 14, 39, 0.95);
  backdrop-filter: blur(10px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.popup-content {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(124, 58, 237, 0.3);
  padding: 3rem;
  border-radius: 20px;
  text-align: center;
  max-width: 500px;
  width: 90%;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.3);
}

.popup-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.popup-subtitle {
  color: #94a3b8;
  margin-bottom: 2rem;
}

.mode-buttons {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.mode-btn {
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 600;
  border: 2px solid rgba(124, 58, 237, 0.5);
  border-radius: 10px;
  cursor: pointer;
  background: rgba(15, 23, 42, 0.6);
  color: white;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.mode-btn:hover {
  background: rgba(124, 58, 237, 0.2);
  border-color: #7c3aed;
  transform: translateY(-2px);
}

.mode-btn.beginner {
  border-color: rgba(34, 197, 94, 0.5);
}

.mode-btn.beginner:hover {
  border-color: #22c55e;
}

.mode-btn.intermediate {
  border-color: rgba(234, 179, 8, 0.5);
}

.mode-btn.intermediate:hover {
  border-color: #eab308;
}

.mode-btn.expert {
  border-color: rgba(239, 68, 68, 0.5);
}

.mode-btn.expert:hover {
  border-color: #ef4444;
}

/* Game Container */
.game-container {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem 5%;
  position: relative;
  z-index: 1;
}

.game-card {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 20px;
  padding: 2.5rem;
  max-width: 800px;
  width: 100%;
  backdrop-filter: blur(10px);
  box-shadow: 0 20px 60px rgba(124, 58, 237, 0.2);
}

.language-toggle {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.language-toggle button {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(124, 58, 237, 0.3);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.6);
  color: #94a3b8;
  transition: all 0.3s ease;
}

.language-toggle button.active {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
  border-color: transparent;
}

.question-container {
  margin-bottom: 2rem;
}

.question-text {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: #fff;
}

.choices {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.choice-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  background: rgba(15, 23, 42, 0.6);
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.choice-option:hover {
  border-color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  transform: translateY(-2px);
}

.choice-option input[type="radio"] {
  appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid #7c3aed;
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

.choice-option input[type="radio"]:checked {
  background: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.2);
}

.choice-label {
  flex: 1;
  font-size: 1rem;
  color: #fff;
}

.next-btn {
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
  color: white;
  border: none;
  padding: 1rem 3rem;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  font-size: 1.1rem;
  transition: transform 0.3s;
  width: 100%;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}

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

#back-to-home {
  color: #fff;
  display: flex;
  justify-content: center;
  padding-top: 20px;
  font-family: "cairo, sans-serif";
  font-weight: bold;
  cursor: pointer;
}

/* Progress Bar */
.progress-container {
  position: fixed;
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}

.progress-bar-wrapper {
  width: 50px;
  height: 400px;
  background: rgba(15, 23, 42, 0.8);
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 25px;
  padding: 5px;
  backdrop-filter: blur(10px);
}

.progress-bar {
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, #22c55e 0%, #16a34a 100%);
  border-radius: 20px;
  transition: height 0.3s ease, background 0.3s ease;
  position: relative;
}

.progress-bar.warning {
  background: linear-gradient(180deg, #ef4444 0%, #dc2626 100%);
}

.warning-message {
  position: fixed;
  right: 2rem;
  top: calc(50% - 250px);
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #ef4444;
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  max-width: 200px;
  backdrop-filter: blur(10px);
  display: none;
}

.warning-message.show {
  display: block;
}

.beta-badge {
  position: fixed;
  top: 1rem;
  background: rgba(239, 68, 68, 0.9);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  z-index: 100;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .logo img {
    height: 32px;
    max-width: 120px;
  }

  .choices {
    grid-template-columns: 1fr;
  }

  .progress-container {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    top: auto;
    right: auto;
  }

  .progress-bar-wrapper {
    width: 90vw;
    height: 30px;
  }

  .progress-bar {
    width: 100%;
    transition: width 0.3s ease;
  }

  .warning-message {
    bottom: 4rem;
    top: auto;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
  }

  .game-card {
    padding: 1.5rem;
  }

  .question-text {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  .popup-content {
    padding: 2rem 1.5rem;
  }

  .popup-content h2 {
    font-size: 1.5rem;
  }
}