.learn-dialog {
  width: min(900px, calc(100vw - 28px)); max-width: 900px;
  max-height: calc(100dvh - 28px); margin: auto; padding: 0;
  overflow: auto; overscroll-behavior: contain; color: #eaf0da;
  background: #17352e; border: 1px solid #a7b18380; border-radius: 22px;
  box-shadow: 0 24px 90px #081c24b3;
}
.learn-dialog::backdrop { background: #071a20cc; backdrop-filter: blur(5px); }
.learn-dialog button { cursor: pointer; }
.learn-dialog button:disabled { cursor: default; }
.learn-header {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center;
  justify-content: space-between; padding: 10px 22px; background: #17352e;
  border-bottom: 1px solid #a7b18330; font-size: 10px; letter-spacing: 1.5px; font-weight: 800;
}
.learn-header button { width: 44px; height: 44px; color: #eaf0da; font-size: 20px; border-radius: 50%; }
.learn-header button:hover { background: #ffffff10; }
.learn-progress { display: flex; gap: 8px; padding: 16px 26px 4px; }
.learn-progress button { flex: 1; min-width: 0; min-height: 44px; color: #aabfaf; border-bottom: 2px solid #718b6b55; font-size: 12px; }
.learn-progress button[aria-current] { color: #f3d47a; border-color: #f3d47a; font-weight: 800; }
.learn-body { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; padding: 26px; }
.learn-copy .eyebrow { color: #c4ceaa; font-size: 10px; margin-bottom: 12px; }
.learn-copy h2 { font-size: clamp(26px, 4vw, 40px); line-height: 1.08; letter-spacing: -.8px; margin: 0 0 20px; color: #f6e8bc; }
.learn-copy > p:not(.eyebrow) { font-size: 16px; line-height: 1.65; margin: 0 0 18px; }
.learn-copy .lesson-tip { color: #bdcdbb; font-size: 14px !important; }
.learn-live { color: #f3d47a; font-size: 13px; margin: 12px 26px 0; line-height: 1.5; }
.lesson-checklist { padding-left: 22px; font-size: 16px; line-height: 1.7; margin-bottom: 20px; }
.lesson-board-label { display: flex; justify-content: space-between; gap: 8px; font-size: 9px; font-weight: 800; letter-spacing: 1px; margin-bottom: 10px; color: #f3d47a; }
.lesson-board-label span { color: #a9bcaa; font-weight: 500; letter-spacing: 0; }
.lesson-board { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; padding: 10px; background: #315846; border: 1px solid #acaa6c; border-radius: 13px; box-shadow: 0 5px 0 #0d2721; }
.lesson-cell { position: relative; display: grid; place-items: center; aspect-ratio: 1; min-width: 0; border: 1px solid #ede9d0; border-radius: 5px; background: #f0ecd4; color: #294343; isolation: isolate; }
.lesson-cell.red, .lesson-hand-card.red { color: #bd4b43; }
.lesson-cell:disabled { opacity: 1; }
.lesson-cell .lesson-rank { position: absolute; left: 4px; top: 3px; font-size: 11px; font-weight: 800; }
.lesson-cell > svg { width: 21px; height: 23px; fill: currentColor; margin: 6px 0 0 5px; }
.lesson-cell .chip { width: 76%; }
.lesson-cell.lesson-legal { outline: 2px solid #f3d47a; outline-offset: 1px; cursor: pointer; box-shadow: 0 0 12px #f3d47a70; }
.lesson-cell.lesson-legal:hover { background: #f9dfa0; }
.lesson-last { outline: 2px solid #f3d47a; outline-offset: 1px; }
.lesson-last .chip { animation: lesson-place .4s cubic-bezier(.16, 1, .3, 1); }
.lesson-directions { display: flex; gap: 8px; margin-top: 16px; }
.lesson-directions button { min-height: 44px; flex: 1; border: 1px solid #7d9b7a; border-radius: 9px; color: #d9e3cd; font-size: 12px; }
.lesson-directions button[aria-pressed="true"] { background: #ead084; color: #18372c; border-color: #ead084; font-weight: 800; }
.lesson-hand { display: flex; align-items: center; gap: 18px; margin: 22px 0 8px; min-height: 94px; }
.lesson-hand-card { position: relative; width: 65px; height: 88px; flex-shrink: 0; display: grid; place-items: center; border-radius: 8px; background: #f0ecd4; color: #294343; border: 1px solid #e3d7b1; box-shadow: 0 4px 0 #958f6c; }
.lesson-hand-card .lesson-rank { position: absolute; top: 6px; left: 8px; font-size: 20px; font-weight: 800; }
.lesson-hand-card svg { width: 30px; height: 34px; fill: currentColor; margin-top: 20px; }
.lesson-hand-card[aria-pressed="true"] { outline: 3px solid #f3d47a; outline-offset: 3px; }
.lesson-hand > div { display: grid; gap: 8px; }
.lesson-hand strong { font-size: 10px; letter-spacing: .6px; color: #f3d47a; }
.lesson-hand span:not(.lesson-rank) { font-size: 13px; line-height: 1.5; }
.lesson-hand .button { min-height: 44px; font-size: 11px; padding: 8px 12px; }
.lesson-feedback { color: #dce7cd; min-height: 46px; font-size: 13px; line-height: 1.5; margin: 14px 0 0; }
.learn-footer { display: flex; justify-content: space-between; gap: 12px; padding: 0 26px 12px; }
.learn-footer .button { min-height: 48px; min-width: 112px; font-size: 12px; }
.learn-footer .button:disabled { opacity: .4; }
.learn-secondary { display: flex; justify-content: space-between; gap: 14px; padding: 0 26px 12px; }
.learn-secondary button { min-height: 44px; font-size: 12px; color: #c3d3bd; text-decoration: underline; text-underline-offset: 4px; }
.lesson-reference { border-top: 1px solid #93a67a44; padding: 0 26px 18px; }
.lesson-reference summary { cursor: pointer; padding: 18px 0; font-size: 14px; font-weight: 700; color: #f3d47a; }
.lesson-reference dl { margin: 0; }
.lesson-reference dt { font-weight: 800; margin: 18px 0 5px; font-size: 14px; }
.lesson-reference dd { margin: 0; color: #c6d5c0; line-height: 1.65; font-size: 14px; }
.menu-learn { margin-top: 10px; width: 100%; min-height: 48px; color: #e7d28f; font-size: 13px; text-align: left; text-decoration: underline; text-underline-offset: 5px; }
@keyframes lesson-place { from { opacity: .3; transform: translateY(-10px) scale(1.12); } to { opacity: 1; transform: none; } }
@media (max-width: 600px) {
  .learn-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .learn-header { padding: 6px 14px; font-size: 9px; }
  .learn-progress { padding: 8px 16px 0; gap: 4px; }
  .learn-body { grid-template-columns: 1fr; gap: 10px; padding: 18px 18px 10px; }
  .learn-copy h2 { font-size: 27px; margin-bottom: 12px; }
  .learn-copy > p:not(.eyebrow) { font-size: 14px; line-height: 1.55; margin-bottom: 12px; }
  .learn-copy .lesson-tip { font-size: 12px !important; }
  .learn-demo { width: 100%; max-width: 320px; margin-inline: auto; }
  .learn-footer { padding: 0 18px 10px; }
  .learn-secondary { padding: 0 18px 10px; }
  .lesson-reference { padding: 0 18px 16px; }
  .learn-live { margin: 12px 18px 0; font-size: 12px; }
  .header-actions .rules-button { display: inline-grid; place-items: center; width: 32px; height: 32px; min-width: 32px; padding: 0; }
  .header-actions .rules-button > span:last-child { display: none; }
}
body.reduce-motion .lesson-last .chip { animation: none; }
@media (prefers-reduced-motion: reduce) { .lesson-last .chip { animation: none; } }

.lesson-corner { display: flex; align-items: center; gap: 7px; margin: 18px 0 10px; }
.lesson-corner span { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; color: #a5e5b5; background: #357953; border: 2px solid #81be88; }
.lesson-corner span:last-child { border-radius: 5px; background: #d8c482; color: #243e2d; border-color: #efdfa8; font-size: 9px; font-weight: 800; }
.learn-demo { max-width: 340px; width: 100%; justify-self: center; }
.learn-copy h2:focus, .lesson-feedback:focus { outline: none; }
@media (max-width: 380px) {
  .topbar:has(.account-menu-button:not([hidden])) .brand > span:last-child { display: none; }
}
