:root {
  --bg: #efe3d4;
  --bg-strong: #e4d4c2;
  --surface: #fff8f0;
  --surface-strong: #fffdf9;
  --ink: #171512;
  --muted: #6d6258;
  --line: #d6c2af;
  --accent: #d13c2f;
  --accent-dark: #8f241d;
  --accent-soft: #f4d6cf;
  --good: #1d8b5f;
  --bad: #c74632;
  --shadow: 0 24px 60px rgba(52, 28, 16, 0.14);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(209, 60, 47, 0.16), transparent 24%),
    radial-gradient(circle at bottom right, rgba(23, 21, 18, 0.07), transparent 28%),
    linear-gradient(180deg, #f5ecdf 0%, #eadbca 100%);
}

button {
  font: inherit;
}

.app-shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.topbar,
.layout,
.stats-grid,
.section-heading,
.progress-row,
.results-actions {
  display: flex;
}

.topbar,
.section-heading,
.progress-row,
.results-actions {
  align-items: center;
  justify-content: space-between;
}

.topbar {
  gap: 16px;
  margin-bottom: 24px;
  padding: 14px 0 20px;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  border-bottom: 1px solid rgba(23, 21, 18, 0.08);
}

.topbar-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-home-link {
  display: inline-flex;
  align-items: center;
}

.brand-logo {
  display: block;
  width: auto;
  height: 46px;
  object-fit: contain;
}

.single-column {
  display: block;
}

.layout {
  gap: 24px;
  align-items: start;
}

.hero-panel,
.phone-frame {
  border: 1px solid rgba(31, 28, 24, 0.08);
  box-shadow: var(--shadow);
}

.hero-panel {
  flex: 1 1 45%;
  padding: 34px 30px;
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(255, 251, 246, 0.96), rgba(247, 238, 228, 0.96));
  position: relative;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(209, 60, 47, 0.04), transparent 34%),
    linear-gradient(0deg, rgba(255, 255, 255, 0.25), transparent 40%);
}

.landing-panel,
.admin-page-panel {
  max-width: 980px;
  margin: 0 auto;
}

.landing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  position: relative;
  z-index: 1;
  margin-top: 20px;
}

.route-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
}

.student-page {
  max-width: 760px;
  margin: 0 auto;
}

.student-frame {
  width: 100%;
  min-height: auto;
}

.stats-grid-compact {
  margin-bottom: 16px;
}

.hero-copy {
  margin-bottom: 28px;
  position: relative;
  z-index: 1;
}

.eyebrow,
.card-kicker,
.microcopy,
.prompt {
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow,
.card-kicker {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--accent);
}

h1,
h2,
h3,
h4,
.word-text,
.results-score {
  margin: 0;
  font-family: "Fraunces", serif;
}

h1 {
  font-size: clamp(1.9rem, 4vw, 2.8rem);
}

h2 {
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.08;
  max-width: 13ch;
}

h3 {
  font-size: 1.45rem;
}

h4 {
  font-size: 1.3rem;
}

.hero-text,
.teacher-note p,
.results-copy,
.word-subtitle,
#dailySummary,
#sourceNote {
  line-height: 1.55;
  color: var(--muted);
}

.stats-grid {
  gap: 12px;
  margin-bottom: 20px;
}

.stat-card,
.teacher-note,
.card {
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(31, 28, 24, 0.08);
}

.stat-card {
  flex: 1 1 0;
  padding: 18px;
}

.stat-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.stat-value {
  font-size: 1.6rem;
}

.teacher-note {
  padding: 18px 20px;
  position: relative;
  z-index: 1;
}

.teacher-title {
  margin: 0 0 8px;
  font-weight: 800;
}

.admin-panel {
  margin-top: 12px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: rgba(255, 251, 246, 0.82);
  border: 1px solid rgba(31, 28, 24, 0.08);
  position: relative;
  z-index: 1;
}

.admin-heading {
  margin-bottom: 16px;
}

.compact-button {
  padding: 12px 14px;
  font-size: 0.92rem;
}

.admin-filters,
.admin-add-grid,
.admin-actions,
.admin-list-header,
.admin-row,
.admin-meta {
  display: flex;
}

.admin-filters,
.admin-actions,
.admin-list-header,
.admin-row {
  justify-content: space-between;
}

.admin-filters,
.admin-add-grid {
  gap: 12px;
  margin-bottom: 16px;
}

.admin-add-grid {
  flex-wrap: wrap;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 160px;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
}

.field span {
  color: var(--muted);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 132px;
}

.align-end {
  align-self: end;
}

.admin-import {
  margin-bottom: 16px;
}

.helper-import {
  padding-top: 4px;
  border-top: 1px dashed rgba(31, 28, 24, 0.12);
}

.admin-actions {
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.admin-note,
.admin-list-header span,
.admin-word span,
.admin-empty {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.admin-list-header {
  align-items: center;
  margin-bottom: 10px;
}

.admin-list {
  display: grid;
  gap: 10px;
}

.admin-row {
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(31, 28, 24, 0.08);
}

.admin-word {
  flex: 1 1 auto;
}

.admin-word strong,
.admin-meta span:first-child {
  display: block;
}

.admin-meta {
  min-width: 120px;
  flex-direction: column;
  gap: 2px;
  font-size: 0.84rem;
  color: var(--muted);
}

.admin-empty {
  padding: 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px dashed var(--line);
}

.phone-frame {
  flex: 1 1 55%;
  min-height: 760px;
  padding: 22px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(255, 253, 249, 0.95), rgba(245, 235, 221, 0.92)),
    linear-gradient(135deg, rgba(209, 60, 47, 0.1), transparent 40%);
  border: 1px solid rgba(23, 21, 18, 0.12);
}

.phone-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.streak-chip {
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 0.85rem;
  font-weight: 800;
}

.screen {
  display: none;
}

.screen.active {
  display: block;
}

.card {
  padding: 20px;
  margin-bottom: 16px;
}

.feature-card {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(135deg, #211d19 0%, #362a24 100%);
  color: #fff9f4;
}

.feature-card .card-kicker,
.feature-card h4,
.feature-card p {
  color: inherit;
}

.feature-card #dailySummary {
  color: rgba(255, 249, 244, 0.72);
}

.chip-grid,
.answer-grid {
  display: grid;
  gap: 10px;
}

.chip-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.chip,
.answer,
.primary-button,
.ghost-button {
  border-radius: 16px;
  border: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.chip,
.answer,
.ghost-button {
  background: var(--surface-strong);
  border: 1px solid var(--line);
}

.chip,
.answer {
  text-align: left;
  padding: 14px;
}

.chip:hover,
.answer:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

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

.chip strong,
.answer strong {
  display: block;
  margin-bottom: 4px;
}

.chip span,
.answer span,
.microcopy {
  color: var(--muted);
  font-size: 0.84rem;
}

.primary-button,
.ghost-button {
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--accent);
  color: white;
  box-shadow: 0 12px 26px rgba(209, 60, 47, 0.22);
}

.primary-button:hover {
  background: var(--accent-dark);
}

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

.ghost-button {
  color: var(--ink);
}

.topbar .ghost-button {
  background: rgba(255, 253, 249, 0.94);
  border-color: rgba(23, 21, 18, 0.12);
}

a.primary-button,
a.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.start-button,
.results-actions button {
  width: 100%;
}

.quiz-card {
  min-height: 560px;
}

.progress-bar {
  height: 10px;
  margin: 16px 0 24px;
  border-radius: 999px;
  background: #eadbca;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), #e27b5d);
  transition: width 0.25s ease;
}

.word-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(241, 225, 204, 0.7), rgba(255, 253, 249, 0.94));
  margin-bottom: 16px;
  text-align: center;
  border: 1px solid rgba(23, 21, 18, 0.06);
}

.word-text {
  font-size: clamp(2rem, 7vw, 3.2rem);
}

.word-subtitle {
  margin: 10px 0 0;
}

.audio-button {
  width: 100%;
  margin-bottom: 18px;
}

.prompt {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
}

.answer.correct {
  border-color: var(--good);
  background: rgba(29, 139, 95, 0.12);
}

.answer.wrong {
  border-color: var(--bad);
  background: rgba(199, 70, 50, 0.12);
}

.answer.reveal {
  border-color: var(--good);
}

.feedback {
  min-height: 24px;
  font-weight: 700;
}

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

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

.results-card {
  text-align: center;
}

.results-score {
  margin: 10px 0;
  font-size: 4.5rem;
  line-height: 1;
  color: var(--accent);
}

.results-actions {
  gap: 10px;
  flex-direction: column;
}

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

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

  .hero-panel,
  .phone-frame {
    width: 100%;
  }

  .admin-filters,
  .admin-actions,
  .admin-list-header,
  .admin-row {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .app-shell {
    width: min(100% - 20px, 1000px);
  }

  .topbar,
  .feature-card,
  .phone-header {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-links {
    justify-content: stretch;
  }

  .brand-lockup {
    align-items: center;
  }

  .brand-logo {
    height: 40px;
  }

  .stats-grid,
  .chip-grid {
    grid-template-columns: 1fr;
  }

  .phone-frame {
    padding: 16px;
    border-radius: 28px;
    min-height: auto;
  }
}
