@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700;900&display=swap');

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

:root {
  --primary: #6c5ce7;
  --primary-dark: #5a4bd1;
  --success: #00b894;
  --danger: #e17055;
  --warning: #fdcb6e;
  --dark: #2d3436;
  --light: #f8f9fa;
  --shadow: 0 4px 20px rgba(0,0,0,0.15);
  --radius: 16px;
}

body {
  font-family: 'Rubik', sans-serif;
  background: linear-gradient(135deg, #0c0c1d 0%, #1a1a3e 50%, #2d1b69 100%);
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;
}

.screen { display: none; min-height: 100vh; padding: 20px; }
.screen.active { display: flex; flex-direction: column; align-items: center; justify-content: center; animation: fadeIn 0.4s ease; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pop { 0% { transform: scale(0.8); opacity: 0; } 50% { transform: scale(1.05); } 100% { transform: scale(1); opacity: 1; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
@keyframes heartbreak { 0% { transform: scale(1); } 50% { transform: scale(1.3); } 100% { transform: scale(1); } }

/* Loading Screen */
.loading-content { text-align: center; }
.loading-spinner { font-size: 5rem; animation: spin 2s linear infinite; margin-bottom: 20px; }
.loading-content h2 { font-size: 1.8rem; margin-bottom: 10px; }
.loading-content p { color: #b2bec3; }

/* Start Screen */
.start-content { text-align: center; max-width: 500px; }
.start-content h1 { font-size: 3rem; font-weight: 900; margin-bottom: 10px; text-shadow: 0 4px 20px rgba(108,92,231,0.5); }
.subtitle { font-size: 1.2rem; color: #b2bec3; margin-bottom: 30px; }
.rules { background: rgba(255,255,255,0.05); border-radius: var(--radius); padding: 20px; margin-bottom: 30px; text-align: right; }
.rule { padding: 8px 0; font-size: 1rem; display: flex; align-items: center; gap: 10px; }
.rule-icon { font-size: 1.3rem; }

/* Buttons */
.btn {
  border: none; padding: 12px 28px; border-radius: 12px; font-family: inherit;
  font-size: 1rem; font-weight: 600; cursor: pointer; transition: all 0.2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 15px rgba(108,92,231,0.4); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-large { font-size: 1.3rem; padding: 16px 40px; }

.btn-5050 {
  background: rgba(253,203,110,0.15); color: var(--warning); border: 2px solid var(--warning);
  margin-top: 15px; transition: all 0.3s;
}
.btn-5050:hover { background: rgba(253,203,110,0.25); }
.btn-5050.used { opacity: 0.3; pointer-events: none; }

/* Game Header */
.game-header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; max-width: 700px; padding: 15px 20px;
  background: rgba(255,255,255,0.05); border-radius: var(--radius);
  margin-bottom: 10px; backdrop-filter: blur(10px);
}
.score-display { font-size: 1.4rem; font-weight: 700; color: var(--warning); }
.round-display { font-size: 1rem; color: #b2bec3; }
.streak-display { font-size: 1.2rem; }

/* Game Subheader */
.game-subheader {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 700px;
  margin-bottom: 15px;
}

/* Attempts Display */
.attempts-display {
  font-size: 1.5rem;
  letter-spacing: 4px;
  text-align: center;
  min-height: 30px;
}

/* Difficulty Label */
.difficulty-label {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s ease;
}
.difficulty-label.easy {
  background: rgba(0, 184, 148, 0.2);
  color: #00b894;
  border: 1px solid #00b894;
}
.difficulty-label.medium {
  background: rgba(253, 203, 110, 0.2);
  color: #fdcb6e;
  border: 1px solid #fdcb6e;
}
.difficulty-label.hard {
  background: rgba(225, 112, 85, 0.2);
  color: #e17055;
  border: 1px solid #e17055;
}

/* Image */
.image-container {
  width: 100%; max-width: 700px; height: 300px; border-radius: var(--radius);
  overflow: hidden; position: relative; cursor: pointer;
  box-shadow: var(--shadow); margin-bottom: 20px;
}
.image-container img {
  width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s;
}
.image-container:hover img { transform: scale(1.03); }
.image-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 15px; background: linear-gradient(transparent, rgba(0,0,0,0.7));
  text-align: center; pointer-events: none;
}
.magnify-icon { font-size: 0.9rem; color: rgba(255,255,255,0.7); }

/* Stage Indicator */
.stage-indicator {
  display: flex; gap: 8px; margin-bottom: 20px; direction: ltr;
}
.stage {
  padding: 8px 20px; border-radius: 20px; font-size: 0.85rem; font-weight: 600;
  background: rgba(255,255,255,0.08); color: #636e72; transition: all 0.3s;
}
.stage.active { background: var(--primary); color: #fff; animation: pop 0.3s ease; }
.stage.done { background: var(--success); color: #fff; }

/* Question */
.question { font-size: 1.5rem; font-weight: 700; margin-bottom: 20px; text-align: center; }

/* Options */
.options-container {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px; width: 100%; max-width: 700px;
}
.option-btn {
  padding: 16px 20px; border-radius: 14px; border: 2px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.05); color: #fff; font-family: inherit;
  font-size: 1.1rem; font-weight: 500; cursor: pointer; transition: all 0.2s;
  backdrop-filter: blur(5px);
}
.option-btn:hover:not(:disabled) { border-color: var(--primary); background: rgba(108,92,231,0.15); transform: translateY(-2px); }
.option-btn.correct { border-color: var(--success); background: rgba(0,184,148,0.2); animation: pop 0.3s; }
.option-btn.wrong { border-color: var(--danger); background: rgba(225,112,85,0.2); animation: shake 0.4s; }
.option-btn.hidden { opacity: 0; pointer-events: none; transform: scale(0.8); }
.option-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Overlays */
.overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(5px);
  align-items: center; justify-content: center;
}
.overlay.active { display: flex; }
.overlay-content {
  background: #1e1e3f; border-radius: var(--radius); padding: 40px;
  text-align: center; max-width: 400px; width: 90%; animation: pop 0.4s ease;
}
.overlay-icon { font-size: 4rem; margin-bottom: 15px; }
.overlay-content h2 { font-size: 1.8rem; margin-bottom: 10px; }
.overlay-content p { color: #b2bec3; margin-bottom: 10px; font-size: 1.1rem; }

/* Failed Overlay Specific */
.failed-content .location-name { 
  font-size: 1.3rem; 
  color: #fff; 
  font-weight: 600;
  margin-bottom: 8px;
}
.failed-content .correct-answer-text { 
  color: var(--success); 
  font-size: 1.1rem;
}
.failed-content .attempts-text { 
  color: #636e72; 
  font-size: 0.9rem;
  margin-bottom: 20px;
}

/* Game Over */
.gameover-content { text-align: center; max-width: 500px; animation: slideUp 0.5s ease; }
.gameover-content h1 { font-size: 2.5rem; margin-bottom: 30px; }
.final-score { margin-bottom: 30px; }
.final-score-label { font-size: 1rem; color: #b2bec3; margin-bottom: 5px; }
.final-score-value { font-size: 4rem; font-weight: 900; color: var(--warning); text-shadow: 0 4px 20px rgba(253,203,110,0.4); }
.stats { display: flex; gap: 20px; justify-content: center; margin-bottom: 30px; }
.stat { text-align: center; }
.stat-value { display: block; font-size: 2rem; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 0.85rem; color: #636e72; }

/* Modal */
.modal {
  display: none; position: fixed; inset: 0; z-index: 200;
  background: rgba(0,0,0,0.9); align-items: center; justify-content: center; cursor: zoom-out;
}
.modal.active { display: flex; }
.modal img { max-width: 95vw; max-height: 90vh; object-fit: contain; border-radius: 8px; }
.modal-close { position: absolute; top: 20px; left: 20px; font-size: 2rem; color: #fff; cursor: pointer; }

/* Responsive */
@media (max-width: 600px) {
  .start-content h1 { font-size: 2rem; }
  .image-container { height: 220px; }
  .options-container { grid-template-columns: 1fr 1fr; }
  .question { font-size: 1.2rem; }
  .game-header { padding: 10px 15px; }
  .stats { gap: 12px; }
  .final-score-value { font-size: 3rem; }
  .attempts-display { font-size: 1.2rem; }
}
