.course-page { line-height:1.5; }
.course-page [hidden] { display:none !important; }
.course-header,.course-main { width:min(1180px,calc(100% - 24px)); margin-inline:auto; }
.course-header { display:flex; align-items:center; gap:8px; min-height:60px; border-bottom:1px solid var(--line); }
.course-header h1 { flex:1; font:600 17px/1.25 var(--serif); letter-spacing:-.02em; margin:8px 0; }
.back-link { display:grid; place-items:center; width:44px; height:44px; flex:none; color:var(--green); font-size:24px; }
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.course-page button,.course-page select { color:var(--ink); }
.lesson-picker { display:flex; gap:6px; padding-block:10px; }
.lesson-picker button { flex:0 0 44px; font-size:26px; }
.course-page button { cursor:pointer; }
.lesson-picker button,.board-controls button { border:1px solid var(--line); background:transparent; border-radius:3px; min-height:44px; }
.lesson-picker select { min-width:0; flex:1; border:1px solid var(--line); border-radius:3px; background:var(--paper); padding:8px; font:inherit; font-size:14px; }
.workspace { display:grid; gap:18px; align-items:start; }
.board-column { width:100%; max-width:max(280px,calc(100svh - 255px)); margin-inline:auto; }
.mobile-question { margin-bottom:8px; }
.mobile-question p { font-size:15px; line-height:1.4; margin:0; }
.mobile-question .question-label { font-size:11px; margin-bottom:4px; }
.board-status { min-height:28px; display:flex; align-items:center; justify-content:space-between; gap:8px; font-size:12px; color:var(--muted); }
#position-label { font-variant-numeric:tabular-nums; }
.board { display:grid; grid-template-columns:repeat(8,1fr); aspect-ratio:1; width:100%; user-select:none; -webkit-user-select:none; touch-action:none; overflow:hidden; border:1px solid #667c6c; }
.square { position:relative; aspect-ratio:1; border:0; border-radius:0; padding:0; background:#eee8d9; display:grid; place-items:center; }
.square.dark { background:#829b89; }
.square.last { background:#e6cc79; }
.square.dark.last { background:#b2b76e; }
.square.selected { box-shadow:inset 0 0 0 4px #275f46; }
.square.check { background:#d59980; }
.square img { width:93%; height:93%; pointer-events:none; -webkit-user-drag:none; }
.square .coord { position:absolute; font:600 10px/1 sans-serif; color:#264435; pointer-events:none; }
.square.dark .coord { color:#172c22; }
.square .rank { top:3px; left:3px; }
.square .file { right:3px; bottom:2px; }
.square.target::after { content:""; position:absolute; width:23%; aspect-ratio:1; border-radius:50%; background:#244e4399; pointer-events:none; }
.square.target:has(img)::after { width:86%; border:3px solid #244e43b3; background:transparent; }
.square.drag-over { box-shadow:inset 0 0 0 4px #275f46; }
.square:focus-visible { outline:3px solid #17251a; outline-offset:-3px; z-index:1; border-radius:0; }
.drag-piece { position:fixed; pointer-events:none; z-index:100; opacity:.9; transform:translate(-50%,-50%); }
.board-controls { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:5px; margin-top:8px; }
.board-controls button { font-size:23px; line-height:1; }
.board-controls button:hover,.lesson-picker button:hover { background:var(--children); }
.feedback { margin:9px 0 0; min-height:21px; font-size:13px; color:var(--green); }
.feedback:empty { display:none; }
.feedback[data-kind="retry"] { color:var(--ink); }
.board-help { font-size:11px; color:var(--muted); margin:3px 0 0; }
.lesson-content { min-width:0; padding-bottom:12px; }
.lesson-meta { color:var(--green); font-size:12px; margin:0 0 6px; }
.lesson-content h2 { font:600 25px/1.2 var(--serif); letter-spacing:-.025em; margin-bottom:8px; }
.players { font-size:13px; color:var(--muted); margin-bottom:18px; }
.lesson-content p { overflow-wrap:anywhere; }
.context-copy { font-size:15px; margin-bottom:14px; }
.question { border-top:2px solid var(--green); padding-top:12px; }
.question-label { font-size:12px; font-weight:600; color:var(--green); margin-bottom:7px; }
.question-prompt { font-size:18px; line-height:1.45; margin-bottom:14px; }
.actions { display:flex; flex-wrap:wrap; gap:8px; margin-block:12px; }
.actions button,.line-choice,.question-jump,#promotion button { min-height:44px; border:1px solid var(--line); border-radius:3px; padding:9px 13px; font:inherit; font-size:14px; background:transparent; }
.actions .primary { color:var(--button-ink); background:var(--green); border-color:var(--green); }
.actions button:hover,.line-choice:hover,.question-jump:hover { filter:brightness(.94); background:var(--children); color:var(--ink); }
.hint { color:var(--muted); font-size:14px; }
.answer { border-left:3px solid var(--green); padding-left:14px; margin-top:16px; }
.answer p { margin-bottom:10px; }
.answer .answer-label { font-size:12px; color:var(--green); font-weight:600; }
.history-note { font-size:14px; padding-block:10px; border-block:1px solid var(--line); }
.question-jumps { display:flex; flex-wrap:wrap; gap:6px; margin-top:14px; }
.question-jump { font-size:13px; padding:8px 10px; }
.question-jump[aria-current="step"],.line-choice[aria-pressed="true"] { background:var(--children); border-color:var(--green); }
.lesson-content details { border-top:1px solid var(--line); margin-top:18px; }
.lesson-content summary { cursor:pointer; min-height:44px; padding-block:12px; font-size:14px; color:var(--green); }
.lesson-content details p { font-size:14px; }
#lines { display:flex; flex-wrap:wrap; gap:6px; margin-block:5px 12px; }
.line-choice { font-size:13px; padding:8px 10px; }
.move-list { display:flex; flex-wrap:wrap; gap:3px; }
.move-list button { min-height:44px; padding:7px 9px; border:0; border-radius:3px; font:14px ui-monospace,monospace; background:transparent; }
.move-list button[aria-current="step"] { color:var(--button-ink); background:var(--green); }
.move-list button:hover { box-shadow:inset 0 0 0 1px var(--green); }
.takeaways { padding-left:20px; font-size:15px; }
.takeaways li { margin-block:7px; }
#about a { text-decoration:underline; text-underline-offset:3px; display:inline-block; padding-block:10px; overflow-wrap:anywhere; }
.course-footer { display:flex; flex-wrap:wrap; justify-content:space-between; gap:8px 20px; border-top:1px solid var(--line); margin-top:28px; font-size:12px; color:var(--muted); }
.course-footer a { display:inline-flex; align-items:center; min-height:44px; }
.loading { margin:30px auto; padding:16px; max-width:700px; }
#promotion { max-width:calc(100% - 32px); background:var(--paper); color:var(--ink); border:1px solid var(--line); border-radius:4px; }
#promotion::backdrop { background:#17251a80; }
#promotion h2 { font:600 21px/1.3 var(--serif); }
#promotion-options { display:flex; gap:5px; margin-bottom:16px; }
#promotion-options button { padding:5px; width:56px; height:56px; }
#promotion-options img { width:100%; height:100%; }
@media (min-width:850px) {
  .course-header,.course-main { width:min(1180px,calc(100% - 64px)); }
  .course-header { min-height:64px; }
  .course-header h1 { font-size:21px; }
  .lesson-picker { max-width:650px; padding-block:16px; }
  .workspace { grid-template-columns:minmax(0,1.12fr) minmax(0,1fr); gap:40px; }
  .board-column { position:sticky; top:16px; max-width:max(300px,calc(100svh - 215px)); }
  .mobile-question { display:none; }
  .lesson-content { padding-top:28px; }
  .lesson-content h2 { font-size:30px; }
  .square .coord { font-size:12px; }
}
@media (max-width:849px) {
  .question > .question-label,.question > .question-prompt { display:none; }
}
@media (prefers-reduced-motion:no-preference) {
  .square img { animation:piece-in .12s ease-out; }
  .actions button,.board-controls button,.line-choice { transition:background .14s,color .14s; }
  .hint,.answer { animation:reveal .16s ease-out; }
  @keyframes piece-in { from { opacity:.72; } to { opacity:1; } }
  @keyframes reveal { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:translateY(0); } }
}
