:root {
  --bg: #0f0f1e;
  --bg-card: #1a1a2e;
  --bg-card-hover: #232342;
  --primary: #00d9ff;
  --primary-dark: #0099cc;
  --secondary: #ff6b35;
  --success: #00ff88;
  --error: #ff3860;
  --warn: #ffdc2e;
  --text: #ffffff;
  --text-dim: #a0a0c0;
  --border: #2a2a45;
  --gradient-1: linear-gradient(135deg, #00d9ff 0%, #0066ff 100%);
  --gradient-2: linear-gradient(135deg, #ff6b35 0%, #ff3860 100%);
  --gradient-success: linear-gradient(135deg, #00ff88 0%, #00d9ff 100%);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: 'SF Pro Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(circle at 20% 10%, rgba(0, 217, 255, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 107, 53, 0.12) 0%, transparent 50%),
    var(--bg);
}

.container { max-width: 1100px; margin: 0 auto; padding: 32px 24px; }

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 48px;
  padding: 16px 24px;
  background: rgba(26, 26, 46, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.logo { display: flex; align-items: center; gap: 12px; font-size: 24px; font-weight: 800; letter-spacing: -0.5px; text-decoration: none; color: inherit; }

.logo-dot {
  width: 12px;
  height: 12px;
  background: var(--gradient-1);
  border-radius: 50%;
  box-shadow: 0 0 20px var(--primary);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

.streak {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-2);
  padding: 8px 16px;
  border-radius: 100px;
  font-weight: 700;
  font-size: 14px;
}

.hero { text-align: center; margin-bottom: 64px; }

.hero h1 {
  font-size: clamp(32px, 6vw, 56px);
  font-weight: 900;
  letter-spacing: -1.5px;
  line-height: 1.05;
  margin-bottom: 16px;
  background: var(--gradient-1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p { color: var(--text-dim); font-size: 18px; max-width: 600px; margin: 0 auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--primary);
  box-shadow: 0 20px 40px rgba(0, 217, 255, 0.2);
}

.card-icon {
  width: 56px;
  height: 56px;
  background: var(--gradient-1);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-bottom: 16px;
}

.card-icon.history { background: var(--gradient-2); }
.card-icon.english { background: linear-gradient(135deg, #00ff88 0%, #00d9ff 100%); }
.card-icon.literature { background: linear-gradient(135deg, #ffdc2e 0%, #ff6b35 100%); }

.card h3 { font-size: 22px; font-weight: 800; margin-bottom: 8px; letter-spacing: -0.3px; }

.card .subject {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
  font-weight: 600;
}

.card p { color: var(--text-dim); font-size: 15px; margin-bottom: 16px; }

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
}

.badge {
  background: rgba(0, 217, 255, 0.15);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
}

.badge.urgent {
  background: rgba(255, 56, 96, 0.15);
  color: var(--error);
}

.quiz { max-width: 720px; margin: 0 auto; }
.quiz-header { margin-bottom: 32px; }
.quiz-title { font-size: 32px; font-weight: 900; margin-bottom: 8px; letter-spacing: -0.5px; }
.quiz-subtitle { color: var(--text-dim); font-size: 16px; }

.progress {
  height: 8px;
  background: var(--bg-card);
  border-radius: 100px;
  overflow: hidden;
  margin: 24px 0;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-1);
  border-radius: 100px;
  transition: width 0.4s ease;
  box-shadow: 0 0 16px var(--primary);
  width: 0;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  margin-bottom: 8px;
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
}

.question-text { font-size: 22px; font-weight: 800; margin-bottom: 24px; line-height: 1.3; }
.options { display: grid; gap: 12px; }

.option {
  background: rgba(255, 255, 255, 0.03);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  transition: all 0.18s;
  width: 100%;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
}

.option:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(0, 217, 255, 0.08);
}

.option-letter {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.option.correct {
  border-color: var(--success);
  background: rgba(0, 255, 136, 0.12);
}

.option.correct .option-letter { background: var(--success); color: var(--bg); }

.option.wrong {
  border-color: var(--error);
  background: rgba(255, 56, 96, 0.12);
}

.option.wrong .option-letter { background: var(--error); color: white; }
.option:disabled { cursor: not-allowed; }

.feedback {
  margin-top: 20px;
  padding: 16px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  display: none;
}

.feedback.show { display: block; }

.feedback.correct {
  background: rgba(0, 255, 136, 0.12);
  color: var(--success);
  border: 1px solid var(--success);
}

.feedback.wrong {
  background: rgba(255, 56, 96, 0.12);
  color: var(--error);
  border: 1px solid var(--error);
}

.btn {
  background: var(--gradient-1);
  color: var(--bg);
  border: none;
  padding: 16px 32px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
  letter-spacing: 0.3px;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(0, 217, 255, 0.3); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 2px solid var(--border);
}

.btn-secondary:hover { border-color: var(--primary); box-shadow: none; }

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 24px;
}

.result { text-align: center; padding: 48px 24px; }

.result-emoji {
  font-size: 96px;
  margin-bottom: 16px;
  animation: bounce 0.8s ease;
}

@keyframes bounce {
  0% { transform: scale(0); }
  60% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

.result-score {
  font-size: 72px;
  font-weight: 900;
  background: var(--gradient-success);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -2px;
  line-height: 1;
}

.result-detail { color: var(--text-dim); font-size: 18px; margin: 16px 0 32px; }
.result-message { font-size: 22px; font-weight: 800; margin-bottom: 32px; }

.errors-list {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: left;
  max-width: 500px;
  margin: 0 auto 32px;
}

.errors-list h4 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

.error-item {
  padding: 12px;
  background: rgba(255, 56, 96, 0.08);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.error-item strong { color: var(--error); }

.back-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 24px;
  transition: color 0.2s;
}

.back-link:hover { color: var(--primary); }

@media (max-width: 640px) {
  .container { padding: 16px; }
  .question-card { padding: 20px; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
}
