:root {
  --red: #a51c30;
  --red-dark: #7f1223;
  --blue: #173f5f;
  --yellow: #efb93f;
  --ink: #182026;
  --paper: #f7f3ea;
  --white: #fffdf8;
  --muted: #6f6c65;
  --line: #d8d0c2;
  --shadow: 0 10px 28px rgba(45, 35, 25, .09);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif; }
body.cloud-required > header, body.cloud-required > main, body.cloud-required > footer { visibility: hidden; }
button, input { font: inherit; }
button { cursor: pointer; }
.topbar { height: 72px; padding: 0 clamp(20px, 5vw, 72px); display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { padding: 0; border: 0; background: none; color: var(--ink); text-decoration: none; font-family: Georgia, serif; font-size: 1.25rem; font-weight: 800; letter-spacing: .06em; }
.brand span { color: var(--red); }
.top-actions, .section-actions { display: flex; gap: 15px; align-items: center; }.nav-button { border: 1px solid var(--line); border-radius: 99px; background: var(--white); padding: 8px 12px; color: var(--ink); font-size: .82rem; }.nav-button:hover { border-color: var(--red); color: var(--red); }
.streak { font-size: .9rem; color: var(--muted); }
.streak span { color: var(--red); margin-right: 5px; }
main { max-width: 1180px; margin: 0 auto; padding: 0 28px 80px; }
.intro { padding: 72px 0 48px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: 1fr minmax(260px, 380px); column-gap: 70px; align-items: end; }
.eyebrow { margin: 0 0 9px; color: var(--red); font-size: .75rem; font-weight: 800; letter-spacing: .18em; }
h1, h2 { font-family: Georgia, serif; margin: 0; line-height: 1.05; }
h1 { font-size: clamp(2.6rem, 6vw, 5rem); grid-column: 1; }
.intro > p:not(.eyebrow) { margin: 18px 0 0; color: var(--muted); font-size: 1.05rem; grid-column: 1; }
.progress-wrap { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.progress-copy { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: .9rem; }
.progress-track { height: 10px; border-radius: 99px; overflow: hidden; background: #ded6c8; }
.progress-bar { width: 0; height: 100%; background: var(--red); transition: width .35s ease; }
.words-section, .practice-section, .bank-section { padding-top: 58px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 24px; }
.section-heading h2 { font-size: 2rem; }
.section-heading > p { color: var(--muted); margin: 0; font-size: .9rem; }
.word-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.word-card { min-height: 150px; padding: 20px; display: flex; text-align: left; flex-direction: column; justify-content: space-between; border: 1px solid var(--line); border-radius: 4px; background: var(--white); color: var(--ink); box-shadow: 0 0 0 transparent; transition: transform .18s, box-shadow .18s, border-color .18s; }
.word-card:hover, .word-card:focus-visible { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #b7ad9d; outline: none; }
.word-card.revealed { background: var(--red); border-color: var(--red); color: white; }
.word-number { font: 700 .72rem/1 Georgia, serif; opacity: .55; }
.word-main { font: 700 1.45rem/1.1 Georgia, serif; }
.word-type { color: var(--muted); font-size: .76rem; }
.revealed .word-type { color: rgba(255,255,255,.72); }
.practice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.practice-card { min-height: 180px; padding: 22px; border: 0; border-radius: 4px; color: white; text-align: left; display: flex; flex-direction: column; align-items: flex-start; transition: transform .18s, filter .18s; }
.practice-card:hover, .practice-card:focus-visible { transform: translateY(-3px); filter: brightness(1.05); outline: 3px solid rgba(165,28,48,.2); }
.practice-card.red { background: var(--red); }.practice-card.blue { background: var(--blue); }.practice-card.yellow { background: var(--yellow); color: var(--ink); }.practice-card.ink { background: var(--ink); }
.mode-icon { padding: 7px 9px; border: 1px solid currentColor; font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.practice-card strong { margin-top: auto; font-family: Georgia, serif; font-size: 1.25rem; }
.practice-card small { margin-top: 7px; opacity: .72; }
.word-bank { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.bank-entry { padding: 18px 20px; background: var(--white); border: 1px solid var(--line); border-radius: 4px; }
.bank-wordline { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }.bank-wordline strong { font: 700 1.25rem/1.1 Georgia, serif; }.bank-wordline span { color: var(--red); font-weight: 700; }
.bank-entry p { margin: 12px 0 0; color: var(--muted); font-size: .87rem; line-height: 1.45; }.bank-entry p b { color: var(--ink); }.bank-empty { grid-column: 1 / -1; padding: 30px; border: 1px dashed var(--line); color: var(--muted); text-align: center; }
.profile-instruction { margin: 20px 0 0; color: var(--muted); }
.secondary { padding: 13px 20px; border: 1px solid var(--line); border-radius: 3px; background: var(--white); color: var(--ink); font-weight: 700; }
.field-label { display: block; margin: 24px 0 8px; font-weight: 700; }.dialog-shell select { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--ink); }
.dialog-shell > input { width: 100%; padding: 13px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--ink); }
.auth-message { min-height: 22px; margin: 16px 0 0; color: var(--muted); font-size: .9rem; }
.auth-message.error { color: var(--red); }
.auth-hint { margin: 8px 0 0; color: var(--muted); font-size: .8rem; }
.placement-count { margin: 20px 0 10px; color: var(--muted); font-weight: 700; }
.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 18px; }
.topic-choice { padding: 12px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--ink); text-align: left; }
.topic-choice strong, .topic-choice small { display: block; }.topic-choice small { margin-top: 4px; color: var(--muted); }
.topic-choice.selected { border-color: var(--red); background: #fff0f1; color: var(--red); }
.placement-grid { max-height: 42vh; overflow-y: auto; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 2px; }
.placement-word { min-width: 0; padding: 12px; border: 1px solid var(--line); border-radius: 3px; background: white; color: var(--ink); text-align: left; }
.placement-word strong, .placement-word small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.placement-word small { margin-top: 4px; color: var(--muted); }
.placement-word.selected { border-color: var(--red); background: #fff0f1; color: var(--red); }
footer { min-height: 100px; padding: 28px clamp(20px, 5vw, 72px); display: flex; align-items: center; gap: 20px; border-top: 1px solid var(--line); background: var(--white); }
footer span { font-family: Georgia, serif; font-weight: 800; color: var(--red); } footer p { color: var(--muted); } .text-button { margin-left: auto; border: 0; background: none; color: var(--muted); text-decoration: underline; }
dialog { width: min(620px, calc(100% - 28px)); padding: 0; border: 0; border-radius: 5px; background: var(--white); box-shadow: 0 24px 80px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(24,32,38,.68); }
.dialog-shell { padding: clamp(24px, 5vw, 44px); }
.dialog-head { display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); padding-bottom: 20px; }
.dialog-head h2 { font-size: 2rem; }.close { border: 0; background: none; font-size: 2rem; line-height: 1; color: var(--muted); }
.quiz { padding-top: 28px; }.quiz-progress { color: var(--muted); font-size: .85rem; }.prompt { margin: 28px 0; text-align: center; font: 700 clamp(2rem, 9vw, 3.5rem)/1 Georgia, serif; }
.answer-row { display: flex; gap: 10px; }.answer-row input { width: 100%; padding: 14px; border: 1px solid var(--line); border-radius: 3px; background: white; font-size: 1rem; }.primary { padding: 14px 20px; border: 0; border-radius: 3px; background: var(--red); color: white; font-weight: 700; }
.feedback { min-height: 50px; margin: 16px 0 0; padding: 12px; border-left: 4px solid transparent; }.feedback.good { background: #e7f3e8; border-color: #347a40; }.feedback.bad { background: #fae8e9; border-color: var(--red); }
.next { width: 100%; margin-top: 14px; }.bingo-prompt { margin: 22px 0 16px; font-size: 1.1rem; }.bingo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }.bingo-cell { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 3px; background: white; font-weight: 700; }.bingo-cell.correct { background: #dcefdc; border-color: #347a40; }.bingo-cell.wrong { animation: shake .25s; background: #fae8e9; }
@keyframes shake { 25% { transform: translateX(-4px) } 75% { transform: translateX(4px) } }
@media (max-width: 850px) { .word-grid { grid-template-columns: repeat(2, 1fr); }.practice-grid { grid-template-columns: 1fr 1fr; }.intro { grid-template-columns: 1fr; }.progress-wrap { grid-column: 1; grid-row: auto; margin-top: 32px; } }
@media (max-width: 700px) { .top-actions { gap: 8px; }.streak { display: none; }.nav-button { padding: 7px 9px; } }
@media (max-width: 520px) { main { padding-inline: 18px; }.topbar { padding-inline: 18px; }.intro { padding-top: 45px; }.word-card { min-height: 130px; padding: 16px; }.practice-grid, .placement-grid, .topic-grid { grid-template-columns: 1fr; }.practice-card { min-height: 145px; }.section-heading { align-items: start; flex-direction: column; gap: 8px; }.section-actions { align-items: start; flex-direction: column; gap: 10px; } footer p { display: none; } }
