/* CaseRace - Two Truths and AI */

:root {
  --bg-dark: #0a0a0f;
  --bg-surface: #12121a;
  --bg-card: #1a1a24;
  --border: #2a2a3a;
  --border-hover: #3a3a4a;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --text-dim: #5a5a70;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.3);
  --correct: #10b981;
  --incorrect: #ef4444;
  --ai-highlight: #a855f7;
  --gradient-start: #6366f1;
  --gradient-end: #a855f7;
}

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

body {
  font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* Dark overlay for readability over background images */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 15, 0.55);
  pointer-events: none;
  z-index: -1;
}

/* Navigation */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(10, 10, 15, 0.8);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text);
}

.logo-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 8px;
  font-family: 'Space Mono', monospace;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.nav-tagline {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Container */
.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2.5rem;
}

h1 {
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--text) 0%, var(--text-muted) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-style: italic;
}

.explanation {
  color: var(--text-dim);
  font-size: 0.9rem;
  max-width: 500px;
  margin: 1rem auto 0;
  line-height: 1.6;
}

/* Game Section */
.game {
  margin-bottom: 3rem;
}

.topic {
  font-size: 1.4rem;
  font-weight: 500;
  text-align: center;
  margin-bottom: 2rem;
  color: var(--accent);
  letter-spacing: -0.01em;
}

/* Options */
.options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.option:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.option:hover::before {
  opacity: 1;
}

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

.option-label {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
  z-index: 1;
}

.option-text {
  font-size: 0.95rem;
  line-height: 1.7;
  position: relative;
  z-index: 1;
}

/* Option states after voting */
.option.selected {
  border-color: var(--accent);
  border-width: 2px;
}

.option.correct {
  border-color: var(--correct);
  background: rgba(16, 185, 129, 0.1);
}

.option.incorrect {
  border-color: var(--incorrect);
  background: rgba(239, 68, 68, 0.1);
}

.option.ai-revealed {
  border-color: var(--ai-highlight);
  background: rgba(168, 85, 247, 0.1);
}

.option.ai-revealed .option-label::after {
  content: ' - AI Generated';
  color: var(--ai-highlight);
  font-weight: 500;
}

.option.disabled {
  pointer-events: none;
  cursor: default;
}

.option.disabled:hover {
  transform: none;
}

.option.disabled::before {
  opacity: 0;
}

/* Result */
.result {
  text-align: center;
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.result.hidden {
  display: none;
}

#result-text {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.result-actions {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-secondary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Space Grotesk', sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  border-color: var(--text-muted);
  color: var(--text);
  background: var(--bg-surface);
}

.prompt-display {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg-dark);
  border-radius: 8px;
  text-align: left;
  border: 1px solid var(--border);
}

.prompt-display.hidden {
  display: none;
}

.prompt-display code {
  font-family: 'Space Mono', monospace;
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: pre-wrap;
  word-break: break-word;
}

/* Countdown */
.countdown {
  text-align: center;
  margin-top: 2rem;
  color: var(--text-dim);
  font-size: 0.9rem;
}

#countdown-time {
  font-family: 'Space Mono', monospace;
  color: var(--accent);
  font-weight: 500;
}

/* Stats Footer */
.stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}

.stat {
  text-align: center;
}

.stat span:first-child {
  display: block;
  font-size: 1.75rem;
  font-family: 'Space Mono', monospace;
  font-weight: 500;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.25rem;
}

/* Loading State */
.loading {
  opacity: 0.5;
}

/* Responsive */
@media (max-width: 600px) {
  .site-nav {
    padding: 0.75rem 1rem;
  }

  .nav-tagline {
    display: none;
  }

  .container {
    padding: 2rem 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  .topic {
    font-size: 1.2rem;
  }

  .stats {
    flex-direction: column;
    gap: 1.5rem;
  }

  .result-actions {
    flex-direction: column;
  }

  .btn-secondary {
    width: 100%;
  }
}

/* Image Credit Footer */
.image-credit {
  margin-top: 3rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.image-credit img {
  height: 40px;
  opacity: 0.9;
}

.image-credit-text {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-align: center;
  line-height: 1.4;
}

.image-credit a {
  color: var(--accent);
  text-decoration: none;
}

.image-credit a:hover {
  text-decoration: underline;
}

@media (max-width: 600px) {
  .image-credit {
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem;
  }

  .image-credit img {
    height: 32px;
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}
