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

body {
  font-family: 'Georgia', serif;
  background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

h1 {
  font-size: 2.5em;
  margin: 20px 0;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  gap: 15px;
  margin-bottom: 30px;
  background: rgba(255,255,255,0.1);
  padding: 5px;
  border-radius: 50px;
  backdrop-filter: blur(10px);
}

.mode-btn {
  background: transparent;
  color: #fff;
  padding: 12px 30px;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

.mode-btn:hover {
  background: rgba(255,255,255,0.1);
}

.mode-btn.active {
  background: #ffeb3b;
  color: #1e3c72;
  box-shadow: 0 4px 15px rgba(255,235,59,0.4);
}

/* Spin Mode Styles */
.progress {
  background: rgba(255,255,255,0.2);
  padding: 10px 20px;
  border-radius: 25px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
}

.wheel-container {
  position: relative;
  width: 400px;
  height: 400px;
  margin: 30px 0;
}

.pointer {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 20px solid transparent;
  border-right: 20px solid transparent;
  border-top: 40px solid #ffeb3b;
  z-index: 10;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

#wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 8px solid #ffeb3b;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  position: relative;
  overflow: hidden;
  background: #2c3e50;
}

.wheel-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 70px;
  height: 70px;
  background: linear-gradient(135deg, #ffeb3b 0%, #fdd835 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  color: #1e3c72;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  z-index: 5;
  border: 3px solid white;
}

#spin-btn {
  background: #ffeb3b;
  color: #1e3c72;
  padding: 15px 50px;
  border: none;
  border-radius: 50px;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,235,59,0.4);
  transition: all 0.3s;
  margin: 30px auto 10px auto;
  display: block;
  text-align: center;
}

#spin-btn:hover:not(:disabled) {
  background: #fdd835;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,235,59,0.6);
}

#spin-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#result {
  margin-top: 20px;
  font-size: 20px;
  text-align: center;
  background: rgba(255,255,255,0.1);
  padding: 20px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  min-height: 100px;
  max-width: 600px;
}

#result img {
  margin-top: 15px;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  max-width: 200px;
}

.category-badge {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 14px;
  margin-top: 10px;
}

/* Guess Mode Styles */
.game-stats {
  display: flex;
  gap: 20px;
  margin-bottom: 25px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat-box {
  background: rgba(255,255,255,0.15);
  padding: 15px 30px;
  border-radius: 15px;
  backdrop-filter: blur(10px);
  text-align: center;
  min-width: 120px;
}

.stat-label {
  font-size: 14px;
  opacity: 0.8;
  margin-bottom: 5px;
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: #ffeb3b;
}

.timer-container {
  margin-bottom: 20px;
  text-align: center;
}

.timer-bar {
  width: 100%;
  max-width: 400px;
  height: 30px;
  background: rgba(255,255,255,0.2);
  border-radius: 15px;
  overflow: hidden;
  margin: 0 auto 10px;
  position: relative;
}

.timer-fill {
  height: 100%;
  background: linear-gradient(90deg, #4caf50, #8bc34a);
  transition: width 0.1s linear;
  border-radius: 15px;
}

.timer-text {
  font-size: 24px;
  font-weight: bold;
  color: #ffeb3b;
}

.game-controls {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.game-btn {
  background: #ffeb3b;
  color: #1e3c72;
  padding: 15px 40px;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(255,235,59,0.4);
  transition: all 0.3s;
}

.game-btn:hover:not(:disabled) {
  background: #fdd835;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255,235,59,0.6);
}

.game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.game-btn.secondary {
  background: rgba(255,255,255,0.2);
  color: #fff;
}

.game-btn.secondary:hover:not(:disabled) {
  background: rgba(255,255,255,0.3);
}

.card-display {
  margin: 30px 0;
  display: flex;
  justify-content: center;
}

.card-container {
  position: relative;
  max-width: 400px;
  width: 100%;
}

.game-card {
  width: 100%;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.5);
  transition: all 0.5s ease;
}

.game-card.blurred {
  filter: blur(20px);
}

.game-card.revealed {
  filter: blur(0);
  animation: revealCard 0.5s ease;
}

@keyframes revealCard {
  0% { filter: blur(20px); transform: scale(0.95); }
  100% { filter: blur(0); transform: scale(1); }
}

.blur-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(30, 60, 114, 0.7);
  backdrop-filter: blur(5px);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.5s ease;
}

.blur-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.guess-prompt {
  font-size: 24px;
  font-weight: bold;
  color: #ffeb3b;
  text-align: center;
  animation: pulse 2s infinite;
}

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

.guess-input-container {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 30px 0;
  flex-wrap: wrap;
}

#guessInput {
  padding: 15px 25px;
  border: 3px solid #ffeb3b;
  border-radius: 50px;
  font-size: 18px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  backdrop-filter: blur(10px);
  min-width: 300px;
  outline: none;
  transition: all 0.3s;
}

#guessInput::placeholder {
  color: rgba(255,255,255,0.5);
}

#guessInput:focus {
  background: rgba(255,255,255,0.2);
  box-shadow: 0 0 20px rgba(255,235,59,0.3);
}

#submitGuessBtn {
  background: #4caf50;
  color: #fff;
  padding: 15px 40px;
  border: none;
  border-radius: 50px;
  font-size: 18px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
}

#submitGuessBtn:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(76,175,80,0.4);
}

#submitGuessBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#gameResult {
  text-align: center;
  font-size: 22px;
  margin: 20px 0;
  padding: 20px;
  border-radius: 15px;
  min-height: 60px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.hint-box {
  background: rgba(255,235,59,0.2);
  padding: 15px 25px;
  border-radius: 15px;
  margin: 20px auto;
  max-width: 500px;
  text-align: center;
  border: 2px solid #ffeb3b;
}

.correct-answer {
  color: #4caf50;
  font-weight: bold;
  animation: correctBounce 0.6s ease;
}

.wrong-answer {
  color: #f44336;
  font-weight: bold;
  animation: shake 0.5s ease;
}

@keyframes correctBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

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

/* Card Popup (Spin Mode) */
#cardPopup {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  backdrop-filter: blur(10px);
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

#cardPopupContent {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 90%;
  max-height: 90%;
  animation: scaleIn 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes scaleIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

#popupImage {
  width: 70vw;
  max-width: 600px;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 15px 50px rgba(255, 235, 59, 0.3);
  transition: transform 0.3s ease;
}

#popupImage:hover {
  transform: scale(1.02);
}

.popup-text {
  margin-top: 20px;
  font-size: 24px;
  font-weight: bold;
  color: #ffeb3b;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.popup-category {
  margin-top: 10px;
  font-size: 16px;
  opacity: 0.8;
}

.close-hint {
  margin-top: 15px;
  font-size: 14px;
  opacity: 0.7;
}

/* Mobile Responsive */
@media (max-width: 600px) {
  .wheel-container {
    width: 300px;
    height: 300px;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  .wheel-center {
    width: 50px;
    height: 50px;
    font-size: 10px;
  }

  .mode-toggle {
    flex-direction: column;
    width: 100%;
  }

  .mode-btn {
    width: 100%;
  }

  .game-stats {
    gap: 10px;
  }

  .stat-box {
    min-width: 90px;
    padding: 10px 20px;
  }

  .stat-value {
    font-size: 24px;
  }

  #guessInput {
    min-width: 100%;
  }

  .guess-input-container {
    flex-direction: column;
    padding: 0 20px;
  }

  #submitGuessBtn {
    width: 100%;
  }

}

/* --- BLUR EFFECTS FOR GUESS MODE (Enhanced coverage) --- */
.card-container {
  position: relative;
  display: inline-block;
  max-width: 400px;
  width: 100%;
}

#gameCardImage {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  transition: all 0.4s ease;
}

/* Disable full-card blur */
.game-card.blurred {
  filter: none !important;
}
.game-card.revealed {
  filter: none !important;
  transform: scale(1);
}

/* 🔹 Blur overlays for specific areas */
.blur-name,
.blur-image {
  position: absolute;
  backdrop-filter: blur(16px); /* slightly stronger blur */
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

/* Name area blur — wider & taller */
.blur-name {
  top: 1%;       /* moved up slightly */
  left: 8%;      /* wider */
  width: 60%;    /* wider */
  height: 9%;   /* taller */
}

/* Portrait area blur — covers more space */
.blur-image {
  top: 10%;      /* higher (starts closer to top) */
  left: 8%;      /* wider */
  width: 84%;    /* wider */
  height: 40%;   /* taller coverage */
}

.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
