:root {
  --ink: #152238;
  --muted: #46556f;
  --line: #2f3b52;
  --paper: rgba(255, 255, 255, 0.94);
  --paper-strong: #ffffff;
  --mint: #d8f3e5;
  --sky: #dcebff;
  --peach: #ffe2d2;
  --lemon: #fff3bd;
  --lavender: #eadfff;
  --rose: #ffddea;
  --green: #23735d;
  --blue: #245ca8;
  --orange: #a85222;
  --purple: #6048a8;
  --shadow: 0 16px 40px rgba(18, 30, 54, 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background:
    linear-gradient(rgba(255, 255, 255, 0.42), rgba(255, 255, 255, 0.64)),
    url("assets/classroom-bg.png") center / cover fixed;
}

button {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  width: min(1360px, 100%);
  margin: 0 auto;
  padding: 18px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.eyebrow,
.set-label {
  margin: 0 0 4px;
  color: #31415f;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.45rem, 2.5vw, 2.25rem);
  line-height: 1.12;
}

h2 {
  margin-bottom: 8px;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.18;
}

h3 {
  margin-bottom: 0;
  font-size: 1.18rem;
  line-height: 1.25;
}

.speech-panel,
.stepper,
.set-tabs,
.keyword-bank,
.recall-options {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.speech-panel {
  justify-content: flex-end;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--lemon);
  font-weight: 800;
}

.toggle input {
  width: 24px;
  height: 24px;
  accent-color: var(--blue);
}

.icon-button,
.nav-button,
.tab-button,
.question-button,
.keyword-button,
.recall-button {
  min-height: 48px;
  border: 2px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: var(--paper-strong);
  font-weight: 800;
  box-shadow: 0 4px 0 rgba(21, 34, 56, 0.22);
}

.icon-button {
  width: 52px;
  font-size: 1rem;
}

.nav-button {
  padding: 0 16px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.sidebar,
.question-card,
.reveal-card,
.thinking-panel,
.recall-card {
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.sidebar {
  position: sticky;
  top: 14px;
  height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  overflow: auto;
}

.tab-button {
  flex: 1;
  background: var(--sky);
}

.tab-button.active {
  background: var(--peach);
}

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

.question-button {
  width: 100%;
  padding: 12px;
  text-align: left;
  background: #ffffff;
}

.question-button.active {
  background: var(--mint);
  outline: 3px solid #155d4a;
}

.question-button small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.score-card {
  margin-top: auto;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: var(--lavender);
}

.score-card span {
  display: block;
  font-weight: 800;
}

.score-card strong {
  display: block;
  margin: 5px 0 10px;
  font-size: 1.45rem;
}

.meter {
  height: 18px;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.meter span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #2a7f67, #5d8fd8);
}

.workspace {
  display: grid;
  gap: 18px;
}

.question-card,
.reveal-card,
.thinking-panel,
.recall-card {
  padding: 18px;
}

.focus-line {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  font-weight: 700;
}

.card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

#partCount {
  min-width: 72px;
  text-align: center;
  font-weight: 900;
}

.keyword-bank {
  align-items: stretch;
  margin-bottom: 14px;
}

.keyword-button {
  flex: 1 1 150px;
  padding: 12px 14px;
  background: var(--lemon);
  font-size: 1rem;
}

.keyword-button:nth-child(2n) {
  background: var(--sky);
}

.keyword-button:nth-child(3n) {
  background: var(--rose);
}

.keyword-button.selected,
.keyword-button:focus {
  outline: 4px solid #114f8f;
  background: #ffffff;
}

.response-box {
  min-height: 210px;
  padding: 18px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
}

.locked-message {
  margin: 0;
  color: var(--muted);
  font-size: 1.25rem;
  font-weight: 800;
}

.response-part {
  animation: rise 180ms ease-out;
}

.response-part p {
  margin-bottom: 14px;
  font-size: clamp(1.08rem, 1.7vw, 1.35rem);
  line-height: 1.55;
}

.response-tag {
  display: inline-block;
  margin-bottom: 10px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--mint);
  font-size: 0.82rem;
  font-weight: 900;
}

.thinking-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.move-list,
.prompt-stack {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.move-item,
.practice-prompt {
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  font-weight: 700;
  line-height: 1.35;
}

.move-item strong,
.practice-prompt strong {
  display: block;
  margin-bottom: 4px;
}

.recall-card {
  display: grid;
  gap: 14px;
  background: rgba(255, 247, 214, 0.96);
}

.recall-button {
  flex: 1 1 210px;
  padding: 12px;
  background: #ffffff;
}

.recall-options.locked .recall-button {
  background: #f3f6fb;
  border-style: dashed;
}

.recall-button.correct {
  background: var(--mint);
}

.recall-button.wrong {
  background: var(--peach);
}

.feedback {
  min-height: 28px;
  margin-bottom: 0;
  font-weight: 900;
}

.feedback.nudge {
  animation: nudge 260ms ease-out;
}

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

@keyframes nudge {
  0% {
    transform: translateX(0);
  }
  35% {
    transform: translateX(8px);
  }
  70% {
    transform: translateX(-5px);
  }
  100% {
    transform: translateX(0);
  }
}

@media (max-width: 900px) {
  .app-shell {
    padding: 10px;
  }

  .topbar,
  .card-heading {
    flex-direction: column;
    align-items: stretch;
  }

  .speech-panel,
  .stepper {
    justify-content: space-between;
  }

  .lesson-grid,
  .thinking-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    max-height: none;
  }

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

@media (max-width: 560px) {
  .question-list {
    grid-template-columns: 1fr;
  }

  .keyword-button,
  .recall-button {
    flex-basis: 100%;
  }
}
