@font-face { font-family: Inter; src: url('../assets/inter.ttf') format('truetype'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'PT Serif'; src: url('../assets/pt-serif-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
:root {
  --bg: #ecf3fe; --surface: #fff; --text: #17273b; --muted: #53677e; --accent: #285f91;
  --soft: #e3eefa; --border: #cedded; --shadow: 0 4px 9px rgb(18 43 71 / 10%); --heading: 'PT Serif', Georgia, serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.32 Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
:is(a, button, input, summary):focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
h1, h2, p { margin: 0; }
h1, h2 { font-family: var(--heading); line-height: 1.17; }
h1 { font-size: clamp(27px, 8vw, 32px); }
h2 { font-size: 21px; }
small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.shell { max-width: 480px; min-height: 100svh; margin: auto; padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
.topbar { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; min-height: 54px; padding: env(safe-area-inset-top) 16px 0; background: var(--surface); color: var(--accent); text-align: center; font-weight: 700; }
.circle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.bookmark[aria-pressed="true"] { background: var(--soft); }
.icon { display: inline-block; flex: 0 0 auto; width: 22px; height: 22px; background: currentColor; mask: var(--glyph) center / contain no-repeat; }
#screen { padding: 13px 20px 22px; }
#screen > h2 { margin: 14px 0 8px; }
#screen > .button { margin-top: 12px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(65px, 31%); gap: 7px; align-items: start; min-height: 116px; }
.hero p, .subtitle { margin-top: 7px; color: var(--muted); font-size: 14px; line-height: 18px; }
.hero img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.card { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); }
.soft { border-radius: 19px; background: var(--soft); }
.pad { padding: 12px 15px; margin: 6px 0 12px; }
.pad p + p { margin-top: 7px; }
.search { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 0 9px 0 12px; margin: 10px 0 13px; color: var(--accent); }
.subtitle + .search { margin-top: 28px; }
.search input { flex: 1; min-width: 0; padding: 4px 0; border: 0; background: transparent; color: var(--text); font-size: 14px; }
.search input::-webkit-search-cancel-button { appearance: none; }
.search button { display: grid; place-items: center; min-width: 40px; min-height: 44px; padding: 0; border: 0; background: none; color: inherit; }
.search button .icon { width: 16px; height: 16px; }
.segments { display: flex; gap: 5px; margin: 11px 0 14px; }
.segments :is(button, span, a) { display: grid; flex: 1; min-width: 0; min-height: 42px; place-items: center; border: none; border-radius: 24px; padding: 4px; background: var(--soft); color: var(--accent); text-align: center; font-size: clamp(10px, 3.2vw, 12px); font-weight: 700; }
.segments button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topic { display: grid; grid-template-columns: 27px minmax(0, 1fr); align-items: start; gap: 8px; min-height: 84px; padding: 12px 10px; font: 700 clamp(13px, 4vw, 16px)/1.2 var(--heading); overflow-wrap: anywhere; }
.topic img { width: 27px; height: 29px; object-fit: contain; }
.topic small { margin-top: 13px; font-family: Inter, sans-serif; }
.row { display: grid; grid-template-columns: 40px minmax(0, 1fr) 10px; align-items: center; gap: 9px; min-height: 65px; margin: 8px 0; padding: 7px 11px; font-size: 14px; }
.row img { width: 35px; height: 38px; object-fit: contain; }
.row small { margin-top: 4px; }
.row > :last-child { color: var(--accent); font-size: 22px; }
.callout { display: grid; grid-template-columns: 36px 1fr; gap: 8px; min-height: 88px; margin: 12px 0; padding: 13px 12px; }
.callout img { width: 34px; height: 34px; object-fit: contain; }
.callout p { margin-top: 6px; color: var(--muted); font-size: 14px; }
.button { display: grid; place-items: center; width: 100%; min-height: 48px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 24px; background: var(--surface); box-shadow: var(--shadow); color: var(--accent); text-align: center; font-weight: 700; }
.primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.column { display: grid; gap: 12px; margin-top: 14px; }
.stepper { display: grid; grid-template-columns: repeat(auto-fit, minmax(35px, 1fr)); gap: 5px; }
.stepper a { display: grid; place-items: center; min-height: 42px; border-radius: 22px; background: var(--soft); color: var(--accent); }
.empty { margin-top: 16px; text-align: center; }
.empty img { display: block; width: min(190px, 65%); height: 175px; margin: 0 auto 10px; object-fit: contain; }
.empty h2, dialog h2 { font-size: clamp(23px, 7vw, 28px); }
.empty p { margin: 20px 10px; color: var(--muted); font-size: 14px; }
details summary { cursor: pointer; }
details p { margin-top: 9px; }
#tabs:not([hidden]) { position: fixed; z-index: 1; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; width: min(calc(100% - 24px),456px); padding: 6px; border: 1px solid var(--border); border-radius: 32px; background: var(--surface); box-shadow: var(--shadow); }
#tabs :is(a, button) { display: grid; place-items: center; min-height: 44px; padding: 0; border: 0; border-radius: 30px; background: transparent; color: var(--muted); }
#tabs .active { background: var(--soft); color: var(--accent); }
dialog { width: min(350px, calc(100% - 32px)); padding: 22px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); color: var(--text); text-align: center; }
dialog::backdrop { background: rgb(35 25 32 / 36%); }
dialog p { margin: 12px 0 20px; color: var(--muted); font-size: 14px; }
.bottom-sheet { position: fixed; top: auto; bottom: max(14px, env(safe-area-inset-bottom)); }
.bottom-sheet img { width: 64px; height: 75px; object-fit: contain; margin: 4px auto 12px; }
.bottom-sheet .column { margin-top: 28px; }
.close-sheet { position: absolute; top: 8px; right: 8px; border: 0; box-shadow: none; }
.hero-card { display: grid; grid-template-columns: minmax(0, 1fr) 30%; gap: 12px; min-height: 156px; align-items: center; padding: 16px; margin: 14px 0; color: #fff; background: var(--accent); border-radius: 22px; }
.hero-card small { font-weight: 700; color: #fff; }
.hero-card h2 { margin-top: 8px; font-size: clamp(22px, 7vw, 30px); }
.hero-card p { margin-top: 14px; font-size: 14px; }
.hero-card img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.hero-card .button { grid-column: 1 / -1; }
.score { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; margin: 12px 0; }
.score strong { font: 700 30px/1.2 var(--heading); }
.score small { margin-top: 4px; }
.ring { position: relative; display: grid; place-items: center; width: 68px; height: 68px; flex: none; border-radius: 50%; background: conic-gradient(var(--accent) var(--value),var(--soft) 0); }
.ring b { display: grid; place-items: center; position: relative; width: 54px; height: 54px; border-radius: 50%; background: var(--surface); font-size: 14px; }
.stat-row { display: grid; min-height: 62px; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 8px 0; padding: 8px 12px; font-size: 14px; }
.stat-row img { width: 38px; height: 38px; object-fit: contain; }
.stat-row small { margin-top: 3px; }
.stat-row > strong { font-size: 12px; color: var(--accent); }
.grid .stat-row { grid-template-columns: 32px minmax(0, 1fr); height: 100%; margin: 0; padding: 8px; }
.grid .stat-row img { width: 32px; height: 32px; }
.grid .stat-row > strong { display: none; }
.panel { margin: 12px 0; padding: 14px; }
.bar-chart { display: flex; gap: 6px; min-height: 95px; margin-top: 10px; }
.bar-chart > div { flex: 1; display: grid; align-items: end; justify-items: center; grid-template-rows: 1fr 18px; min-width: 0; }
.bar-chart .bar { display: block; width: min(28px, 85%); min-height: 1px; height: var(--height); background: var(--accent); border-radius: 4px 4px 0 0; }
.compact { min-height: 96px; }
.month-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: center; }
.month-head b::first-letter { text-transform: uppercase; }
.calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 12px; gap: 4px; }
.calendar > * { display: grid; place-items: center; min-width: 0; height: 34px; border-radius: 12px; font-size: 12px; }
.calendar .played { background: var(--accent); color: #fff; font-weight: 700; }
.stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats .panel { padding: 8px; text-align: center; }
.stats b { font: 700 22px/1.1 var(--heading); }
.date { margin-top: 14px; font-size: 16px; }
.center { text-align: center; }
.leaderboard { list-style: none; display: grid; gap: 6px; padding: 0; margin: 8px 0 14px; }
.leaderboard li { display: grid; grid-template-columns: 30px 1fr auto; gap: 8px; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 12px; background: var(--surface); font-size: 14px; }
.leaderboard li span:first-child { color: var(--accent); font-weight: 700; }
.leaderboard .mine { background: var(--soft); font-weight: 700; }
.award { display: grid; align-content: start; gap: 6px; padding: 12px; }
.award img, .award-hero img { width: 44px; height: 44px; object-fit: contain; }
.award h2 { font-size: 18px; }
.award b { color: var(--accent); font-size: 12px; }
.award b.earned { color: #18724a; }
.award-hero img { width: 86px; height: 86px; }
.preview-links { margin: 14px 0; color: var(--muted); font-size: 12px; }
.preview-links a { display: inline-block; padding: 8px; text-decoration: underline; }

/* A10: proportions from the Burgundy progress overview. */
#screen[data-screen="A10"] > h1 { font-size:30px; line-height:38px; }
#screen[data-screen="A10"] .hero-card { min-height:223px; margin:8px 0; padding:17px 13px 16px 17px; grid-template-columns:minmax(0,1fr) 122px; gap:8px; }
#screen[data-screen="A10"] .hero-card h2 { font-size:28px; line-height:36px; }
#screen[data-screen="A10"] .hero-card p { margin-top:6px; }
#screen[data-screen="A10"] .hero-card img { width:122px; height:118px; }
#screen[data-screen="A10"] .hero-card .button { min-height:44px; box-shadow:none; }
#screen[data-screen="A10"] .score { min-height:131px; margin:8px 0; }
#screen[data-screen="A10"] .score strong { font-size:32px; }
#screen[data-screen="A10"] .ring { width:78px; height:78px; }
#screen[data-screen="A10"] .ring b { width:62px; height:62px; font-size:18px; }
#screen[data-screen="A10"] .grid .stat-row { min-height:86px; align-items:start; padding:12px 11px; }
#screen[data-screen="A10"] .grid .stat-row b { font:700 14px/18px var(--heading); }
#screen[data-screen="A10"] .grid .stat-row small { margin-top:17px; }
#screen[data-screen="A10"] > .stat-row { min-height:67px; }
/* Local progress states follow the proportions of the selected phone screens. */
#screen[data-screen="B04.04"] .segments, #screen[data-screen="B17"] .segments, #screen[data-screen="B13"] .hero-card { margin-top: 38px; }
#screen[data-screen="B04.04"] .stat-row { min-height:67px; }
#screen[data-screen="B04.07"] .date { font-size:20px; }
#screen[data-screen="B17"] .calendar > * { height:34px; }
#screen[data-screen="B04.02"] .limited-icon { display:grid; place-items:center; width:84px; height:84px; margin:48px auto 42px; border-radius:24px; color:var(--accent); background:var(--soft); }
#screen[data-screen="B04.02"] .limited-icon .icon { width:32px; height:32px; }
#screen[data-screen="B04.02"] .stat-row { min-height:55px; }
#screen[data-screen="B04.03"] .subtitle { margin-top:30px; }
#screen[data-screen="B04.03"] .empty { margin-top:30px; }
#screen[data-screen="B04.03"] .stat-row { min-height:55px; }
#screen[data-screen="A12"] .empty { margin-top:35px; }
#screen[data-screen="A12"] .empty h2 { margin-top:18px; }
#screen[data-screen="A12"] .empty p { margin:38px 10px 20px; }
#screen[data-screen="B18"] .empty { margin-top:30px; }
#screen[data-screen="B18"] .soft { min-height:90px; margin-top:8px; padding:16px; }
#screen[data-screen="B18"] .soft p { color:var(--muted); font-size:14px; }
#screen[data-screen="B13"] .hero-card { min-height:183px; }
#screen[data-screen="B04.08"] .award, #screen[data-screen="B04.09"] .award { min-height:137px; }
#screen[data-screen="B16"] .hero-card { min-height:184px; }
#screen[data-screen="B16"] .hero-card p { margin-top:34px; }
#screen[data-screen="A14"] .score, #screen[data-screen="B04.05"] .score { min-height:131px; }
#screen[data-screen="A14"] .ring, #screen[data-screen="B04.05"] .ring { width:78px; height:78px; }
#screen[data-screen="A14"] .ring b, #screen[data-screen="B04.05"] .ring b { width:62px; height:62px; font-size:18px; }
#screen[data-screen="A14"] .hero { min-height:126px; }
:root[data-theme="burgundy"] body[data-section="progress"] { --bg:#f8f7f5; --surface:#fff; --text:#24282d; --muted:#62666a; --accent:#752b40; --soft:#f2eeeb; --border:#ddd6d3; }
.row-icon { display:grid; place-items:center; width:36px; height:36px; border-radius:12px; background:var(--soft); color:var(--accent); }
.row-icon img { width:26px; height:26px; }
#screen[data-screen="B04.08"] .segments, #screen[data-screen="B04.09"] .segments { margin-top:0; }
#screen[data-screen="B04.08"] .grid, #screen[data-screen="B04.09"] .grid { align-items:start; }
.bottom-sheet { bottom: max(34px, env(safe-area-inset-bottom)); min-height:339px; padding:24px; }
.bottom-sheet .award-hero img { width:86px; height:86px; margin:0 auto 18px; }
.bottom-sheet p { margin:40px 0 30px; }
.bottom-sheet .close-sheet { min-width:36px; min-height:36px; width:36px; height:36px; border:0; box-shadow:none; }
#screen[data-screen="A12"] .empty img { height:135px; }
#screen[data-screen="B13"] .hero-card { align-items:start; padding:17px; }
#screen[data-screen="B13"] .hero-card img { width:110px; height:110px; align-self:center; }
#screen[data-screen="B13"] .hero-card p { margin-top:36px; }
#screen[data-screen="B13"] .soft { font-size:14px; }
#screen[data-screen="B13"] .soft p { color:var(--muted); font-size:12px; line-height:16px; }
#screen:is([data-screen="B04.08"],[data-screen="B04.09"]) .grid:has(.award:nth-child(6)) { grid-template-rows:repeat(3,137px); }
#screen:is([data-screen="B04.08"],[data-screen="B04.09"]) .grid:has(.award:nth-child(6)) .award:nth-child(4) { transform:translateY(10px); }
#screen:is([data-screen="B04.08"],[data-screen="B04.09"]) .grid:has(.award:nth-child(6)) .award:nth-child(6) { transform:translateY(18px); }
#tabs:not([hidden]) { bottom:calc(34px + env(safe-area-inset-bottom)); }
#screen:is([data-screen="B04.08"],[data-screen="B04.09"]) .award h2 { font-size:16px; }
.award-symbol { font-size:30px; line-height:1; font-weight:700; }
#screen:is([data-screen="B04.08"],[data-screen="B04.09"]) .grid:has(.award:nth-child(6)) .award:nth-child(6) { transform:translateY(25px); }
@media (max-width:360px) {
  #screen:is([data-screen="B04.08"],[data-screen="B04.09"]) .grid:has(.award:nth-child(6)) { grid-template-rows:none; }
  #screen:is([data-screen="B04.08"],[data-screen="B04.09"]) .grid:has(.award:nth-child(6)) .award { transform:none; }
}
