:root {
  --phase-bg: #fff8cd;
  --phase-strong: #ffd84f;
  --phase-deep: #a66900;
  --phase-soft: #fffdf0;
  --board-ink: #263634;
}

body.lesson-board {
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 7% 18%, rgba(255,255,255,.78) 0 5px, transparent 6px),
    radial-gradient(circle at 92% 72%, rgba(255,255,255,.65) 0 7px, transparent 8px),
    var(--phase-bg);
  background-size: 62px 62px, 78px 78px, auto;
  color: var(--board-ink);
  transition: background-color 220ms ease;
}

body.lesson-board[data-phase="phase2"] {
  --phase-bg: #ffe1ec;
  --phase-strong: #f69abd;
  --phase-deep: #9c315a;
  --phase-soft: #fff5f9;
}

.board-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  min-height: 92px;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 12px clamp(16px, 3vw, 42px);
  border-bottom: 2px solid rgba(38,54,52,.14);
  background: color-mix(in srgb, var(--phase-bg) 90%, white 10%);
  box-shadow: 0 7px 24px rgba(38,54,52,.08);
}

.board-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  color: var(--board-ink);
  font-weight: 900;
  text-decoration: none;
}

.board-brand .brand-mark span { background: var(--phase-strong); }
.board-brand .brand-mark span:nth-child(2) { background: var(--white); }
.board-brand .brand-mark span:nth-child(3) { background: var(--mint); }

.phase-switch {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 2px solid var(--board-ink);
  border-radius: 999px;
  background: rgba(255,255,255,.72);
}

.phase-button {
  min-height: 48px;
  padding: 8px 18px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--board-ink);
  cursor: pointer;
  font-size: 15px;
  font-weight: 900;
}

.phase-button[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--board-ink); }
.phase-one-button[aria-pressed="true"] { background: #ffd84f; }
.phase-two-button[aria-pressed="true"] { background: #f69abd; }

.teacher-tools { display: flex; justify-content: flex-end; gap: 9px; }
.teacher-tool {
  display: flex;
  min-width: 72px;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 9px;
  border: 1px solid rgba(38,54,52,.24);
  border-radius: 12px;
  background: rgba(255,255,255,.66);
  color: var(--board-ink);
  cursor: pointer;
}
.teacher-tool > span { display: grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; background: var(--board-ink); color: #fff; font-weight: 950; }
.teacher-tool small { font-size: 9px; font-weight: 850; }

.board-main {
  width: min(1180px, calc(100% - 34px));
  min-height: calc(100vh - 202px);
  margin: 0 auto;
  padding: 18px 0 126px;
}

.board-progress { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-bottom: 14px; }
.board-progress p { margin: 0; color: var(--phase-deep); font-size: 12px; font-weight: 950; letter-spacing: .08em; text-transform: uppercase; }
.board-progress p:last-child { text-align: right; }
.progress-dots { display: flex; gap: 7px; }
.progress-dots span { width: 11px; height: 11px; border: 2px solid var(--board-ink); border-radius: 50%; background: transparent; }
.progress-dots span.complete { background: var(--phase-strong); }
.progress-dots span.current { box-shadow: 0 0 0 4px rgba(255,255,255,.84); transform: scale(1.2); }

.board-screen {
  position: relative;
  display: flex;
  min-height: min(650px, calc(100vh - 242px));
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: clamp(26px, 4vw, 54px);
  border: 3px solid var(--board-ink);
  border-radius: 35px;
  background: var(--phase-soft);
  box-shadow: 10px 12px 0 rgba(38,54,52,.92);
  text-align: center;
}

.board-screen::before { position: absolute; top: 18px; left: 22px; width: 38px; height: 38px; border-radius: 50%; background: var(--phase-strong); content: ""; opacity: .72; }
.screen-kicker { margin: 0 0 9px; color: var(--phase-deep); font-size: 13px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.board-screen h1 { max-width: 950px; margin: 0 0 16px; font-size: clamp(38px, 6vw, 68px); letter-spacing: -.045em; }
.board-screen h2 { margin-bottom: 18px; font-size: clamp(29px, 4vw, 45px); }
.board-prompt { max-width: 850px; margin: 0 0 23px; color: #415653; font-size: clamp(17px, 2vw, 23px); font-weight: 750; }

.days-row,
.picture-grid,
.corner-grid,
.phrase-options,
.action-row { display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(12px, 2vw, 22px); }

.day-card,
.picture-card,
.corner-card,
.word-choice {
  position: relative;
  display: flex;
  min-width: 170px;
  min-height: 185px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 17px;
  border: 3px solid var(--board-ink);
  border-radius: 24px;
  background: #fff;
  box-shadow: 6px 7px 0 var(--board-ink);
  color: var(--board-ink);
  cursor: pointer;
  font: inherit;
  font-weight: 900;
  transition: transform 130ms ease, background 130ms ease;
}
.day-card:hover,
.picture-card:hover,
.corner-card:hover,
.word-choice:hover { transform: translateY(-4px); }
.day-card:active,
.picture-card:active,
.corner-card:active,
.word-choice:active { box-shadow: 2px 3px 0 var(--board-ink); transform: translateY(3px); }
.picture-card .picture,
.corner-card .picture { font-size: clamp(68px, 9vw, 105px); line-height: 1; }
.picture-card strong,
.corner-card strong { font-size: clamp(19px, 2.2vw, 28px); }
.picture-card small,
.corner-card small { color: #63726f; font-size: 11px; }
.picture-card.gentle-correct,
.day-card.gentle-correct,
.word-choice.gentle-correct { background: #cdeed8; animation: card-pop 340ms ease; }
.picture-card.listen-again,
.day-card.listen-again,
.word-choice.listen-again { background: #fff3c5; }

@keyframes card-pop { 50% { transform: translateY(-8px) rotate(1deg); } }

.day-card { min-width: 155px; min-height: 145px; }
.day-card span { font-size: 42px; line-height: 1; }
.day-card strong { font-size: 19px; }
.day-card.tuesday { background: var(--phase-strong); transform: rotate(-2deg); }
.day-card.tuesday::after { position: absolute; top: -14px; right: -11px; content: "★"; color: #fff; font-size: 32px; -webkit-text-stroke: 2px var(--board-ink); }

.song-actions { display: flex; gap: 12px; margin-top: 24px; }
.song-actions span { padding: 10px 15px; border: 2px solid var(--board-ink); border-radius: 999px; background: #fff; font-weight: 900; }

.screen-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 25px; }
.screen-button {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 20px;
  border: 2px solid var(--board-ink);
  border-radius: 15px;
  background: var(--phase-strong);
  box-shadow: 3px 4px 0 var(--board-ink);
  color: var(--board-ink);
  cursor: pointer;
  font-weight: 950;
}
.screen-button.secondary { background: #fff; }
.screen-button:active { box-shadow: none; transform: translateY(3px); }

.board-feedback { min-height: 34px; margin: 20px 0 0; color: var(--phase-deep); font-size: 20px; font-weight: 950; }
.picture-grid.four .picture-card { min-width: min(205px, 20vw); }

.sound-mystery { display: grid; min-height: 135px; margin: 3px 0 18px; place-items: center; }
.sound-mystery .ear { font-size: 95px; line-height: 1; animation: listening 1.6s ease-in-out infinite; }
.sound-mystery .reveal-word { display: flex; align-items: center; gap: 15px; padding: 11px 22px; border: 3px solid var(--board-ink); border-radius: 20px; background: #fff; box-shadow: 4px 5px 0 var(--board-ink); }
.sound-mystery .reveal-word span { font-size: 65px; }
.sound-mystery .reveal-word strong { font-size: 32px; }
@keyframes listening { 50% { transform: scale(1.08) rotate(3deg); } }

.corner-grid .corner-card { min-width: min(330px, 38vw); min-height: 250px; background: #fff; }
.corner-grid .corner-card:first-child { background: #f7e1c1; }
.corner-grid .corner-card:last-child { background: #d9edf8; }
.move-label { display: inline-flex; margin-bottom: 18px; padding: 8px 16px; border-radius: 999px; background: var(--board-ink); color: #fff; font-size: 15px; font-weight: 900; }

.trace-layout { display: grid; width: min(900px, 100%); grid-template-columns: .8fr 1.2fr; gap: 22px; }
.trace-guide {
  position: relative;
  min-height: 390px;
  overflow: hidden;
  border: 3px solid var(--board-ink);
  border-radius: 27px;
  background: #fff;
  touch-action: none;
}
.trace-guide::before { position: absolute; inset: 0 auto 0 48%; border-left: 2px dashed #c5b985; content: ""; }
.trace-letter { position: absolute; top: 47%; left: 25%; color: rgba(38,54,52,.16); font-family: var(--hand); font-size: clamp(230px, 28vw, 330px); line-height: .75; transform: translate(-50%,-50%); }
.line-guides { position: absolute; inset: 34px 5% 34px 55%; display: flex; justify-content: space-around; }
.line-guides span { width: 0; border-left: 10px dotted rgba(166,105,0,.26); }
#board-trace-canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: crosshair; touch-action: none; }
.offscreen-practice { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 3px dashed var(--board-ink); border-radius: 27px; background: rgba(255,255,255,.7); }
.offscreen-practice span { font-size: 105px; }
.offscreen-practice h2 { margin: 8px 0 9px; }
.offscreen-practice p { max-width: 320px; margin: 0; color: #526562; font-weight: 750; }

.phrase-card { display: flex; min-width: min(580px, 100%); align-items: center; justify-content: center; gap: 24px; margin: 5px 0 25px; padding: 24px; border: 3px solid var(--board-ink); border-radius: 27px; background: #fff; box-shadow: 6px 7px 0 var(--board-ink); }
.phrase-card .picture { font-size: 105px; line-height: 1; }
.phrase-line { display: flex; align-items: end; gap: 12px; font-family: var(--hand); font-size: clamp(44px, 7vw, 75px); line-height: 1; }
.phrase-blank { display: inline-block; min-width: 120px; border-bottom: 7px solid var(--phase-strong); }
.word-choice { min-width: 190px; min-height: 90px; font-family: var(--hand); font-size: 52px; }

.mystery-layout { display: grid; width: min(850px, 100%); grid-template-columns: 1fr 1fr; align-items: center; gap: 35px; }
.mystery-bag { position: relative; display: grid; min-height: 340px; place-items: center; }
.mystery-bag .closed-bag { font-size: 200px; line-height: 1; filter: drop-shadow(6px 8px 0 rgba(38,54,52,.28)); }
.mystery-bag .question-mark { position: absolute; top: 14%; right: 15%; display: grid; width: 70px; height: 70px; place-items: center; border: 3px solid var(--board-ink); border-radius: 50%; background: var(--phase-strong); font-family: var(--hand); font-size: 55px; }
.mystery-reveal { display: flex; min-height: 290px; flex-direction: column; align-items: center; justify-content: center; padding: 24px; border: 3px solid var(--board-ink); border-radius: 27px; background: #fff; box-shadow: 6px 7px 0 var(--board-ink); }
.mystery-reveal .picture { font-size: 120px; line-height: 1; }
.mystery-reveal h2 { margin: 10px 0 0; font-family: var(--hand); font-size: 48px; }
.mystery-reveal p { margin: 8px 0 0; color: #526562; font-weight: 800; }

.check-step { margin-bottom: 13px; color: var(--phase-deep); font-size: 13px; font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.optional-sentence { display: grid; max-width: 700px; place-items: center; padding: 28px; border: 3px dashed var(--board-ink); border-radius: 27px; background: #fff; }
.optional-sentence span { font-size: 90px; }
.optional-sentence blockquote { margin: 8px 0 16px; font-family: var(--hand); font-size: clamp(36px, 6vw, 60px); }

.goodbye-art { position: relative; display: grid; width: 260px; height: 210px; margin-bottom: 12px; place-items: center; }
.goodbye-art .calendar { display: grid; width: 170px; height: 160px; place-items: center; border: 4px solid var(--board-ink); border-radius: 24px; background: #fff; box-shadow: 7px 8px 0 var(--board-ink); font-size: 78px; }
.goodbye-art .success-star { position: absolute; top: -5px; right: 8px; color: var(--phase-strong); font-size: 80px; -webkit-text-stroke: 3px var(--board-ink); animation: success-spin 700ms ease-out both; }
.confetti { position: absolute; inset: 0; pointer-events: none; }
.confetti i { position: absolute; width: 13px; height: 26px; border: 2px solid var(--board-ink); border-radius: 4px; background: var(--phase-strong); animation: confetti-fall 1.1s ease-out both; }
.confetti i:nth-child(1) { top: 13%; left: 9%; transform: rotate(24deg); }.confetti i:nth-child(2) { top: 20%; right: 12%; background: var(--mint); transform: rotate(-18deg); }.confetti i:nth-child(3) { bottom: 8%; left: 18%; background: var(--coral); transform: rotate(45deg); }.confetti i:nth-child(4) { right: 21%; bottom: 4%; background: var(--blue); transform: rotate(-36deg); }
@keyframes success-spin { from { opacity: 0; transform: scale(.4) rotate(-80deg); } to { opacity: 1; transform: scale(1) rotate(8deg); } }
@keyframes confetti-fall { from { opacity: 0; transform: translateY(-80px) rotate(0); } to { opacity: 1; } }

.board-nav {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 25;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 11px max(16px, calc((100vw - 1000px) / 2));
  border-top: 2px solid rgba(38,54,52,.18);
  background: rgba(255,255,255,.96);
  box-shadow: 0 -7px 25px rgba(38,54,52,.1);
}
.nav-control { display: flex; min-height: 65px; align-items: center; justify-content: center; gap: 10px; border: 2px solid var(--board-ink); border-radius: 17px; background: #fff; color: var(--board-ink); cursor: pointer; font-size: 17px; }
.nav-control span { font-size: 25px; }
.nav-control.repeat-control { background: #e4f3fb; }
.nav-control.next-control { background: var(--phase-strong); box-shadow: 3px 4px 0 var(--board-ink); }
.nav-control:disabled { cursor: default; opacity: .35; box-shadow: none; }

.teacher-dialog,
.movement-dialog { width: min(660px, calc(100% - 30px)); max-height: calc(100vh - 35px); overflow-y: auto; padding: 31px; border: 3px solid var(--board-ink); border-radius: 26px; background: #fffdf8; box-shadow: 9px 11px 0 var(--board-ink); color: var(--board-ink); }
.teacher-dialog::backdrop,
.movement-dialog::backdrop { background: rgba(20,42,40,.6); backdrop-filter: blur(3px); }
.dialog-close { float: right; display: grid; width: 43px; height: 43px; place-items: center; border: 2px solid var(--board-ink); border-radius: 50%; background: #fff; cursor: pointer; font-size: 30px; line-height: 1; }
.dialog-kicker { margin: 5px 0 8px; color: var(--phase-deep); font-size: 12px; font-weight: 950; letter-spacing: .12em; text-transform: uppercase; }
.teacher-dialog h2 { font-size: 36px; }
.teacher-detail { display: grid; grid-template-columns: 55px 1fr; gap: 14px; margin-top: 16px; padding: 17px; border-radius: 17px; background: #f6f4ed; }
.teacher-detail > span { font-size: 34px; }
.teacher-detail h3 { margin: 0 0 6px; font-size: 19px; }
.teacher-detail p { margin: 0; color: #536562; }
.teacher-detail.physical-reminder { background: var(--phase-bg); }

.assessment-activity { padding: 13px 16px; border-radius: 13px; background: var(--phase-bg); font-weight: 850; }
.assessment-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.assessment-options button { display: flex; min-height: 78px; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; border: 2px solid #cdd5d0; border-radius: 15px; background: #fff; cursor: pointer; font-weight: 900; }
.assessment-options button span { color: #bec8c2; }
.assessment-options button[aria-pressed="true"] { border-color: var(--board-ink); background: #dff2e5; box-shadow: 3px 4px 0 var(--board-ink); }
.assessment-options button[aria-pressed="true"] span { color: #4ba267; }
.assessment-options button:nth-child(2)[aria-pressed="true"] { background: #fff3c5; }.assessment-options button:nth-child(2)[aria-pressed="true"] span { color: #d1a11e; }
.assessment-options button:nth-child(3)[aria-pressed="true"] { background: #ffe2e2; }.assessment-options button:nth-child(3)[aria-pressed="true"] span { color: #cf6161; }
.assessment-status { min-height: 26px; margin: 13px 0; color: #526562; font-size: 13px; font-weight: 800; }
.assessment-summary { margin-top: 19px; padding-top: 17px; border-top: 1px solid #d8ddd9; }
.assessment-summary h3 { margin-bottom: 10px; font-size: 19px; }
.assessment-summary-list { display: grid; gap: 6px; }
#assessment-summary-list p { display: flex; justify-content: space-between; gap: 15px; margin: 0; padding: 7px 9px; border-radius: 8px; background: #f6f4ed; font-size: 12px; }
.clear-assessment { margin-top: 17px; padding: 7px 0; border: 0; background: transparent; color: #6a7977; cursor: pointer; font-size: 12px; font-weight: 800; text-decoration: underline; }

.movement-dialog { text-align: center; }
.movement-dialog .movement-feet { font-size: 88px; }
.movement-dialog > p { color: var(--phase-deep); font-weight: 950; letter-spacing: .1em; text-transform: uppercase; }
.movement-dialog h2 { font-size: clamp(36px, 6vw, 55px); }
.movement-actions { display: flex; justify-content: center; gap: 18px; margin: 25px 0; font-size: 55px; }
.movement-ready { min-height: 58px; padding: 12px 27px; border: 3px solid var(--board-ink); border-radius: 17px; background: var(--phase-strong); box-shadow: 4px 5px 0 var(--board-ink); cursor: pointer; font-size: 18px; font-weight: 950; }

@media (max-width: 850px) {
  .board-header { grid-template-columns: 1fr auto; }
  .phase-switch { grid-column: 1 / -1; grid-row: 2; justify-self: center; }
  .teacher-tools { grid-column: 2; grid-row: 1; }
  .board-brand > span:last-child { display: none; }
  .board-main { padding-top: 13px; }
  .trace-layout,
  .mystery-layout { grid-template-columns: 1fr; }
  .offscreen-practice { display: none; }
  .trace-guide { min-height: 420px; }
}

@media (max-width: 600px) {
  .board-header { min-height: 78px; padding: 8px 12px; }
  .phase-switch { width: 100%; }
  .phase-button { min-height: 44px; flex: 1; padding-inline: 10px; }
  .teacher-tool { min-width: 50px; padding-inline: 6px; }
  .teacher-tool small { display: none; }
  .board-main { width: min(100% - 18px, 1180px); padding-bottom: 109px; }
  .board-progress { grid-template-columns: auto 1fr auto; gap: 9px; }
  .progress-dots { justify-content: center; gap: 4px; }
  .progress-dots span { width: 8px; height: 8px; border-width: 1px; }
  .board-screen { min-height: calc(100vh - 238px); padding: 24px 14px; border-radius: 24px; box-shadow: 5px 6px 0 var(--board-ink); }
  .board-screen::before { width: 22px; height: 22px; }
  .days-row,
  .picture-grid { width: 100%; gap: 9px; }
  .day-card,
  .picture-card { min-width: 0; min-height: 130px; flex: 1 1 40%; padding: 10px; border-radius: 17px; box-shadow: 3px 4px 0 var(--board-ink); }
  .picture-grid.four .picture-card { min-width: 0; }
  .picture-card .picture { font-size: 60px; }
  .day-card span { font-size: 34px; }
  .corner-grid { width: 100%; }
  .corner-grid .corner-card { min-width: 0; min-height: 185px; flex: 1 1 40%; padding: 11px; }
  .corner-card .picture { font-size: 70px; }
  .song-actions { flex-wrap: wrap; justify-content: center; }
  .trace-guide { min-height: 340px; }
  .trace-letter { font-size: 220px; }
  .line-guides span { border-left-width: 7px; }
  .phrase-card { gap: 12px; padding: 16px; }
  .phrase-card .picture { font-size: 75px; }
  .phrase-line { font-size: 43px; }
  .phrase-blank { min-width: 80px; }
  .word-choice { min-width: 125px; min-height: 78px; font-size: 42px; }
  .mystery-bag { min-height: 230px; }
  .mystery-bag .closed-bag { font-size: 150px; }
  .mystery-reveal { min-height: 220px; }
  .mystery-reveal .picture { font-size: 90px; }
  .board-nav { gap: 5px; padding: 7px; }
  .nav-control { min-height: 58px; flex-direction: column; gap: 0; border-radius: 12px; font-size: 12px; }
  .nav-control span { font-size: 21px; line-height: 1; }
  .assessment-options { grid-template-columns: 1fr; }
  .teacher-dialog { padding: 21px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
