/* ── Reset & Variables ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --gold:          #F5C200;
  --gold-dark:     #C9A000;
  --gold-light:    #FFF8D6;
  --black:         #0F0F0F;
  --dark:          #1A1A1A;
  --mid:           #2E2E2E;
  --surface:       #FAFAF8;
  --white:         #FFFFFF;
  --border:        #E6E6E2;
  --text:          #111111;
  --muted:         #6B6B6B;
  --correct-bg:    #EDFAF0;
  --correct-border:#2E9E50;
  --correct-text:  #1B6B34;
  --wrong-bg:      #FDF0F0;
  --wrong-border:  #D03030;
  --wrong-text:    #9B1C1C;
  --ipa-color:     #6D5BD0;
  --example-color: #2E6FA3;
  --radius:        10px;
  --radius-lg:     16px;
  --radius-xl:     20px;
  --shadow-sm:     0 1px 4px rgba(0,0,0,0.06);
  --shadow-md:     0 4px 16px rgba(0,0,0,0.09);
  --shadow-lg:     0 10px 36px rgba(0,0,0,0.13);
  --t:             0.18s ease;
}

html { -webkit-font-smoothing: antialiased; scroll-behavior: smooth; }

body {
  font-family: 'Barlow', sans-serif;
  background: var(--surface);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* ════════════════════════════════════════
   SHARED – HEADER
════════════════════════════════════════ */
header {
  width: 100%;
  background: var(--white);
  padding: 15px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  border-bottom: 2px solid var(--gold);
}

.logo {
  display: flex;
  align-items: center;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  line-height: 1;
  text-decoration: none;
}

.logo-ielts    { color: var(--gold); }
.logo-champion { color: var(--black); display: inline-flex; align-items: center; }

.logo-star {
  width: 26px;
  height: 26px;
  margin: 0 1px;
  flex-shrink: 0;
}

.header-back {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t), border-color var(--t);
  padding: 6px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.header-back:hover { color: var(--gold-dark); border-color: var(--gold); }
.header-back svg   { width: 14px; height: 14px; flex-shrink: 0; }

/* ════════════════════════════════════════
   SHARED – HERO STRIP
════════════════════════════════════════ */
.hero {
  width: 100%;
  background: var(--gold);
  padding: 20px 32px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 20px,
    rgba(0,0,0,0.03) 20px,
    rgba(0,0,0,0.03) 21px
  );
  pointer-events: none;
}
.hero h1 {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: 0.6px;
  text-transform: uppercase;
  position: relative;
}
.hero p {
  font-size: 13px;
  color: var(--dark);
  margin-top: 3px;
  font-weight: 500;
  position: relative;
}

/* ════════════════════════════════════════
   SHARED – MAIN WRAPPER
════════════════════════════════════════ */
main {
  width: 100%;
  max-width: 680px;
  padding: 36px 20px 72px;
  flex: 1;
}

/* ════════════════════════════════════════
   INDEX PAGE
════════════════════════════════════════ */
.index-main { max-width: 600px; }

/* Class section */
.class-section { margin-bottom: 36px; }

.class-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1.5px solid var(--border);
}

.class-badge {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: var(--gold);
  color: var(--black);
  border-radius: 8px;
  padding: 4px 14px;
}

.class-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Class-selection cards (homepage) */
.class-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.class-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 22px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.class-card:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.class-card:active { transform: translateY(0); }

.class-card-icon {
  width: 56px;
  height: 56px;
  background: var(--gold);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.class-card-icon svg {
  width: 26px;
  height: 26px;
  color: var(--black);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.class-card-body { flex: 1; min-width: 0; }

.class-card-badge {
  display: inline-block;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  background: var(--gold-light);
  color: var(--gold-dark);
  border: 1px solid rgba(245,194,0,0.5);
  border-radius: 6px;
  padding: 2px 9px;
  margin-bottom: 6px;
}

.class-card-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.1px;
  line-height: 1.2;
}

.class-card-sub {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 3px;
  line-height: 1.4;
}

.class-card-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-dark);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 8px;
}

.class-card-arrow {
  color: var(--border);
  flex-shrink: 0;
  transition: color var(--t);
}
.class-card-arrow svg { width: 18px; height: 18px; }
.class-card:hover .class-card-arrow { color: var(--gold-dark); }

/* Empty state (topics page) */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  background: var(--white);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-xl);
}
.empty-state-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 6px;
}
.empty-state-sub {
  font-size: 14px;
  color: var(--muted);
}

/* Topic rows */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.topic-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 15px 16px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}
.topic-row:hover {
  border-color: var(--gold);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.topic-row:active { transform: translateY(0); }

.topic-row-day {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gold-dark);
  background: var(--gold-light);
  border: 1px solid rgba(245,194,0,0.45);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-row-icon {
  width: 42px;
  height: 42px;
  background: var(--gold);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.topic-row-icon svg {
  width: 20px;
  height: 20px;
  color: var(--black);
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topic-row-info { flex: 1; min-width: 0; }

.topic-row-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 19px;
  font-weight: 800;
  color: var(--black);
  letter-spacing: -0.1px;
  line-height: 1.2;
}

.topic-row-sub {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topic-row-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-row-arrow {
  color: var(--border);
  flex-shrink: 0;
  transition: color var(--t);
}
.topic-row-arrow svg { width: 16px; height: 16px; }
.topic-row:hover .topic-row-arrow { color: var(--gold-dark); }

/* ════════════════════════════════════════
   QUIZ PAGE – PROGRESS
════════════════════════════════════════ */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.progress-track {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(.4,0,.2,1);
}
.progress-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  min-width: 52px;
  text-align: right;
}

/* ── Card ── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 32px 28px 24px;
  box-shadow: var(--shadow-md);
  animation: fadeUp 0.28s ease both;
}

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

/* ── Total quiz timer ── */
.total-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--black);
  background: var(--gold);
  border-radius: 99px;
  padding: 8px 24px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-sm);
  transition: background 0.4s, color 0.4s;
}
.total-timer-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.total-timer.warn   { background: #FEF3C7; color: #92400E; }
.total-timer.danger { background: #FEE2E2; color: #991B1B; animation: pulse-timer 0.7s ease-in-out infinite; }
@keyframes pulse-timer {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

/* ── Card header (tag + timer row) ── */
.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.card-header .tag { margin-bottom: 4px; }

/* ── Countdown timer ── */
.timer {
  position: relative;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
}
.timer svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.timer-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 4;
}
.timer-ring {
  fill: none;
  stroke: var(--correct-border);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 125.66 125.66;
  transition: stroke-dasharray 0.95s linear, stroke 0.3s;
}
.timer-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  color: var(--correct-text);
  transition: color 0.3s;
}
.timer-warn   .timer-ring { stroke: #F59E0B; }
.timer-warn   .timer-num  { color: #92400E; }
.timer-danger .timer-ring { stroke: #EF4444; }
.timer-danger .timer-num  { color: #991B1B; }

/* ── Tag ── */
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  background: var(--gold-light);
  color: var(--gold-dark);
  border: 1px solid rgba(245,194,0,0.5);
  border-radius: 99px;
  padding: 3px 10px;
  margin-bottom: 14px;
}

/* ── Question ── */
.q-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.q-text {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--black);
  margin-bottom: 26px;
}

/* ── Options ── */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}
.opt-btn {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  text-align: left;
  cursor: pointer;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
  transition: border-color var(--t), background var(--t), transform 0.1s;
}
.opt-btn:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--gold-light);
  transform: translateY(-1px);
}
.opt-btn:active:not(:disabled) { transform: translateY(0); }
.opt-btn.selected:not(.correct):not(.wrong) {
  border-color: var(--gold-dark);
  background: var(--gold-light);
  font-weight: 600;
  box-shadow: 0 0 0 1.5px var(--gold-dark) inset;
}
.opt-btn.correct {
  background: var(--correct-bg);
  border-color: var(--correct-border);
  color: var(--correct-text);
  font-weight: 600;
}
.opt-btn.wrong {
  background: var(--wrong-bg);
  border-color: var(--wrong-border);
  color: var(--wrong-text);
  font-weight: 600;
}
.opt-btn:disabled { cursor: default; transform: none; }

/* ── Feedback ── */
.feedback {
  min-height: 46px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  margin-bottom: 20px;
  padding: 0 2px;
}
.feedback .label-correct { color: var(--correct-text); font-weight: 700; }
.feedback .label-wrong   { color: var(--wrong-text);   font-weight: 700; }

/* ── Bottom bar ── */
.bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.score-chip {
  font-size: 13px;
  font-weight: 700;
  background: var(--gold);
  color: var(--black);
  border-radius: 99px;
  padding: 6px 14px;
}
.next-btn {
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  padding: 11px 22px;
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  cursor: pointer;
  transition: background var(--t), transform 0.1s;
}
.next-btn:hover:not(:disabled) { background: var(--gold-dark); transform: translateY(-1px); }
.next-btn:active:not(:disabled) { transform: translateY(0); }
.next-btn:disabled { opacity: 0.32; cursor: default; transform: none; }

/* ════════════════════════════════════════
   QUIZ PAGE – RESULT SCREEN
════════════════════════════════════════ */
.result {
  text-align: center;
  padding: 16px 0 8px;
}
.result-ring {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--gold);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 6px 24px rgba(245,194,0,0.45);
}
.result-score {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 44px;
  font-weight: 800;
  color: var(--black);
  line-height: 1;
}
.result-total {
  font-size: 12px;
  font-weight: 700;
  color: var(--dark);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.result-msg {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.result-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 32px;
  line-height: 1.55;
}
.result-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.restart-btn {
  background: var(--gold);
  color: var(--black);
  border: none;
  border-radius: var(--radius);
  padding: 13px 28px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t);
}
.restart-btn:hover { background: var(--gold-dark); }
.topics-btn {
  background: var(--surface);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 28px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color var(--t), background var(--t);
  text-decoration: none;
  display: inline-block;
}
.topics-btn:hover { border-color: var(--gold); background: var(--gold-light); }

/* ── Start screen (name entry) ── */
.start-screen {
  text-align: center;
  padding: 20px 0 8px;
}
.start-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  font-weight: 800;
  color: var(--black);
  margin-bottom: 6px;
  letter-spacing: -0.2px;
}
.start-sub {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
  line-height: 1.5;
}
.name-input {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 16px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  text-align: center;
  transition: border-color var(--t);
}
.name-input:focus {
  outline: none;
  border-color: var(--gold);
}
.start-error {
  color: var(--wrong-text);
  font-size: 12px;
  font-weight: 600;
  margin-top: 10px;
}
.start-btn {
  display: block;
  margin: 22px auto 0;
  background: var(--gold);
  color: var(--black);
  border: none;
  border-radius: var(--radius);
  padding: 13px 32px;
  font-family: 'Barlow', sans-serif;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--t), transform 0.1s;
}
.start-btn:hover { background: var(--gold-dark); }
.start-btn:active { transform: translateY(1px); }
a.start-btn { text-decoration: none; }

.start-switch {
  margin-top: 16px;
  font-size: 13px;
}
.start-switch a {
  color: var(--muted);
  text-decoration: underline;
  transition: color var(--t);
}
.start-switch a:hover { color: var(--gold-dark); }

/* ── Roster selection screen ── */
.roster-card { max-width: 420px; margin: 0 auto; }
.roster-label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  margin: 20px 0 8px;
}
.roster-label:first-child { margin-top: 0; }
.roster-select {
  display: block;
  width: 100%;
  margin: 0;
  text-align: left;
}
.roster-select:disabled { opacity: 0.55; cursor: not-allowed; }
.roster-error {
  color: var(--wrong-text);
  font-size: 12px;
  font-weight: 600;
  margin-top: 14px;
  text-align: center;
}

/* ── Loading state ── */
.loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}
.loading-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  margin: 0 auto 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════════════════════════════════════
   HOMEWORK PAGE
════════════════════════════════════════ */
.homework-main { max-width: 1180px; }

.hw-card { margin-bottom: 24px; }

/* ── Vocabulary section ── */
.hw-vocab-header {
  font-size: 15px;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.6;
}
.hw-star { color: var(--gold-dark); }

.vocab-list {
  list-style: none;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1.5px dashed var(--border);
}
.vocab-item {
  position: relative;
  padding-left: 20px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 16px;
}
.vocab-item:last-child { margin-bottom: 0; }
.vocab-item::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-dark);
}
.vocab-item strong { color: var(--black); }
.vocab-type  { color: var(--muted); font-style: italic; }
.vocab-ipa   { color: var(--ipa-color); font-weight: 600; }
.vocab-meaning { color: var(--text); }
.vocab-example {
  display: block;
  margin-top: 3px;
  color: var(--example-color);
}

.hw-exercise-title { margin-bottom: 16px; }
.hw-questions-range {
  font-family: 'Barlow Condensed', sans-serif;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: 0.2px;
  color: var(--gold-dark);
  margin-bottom: 6px;
}
.hw-instructions {
  font-style: italic;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
}
.hw-instructions strong { font-weight: 800; }

.hw-question-list {
  list-style: none;
}
.hw-question-list .question-block {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius);
  margin-bottom: 6px;
  transition: background var(--t);
}
.hw-question-list .question-block.correct   { background: var(--correct-bg); }
.hw-question-list .question-block.incorrect { background: var(--wrong-bg); }

/* ── Cloze passage (word bank + inline blanks) ── */
.hw-wordbank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1.5px dashed var(--border);
  font-weight: 700;
  font-size: 14px;
  color: var(--black);
}
.wordbank-used {
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 500;
}

.cloze-text {
  font-size: 14px;
  line-height: 2.6;
  color: var(--text);
}
.cloze-blank {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.cloze-blank.correct .q-input   { border-color: var(--correct-border); background: var(--correct-bg); }
.cloze-blank.incorrect .q-input { border-color: var(--wrong-border); background: var(--wrong-bg); }
.cloze-blank .q-mark { font-size: 11px; }

/* ── Listening exercises (audio + notes/table completion) ── */
.hw-exercise + .hw-exercise {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 1.5px dashed var(--border);
}
.hw-audio {
  width: 100%;
  margin: 4px 0 20px;
  height: 40px;
}

.notes-instructions {
  margin-top: 22px;
  margin-bottom: 10px;
}
.hw-exercise .notes-instructions:first-of-type { margin-top: 0; }

.notes-heading {
  font-weight: 800;
  font-size: 14px;
  color: var(--black);
  margin-bottom: 6px;
}

.notes-list {
  list-style: none;
}
.notes-list li {
  position: relative;
  padding-left: 18px;
  font-size: 14px;
  line-height: 2.4;
  color: var(--text);
  margin-bottom: 4px;
}
.notes-list li::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted);
}

.hw-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 10px;
  font-size: 14px;
}
.hw-table th,
.hw-table td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.hw-table th {
  background: var(--surface);
  font-weight: 700;
  color: var(--black);
}
.hw-table td { line-height: 2.2; }

.q-number {
  font-weight: 700;
  color: var(--muted);
  flex-shrink: 0;
}
.q-prompt {
  flex: 1;
  min-width: 200px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}
.q-mark {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.q-mark .label-correct { color: var(--correct-text); }
.q-mark .label-wrong   { color: var(--wrong-text); }

.q-input {
  font-family: 'Barlow', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 4px 10px;
  transition: border-color var(--t);
}
.q-input:focus { outline: none; border-color: var(--gold); }
select.q-input { cursor: pointer; }
input.blank-input { width: 160px; text-align: center; }

/* ── Reading section: two-column layout ── */
.reading-panes {
  display: flex;
  gap: 20px;
  align-items: stretch;
}
.reading-pane {
  flex: 1 1 50%;
  min-width: 0;
  padding: 4px 14px 4px 0;
}
.reading-pane--passage { border-right: 1.5px solid var(--border); }
.reading-pane--questions .hw-exercise { margin-bottom: 26px; }
.reading-pane--questions .hw-exercise:last-child { margin-bottom: 0; }

.hw-passage-intro {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.6;
  margin-bottom: 14px;
}
.passage-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--black);
  text-align: center;
  margin-bottom: 16px;
}
.passage-paragraph {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 14px;
}
.para-label { color: var(--gold-dark); margin-right: 4px; }

/* ── Per-section score summary ── */
.hw-summary:not(:empty) {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1.5px dashed var(--border);
}

/* ── Submit bar ── */
.hw-submit-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 40px;
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 480px) {
  .options          { grid-template-columns: 1fr; }
  .card             { padding: 24px 18px 20px; }
  .q-text           { font-size: 16px; }
  .logo             { font-size: 26px; }
  .logo-star        { width: 22px; height: 22px; }
  header            { padding: 13px 18px; }
  .hero             { padding: 16px 20px; }
  .result-actions   { flex-direction: column; align-items: stretch; }
  .restart-btn,
  .topics-btn       { text-align: center; }
}

@media (max-width: 860px) {
  .reading-panes          { flex-direction: column; }
  .reading-pane           { padding: 0; }
  .reading-pane--passage  { border-right: none; border-bottom: 1.5px solid var(--border); padding-bottom: 20px; margin-bottom: 20px; }
  .hw-submit-bar          { flex-direction: column; align-items: stretch; }
}
