/* Daily Geography Quiz - Distinctive cartographic aesthetic */

:root {
  --bg-dark: #0f1419;
  --bg-card: #1a2332;
  --bg-elevated: #243447;
  --accent: #00d4aa;
  --accent-dim: #00a88a;
  --accent-glow: rgba(0, 212, 170, 0.3);
  --text: #e8edf4;
  --text-muted: #8b9cb8;
  --correct: #22c55e;
  --wrong: #ef4444;
  --border: rgba(139, 156, 184, 0.15);
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--bg-dark);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  background-image:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 212, 170, 0.08), transparent),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(0, 168, 138, 0.05), transparent);
}

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

/* Header */
.header {
  text-align: center;
  padding: 2rem 0 1.5rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.date-display {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  opacity: 0.9;
}

/* Main content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen {
  animation: fadeIn 0.3s ease;
}

.screen.hidden {
  display: none !important;
}

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

/* Gate screen */
.gate-content {
  text-align: center;
}

.gate-content .lock-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.gate-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.gate-content > p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.gate-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.gate-message {
  font-size: 0.9rem;
  margin-top: 1rem;
  min-height: 1.5em;
}

.gate-message.success {
  color: var(--accent);
}

.gate-message.error {
  color: var(--wrong);
}

body.on-gate .footer {
  display: none;
}

/* Start screen */
.start-content {
  text-align: center;
}

.globe-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}

.start-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.start-content p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.input-group input {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-group input.error {
  border-color: var(--wrong);
}

.input-group input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

/* Buttons */
.btn {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.875rem 1.5rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: var(--bg-dark);
  box-shadow: 0 4px 20px var(--accent-glow);
}

.btn-primary:hover {
  box-shadow: 0 6px 28px var(--accent-glow);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--accent);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--accent);
}

/* Quiz screen */
.quiz-progress {
  margin-bottom: 1.5rem;
}

.quiz-progress span {
  font-size: 0.8rem;
  color: var(--text-muted);
  display: block;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-dim));
  border-radius: 2px;
  transition: width 0.4s ease;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
}

.question-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.answers {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.answer-btn {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.875rem 1rem;
  text-align: left;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.answer-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: rgba(0, 212, 170, 0.08);
}

.answer-btn:disabled {
  cursor: default;
  opacity: 0.9;
}

.answer-btn.correct {
  border-color: var(--correct);
  background: rgba(34, 197, 94, 0.15);
  color: var(--correct);
}

.answer-btn.wrong {
  border-color: var(--wrong);
  background: rgba(239, 68, 68, 0.15);
  color: var(--wrong);
}

/* Results screen */
.results-content {
  text-align: center;
  padding: 2rem 0;
}

.results-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.score-display {
  font-size: 3rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1rem 0;
}

.score-display span {
  font-family: var(--font-display);
}

.score-message {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Leaderboard */
.leaderboard-content {
  padding: 1rem 0;
}

.leaderboard-content h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 400;
  text-align: center;
  margin-bottom: 0.25rem;
}

.leaderboard-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 1.5rem;
}

.leaderboard-list {
  list-style: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.leaderboard-list li {
  display: flex;
  align-items: center;
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}

.leaderboard-list li:last-child {
  border-bottom: none;
}

.leaderboard-list li.highlight {
  background: rgba(0, 212, 170, 0.1);
  border-left: 3px solid var(--accent);
}

.leaderboard-list li.empty {
  justify-content: center;
  color: var(--text-muted);
  font-style: italic;
}

.leaderboard-list .rank {
  font-weight: 700;
  color: var(--accent);
  min-width: 2rem;
}

.leaderboard-list .name {
  flex: 1;
}

.leaderboard-list .score {
  font-weight: 600;
  color: var(--text-muted);
}

.leaderboard-actions {
  display: flex;
  justify-content: center;
}

/* Footer */
.footer {
  padding: 1rem 0;
  text-align: center;
}

.nav-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.875rem;
  cursor: pointer;
  transition: color 0.2s;
}

.nav-link:hover {
  color: var(--accent);
}
