:root {
  color-scheme: light;
  --bg: #0a0f1e;
  --bg-alt: #0f1730;
  --card: rgba(16, 24, 48, 0.88);
  --card-bright: rgba(20, 32, 64, 0.95);
  --accent: #ff9d4d;
  --accent-2: #2ee6c5;
  --accent-3: #ffd166;
  --text: #f6f7fb;
  --muted: rgba(246, 247, 251, 0.68);
  --stroke: rgba(255, 255, 255, 0.1);
  --shadow: 0 30px 60px rgba(6, 10, 20, 0.6);
  --font-display: "Bricolage Grotesque", sans-serif;
  --font-body: "Sora", sans-serif;
}

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

body {
  font-family: var(--font-body);
  color: var(--text);
  background: radial-gradient(circle at 15% 20%, rgba(46, 230, 197, 0.2), transparent 40%),
    radial-gradient(circle at 80% 15%, rgba(255, 157, 77, 0.22), transparent 42%),
    linear-gradient(160deg, #0a0f1e 0%, #0d1326 50%, #0a0f1e 100%);
  min-height: 100vh;
}

.app {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  position: relative;
}

.app::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='2' cy='2' r='2' fill='rgba(255,255,255,0.08)'/%3E%3Ccircle cx='60' cy='60' r='2' fill='rgba(255,255,255,0.06)'/%3E%3C/svg%3E");
  opacity: 0.35;
  pointer-events: none;
  mix-blend-mode: screen;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  align-items: stretch;
  margin-bottom: 36px;
}

.hero__content {
  background: var(--card);
  border: 1px solid var(--stroke);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.hero__content::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  right: -120px;
  top: -120px;
  background: radial-gradient(circle, rgba(255, 209, 102, 0.5), transparent 70%);
  opacity: 0.7;
}

.hero__tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent-2);
  margin-bottom: 12px;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  margin-bottom: 12px;
}

.hero__subtitle {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 24px;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.hero__status {
  font-size: 14px;
  color: var(--accent-3);
}

.hero__panel {
  display: grid;
  gap: 16px;
}

.hero__card {
  background: var(--card-bright);
  border-radius: 20px;
  padding: 20px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
}

.hero__card h3 {
  font-family: var(--font-display);
  margin-bottom: 10px;
}

.hero__card ul {
  list-style: none;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.hero__card li::before {
  content: "✦";
  color: var(--accent-2);
  margin-right: 8px;
}

.hero__card--glow {
  border: 1px solid rgba(46, 230, 197, 0.4);
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.panel {
  background: var(--card);
  border-radius: 24px;
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow);
  padding: 24px;
  min-height: 520px;
}

.panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 16px;
}

.panel__header h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
}

.panel__tag {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.4px;
  color: var(--accent-2);
}

/* Test Selector Buttons */
.test-selector {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.test-btn {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--muted);
  background: rgba(8, 12, 28, 0.6);
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-btn:hover {
  border-color: rgba(46, 230, 197, 0.5);
  color: var(--text);
  background: rgba(46, 230, 197, 0.08);
  transform: translateY(-2px);
}

.test-btn.active {
  border-color: var(--accent-2);
  color: #07121e;
  background: linear-gradient(120deg, var(--accent-2), #3de0ff);
  box-shadow: 0 8px 16px rgba(46, 230, 197, 0.3);
}

.panel__footer {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.study-grid {
  display: grid;
  gap: 14px;
}

.study-card {
  padding: 16px 18px;
  border-radius: 16px;
  border: 1px solid var(--stroke);
  background: rgba(8, 12, 28, 0.7);
  transition: transform 0.3s ease, border 0.3s ease;
}

.study-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 157, 77, 0.5);
}

.study-card h3 {
  font-family: var(--font-display);
  margin-bottom: 8px;
  font-size: 1.1rem;
}

.study-card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 6px;
}

/* Word stats display */
.word-stats {
  font-size: 0.85rem;
  color: var(--accent-3);
  font-weight: 400;
  margin-left: 8px;
}

/* Collapsed study panel (test mode) */
.study-panel--collapsed .study-card p {
  display: none;
}

.study-panel--collapsed .study-card {
  padding: 12px 18px;
}

.study-panel--collapsed .study-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0;
}

.tests {
  display: grid;
  gap: 16px;
}

.test-card {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid var(--stroke);
  background: rgba(10, 16, 34, 0.85);
}

.test-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 12px;
}

.question {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 0;
}

.question:last-child {
  border-bottom: none;
}

.question__meta {
  font-size: 12px;
  color: var(--accent-3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.question__text {
  font-size: 14px;
  margin-bottom: 8px;
  line-height: 1.4;
}

.options {
  display: grid;
  gap: 6px;
}

.option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: border 0.2s ease, transform 0.2s ease;
}

.option:hover {
  border-color: rgba(46, 230, 197, 0.6);
  transform: translateX(4px);
}

.option input {
  accent-color: var(--accent-2);
}

.option.correct {
  border-color: rgba(46, 230, 197, 0.8);
  background: rgba(46, 230, 197, 0.1);
}

.option.incorrect {
  border-color: rgba(255, 77, 79, 0.8);
  background: rgba(255, 77, 79, 0.08);
}

.feedback {
  margin-top: 6px;
  font-size: 12px;
  color: var(--accent-2);
}

.feedback.bad {
  color: #ff4d4f;
}

.btn {
  border: none;
  border-radius: 999px;
  padding: 10px 18px;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.btn--primary {
  background: linear-gradient(120deg, var(--accent-2), #3de0ff);
  color: #07121e;
  box-shadow: 0 12px 25px rgba(46, 230, 197, 0.4);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn--accent {
  background: linear-gradient(120deg, var(--accent), #ff6b6b);
  color: #130b0a;
  box-shadow: 0 12px 25px rgba(255, 157, 77, 0.35);
}

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

.btn--small {
  padding: 6px 12px;
  font-size: 12px;
  margin-left: auto;
}

/* Dropdown select styling */
select.btn--ghost {
  background: var(--bg-alt);
  color: var(--text);
}

select.btn--ghost option {
  background: var(--bg-alt);
  color: var(--text);
}

.score {
  font-size: 14px;
  color: var(--accent-3);
}

/* Test View (Single Question Interface) */
.test-view {
  display: none;
  animation: fadeIn 0.3s ease;
}

.test-view.active {
  display: block;
}

.question-display {
  background: rgba(8, 12, 28, 0.7);
  border: 1px solid var(--stroke);
  border-radius: 18px;
  padding: 28px;
  margin-bottom: 20px;
  min-height: 300px;
}

.question-display .question {
  border-bottom: none;
  padding: 0;
}

.test-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(10, 16, 34, 0.5);
  border-radius: 14px;
  border: 1px solid var(--stroke);
}

.test-nav button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}

.test-nav button:hover:not(:disabled) {
  border-color: var(--accent-2);
  background: rgba(46, 230, 197, 0.1);
  transform: translateX(var(--hover-offset, 0));
}

.test-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

#prevBtn:hover:not(:disabled) {
  --hover-offset: -4px;
}

#nextBtn:hover:not(:disabled) {
  --hover-offset: 4px;
}

.question-counter {
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-3);
  letter-spacing: 0.5px;
}

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

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

@media (max-width: 600px) {
  .hero__actions {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
