/* Human Body Explorer - Gaming Styles */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700;800&display=swap");

:root {
  --primary: #06b6d4;
  --primary-dark: #0891b2;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e293b;
  --card-bg: rgba(255, 255, 255, 0.95);
  --text-dark: #1e293b;
  --text-light: #64748b;
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.4);
}

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

body {
  font-family: "Poppins", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(
    135deg,
    var(--bg-gradient-start) 0%,
    var(--bg-gradient-end) 100%
  );
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
    circle,
    rgba(6, 182, 212, 0.1) 0%,
    transparent 50%
  );
  animation: pulse-bg 15s ease-in-out infinite;
  pointer-events: none;
}

@keyframes pulse-bg {
  0%,
  100% {
    transform: scale(1);
    opacity: 0.3;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.5;
  }
}

/* Game Container */
#game-container {
  background: var(--card-bg);
  border-radius: 32px;
  padding: 40px;
  max-width: 1200px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  z-index: 1;
}

/* Header */
.game-header {
  text-align: center;
  margin-bottom: 40px;
}

.game-icon {
  font-size: 120px;
  animation: float 3s ease-in-out infinite;
  filter: drop-shadow(0 10px 20px rgba(6, 182, 212, 0.3));
  display: inline-block;
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-15px);
  }
}

.game-title {
  font-size: 3.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 20px 0 10px;
  letter-spacing: -1px;
}

.game-subtitle {
  font-size: 1.3rem;
  color: var(--text-light);
  font-weight: 500;
}

/* Skills Display */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin: 25px 0;
}

.skill-badge {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.2) 0%,
    rgba(139, 92, 246, 0.2) 100%
  );
  color: var(--primary);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--primary);
  text-transform: capitalize;
  transition: all 0.3s ease;
}

.skill-badge:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
}

/* Progress Bar */
.progress-container {
  margin: 30px 0;
  text-align: center;
}

.progress-label {
  font-size: 1.1rem;
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.progress-count {
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  color: white;
  padding: 5px 15px;
  border-radius: 20px;
  font-weight: 700;
}

.progress-bar {
  width: 100%;
  height: 20px;
  background: rgba(6, 182, 212, 0.1);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
  border-radius: 20px;
  transition: width 0.5s ease;
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.5);
}

/* Buttons */
.btn {
  padding: 18px 40px;
  font-size: 1.2rem;
  font-weight: 700;
  border: none;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s ease;
}

.btn:hover::before {
  left: 100%;
}

.btn-primary {
  background: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-dark) 100%
  );
  color: white;
  box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.btn-primary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(6, 182, 212, 0.5);
}

.btn-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--accent) 100%);
  color: white;
  box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
}

.btn-secondary:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(139, 92, 246, 0.5);
}

.btn-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4);
}

.btn-success:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 35px rgba(16, 185, 129, 0.5);
}

/* Game Screens */
.game-screen {
  display: none;
}

#welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.welcome-content {
  text-align: center;
  max-width: 700px;
}

.welcome-text {
  font-size: 1.2rem;
  color: var(--text-dark);
  line-height: 1.8;
  margin-bottom: 30px;
}

.mode-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
}

/* Exploration Screen */
#exploration-screen {
  display: none;
}

.exploration-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.body-diagram-container {
  position: relative;
  width: 400px;
  height: 600px;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.05) 0%,
    rgba(139, 92, 246, 0.05) 100%
  );
  border-radius: 200px;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow: inset 0 0 40px rgba(6, 182, 212, 0.1);
}

#body-diagram {
  position: relative;
  width: 100%;
  height: 100%;
}

.body-silhouette {
  width: 100%;
  height: 100%;
  opacity: 0.1;
  position: absolute;
  top: 0;
  left: 0;
}

/* Organ Hotspots */
.organ-hotspot {
  position: absolute;
  width: 80px;
  height: 80px;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
}

.hotspot-pulse {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: var(--organ-color, var(--primary));
  opacity: 0.3;
  animation: pulse-hotspot 2s ease-in-out infinite;
}

@keyframes pulse-hotspot {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.3;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.3);
    opacity: 0;
  }
}

.hotspot-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 48px;
  filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
  transition: all 0.3s ease;
}

.organ-hotspot:hover .hotspot-icon {
  transform: translate(-50%, -50%) scale(1.2);
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

.organ-hotspot.explored .hotspot-pulse {
  background: var(--success);
  animation: none;
  opacity: 0.5;
}

.organ-hotspot.explored::after {
  content: "✓";
  position: absolute;
  top: -10px;
  right: -10px;
  width: 30px;
  height: 30px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Organ Modal */
#organ-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

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

.organ-modal-content {
  background: var(--card-bg);
  border-radius: 32px;
  padding: 50px;
  max-width: 700px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  position: relative;
  animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideUp {
  from {
    transform: translateY(50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

#close-organ-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

#close-organ-modal:hover {
  background: var(--danger);
  color: white;
  transform: rotate(90deg);
}

.organ-modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

#organ-icon {
  font-size: 80px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.2));
}

#organ-name {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.organ-info-section {
  margin-bottom: 25px;
}

.info-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 10px;
}

.info-text {
  font-size: 1.1rem;
  color: var(--text-dark);
  line-height: 1.7;
}

.fun-fact-box {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.1) 0%,
    rgba(245, 158, 11, 0.05) 100%
  );
  border-left: 5px solid var(--warning);
  padding: 20px;
  border-radius: 12px;
  margin: 25px 0;
}

.fun-fact-box .info-text {
  color: #92400e;
  font-weight: 500;
}

#start-mini-quiz {
  width: 100%;
  margin-top: 20px;
}

/* Quiz Screen */
#quiz-screen {
  display: none;
  flex-direction: column;
  gap: 30px;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  border-radius: 20px;
}

.quiz-progress {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
}

.quiz-score {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--secondary);
}

.quiz-content {
  padding: 40px;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.5) 0%,
    rgba(248, 250, 252, 0.5) 100%
  );
  border-radius: 24px;
  box-shadow: inset 0 2px 20px rgba(0, 0, 0, 0.05);
}

#quiz-question {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.5;
}

#quiz-options {
  display: grid;
  gap: 20px;
  margin-bottom: 30px;
}

.quiz-option {
  padding: 25px 30px;
  font-size: 1.2rem;
  font-weight: 600;
  background: white;
  color: var(--text-dark);
  border: 3px solid rgba(6, 182, 212, 0.2);
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.quiz-option:hover:not(:disabled) {
  border-color: var(--primary);
  transform: translateX(10px);
  box-shadow: 0 6px 25px rgba(6, 182, 212, 0.2);
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.05) 0%, white 100%);
}

.quiz-option.correct {
  background: linear-gradient(135deg, #d1fae5 0%, #6ee7b7 100%);
  border-color: var(--success);
  border-width: 4px;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
  animation: correctPulse 0.5s ease;
}

.quiz-option.wrong {
  background: linear-gradient(135deg, #fee2e2 0%, #fca5a5 100%);
  border-color: var(--danger);
  border-width: 4px;
  box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
  animation: wrongShake 0.5s ease;
}

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

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

#quiz-explanation {
  display: none;
  padding: 25px;
  border-radius: 16px;
  font-size: 1.1rem;
  line-height: 1.7;
  margin-top: 25px;
}

.correct-explanation {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.1) 0%,
    rgba(16, 185, 129, 0.05) 100%
  );
  border-left: 5px solid var(--success);
  color: #065f46;
}

.wrong-explanation {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.1) 0%,
    rgba(239, 68, 68, 0.05) 100%
  );
  border-left: 5px solid var(--danger);
  color: #991b1b;
}

#next-question {
  display: none;
  width: 100%;
}

/* Flash Animations */
#quiz-screen.flash-correct {
  animation: flashCorrect 0.5s ease;
}

#quiz-screen.flash-wrong {
  animation: flashWrong 0.5s ease;
}

@keyframes flashCorrect {
  0%,
  100% {
    background: transparent;
  }
  50% {
    background: rgba(16, 185, 129, 0.1);
  }
}

@keyframes flashWrong {
  0%,
  100% {
    background: transparent;
  }
  50% {
    background: rgba(239, 68, 68, 0.1);
  }
}

/* Results Screen */
#results-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 35px;
  text-align: center;
}

.results-icon {
  font-size: 120px;
  animation: bounce 1s ease infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}

.results-title {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 25px;
  width: 100%;
  margin: 30px 0;
}

.stat-card {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.1) 0%,
    rgba(139, 92, 246, 0.1) 100%
  );
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.12);
}

.stat-value {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 10px;
}

.performance-message {
  font-size: 1.5rem;
  font-weight: 700;
  padding: 20px 40px;
  border-radius: 16px;
  margin: 20px 0;
}

.performance-message.perfect {
  background: linear-gradient(
    135deg,
    rgba(16, 185, 129, 0.2) 0%,
    rgba(16, 185, 129, 0.1) 100%
  );
  color: #065f46;
}

.performance-message.excellent {
  background: linear-gradient(
    135deg,
    rgba(6, 182, 212, 0.2) 0%,
    rgba(6, 182, 212, 0.1) 100%
  );
  color: #0e7490;
}

.performance-message.good {
  background: linear-gradient(
    135deg,
    rgba(245, 158, 11, 0.2) 0%,
    rgba(245, 158, 11, 0.1) 100%
  );
  color: #92400e;
}

.performance-message.try-again {
  background: linear-gradient(
    135deg,
    rgba(239, 68, 68, 0.2) 0%,
    rgba(239, 68, 68, 0.1) 100%
  );
  color: #991b1b;
}

.results-actions {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Responsive Design */
@media (max-width: 768px) {
  #game-container {
    padding: 25px;
  }

  .game-title {
    font-size: 2.5rem;
  }

  .game-icon {
    font-size: 80px;
  }

  .body-diagram-container {
    width: 300px;
    height: 450px;
  }

  .organ-hotspot {
    width: 60px;
    height: 60px;
  }

  .hotspot-icon {
    font-size: 36px;
  }

  .organ-modal-content {
    padding: 30px;
  }

  #organ-name {
    font-size: 2rem;
  }

  #quiz-question {
    font-size: 1.5rem;
  }

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

  .btn {
    width: 100%;
  }

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