@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Share+Tech+Mono&display=swap');

:root {
  --bg-dark: #7fb4b0;
  --bg-panel: #b8ccc8;
  --border-color: #2d4d4a;
  --text-primary: #1a2d2b;
  --text-secondary: #2d4d4a;
  --text-dim: #5a7573;
  --text-white: #1a2d2b;
  --error-red: #c45353;
  --warning-yellow: #d4a53d;
  --button-hover: #2d4d4a;
  --glow: 0 0 5px rgba(45, 77, 74, 0.3);
  --glow-strong: 0 0 8px rgba(45, 77, 74, 0.5);
  --beige: #d4c5a9;
}
}

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

body {
  font-family: 'Orbitron', monospace;
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}


/* Container */
.container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  max-width: 800px;
  margin: 0 auto;
  width: 100%;
}

/* Logo/Title */
.logo {
  font-size: 4rem;
  font-weight: 900;
  color: var(--text-primary);
  text-shadow: var(--glow-strong);
  margin-bottom: 3rem;
  letter-spacing: 0.2em;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}

/* Panels */
.panel {
  background: var(--bg-panel);
  border: 2px solid var(--border-color);
  box-shadow: var(--glow);
  padding: 2rem;
  margin: 1rem 0;
  width: 100%;
  position: relative;
}



/* Buttons */
.btn {
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  border: 2px solid var(--text-primary);
  padding: 1rem 2rem;
  margin: 0.5rem;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--text-primary);
  transition: left 0.3s;
  z-index: -1;
}

.btn:hover {
  color: var(--bg-dark);
  box-shadow: var(--glow);
}

.btn:hover::before {
  left: 0;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--text-primary);
  color: var(--bg-dark);
}

.btn-primary::before {
  background: var(--button-hover);
}

.btn-small {
  font-size: 0.9rem;
  padding: 0.5rem 1rem;
}

/* Input */
input[type="text"],
input[type="number"] {
  font-family: 'Share Tech Mono', monospace;
  font-size: 2rem;
  color: var(--text-primary);
  background: var(--bg-dark);
  border: 2px solid var(--text-dim);
  padding: 1rem;
  width: 100%;
  text-align: center;
  transition: all 0.3s;
}

input[type="text"]:focus,
input[type="number"]:focus {
  outline: none;
  border-color: var(--text-primary);
  box-shadow: var(--glow);
}

input::placeholder {
  color: var(--text-dim);
}

/* Game screen specific */
.game-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.score-display,
.timer-display {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1.5rem;
  color: var(--text-primary);
  text-shadow: var(--glow);
}

.timer-display {
  font-size: 2.5rem;
  font-weight: 700;
}

.timer-warning {
  color: var(--warning-yellow);
  animation: blink 0.5s linear infinite;
}

.timer-danger {
  color: var(--error-red);
  animation: blink 0.3s linear infinite;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0.3; }
}

/* Event display */
.event-container {
  text-align: center;
  margin: 2rem 0;
}

.event-text {
  font-size: 1.5rem;
  color: var(--text-white);
  margin-bottom: 2rem;
  line-height: 1.6;
  min-height: 4rem;
}

.event-number {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

/* Answer feedback */
.answer-feedback {
  text-align: center;
  margin: 1rem 0;
  min-height: 3rem;
}

.feedback-correct {
  color: var(--text-primary);
  font-size: 1.2rem;
  animation: fadeIn 0.5s;
}

.feedback-wrong {
  color: var(--error-red);
  font-size: 1.2rem;
  animation: fadeIn 0.5s;
}

.points-earned {
  font-family: 'Share Tech Mono', monospace;
  font-size: 1rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

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

/* Century list */
.century-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--text-dim);
}

.century-item {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.9rem;
  padding: 0.5rem;
  border: 1px solid var(--text-dim);
  color: var(--text-dim);
  transition: all 0.3s;
}

.century-item.revealed {
  color: var(--text-primary);
  border-color: var(--text-primary);
  box-shadow: 0 0 5px var(--text-primary);
}

/* Results screen */
.results-panel {
  text-align: center;
}

.final-score {
  font-size: 4rem;
  color: var(--text-primary);
  text-shadow: var(--glow-strong);
  margin: 1rem 0;
}

.score-breakdown {
  text-align: left;
  margin: 2rem 0;
  font-family: 'Share Tech Mono', monospace;
}

.score-breakdown-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem;
  border-bottom: 1px solid var(--text-dim);
  font-size: 1.1rem;
}

.score-comment {
  font-size: 1.5rem;
  color: var(--text-secondary);
  margin: 2rem 0;
  font-style: italic;
}

/* Leaderboard */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Share Tech Mono', monospace;
  margin: 1rem 0;
}

.leaderboard-table th {
  background: var(--bg-dark);
  color: var(--text-primary);
  padding: 1rem;
  border: 1px solid var(--text-dim);
  text-align: left;
}

.leaderboard-table td {
  padding: 0.8rem 1rem;
  border: 1px solid var(--text-dim);
  color: var(--text-white);
}

.leaderboard-table tr:hover {
  background: var(--bg-dark);
}

.leaderboard-rank {
  color: var(--text-primary);
  font-weight: 700;
}

.user-rank {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin: 1rem 0;
}

/* Footer */
.footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-dim);
  font-size: 0.8rem;
  border-top: 1px solid var(--text-dim);
  margin-top: auto;
}

.footer a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s;
}

.footer a:hover {
  text-shadow: var(--glow);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--bg-panel);
  border: 2px solid var(--border-color);
  box-shadow: var(--glow-strong);
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 2rem;
  color: var(--text-primary);
  cursor: pointer;
  border: none;
  background: none;
  transition: all 0.3s;
}

.modal-close:hover {
  color: var(--error-red);
  text-shadow: var(--glow);
}

.modal h2 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-shadow: var(--glow);
}

.modal p {
  margin-bottom: 1rem;
  line-height: 1.6;
}

/* Countdown */
.countdown {
  font-family: 'Share Tech Mono', monospace;
  font-size: 3rem;
  color: var(--text-primary);
  text-shadow: var(--glow-strong);
  text-align: center;
  margin: 2rem 0;
}

/* Progress indicator */
.progress-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
}

.progress-dot {
  width: 12px;
  height: 12px;
  border: 1px solid var(--text-dim);
  background: transparent;
  transition: all 0.3s;
}

.progress-dot.completed {
  background: var(--text-primary);
  box-shadow: 0 0 5px var(--text-primary);
}

.progress-dot.current {
  border-color: var(--text-primary);
  animation: pulse-dot 1s ease-in-out infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
  .logo {
    font-size: 2.5rem;
    margin-bottom: 2rem;
  }

  .panel {
    padding: 1.5rem;
  }

  .btn {
    font-size: 1rem;
    padding: 0.8rem 1.5rem;
  }

  .event-text {
    font-size: 1.2rem;
  }

  input[type="text"],
  input[type="number"] {
    font-size: 1.5rem;
  }

  .final-score {
    font-size: 3rem;
  }

  .game-header {
    flex-direction: column;
    align-items: center;
  }

  .timer-display {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .logo {
    font-size: 2rem;
  }

  .event-text {
    font-size: 1rem;
  }

  .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
  }
}

/* Timeline */
.timeline-container {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-dark);
  border: 1px solid var(--text-dim);
  overflow-x: auto;
  min-height: 150px;
}

#timeline {
  display: block;
  margin: 0 auto;
}

.timeline-marker {
  cursor: pointer;
  transition: all 0.3s;
}

.timeline-marker:hover {
  opacity: 0.8;
}

.timeline-marker-correct {
  fill: var(--text-primary);
  filter: drop-shadow(0 0 3px var(--text-primary));
}

.timeline-marker-guess {
  fill: var(--error-red);
  filter: drop-shadow(0 0 3px var(--error-red));
}

.timeline-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 10px;
  fill: var(--text-white);
  text-anchor: middle;
}

.timeline-year-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 9px;
  fill: var(--text-dim);
  text-anchor: middle;
}

.timeline-axis {
  stroke: var(--text-dim);
  stroke-width: 1;
}

.timeline-tick {
  stroke: var(--text-dim);
  stroke-width: 1;
}

.timeline-connection-line {
  stroke: var(--error-red);
  stroke-width: 1;
  stroke-dasharray: 2,2;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }

.hidden {
  display: none !important;
}

/* Perfect guess animation */
@keyframes perfect-glow {
  0%, 100% { 
    box-shadow: 0 0 20px var(--warning-yellow), 0 0 40px var(--warning-yellow);
    transform: scale(1);
  }
  50% { 
    box-shadow: 0 0 30px var(--warning-yellow), 0 0 60px var(--warning-yellow);
    transform: scale(1.05);
  }
}

.btn-perfect {
  animation: perfect-glow 1s ease-in-out 3;
  border-color: var(--warning-yellow) !important;
  color: var(--warning-yellow) !important;
  font-weight: 900;
}

/* Perfect timeline marker glow */
.timeline-marker-perfect {
  animation: marker-glow 1.5s ease-in-out infinite;
}

@keyframes marker-glow {
  0%, 100% { 
    filter: drop-shadow(0 0 8px var(--warning-yellow)) drop-shadow(0 0 16px var(--warning-yellow));
  }
  50% { 
    filter: drop-shadow(0 0 12px var(--warning-yellow)) drop-shadow(0 0 24px var(--warning-yellow));
  }
}
