:root {
  --bg-color: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.7);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #10b981;
  --secondary-hover: #059669;
  --accent: #8b5cf6;
  --danger: #ef4444;
  --border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-color);
  background-image: 
    radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.15) 0px, transparent 50%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app-container {
  width: 100%;
  max-width: 600px;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

header h1 {
  font-size: 2.5rem;
  background: linear-gradient(to right, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

h2 { margin-bottom: 1.5rem; text-align: center; font-weight: 600; }
h3 { margin-bottom: 1rem; color: var(--text-muted); font-size: 1rem; }

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

.divider {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  position: relative;
}

.divider::before, .divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40%;
  height: 1px;
  background: var(--border);
}

.divider::before { left: 0; }
.divider::after { right: 0; }

form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s;
}

input:focus { border-color: var(--primary); }

.btn {
  width: 100%;
  padding: 0.875rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, background 0.2s;
  color: white;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.btn.primary { background: var(--primary); }
.btn.primary:hover:not(:disabled) { background: var(--primary-hover); }

.btn.secondary { background: var(--secondary); }
.btn.secondary:hover:not(:disabled) { background: var(--secondary-hover); }

.hidden { display: none !important; }

.highlight {
  color: var(--accent);
  letter-spacing: 2px;
}

ul { list-style: none; }

#players-list li {
  padding: 0.75rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
}

.option-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 2px solid transparent;
  color: var(--text-main);
  padding: 1rem;
}
.option-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
  border-color: var(--primary);
}
.option-btn.selected {
  background: var(--primary);
  border-color: var(--primary);
}
.option-btn.correct { background: var(--secondary) !important; border-color: var(--secondary) !important; color: white !important;}
.option-btn.incorrect { background: var(--danger) !important; border-color: var(--danger) !important; color: white !important; }

.timer-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}

#timer-fill {
  height: 100%;
  background: var(--accent);
  width: 100%;
  transition: width 1s linear;
}

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

#leaderboard-list li {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  font-weight: 600;
}

#leaderboard-list li:nth-child(1) { background: linear-gradient(to right, rgba(250, 204, 21, 0.2), transparent); border-left: 4px solid #facc15; }
#leaderboard-list li:nth-child(2) { background: linear-gradient(to right, rgba(156, 163, 175, 0.2), transparent); border-left: 4px solid #9ca3af; }
#leaderboard-list li:nth-child(3) { background: linear-gradient(to right, rgba(180, 83, 9, 0.2), transparent); border-left: 4px solid #b45309; }

@media (max-width: 480px) {
  .options-grid { grid-template-columns: 1fr; }
}
