/* =========================================================
   Study Quiz - style.css
   Layout and look for every page. Mobile first: the basic
   rules are for phones, the @media rules at the bottom
   make things roomier on bigger screens.
   ========================================================= */

/* ---------- Colours and sizes (light mode) ----------
   Stark black and white, sharp corners, thin lines. */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f2f2f2;
  --text: #000000;
  --muted: #5e5e5e;
  --border: #d9d9d9;

  --accent: #000000;
  --accent-2: #000000;
  --accent-soft: #ededed;
  --accent-text: #ffffff;
  --button-from: #000000;
  --button-to: #000000;

  --good: #1a7f37;
  --good-soft: #e9f5ec;
  --bad: #c4231c;
  --bad-soft: #fbeceb;
  --warn: #9a5b00;
  --warn-soft: #fbf2e2;
  --on-status: #ffffff;

  --radius: 0px;
  --radius-small: 2px;
  --shadow: none;
  --shadow-lift: none;

  --font: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Inter Tight", "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
}

/* ---------- Colours for dark mode ---------- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #0b0b0b;
    --surface-2: #1a1a1a;
    --text: #ffffff;
    --muted: #a3a3a3;
    --border: #2e2e2e;

    --accent: #ffffff;
    --accent-2: #ffffff;
    --accent-soft: #1f1f1f;
    --accent-text: #000000;
    --button-from: #ffffff;
    --button-to: #ffffff;

    --good: #4cc46a;
    --good-soft: #0f2416;
    --bad: #ff6b61;
    --bad-soft: #2c1110;
    --warn: #f2b84b;
    --warn-soft: #2b2110;
    --on-status: #000000;

    --shadow: none;
    --shadow-lift: none;
  }
}

/* ---------- Basics ---------- */
* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

h1, h2, h3 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

button {
  font-family: inherit;
  font-size: inherit;
}

.hidden {
  display: none !important;
}

/* ---------- Page frame ---------- */
.page {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 48px 16px;
}

/* ---------- Top bar ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 17px;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-small);
  background: var(--accent);
  color: var(--accent-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  box-shadow: none;
}

.topbar-link {
  color: var(--muted);
  font-size: 15px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-small);
}

.topbar-link:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- Hero (page heading) ---------- */
.hero {
  padding: 24px 0 20px 0;
}

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 30px;
  font-weight: 800;
}

.hero p {
  color: var(--muted);
  margin: 10px 0 0 0;
  font-size: 16px;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 28px 0 12px 0;
}

/* ---------- Module list (index page) ---------- */
.module-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.module-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  color: var(--text);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

a.module-card:hover {
  transform: none;
  box-shadow: var(--shadow-lift);
  border-color: var(--accent);
}

a.module-card:active {
  transform: translateY(0);
}

.module-card.is-locked {
  opacity: 0.6;
  box-shadow: none;
}

.module-icon {
  flex-shrink: 0;
  width: 46px;
  height: 46px;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
}

.module-text {
  flex: 1;
  min-width: 0;
}

.module-name {
  font-weight: 650;
  font-size: 16px;
}

.module-meta {
  color: var(--muted);
  font-size: 14px;
  margin-top: 2px;
}

.module-arrow {
  color: var(--muted);
  font-size: 20px;
}

/* ---------- Small labels ---------- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-small);
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.tag-ready {
  background: var(--good-soft);
  color: var(--good);
}

.tag-accent {
  background: var(--accent-soft);
  color: var(--accent);
}

.tag-warn {
  background: var(--warn-soft);
  color: var(--warn);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border-radius: var(--radius-small);
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.18s ease, background 0.18s ease, opacity 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}

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

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-text);
  box-shadow: none;
}

.btn-primary:hover {
  box-shadow: none;
}

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--surface-2);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  min-height: 44px;
  padding: 0 14px;
}

.btn-ghost:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-danger {
  background: transparent;
  color: var(--bad);
  border-color: var(--border);
  min-height: 44px;
  font-size: 15px;
}

.btn-danger.is-confirming {
  background: var(--bad);
  color: var(--on-status);
  border-color: var(--bad);
}

.btn-full {
  width: 100%;
}

.btn-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

/* ---------- Choice chips (lecture + round size) ---------- */
.field-label {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 10px 0;
}

.field {
  margin-bottom: 22px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 46px;
  min-width: 64px;
  padding: 0 18px;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.chip:hover {
  border-color: var(--accent);
}

.chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

/* lecture list: one row per lecture */
.lecture-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lecture-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lecture-option:hover {
  border-color: var(--accent);
}

.lecture-option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.lecture-number {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
}

.lecture-option.is-selected .lecture-number {
  background: var(--accent);
  color: var(--accent-text);
}

.lecture-text {
  flex: 1;
  min-width: 0;
}

.lecture-title {
  font-weight: 600;
}

.lecture-stats {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* small progress bar under each lecture */
.mini-bar {
  height: 5px;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 8px;
}

.mini-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: var(--radius-small);
  transition: width 0.5s ease;
}

/* ---------- Quiz screen ---------- */
.quiz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0 12px 0;
}

.quiz-counter {
  font-weight: 600;
  color: var(--muted);
  font-size: 15px;
}

.progress {
  height: 8px;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  overflow: hidden;
  margin-bottom: 20px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-small);
  background: var(--accent);
  transition: width 0.4s ease;
}

.question-card {
  padding: 22px 20px;
}

.question-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.question-text {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
  margin: 0 0 20px 0;
  letter-spacing: -0.01em;
  white-space: pre-line;
}

/* keep "\n" line breaks in answers, rows and model answers too */
.option-text,
.label-row-text,
.model-answer {
  white-space: pre-line;
}

/* answer buttons */
.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 58px;
  padding: 12px 16px;
  text-align: left;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
  -webkit-tap-highlight-color: transparent;
}

.option:hover {
  border-color: var(--accent);
}

.option:active {
  transform: scale(0.99);
}

.option-key {
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-small);
  background: var(--surface-2);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}

.option-text {
  flex: 1;
}

.option-mark {
  flex-shrink: 0;
  font-weight: 800;
  font-size: 18px;
}

.option.is-locked {
  cursor: default;
}

.option.is-locked:hover {
  border-color: var(--border);
}

.option.is-dimmed {
  opacity: 0.5;
}

.option.is-right,
.option.is-right:hover {
  border-color: var(--good);
  background: var(--good-soft);
}

.option.is-right .option-key {
  background: var(--good);
  color: var(--on-status);
}

.option.is-right .option-mark {
  color: var(--good);
}

.option.is-wrong,
.option.is-wrong:hover {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.option.is-wrong .option-key {
  background: var(--bad);
  color: var(--on-status);
}

.option.is-wrong .option-mark {
  color: var(--bad);
}

/* true / false side by side */
.options-tf {
  flex-direction: row;
}

.options-tf .option {
  justify-content: center;
  font-weight: 600;
  min-height: 64px;
}

/* number input for calculation questions */
.calc-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.calc-row .btn {
  flex-shrink: 0;
  padding: 0 18px;
}

.calc-input-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  padding: 0 14px;
  transition: border-color 0.15s ease;
}

.calc-input-wrap:focus-within {
  border-color: var(--accent);
}

.calc-input-wrap.is-right {
  border-color: var(--good);
  background: var(--good-soft);
}

.calc-input-wrap.is-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.calc-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  height: 54px;
  outline: none;
}

.calc-unit {
  color: var(--muted);
  font-weight: 600;
}

/* explain-in-your-own-words */
.explain-box {
  width: 100%;
  min-height: 110px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-small);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  padding: 12px 14px;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s ease;
}

.explain-box:focus {
  border-color: var(--accent);
}

.model-answer {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-small);
  background: var(--accent-soft);
  border: 1px solid var(--border);
}

.model-answer-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.self-mark {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.self-mark .btn {
  flex: 1;
}

.btn-good {
  background: var(--good-soft);
  color: var(--good);
  border-color: var(--good);
}

.btn-bad {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: var(--bad);
}

.hint {
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
}

/* feedback box after answering */
.feedback {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  background: var(--surface-2);
  animation: fadeUp 0.3s ease;
}

.feedback.is-right {
  background: var(--good-soft);
  border-color: transparent;
}

.feedback.is-wrong {
  background: var(--bad-soft);
  border-color: transparent;
}

.feedback-title {
  font-weight: 750;
  font-size: 17px;
  margin-bottom: 4px;
}

.feedback.is-right .feedback-title {
  color: var(--good);
}

.feedback.is-wrong .feedback-title {
  color: var(--bad);
}

.feedback-text {
  margin: 0;
  white-space: pre-line;
}

/* ---------- Tick grid ---------- */
.grid-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.grid-chip {
  min-height: 40px;
  min-width: 52px;
  padding: 0 12px;
  font-size: 14px;
}

.grid-chip.is-right {
  border-color: var(--good);
  background: var(--good);
  color: var(--on-status);
}

.grid-chip.is-wrong {
  border-color: var(--bad);
  background: var(--bad);
  color: var(--on-status);
}

.grid-chip.is-missed {
  border-color: var(--good);
  border-style: dashed;
  color: var(--good);
}

.feedback-source {
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}

.next-row {
  margin-top: 18px;
}

/* ---------- Results screen ---------- */
.results-card {
  text-align: center;
  padding: 30px 20px;
}

.score-ring {
  position: relative;
  width: 170px;
  height: 170px;
  margin: 0 auto 18px auto;
}

.score-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-back {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 6;
}

.ring-front {
  fill: none;
  stroke: var(--accent);
  stroke-width: 6;
  stroke-linecap: butt;
  transition: stroke-dashoffset 1s ease;
}

.score-number {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-percent {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.score-detail {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.results-title {
  font-size: 24px;
  font-weight: 800;
}

.results-sub {
  color: var(--muted);
  margin: 8px 0 0 0;
}

.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.review-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-small);
}

.review-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: var(--on-status);
}

.review-icon.is-right {
  background: var(--good);
}

.review-icon.is-wrong {
  background: var(--bad);
}

.review-text {
  font-size: 15px;
}

.review-source {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- Messages (errors, empty states) ---------- */
.notice {
  text-align: center;
  padding: 40px 20px;
}

.notice-icon {
  font-size: 40px;
  margin-bottom: 8px;
}

.notice h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.notice p {
  color: var(--muted);
  margin: 0 0 18px 0;
}

.footer {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 32px 0 0 0;
}

.kbd {
  display: inline-block;
  padding: 1px 6px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
}

/* ---------- "Type #N" label ---------- */
.tag-group {
  background: var(--text);
  color: var(--bg);
}

/* ---------- Pictures in questions ---------- */
.question-image {
  display: block;
  margin: 0 0 18px 0;
  border-radius: var(--radius-small);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
}

.question-image img {
  display: block;
  width: 100%;
  height: auto;
}

.feedback .question-image,
.model-answer .question-image {
  margin: 12px 0 0 0;
}

.option-image {
  display: block;
  max-width: 100%;
  max-height: 120px;
  background: #ffffff;
  border-radius: var(--radius-small);
}

/* ---------- Select all that apply ---------- */
.option.is-tickbox .option-key {
  border-radius: var(--radius-small);
}

.option.is-checked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.option.is-checked .option-key {
  background: var(--accent);
  color: var(--accent-text);
}

.option-mark {
  font-size: 14px;
}

/* ---------- Drag and drop labelling ---------- */
.label-board {
  position: relative;
  margin-bottom: 16px;
  border-radius: var(--radius-small);
  overflow: hidden;
  border: 1px solid var(--border);
  background: #ffffff;
}

.label-board img {
  display: block;
  width: 100%;
  height: auto;
}

.label-board .drop-slot {
  position: absolute;
  transform: translate(-50%, -50%);
  min-width: 56px;
  min-height: 28px;
  max-width: 45%;
  padding: 2px 8px;
  font-size: 12px;
  box-shadow: none;
}

.drop-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 110px;
  padding: 4px 10px;
  border-radius: var(--radius-small);
  border: 2px dashed var(--accent);
  background: var(--surface);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.drop-slot.is-filled {
  border-style: solid;
  background: var(--accent-soft);
  color: var(--text);
}

.drop-slot.is-hover {
  background: var(--accent);
  color: var(--accent-text);
}

.drop-slot.is-right {
  border: 2px solid var(--good);
  background: var(--good-soft);
  color: var(--good);
}

.drop-slot.is-wrong {
  border: 2px solid var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
}

.drop-slot.is-locked {
  cursor: default;
}

.label-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 10px 12px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border);
  background: var(--surface);
}

.label-row-text {
  flex: 1;
  min-width: 140px;
}

.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.word-chip {
  padding: 9px 14px;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-weight: 600;
  font-size: 15px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.word-chip.is-selected {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

.word-chip.is-used {
  opacity: 0.35;
}

.word-chip.is-locked {
  cursor: default;
}

.drag-ghost {
  position: fixed;
  z-index: 100;
  pointer-events: none;
  transform: translate(-50%, -120%) rotate(-2deg);
  background: var(--accent);
  color: var(--accent-text);
  border-color: var(--accent);
  box-shadow: var(--shadow-lift);
}

/* ---------- Matching ---------- */
.match-select {
  flex: 1;
  min-width: 160px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
}

.match-row.is-right {
  border-color: var(--good);
  background: var(--good-soft);
}

.match-row.is-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.match-result {
  width: 100%;
  font-size: 14px;
  font-weight: 700;
}

.match-row.is-right .match-result {
  color: var(--good);
}

.match-row.is-wrong .match-result {
  color: var(--bad);
}

/* ---------- Several number boxes ---------- */
.numbers-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.number-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border);
  background: var(--surface);
}

.number-box:focus-within {
  border-color: var(--accent);
}

.number-box.is-right {
  border-color: var(--good);
  background: var(--good-soft);
}

.number-box.is-wrong {
  border-color: var(--bad);
  background: var(--bad-soft);
}

.number-name {
  font-weight: 700;
  color: var(--muted);
}

.number-input {
  width: 56px;
  height: 50px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  outline: none;
}

/* ---------- Materials (slides and notes) ---------- */
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.hero-actions:empty {
  display: none;
}

.hero-actions .btn {
  min-height: 44px;
  font-size: 15px;
  padding: 0 16px;
}

.material-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-small);
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.material-row:hover {
  border-color: var(--accent);
  transform: none;
}

a.feedback-source {
  display: inline-block;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Sync line on the start screen ---------- */
.hero p.sync-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
}

.sync-status:empty {
  display: none;
}

.sync-status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}

.sync-ok::before {
  background: var(--good);
}

.sync-offline::before {
  background: var(--warn);
}

.sync-busy::before {
  background: var(--accent);
  animation: pulse 1s ease infinite;
}

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

/* ---------- Animations ---------- */
.screen {
  animation: fadeUp 0.35s ease;
}

.slide-in {
  animation: slideIn 0.35s ease;
}

.shake {
  animation: shake 0.4s ease;
}

.pop {
  animation: pop 0.35s ease;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(24px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes shake {
  0%   { transform: translateX(0); }
  20%  { transform: translateX(-6px); }
  40%  { transform: translateX(6px); }
  60%  { transform: translateX(-4px); }
  80%  { transform: translateX(4px); }
  100% { transform: translateX(0); }
}

@keyframes pop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.025); }
  100% { transform: scale(1); }
}

/* people who switch off motion in their system get no animations */
/* ---------- Typography: big plain headings, small mono labels ---------- */
h1, h2, h3,
.hero h1,
.results-title,
.score-percent,
.question-text {
  font-family: var(--font-display);
}

.hero h1 {
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.results-title {
  font-weight: 500;
  letter-spacing: -0.03em;
}

.score-percent {
  font-weight: 500;
}

.eyebrow,
.section-title,
.tag {
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.eyebrow {
  font-size: 12px;
}

.section-title {
  font-size: 12px;
  border-top: 1px solid var(--text);
  padding-top: 10px;
}

.tag {
  font-size: 11px;
  border: 1px solid var(--border);
  background: transparent;
}

.btn {
  font-weight: 500;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  opacity: 0.85;
}

a.module-card:hover,
.material-row:hover {
  border-color: var(--text);
}

.module-icon {
  font-family: var(--font-mono);
  font-weight: 500;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Bigger screens ---------- */
@media (min-width: 640px) {
  .page {
    padding: 0 24px 64px 24px;
  }

  .hero {
    padding: 40px 0 24px 0;
  }

  .hero h1 {
    font-size: 52px;
  }

  .module-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card {
    padding: 28px;
  }

  .question-card {
    padding: 32px;
  }

  .question-text {
    font-size: 22px;
  }

  .btn-row {
    flex-direction: row;
    justify-content: center;
  }
}
