/* Layout: a single-screen game. Board on the left, a narrow "herald" column on the right; stacks on phones. */
:root {
  --bg: #EEEDEA;
  --surface: #F8F7F4;
  --ink: #1B1E2B;
  --muted: #646876;
  --line: #CFCDC6;
  --accent: #A8781F;
  --accent-strong: #7E540A;
  --sun: #EE9B0B;
  --sea: #2C6F87;
  --shutter: #3A4256;
  --loop: #24508A;
  --sand: #EEDDB2;
  --moon: #2F62D0;
  --bad: #C2362B;
  --font-display: "IM Fell English SC", "Iowan Old Style", Georgia, serif;
  --font-body: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r0:#EBB5AE; --r1:#AFC8EA; --r2:#B7D8B2; --r3:#EFD68E; --r4:#D0B8E0;
  --r5:#F2C49C; --r6:#A3D5CF; --r7:#EFBAD4; --r8:#D3D5DB; --r9:#D7C2A8;
  --cell-ink: #1B1E2B;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13151D; --surface: #1C1F2A; --ink: #ECEAE4; --muted: #9A9DA9; --line: #333746;
    --accent: #D9A94A; --accent-strong: #F0C463; --sun: #FFB833; --moon: #7FA4FF; --sea: #3B8AA5; --shutter: #8B95AE; --loop: #9CC0F5; --sand: #6B5B39; --bad: #FF6B5E;
    --r0:#7C3D38; --r1:#355883; --r2:#416E45; --r3:#866C29; --r4:#614878;
    --r5:#87552F; --r6:#2F6B66; --r7:#804564; --r8:#525867; --r9:#6A5640;
    --cell-ink: #F6F3EC;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #13151D; --surface: #1C1F2A; --ink: #ECEAE4; --muted: #9A9DA9; --line: #333746;
  --accent: #D9A94A; --accent-strong: #F0C463; --sun: #FFB833; --moon: #7FA4FF; --sea: #3B8AA5; --shutter: #8B95AE; --loop: #9CC0F5; --sand: #6B5B39; --bad: #FF6B5E;
  --r0:#7C3D38; --r1:#355883; --r2:#416E45; --r3:#866C29; --r4:#614878;
  --r5:#87552F; --r6:#2F6B66; --r7:#804564; --r8:#525867; --r9:#6A5640;
  --cell-ink: #F6F3EC;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { min-height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; }
button:focus-visible, .board:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.app { max-width: 1040px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 20px; }
.wordmark { font-family: var(--font-display); font-size: clamp(34px, 6vw, 48px); line-height: .9; letter-spacing: .01em; margin: 0; }
.wordmark .k { color: var(--accent); }
.tag { color: var(--muted); font-size: 13px; margin-top: 6px; }
.datebar { display: flex; align-items: center; gap: 6px; }
.datebar .date { font-variant-numeric: tabular-nums; font-weight: 500; min-width: 150px; text-align: center; }
.iconbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; width: 34px; height: 34px; cursor: pointer; font-size: 18px; line-height: 1; }
.iconbtn:disabled { opacity: .35; cursor: default; }
.streak { font-size: 13px; color: var(--muted); padding-left: 10px; border-left: 1px solid var(--line); margin-left: 6px; white-space: nowrap; }
.streak b { color: var(--accent); font-variant-numeric: tabular-nums; }

.main { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: start; }
@media (max-width: 820px) { .main { grid-template-columns: 1fr; } }

.levels { display: flex; gap: 6px; margin-bottom: 12px; }
.levels button { flex: 1; border: 1px solid var(--line); background: var(--surface); padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 500; display: flex; align-items: center; justify-content: center; gap: 6px; }
.levels button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.levels .tick { font-size: 12px; color: var(--accent); }
.levels button[aria-pressed="true"] .tick { color: var(--accent); }

.boardwrap { position: relative; width: 100%; }
.board { container-type: inline-size; display: grid; grid-template-columns: repeat(10, 1fr); border: 3px solid var(--ink); border-radius: 6px; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background: var(--ink); }
.cell { aspect-ratio: 1; position: relative; display: grid; place-items: center; cursor: pointer; border-style: solid; border-color: var(--ink); font-size: clamp(16px, 4.6vw, 34px); font-size: calc(58cqi / var(--n, 10)); color: var(--cell-ink); }
.cell .g { pointer-events: none; line-height: 1; }
.cell.x .g { font-size: .62em; opacity: .55; font-weight: 600; }
.cell.mark .g { font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", serif; }
.cell.mark:not(.given) .g { animation: drop .16s ease-out; }
.cell.given::after { content: ""; position: absolute; inset: 14%; border: 2px solid var(--cell-ink); border-radius: 50%; opacity: .45; pointer-events: none; }
.cell.bad .g { color: var(--bad); }
.cell.bad::before { content: ""; position: absolute; inset: 3px; border: 2px dashed var(--bad); border-radius: 4px; pointer-events: none; }
.cell.hfocus { box-shadow: inset 0 0 0 100px rgba(255,255,255,.28); }
:root[data-theme="dark"] .cell.hfocus { box-shadow: inset 0 0 0 100px rgba(255,255,255,.14); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cell.hfocus { box-shadow: inset 0 0 0 100px rgba(255,255,255,.14); } }
.cell.htarget::before { content: ""; position: absolute; inset: 2px; border: 3px solid var(--accent); border-radius: 5px; animation: pulse 1.2s ease-in-out infinite; pointer-events: none; }
.cell.cursor::after { content: ""; position: absolute; inset: 1px; outline: 2px solid var(--accent); outline-offset: -2px; pointer-events: none; }
@keyframes drop { from { transform: scale(1.35); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .cell .g, .cell.htarget::before { animation: none !important; } }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.btn { border: 1px solid var(--line); background: var(--surface); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-weight: 500; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1B1E2B; }
.btn:disabled { opacity: .4; cursor: default; }
.timer { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 17px; letter-spacing: .02em; }
.toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }

.paused { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; text-align: center; background: var(--surface); border: 3px solid var(--ink); border-radius: 6px; }
.paused .ptitle { font-family: var(--font-display); font-size: 40px; line-height: 1; margin-bottom: 6px; }
.paused .psub { color: var(--muted); font-size: 14px; margin-bottom: 16px; font-variant-numeric: tabular-nums; }
.board.is-paused .g { visibility: hidden; }
.loading, .win { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; border-radius: 6px; }
.loading { background: color-mix(in srgb, var(--bg) 70%, transparent); font-family: var(--font-display); font-size: 22px; }
.win { background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(2px); padding: 16px; }
.wincard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 22px 24px; max-width: 340px; width: 100%; text-align: center; box-shadow: 0 12px 40px rgba(0,0,0,.18); }
.wincard h2 { font-family: var(--font-display); font-weight: 400; font-size: 32px; margin: 0 0 4px; }
.wincard .stats { display: flex; justify-content: center; gap: 22px; margin: 14px 0 16px; }
.wincard .stats div { display: grid; }
.wincard .stats b { font-size: 22px; font-variant-numeric: tabular-nums; }
.wincard .stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.wincard .row { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.copied { font-size: 12px; color: var(--muted); min-height: 18px; margin-top: 8px; }

aside { display: grid; gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.panel h3 { font-family: var(--font-display); font-weight: 400; font-size: 21px; margin: 0 0 10px; text-wrap: balance; }
.rules { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.rules li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 14px; }
.rules .n { font-family: var(--font-display); font-size: 20px; color: var(--accent); line-height: 1.1; text-align: center; }
.knight-demo { display: grid; grid-template-columns: repeat(4, 18px); gap: 2px; margin-top: 6px; }
.knight-demo i { width: 18px; height: 18px; background: var(--r1); border-radius: 2px; display: grid; place-items: center; font-style: normal; font-size: 12px; color: var(--cell-ink); }
.knight-demo i.o { background: transparent; border: 1px solid var(--line); }
.patterns { display: grid; gap: 14px; }
.patterns h4 { margin: 0 0 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.patterns ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.patterns li { font-size: 14px; }
.patterns li b { font-weight: 600; }
.mini { margin: 8px 0 2px; display: grid; gap: 4px; }
.mini .g2 { display: grid; width: max-content; border: 1.5px solid var(--ink); border-radius: 3px; overflow: hidden; }
.mini .c { width: 22px; height: 22px; display: grid; place-items: center; font-size: 14px; line-height: 1; border-style: solid; border-color: color-mix(in srgb, var(--ink) 25%, transparent); color: var(--cell-ink); }
.mini .c.k { font-family: "Segoe UI Symbol", "Apple Symbols", "DejaVu Sans", serif; }
.mini .c.acc { color: var(--accent-strong); font-weight: 700; }
.mini .c.x { opacity: .55; font-weight: 600; font-size: 12px; }
.mini .c.acc.x { opacity: 1; font-size: 13px; }
.mini .c.o::after { content: ""; width: 12px; height: 12px; border: 2px solid var(--accent-strong); border-radius: 50%; }
.mini .c.ghost { opacity: .5; outline: 1.5px dashed var(--ink); outline-offset: -3px; }
.mini .c.red { color: var(--bad); opacity: 1; font-weight: 700; font-size: 13px; }
.mini figcaption { font-size: 12px; color: var(--muted); }
.legend { font-size: 12px; color: var(--muted); margin: -4px 0 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend i { font-style: normal; color: var(--accent-strong); font-weight: 700; }
.legend .ring { width: 10px; height: 10px; border: 2px solid var(--accent-strong); border-radius: 50%; display: inline-block; }
.panel .note { font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.controls-help { font-size: 13px; color: var(--muted); margin: 12px 0 0; }
.hint .tech { display: inline-block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin-bottom: 4px; }
.hint p { margin: 0 0 12px; }
.hint .row { display: flex; gap: 8px; }
.hint .empty { color: var(--muted); font-size: 14px; margin: 0; }
.meta { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.linkbtn { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ===================== app chrome ===================== */
.view { min-height: 100vh; min-height: 100dvh; }
.paper { background: var(--bg); }
.appbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right), calc((100% - 1040px) / 2 + 8px)) 10px max(16px, env(safe-area-inset-left), calc((100% - 1040px) / 2 + 8px)); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.appbar .back { width: 40px; height: 40px; border-radius: 50%; border: none; background: transparent; font-size: 22px; cursor: pointer; flex: none; }
.appbar .back:hover { background: var(--surface); }
.appbar-title { display: grid; line-height: 1.2; min-width: 0; flex: 1; }
.appbar-title .t { font-family: var(--font-display); font-size: 24px; }
.appbar-title .s { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wordmark-sm .k { color: var(--accent); }
.appbar .streak { border-left: none; }
.fatal { position: fixed; inset: auto 16px 16px; background: var(--ink); color: var(--bg); padding: 12px 16px; border-radius: 10px; z-index: 50; }

/* ===================== launcher (Android-style home screen) ===================== */
.launcher {
  --wall-a: #1A2340; --wall-b: #2B1D33; --wall-c: #10131C;
  color: #F4F1EA; color-scheme: dark;
  background:
    radial-gradient(60% 45% at 15% 10%, rgba(53, 88, 131, .75), transparent 70%),
    radial-gradient(55% 40% at 90% 35%, rgba(128, 69, 100, .55), transparent 70%),
    radial-gradient(70% 45% at 40% 100%, rgba(134, 108, 41, .45), transparent 70%),
    linear-gradient(160deg, var(--wall-a), var(--wall-b) 55%, var(--wall-c));
  display: flex; flex-direction: column;
  padding: calc(28px + env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) calc(20px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  position: relative; overflow: hidden;
}
.launcher::before { /* faint puzzle grid in the wallpaper */
  content: ""; position: absolute; inset: -2px; pointer-events: none; opacity: .07;
  background-image: linear-gradient(#fff 1px, transparent 1px), linear-gradient(90deg, #fff 1px, transparent 1px);
  background-size: 44px 44px; mask-image: linear-gradient(to bottom, #000, transparent 75%);
}
.launcher > * { position: relative; width: 100%; max-width: 560px; margin-left: auto; margin-right: auto; }
.glance { padding: 12px 4px 0; }
.glance-date { font-size: clamp(30px, 8vw, 40px); font-weight: 500; letter-spacing: -.01em; line-height: 1.1; }
.glance-sub { margin-top: 6px; font-size: 15px; opacity: .85; }
.glance-sub b { color: #F0C463; font-weight: 600; }
.appgrid { margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px 8px; }
@media (min-width: 520px) { .appgrid { grid-template-columns: repeat(5, 1fr); } }
.appicon { border: none; background: none; color: inherit; cursor: pointer; display: grid; justify-items: center; gap: 7px; padding: 4px 0; border-radius: 16px; -webkit-tap-highlight-color: transparent; }
.appicon .iconwrap { position: relative; width: 64px; height: 64px; transition: transform .15s ease; }
.appicon img { width: 64px; height: 64px; border-radius: 30%; display: block; box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 1px 2px rgba(0,0,0,.3); }
.appicon:active .iconwrap { transform: scale(.9); }
.appicon:focus-visible { outline: 2px solid #F0C463; outline-offset: 2px; }
.appicon .badge { position: absolute; top: -3px; right: -3px; width: 14px; height: 14px; border-radius: 50%; background: #F0C463; border: 2px solid #1A2340; }
.applabel { font-size: 12.5px; line-height: 1.25; text-align: center; text-shadow: 0 1px 3px rgba(0,0,0,.6); max-width: 84px; }
.launcher-foot { margin-top: auto; padding-top: 40px; display: grid; justify-items: center; gap: 10px; }
.chip { border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.1); color: inherit; border-radius: 999px; padding: 9px 18px; font-weight: 500; cursor: pointer; backdrop-filter: blur(6px); }
.ios-tip { margin: 0; font-size: 13px; opacity: .85; text-align: center; }
.brand { margin: 0; font-family: var(--font-display); font-size: 18px; opacity: .55; letter-spacing: .04em; }
@media (prefers-reduced-motion: reduce) { .appicon .iconwrap { transition: none; } }

/* ===================== history ===================== */
.hist-wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(40px + env(safe-area-inset-bottom)); display: grid; gap: 18px; }
.hist-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.hist-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px; display: grid; }
.hist-stats b { font-size: 24px; font-variant-numeric: tabular-nums; }
.hist-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.month h2 { font-family: var(--font-display); font-weight: 400; font-size: 22px; margin: 6px 0 8px; }
.days { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.day { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
.day:first-child { border-top: none; }
.day .dl { display: grid; line-height: 1.25; }
.day .dl b { font-weight: 600; }
.day .dl span { font-size: 12px; color: var(--muted); }
.day.today { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.lvls { display: flex; gap: 6px; }
.lv { border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 6px 8px; min-width: 74px; cursor: pointer; display: grid; text-align: left; line-height: 1.2; }
.lv .n { font-size: 12px; font-weight: 600; }
.lv .st { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lv.done { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.lv.done .st { color: color-mix(in srgb, var(--bg) 75%, transparent); }
.lv.started { border-color: var(--accent); }
.lv.started .st { color: var(--accent); }
@media (max-width: 480px) { .day { grid-template-columns: 1fr; } .lv { min-width: 0; flex: 1; } }
.hist-foot { text-align: center; }

/* catalogue: coming-soon games and toast */
.appicon.soon img { filter: grayscale(.85) brightness(.75); }
.appicon.soon .applabel { opacity: .7; }
.soon-tag { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; background: rgba(20, 22, 31, .85); color: #F0C463; border: 1px solid rgba(240, 196, 99, .5); padding: 1px 6px; border-radius: 999px; white-space: nowrap; }
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(420px, calc(100% - 32px)); background: rgba(244, 241, 234, .96); color: #1B1E2B; padding: 10px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 30px rgba(0,0,0,.35); z-index: 40; text-align: center; }

/* launcher quick setting (Android quick-settings tile) */
.quick { margin-top: 22px; display: grid; gap: 8px; justify-items: start; }
.qs { display: inline-flex; align-items: center; gap: 12px; border: none; cursor: pointer; text-align: left; padding: 10px 18px 10px 10px; border-radius: 999px; background: rgba(255,255,255,.12); color: inherit; backdrop-filter: blur(8px); transition: background .15s ease; }
.qs .qs-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; font-weight: 700; background: rgba(255,255,255,.14); }
.qs .qs-text { display: grid; line-height: 1.25; }
.qs .qs-text b { font-weight: 600; font-size: 15px; }
.qs .qs-text span { font-size: 12.5px; opacity: .8; }
.qs[aria-checked="true"] { background: #F0C463; color: #1B1E2B; }
.qs[aria-checked="true"] .qs-icon { background: #1B1E2B; color: #F0C463; }
.qs:focus-visible { outline: 2px solid #F0C463; outline-offset: 3px; }
.qs-help { margin: 0; font-size: 12.5px; opacity: .7; max-width: 380px; }
.appgrid { margin-top: 34px; }

/* two-symbol board (Balance) */
.symwrap { position: relative; container-type: inline-size; width: 100%; }
.symboard .cell { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 28%, transparent); }
.symboard .cell[data-v="1"] { background: color-mix(in srgb, var(--sun) 16%, var(--surface)); }
.symboard .cell[data-v="2"] { background: color-mix(in srgb, var(--moon) 14%, var(--surface)); }
.symboard .cell.given { cursor: default; }
.symboard .cell.given[data-v="1"] { background: color-mix(in srgb, var(--sun) 34%, var(--surface)); }
.symboard .cell.given[data-v="2"] { background: color-mix(in srgb, var(--moon) 30%, var(--surface)); }
.symboard .cell.given::after { display: none; }
.symboard .cell .g { width: 80%; height: 80%; display: grid; }
.symboard .cell svg, .symfig svg { width: 100%; height: 100%; display: block; }
.sun circle { fill: var(--sun); } .sun line { stroke: var(--sun); }
.cell.given .sun circle, .cell.given .moon { filter: saturate(1.15) brightness(.92); }
.moon { fill: var(--moon); }
.symboard .cell:not(.given) .g svg { animation: drop .16s ease-out; }
.linklayer { position: absolute; inset: 3px; pointer-events: none; }
.linklayer .link { position: absolute; transform: translate(-50%, -50%); width: calc(40cqi / var(--n)); height: calc(40cqi / var(--n)); min-width: 18px; min-height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; font-size: max(13px, calc(28cqi / var(--n))); line-height: 1; z-index: 2; box-shadow: 0 1px 3px rgba(0,0,0,.18); }
.linklayer .link.bad { border-color: var(--bad); color: var(--bad); }
.symmini .symfig { position: relative; }
.symmini .c.sc { width: 24px; height: 24px; background: var(--surface); padding: 2px; border: .5px solid color-mix(in srgb, var(--ink) 25%, transparent); padding: 3px; }
.symmini .c.sc.acc { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.symmini .c.sc.red { box-shadow: inset 0 0 0 2px var(--bad); }
.symmini .symfig .link { position: absolute; transform: translate(-50%, -50%); width: 15px; height: 15px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 1.2px solid var(--ink); font-size: 11px; font-weight: 700; line-height: 1; }
.legend-sym { display: inline-flex; gap: 2px; } .legend-sym svg { width: 14px; height: 14px; }

/* numbered hint markers on the board */
.cell .lbl { position: absolute; top: 4%; left: 4%; min-width: 1.5em; height: 1.5em; padding: 0 .3em; border-radius: 999px; display: grid; place-items: center; background: var(--accent); color: #1B1E2B; font: 700 max(10px, calc(26cqi / var(--n, 10))) / 1 var(--font-body); box-shadow: 0 1px 3px rgba(0,0,0,.25); z-index: 3; pointer-events: none; font-variant-numeric: tabular-nums; }
.hint p { white-space: pre-line; }

/* shading board (Archipelago) */
.shadeboard .cell { background: var(--surface); border-color: color-mix(in srgb, var(--ink) 28%, transparent); transition: background-color .08s ease; }
.shadeboard .cell[data-v="1"] { background: var(--sea); }
.shadeboard .cell[data-v="2"] { background: color-mix(in srgb, var(--sand) 40%, var(--surface)); }
.shadeboard .cell[data-v="2"] .g::after { content: ""; width: 22%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); opacity: .5; }
.shadeboard .cell .g { width: 100%; height: 100%; display: grid; place-items: center; }
.shadeboard .cell.clue { background: var(--sand); cursor: default; }
.shadeboard .cell.clue .g { font: 700 calc(46cqi / var(--n)) / 1 var(--font-body); color: var(--ink); font-variant-numeric: tabular-nums; }
.shadeboard .cell.clue.done .g { color: var(--accent-strong); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }
.shadeboard .cell.given::after { display: none; }
.shadeboard.is-paused .cell { background: var(--surface) !important; }
.shademini .c.shc { width: 24px; height: 24px; background: var(--surface); border: .5px solid color-mix(in srgb, var(--ink) 25%, transparent); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
.shademini .c.shc.sea { background: var(--sea); }
.shademini .c.shc.land { background: color-mix(in srgb, var(--sand) 40%, var(--surface)); }
.shademini .c.shc.land::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ink); opacity: .5; }
.shademini .c.shc.clue { background: var(--sand); color: var(--ink); }
.shademini .c.shc.acc { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.shademini .c.shc.ghost { opacity: .55; outline: 1.5px dashed var(--ink); outline-offset: -3px; }
.legend .lg-sea, .legend .lg-land, .legend .lg-acc { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.legend .lg-sea { background: var(--sea); } .legend .lg-land { background: var(--sand); } .legend .lg-acc { box-shadow: inset 0 0 0 2px var(--accent-strong); }

/* rooms board (Shutters) */
.roomboard .cell { background: var(--surface); }
.roomboard .cell[data-v="1"] { background: repeating-linear-gradient(180deg, var(--shutter) 0 18%, color-mix(in srgb, var(--shutter) 70%, #000) 18% 25%); }
.roomboard .cell[data-v="2"] .g::after { content: ""; width: 20%; aspect-ratio: 1; border-radius: 50%; background: var(--ink); opacity: .45; }
.roomboard .cell .g { width: 100%; height: 100%; display: grid; place-items: center; }
.roomboard .cell .rnum { position: absolute; top: 6%; left: 9%; font: 700 calc(30cqi / var(--n)) / 1 var(--font-body); color: var(--ink); pointer-events: none; font-variant-numeric: tabular-nums; }
.roomboard .cell[data-v="1"] .rnum { color: #F4F1EA; }
.roomboard .cell.done .rnum { color: var(--accent-strong); text-decoration: underline; text-decoration-thickness: 2px; }
.roomboard .cell.given::after { display: none; }
.roomboard.is-paused .cell { background: var(--surface) !important; }
.roommini .c.rc { width: 24px; height: 24px; background: var(--surface); border-style: solid; position: relative; display: grid; place-items: center; }
.roommini .c.rc.shut { background: repeating-linear-gradient(180deg, var(--shutter) 0 18%, color-mix(in srgb, var(--shutter) 70%, #000) 18% 25%); }
.roommini .c.rc.open::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); opacity: .5; }
.roommini .c.rc.acc { box-shadow: inset 0 0 0 2px var(--accent-strong); }
.roommini .c.rc.ghost { opacity: .5; outline: 1.5px dashed var(--ink); outline-offset: -3px; }
.roommini .c.rc .rnum { position: absolute; top: 1px; left: 3px; font-size: 10px; font-weight: 700; color: var(--ink); }
.roommini .c.rc.shut .rnum { color: #F4F1EA; }
.legend .lg-shut, .legend .lg-open { display: inline-block; width: 11px; height: 11px; border-radius: 2px; }
.legend .lg-shut { background: var(--shutter); } .legend .lg-open { background: var(--surface); border: 1px solid var(--line); }
/* room numbers live top-left on Shutters boards, so hint markers go top-right */
.roomboard .cell .lbl { left: auto; right: 4%; }

/* loop board (Perimeter) */
.loopboard { display: block; background: var(--surface); border-color: var(--line); }
.loopsvg { display: block; width: 100%; height: auto; }
.loopsvg .lcell { fill: transparent; }
.loopsvg .lcell.cursor { fill: none; stroke: var(--accent); stroke-width: .05; }
.loopsvg .lnum { font: 700 .5px var(--font-body); fill: var(--ink); text-anchor: middle; dominant-baseline: middle; font-variant-numeric: tabular-nums; pointer-events: none; }
.loopsvg .lnum.done { fill: var(--muted); }
.loopsvg .lnum.bad { fill: var(--bad); }
.loopsvg .lguide { stroke: color-mix(in srgb, var(--ink) 9%, transparent); stroke-width: .03; }
.loopsvg .lline { stroke: var(--loop); stroke-width: .13; stroke-linecap: round; display: none; }
.loopsvg .lx { stroke: color-mix(in srgb, var(--ink) 55%, transparent); stroke-width: .045; stroke-linecap: round; fill: none; display: none; }
.loopsvg .ledge[data-v="1"] .lline { display: inline; }
.loopsvg .ledge[data-v="2"] .lx { display: inline; }
.loopsvg .ledge.bad .lline { stroke: var(--bad); }
.loopsvg .ldot { fill: var(--ink); pointer-events: none; }
.loopsvg .ldot.bad { fill: var(--bad); r: .14; }
.loopsvg .fcell { fill: color-mix(in srgb, var(--accent) 22%, transparent); }
.loopsvg .fdot { fill: none; stroke: var(--accent-strong); stroke-width: .06; }
.loopsvg .fedge { stroke: color-mix(in srgb, var(--accent) 55%, transparent); stroke-width: .26; stroke-linecap: round; }
.loopsvg .ftarget { stroke: var(--accent); stroke-width: .3; stroke-linecap: round; opacity: .7; animation: pulse 1.2s ease-in-out infinite; }
.loopsvg .llbl circle { fill: var(--accent); stroke: #1B1E2B; stroke-width: .015; }
.loopsvg .llbl text { font: 700 .24px var(--font-body); fill: #1B1E2B; text-anchor: middle; dominant-baseline: middle; }
.loopboard.is-solved .lline { stroke: var(--accent-strong); }
.loopboard.is-paused .ledges, .loopboard.is-paused .llabels, .loopboard.is-paused .lfocus { visibility: hidden; }
@media (prefers-reduced-motion: reduce) { .loopsvg .ftarget { animation: none; } }
.loopmini svg { display: block; }
.loopmini .lboard { stroke: var(--muted); stroke-width: .08; stroke-dasharray: .16 .1; }
.loopmini .lline.acc { stroke: var(--accent-strong); }
.loopmini .lline.ghost { stroke-dasharray: .12 .1; opacity: .6; }
.loopmini .lx { display: inline; }
.loopmini .lx.acc { stroke: var(--accent-strong); stroke-width: .07; }
.loopmini .lline { display: inline; }
.loopmini .lnum { font-size: .55px; }
.legend .lg-line.acc { background: var(--accent-strong); }
.legend .lg-line, .legend .lg-board { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--loop); }
.legend .lg-board { background: repeating-linear-gradient(90deg, var(--muted) 0 4px, transparent 4px 7px); height: 2px; }
.legend .lg-x { color: var(--muted); font-weight: 700; }
