@font-face { font-family: "Blint Display"; src: url("fonts/secular-one-hebrew.woff2") format("woff2"); font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Blint Display"; src: url("fonts/secular-one-latin.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Blint Body"; src: url("fonts/assistant-hebrew.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F; }
@font-face { font-family: "Blint Body"; src: url("fonts/assistant-latin.woff2") format("woff2"); font-weight: 200 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Blint Mono"; src: url("fonts/jetbrains-mono-latin.woff2") format("woff2"); font-weight: 100 800; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* Design system B, "Navy Night": deep navy surfaces with silver hairlines, the logo's gold (#FFAC42) as the one
   accent, green and red only when they mean something. Gold may glow only for an insight or a focus ring. The
   BlintCurl (a gold rule that rolls up into a spiral, from the logo) marks the active tab and the end of progress. */
:root {
  color-scheme: dark;
  --bg: #0D1424; --surface: #141F34; --raised: #1B2942; --panel: #141F34; --line: #26344F; --line-2: #33425E;
  --ink: #F3F4F6; --text-2: #C9CED7; --muted: #929CAD; --navy: #1B2A4A; --silver: #BFC5CE;
  --accent: #FFAC42; --accent-hi: #FFBD66; --accent-ink: #111827; --good: #58A67D; --bad: #D66565; --amber: #FFAC42;
  --r-sm: 8px; --r-md: 10px; --r-lg: 14px; --ease: cubic-bezier(.2, .8, .2, 1);
  --f-head: Manrope, "Blint Display", "Segoe UI", sans-serif; --f-body: Inter, "Blint Body", "Segoe UI", sans-serif;
  --f-num: "Space Grotesk", "Blint Mono", ui-monospace, monospace;
  --curl: url("icons/curl.svg");
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; flex-direction: column;
  background: var(--bg); color: var(--ink);
  font: 14px/1.6 var(--f-body);
}
[hidden] { display: none !important; }
p { margin: 0; }
.muted { color: var(--muted); margin: 0; }
.error { color: var(--bad); margin: 0; font-weight: 600; }
h2 { margin: 0; font: 700 17px/1.3 var(--f-head); color: var(--ink); letter-spacing: -.1px; }

/* ---------- header: identity, then the three places ---------- */
header { position: sticky; top: 0; z-index: 2; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  padding: 0 max(16px, calc((100% - 1080px) / 2)); display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); min-height: 64px; }
.top { display: flex; align-items: center; justify-content: space-between; }
header .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; flex: none; }
header .brand img { border-radius: 8px; }
header b { font: 800 18px/1 var(--f-head); letter-spacing: -.2px; }
.icon { font: inherit; font-size: 17px; line-height: 1; width: 34px; height: 34px; border-radius: var(--r-sm); border: 0; background: none; color: var(--muted);
  cursor: pointer; display: grid; place-items: center; transition: background .15s, color .15s; }
.icon:hover, .icon[aria-pressed="true"] { background: var(--panel); color: var(--ink); }
nav.tabs { display: flex; gap: 4px; flex: 1; justify-content: center; align-self: stretch; }
.tab { font: 600 14px/1 var(--f-body); flex: none; border: 0; background: none; color: var(--muted); cursor: pointer;
  padding: 0 14px; position: relative; transition: color .15s; white-space: nowrap; }
.tab:hover { color: var(--text-2); }
.tab[aria-pressed="true"] { color: var(--ink); }
.tab[aria-pressed="true"]::after { content: ""; position: absolute; inset-inline: 10%; bottom: -6px; height: 12px;
  background: linear-gradient(var(--accent), var(--accent)) left center / calc(100% - 11px) 2px no-repeat, var(--curl) right center / 12px 12px no-repeat; }
[dir="rtl"] .tab[aria-pressed="true"]::after { transform: scaleX(-1); }
.tab .n { display: inline-block; min-width: 18px; margin-inline-start: 6px; padding: 2px 5px; border-radius: 999px; font-size: 11px;
  background: var(--accent); color: var(--accent-ink); }

/* ---------- controls ---------- */
.btn {
  font: 600 14px/1.15 var(--f-body); border: 0; border-radius: var(--r-md); min-height: 42px; padding: 10px 18px;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; align-self: flex-start;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .28); transition: background .12s, transform .12s var(--ease), box-shadow .12s;
}
.btn:hover { background: var(--accent-hi); transform: translateY(-1px); box-shadow: 0 6px 14px rgba(0, 0, 0, .34); }
.btn:active { transform: translateY(0); box-shadow: 0 2px 5px rgba(0, 0, 0, .3); }
.btn:disabled { opacity: .45; cursor: default; transform: none; box-shadow: none; }
.ghost { font: 600 13.5px/1.15 var(--f-body); border: 1px solid var(--line-2); border-radius: var(--r-md); min-height: 40px; padding: 9px 14px;
  background: var(--raised); color: var(--ink); cursor: pointer; transition: border-color .12s, background .12s, transform .12s var(--ease); }
.ghost:hover { border-color: var(--silver); transform: translateY(-1px); }
.link { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 172, 66, .4); }
code {
  direction: ltr; unicode-bidi: isolate; display: block; white-space: pre-wrap; word-break: break-all;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font: 12.5px/1.5 "Blint Mono", Consolas, monospace;
}
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row .muted { margin-inline-start: auto; font-size: 12.5px; }

/* ---------- surfaces ---------- */
form, main, #profile, #puzzles { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
main:empty { display: none; }
iframe { flex: 1; width: 100%; border: 0; }
body:not([data-view="game"]) #status, body:not([data-view="game"]) #report { display: none; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.eyebrow { font: 700 12px/1 "Blint Body", "Segoe UI", sans-serif; color: var(--accent); display: inline-flex; align-items: center; }
[dir="ltr"] .eyebrow { font: 600 11px/1 "Blint Mono", Consolas, monospace; letter-spacing: .1em; text-transform: uppercase; }

/* the game view: the empty state is a calm card */
main { gap: 10px; }
main > p:first-child:not(.error) { color: var(--text-2); }

/* ---------- settings ---------- */
form { gap: 14px; border-bottom: 1px solid var(--line); background: var(--surface); }
form .field { display: flex; flex-direction: column; gap: 6px; }
label { font-weight: 600; font-size: 13px; color: var(--text-2); }
input, select {
  font: inherit; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink);
}
.check { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--ink); font-size: 14px; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }

/* ---------- profile ---------- */
.focus { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.focus p { color: var(--ink); font-size: 15px; }
.spots { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.spot-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.spot-head b { font-weight: 600; color: var(--ink); }
.spots .muted { font-size: 12.5px; }
.bar { height: 4px; border-radius: 2px; background: var(--line); margin: 6px 0 4px; }
.bar i { display: block; height: 100%; background: color-mix(in srgb, var(--bad) 70%, transparent); border-radius: 2px; }
.chip { font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.chip.better { background: color-mix(in srgb, var(--good) 15%, transparent); color: var(--good); }
.chip.worse { background: color-mix(in srgb, var(--bad) 15%, transparent); color: var(--bad); }
.insights { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); font-size: 13.5px; }
.insights li::marker { color: var(--muted); }
.building { display: flex; align-items: center; gap: 10px; }
.build { display: flex; flex-direction: column; gap: 8px; padding: 4px 2px 8px; }
.build .muted { font-size: 12.5px; }

/* the week */
.week ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; color: var(--text-2); }
.week li { padding-inline-start: 22px; position: relative; }
.week li::before { position: absolute; inset-inline-start: 0; font-weight: 700; color: var(--muted); }
.week li.games::before { content: "♞"; color: var(--accent); }
.week li.better::before { content: "↑"; color: var(--good); }
.week li.still::before { content: "↻"; color: var(--bad); }
.week li.puzzles::before { content: "✓"; color: var(--good); }
.week li.missions::before { content: "★"; color: var(--amber); }
.week li.next::before { content: "→"; color: var(--accent); }
.week li.next { color: var(--ink); }
.week li.quiet::before { content: "·"; }
[dir="rtl"] .week li.next::before { content: "←"; }

/* your clock */
.tbar { display: grid; grid-template-columns: 7.5em 1fr auto; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.tbar .track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .06); overflow: hidden; }
.tbar i { display: block; height: 100%; border-radius: 3px; }
.tbar i.usual { background: color-mix(in srgb, var(--ink) 55%, transparent); } .tbar i.mistake { background: color-mix(in srgb, var(--bad) 75%, transparent); }
.tbar b { font: 600 12.5px/1 "Blint Mono", "Blint Body", Consolas, monospace; color: var(--ink); text-align: end; white-space: nowrap; min-width: 4.5em; }

/* Blint's wardrobe */
.wardrobe { display: flex; gap: 14px; align-items: center; }
.wardrobe ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; flex: 1; min-width: 0; }
.wardrobe li { display: flex; flex-direction: column; opacity: .55; font-size: 13.5px; }
.wardrobe li b { font-weight: 600; }
.wardrobe li .muted { font-size: 12.5px; }
.wardrobe li.earned { opacity: 1; }
.wardrobe li.earned b { color: var(--good); }

/* ---------- puzzles ---------- */
#puzzles { position: relative; }
.pz-head { display: flex; align-items: flex-end; gap: 10px; }
.pz-head .bubble { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 10px 14px; color: var(--ink); }
.pz-head .bubble b { font: 400 16px/1.3 "Blint Display", "Segoe UI", sans-serif; display: block; margin-bottom: 2px; }
.pz-head small { color: var(--muted); display: flex; align-items: center; font-size: 12px; margin-bottom: 2px; }
.pz-board { position: relative; width: 100%; max-width: 380px; aspect-ratio: 1; align-self: center; direction: ltr;
  container-type: inline-size; display: grid; grid-template-columns: repeat(8, 1fr); grid-template-rows: repeat(8, 1fr);
  border-radius: var(--r-sm); overflow: hidden; box-shadow: 0 0 0 1px var(--line-2), 0 12px 30px rgba(0, 0, 0, .35); }
.pz-board button { border: 0; padding: 0; margin: 0; display: grid; place-items: center; cursor: pointer;
  font: normal 10.5cqw/1 "Segoe UI Symbol", "Noto Sans Symbols 2", serif; }
.pz-board .l { background: #D8D2C7; } .pz-board .d { background: #34425C; }
.pz-board .w { color: #fbfbf8; text-shadow: 0 0 1px #111, 0 0 1px #111, 0 1px 1px #111; } .pz-board .b { color: #10151a; }
.pz-board .sel { box-shadow: inset 0 0 0 3px var(--amber); }
.pz-board .wrong { box-shadow: inset 0 0 0 3px var(--bad); }
.pz-board svg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.pz-fb { border-radius: var(--r-md); padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text-2); }
.pz-fb.good { border-color: color-mix(in srgb, var(--good) 45%, transparent); color: var(--ink); }
#puzzles > .muted { font-size: 12.5px; }

/* symbols */
.sigil { flex: none; overflow: visible; vertical-align: -.2em; margin-inline-end: 6px; color: var(--accent); }
.spot-head b, .eyebrow { display: inline-flex; align-items: center; }
.spots .sigil { color: var(--muted); }

/* gold: a puzzle solved (twice, then still) */
.pz-fb.gold { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--amber) 60%, transparent); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); color: var(--ink); }
.pz-fb.gold::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 230, 160, .22) 50%, transparent 70%);
  transform: translateX(-120%); animation: sheen 2.8s ease-in-out 2 .3s; }
@keyframes sheen { 60%, 100% { transform: translateX(120%); } }
.confetti { position: absolute; width: 6px; height: 7px; border-radius: 2px; pointer-events: none; z-index: 5;
  animation: fly .9s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes fly { 0% { opacity: 1; transform: translate(-50%, -50%); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(220deg); } }
@media (prefers-reduced-motion: reduce) { .spinner, .pz-fb.gold::after, .confetti, .btn { animation: none !important; transition: none !important; } }

/* ---------- flash drills ---------- */
#flash { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.fl-top { display: flex; align-items: center; gap: 10px; }
.fl-timer { flex: 1; height: 4px; border-radius: 2px; background: var(--panel); overflow: hidden; position: relative; }
.fl-timer::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: left; animation: fltime var(--pace, 10s) linear forwards; }
[dir="rtl"] .fl-timer::after { transform-origin: right; }
@keyframes fltime { to { transform: scaleX(0); } }
.fl-q { font-weight: 700; font-size: 16px; color: var(--ink); }
.fl-board .pc { display: block; transition: opacity .25s; }
.fl-board.gone .pc { opacity: 0; }
.fl-board .pc.ghost { opacity: .2; }
.fl-board .danger { box-shadow: inset 0 0 0 3px var(--bad); }
.fl-board .move { background-image: linear-gradient(rgba(255, 255, 51, .38), rgba(255, 255, 51, .38)); }
.fl-board .ok { box-shadow: inset 0 0 0 4px var(--good); }
.fl-board .covered { box-shadow: inset 0 0 0 3px var(--good); }
.fl-board .hit { box-shadow: inset 0 0 0 3px var(--amber); }
.fl-stats { display: flex; gap: 22px; }
.fl-stats div { display: flex; flex-direction: column; }
.fl-stats b { font: 400 24px/1.1 "Blint Display", "Segoe UI", sans-serif; color: #fff; }
.fl-stats span { color: var(--muted); font-size: 12.5px; }
.fl-hl { margin-top: 6px; }
.fl-hist { display: flex; align-items: flex-end; gap: 4px; height: 56px; direction: ltr; }
.fl-hist i { flex: 1; background: var(--accent); border-radius: 2px 2px 0 0; }
@media (prefers-reduced-motion: reduce) { .fl-board .pc { transition: none; } }
.fl-pl { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.fl-pace { display: flex; gap: 6px; flex-wrap: wrap; }
.fl-pace button { flex: 1; min-height: 34px; padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line-2);
  background: transparent; color: var(--text-2); font: inherit; font-size: 13px; cursor: pointer; white-space: nowrap; }
.fl-pace button[aria-checked="true"] { border-color: var(--accent); color: var(--ink); background: rgba(164, 154, 212, .14); font-weight: 700; }
.fl-ph { font-size: 12px; margin-bottom: 4px; }
.fl-res { display: block; font-size: 13px; color: var(--muted); }
.pz-fb.good .fl-res { color: var(--good); }
.fl-name { font: 400 18px/1.35 "Blint Display", "Segoe UI", sans-serif; color: #fff; margin: 2px 0 4px; }

/* ---------- the atlas ---------- */
.pats { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.pat { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.thumb { display: grid; grid-template-columns: repeat(8, 12px); grid-template-rows: repeat(8, 12px); direction: ltr;
  border-radius: 4px; overflow: hidden; box-shadow: 0 0 0 1px var(--line-2); }
.thumb i { display: grid; place-items: center; font: normal 11px/1 "Segoe UI Symbol", "Noto Sans Symbols 2", serif; font-style: normal; }
.thumb .l { background: #D8D2C7; } .thumb .d { background: #34425C; } .thumb .pcs { width: 100%; height: 100%; }
.thumb .w { color: #fbfbf8; text-shadow: 0 0 1px #111, 0 0 1px #111; } .thumb .b { color: #10151a; }
.thumb .mv { background: color-mix(in srgb, #FFAC42 45%, #D8D2C7); } .thumb .d.mv { background: color-mix(in srgb, #FFAC42 40%, #34425C); }
.thumb .dg { box-shadow: inset 0 0 0 1.5px var(--bad); }
.pinfo { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pinfo b { font-weight: 700; color: var(--ink); line-height: 1.3; }
.pinfo .muted { font-size: 12.5px; }
.known { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.rec { width: 56px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .08); overflow: hidden; direction: ltr; }
.rec i { display: block; height: 100%; background: var(--good); border-radius: 2px; }
.pat .ghost { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.pats-more { margin-top: 12px; }
.pats-more summary { cursor: pointer; color: var(--text-2); font-size: 13px; list-style: none; }
.pats-more summary::-webkit-details-marker { display: none; }
.pats-more summary::before { content: "+ "; }
.pats-more[open] summary::before { content: "− "; }
.pats-more .pats { margin-top: 12px; }
.fl-board .sel { box-shadow: inset 0 0 0 3px var(--accent); }
.fl-q:empty { display: none; }

/* the learning receipt and the transfer line */
.receipt { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.receipt li { display: flex; flex-direction: column; gap: 3px; }
.receipt b { font-weight: 700; color: var(--ink); }
.marks { font-size: 13px; letter-spacing: 1px; color: var(--text-2); }
.marks i { font-style: normal; display: inline-block; width: 1.1em; text-align: center; }
.marks i.y { color: var(--good); }
.marks i.n { color: var(--bad); }
.tr-sum { font-size: 13px; margin: 4px 0 10px; }

/* tab icons: the line icon in the tab's colour, its curl in gold */
.tab .ti { display: inline-flex; margin-inline-end: 6px; vertical-align: -.22em; }
.tab .ti .sigil { margin: 0; color: currentColor; }
#settingsBtn .sigil { margin: 0; color: var(--muted); }


/* ---------- design system B: pieces, tiles, the curl ---------- */
.pcs { width: 88%; height: 88%; display: block; }
.fl-board .pc { display: grid; place-items: center; width: 100%; height: 100%; }
.tab img.ti { width: 22px; height: 22px; border-radius: 6px; margin-inline-end: 6px; vertical-align: -.35em; }
.bar i, .rec i { position: relative; }
.bar i::after, .rec i::after { content: ""; position: absolute; inset-inline-end: -9px; top: 50%; width: 12px; height: 12px; transform: translateY(-50%); background: var(--curl) center / contain no-repeat; }
[dir="rtl"] .bar i::after, [dir="rtl"] .rec i::after { transform: translateY(-50%) scaleX(-1); }
.card { background: var(--surface); }
.card.focus { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 0 0 1px rgba(255, 172, 66, .14), 0 8px 22px rgba(255, 172, 66, .10); }
h3, .fl-name, .q { font-family: var(--f-head); }
.num, .fl-top .muted, .stat b, .count { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
/* the SVG pieces must not size the board: fixed 8x8 tracks, cells that never grow */
.pz-board { grid-template-columns: repeat(8, minmax(0, 1fr)); grid-template-rows: repeat(8, minmax(0, 1fr)); }
.pz-board > button, .pz-board > i { min-width: 0; min-height: 0; overflow: hidden; position: relative; }
.fl-board .pc { position: absolute; inset: 0; display: grid; place-items: center; width: auto; height: auto; }
.fl-board .pc .pcs, .pz-board > button > .pcs, .pz-board > i > .pcs { width: 88%; height: 88%; }


/* ---------- home: the welcome and the player's games ---------- */
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; padding: 22px 6px 8px; }
.welcome .spinner { margin-top: 30px; }
.wl-logo { width: 96px; height: 96px; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .45)); }
.welcome h1 { margin: 4px 0 0; font: 800 25px/1.15 var(--f-head); letter-spacing: -.4px; color: var(--ink); }
.wl-sub { margin: 0; max-width: 30ch; color: var(--text-2); }
.wl-card { width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 10px; padding: 18px; margin-top: 6px; text-align: start; }
.wl-card p { margin: 0; }
.wl-name { font: 800 22px/1.2 var(--f-head); color: var(--accent); text-align: start; }
.wl-card label { font-weight: 600; color: var(--text-2); }
.wl-card input { font: 500 16px/1.2 var(--f-body); padding: 12px 14px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--bg); color: var(--ink); }
.wl-card input:focus { border-color: var(--accent); }
.btn.wl-go { align-self: stretch; min-height: 48px; font-size: 15.5px; }
.linkish { background: none; border: 0; color: var(--muted); font: 500 13px/1 var(--f-body); cursor: pointer; padding: 6px; }
.linkish:hover { color: var(--ink); text-decoration: underline; }
.wl-fine { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); max-width: 34ch; }

.home { display: flex; flex-direction: column; gap: 12px; }
.home > .spinner { margin: 30px auto; }
.spot { display: flex; flex-direction: column; gap: 8px; }
.spot.wait { flex-direction: row; align-items: center; gap: 12px; }
.spot.wait p { margin: 0; }
.spot-q { margin: 0; font: 700 15.5px/1.35 var(--f-head); color: var(--ink); }
.spot-row { display: flex; align-items: flex-end; gap: 14px; }
.pz-board.spot-board { width: 148px; flex: none; pointer-events: none; border-radius: 6px; overflow: hidden; }
.spot-row .btn { margin-inline-start: auto; }
.home-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 4px; }
.home-head h2 { display: flex; align-items: center; gap: 6px; }
.home-head .num { font-size: 12.5px; }
.home .bar { margin: 0; }
.games { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gm { width: 100%; display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; text-align: start; cursor: pointer; transition: border-color .12s, transform .12s var(--ease), background .12s; }
.gm:hover { border-color: var(--line-2); background: var(--raised); transform: translateY(-1px); }
.res { flex: none; min-width: 44px; text-align: center; font: 700 11.5px/1 var(--f-body); letter-spacing: .3px; text-transform: uppercase; padding: 6px 7px; border-radius: 6px; }
.res.win { background: color-mix(in srgb, var(--good) 20%, transparent); color: #8fd1ad; }
.res.loss { background: color-mix(in srgb, var(--bad) 20%, transparent); color: #eb9a9a; }
.res.draw { background: var(--raised); color: var(--silver); }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who b { font-weight: 600; }
.who .num { font-size: 12.5px; margin-inline-start: 4px; }
.who small { font-size: 12px; }
.st { flex: none; font-size: 12.5px; color: var(--text-2); }
.st.clean { color: var(--good); }
.st.bad { color: var(--accent); }
.st.pending { color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.st .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); animation: blink 1.2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .25; } }
.ghost.more { align-self: center; }
.home .small { font-size: 12.5px; text-align: center; margin: 4px 0 0; }
.back { background: none; border: 0; color: var(--text-2); font: 600 13px/1 var(--f-body); cursor: pointer; padding: 4px 0 10px; display: inline-flex; gap: 6px; }
.back:hover { color: var(--ink); }
[dir="rtl"] .back .arr { display: inline-block; transform: scaleX(-1); }
@media (prefers-reduced-motion: reduce) { .st .dot { animation: none; } }


/* ---------- the web app: a page, not a panel ---------- */
#settingsBtn { flex: none; }
form#settings, main, #profile, #puzzles, #flash { width: 100%; max-width: 760px; margin-inline: auto; padding: 24px 16px; }
form#settings { border-bottom: 1px solid var(--line); }
body[data-view="game"] main { max-width: 1080px; }
main:has(.welcome) { max-width: 560px; padding-top: 48px; }
.welcome h1 { font-size: 34px; }
.wl-logo { width: 120px; height: 120px; }
iframe#report { width: 100%; max-width: 1080px; margin-inline: auto; min-height: calc(100vh - 140px); }
@media (min-width: 900px) {
  .home { display: grid; grid-template-columns: 340px 1fr; grid-template-areas: "spot head" "spot bar" "spot list" "spot more" "spot link"; column-gap: 28px; align-items: start; }
  .home > .spot { grid-area: spot; position: sticky; top: 88px; }
  .home > .home-head { grid-area: head; margin-top: 0; }
  .home > .bar { grid-area: bar; }
  .home > .games { grid-area: list; }
  .home > .more { grid-area: more; }
  .home > .link-form { grid-area: link; }
  .home .spot-row { flex-direction: column; align-items: stretch; }
  .home .pz-board.spot-board { width: 100%; }
  .home .spot-row .btn { margin: 0; align-self: stretch; }
}
.link-form { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; padding-top: 16px; border-top: 1px solid var(--line); }
.link-form label { font-size: 13px; color: var(--muted); }
.link-form .row { flex-wrap: nowrap; }
.link-form input { flex: 1; min-width: 0; font: 500 14px/1.2 var(--f-body); padding: 10px 12px; border-radius: var(--r-md); border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); }
@media (max-width: 720px) {
  header { flex-wrap: wrap; gap: 0 12px; padding-top: 10px; }
  header .brand { flex: 1; }
  nav.tabs { order: 3; flex-basis: 100%; justify-content: space-between; min-height: 58px; gap: 0; }
  .tab { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px 8px; font-size: 11.5px; }
  .tab img.ti { margin: 0; }
  .tab .n { position: absolute; top: 2px; inset-inline-start: calc(50% + 6px); margin: 0; }
  .tab[aria-pressed="true"]::after { bottom: -6px; }
}


/* ---------- status icons (tiles from the family) instead of text labels ---------- */
img.ic { width: 26px; height: 26px; border-radius: 7px; flex: none; display: inline-block; vertical-align: middle; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); }
img.ic.res { width: 38px; height: 38px; border-radius: 9px; }
img.ic.res.loss { filter: saturate(.85) brightness(.92); }
img.ic.sm { width: 20px; height: 20px; border-radius: 5px; }
img.ic.xs { width: 16px; height: 16px; border-radius: 4px; margin-inline-end: 6px; vertical-align: -3px; }
.gm .meta { display: flex; align-items: center; flex-wrap: wrap; }
.tc { display: inline-flex; align-items: center; gap: 4px; margin-inline-start: 4px; }
.tc img.ic.sm { width: 16px; height: 16px; border-radius: 4px; }
.gm .st { display: inline-flex; align-items: center; gap: 8px; }
.cnt { display: inline-flex; align-items: center; gap: 5px; font: 600 14px/1 var(--f-num); color: var(--text-2); }
.cnt.bad b { color: var(--accent); }
img.ic.spin { animation: blink 1.4s ease-in-out infinite; }
img.ic.trend { width: 22px; height: 22px; border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { img.ic.spin { animation: none; } }
/* The result's tile is tinted (win green, loss red, draw purple: res-*.png); the piece keeps its colours. */
img.ic.res { min-width: 0; padding: 0; background: none; filter: none; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
/* Mistakes and blunders: a thick pink frame around their tile. */
:root { --pink: #F29BC0; }
.cnt img.ic { box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }  /* the tile itself is pink (fill-*.png) */

/* ---------- a page needs page-sized type: the header at the edges, everything a size up on wide screens ---------- */
header { display: grid; grid-template-columns: 1fr auto 1fr; padding: 0 28px; min-height: 72px; gap: 24px; }
header .brand { justify-self: start; gap: 12px; }
header .brand img { width: 36px; height: 36px; }
header b { font-size: 21px; }
#settingsBtn { justify-self: end; width: 42px; height: 42px; }
#settingsBtn svg { width: 24px; height: 24px; }
nav.tabs { gap: 8px; }
.tab { font-size: 16px; padding: 0 16px; }
.tab img.ti { width: 28px; height: 28px; border-radius: 7px; margin-inline-end: 8px; }
.tab .n { font-size: 12px; min-width: 20px; }
/* The content itself: one step up in proportion (type, buttons, cards, boards) on screens wide enough for it. */
@media (min-width: 1000px) {
  form#settings, main, #profile, #puzzles, #flash { zoom: 1.2; }
  /* as big as the screen allows, with the question above and the buttons below still in view */
  #puzzles .pz-board, #flash .pz-board { max-width: min(520px, calc((100vh - 390px) / 1.2)); min-width: 340px; }
}
@media (max-width: 720px) {
  header { display: flex; padding: 10px 16px 0; gap: 0 12px; min-height: 0; }
  .tab { font-size: 11.5px; padding: 6px 2px 8px; }
  .tab img.ti { width: 24px; height: 24px; margin: 0; }
}


/* ---------- which game a position comes from, and the stage centred on the board ---------- */
.src { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; color: var(--text-2); }
.src img.ic.xs { width: 20px; height: 20px; border-radius: 5px; margin: 0; }
.spot .src { font-size: 12.5px; }
/* Flash and puzzles: the question, the board and the buttons share the board's width, in the middle. */
#flash, #puzzles { --bw: 100%; align-items: center; }
#flash > *, #puzzles > * { width: 100%; max-width: var(--bw); }
#flash > .pz-board, #puzzles > .pz-board { max-width: var(--bw); }
@media (min-width: 1000px) {
  #flash, #puzzles { --bw: max(400px, min(560px, calc((100vh - 390px) / 1.2))); }
  #puzzles .pz-board, #flash .pz-board { max-width: min(var(--bw), calc((100vh - 390px) / 1.2)); min-width: 340px; }
}


/* ---------- back to the player's own game ---------- */
.src { flex-wrap: wrap; }
.src-open { margin-inline-start: auto; color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
.src-open:hover { text-decoration: underline; text-underline-offset: 3px; }
.memo { margin: 0; padding: 8px 12px; border-radius: var(--r-md); font-size: 13.5px; color: var(--text-2);
  background: var(--surface); border-inline-start: 3px solid var(--line-2); }
.memo.was-wrong { border-inline-start-color: var(--pink, #F29BC0); }
.memo.was-right { border-inline-start-color: var(--good); }
.memo.first { border-inline-start-color: var(--accent); }
.bubble .memo { padding: 0; background: none; border: 0; font-size: 12.5px; margin: 2px 0 4px; }
.bubble .memo.was-wrong { color: var(--pink, #F29BC0); } .bubble .memo.was-right { color: var(--good); } .bubble .memo.first { color: var(--accent); }

/* ---------- wide screens: the board in the middle, the story on its left, the answer on its right ----------
   The board stays centred on the page and gets the screen's full height; what is above it on a narrow
   screen (which game, last time, Blint's question) moves to the left column, the feedback and buttons
   to the right one. */
@media (min-width: 1200px) {
  #flash, #puzzles { max-width: 1100px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    column-gap: 28px; row-gap: 12px; align-items: start; align-content: start; justify-items: stretch; }
  #flash > *, #puzzles > * { max-width: none; grid-column: 1; }
  #flash > .fl-top, #puzzles > p.muted:first-child { grid-column: 1 / -1; }
  #flash > .pz-board, #puzzles > .pz-board { grid-column: 2; grid-row: 2 / span 6; width: min(560px, calc((100vh - 190px) / 1.2));
    max-width: none; min-width: 340px; }
  #flash > #flFb, #puzzles > #pzFb, #puzzles > #pzRow { grid-column: 3; }
  #flash > #flFb { grid-row: 2; }
  #puzzles > #pzFb { grid-row: 2; }
  #puzzles > #pzRow { grid-row: 3; }
  #flash .fl-q { font-size: 17px; }
  /* Screens that are not a round (the start, the receipt, an empty day) keep one centred column. */
  #flash:not(:has(> .pz-board)), #puzzles:not(:has(> .pz-board)) { display: flex; max-width: 760px; }
}
.src > span { flex: 1 1 0; min-width: 0; }
.src-open { flex-basis: 100%; margin-inline-start: 28px; }


/* ---------- the game row: a BlintChess object, not a list item ----------
   A barely-there navy gradient; a brushed-silver frame (bright at the leading top corner, fading along the
   row, like our icons' edges); a soft inner bevel; the result's colour as a rounded tab tucked into the
   leading edge (inline-start, so it flips in RTL). The gold curl appears once, in the far corner, only
   while the row is hovered. */
.gm {
  --res: var(--line-2);
  position: relative; overflow: hidden; border-radius: 12px; padding: 11px 14px 11px 18px;
  border: 1px solid transparent;
  background:
    linear-gradient(135deg, #141F34 0%, #17243B 100%) padding-box,
    linear-gradient(115deg, rgba(191, 197, 206, .55) 0%, rgba(191, 197, 206, .14) 26%, rgba(191, 197, 206, .06) 60%, rgba(191, 197, 206, .26) 100%) border-box;
  box-shadow: inset 0 1px 0 rgba(191, 197, 206, .08), 0 2px 6px rgba(0, 0, 0, .18);
  transition: transform .12s var(--ease), box-shadow .12s, filter .12s;
}
[dir="rtl"] .gm { padding: 11px 18px 11px 14px; background:
    linear-gradient(225deg, #141F34 0%, #17243B 100%) padding-box,
    linear-gradient(245deg, rgba(191, 197, 206, .55) 0%, rgba(191, 197, 206, .14) 26%, rgba(191, 197, 206, .06) 60%, rgba(191, 197, 206, .26) 100%) border-box; }
.gm::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; width: 4px;
  border-start-end-radius: 4px; border-end-end-radius: 4px; background: var(--res); box-shadow: 0 0 10px color-mix(in srgb, var(--res) 35%, transparent); }
.gm.win { --res: #9CDEAA; }
.gm.loss { --res: #D65C5C; }
.gm.draw { --res: #C4B2F0; }
.gm::after { content: ""; position: absolute; top: 7px; inset-inline-end: 8px; width: 13px; height: 13px;
  background: var(--curl) center / contain no-repeat; opacity: 0; transform: scale(.7); transition: opacity .15s, transform .15s var(--ease); }
[dir="rtl"] .gm::after { transform: scale(.7) scaleX(-1); }
.gm:hover { transform: translateY(-1px); filter: brightness(1.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .09), 0 6px 16px rgba(0, 0, 0, .3); }
.gm:hover::after { opacity: 1; transform: scale(1); }
[dir="rtl"] .gm:hover::after { transform: scaleX(-1); }
.gm:active { transform: translateY(1px); box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25); }
.gm:focus-visible { box-shadow: 0 0 0 3px rgba(255, 172, 66, .4); }


/* ---------- Today | Games | Progress ---------- */
#today { width: 100%; max-width: 760px; margin-inline: auto; padding: 24px 16px; }
#runBar { width: 100%; max-width: 1100px; margin-inline: auto; padding: 18px 16px 0; }
@media (min-width: 1000px) { #today, #runBar { zoom: 1.2; } }
.today { display: flex; flex-direction: column; align-items: stretch; gap: 16px; padding-top: 28px; }
.today > h1, .today > .today-sub { text-align: center; margin: 0; }
.today h1 { font: 800 30px/1.15 var(--f-head); letter-spacing: -.4px; color: var(--ink); }
.today-sub { color: var(--text-2); font-size: 15px; }
.btn.today-go { align-self: stretch; min-height: 58px; font-size: 17px; font-weight: 700; border-radius: 14px; margin: 4px 0 12px;
  box-shadow: 0 10px 26px rgba(255, 172, 66, .20), 0 3px 8px rgba(0, 0, 0, .3); }
.today-wait { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 30px 0; }
.today-wait h1 { font-size: 22px; max-width: 26ch; }
.today .card { display: flex; flex-direction: column; gap: 6px; }
.today-focus b { display: flex; align-items: center; gap: 6px; font: 700 16px/1.3 var(--f-head); color: var(--ink); }
.today-link { color: var(--accent); font-weight: 600; text-decoration: none; align-self: flex-start; }
.today-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.today a.today-moment { flex-direction: row; align-items: center; gap: 16px; color: inherit; text-decoration: none; transition: border-color .12s, transform .12s var(--ease); }
a.today-moment:hover { border-color: var(--line-2); transform: translateY(-1px); }
a.today-moment .pz-board.spot-board { width: 104px; flex: none; }
a.today-moment > div:not(.pz-board) { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.today-face { align-self: center; }
.today-next { justify-content: center; }
.today-next a { text-decoration: none; display: inline-flex; align-items: center; }
.run-top { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.run-track { flex: 1; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.run-track i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .3s var(--ease); }
.run-top .num { color: var(--ink); }
/* games: the archive, one calm column */
body[data-view="game"] main { max-width: 900px; }
@media (min-width: 900px) { .home { display: flex !important; flex-direction: column; } }
/* progress: the rest, folded */
details.more { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 4px 16px; }
details.more > summary { cursor: pointer; padding: 12px 0; color: var(--text-2); font-weight: 600; list-style: none; }
details.more > summary::before { content: "▸ "; color: var(--accent); }
details.more[open] > summary::before { content: "▾ "; }
details.more[open] { padding-bottom: 16px; }
details.more > .card { margin-top: 12px; }
@media (min-width: 900px) { .home { align-items: stretch !important; } }
/* inside a session the flash countdown is a quiet line, not a second progress bar */
body[data-view="train"] .fl-timer { height: 2px; opacity: .55; filter: grayscale(1); }

/* ---------- the metal pieces ---------- */
img.pcs { object-fit: contain; pointer-events: none; user-select: none; }
/* a navy piece on a navy square keeps its edge: a faint silver rim */
img.pcs.pb { filter: drop-shadow(0 0 1px rgba(191, 197, 206, .55)) drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
img.pcs.pw { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
/* the image already keeps its own margin (the king fills 90% of it), so it takes the whole square */
.pz-board > button > img.pcs, .pz-board > i > img.pcs, .fl-board .pc img.pcs, .thumb img.pcs { width: 100%; height: 100%; }


/* ---------- dragging pieces ---------- */
.pz-board { touch-action: none; }
.pz-board > button.w, .pz-board > button.b { cursor: grab; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; cursor: grabbing;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .5)) !important; }
.pz-board .tgt::after { content: ""; position: absolute; inset: 37%; border-radius: 50%; background: rgba(255, 172, 66, .6); pointer-events: none; z-index: 2; }
.pz-board .tgt.capt::after { inset: 5%; background: none; border: 3px solid rgba(255, 172, 66, .7); }
/* the piece in your hand: its square turns light grey and the piece grows a little (back on release) */
.pz-board .sel, .pz-board .held, .fl-board .sel { box-shadow: inset 0 0 0 999px rgba(176, 176, 176, .62); }
.pz-board img.pcs { transition: transform .09s ease-out; }
.pz-board > button.held { overflow: visible; z-index: 4; }
.pz-board .held img.pcs { transform: scale(1.15); }
.pz-board.flipped .held img.pcs { transform: rotate(180deg) scale(1.15); }
/* your own arrows and circles (right-click) */
.pz-board svg.ua { z-index: 5; pointer-events: none; }
.pz-board svg.ua .ua-preview { opacity: .6; }


/* ======================================================================================================
   Material system: one light source (top-left), three elevations, contrast before decoration.
   base   = quiet areas (navigation, folded sections)       raised = controls, the active panel
   card   = the main content (rows, cards, the board's panel)
   Every surface: a brighter top edge, a darker bottom edge, a soft shadow beneath. No nested cards.
   ====================================================================================================== */
:root {
  --bg: #0D1424;
  --s-base: linear-gradient(155deg, #19253B 0%, #141F34 65%, #111B2D 100%);
  --s-card: linear-gradient(145deg, #24334C 0%, #1B2942 48%, #17243A 100%);
  --s-raised: linear-gradient(145deg, #344660 0%, #253550 50%, #1F2E46 100%);
  --e-base: inset 0 1px 0 rgba(255, 255, 255, .035);
  --e-card: inset 0 1px 0 rgba(255, 255, 255, .09), inset 0 -1px 0 rgba(0, 0, 0, .22), 0 2px 4px rgba(0, 0, 0, .18), 0 12px 28px rgba(0, 0, 0, .26);
  --e-raised: inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 -2px 0 rgba(0, 0, 0, .20), 0 3px 6px rgba(0, 0, 0, .24), 0 12px 24px rgba(0, 0, 0, .30);
  --ink: #F0F2F6; --text-2: #AAB5C8; --muted: #8492A8;
}
/* the page: almost black at the edges, a soft light behind the content */
body {
  background:
    radial-gradient(ellipse at 50% 8%, rgba(43, 65, 101, .30) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 100%, rgba(4, 9, 18, .55) 0%, transparent 65%),
    #0A101D fixed;
}
header { background: linear-gradient(180deg, rgba(13, 20, 36, .96), rgba(13, 20, 36, .88)); border-bottom-color: #1E2A40;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 24px rgba(0, 0, 0, .25); }

/* level 2: cards */
.card, .pz-head .bubble, a.today-moment, .wl-card {
  background: var(--s-card); border: 1px solid #35445D; border-radius: 16px; box-shadow: var(--e-card);
}
.card.focus { border-color: #6A5A3A; box-shadow: var(--e-card), 0 0 0 1px rgba(255, 172, 66, .18), 0 10px 30px rgba(255, 172, 66, .10); }
/* level 1: quiet areas */
details.more, .memo { background: var(--s-base); border: 1px solid rgba(115, 137, 169, .14); box-shadow: var(--e-base); }
details.more { border-radius: 14px; }
details.more > .card { box-shadow: none; background: transparent; border: 0; border-top: 1px solid #26344F; border-radius: 0; padding-inline: 0; }

/* section labels: a readable label, not uppercase monospace */
.eyebrow, [dir="ltr"] .eyebrow { font: 600 13px/1.2 var(--f-body); letter-spacing: 0; text-transform: none; color: var(--text-2); gap: 6px; }

/* buttons: the gold one is the main action and looks pressable; the navy one is secondary */
.btn {
  background: linear-gradient(180deg, #FFD078 0%, #FFAC42 55%, #D98625 100%); color: #24180D; border: 1px solid #FFD58C; border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(130, 75, 15, .28), 0 3px 0 #995D21, 0 6px 14px rgba(0, 0, 0, .30);
  transition: transform .16s var(--ease), filter .16s, box-shadow .16s;
}
.btn:hover { background: linear-gradient(180deg, #FFD078 0%, #FFAC42 55%, #D98625 100%); filter: brightness(1.08); transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(130, 75, 15, .28), 0 4px 0 #995D21, 0 8px 18px rgba(0, 0, 0, .32); }
.btn:active { transform: translateY(2px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 1px 0 #995D21, 0 2px 5px rgba(0, 0, 0, .25); }
.btn.today-go { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -2px 0 rgba(130, 75, 15, .28), 0 4px 0 #995D21, 0 12px 28px rgba(255, 172, 66, .18); }
.ghost {
  background: linear-gradient(180deg, #344660, #23334C); color: #E1E6EE; border: 1px solid #52647E; border-radius: 11px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 3px 7px rgba(0, 0, 0, .25);
}
.ghost:hover { border-color: #6E809B; filter: brightness(1.06); }
.ghost:active { transform: translateY(1px); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3); }

/* chips: weight and meaning, not flat pills */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 8px; font-size: 12px; font-weight: 650;
  background: linear-gradient(180deg, #293952, #1D2A40); border: 1px solid #40516B; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 2px 4px rgba(0, 0, 0, .18); }

/* the board: a physical board in a raised frame (the squares fill the inside, the frame is the border) */
.pz-board:not(.spot-board) {
  border: 8px solid transparent; border-radius: 14px;
  background: linear-gradient(145deg, #465875 0%, #263851 35%, #142139 100%) border-box;
  box-shadow: inset 0 2px 3px rgba(255, 255, 255, .20), inset 0 -3px 5px rgba(0, 0, 0, .45), 0 4px 8px rgba(0, 0, 0, .35), 0 18px 36px rgba(0, 0, 0, .35);
  outline: 1px solid #61718A; outline-offset: -1px;
}
.pz-board.spot-board { border: 4px solid #2C3D58; border-radius: 10px; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); }

/* the game row: a substantial object, more air between rows */
.games { gap: 10px; }
.gm {
  background: var(--s-card) padding-box, linear-gradient(115deg, rgba(191, 197, 206, .55) 0%, rgba(191, 197, 206, .16) 26%, rgba(191, 197, 206, .08) 60%, rgba(191, 197, 206, .28) 100%) border-box;
  border-radius: 16px; padding: 14px 18px 14px 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10), inset 0 -1px 0 rgba(0, 0, 0, .25), 0 4px 8px rgba(0, 0, 0, .22), 0 12px 24px rgba(0, 0, 0, .24);
}
[dir="rtl"] .gm { padding: 14px 22px 14px 18px; background: var(--s-card) padding-box, linear-gradient(245deg, rgba(191, 197, 206, .55) 0%, rgba(191, 197, 206, .16) 26%, rgba(191, 197, 206, .08) 60%, rgba(191, 197, 206, .28) 100%) border-box; }
.gm:hover { transform: translateY(-2px); filter: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), 0 6px 12px rgba(0, 0, 0, .28), 0 16px 30px rgba(0, 0, 0, .32); }
.gm .who b { font-size: 15.5px; }
img.ic.res { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .3), 0 3px 8px rgba(0, 0, 0, .45); }

/* the session's progress: one segment per position */
.run-steps { flex: 1; display: flex; gap: 6px; }
.run-steps i { flex: 1; height: 6px; border-radius: 5px; background: #26344B; box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); }
.run-steps i.done { background: linear-gradient(90deg, #D98625, #FFAC42); box-shadow: 0 0 8px rgba(255, 172, 66, .25); }
.run-steps i.now { background: linear-gradient(90deg, #4A5B78, #6A7C99); }
.run-top { padding: 10px 14px; border-radius: 12px; background: var(--s-base); border: 1px solid rgba(115, 137, 169, .14); box-shadow: var(--e-base); }

/* ---------- the game list: the title centred, each row's content centred between the result and the mistakes ---------- */
.home-head { justify-content: center; flex-direction: column; align-items: center; gap: 4px; }
.gm { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: 16px; align-items: center; }
.gm .who { align-items: center; text-align: center; }
.gm .who .meta { justify-content: center; }
.gm .st { justify-self: end; }

/* ======================================================================================================
   The training stage on wide screens (GPT's layout): everything on one vertical axis around the board, so
   the eyes stay near it. Top to bottom: the count, which game, last time, the question, then the board
   with the two answers at its sides (at its middle height), the feedback strip right under it, and one
   consistent spot for Show me / Continue. The feedback and buttons are the same elements as before; the
   grid places them (their containers become transparent to it).
   ====================================================================================================== */
@media (min-width: 1200px) {
  #flash:has(> .pz-board), #puzzles:has(> .pz-board) {
    zoom: 1; max-width: 1140px; display: grid; padding-top: 14px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    grid-template-areas: "top top top" "ctx ctx ctx" "mem mem mem" "q q q" "l b r" "fb fb fb" "act act act";
    column-gap: 24px; row-gap: 10px; justify-items: center; align-items: center;
  }
  #flash:has(> .pz-board) > *, #puzzles:has(> .pz-board) > * { grid-column: auto; grid-row: auto; max-width: none; width: auto; }
  #flash > .fl-top, #puzzles > p.muted:first-child { grid-area: top; width: min(560px, 100%); text-align: center; }
  #flash > .src, #puzzles > .src { grid-area: ctx; justify-content: center; font-size: 14px; }
  #flash > .src > span, #puzzles > .src > span { flex: 0 1 auto; }
  #flash > .src .src-open, #puzzles > .src .src-open { flex-basis: auto; margin-inline-start: 12px; }
  #flash > .memo { grid-area: mem; width: min(560px, 100%); text-align: center; border-inline-start: 0; border-top: 2px solid var(--line-2); }
  #flash > .memo.was-wrong { border-top-color: #B87561; } #flash > .memo.was-right { border-top-color: var(--good); } #flash > .memo.first { border-top-color: var(--accent); }
  #flash > .fl-q { grid-area: q; text-align: center; font-size: 19px; }
  #puzzles > .pz-head { grid-area: q; width: min(620px, 100%); }
  #flash > .pz-board, #puzzles > .pz-board {
    grid-area: b; width: max(360px, min(560px, calc(100vh - 300px))); max-width: none; min-width: 0;
  }
  #puzzles > .pz-board { width: max(360px, min(560px, calc(100vh - 360px))); }
  #flFb { display: contents; }
  #flFb > .pz-fb, #puzzles > #pzFb { grid-area: fb; width: min(560px, 100%); text-align: center; }
  #puzzles > #pzFb:empty, #flFb > .pz-fb:empty { display: none; }
  #flFb > .row, #pzRow { display: contents; }
  #flFb > .row > button, #pzRow > button { min-width: 168px; min-height: 48px; font-size: 15px; }
  #flFb > .row > button:first-of-type:not(:last-of-type), #pzRow > button:first-of-type:not(:last-of-type) { grid-area: l; justify-self: end; }
  #flFb > .row > button:nth-of-type(2), #pzRow > button:nth-of-type(2) { grid-area: r; justify-self: start; }
  #flFb > .row > button:only-of-type, #pzRow > button:only-of-type,
  #flFb > .row > button:nth-of-type(n+3), #pzRow > button:nth-of-type(n+3) { grid-area: act; justify-self: center; }
  #pzRow > span { display: none; }
}

/* ---------- state tiles as metal: an edge in the state's light tone; the row's tab in its main tone ---------- */
img.ic.res { border: 1px solid var(--edge, transparent); }
img.ic.res.win { --edge: #A6D9B7; } img.ic.res.loss { --edge: #E5A4A4; } img.ic.res.draw { --edge: #C7B9E9; }
.cnt img.ic { border: 1px solid #D7A58C; }
.gm.win { --res: #58A67D; } .gm.loss { --res: #D66565; } .gm.draw { --res: #A998D0; }
.gm::before { inset-block: 12px; width: 4px; box-shadow: 0 0 7px color-mix(in srgb, var(--res) 28%, transparent); }
.cnt b { color: #E3B9A0; } .cnt.bad b { color: #E8A07F; }
@media (min-width: 1200px) {
  #flash > .pz-board, #puzzles > .pz-board { width: max(360px, min(580px, calc(100vh - 270px))); }
  body[data-view="train"] #flash > .pz-board, body[data-view="train"] #puzzles > .pz-board { width: max(360px, min(580px, calc(100vh - 320px))); }
}
@media (min-width: 1200px) {
  /* the one action (Continue, Show me, Next) sits where the second answer was, beside the board: always the same spot */
  #flFb > .row > button:only-of-type, #pzRow > button:only-of-type { grid-area: r; justify-self: start; }
  /* room under the board for a short feedback strip */
  #flash > .pz-board, #puzzles > .pz-board { width: max(360px, min(580px, calc(100vh - 330px))); }
  body[data-view="train"] #flash > .pz-board, body[data-view="train"] #puzzles > .pz-board { width: max(360px, min(580px, calc(100vh - 380px))); }
  #flFb > .pz-fb, #puzzles > #pzFb { font-size: 14px; line-height: 1.45; }
}

/* ---------- a pattern row: the action sits next to its board, and the whole row is a target ---------- */
.pat { grid-template-columns: 104px minmax(0, 1fr); gap: 16px; padding: 10px; margin-inline: -10px; border-radius: 14px;
  cursor: pointer; transition: background .15s, box-shadow .15s; }
.pat:hover { background: rgba(255, 255, 255, .035); box-shadow: inset 0 0 0 1px rgba(115, 137, 169, .18); }
.pat .btn.pat-go { align-self: flex-start; margin-top: 8px; min-height: 36px; padding: 7px 18px; font-size: 13.5px; }

/* ---------- the session's progress lives in the top bar while training: the tabs make room for it ---------- */
body[data-view="train"] nav.tabs { display: none; }
header #runBar { grid-column: 2; align-self: center; width: min(640px, 52vw); max-width: none; margin: 0; padding: 0; zoom: 1; }
header #runBar .run-top { padding: 0; background: none; border: 0; box-shadow: none; font-size: 14px; }
@media (max-width: 720px) {
  header #runBar { order: 3; flex-basis: 100%; width: 100%; padding: 10px 0; }
}
@media (min-width: 1200px) {
  #flash > .pz-board, body[data-view="train"] #flash > .pz-board, body[data-view="train"] #puzzles > .pz-board {
    width: max(360px, min(580px, calc(100vh - 330px))); }
}

/* the review sits on the page: no frame, no inner scrollbar, the page's own background */
iframe#report { display: block; flex: none; min-height: 0; height: 80vh; max-width: 1140px; overflow: hidden; background: transparent; color-scheme: dark; }

/* ======================================================================================================
   Training, round 3: the rival's name stands out (result, rival / when / move), headings a size up and
   bolder, the board as large as the screen's height allows, the tools (time limit, play as the rival),
   back to the previous step, and the board that turns round.
   ====================================================================================================== */
.src { gap: 6px 16px; }
.src .sp { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.src .rival { color: var(--accent); font: 800 1.12em/1.2 var(--f-head); letter-spacing: -.1px; }
.src .when { color: var(--muted); }
.src .mv svg { width: 18px; height: 18px; }
.src .mv b { color: var(--ink); font-weight: 700; }
.tools { display: inline-flex; gap: 8px; margin-inline-start: 8px; }
.tool { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 5px 11px; border-radius: 9px; cursor: pointer;
  font: 600 12.5px/1 var(--f-body); color: var(--text-2); background: linear-gradient(180deg, #293952, #1D2A40); border: 1px solid #40516B;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .07), 0 2px 4px rgba(0, 0, 0, .18); }
.tool:hover { color: var(--ink); border-color: #60718B; }
.tool.on { color: #24180D; background: linear-gradient(180deg, #FFD078, #FFAC42 60%, #D98625); border-color: #FFD58C; }
.tool svg { width: 16px; height: 16px; }
.back-step { color: var(--text-2); font-weight: 600; font-size: 14px; padding: 6px 8px; }
.back-step:hover { color: var(--ink); }
.run-top .tool { margin-inline-start: 4px; }

/* headings: bigger and bolder at every stage */
h1 { font-weight: 800; font-size: clamp(28px, 3.2vw, 38px); letter-spacing: -.5px; }
h2 { font-weight: 800; font-size: clamp(21px, 2.2vw, 26px); letter-spacing: -.3px; }
.fl-q, #flQ { font: 800 clamp(20px, 2vw, 26px)/1.25 var(--f-head) !important; letter-spacing: -.3px; color: var(--ink); }
.pz-head .bubble p { font: 700 18px/1.4 var(--f-head); color: var(--ink); }

/* the board turns round: the board rotates, each piece turns back so it stays upright all the way */
.pz-board { transition: transform .7s cubic-bezier(.65, 0, .35, 1); }
.pz-board img.pcs { transition: transform .7s cubic-bezier(.65, 0, .35, 1); }
.pz-board.flipped { transform: rotate(180deg); }
.pz-board.flipped img.pcs { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) { .pz-board, .pz-board img.pcs { transition: none; } }

/* the board as large as the height allows on a laptop: the rows above it are tight */
@media (min-width: 1200px) {
  #flash:has(> .pz-board), #puzzles:has(> .pz-board) { row-gap: 8px; padding-top: 10px; max-width: 1280px; }
  #flash > .memo { padding: 6px 12px; font-size: 13px; }
  #flash > .pz-board, #puzzles > .pz-board,
  body[data-view="train"] #flash > .pz-board, body[data-view="train"] #puzzles > .pz-board { width: max(420px, min(860px, calc(100vh - 250px))); }
  #puzzles > .pz-head { width: min(760px, 100%); }
}
.src .sp { flex-direction: row; text-align: start; }
.src .sp img.ic.xs { display: block; width: 24px; height: 24px; border-radius: 6px; }
@media (min-width: 1200px) {
  #puzzles > .pz-board, body[data-view="train"] #puzzles > .pz-board { width: max(420px, min(860px, calc(100vh - 330px))); }
}

/* ---------- the account, in Settings ---------- */
.account { margin-top: 22px; padding-top: 18px; border-top: 1px solid rgba(190, 205, 225, .12); display: flex; flex-direction: column; gap: 10px; }
.account h3 { margin: 0; font: 800 18px/1.3 var(--f-head); color: var(--ink); }
.acc-who { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.acc-mail { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-mail input { flex: 1 1 220px; min-height: 42px; }
.acc-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.acc-row .ghost { text-decoration: none; }
.acc-del { color: #E8A0A0; margin-inline-start: auto; }
.acc-fine { font-size: 12.5px; margin: 0; }
.acc-fine a, .acc-dev a { color: var(--accent); font-weight: 600; }
.account .good { color: #8FD0AC; margin: 0; font-size: 14px; }
.account .error { margin: 0; }
.toast { position: fixed; z-index: 50; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px; border-radius: 12px; background: linear-gradient(180deg, #2B3C57, #1E2C44); border: 1px solid #50617A; color: var(--ink);
  font: 600 14.5px/1.4 var(--f-body); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); transition: opacity .5s, transform .5s; }
.toast.out { opacity: 0; transform: translate(-50%, 8px); }

/* whose games these are: verified, public, or a player who asked not to be analysed */
.who-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; max-width: 1180px; margin: 10px auto 0; padding: 8px 14px;
  border-radius: 12px; font-size: 13.5px; color: var(--text-2); background: var(--surface, #141F34); border: 1px solid rgba(190, 205, 225, .12); }
.who-bar b { color: var(--ink); font-weight: 700; }
.who-bar.mine { border-color: rgba(143, 208, 172, .28); }
.who-bar.off { border-color: rgba(232, 160, 160, .35); color: #E8A0A0; }
.who-bar .linkish { color: var(--accent); font-weight: 600; }
.who-ok { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(143, 208, 172, .18); color: #8FD0AC; font-size: 12px; font-weight: 800; }
.acc-player { display: flex; flex-direction: column; gap: 10px; padding-bottom: 18px; margin-bottom: 4px; border-bottom: 1px solid rgba(190, 205, 225, .12); }
.acc-player:empty { display: none; }
.acc-player h3 { margin: 0; font: 800 16px/1.3 var(--f-head); color: var(--ink); }
.acc-player .good { color: #8FD0AC; margin: 0; font-size: 14px; }
.acc-player .error { margin: 0; }
.v-steps { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 8px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.v-steps a { color: var(--accent); font-weight: 600; }
.v-code { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.v-code code { font: 600 16px/1 var(--f-mono, "Space Grotesk", monospace); letter-spacing: .04em; color: var(--accent); background: var(--raised, #1B2942);
  padding: 9px 12px; border-radius: 10px; border: 1px solid rgba(255, 172, 66, .3); user-select: all; }
.ghost.danger { color: #E8A0A0; border-color: rgba(232, 160, 160, .35); }

/* the game line's parts keep their own width and wrap to a new line instead of running into each other */
.src > span.sp { flex: 0 0 auto; }

/* signing in with Lichess */
.lichess-btn { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 700; }
.lichess-btn .li-mark { width: 20px; height: 20px; }
.acc-or { margin: 2px 0 0; font-size: 13px; }
.acc-also { font-size: 13px; }
.acc-also b, .acc-who b { color: var(--ink); }

/* where the player plays: chess.com or Lichess */
.wl-site { display: flex; gap: 6px; padding: 4px; border-radius: var(--r-md); background: rgba(191, 197, 206, .06); border: 1px solid var(--line-2); margin-bottom: 12px; }
.wl-site button { flex: 1; font: 600 13.5px/1 var(--f-body); color: var(--text-2); background: none; border: 0; border-radius: 8px; padding: 9px 10px; cursor: pointer; }
.wl-site button[aria-checked="true"] { color: var(--ink); background: rgba(255, 172, 66, .14); box-shadow: inset 0 0 0 1px rgba(255, 172, 66, .55); }
.wl-mine { width: 100%; margin-top: 10px; }
.site-tag { font: 600 11px/1 var(--f-body); color: var(--text-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 6px; vertical-align: middle; }

/* coach mode: the coach's page, one student, and the invite a student opens */
.coach { display: flex; flex-direction: column; gap: 14px; padding-top: 24px; }
.coach > h1 { font: 800 28px/1.15 var(--f-head); letter-spacing: -.4px; color: var(--ink); margin: 0; }
.coach > .today-sub { margin: 0; }
.coach .card label { margin-top: 2px; }
.c-title { display: flex; align-items: center; gap: 8px; }
.c-h { font: 700 17px/1.2 var(--f-head); color: var(--ink); margin: 8px 0 0; }
.c-link { display: flex; gap: 8px; }
.c-link input { flex: 1; min-width: 0; }
.coach select, .coach textarea { width: 100%; font: 500 14px/1.4 var(--f-body); color: var(--ink); background: var(--raised, #1B2942);
  border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 9px 11px; }
.coach textarea { resize: vertical; }
.c-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.c-stu { color: inherit; text-decoration: none; gap: 8px; transition: border-color .15s, transform .15s; }
a.c-stu:hover { border-color: var(--silver); transform: translateY(-1px); }
.c-stu.off { flex-direction: row; justify-content: space-between; align-items: center; }
.c-stu-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.c-name { font-size: 16px; }
.c-stats { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 13px; color: var(--text-2); }
.c-stats b { color: var(--ink); font-size: 15px; }
.c-stats.big b { font-size: 20px; }
.c-top { margin: 0; font-size: 13px; }
.c-days { display: inline-flex; gap: 4px; }
.c-days i { width: 9px; height: 9px; border-radius: 3px; background: rgba(191, 197, 206, .16); }
.c-days i.on { background: var(--accent); }
.c-chip { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; font: 600 12.5px/1 var(--f-body); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line)); border-radius: 999px; padding: 6px 10px; }
.c-chip svg { width: 14px; height: 14px; }
.pat.c-on { outline: 1px solid color-mix(in srgb, var(--accent) 55%, transparent); border-radius: var(--r-md); }
.c-note { margin: 0; color: var(--text-2); font-style: italic; }
.today-coach b { font: 700 16px/1.3 var(--f-head); color: var(--ink); }
.today-coach .eyebrow svg { width: 14px; height: 14px; margin-inline-end: 6px; }
.acc-coaches { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--text-2); }
.acc-coaches li { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.acc-coach-mode { margin: 4px 0; }

#coach { width: 100%; max-width: 760px; margin-inline: auto; padding: 24px 16px; }
@media (min-width: 1000px) { #coach { zoom: 1.2; } }


/* ======================================================================================================
   The coach panel: what to do now, how it went and why, and the one main button, always in the same place
   (beside the board on wide screens, under it on a phone). The steps on top say where in the exercise you are.
   ====================================================================================================== */
.panel { display: flex; flex-direction: column; gap: 10px; width: 100%; min-width: 0; }
.panel #flFb, .panel #flFb > .row, .panel #pzRow { display: flex; flex-wrap: wrap; gap: 8px; }
.panel #flFb { flex-direction: column; flex-wrap: nowrap; gap: 10px; }
.panel .row > button { min-width: 0; min-height: 44px; font-size: 14.5px; flex: 1 1 140px; }
.panel .row > .btn { flex-basis: 100%; min-height: 50px; font-size: 16px; }
.panel #pzRow > span { align-self: center; }
.steps { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--muted); }
.steps li { display: flex; align-items: center; gap: 6px; }
.steps li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--line-2); flex: none; }
.steps li.now { color: var(--ink); font-weight: 700; }
.steps li.now::before { background: var(--amber); box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 25%, transparent); }
.steps li.done { color: var(--good); }
.steps li.done::before { background: var(--good); }
.fb-tip { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.45; }
.fb, .panel .pz-fb { margin: 0; text-align: start !important; border-radius: var(--r-md); padding: 12px 14px; background: var(--panel);
  border: 1px solid var(--line); color: var(--text-2); font-size: 14.5px; line-height: 1.5; width: auto !important; }
.fb.good, .panel .pz-fb.good { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.fb.learn { border-color: color-mix(in srgb, var(--amber) 50%, transparent); }
.fb.gold { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--amber) 60%, transparent); background: color-mix(in srgb, var(--amber) 10%, var(--surface)); }
.fb-head, .panel .fl-res { display: block; font: 800 17px/1.3 var(--f-head, inherit); color: var(--ink); margin: 0 0 4px; }
.fb.good .fb-head, .panel .pz-fb.good .fl-res { color: var(--good); }
.fb.learn .fb-head { color: var(--amber); }
.fb-body { margin: 0; color: var(--ink); }
.fb-why { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.fb-why-t { display: block; font-size: 12px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.fb-why-l { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.fb-why-l .skel { list-style: none; height: 12px; border-radius: 6px; background: var(--line); animation: skel 1.1s ease-in-out infinite alternate; }
.fb-why-l .skel.short { width: 60%; }
@keyframes skel { to { opacity: .45; } }
.fb-note { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .fb-why-l .skel { animation: none; } }
@media (pointer: fine) { .panel .row > .btn::after { content: "↵"; margin-inline-start: 10px; opacity: .55; font-size: .85em; } }
/* a phone: the main button stays in reach at the bottom of the screen while the panel is in view */
@media (max-width: 1199px) {
  .panel .row:has(> .btn) { position: sticky; bottom: 12px; z-index: 6; }
  .panel .row > .btn { box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
}
@media (min-width: 1200px) {
  #puzzles:has(> .pz-board) > .panel, #flash:has(> .pz-board) > .panel {
    grid-area: r; justify-self: start; align-self: center; width: min(340px, 100%); max-height: calc(100vh - 220px); overflow: auto; }
  .panel .row > button { grid-area: auto !important; justify-self: auto !important; min-width: 0 !important; }
}
/* a phone in training: the session bar gets its own row under the logo, one line, the timer as an icon */
@media (max-width: 720px) {
  body[data-view="train"] header { flex-wrap: wrap; }
  header #runBar .run-top { gap: 8px; font-size: 13px; flex-wrap: nowrap; }
  header #runBar .run-steps { min-width: 40px; }
  header #runBar .tool span { display: none; }
  header #runBar .back-step, header #runBar .linkish { white-space: nowrap; }
}
/* the page is a flex column: on a long page the top bar must keep its height, not shrink under its own content */
header { flex-shrink: 0; }

/* ---------- mastery: a pattern's level (new, practicing, reliable, strong), and why a position is here today ---------- */
.lvl { display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px; font: 700 11.5px/1.6 var(--f-body, inherit);
  letter-spacing: .2px; vertical-align: middle; border: 1px solid transparent; white-space: nowrap; }
.lvl.new { color: var(--muted); border-color: var(--line-2); }
.lvl.practicing { color: #F2C27A; background: rgba(255, 172, 66, .1); border-color: rgba(255, 172, 66, .35); }
.lvl.reliable { color: #8FDCC0; background: rgba(95, 191, 159, .12); border-color: rgba(95, 191, 159, .4); }
.lvl.strong { color: #1B1406; background: linear-gradient(90deg, #E9B04F, #FFD27A); }
.pinfo .lvl { margin-inline-start: 6px; }
.lvl-next { font-size: 12.5px; color: var(--text-2); }
.fb-level { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 0; padding-top: 10px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--ink); }
.fb-level.up { font-weight: 700; color: var(--amber); }
.why-chip { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; color: var(--text-2); background: var(--surface); border: 1px solid var(--line); }
.why-chip.due { color: #8FDCC0; border-color: rgba(95, 191, 159, .35); }
.why-chip.new { color: #F2C27A; border-color: rgba(255, 172, 66, .35); }
.why-chip.coach { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }

/* ---------- the week's pattern on Today ---------- */
.today .week-card, .week-card { display: flex; flex-direction: row; gap: 16px; align-items: flex-start; text-align: start; }
.week-card .wk-thumb { flex: none; width: 112px; }
.week-card .wk-thumb > * { width: 100%; }
.week-card .wk-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.week-card b { font: 800 17px/1.3 var(--f-head, inherit); color: var(--ink); }
.week-card .wk-goal { margin: 0; color: var(--amber); font-weight: 700; }
.week-card.reached .wk-goal { color: var(--good); }
.week-card .wk-next, .week-card .muted { margin: 0; font-size: 13px; }
.wk-days { display: flex; gap: 6px; margin: 2px 0; }
.wk-days i { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font: 600 11.5px/1 var(--f-body, inherit);
  font-style: normal; color: var(--muted); background: var(--surface); border: 1px solid var(--line); }
.wk-days i.on { color: #10151a; background: linear-gradient(135deg, #E9B04F, #FFAC42); border-color: transparent; }
.wk-days i.now { box-shadow: 0 0 0 2px color-mix(in srgb, var(--amber) 55%, transparent); }
.why-chip.week { color: #F2C27A; border-color: rgba(255, 172, 66, .45); background: rgba(255, 172, 66, .08); }
@media (max-width: 480px) { .week-card .wk-thumb { width: 84px; } .wk-days i { width: 24px; height: 24px; } }

/* ---------- the player's tactics on Progress ---------- */
.skills h3 { margin: 10px 0 6px; font-size: 14px; color: var(--muted); font-weight: 700; }
.skills .sk-lines { margin: 4px 0; padding-inline-start: 18px; display: grid; gap: 4px; }
.sk-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.sk-list, .sk-ops, .sk-all ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.sk-list li, .sk-ops li, .sk-all li { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); }
.sk-list li.good { border-inline-start: 3px solid var(--good); }
.sk-list li.weak { border-inline-start: 3px solid var(--amber); }
.sk-list .muted, .sk-ops .muted, .sk-all .muted { font-size: 12.5px; }
.sk-practice { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 0; }
.sk-practice .chip { padding: 3px 10px; border-radius: 999px; font-size: 13px; background: rgba(255, 172, 66, .1);
  border: 1px solid rgba(255, 172, 66, .4); color: #F2C27A; }
.sk-all { margin-top: 10px; }
.sk-all summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.sk-all ul { margin-top: 8px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.sk-all li.unseen { opacity: .55; }
.why-chip.weak { color: #F5A99A; border-color: rgba(240, 120, 100, .45); background: rgba(240, 120, 100, .08); }
