/* ============================================================
   Sudoku v17 — design tokens
   ============================================================ */
/* Dark mode: every @media (prefers-color-scheme:dark) block is scoped to :root:not([data-scheme="light"]) and
   copied for :root[data-scheme="dark"], so a mode chosen in Settings wins over the device's. Keep that pattern
   for new dark rules. */
:root{
  color-scheme:light dark;
  --font-ui:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --font-digit:ui-rounded,"SF Pro Rounded","Nunito","Segoe UI",system-ui,-apple-system,Roboto,Arial,sans-serif;

  --gutter:14px;
  --gap:12px;
  --radius:16px;
  --radius-sm:12px;
  --ease:cubic-bezier(.2,.8,.2,1);

  /* light */
  --bg:#f3f5fb;
  --bg-glow:rgba(99,125,255,.10);
  --surface:#ffffff;
  --surface-2:#eef1f8;
  --surface-3:#e4e8f3;
  --text:#101828;
  --text-2:#475069;
  --muted:#5b647c;
  --line:rgba(16,24,40,.08);
  --line-2:rgba(16,24,40,.14);

  --accent:#4b61e0;
  --accent-2:#6d84ff;
  --accent-ink:#ffffff;
  --accent-soft:rgba(75,97,224,.10);
  --accent-soft-2:rgba(75,97,224,.18);

  --grid-thin:#e2e6f0;
  --grid-bold:#858ea6;
  --cell:#ffffff;
  --cell-given-text:#101828;
  --cell-user-text:#3d54d6;
  --cell-peer:#eef1fb;
  --cell-same:#dbe2ff;
  --cell-selected:#c6d0ff;
  --note-text:#5b647c;
  --note-text-selected:#4f5870;

  --danger:#d92d33;
  --danger-soft:rgba(229,72,77,.12);
  --success:#15803d;
  --gold:#b78a00;

  --shadow-sm:0 1px 2px rgba(16,24,40,.06),0 1px 3px rgba(16,24,40,.06);
  --shadow:0 10px 30px -12px rgba(30,41,80,.22),0 2px 6px rgba(16,24,40,.05);
  --shadow-lg:0 30px 70px -20px rgba(20,30,70,.40);
  --veil:rgba(243,245,251,.55);
  --seg-pill:#ffffff;
  --scroll-thumb:rgba(16,24,40,.18);
  --scroll-thumb-hover:rgba(16,24,40,.32);
  --scrim:rgba(16,22,40,.38);
}

@media (prefers-color-scheme:dark){:root:not([data-scheme="light"]){
    --bg:#0b1020;
    --bg-glow:rgba(109,132,255,.12);
    --surface:#141a2e;
    --surface-2:#1a2139;
    --surface-3:#232b47;
    --text:#eef1fb;
    --text-2:#b4bdd6;
    --muted:#8f99b8;
    --line:rgba(255,255,255,.07);
    --line-2:rgba(255,255,255,.13);

    --accent:#7d95ff;
    --accent-2:#9fb0ff;
    --accent-ink:#0b1020;
    --accent-soft:rgba(125,149,255,.13);
    --accent-soft-2:rgba(125,149,255,.24);

    --grid-thin:#232a44;
    --grid-bold:#6b769a;
    --cell:#131a2d;
    --cell-given-text:#eef1fb;
    --cell-user-text:#93a7ff;
    --cell-peer:#1a2240;
    --cell-same:#26315e;
    --cell-selected:#33418a;
    --note-text:#8a94b4;
    --note-text-selected:#c3cae0;

    --danger:#ff6b6f;
    --danger-soft:rgba(255,107,111,.16);
    --success:#34d399;
    --gold:#fbbf24;

    --shadow-sm:0 1px 2px rgba(0,0,0,.3);
    --shadow:0 14px 34px -14px rgba(0,0,0,.6);
    --shadow-lg:0 30px 80px -20px rgba(0,0,0,.75);
    --veil:rgba(11,16,32,.45);
    --seg-pill:#2a3354;
    --scroll-thumb:rgba(255,255,255,.16);
    --scroll-thumb-hover:rgba(255,255,255,.28);
    --scrim:rgba(3,6,14,.6);
  }}
/* dark chosen in Settings, on a light device */
:root[data-scheme="dark"]{
    --bg:#0b1020;
    --bg-glow:rgba(109,132,255,.12);
    --surface:#141a2e;
    --surface-2:#1a2139;
    --surface-3:#232b47;
    --text:#eef1fb;
    --text-2:#b4bdd6;
    --muted:#8f99b8;
    --line:rgba(255,255,255,.07);
    --line-2:rgba(255,255,255,.13);

    --accent:#7d95ff;
    --accent-2:#9fb0ff;
    --accent-ink:#0b1020;
    --accent-soft:rgba(125,149,255,.13);
    --accent-soft-2:rgba(125,149,255,.24);

    --grid-thin:#232a44;
    --grid-bold:#6b769a;
    --cell:#131a2d;
    --cell-given-text:#eef1fb;
    --cell-user-text:#93a7ff;
    --cell-peer:#1a2240;
    --cell-same:#26315e;
    --cell-selected:#33418a;
    --note-text:#8a94b4;
    --note-text-selected:#c3cae0;

    --danger:#ff6b6f;
    --danger-soft:rgba(255,107,111,.16);
    --success:#34d399;
    --gold:#fbbf24;

    --shadow-sm:0 1px 2px rgba(0,0,0,.3);
    --shadow:0 14px 34px -14px rgba(0,0,0,.6);
    --shadow-lg:0 30px 80px -20px rgba(0,0,0,.75);
    --veil:rgba(11,16,32,.45);
    --seg-pill:#2a3354;
    --scroll-thumb:rgba(255,255,255,.16);
    --scroll-thumb-hover:rgba(255,255,255,.28);
    --scrim:rgba(3,6,14,.6);
  }

/* ============================================================
   Base
   ============================================================ */
:root[data-scheme="light"]{color-scheme:light}
:root[data-scheme="dark"]{color-scheme:dark}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;min-height:100%;background:var(--bg);color:var(--text)}
body{
  font-family:var(--font-ui);
  text-wrap:pretty;
  background:
    radial-gradient(1000px 520px at 50% -140px,var(--bg-glow),transparent 70%),
    var(--bg);
  background-attachment:fixed;
  -webkit-font-smoothing:antialiased;
  overscroll-behavior:none;
}
button{font:inherit;color:inherit;cursor:pointer}
button:disabled{cursor:default}
svg{width:20px;height:20px;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* app-styled scrollbars everywhere: thin, rounded, no arrow buttons */
::-webkit-scrollbar{width:12px;height:12px}
::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{
  background:var(--scroll-thumb);
  border:4px solid transparent;
  border-radius:99px;
  background-clip:padding-box;
}
::-webkit-scrollbar-thumb:hover{background-color:var(--scroll-thumb-hover)}
::-webkit-scrollbar-button{display:none;width:0;height:0}
::-webkit-scrollbar-corner{background:transparent}
@supports not selector(::-webkit-scrollbar){
  *{scrollbar-width:thin;scrollbar-color:var(--scroll-thumb) transparent}
}

/* ============================================================
   Layout
   ============================================================ */
.app{
  /* board size drives the whole layout on phones */
  --reserve:calc(230px + env(safe-area-inset-top) + env(safe-area-inset-bottom));
  --board:max(260px,min(calc(100vw - var(--gutter)*2),calc(100dvh - var(--reserve)),640px));
  min-height:100dvh;
  display:flex;
  flex-direction:column;
  align-items:center;
  padding:
    calc(env(safe-area-inset-top) + 6px)
    calc(env(safe-area-inset-right) + var(--gutter))
    calc(env(safe-area-inset-bottom) + 14px)
    calc(env(safe-area-inset-left) + var(--gutter));
  outline:none;
}
.header{
  width:var(--board);
  height:52px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{width:30px;height:30px;border-radius:9px;box-shadow:0 4px 12px -4px rgba(75,97,224,.55)}
.brand-name{font-size:20px;font-weight:800;letter-spacing:-.02em}
.header-actions{display:flex;gap:6px}

.game{
  width:var(--board);
  flex:1 1 auto;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:var(--gap);
  padding-top:4px;
}
.board-col{display:flex;flex-direction:column;gap:10px}
.controls{display:flex;flex-direction:column;gap:10px}

/* ============================================================
   Buttons
   ============================================================ */
.iconbtn{
  width:40px;height:40px;
  display:grid;place-items:center;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface);
  color:var(--text-2);
  box-shadow:var(--shadow-sm);
  transition:transform .12s var(--ease),background .15s,color .15s;
}
.iconbtn:hover{color:var(--text)}
.iconbtn:active{transform:scale(.94)}
.iconbtn.accent{background:var(--accent);border-color:transparent;color:var(--accent-ink)}
.iconbtn.small{width:36px;height:36px;border-radius:11px;box-shadow:none;background:var(--surface-2)}

.btn{
  min-height:46px;
  padding:0 16px;
  border:1px solid var(--line-2);
  border-radius:14px;
  background:var(--surface);
  color:var(--text);
  display:inline-flex;align-items:center;justify-content:center;gap:9px;
  font-weight:700;font-size:15px;
  transition:transform .12s var(--ease),filter .15s,background .15s;
}
.btn:active{transform:scale(.97)}
.btn.primary{
  border-color:transparent;
  background:linear-gradient(180deg,var(--accent-2),var(--accent));
  color:#fff;
  box-shadow:0 10px 24px -10px var(--accent);
}
@media (prefers-color-scheme:dark){:where(:root:not([data-scheme="light"])) .btn.primary{color:#0b1020}}
/* dark chosen in Settings, on a light device */
:where(:root[data-scheme="dark"]) .btn.primary{color:#0b1020}
.btn.primary svg:has(use[href="#i-play"]),.btn.primary svg:has(use[href="#i-pause"]){fill:currentColor}   /* only the play/pause marks are solid; outline icons stay outlines */
.btn.big{min-height:56px;font-size:17px;border-radius:16px;width:100%}
.btn.big svg{width:22px;height:22px}
.btn.ghost{background:transparent;border-color:transparent;color:var(--text-2)}
.btn.ghost:hover{color:var(--text)}
.btn.small{min-height:36px;font-size:14px}
.btn.danger{background:var(--danger);border-color:transparent;color:#fff}

/* ============================================================
   Info bar (level · mistakes · timer)
   ============================================================ */
.infobar{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:8px;
  height:40px;
}
.level-chip{
  height:36px;
  padding:0 8px 0 12px;
  display:inline-flex;align-items:center;gap:8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
  font-weight:700;font-size:14px;
}
.level-chip svg{width:16px;height:16px;color:var(--muted)}
.level-dots{display:inline-flex;gap:3px}
.level-dots i{width:6px;height:6px;border-radius:99px;background:var(--surface-3)}
.level-dots i.on{background:var(--accent)}
.info-item{
  justify-self:center;
  display:inline-flex;align-items:baseline;gap:6px;
  font-size:13px;color:var(--muted);font-weight:600;
}
.info-item strong{font-size:15px;color:var(--text);font-variant-numeric:tabular-nums}
.info-item.bump strong{animation:bump .45s var(--ease)}
.info-item.has-mistakes strong{color:var(--danger)}
@keyframes bump{40%{transform:scale(1.35)}}

.timer{
  height:36px;
  padding:0 4px 0 12px;
  display:inline-flex;align-items:center;gap:8px;
  border:1px solid var(--line);
  border-radius:999px;
  background:var(--surface);
  box-shadow:var(--shadow-sm);
  transition:transform .12s var(--ease);
}
.timer:active{transform:scale(.96)}
.timer-time{font-size:15px;font-weight:750;font-variant-numeric:tabular-nums;letter-spacing:.01em;min-width:44px;text-align:right}
.timer-icon{
  width:28px;height:28px;border-radius:99px;
  display:grid;place-items:center;
  background:var(--accent-soft);
  color:var(--accent);
}
.timer-icon svg{width:14px;height:14px}
.timer.is-paused .timer-icon{background:var(--accent);color:var(--accent-ink)}
.timer.is-idle .timer-time{color:var(--muted)}
.timer.is-paused .timer-time{color:var(--muted)}
.timer:disabled{opacity:1;cursor:default}
.timer:disabled .timer-icon{background:color-mix(in srgb,var(--success) 18%,transparent);color:var(--success)}
.timer:disabled .timer-icon svg{width:16px;height:16px;stroke-width:3}

/* ============================================================
   Board
   ============================================================ */
.board-wrap{position:relative;width:100%;container-type:inline-size}
.board{
  container-type:inline-size;
  width:100%;
  aspect-ratio:1/1;
  display:grid;
  grid-template-columns:repeat(9,minmax(0,1fr));
  grid-template-rows:repeat(9,minmax(0,1fr));
  border:2px solid var(--grid-bold);
  border-radius:var(--radius);
  overflow:hidden;
  background:var(--cell);
  box-shadow:var(--shadow);
  transition:filter .35s var(--ease),transform .35s var(--ease),opacity .35s;
  user-select:none;-webkit-user-select:none;
}
.board.veiled{filter:blur(9px) saturate(.7);transform:scale(.985);pointer-events:none}

.cell{
  position:relative;
  min-width:0;min-height:0;
  padding:0;border:0;border-radius:0;
  border-right:1px solid var(--grid-thin);
  border-bottom:1px solid var(--grid-thin);
  background:var(--cell);
  color:var(--cell-user-text);
  display:grid;place-items:center;
  font-family:var(--font-digit);
  font-size:clamp(18px,6vw,32px);
  font-size:calc(100cqi / 9 * .56);
  font-weight:600;
  line-height:1;
  touch-action:manipulation;
  transition:background-color .12s;
}
.cell.box-r{border-right:2px solid var(--grid-bold)}
.cell.box-b{border-bottom:2px solid var(--grid-bold)}
.cell.no-r{border-right:0}
.cell.no-b{border-bottom:0}
.cell.given{color:var(--cell-given-text);font-weight:700}
.cell.peer{background:var(--cell-peer)}
.cell.same{background:var(--cell-same)}
.cell.selected{background:var(--cell-selected)}
.cell.wrong{color:var(--danger);background:var(--danger-soft)}
.cell.selected.wrong{background:color-mix(in srgb,var(--danger) 26%,var(--cell))}
.cell .v{display:block}
.cell.pop .v{animation:pop .28s var(--ease)}
.cell.shake .v{animation:shake .38s ease}
@keyframes pop{0%{transform:scale(.4);opacity:0}70%{transform:scale(1.12)}100%{transform:scale(1);opacity:1}}
@keyframes shake{20%{transform:translateX(-4px)}40%{transform:translateX(4px)}60%{transform:translateX(-3px)}80%{transform:translateX(2px)}}

.notes{
  position:absolute;inset:2px;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  grid-template-rows:repeat(3,1fr);
  color:var(--note-text);
  font-family:var(--font-ui);
  font-size:calc(100cqi / 9 * .235);
  font-weight:600;
}
.note{display:grid;place-items:center;line-height:1}
.note.hl{color:var(--accent);font-weight:800}

.cell.hint-reveal{animation:hintReveal 1.1s ease-out}
@keyframes hintReveal{
  0%{background:var(--accent-soft-2);box-shadow:inset 0 0 0 3px var(--accent)}
  100%{box-shadow:inset 0 0 0 0 transparent}
}
.cell.unit-done{animation:unitDone .6s var(--ease) both;animation-delay:var(--d,0ms)}
@keyframes unitDone{
  0%{background:var(--cell)}
  35%{background:var(--accent-soft-2)}
  100%{}
}
.cell.win{animation:win .7s var(--ease) both;animation-delay:var(--d,0ms)}
@keyframes win{
  0%{}
  40%{background:var(--accent);color:var(--accent-ink)}
  100%{}
}

/* ============================================================
   Gate (start / pause / resume) — blurred grid + card
   ============================================================ */
.gate,.completion-overlay{
  position:absolute;inset:0;z-index:20;
  display:grid;place-items:center;
  padding:14px;
  border-radius:var(--radius);
  background:var(--veil);
  animation:fadeIn .25s ease both;
}
.gate-card,.completion-card{
  width:min(100%,340px);
  max-height:100%;
  overflow:auto;
  padding:22px 20px 16px;
  border:1px solid var(--line);
  border-radius:22px;
  background:var(--surface);
  box-shadow:var(--shadow-lg);
  text-align:center;
  display:flex;flex-direction:column;align-items:stretch;
  animation:cardIn .38s var(--ease) both;
}
@keyframes fadeIn{from{opacity:0}}
@keyframes cardIn{from{opacity:0;transform:translateY(10px) scale(.96)}}
.gate-icon,.completion-icon{
  width:52px;height:52px;margin:0 auto 12px;
  border-radius:16px;
  display:grid;place-items:center;
  background:var(--accent-soft);
  color:var(--accent);
}
.gate-icon svg,.completion-icon svg{width:26px;height:26px}
.gate-icon img{width:52px;height:52px;border-radius:15px}
.gate-icon.plain{background:none}
.gate-kicker,.completion-kicker{
  color:var(--accent);
  font-size:12px;font-weight:800;
  text-transform:uppercase;letter-spacing:.08em;
}
.gate-title,.completion-title{margin-top:4px;font-size:24px;font-weight:800;letter-spacing:-.02em}
.gate-meta{margin-top:6px;color:var(--muted);font-size:14px;font-weight:600;font-variant-numeric:tabular-nums}
.gate-meta .big-time{display:block;margin:6px 0 2px;color:var(--text);font-size:40px;font-weight:800;letter-spacing:-.03em}
.gate-levels{margin:16px 0 4px}
.gate-levels .seg{height:34px}
.gate-levels .segment.level-tabs .seg{height:50px}
#gatePrimary{margin-top:16px}
#gateSecondary{margin-top:6px}
.gate-foot{margin-top:10px;color:var(--muted);font-size:12px;line-height:1.4}
.gate-foot:empty{display:none}
/* copyright and legal links at the foot of the page, where there is room */
.site-foot{display:none}
@media (min-width:900px) and (min-height:760px){
  .site-foot{position:fixed;left:0;right:0;bottom:6px;z-index:1;display:flex;justify-content:center;flex-wrap:wrap;gap:4px 14px;
    padding:0 16px;font-size:11.5px;color:var(--muted);pointer-events:none}
  .site-foot a{color:inherit;pointer-events:auto}
}
.challenge-pill{
  margin-top:12px;padding:8px 12px;border-radius:12px;
  background:var(--accent-soft);color:var(--text);
  font-size:13px;font-weight:700;
  display:flex;align-items:center;justify-content:center;gap:8px;
}
.challenge-pill svg{width:16px;height:16px;color:var(--accent)}

/* compact card when the board is phone-sized */
@container (max-width:430px){
  .gate,.completion-overlay{padding:10px}
  .gate-card,.completion-card{padding:16px 16px 12px;border-radius:20px}
  .gate-icon,.completion-icon{width:42px;height:42px;margin-bottom:8px;border-radius:13px}
  .gate-icon img{width:42px;height:42px;border-radius:12px}
  .gate-icon svg,.completion-icon svg{width:22px;height:22px}
  .gate-title,.completion-title{font-size:21px}
  .gate-meta{font-size:13px}
  .gate-meta .big-time{font-size:34px;margin:2px 0 0}
  .gate-levels{margin-top:12px}
  .gate-levels .seg{height:32px;font-size:12px}
  .gate-levels .segment.level-tabs .seg{height:46px;gap:4px}
  #gatePrimary{margin-top:12px}
  .btn.big{min-height:50px;font-size:16px}
  .gate-foot{margin-top:8px;font-size:11px}
  .completion-time{font-size:38px;margin-top:6px}
  .completion-stats{margin-top:12px}
  .completion-actions{margin-top:12px}
  .completion-actions .btn{min-height:42px}
}
@container (max-width:330px){
  .gate-icon,.completion-icon{display:none}
  .gate-foot{display:none}
}

/* completion */
.completion-overlay{background:color-mix(in srgb,var(--bg) 40%,transparent);backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px)}
.completion-icon{background:color-mix(in srgb,var(--gold) 18%,transparent);color:var(--gold)}
.completion-time{margin-top:10px;font-size:46px;line-height:1;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.035em}
.completion-stats{margin-top:18px;display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.completion-stats>div{padding:10px 4px;border-radius:13px;background:var(--surface-2)}
.completion-stats span{display:block;color:var(--muted);font-size:11px;font-weight:700}
.completion-stats strong{display:block;margin-top:4px;font-size:16px;font-variant-numeric:tabular-nums}
.completion-challenge{margin-top:10px;padding:10px;border-radius:13px;background:var(--accent-soft);font-size:13px;font-weight:700}
.completion-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:16px}
.completion-actions #completionNew{grid-column:1/-1}
.completion-actions .btn{min-width:0;font-size:14px;padding:0 10px}
/* three across: icon above its label, as in the tool bar, so "Classement" or "Leaderboard" always fits
   inside its button; a label that still cannot fit (very large text) wraps instead of spilling out */
.completion-actions .btn:not(#completionNew){flex-direction:column;gap:4px;min-height:56px;padding:7px 4px;font-size:13px;line-height:1.15}
.completion-actions .btn:not(#completionNew) svg{width:19px;height:19px;flex:0 0 auto}
.completion-actions .btn>span{min-width:0;max-width:100%;text-align:center;overflow-wrap:anywhere}

/* ============================================================
   Tools + number pad
   ============================================================ */
.tools{display:grid;grid-template-columns:repeat(5,1fr);gap:6px}
.tool{
  height:58px;
  border:0;background:transparent;
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;
  color:var(--text-2);
  border-radius:14px;
  transition:background .15s,color .15s,transform .12s var(--ease);
}
.tool:hover:not(:disabled){background:var(--surface-2)}
.tool:active:not(:disabled){transform:scale(.94)}
.tool:disabled{opacity:.38}
.tool-icon{
  position:relative;
  width:44px;height:34px;border-radius:12px;
  display:grid;place-items:center;
  background:var(--surface);
  border:1px solid var(--line);
  box-shadow:var(--shadow-sm);
}
.tool-icon svg{width:19px;height:19px}
.tool-label{font-size:12px;font-weight:650;line-height:1}
.tool-badge,.tool-flag{
  position:absolute;top:-7px;right:-9px;
  min-width:18px;height:18px;padding:0 5px;
  border-radius:99px;
  display:grid;place-items:center;
  font-size:10px;font-weight:800;line-height:1;
  font-variant-numeric:tabular-nums;
  background:var(--accent);color:var(--accent-ink);
  border:2px solid var(--bg);
}
.tool-flag{background:var(--surface-3);color:var(--muted);font-size:9px;letter-spacing:.03em}
.tool.active{color:var(--accent)}
.tool.active .tool-icon{background:var(--accent);border-color:transparent;color:var(--accent-ink)}
.tool.active .tool-flag{background:var(--accent);color:var(--accent-ink)}
.tool:disabled .tool-badge{background:var(--surface-3);color:var(--muted)}

/* ============================================================
   Number pad — pops up right next to the selected cell
   ============================================================ */
.pad{
  --key:46px;
  position:absolute;z-index:15;
  padding:7px;
  border:1px solid var(--line-2);
  border-radius:18px;
  background:var(--surface);
  box-shadow:var(--shadow-lg),0 0 0 1px rgba(0,0,0,.02);
  animation:padIn .16s var(--ease) both;
}
.pad[data-side="above"]{animation-name:padInUp}
.pad[data-side="right"]{animation-name:padInRight}
.pad[data-side="left"]{animation-name:padInLeft}
@keyframes padIn{from{opacity:0;transform:translateY(-6px) scale(.95)}}
@keyframes padInUp{from{opacity:0;transform:translateY(6px) scale(.95)}}
@keyframes padInRight{from{opacity:0;transform:translateX(-6px) scale(.95)}}
@keyframes padInLeft{from{opacity:0;transform:translateX(6px) scale(.95)}}
.pad-caret{
  position:absolute;width:14px;height:14px;
  background:var(--surface);
  border:1px solid var(--line-2);
}
.pad[data-side="below"] .pad-caret{top:-8px;left:var(--caret-x);transform:translateX(-50%) rotate(45deg);border-right:0;border-bottom:0}
.pad[data-side="above"] .pad-caret{bottom:-8px;left:var(--caret-x);transform:translateX(-50%) rotate(45deg);border-left:0;border-top:0}
.pad[data-side="right"] .pad-caret{left:-8px;top:var(--caret-y);transform:translateY(-50%) rotate(45deg);border-top:0;border-right:0}
.pad[data-side="left"] .pad-caret{right:-8px;top:var(--caret-y);transform:translateY(-50%) rotate(45deg);border-bottom:0;border-left:0}
.pad-keys{
  position:relative;
  display:grid;grid-template-columns:repeat(3,var(--key));gap:5px;
}
.key{
  position:relative;
  width:var(--key);height:var(--key);padding:0;
  border:1px solid var(--line);
  border-radius:12px;
  background:var(--surface-2);
  color:var(--cell-user-text);
  font-family:var(--font-digit);
  display:grid;place-items:center;
  transition:transform .08s var(--ease),background .12s;
}
.key b{font-size:calc(var(--key) * .5);font-weight:650;line-height:1}
.key small{
  position:absolute;right:5px;bottom:3px;
  font-family:var(--font-ui);font-size:9px;font-weight:700;color:var(--muted);
  font-variant-numeric:tabular-nums;
}
.key:hover:not(:disabled){background:var(--accent-soft-2)}
.key:active:not(:disabled){transform:scale(.9);background:var(--accent);color:var(--accent-ink)}
.key:disabled{opacity:.22;cursor:default}
.key.dim{opacity:.4}
.key.done{opacity:.22}
.key.notes-mode{color:var(--text-2)}
.key.notes-mode b{font-family:var(--font-ui);font-size:calc(var(--key) * .38);font-weight:700}
.pad-foot{position:relative;display:grid;grid-template-columns:1fr auto;gap:5px;margin-top:5px}
.pad-tool{
  height:34px;padding:0 10px;
  border:1px solid var(--line);border-radius:10px;
  background:transparent;color:var(--text-2);
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  font-size:12px;font-weight:700;
}
.pad-tool svg{width:16px;height:16px}
.pad-tool.active{background:var(--accent);border-color:transparent;color:var(--accent-ink)}
.pad-tool:disabled{opacity:.35;cursor:default}
#padErase{width:44px;padding:0}

/* ============================================================
   Toast
   ============================================================ */
.toast{
  position:fixed;left:50%;top:calc(env(safe-area-inset-top) + 64px);
  z-index:90;
  max-width:calc(100vw - 32px);
  padding:10px 16px;
  border-radius:999px;
  background:var(--text);color:var(--bg);
  font-size:14px;font-weight:700;
  box-shadow:var(--shadow-lg);
  transform:translate(-50%,-12px);opacity:0;pointer-events:none;
  transition:opacity .2s,transform .25s var(--ease);
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
}
.toast.show{opacity:1;transform:translate(-50%,0)}
.toast.danger{background:var(--danger);color:#fff}
.toast.success{background:var(--success);color:#fff}
.toast.coach{white-space:normal;width:max-content;max-width:min(440px,calc(100vw - 32px));border-radius:16px;padding:11px 16px;
  font-weight:600;line-height:1.45;text-align:left;background:var(--surface);color:var(--text);box-shadow:var(--shadow-lg),inset 0 0 0 1px var(--plus-gold)}
.cell.coach-unit{animation:coachUnit 1.8s ease-out}
@keyframes coachUnit{0%,70%{box-shadow:inset 0 0 0 2px var(--plus-gold)}100%{box-shadow:none}}
@media (prefers-reduced-motion:reduce){.cell.coach-unit{animation:none;box-shadow:inset 0 0 0 2px var(--plus-gold)}}

/* ============================================================
   Sheets
   ============================================================ */
.overlay{
  position:fixed;inset:0;z-index:80;
  display:flex;align-items:flex-end;justify-content:center;
  padding:0;
  background:var(--scrim);
  backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px);
  animation:fadeIn .2s ease both;
}
.sheet{
  width:min(100%,560px);
  max-height:88dvh;
  display:flex;flex-direction:column;
  border-radius:24px 24px 0 0;
  background:var(--surface);
  box-shadow:var(--shadow-lg);
  padding-bottom:env(safe-area-inset-bottom);
  overflow:hidden;
  animation:sheetIn .32s var(--ease) both;
}
@keyframes sheetIn{from{transform:translateY(40px);opacity:.4}}
/* above the on-screen keyboard where it covers the page (--kb is set by app.js from the visual viewport) */
.overlay .sheet{margin-bottom:var(--kb,0px);max-height:calc(88dvh - var(--kb,0px))}
.sheet-head{
  display:flex;align-items:flex-start;justify-content:space-between;gap:12px;
  padding:18px 18px 10px;
  border-bottom:1px solid var(--line);
}
.sheet-title{font-size:20px;font-weight:800;letter-spacing:-.02em}
.sheet-note{margin-top:3px;color:var(--muted);font-size:13px;line-height:1.4}
.sheet-note:empty{display:none}
.sheet-body{
  flex:1 1 auto;min-height:0;
  overflow-y:auto;overflow-x:hidden;
  padding:6px 16px 20px;
  overscroll-behavior:contain;
}
.sheet-body::-webkit-scrollbar-track{margin:6px 0 14px}
.section-title{
  font-size:11px;font-weight:800;color:var(--muted);
  text-transform:uppercase;letter-spacing:.09em;
  padding:16px 2px 8px;
}

/* segmented control with a sliding pill */
.segment{
  --n:4;--i:0;
  position:relative;isolation:isolate;
  display:grid;grid-template-columns:repeat(var(--n),minmax(0,1fr));
  padding:4px;
  border-radius:14px;
  background:var(--surface-2);
}
.seg-pill{
  position:absolute;z-index:0;
  top:4px;bottom:4px;left:4px;
  width:calc((100% - 8px) / var(--n));
  border-radius:10px;
  background:var(--seg-pill);
  box-shadow:0 1px 2px rgba(16,24,40,.08),0 2px 8px -2px rgba(16,24,40,.12);
  transform:translateX(calc(var(--i) * 100%));
  transition:transform .34s cubic-bezier(.3,1.25,.4,1);
}
.seg{
  position:relative;z-index:1;
  height:38px;min-width:0;padding:0 6px;
  border:0;border-radius:10px;background:transparent;
  display:inline-flex;align-items:center;justify-content:center;gap:7px;
  font-weight:700;font-size:13px;color:var(--muted);
  white-space:nowrap;
  transition:color .2s;
}
.seg span{overflow:hidden;text-overflow:ellipsis}
.seg:hover{color:var(--text-2)}
.seg.active{color:var(--text)}
.seg svg{width:17px;height:17px;transition:color .2s}
.seg.active svg{color:var(--accent)}
.seg:focus-visible{outline-offset:-2px}
.segment.with-icons .seg{height:44px}
/* stats level tabs: difficulty dots above the label */
.segment.level-tabs .seg{flex-direction:column;gap:5px;height:54px}
.seg .level-dots i{width:6px;height:6px;background:color-mix(in srgb,var(--muted) 28%,transparent);transition:background .2s}
.seg .level-dots i.on{background:var(--muted)}
.seg.active .level-dots i.on{background:var(--accent)}
.record-card .lvl{display:flex;align-items:center;gap:8px}

/* level list (new game sheet) */
.level-list{display:grid;gap:8px;margin-top:10px}
.level-row{
  width:100%;
  display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;
  padding:14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--surface);
  text-align:left;
  transition:background .15s,border-color .15s,transform .12s var(--ease);
}
.level-row:hover{background:var(--surface-2)}
.level-row:active{transform:scale(.99)}
.level-row.current{border-color:var(--accent);background:var(--accent-soft)}
.level-row .lv-name{font-weight:800;font-size:16px}
.level-row .lv-sub{color:var(--muted);font-size:12px;margin-top:2px;font-weight:600}
.level-row .lv-best{text-align:right;font-variant-numeric:tabular-nums;font-weight:750;font-size:14px}
.level-row .lv-best small{display:block;color:var(--muted);font-size:11px;font-weight:600}
.level-row .level-dots i{width:7px;height:7px}

/* settings */
.setting-card{padding:16px;border:1px solid var(--line);border-radius:18px;background:var(--surface)}
.setting-card+.setting-card{margin-top:12px}
.sheet-body>.setting-card:first-child{margin-top:10px}
.setting-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:14px}
.setting-icon{
  flex:0 0 auto;width:38px;height:38px;border-radius:12px;
  display:grid;place-items:center;
  background:var(--accent-soft);color:var(--accent);
}
.setting-icon svg{width:20px;height:20px}
.setting-name{font-weight:800;font-size:16px}
.setting-sub{margin-top:2px;color:var(--muted);font-size:13px;line-height:1.4}

.mode-desc{
  margin-top:10px;
  display:flex;align-items:flex-start;gap:8px;
  color:var(--text-2);font-size:13px;line-height:1.45;
}
.mode-desc svg{width:16px;height:16px;margin-top:1px;color:var(--accent)}

.feat-list{margin-top:12px;display:grid;gap:8px}
.feat{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;
  padding:10px 12px;
  border-radius:14px;
  background:var(--surface-2);
  transition:opacity .25s;
}
.feat-name{font-weight:750;font-size:14px}
.feat-desc{margin-top:2px;color:var(--muted);font-size:12px;line-height:1.4}
.feat-state{
  padding:4px 9px;border-radius:99px;
  font-size:11px;font-weight:800;white-space:nowrap;
  background:var(--accent);color:var(--accent-ink);
  transition:background .2s,color .2s;
}
.feat.is-off .feat-state{background:var(--surface-3);color:var(--muted)}
.feat.is-off .feat-name{color:var(--text-2)}

/* mini illustrations — they react to the current mode */
.feat-art{
  display:grid;gap:3px;
  padding:5px;border-radius:10px;
  background:var(--surface);border:1px solid var(--line);
  font-family:var(--font-digit);font-weight:700;font-size:11px;line-height:1;
}
.feat-art i{font-style:normal;display:grid;place-items:center;border-radius:5px;transition:opacity .25s,background .25s,color .25s}
.mini-pad{grid-template-columns:repeat(3,17px)}
.mini-pad i{height:17px;background:var(--surface-2);color:var(--cell-user-text)}
.mini-pad i.x{opacity:.22}
.feat.is-off .mini-pad i.x{opacity:1}
.mini-grid{grid-template-columns:repeat(3,17px);gap:0;padding:0;overflow:hidden}
.mini-grid i{height:17px;color:var(--text);border-right:1px solid var(--grid-thin);border-bottom:1px solid var(--grid-thin);border-radius:0}
.mini-grid i:nth-child(3n){border-right:0}
.mini-grid i:nth-child(n+7){border-bottom:0}
.mini-grid i.h{background:var(--cell-same);color:var(--accent)}
.feat.is-off .mini-grid i.h{background:transparent;color:var(--text)}
/* the keypad's counts: the same row, with its own switch (it does not follow the assist mode) */
.feat.feat-switch{cursor:pointer}
.mini-pad.counts i{position:relative}
.mini-pad.counts b{position:absolute;right:1px;bottom:0;font-size:7px;font-weight:800;line-height:1;color:var(--accent-strong);transition:opacity .25s}
.feat-switch:not(.is-on) .mini-pad.counts b{opacity:0}
.feat-switch:not(.is-on) .mini-pad.counts i.x{opacity:1}
.feat-switch .switch{grid-column:3}

.assist-always{
  margin-top:12px;
  display:flex;align-items:flex-start;gap:8px;
  color:var(--muted);font-size:12px;line-height:1.45;
}
.assist-always svg{width:15px;height:15px;margin-top:1px;color:var(--success)}

/* keyboard shortcuts */
.kb-groups{display:grid;gap:10px}
.kb-group{padding:12px;border-radius:14px;background:var(--surface-2)}
.kb-group-title{
  display:flex;align-items:center;gap:7px;margin-bottom:10px;
  font-size:11px;font-weight:800;color:var(--muted);
  text-transform:uppercase;letter-spacing:.09em;
}
.kb-group-title svg{width:14px;height:14px}
.kb-rows{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px}
.kb-row{display:flex;align-items:center;gap:10px;min-width:0}
.kb-keys{flex:0 0 auto;display:inline-flex;align-items:center;gap:4px}
.kb-label{font-size:13px;color:var(--text-2);line-height:1.3}
.kb-to{color:var(--muted);font-size:11px}
kbd{
  min-width:28px;height:28px;padding:0 8px;
  display:inline-grid;place-items:center;
  font-family:var(--font-ui);font-size:12px;font-weight:750;line-height:1;
  border-radius:8px;
  background:var(--surface);
  border:1px solid var(--line-2);
  box-shadow:0 2px 0 var(--line-2);
  color:var(--text);white-space:nowrap;
  transform:translateY(-1px);
}
.kb-arrows{display:inline-grid;grid-template-columns:repeat(3,22px);grid-template-rows:repeat(2,20px);gap:3px}
.kb-arrows kbd{min-width:0;width:22px;height:20px;padding:0;font-size:10px;border-radius:6px}
.kb-arrows .up{grid-column:2;grid-row:1}
.kb-arrows .left{grid-column:1;grid-row:2}
.kb-arrows .down{grid-column:2;grid-row:2}
.kb-arrows .right{grid-column:3;grid-row:2}
@media (max-width:639px),(hover:none),(pointer:coarse){.kb-card{display:none}}
@media (max-width:520px){
  .segment.with-icons .seg{flex-direction:column;gap:3px;height:58px;font-size:12px}
  .segment.with-icons .seg svg{width:19px;height:19px}
  .setting-card{padding:14px}
  .setting-icon{width:34px;height:34px}
  .feat{grid-template-columns:auto minmax(0,1fr);align-items:start;gap:4px 12px;padding:12px}
  .feat-art{grid-row:1 / span 2;align-self:center}
  .feat-state{grid-column:2;justify-self:start;margin-top:4px}
  .feat.feat-switch{grid-template-columns:auto minmax(0,1fr) auto;align-items:center}
  .feat-switch .switch{grid-row:1 / span 2;align-self:center}
}

.about{margin-top:18px;display:flex;align-items:center;gap:12px;color:var(--muted);font-size:12px}
.about img{width:36px;height:36px;border-radius:10px}

/* ============================================================
   Install & feedback
   ============================================================ */
.install-btn{position:relative;color:var(--accent)}
.install-btn .dot{
  position:absolute;top:7px;right:7px;width:8px;height:8px;border-radius:99px;
  background:var(--danger);box-shadow:0 0 0 2px var(--surface);
  transform:scale(0);transition:transform .25s var(--ease);
}
.install-btn.has-dot .dot{transform:scale(1);animation:dotPulse 2.4s ease-in-out infinite}
@keyframes dotPulse{0%,100%{box-shadow:0 0 0 2px var(--surface)}50%{box-shadow:0 0 0 2px var(--surface),0 0 0 6px color-mix(in srgb,var(--danger) 20%,transparent)}}

.install-sheet .sheet-head{border-bottom:0;padding-bottom:0}
.install-hero{text-align:center;padding:0 0 6px}
.install-icon{
  width:84px;height:84px;margin:0 auto 12px;
  border-radius:22px;
  box-shadow:0 18px 40px -14px var(--accent),0 2px 6px rgba(16,24,40,.12);
  animation:iconFloat 3.6s ease-in-out infinite;
}
.install-icon img{width:84px;height:84px;border-radius:22px;display:block}
@keyframes iconFloat{50%{transform:translateY(-4px)}}
.install-name{font-size:22px;font-weight:800;letter-spacing:-.02em}
.install-tagline{margin-top:3px;color:var(--muted);font-size:13px;font-weight:600}
.install-benefits{margin:18px 0 4px;display:grid;grid-template-columns:1fr 1fr;gap:8px}
.benefit{
  display:flex;align-items:center;gap:10px;
  padding:12px;border-radius:14px;background:var(--surface-2);
  font-size:13px;font-weight:650;line-height:1.3;color:var(--text-2);
}
.benefit svg{width:20px;height:20px;color:var(--accent);flex:0 0 auto}
.install-action{display:grid;gap:8px;margin-top:12px}
.install-action>.btn.big{margin-top:6px}
.install-steps{list-style:none;margin:0;padding:0;display:grid;gap:8px}
.install-steps li{
  display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;
  padding:12px;border:1px solid var(--line);border-radius:14px;
}
.step-num{
  width:28px;height:28px;border-radius:99px;display:grid;place-items:center;
  background:var(--accent);color:var(--accent-ink);font-weight:800;font-size:13px;
}
.step-title{font-weight:750;font-size:14px}
.step-hint{margin-top:2px;color:var(--muted);font-size:12px;line-height:1.4}
.step-icon{
  width:38px;height:38px;border-radius:11px;display:grid;place-items:center;
  background:var(--accent-soft);color:var(--accent);
}
.install-note{
  padding:10px 12px;border-radius:12px;background:var(--surface-2);
  color:var(--text-2);font-size:12px;line-height:1.45;
}
.install-never{
  display:block;margin:10px auto 0;padding:8px;
  border:0;background:none;color:var(--muted);font-size:12px;font-weight:600;
  text-decoration:underline;text-underline-offset:3px;
}

/* bottom nudge */
.nudge{
  position:fixed;z-index:70;
  left:50%;bottom:calc(env(safe-area-inset-bottom) + 14px);
  width:min(calc(100vw - 24px),460px);
  transform:translateX(-50%);
  display:flex;align-items:center;gap:12px;
  padding:12px 12px 12px 14px;
  border:1px solid var(--line-2);
  border-radius:20px;
  background:var(--surface);
  box-shadow:var(--shadow-lg);
  animation:nudgeIn .45s cubic-bezier(.2,1.2,.3,1) both;
}
.nudge.leaving{animation:nudgeOut .22s ease both}
@keyframes nudgeIn{from{opacity:0;transform:translate(-50%,40px) scale(.96)}}
@keyframes nudgeOut{to{opacity:0;transform:translate(-50%,20px)}}
.nudge-logo{width:42px;height:42px;border-radius:12px;flex:0 0 auto}
.nudge-text{flex:1 1 auto;min-width:0}
.nudge-title{font-weight:800;font-size:15px}
.nudge-sub{margin-top:1px;color:var(--muted);font-size:12px;line-height:1.35}
.nudge-cta{min-height:40px;padding:0 14px;font-size:14px;flex:0 0 auto}
.nudge-close{
  flex:0 0 auto;width:30px;height:30px;border:0;border-radius:99px;
  display:grid;place-items:center;background:var(--surface-2);color:var(--muted);
}
.nudge-close svg{width:15px;height:15px}
.nudge[data-kind="rate"]{flex-wrap:wrap}
.nudge[data-kind="rate"] .stars{flex:0 0 auto}
@media (max-width:420px){
  .nudge[data-kind="rate"] .nudge-text{flex-basis:calc(100% - 42px)}
  .nudge[data-kind="rate"] .stars{order:3;width:100%;justify-content:center}
}

/* stars */
.stars{display:flex;gap:2px}
.star{
  width:34px;height:34px;padding:0;border:0;background:none;
  display:grid;place-items:center;color:var(--muted);
  transition:transform .15s var(--ease),color .15s;
}
.star svg{width:26px;height:26px;fill:transparent;stroke:currentColor;stroke-width:1.6;transition:fill .15s}
.star.on{color:var(--gold)}
.star.on svg{fill:currentColor}
.star:hover{transform:scale(1.12)}
.star.pop{animation:starPop .35s var(--ease)}
@keyframes starPop{50%{transform:scale(1.35) rotate(-8deg)}}
.stars.large{justify-content:center;gap:6px;margin-top:14px}
.stars.large .star{width:48px;height:48px}
.stars.large .star svg{width:38px;height:38px}
.star-label{text-align:center;margin-top:6px;font-weight:700;color:var(--text-2);min-height:20px}

.rate-more.reveal{animation:cardIn .3s var(--ease) both}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{
  height:36px;padding:0 14px;border:1px solid var(--line-2);border-radius:99px;
  background:var(--surface);font-size:13px;font-weight:650;color:var(--text-2);
  transition:background .15s,color .15s,border-color .15s;
}
.chip.on{background:var(--accent);border-color:transparent;color:var(--accent-ink)}
.rate-comment{
  width:100%;margin-top:14px;padding:12px 14px;
  border:1px solid var(--line-2);border-radius:14px;
  background:var(--surface-2);color:var(--text);
  font:inherit;font-size:14px;resize:vertical;min-height:80px;
}
.rate-comment:focus{outline:2px solid var(--accent);outline-offset:0;border-color:transparent}
.rate-send{margin-top:12px}

.rate-thanks{text-align:center;padding:4px 0 6px}
.thanks-icon{
  width:64px;height:64px;margin:0 auto 12px;border-radius:20px;
  display:grid;place-items:center;
  background:color-mix(in srgb,var(--danger) 14%,transparent);color:var(--danger);
  animation:starPop .5s var(--ease);
}
.thanks-icon svg{width:30px;height:30px;fill:currentColor}
.thanks-title{font-size:22px;font-weight:800}
.thanks-text{margin-top:4px;color:var(--muted);font-size:14px}
.thanks-pitch{margin-top:14px;padding:12px;border-radius:14px;background:var(--accent-soft);font-weight:650;font-size:14px}
.thanks-actions{display:grid;gap:8px;margin-top:14px}
.thanks-actions a.btn{text-decoration:none}

/* settings: app card */
.app-rows{display:grid;gap:6px}
.app-row{
  width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;
  padding:10px 10px 10px 10px;border:0;border-radius:14px;background:var(--surface-2);text-align:left;
  transition:background .15s;
}
.app-row:hover{background:var(--surface-3)}
.app-row>svg{width:16px;height:16px;color:var(--muted);transform:rotate(-90deg)}
.app-row-icon{width:36px;height:36px;border-radius:11px;display:grid;place-items:center}
.app-row-icon.accent{background:var(--accent);color:var(--accent-ink)}
.app-row-icon.gold{background:color-mix(in srgb,var(--gold) 20%,transparent);color:var(--gold)}
.app-row-icon.gold svg{fill:currentColor}
.app-row-title{display:block;font-weight:750;font-size:14px}
.app-row-sub{display:block;margin-top:1px;color:var(--muted);font-size:12px}
.app-card .setting-icon{background:color-mix(in srgb,var(--danger) 12%,transparent);color:var(--danger)}
@media (max-width:420px){
  .benefit{flex-direction:column;align-items:flex-start;gap:6px;font-size:12px;padding:10px 12px}
  .install-icon,.install-icon img{width:72px;height:72px;border-radius:19px}
  .install-benefits{margin-top:14px}
}
.privacy-note{margin-top:12px;display:flex;gap:8px;align-items:flex-start;color:var(--muted);font-size:12px;line-height:1.45}
.privacy-note svg{width:15px;height:15px;margin-top:1px;color:var(--success);flex:0 0 auto}
.app-card .setting-icon.logo{background:none;padding:0}
.app-card .setting-icon.logo img{width:38px;height:38px;border-radius:11px}

/* stats */
.summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.summary-card{padding:12px 8px;border-radius:14px;background:var(--surface-2);text-align:center}
.summary-card .n{font-size:18px;font-weight:800;font-variant-numeric:tabular-nums}
.summary-card .k{font-size:11px;color:var(--muted);margin-top:3px;font-weight:600}
.records-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.record-card{padding:12px;border-radius:14px;background:var(--surface-2)}
.record-card .row1{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.record-card .lvl{font-weight:800}
.record-card .best{font-weight:800;font-variant-numeric:tabular-nums}
.record-card .meta{display:flex;justify-content:space-between;gap:8px;color:var(--muted);font-size:12px}
.trend-card{margin-top:8px;padding:12px;border-radius:14px;background:var(--surface-2)}
.trend-head{display:flex;justify-content:space-between;gap:12px;margin-bottom:8px;color:var(--muted);font-size:12px;font-weight:700}
.trend-head span:last-child{color:var(--text);font-variant-numeric:tabular-nums}
.trend-svg{width:100%;height:auto;display:block;overflow:visible}
.trend-line{fill:none;stroke:var(--accent);stroke-width:2.4;vector-effect:non-scaling-stroke}
.trend-area{fill:var(--accent-soft);stroke:none}
.trend-dot{fill:var(--accent);stroke:none}
.history-list{display:grid;gap:6px}
.history-row{
  padding:10px 12px;border-radius:14px;background:var(--surface-2);
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;
}
.history-main{display:flex;align-items:center;gap:8px;font-weight:700;font-size:14px}
.history-meta{margin-top:3px;color:var(--muted);font-size:11px}
.history-time{font-weight:800;font-variant-numeric:tabular-nums}
.history-dot{width:8px;height:8px;border-radius:99px;background:var(--muted);flex:0 0 auto}
.history-dot.perfect{background:var(--success)}
.history-dot.solved{background:var(--accent)}
.export-row{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.install-row{
  width:100%;padding:14px;margin-top:8px;
  border:1px solid var(--accent);border-radius:16px;background:var(--accent-soft);
  display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;
}
.install-row .main{font-weight:800}
.install-row .sub{margin-top:2px;color:var(--muted);font-size:12px}
.sheet-loading,.empty-state,.data-note{padding:12px 2px;color:var(--muted);font-size:12px;line-height:1.45}

/* confirm dialog */
.confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:16px}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width:374px){
  :root{--gutter:10px}
  .tool{height:54px}
  .info-label{display:none}
  .brand-name{font-size:18px}
}
@media (max-height:700px){
  .app{--reserve:calc(210px + env(safe-area-inset-top) + env(safe-area-inset-bottom))}
  .tool{height:50px;gap:3px}
  .tool-icon{height:30px}
  .header{height:46px}
}
/* larger screens: same centred single column, just more room */
@media (min-width:700px) and (min-height:700px){
  .app{--board:min(calc(100dvh - 250px),680px,calc(100vw - 48px));padding-top:16px}
  .game{gap:16px}
  .tool{height:64px}
  .overlay{align-items:center;padding:24px}
  .sheet,.overlay .sheet{border-radius:24px;max-height:min(760px,calc(90dvh - var(--kb,0px)))}
  .toast{top:22px}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms!important;animation-delay:0ms!important;transition-duration:.01ms!important}
}

/* ============================================================
   Tooltips (mouse only)
   ============================================================ */
.tip{
  position:fixed;z-index:100;left:0;top:0;
  display:flex;align-items:center;gap:8px;
  padding:7px 10px;
  border-radius:10px;
  background:var(--text);color:var(--bg);
  font-size:12px;font-weight:650;line-height:1.2;white-space:nowrap;
  box-shadow:0 8px 24px -8px rgba(0,0,0,.45);
  pointer-events:none;
  opacity:0;transform:translateY(-3px);
  transition:opacity .14s ease,transform .14s ease;
}
.tip[data-side="above"]{transform:translateY(3px)}
.tip.show{opacity:1;transform:none}
.tip::before{
  content:"";position:absolute;left:var(--arrow-x,50%);width:8px;height:8px;
  background:inherit;transform:translateX(-50%) rotate(45deg);
}
.tip[data-side="below"]::before{top:-4px}
.tip[data-side="above"]::before{bottom:-4px}
.tip kbd{
  min-width:20px;height:20px;padding:0 6px;border-radius:6px;font-size:11px;
  background:color-mix(in srgb,var(--bg) 18%,transparent);
  border:1px solid color-mix(in srgb,var(--bg) 28%,transparent);
  box-shadow:none;color:inherit;transform:none;
}

/* ============================================================
   Sound switch
   ============================================================ */
.switch-row{display:flex;align-items:center;gap:12px;cursor:pointer}
.switch-text{flex:1 1 auto;min-width:0;display:block}
.switch-text .setting-name,.switch-text .setting-sub{display:block}
.switch{
  appearance:none;-webkit-appearance:none;flex:0 0 auto;
  position:relative;width:50px;height:30px;margin:0;border-radius:99px;
  background:var(--surface-3);cursor:pointer;
  transition:background .2s;
}
.switch::after{
  content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:99px;
  background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);
  transition:transform .28s cubic-bezier(.3,1.3,.4,1);
}
.switch:checked{background:var(--accent)}
.switch:checked::after{transform:translateX(20px)}
.switch:focus-visible{outline:2px solid var(--accent);outline-offset:2px}

/* ============================================================
   Notes explainer
   ============================================================ */
.notes-demo{display:flex;align-items:center;justify-content:center;gap:16px;margin:10px 0 16px}
.demo-cell{
  width:92px;height:92px;border-radius:16px;
  border:2px solid var(--grid-bold);background:var(--cell);
  box-shadow:var(--shadow);
}
.notes-cell{display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);padding:6px}
.notes-cell span{display:grid;place-items:center;font-weight:700;font-size:17px;color:var(--note-text)}
.notes-cell .n{opacity:0;animation:noteIn 4.5s infinite}
.notes-cell .n4{animation-delay:.35s}
.notes-cell .n7{animation-delay:.7s;color:var(--accent)}
@keyframes noteIn{0%{opacity:0;transform:scale(.4)}8%,70%{opacity:1;transform:none}85%,100%{opacity:0}}
.final-cell{display:grid;place-items:center;font-family:var(--font-digit)}
.final-cell b{font-size:46px;font-weight:650;color:var(--cell-user-text);opacity:0;animation:finalIn 4.5s infinite}
@keyframes finalIn{0%,55%{opacity:0;transform:scale(.5)}65%,90%{opacity:1;transform:none}100%{opacity:0}}
.demo-arrow{color:var(--muted)}
.demo-arrow svg{transform:rotate(-90deg);width:22px;height:22px}
.notes-lead{margin:0 0 12px;text-align:center;font-size:15px;font-weight:650;color:var(--text)}
.notes-points{list-style:none;margin:0 0 16px;padding:0;display:grid;gap:8px}
.notes-points li{display:flex;gap:12px;align-items:flex-start;padding:12px;border-radius:14px;background:var(--surface-2);font-size:13px;line-height:1.45;color:var(--text-2)}
.notes-points li>svg{width:18px;height:18px;flex:0 0 auto;margin-top:1px;color:var(--accent)}
.notes-points kbd{min-width:24px;height:22px;font-size:11px;margin-left:4px}

/* ============================================================
   v17.6 — sound button, assist tool, tiers, bigger touch pad
   ============================================================ */
.sound-btn.muted{color:var(--muted)}
@media (max-width:400px){
  .header-actions{gap:4px}
  .header .iconbtn{width:36px;height:36px;border-radius:11px}
  .header .iconbtn svg{width:18px;height:18px}
  .brand{gap:8px}
  .brand-mark{width:28px;height:28px}
}
@media (max-width:350px){.brand-name{display:none}}

/* assist tool flag: AUTO is a bit wider */
#assistFlag{min-width:22px;font-size:8.5px}
.tool#assistTool:not(.active) .tool-icon{color:var(--muted)}

/* bigger keys on touch screens */
.pad.touch{padding:8px;border-radius:20px}
.pad.touch .pad-keys{gap:6px}
.pad.touch .key{border-radius:14px}
.pad.touch .key small{font-size:10px;right:6px;bottom:4px}
.pad.touch .pad-foot{gap:6px;margin-top:6px}
.pad.touch .pad-tool{height:44px;font-size:13px;border-radius:12px}
.pad.touch #padErase{width:56px}

/* tier badges */
.tier-badge{
  display:inline-flex;align-items:center;gap:5px;
  height:24px;padding:0 9px;border-radius:99px;
  font-size:12px;font-weight:750;white-space:nowrap;
  background:var(--surface-2);color:var(--text-2);
}
.tier-badge svg{width:13px;height:13px;stroke-width:2.4}
.tier-badge.tier-pure{background:color-mix(in srgb,var(--success) 16%,transparent);color:var(--success)}
.tier-badge.tier-perfect{background:var(--accent-soft-2);color:var(--accent)}
.tier-badge.assist-on{color:var(--text-2)}
.tier-badge.assist-off{color:var(--text-2)}
.completion-badges{display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin-top:10px}
.history-main .tier-badge{height:20px;font-size:10.5px;padding:0 7px;margin-left:2px}

/* results tiles */
.summary-card.tier-card{position:relative;padding-top:14px}
.summary-card .s{margin-top:2px;font-size:11px;color:var(--muted);font-variant-numeric:tabular-nums}
.tier-ico{width:26px;height:26px;margin:0 auto 6px;border-radius:9px;display:grid;place-items:center;background:var(--surface-3);color:var(--text-2)}
.tier-ico svg{width:15px;height:15px;stroke-width:2.3}
.tier-card.tier-perfect .tier-ico{background:var(--accent-soft-2);color:var(--accent)}
.tier-card.tier-pure .tier-ico{background:color-mix(in srgb,var(--success) 18%,transparent);color:var(--success)}
.tier-legend{
  margin-top:10px;display:grid;grid-template-columns:auto 1fr;gap:6px 8px;align-items:center;
  font-size:12px;color:var(--muted);
}
.tier-legend .tier-badge{justify-self:start}
.filter-seg{margin-bottom:8px}
.filter-seg .seg{height:40px}

/* trend dots by tier */
.trend-dot.tier-solved{fill:var(--muted)}
.trend-dot.tier-perfect{fill:var(--accent)}
.trend-dot.tier-pure{fill:var(--success)}
.trend-legend{display:flex;gap:14px;justify-content:flex-end;margin-top:6px;font-size:11px;color:var(--muted)}
.trend-legend span{display:inline-flex;align-items:center;gap:5px}
.trend-legend i{width:8px;height:8px;border-radius:99px;display:inline-block}
.trend-legend i.tier-pure{background:var(--success)}
.trend-legend i.tier-perfect{background:var(--accent)}
.trend-legend i.tier-solved{background:var(--muted)}

/* records per level: tier counts */
.tiers-meta{justify-content:flex-start!important;gap:12px!important;margin-top:4px}
.tiers-meta span{display:inline-flex;align-items:center;gap:4px;font-weight:700}
.tiers-meta svg{width:13px;height:13px;stroke-width:2.4}
.tiers-meta .t-perfect{color:var(--accent)}
.tiers-meta .t-pure{color:var(--success)}
.history-dot.pure{background:var(--success)}
.history-dot.perfect{background:var(--accent)}
.history-dot.solved{background:var(--muted)}
.history-dot.abandoned{background:var(--surface-3)}

/* mistakes: icon always, text label only when there is room */
.info-item{align-items:center}
.info-ico{width:16px;height:16px;color:var(--muted);align-self:center}
.info-item.has-mistakes .info-ico{color:var(--danger)}
@media (min-width:375px){.info-ico{display:none}}

/* completion card fits phone-sized boards with the tier badges */
@container (max-width:430px){
  .completion-icon{display:none}
  .completion-time{font-size:34px;margin-top:4px}
  .completion-badges{margin-top:6px}
  .completion-badges .tier-badge{height:22px;font-size:11.5px;padding:0 8px}
  .completion-stats{margin-top:8px;gap:5px}
  .completion-stats>div{padding:5px 4px}
  .completion-stats strong{font-size:14px;margin-top:1px}
  .completion-actions{margin-top:8px;gap:6px}
  .completion-actions .btn{min-height:40px}
  /* the kicker and the big time already say it: the heading stays for screen readers only */
  .completion-title{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
  .completion-actions .btn:not(#completionNew){gap:2px;min-height:44px;padding:4px 2px;font-size:12px}
  .completion-actions .btn:not(#completionNew) svg{width:17px;height:17px}
  .completion-challenge{margin-top:6px;padding:6px 8px;font-size:12.5px;line-height:1.3}
  /* never more than two lines on a phone (it is read out in full to screen readers) */
  .completion-challenge{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2;overflow:hidden}
}
@container (max-width:330px){
  .completion-time{font-size:30px}
  .completion-card{padding:12px 12px 10px}
  /* the smallest phones: the kicker already names the result (perfect, pure…), the pills go */
  .completion-badges{display:none}
  .completion-time{font-size:28px;margin-top:2px}
  .completion-stats{margin-top:6px}
  .completion-stats>div{padding:4px}
  .completion-challenge{padding:5px 6px;font-size:11.5px}
  .completion-actions{gap:5px}
  .completion-actions .btn:not(#completionNew){font-size:11px;letter-spacing:-.01em}
}

/* ============================================================
   Accessibility (v17.7) — WCAG 2.2 AA / RGAA 4.1
   ============================================================ */
.sprite{position:absolute;width:0;height:0;overflow:hidden}
.sr-only{
  position:absolute!important;width:1px!important;height:1px!important;
  padding:0!important;margin:-1px!important;overflow:hidden!important;
  clip:rect(0 0 0 0)!important;clip-path:inset(50%)!important;white-space:nowrap!important;border:0!important;
}
h1.brand-name,h2.gate-title,h2.completion-title,h2.sheet-title{margin:0}
h2.gate-title,h2.completion-title{margin-top:4px}
.skip-link{
  position:fixed;z-index:200;left:12px;top:-60px;
  padding:10px 14px;border-radius:12px;
  background:var(--accent);color:var(--accent-ink);font-weight:750;text-decoration:none;
  box-shadow:var(--shadow);
  transition:top .15s;
}
.skip-link:focus{top:calc(env(safe-area-inset-top) + 10px)}
/* keyboard focus on a cell: clearly visible, inside the grid */
.cell:focus-visible{outline:3px solid var(--accent);outline-offset:-3px;z-index:1}
.cell.selected .notes{color:var(--note-text-selected)}
/* switch: the "off" track needs a visible edge (non-text contrast 3:1) */
.switch{box-shadow:inset 0 0 0 1.5px var(--grid-bold)}
.switch:checked{box-shadow:none}
/* legal links in Settings › App and in the rating form */
.legal-links{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:12px;font-size:13px}
.legal-links a,.form-privacy a{color:var(--accent);font-weight:650;text-underline-offset:3px}
.form-privacy{margin:8px 2px 0;font-size:12px;line-height:1.45;color:var(--muted)}
@media (forced-colors:active){
  .cell.selected{outline:3px solid Highlight;outline-offset:-3px}
  .tool.active .tool-icon,.pad-tool.active{outline:2px solid Highlight}
}
/* tier badges: darker ink on tinted chips (text contrast 4.5:1) */
:root{--success-ink:#116530;--accent-strong:#3446c4}
@media (prefers-color-scheme:dark){:root:not([data-scheme="light"]){--success-ink:#34d399;--accent-strong:#9fb0ff}}
/* dark chosen in Settings, on a light device */
:root[data-scheme="dark"]{--success-ink:#34d399;--accent-strong:#9fb0ff}
.tier-badge.tier-pure{color:var(--success-ink)}
.tier-badge.tier-perfect{color:var(--accent-strong)}
/* ============================================================
   Sponsor (v17.9) — one identified slot, never during a game.
   While the victory card is up it covers the tool bar exactly
   (same box, no layout shift); the tools are disabled anyway.
   ============================================================ */
.controls{position:relative;container-type:inline-size}
/* at least the tool bar's box; taller (downwards, over the empty space under it) when the text needs it */
.completion-sponsor{position:absolute;left:0;right:0;top:0;min-height:100%;z-index:2;display:flex}
.controls.sponsor-on .tools{visibility:hidden}
.sponsor-strip{
  flex:1 1 auto;min-width:0;
  display:grid;grid-template-columns:36px minmax(0,1fr) 16px;align-items:center;gap:12px;
  padding:9px 12px 9px 11px;border-radius:16px;
  color:var(--text);text-decoration:none;text-align:left;
  transition:background .15s;
}
.completion-sponsor .sponsor-strip{
  background:var(--surface);border:1px solid var(--line);box-shadow:var(--shadow-sm);
  animation:fadeIn .3s ease both;
}
.sponsor-strip:hover{background:var(--surface-2)}
.sponsor-icon{width:36px;height:36px;border-radius:10px;display:block;object-fit:cover}
.sponsor-initial{display:grid;place-items:center;background:var(--accent);color:var(--accent-ink);font-weight:800;font-size:16px}
.sponsor-text{display:flex;flex-direction:column;gap:1px;min-width:0}
.sponsor-by{font-size:11px;line-height:1.3;font-weight:650;letter-spacing:.01em;color:var(--muted)}
.sponsor-name{font-size:14.5px;line-height:1.25;font-weight:750;color:var(--text);overflow-wrap:anywhere}
.sponsor-tagline{margin-top:1px;font-size:12.5px;line-height:1.35;color:var(--text-2);overflow-wrap:anywhere}
.sponsor-strip>svg{width:16px;height:16px;color:var(--text-2);align-self:start;margin-top:2px}
/* Settings ends with one discreet line: today's sponsor, become a sponsor */
.sponsor-foot{margin:14px 4px 2px;text-align:center;font-size:12.5px;line-height:1.6;color:var(--muted)}
.sponsor-foot a{display:inline-block;min-height:24px;color:var(--text-2);font-weight:650;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}
.sponsor-foot a:hover{color:var(--accent-strong)}
a.app-row{color:inherit;text-decoration:none}
.app-row-icon.soft{background:var(--accent-soft-2);color:var(--accent-strong)}
/* primary buttons: white label keeps 4.5:1 on the whole gradient (light theme) */
:root{--btn-top:#556be8}
@media (prefers-color-scheme:dark){:root:not([data-scheme="light"]){--btn-top:var(--accent-2)}}
/* dark chosen in Settings, on a light device */
:root[data-scheme="dark"]{--btn-top:var(--accent-2)}
.btn.primary{background:linear-gradient(180deg,var(--btn-top),var(--accent))}
/* ============================================================
   Grilles du jour, groups, Sudoku+ (v18)
   ============================================================ */
.daily-levels{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.daily-level{
  display:flex;flex-direction:column;align-items:flex-start;gap:6px;
  padding:12px;border:1px solid var(--line);border-radius:16px;background:var(--surface);text-align:left;
  transition:background .15s,border-color .15s,transform .12s var(--ease);
}
.daily-level:hover{background:var(--surface-2)}
.daily-level:active{transform:scale(.97)}
.daily-level.current{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.daily-level.done{background:var(--surface-2)}
.dl-name{font-weight:750;font-size:14px}
.dl-state{display:flex;align-items:center;gap:4px;font-size:12.5px;font-weight:650;color:var(--accent-strong)}
.daily-level.done .dl-state{color:var(--success-ink)}
.dl-state svg{width:14px;height:14px;stroke-width:2.6}
/* New game: three sections that stand out, levels side by side (4 across from 360 px) */
.ng-section{display:grid;gap:12px;margin-top:12px;padding:14px;border-radius:20px;background:var(--surface-2);border:1px solid var(--line)}
.ng-section:first-child{margin-top:4px}
.ng-head{display:grid;grid-template-columns:40px minmax(0,1fr);align-items:center;gap:12px}
.ng-icon{width:40px;height:40px;border-radius:13px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-strong)}
.ng-icon svg{width:22px;height:22px}
.ng-head.plus .ng-icon{background:linear-gradient(135deg,#ffe7a3,#ffc94d);color:#8a5a00}
.ng-text{display:grid;gap:2px;min-width:0}
.ng-text b{font-size:16px;font-weight:800;letter-spacing:-.01em}
.ng-text small{font-size:12.5px;font-weight:600;color:var(--text-2);line-height:1.35}
.ng-section .daily-level,.ng-section .plus-link{background:var(--surface)}
/* one hover for every choice of the sheet, whatever its section */
.ng-section :is(.daily-level,.level-tile,.plus-link){transition:border-color .15s,box-shadow .15s,transform .12s var(--ease)}
.ng-section :is(.daily-level,.level-tile,.plus-link):hover{border-color:var(--accent);background:var(--surface);box-shadow:0 8px 18px -14px rgba(16,24,40,.55)}
.ng-section :is(.daily-level,.level-tile,.plus-link):active{transform:scale(.98)}
.ng-section :is(.daily-level,.level-tile).current,.ng-section :is(.daily-level,.level-tile).current:hover{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);background:var(--accent-soft)}
.ng-section .daily-level.done{background:var(--surface)}
.ng-section .daily-level.paused{background:var(--accent-soft)}
.level-tiles{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
.level-tile{display:flex;flex-direction:column;align-items:flex-start;gap:5px;min-width:0;padding:12px;border:1px solid var(--line);border-radius:16px;
  background:var(--surface);text-align:left;font:inherit;color:var(--text);cursor:pointer;transition:background .15s,border-color .15s,transform .12s var(--ease)}
.level-tile:hover{border-color:var(--accent)}
.level-tile:active{transform:scale(.97)}
.level-tile.current{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent);background:var(--accent-soft)}
.lt-name{font-weight:800;font-size:14.5px}
.lt-sub{display:none;font-size:12px;font-weight:600;color:var(--muted)}
.lt-best{display:flex;flex-direction:column;font-size:13px;font-weight:750;font-variant-numeric:tabular-nums}
.lt-best small{font-size:10.5px;font-weight:650;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
/* with room (a computer, a tablet): random puzzles in 2 × 2, with their givens */
@media (min-width:600px){
  .level-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
  .level-tile{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"dots name best" "dots sub best";align-items:center;column-gap:12px;row-gap:2px;padding:14px}
  .level-tile .level-dots{grid-area:dots}
  .lt-name{grid-area:name;font-size:15.5px}
  .lt-sub{grid-area:sub;display:block}
  .lt-best{grid-area:best;text-align:right;align-items:flex-end}
  .ng-section .plus-links{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:359px){.daily-levels,.level-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:420px){
  .ng-section{padding:12px}
  .daily-level,.level-tile{padding:10px 9px}
  .dl-name,.lt-name{font-size:13.5px}
  .dl-state{font-size:11.5px}
}

.back-link{display:inline-flex;align-items:center;gap:6px;margin:4px 0 12px;padding:7px 14px 7px 10px;border:0;border-radius:99px;background:var(--surface-2);
  color:var(--text);font-weight:750;font-size:14px;cursor:pointer}
.back-link:hover{background:var(--accent-soft);color:var(--accent-strong)}
.back-link svg{width:18px;height:18px;stroke-width:2.2}
.text-btn{border:0;background:transparent;padding:8px 4px;color:var(--accent-strong);font-weight:650;font-size:14px;text-decoration:underline;text-underline-offset:3px}
.text-btn.danger{color:var(--danger)}
.text-btn:disabled{opacity:.5}

/* forms in sheets */
.group-form{display:grid;gap:4px}
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px;font-weight:650;font-size:14px}
.field input{
  width:100%;font:inherit;font-weight:500;font-size:16px;color:var(--text);
  padding:11px 12px;border-radius:12px;border:1px solid var(--line-2);background:var(--surface-2);
}
.field input:focus{outline:2px solid var(--accent);outline-offset:0;border-color:transparent}
.field small{font-weight:500;color:var(--text-2);font-size:12.5px}
.form-error{margin:6px 0 10px;padding:10px 12px;border-radius:12px;background:var(--danger-soft);color:var(--danger);font-weight:650;font-size:14px}
.group-form .btn.big{width:100%;margin-top:8px}
.emoji-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
.emoji-grid button{height:44px;border:1px solid var(--line);border-radius:12px;background:var(--surface-2);font-size:22px;line-height:1}
.emoji-grid button.on{border-color:var(--accent);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent)}

/* list */
.groups-intro{text-align:center;padding:8px 8px 18px}
.groups-intro-icon,.plus-icon{width:56px;height:56px;margin:0 auto 10px;border-radius:18px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-strong)}
.groups-intro-icon svg,.plus-icon svg{width:28px;height:28px}
.groups-intro h3{margin:0 0 6px;font-size:19px;letter-spacing:-.01em}
.groups-intro p{margin:0;color:var(--text-2);font-size:14.5px;line-height:1.5}
.group-list{display:grid;gap:8px;margin-bottom:14px}
.group-row{
  width:100%;display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:12px;
  padding:14px;border:1px solid var(--line-2);border-radius:18px;background:var(--surface);text-align:left;
  box-shadow:0 6px 18px -14px rgba(16,24,40,.45);
}
.group-list .group-emoji{width:52px;height:52px;border-radius:16px;font-size:28px;background:var(--accent-soft)}
.group-list .group-name{font-size:16.5px;font-weight:800}
.group-bar{display:block;height:5px;margin-top:5px;border-radius:99px;background:var(--surface-2);overflow:hidden;max-width:180px}
.group-bar i{display:block;height:100%;border-radius:inherit;background:var(--accent)}
.group-turn{display:inline-flex;align-items:center;gap:4px;padding:4px 10px;border-radius:99px;background:var(--accent);color:var(--accent-ink);
  font-size:12px;font-weight:800;white-space:nowrap}
.group-turn.done{background:color-mix(in srgb,var(--success) 14%,transparent);color:var(--success-ink)}
.group-turn svg{width:13px;height:13px;stroke-width:2.6}
/* with groups, creating one more is a quiet button under them */
.btn.group-create-more{width:100%;min-height:48px;border:1.5px dashed var(--line-2);background:transparent;color:var(--text-2);font-weight:700}
.btn.group-create-more:hover{border-color:var(--accent);color:var(--accent-strong);background:var(--accent-soft)}
@media (max-width:380px){.group-row{gap:10px;padding:12px}.group-list .group-emoji{width:44px;height:44px;font-size:24px}}
.group-row:hover{background:var(--surface-2)}
.group-row>svg{width:16px;height:16px;color:var(--text-2);transform:rotate(-90deg)}
.group-emoji{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;background:var(--surface-2);font-size:24px}
.group-emoji.big{width:64px;height:64px;margin:0 auto 8px;font-size:34px;border-radius:20px}
.group-main{min-width:0;display:flex;flex-direction:column;gap:2px}
.group-name{font-weight:750;font-size:15.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.group-sub{font-size:12.5px;color:var(--text-2)}
.groups-foot{margin-top:18px;padding-top:14px;border-top:1px solid var(--line);color:var(--text-2);font-size:13px}
.groups-foot p{margin:0 0 8px}
.groups-foot .legal-links a{display:inline-flex;align-items:center;min-height:24px;padding:0 2px}

/* one group */
.join-card{text-align:center;margin-bottom:12px}
.join-card h3{margin:0;font-size:20px}
.join-card p{margin:4px 0 0;color:var(--text-2);font-size:14px}
.join-card .join-lead{margin-top:12px;color:var(--text)}
.group-hello{display:flex;align-items:center;gap:8px;margin-bottom:12px;padding:10px 12px;border-radius:12px;background:var(--accent-soft);color:var(--accent-strong);font-weight:650;font-size:14px}
.group-hello svg{width:18px;height:18px}
.group-actions{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:stretch;margin-bottom:6px}
.group-actions .btn.big{width:100%}
.my-result{display:flex;align-items:center;gap:8px;padding:10px 12px;border-radius:14px;background:var(--surface-2);font-weight:700;font-size:14px}
.my-result svg{width:18px;height:18px;color:var(--gold)}
.my-result.muted{color:var(--text-2);font-weight:600}
.my-result.muted svg{color:var(--success-ink)}
.leaderboard{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:6px}
.lb-row{display:grid;grid-template-columns:28px 34px minmax(0,1fr) auto;grid-template-areas:"rank avatar name time" "rank avatar detail time";align-items:center;column-gap:10px;padding:10px 12px;border-radius:14px;background:var(--surface-2)}
.lb-row .avatar{grid-area:avatar}
.lb-row.me{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent-soft-2)}
.lb-row.pending .lb-name{color:var(--text-2);font-weight:600}
.rank{grid-area:rank;width:28px;height:28px;border-radius:9px;display:grid;place-items:center;background:var(--surface);font-weight:800;font-size:13.5px;font-variant-numeric:tabular-nums}
.rank.r1{background:color-mix(in srgb,var(--gold) 22%,var(--surface));color:var(--text)}
.lb-name{grid-area:name;font-weight:700;font-size:14.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.lb-me{font-weight:600;font-size:12px;color:var(--accent-strong)}
/* avatars: an initial on a colour from the nickname; Sudoku+ = gold ring + "+" badge */
.avatar{--tone:#4b61e0;position:relative;flex:0 0 auto;width:32px;height:32px;border-radius:50%;display:grid;place-items:center;
  background:var(--tone);color:#fff;font-weight:800;font-size:14px;line-height:1;user-select:none}
.avatar[data-tone="1"]{--tone:#0f766e}.avatar[data-tone="2"]{--tone:#b45309}.avatar[data-tone="3"]{--tone:#be185d}
.avatar[data-tone="4"]{--tone:#6d28d9}.avatar[data-tone="5"]{--tone:#15803d}.avatar[data-tone="6"]{--tone:#c2410c}.avatar[data-tone="7"]{--tone:#0369a1}
.avatar.small{width:26px;height:26px;font-size:12px}
.avatar.plus{outline:2px solid var(--plus-gold);outline-offset:2px}
.plus-badge{position:absolute;right:-6px;bottom:-6px;width:16px;height:16px;border-radius:50%;display:grid;place-items:center;
  background:linear-gradient(135deg,#ffd75e,#f5a524);color:#3a2400;font-size:12px;font-weight:900;line-height:1;
  box-shadow:0 0 0 2px var(--surface),0 2px 6px -2px rgba(160,100,0,.6)}
.avatar.small .plus-badge{width:14px;height:14px;font-size:11px;right:-5px;bottom:-5px}
:root{--plus-gold:#f0a91c}
/* the text first, its button underneath (never squeezed beside it on a phone) */
.plan-note{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:10px;margin:2px 0 12px;padding:12px;border-radius:14px;background:var(--surface-2);font-size:13.5px;font-weight:600;color:var(--text-2)}
.plan-note:not(.is-plus) .plan-text{grid-column:1/-1}
.plan-note .avatar{flex:0 0 auto}
.plan-note.is-plus{background:color-mix(in srgb,var(--plus-gold) 14%,var(--surface));color:var(--text)}
.plan-note .btn{grid-column:1/-1;justify-self:start}
.plan-note.is-plus .btn{grid-column:2}
.lb-detail{grid-area:detail;display:flex;align-items:center;gap:4px;font-size:12.5px;color:var(--text-2)}
.lb-detail svg{width:13px;height:13px;color:var(--accent-strong)}
.lb-time{grid-area:time;font-weight:800;font-variant-numeric:tabular-nums;font-size:15px}
.group-manage{display:flex;flex-wrap:wrap;gap:4px 16px;margin-top:16px;padding-top:10px;border-top:1px solid var(--line)}

/* Sudoku+ */
.plus-hero{text-align:center}
.plus-status{display:inline-flex;align-items:center;gap:6px;margin:0 0 10px;padding:6px 12px;border-radius:99px;background:var(--accent-soft);color:var(--accent-strong);font-weight:700;font-size:14px}
.plus-status svg{width:16px;height:16px}
.plus-offers{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}
.plus-offer{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:14px;border:1px solid var(--line-2);border-radius:16px;background:var(--surface);text-align:left}
.plus-offer.featured{border:2px solid var(--accent);background:color-mix(in srgb,var(--accent) 6%,var(--surface))}
.po-tag{position:absolute;top:-10px;right:12px;padding:3px 10px;border-radius:99px;background:var(--accent);color:var(--accent-ink);font-size:11.5px;font-weight:800;letter-spacing:.02em}
.po-cta{display:inline-flex;align-items:center;justify-content:center;gap:4px;align-self:stretch;margin-top:8px;min-height:40px;padding:0 14px;border-radius:12px;
  border:1px solid var(--line-2);background:var(--surface-2);font-size:14px;font-weight:750;color:var(--text)}
.po-cta svg{width:16px;height:16px;transform:rotate(-90deg)}
.plus-offer.featured .po-cta{background:var(--accent);border-color:transparent;color:var(--accent-ink)}
.plus-offer:hover .po-cta{filter:brightness(1.05)}
.plus-offer:disabled{opacity:.7}
.plus-offer:hover{background:var(--surface-2)}
.po-name{font-weight:700;font-size:14px;color:var(--text-2)}
.po-price{font-size:24px;font-weight:850;letter-spacing:-.02em}
.po-price small{font-size:13px;font-weight:650;color:var(--text-2)}
.po-note{font-size:12.5px;color:var(--text-2)}
.plus-restore{margin-top:12px;border-top:1px solid var(--line);padding-top:8px}
/* folds of the app: a whole-width summary with an arrow that turns; details.js animates the height */
.plus-restore>summary,.plus-howto>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;cursor:pointer;list-style:none;
  padding:8px 0;font-weight:650;font-size:14px;color:var(--accent-strong);border-radius:8px}
.plus-restore>summary::-webkit-details-marker,.plus-howto>summary::-webkit-details-marker{display:none}
.plus-restore>summary svg,.plus-howto>summary svg{width:18px;height:18px;transition:transform .24s cubic-bezier(.2,.8,.2,1)}
.plus-restore[open]:not([data-closing])>summary svg,.plus-howto[open]:not([data-closing])>summary svg{transform:rotate(180deg)}
@media (prefers-reduced-motion:reduce){.plus-restore>summary svg,.plus-howto>summary svg{transition:none}}
.plus-howto{margin:10px 0 0;padding:4px 14px;border-radius:14px;background:var(--surface-2)}
.plus-howto ol{margin:0;padding:2px 0 12px 20px;display:grid;gap:6px;font-size:14px;line-height:1.45;color:var(--text-2)}
.plus-howto li::marker{font-weight:800;color:var(--accent-strong)}

/* Settings › digits left on the keypad: a tiny key as its picture */
/* Groups › Sudoku+: free and Sudoku+ side by side, or the member's own card */
.groups-plus{display:grid;gap:12px;margin:14px 0 4px;padding:16px;border-radius:20px;background:var(--surface-2);border:1px solid var(--line)}
.groups-plus.is-plus{background:color-mix(in srgb,var(--plus-gold) 12%,var(--surface));border-color:color-mix(in srgb,var(--plus-gold) 30%,transparent)}
.gp-head{display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:12px}
.gp-gem{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;color:#8a5a00;background:linear-gradient(135deg,#ffe7a3,#ffc94d)}
.gp-gem svg{width:24px;height:24px}
.gp-text{display:grid;gap:2px;min-width:0}
.gp-text b{font-size:16px;font-weight:800;letter-spacing:-.01em}
.gp-text small{font-size:13px;line-height:1.4;font-weight:600;color:var(--text-2)}
.gp-compare{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.gp-col{display:grid;gap:2px;padding:12px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.gp-col.plus{border:2px solid var(--accent);background:var(--accent-soft)}
.gp-name{font-size:11.5px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}
.gp-col.plus .gp-name{color:var(--accent-strong)}
.gp-col b{font-size:19px;font-weight:850;letter-spacing:-.02em}
.gp-col small{font-size:13px;font-weight:600;color:var(--text-2)}
.gp-extras{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.gp-extras li{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:650}
.gp-extras svg{width:17px;height:17px;flex:0 0 auto;color:var(--gold)}
.gp-extras li+li svg{color:var(--accent-strong)}
.gp-note{margin:0;font-size:12.5px;font-weight:600;color:var(--text-2)}
.groups-plus>.btn{justify-self:stretch}
.groups-plus>.btn.gp-cta{background:var(--surface);border:1.5px solid var(--accent);color:var(--accent-strong)}
.groups-plus>.btn.gp-cta:hover{background:var(--accent-soft)}
.groups-plus.is-plus>.btn{justify-self:start}
@media (prefers-color-scheme:dark){:where(:root:not([data-scheme="light"])) .gp-gem{color:#3a2400}}
/* dark chosen in Settings, on a light device */
:where(:root[data-scheme="dark"]) .gp-gem{color:#3a2400}

/* Sudoku+ checkout: Creem's form in the app's sheet; summary beside it on a computer, above it on a phone */
.sheet.checkout-sheet{height:calc(94dvh - var(--kb,0px));max-height:calc(94dvh - var(--kb,0px))}
.checkout-sheet .sheet-body{display:flex;flex-direction:column;padding-bottom:14px}
.checkout-layout{flex:1 0 auto;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(540px,1fr) auto;
  grid-template-areas:"side" "frame" "foot";gap:12px}
.checkout-side{grid-area:side;display:grid;gap:10px;align-content:start;min-width:0}
.checkout-side .back-link{justify-self:start}
.checkout-plan{display:grid;grid-template-columns:40px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 14px;border-radius:18px;
  background:var(--accent-soft)}
.checkout-gem{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--surface);color:var(--accent-strong)}
.checkout-gem svg{width:22px;height:22px}
.checkout-plan-text{display:grid;gap:2px;min-width:0}
.checkout-plan-text b{font-size:15.5px;font-weight:800;letter-spacing:-.01em}
.checkout-plan-text small{font-size:12.5px;line-height:1.35;font-weight:600;color:var(--text-2)}
.checkout-price{font-size:22px;font-weight:850;letter-spacing:-.02em;white-space:nowrap;text-align:right}
.checkout-price small{display:block;font-size:12px;font-weight:650;color:var(--text-2);letter-spacing:0}
.checkout-perks{display:none;list-style:none;margin:0;padding:0;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
.checkout-perks li{--perk:var(--accent);display:flex;align-items:center;gap:8px;min-width:0;padding:6px 8px;border-radius:12px;background:var(--surface-2);
  font-size:13px;font-weight:700;line-height:1.2}
.checkout-perks .perk-icon{width:28px;height:28px;border-radius:9px;flex:0 0 auto}
.checkout-perks .perk-icon svg{width:16px;height:16px}
.checkout-frame{grid-area:frame;position:relative;min-height:540px;border-radius:18px;overflow:hidden;background:#fff;border:1px solid var(--line-2)}
.checkout-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0;background:transparent;opacity:0;transition:opacity .25s}
.checkout-frame.ready iframe{opacity:1}
.checkout-wait{position:absolute;inset:0;display:grid;place-content:center;justify-items:center;gap:12px;padding:20px;text-align:center;
  font-size:14px;font-weight:650;color:#475069}
.checkout-frame.ready .checkout-wait{display:none}
.checkout-spin{width:28px;height:28px;border-radius:50%;border:3px solid #dfe4f2;border-top-color:#4b61e0;animation:checkoutSpin .8s linear infinite}
@keyframes checkoutSpin{to{transform:rotate(360deg)}}
.checkout-foot{grid-area:foot;display:grid;gap:8px;align-content:end;min-width:0}
.checkout-foot p{margin:0}
.checkout-trust{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.45;color:var(--text-2)}
.checkout-trust svg{width:16px;height:16px;margin-top:2px;flex:0 0 auto;color:var(--success-ink)}
.checkout-alt{font-size:13px;line-height:1.45;color:var(--text-2)}
.checkout-alt a{color:var(--accent-strong);font-weight:700}
.checkout-done{display:grid;justify-items:center;gap:8px;padding:18px 12px;border-radius:18px;background:var(--surface-2);text-align:center}
.checkout-done h3{margin:0;font-size:18px;font-weight:800}
.checkout-done p{margin:0 0 4px;font-size:14px;line-height:1.45;color:var(--text-2)}
.checkout-done-icon{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:var(--success);color:#fff}
.checkout-done-icon svg{width:26px;height:26px;stroke-width:2.6}
@media (prefers-color-scheme:dark){:where(:root:not([data-scheme="light"])) .checkout-frame{background:#000}:where(:root:not([data-scheme="light"])) .checkout-wait{color:#b4bdd6}:where(:root:not([data-scheme="light"])) .checkout-spin{border-color:#2a3354;border-top-color:#7d95ff}}
/* dark chosen in Settings, on a light device */
:where(:root[data-scheme="dark"]) .checkout-frame{background:#000}:where(:root[data-scheme="dark"]) .checkout-wait{color:#b4bdd6}:where(:root[data-scheme="dark"]) .checkout-spin{border-color:#2a3354;border-top-color:#7d95ff}
/* a computer: the summary on the left, the form on the right, nothing to scroll */
@media (min-width:900px) and (min-height:640px){
  .sheet.checkout-sheet{width:min(100%,1000px);height:min(880px,calc(100dvh - 48px));max-height:none}
  .checkout-sheet .sheet-body{overflow:hidden;padding-bottom:18px}
  .checkout-layout{flex:1 1 auto;min-height:0;grid-template-columns:minmax(300px,340px) minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);
    grid-template-areas:"side frame" "foot frame";gap:12px 20px}
  .checkout-side,.checkout-foot{overflow-y:auto;overscroll-behavior:contain}
  .checkout-perks{display:grid}
  .checkout-frame{min-height:0}
}
@media (prefers-reduced-motion:reduce){.checkout-spin{animation-duration:2.4s}}

/* Sudoku+ previews (before buying): sample data, buttons frozen */
.perk-preview{position:relative;display:grid;gap:12px;padding:16px;border-radius:20px;background:var(--surface-2);border:1px dashed var(--line-2)}
.pv-badge-tag{justify-self:start;display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:99px;background:var(--surface);
  border:1px solid var(--line);font-size:12px;font-weight:800;letter-spacing:.04em;text-transform:uppercase;color:var(--text-2)}
.pv-badge-tag svg{width:15px;height:15px}
.perk-preview>div{display:grid;gap:12px}
.pv-text{margin:0;font-size:13.5px;line-height:1.5;color:var(--text-2)}
.pv-frozen{width:100%;opacity:.55;filter:saturate(.6);cursor:not-allowed}
.pv-frozen svg{width:18px;height:18px}
.pv-page{justify-self:center;width:min(100%,280px);padding:14px;border-radius:10px;background:#fff;color:#101828;box-shadow:0 18px 40px -22px rgba(16,24,40,.6),0 0 0 1px rgba(16,24,40,.06)}
.pv-page-head{display:flex;align-items:center;gap:6px;padding-bottom:8px;margin-bottom:10px;border-bottom:1.5px solid #e4e8f3;font-size:13px}
.pv-page-head svg{width:16px;height:16px;color:#4b61e0}
.pv-page-head small{margin-left:auto;font-size:10.5px;color:#667091;font-weight:600}
.pv-page-grids{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.pv-page[data-n="4"] .pv-page-grids{grid-template-columns:repeat(2,1fr)}
.pv-grid{display:grid;grid-template-columns:repeat(9,1fr);aspect-ratio:1;border:1.5px solid #4b5563;border-radius:2px;overflow:hidden}
.pv-grid i{display:grid;place-items:center;font-style:normal;font-size:7.5px;font-weight:700;border-right:.5px solid #d6dbe7;border-bottom:.5px solid #d6dbe7}
.pv-grid i:nth-child(3n){border-right:1px solid #4b5563}.pv-grid i:nth-child(9n){border-right:0}
.pv-grid i:nth-child(n+19):nth-child(-n+27),.pv-grid i:nth-child(n+46):nth-child(-n+54){border-bottom:1px solid #4b5563}
.pv-list{display:grid;gap:8px}
.pv-row{display:flex;align-items:center;gap:12px;padding:12px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.pv-row>svg{width:16px;height:16px;margin-left:auto;color:var(--muted)}
.pv-row-main{display:grid;gap:2px;min-width:0}
.pv-row-main b{font-size:14.5px}.pv-row-main small{font-size:12.5px;font-weight:600;color:var(--text-2)}
.pv-group .group-emoji{width:42px;height:42px;font-size:22px;background:var(--accent-soft)}
.pv-heat{display:grid;grid-template-columns:repeat(18,1fr);grid-auto-flow:column;grid-template-rows:repeat(7,1fr);gap:3px}
.pv-heat i{aspect-ratio:1;border-radius:3px}
.pv-heat .l0{background:var(--surface)}.pv-heat .l1{background:color-mix(in srgb,#16a34a 30%,var(--surface))}.pv-heat .l2{background:color-mix(in srgb,#16a34a 62%,var(--surface))}.pv-heat .l3{background:#16a34a}
.pv-season .trophies{margin:0}
.pv-cup1{color:var(--gold)}.pv-cup2{color:#94a3b8}.pv-cup3{color:#c2410c}
.pv-row9{display:grid;grid-template-columns:repeat(9,1fr);max-width:320px;border:2px solid var(--line-2);border-radius:10px;overflow:hidden;background:var(--surface)}
.pv-row9 i{display:grid;place-items:center;aspect-ratio:1;font-style:normal;font-weight:700;font-size:16px;border-right:1px solid var(--line)}
.pv-row9 i:nth-child(3n){border-right:2px solid var(--line-2)}.pv-row9 i:last-child{border-right:0}
.pv-row9 i.target{background:var(--accent-soft);color:var(--accent-strong);box-shadow:inset 0 0 0 2px var(--accent)}
.pv-bubble{display:flex;gap:10px;padding:12px 14px;border-radius:16px;background:var(--surface);border:1px solid var(--line);font-size:14px;line-height:1.45}
.pv-bubble svg{width:20px;height:20px;flex:0 0 auto;color:#e2700f}
.pv-bubble b{display:block;margin-bottom:2px}
.pv-themes .theme-picks{display:grid;grid-template-columns:repeat(auto-fill,minmax(88px,1fr));gap:8px}
.pv-theme{display:grid;justify-items:center;gap:6px;padding:10px 6px;border-radius:14px;border:1px solid var(--line);background:var(--surface);cursor:pointer;font:inherit;color:var(--text)}
.pv-theme[aria-pressed="true"]{border:2px solid var(--accent);padding:9px 5px}
.pv-theme .theme-name{font-size:12.5px;font-weight:700}
.pv-badge .pv-face{display:grid;justify-items:center;gap:8px}
.pv-badge .pv-face b{font-size:16px}
.pv-emojis{display:flex;flex-wrap:wrap;justify-content:center;gap:6px}
.pv-emojis span{width:40px;height:40px;display:grid;place-items:center;border-radius:12px;background:var(--surface);border:1px solid var(--line);font-size:20px;opacity:.75}
.pv-family .pv-key{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:14px;background:var(--surface);border:1px solid var(--line)}
.pv-key svg{width:22px;height:22px;color:var(--accent-strong)}
.pv-key b{display:block;font-size:14px}.pv-key small{font-family:ui-monospace,monospace;font-size:12.5px;color:var(--text-2)}
.pv-devices{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.pv-devices li{display:flex;align-items:center;gap:10px;font-size:14px;font-weight:650}
.pv-devices span{width:26px;height:26px;border-radius:50%;display:grid;place-items:center;background:var(--accent);color:var(--accent-ink);font-size:13px;font-weight:800}
.pv-cta{display:grid;gap:10px;margin-top:14px;padding:14px;border-radius:18px;background:var(--accent-soft);text-align:center}
.pv-cta p{margin:0;font-size:14px;font-weight:650}

/* Sudoku+ perks: tiles to see at a glance (big icon, two words, one line) */
.plus-lead{margin:0 0 10px;font-weight:750;font-size:15px}
.perk-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0 0 12px;text-align:left}
.perk{--perk:var(--accent);position:relative;display:grid;align-content:start;gap:10px;min-height:118px;padding:14px 12px 12px;border:0;border-radius:18px;
  background:var(--surface-2);color:var(--text);text-align:left;font:inherit}
.perk-icon{width:44px;height:44px;border-radius:14px;display:grid;place-items:center;color:var(--perk);background:color-mix(in srgb,var(--perk) 15%,transparent)}
.perk-icon svg{width:24px;height:24px;stroke-width:2.1}
.perk-icon .avatar{margin:0}
.perk-text{display:grid;gap:3px;min-width:0}
.perk-title{font-weight:800;font-size:15px;line-height:1.2;letter-spacing:-.01em;overflow-wrap:anywhere}
.perk-sub{font-size:12.5px;line-height:1.35;font-weight:600;color:var(--text-2);overflow-wrap:anywhere}
.perk.action{cursor:pointer;transition:background .15s,transform .15s}
.perk.action:hover{background:var(--surface-3,color-mix(in srgb,var(--text) 8%,var(--surface-2)))}
.perk.action:active{transform:scale(.98)}
.perk.action>svg{position:absolute;top:14px;right:10px;width:16px;height:16px;color:var(--muted);transform:rotate(-90deg)}
.perk-family{grid-column:1/-1;grid-template-columns:44px minmax(0,1fr) auto;align-items:center;align-content:center;min-height:0;padding:12px 14px;
  background:var(--accent-soft)}
.perk-family .perk-title{font-size:16px}
.perk-family.action>svg{position:static}
.perk-print{--perk:#0b8fb0}.perk-archive{--perk:#7c4ddb}.perk-stats{--perk:#13915f}.perk-groups{--perk:#2f6be6}
.perk-seasons{--perk:var(--gold)}.perk-coach{--perk:#e2700f}.perk-themes{--perk:#d6337f}.perk-badge{--perk:var(--gold)}
@media (prefers-color-scheme:dark){:where(:root:not([data-scheme="light"])) .perk-print{--perk:#3fc6e6}:where(:root:not([data-scheme="light"])) .perk-archive{--perk:#b399ff}:where(:root:not([data-scheme="light"])) .perk-stats{--perk:#45d39b}:where(:root:not([data-scheme="light"])) .perk-groups{--perk:#7ea6ff}:where(:root:not([data-scheme="light"])) .perk-coach{--perk:#ffa257}:where(:root:not([data-scheme="light"])) .perk-themes{--perk:#ff7ab5}}
/* dark chosen in Settings, on a light device */
:where(:root[data-scheme="dark"]) .perk-print{--perk:#3fc6e6}:where(:root[data-scheme="dark"]) .perk-archive{--perk:#b399ff}:where(:root[data-scheme="dark"]) .perk-stats{--perk:#45d39b}:where(:root[data-scheme="dark"]) .perk-groups{--perk:#7ea6ff}:where(:root[data-scheme="dark"]) .perk-coach{--perk:#ffa257}:where(:root[data-scheme="dark"]) .perk-themes{--perk:#ff7ab5}
.plus-promises{list-style:none;margin:0 0 16px;padding:0;display:grid;gap:6px;text-align:left}
.plus-promises li{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:650;color:var(--text-2)}
.plus-promises svg{width:16px;height:16px;flex:0 0 auto;color:var(--success-ink)}
.plus-promises li:first-child svg{color:var(--danger)}
@media (max-width:420px){.plus-offers{grid-template-columns:1fr}}
/* header: room for the groups button on narrow phones */
@media (max-width:400px){.header-actions{gap:4px}.brand{gap:8px}.brand-name{font-size:18px}}

/* the sponsor's own colours (set from /api/config); text is black or white, whichever keeps ≥ 4.5:1 */
.sponsor-strip.branded,.completion-sponsor .sponsor-strip.branded{background:var(--brand);border-color:transparent;color:var(--brand-ink)}
.sponsor-strip.branded:hover{background:var(--brand);filter:brightness(1.07) saturate(1.05)}
.sponsor-strip.branded .sponsor-by,.sponsor-strip.branded .sponsor-name,.sponsor-strip.branded .sponsor-tagline,.sponsor-strip.branded>svg{color:var(--brand-ink)}

.sponsor-strip.branded .sponsor-initial{background:var(--brand-ink);color:var(--brand)}
.sponsor-strip.branded:focus-visible{outline:3px solid var(--accent);outline-offset:3px}

/* ============================================================
   Opening loader (index.html + splash.js): the mark is drawn cell
   by cell, then flies to its place in the header
   ============================================================ */
.splash{display:none}
/* Without JavaScript: say what the game is and where to read about it (also what most AI crawlers see) */
.noscript{position:relative;z-index:5;max-width:640px;margin:16px auto;padding:16px 18px;border-radius:16px;background:var(--surface,#fff);color:var(--text,#101828);border:1px solid var(--line,rgba(16,24,40,.12));font:15px/1.55 system-ui,sans-serif}
.noscript-title{font-weight:800;font-size:20px;margin:0 0 6px}
.noscript a{color:var(--accent,#4b61e0)}
.splash-on .splash{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:24px 16px;
  animation:splash-safety 0s linear 9s forwards}
.splash-on:not(.splash-leaving) .brand-mark{opacity:0}
.brand-mark{transition:opacity .4s ease}
.splash-bg{position:absolute;inset:0;background:radial-gradient(1000px 520px at 50% -140px,var(--bg-glow),transparent 70%),var(--bg)}
.splash-col{position:relative;display:flex;flex-direction:column;align-items:center;gap:28px;margin-top:-4vh}
.splash-stage{position:relative;width:104px;height:104px;display:grid;place-items:center}
.splash-glow{position:absolute;inset:-70px;border-radius:50%;pointer-events:none;
  background:radial-gradient(circle,rgba(109,132,255,.30),rgba(109,132,255,0) 64%);
  animation:splash-glow-in .9s var(--ease) both,splash-breathe 2.6s ease-in-out .9s infinite}
.splash svg.splash-logo{position:relative;width:104px;height:104px;stroke:none;fill:none;overflow:visible;
  filter:drop-shadow(0 18px 30px rgba(75,97,224,.32));transform-origin:center;
  transition:transform .66s cubic-bezier(.65,0,.25,1),filter .66s ease}
.splash-tile,.splash-cells rect,.splash-centre{transform-box:fill-box;transform-origin:center}
.splash-tile{animation:splash-pop .62s cubic-bezier(.34,1.56,.64,1) both}
.splash-cells rect{opacity:.24;animation:splash-cell .34s var(--ease) both,splash-wave 1.6s ease-in-out infinite}
.splash-cells rect:nth-child(1){animation-delay:.22s,1.5s}
.splash-cells rect:nth-child(2){animation-delay:.27s,1.7s}
.splash-cells rect:nth-child(3){animation-delay:.32s,1.9s}
.splash-cells rect:nth-child(4){animation-delay:.37s,2.1s}
.splash-cells rect:nth-child(5){animation-delay:.42s,2.3s}
.splash-cells rect:nth-child(6){animation-delay:.47s,2.5s}
.splash-cells rect:nth-child(7){animation-delay:.52s,2.7s}
.splash-cells rect:nth-child(8){animation-delay:.57s,2.9s}
.splash-centre{animation:splash-pop .44s cubic-bezier(.34,1.56,.64,1) .5s both}
.splash-nine circle{stroke-dasharray:25.2;stroke-dashoffset:25.2;animation:splash-draw .42s ease-in-out .72s forwards}
.splash-nine path{stroke-dasharray:12;stroke-dashoffset:12;animation:splash-draw .26s ease-out 1.08s forwards}
.splash-text{margin:0;max-width:min(calc(100vw - 32px),420px);text-align:center;text-wrap:balance;
  font-size:18px;font-weight:650;letter-spacing:-.01em;color:var(--text);animation:splash-text .5s var(--ease) .35s both}
.splash-trust{position:absolute;left:16px;right:16px;bottom:max(28px,env(safe-area-inset-bottom));margin:0;
  display:flex;align-items:center;justify-content:center;gap:7px;color:var(--muted);font-size:13px;font-weight:550;
  animation:splash-text .5s ease .7s both}
.splash-trust svg{width:15px;height:15px;stroke-width:2}
/* leaving: the loader fades out where it is (no flight to the header), the page shows through */
.splash-out{pointer-events:none;opacity:0;transition:opacity .42s ease}
.splash-out .splash-col{transform:scale(.96);transition:transform .42s var(--ease)}
.splash-out .splash-cells rect,.splash-out .splash-glow{animation-play-state:paused}
@keyframes splash-pop{from{opacity:0;transform:scale(.55)}to{opacity:1;transform:none}}
@keyframes splash-cell{from{opacity:0;transform:scale(.4)}to{opacity:.24;transform:none}}
@keyframes splash-wave{0%,30%,100%{opacity:.24}12%{opacity:.6}}
@keyframes splash-draw{to{stroke-dashoffset:0}}
@keyframes splash-glow-in{from{opacity:0;transform:scale(.6)}to{opacity:1;transform:none}}
@keyframes splash-breathe{50%{opacity:.7;transform:scale(1.06)}}
@keyframes splash-text{from{opacity:0;transform:translateY(5px)}}
@keyframes splash-safety{to{visibility:hidden;opacity:0}}
@media (max-width:560px){.splash-stage,.splash svg.splash-logo{width:92px;height:92px}}
@media (prefers-reduced-motion:reduce){
  .splash *{animation:none!important}
  .splash-nine circle,.splash-nine path{stroke-dashoffset:0}
  .splash-out{transition:opacity .2s ease}
  .splash-out .splash-col{transform:none}
}

/* ============================================================
   Sudoku+ — themes (light, then dark), profile, stats, archive,
   seasons, print. Everything here runs on the device.
   ============================================================ */
:root[data-theme="paper"]{
  --btn-top:#a85a1a;
  --bg:#f6f1e7;--bg-glow:rgba(184,101,31,.08);--surface:#fffdf8;--surface-2:#f1eadb;--surface-3:#e6dcc8;
  --text:#2b2118;--text-2:#5a4a3a;--muted:#6b5a48;--line:rgba(43,33,24,.09);--line-2:rgba(43,33,24,.16);
  --accent:#9a4f12;--accent-2:#b8651f;--accent-ink:#ffffff;--accent-soft:rgba(154,79,18,.10);--accent-soft-2:rgba(154,79,18,.18);--accent-strong:#7d3f0d;
  --grid-thin:#e6dcc8;--grid-bold:#8c7a62;--cell:#fffdf8;--cell-given-text:#2b2118;--cell-user-text:#8a4410;
  --cell-peer:#f5eedf;--cell-same:#f0dfc2;--cell-selected:#e9cfa4;--note-text:#6b5a48;--note-text-selected:#5a4a3a;
  --veil:rgba(246,241,231,.55);--seg-pill:#fffdf8;
}
:root[data-theme="slate"]{
  --btn-top:#137a99;
  --bg:#eef0f2;--bg-glow:rgba(15,110,140,.08);--surface:#ffffff;--surface-2:#e9ecef;--surface-3:#dde1e5;
  --text:#111418;--text-2:#444c56;--muted:#59626d;--line:rgba(17,20,24,.08);--line-2:rgba(17,20,24,.15);
  --accent:#0f6e8c;--accent-2:#1b8db3;--accent-ink:#ffffff;--accent-soft:rgba(15,110,140,.10);--accent-soft-2:rgba(15,110,140,.18);--accent-strong:#0b5770;
  --grid-thin:#dfe3e7;--grid-bold:#7c8794;--cell:#ffffff;--cell-given-text:#111418;--cell-user-text:#0c6380;
  --cell-peer:#eef2f5;--cell-same:#d3e6ee;--cell-selected:#b9d9e6;--note-text:#59626d;--note-text-selected:#444c56;
  --veil:rgba(238,240,242,.55);--seg-pill:#ffffff;
}
:root[data-theme="forest"]{
  --btn-top:#23874c;
  --bg:#eef4ef;--bg-glow:rgba(31,122,69,.08);--surface:#ffffff;--surface-2:#e6efe8;--surface-3:#d9e6dc;
  --text:#0f1d14;--text-2:#3f5446;--muted:#536a5a;--line:rgba(15,29,20,.08);--line-2:rgba(15,29,20,.15);
  --accent:#1f7a45;--accent-2:#2f9a5a;--accent-ink:#ffffff;--accent-soft:rgba(31,122,69,.10);--accent-soft-2:rgba(31,122,69,.18);--accent-strong:#175f35;
  --grid-thin:#dce8df;--grid-bold:#7a917f;--cell:#ffffff;--cell-given-text:#0f1d14;--cell-user-text:#1a6b3b;
  --cell-peer:#edf5ef;--cell-same:#d2ecd9;--cell-selected:#b5dfc1;--note-text:#536a5a;--note-text-selected:#3f5446;
  --veil:rgba(238,244,239,.55);--seg-pill:#ffffff;
}
:root[data-theme="lavender"]{
  --btn-top:#7549cf;
  --bg:#f4f1fa;--bg-glow:rgba(107,63,196,.08);--surface:#ffffff;--surface-2:#eee9f7;--surface-3:#e3dcf1;
  --text:#1a1426;--text-2:#4d4363;--muted:#5f5675;--line:rgba(26,20,38,.08);--line-2:rgba(26,20,38,.15);
  --accent:#6b3fc4;--accent-2:#8a63de;--accent-ink:#ffffff;--accent-soft:rgba(107,63,196,.10);--accent-soft-2:rgba(107,63,196,.18);--accent-strong:#5530a3;
  --grid-thin:#e6e0f1;--grid-bold:#8a80a3;--cell:#ffffff;--cell-given-text:#1a1426;--cell-user-text:#5c33b3;
  --cell-peer:#f2eefb;--cell-same:#e2d8fb;--cell-selected:#cfc0f7;--note-text:#5f5675;--note-text-selected:#4d4363;
  --veil:rgba(244,241,250,.55);--seg-pill:#ffffff;
}
@media (prefers-color-scheme:dark){:root[data-theme="paper"]:not([data-scheme="light"]){
    --btn-top:var(--accent-2);
    --bg:#17130e;--bg-glow:rgba(231,163,92,.10);--surface:#211b14;--surface-2:#2a2219;--surface-3:#362c20;
    --text:#f3ead9;--text-2:#cdbfa8;--muted:#a8987e;--line:rgba(255,240,220,.08);--line-2:rgba(255,240,220,.14);
    --accent:#e7a35c;--accent-2:#f0bb80;--accent-ink:#17130e;--accent-soft:rgba(231,163,92,.14);--accent-soft-2:rgba(231,163,92,.26);--accent-strong:#f0bb80;
    --grid-thin:#2f271d;--grid-bold:#7d6d55;--cell:#1d1812;--cell-given-text:#f3ead9;--cell-user-text:#f0b26e;
    --cell-peer:#262017;--cell-same:#3a2e1e;--cell-selected:#4d3b22;--note-text:#a8987e;--note-text-selected:#d8c9b0;
    --veil:rgba(23,19,14,.45);--seg-pill:#3a2f22;
  }:root[data-theme="slate"]:not([data-scheme="light"]){
    --btn-top:var(--accent-2);
    --bg:#0e1114;--bg-glow:rgba(92,195,228,.08);--surface:#171b20;--surface-2:#1d2228;--surface-3:#262c33;
    --text:#eceff2;--text-2:#b6bec8;--muted:#8e97a2;--line:rgba(255,255,255,.07);--line-2:rgba(255,255,255,.13);
    --accent:#5cc3e4;--accent-2:#8ad5ee;--accent-ink:#0e1114;--accent-soft:rgba(92,195,228,.13);--accent-soft-2:rgba(92,195,228,.24);--accent-strong:#8ad5ee;
    --grid-thin:#252b31;--grid-bold:#6a7480;--cell:#151a1e;--cell-given-text:#eceff2;--cell-user-text:#7fd0ea;
    --cell-peer:#1b2228;--cell-same:#1f3440;--cell-selected:#24495a;--note-text:#8e97a2;--note-text-selected:#c6ced8;
    --veil:rgba(14,17,20,.45);--seg-pill:#2a3139;
  }:root[data-theme="forest"]:not([data-scheme="light"]){
    --btn-top:var(--accent-2);
    --bg:#0b130e;--bg-glow:rgba(95,208,141,.08);--surface:#131d16;--surface-2:#19251c;--surface-3:#213025;
    --text:#e9f3ec;--text-2:#b3c6b8;--muted:#8aa092;--line:rgba(255,255,255,.07);--line-2:rgba(255,255,255,.13);
    --accent:#5fd08d;--accent-2:#8ae0ad;--accent-ink:#0b130e;--accent-soft:rgba(95,208,141,.13);--accent-soft-2:rgba(95,208,141,.24);--accent-strong:#8ae0ad;
    --grid-thin:#1f2d23;--grid-bold:#63806b;--cell:#111a14;--cell-given-text:#e9f3ec;--cell-user-text:#7ddba2;
    --cell-peer:#17241b;--cell-same:#1d3a27;--cell-selected:#245234;--note-text:#8aa092;--note-text-selected:#c3d6c8;
    --veil:rgba(11,19,14,.45);--seg-pill:#24352a;
  }:root[data-theme="lavender"]:not([data-scheme="light"]){
    --btn-top:var(--accent-2);
    --bg:#110d1a;--bg-glow:rgba(180,154,255,.10);--surface:#1a1527;--surface-2:#211b31;--surface-3:#2b2340;
    --text:#f0ebfb;--text-2:#c3b9da;--muted:#9c92b6;--line:rgba(255,255,255,.07);--line-2:rgba(255,255,255,.13);
    --accent:#b49aff;--accent-2:#cbb8ff;--accent-ink:#110d1a;--accent-soft:rgba(180,154,255,.13);--accent-soft-2:rgba(180,154,255,.24);--accent-strong:#cbb8ff;
    --grid-thin:#2a2340;--grid-bold:#776d96;--cell:#181324;--cell-given-text:#f0ebfb;--cell-user-text:#c2acff;
    --cell-peer:#201a33;--cell-same:#2e2450;--cell-selected:#3e2f72;--note-text:#9c92b6;--note-text-selected:#d2c9e8;
    --veil:rgba(17,13,26,.45);--seg-pill:#322a4a;
  }}
/* dark chosen in Settings, on a light device */
:root[data-theme="paper"][data-scheme="dark"]{
    --btn-top:var(--accent-2);
    --bg:#17130e;--bg-glow:rgba(231,163,92,.10);--surface:#211b14;--surface-2:#2a2219;--surface-3:#362c20;
    --text:#f3ead9;--text-2:#cdbfa8;--muted:#a8987e;--line:rgba(255,240,220,.08);--line-2:rgba(255,240,220,.14);
    --accent:#e7a35c;--accent-2:#f0bb80;--accent-ink:#17130e;--accent-soft:rgba(231,163,92,.14);--accent-soft-2:rgba(231,163,92,.26);--accent-strong:#f0bb80;
    --grid-thin:#2f271d;--grid-bold:#7d6d55;--cell:#1d1812;--cell-given-text:#f3ead9;--cell-user-text:#f0b26e;
    --cell-peer:#262017;--cell-same:#3a2e1e;--cell-selected:#4d3b22;--note-text:#a8987e;--note-text-selected:#d8c9b0;
    --veil:rgba(23,19,14,.45);--seg-pill:#3a2f22;
  }:root[data-theme="slate"][data-scheme="dark"]{
    --btn-top:var(--accent-2);
    --bg:#0e1114;--bg-glow:rgba(92,195,228,.08);--surface:#171b20;--surface-2:#1d2228;--surface-3:#262c33;
    --text:#eceff2;--text-2:#b6bec8;--muted:#8e97a2;--line:rgba(255,255,255,.07);--line-2:rgba(255,255,255,.13);
    --accent:#5cc3e4;--accent-2:#8ad5ee;--accent-ink:#0e1114;--accent-soft:rgba(92,195,228,.13);--accent-soft-2:rgba(92,195,228,.24);--accent-strong:#8ad5ee;
    --grid-thin:#252b31;--grid-bold:#6a7480;--cell:#151a1e;--cell-given-text:#eceff2;--cell-user-text:#7fd0ea;
    --cell-peer:#1b2228;--cell-same:#1f3440;--cell-selected:#24495a;--note-text:#8e97a2;--note-text-selected:#c6ced8;
    --veil:rgba(14,17,20,.45);--seg-pill:#2a3139;
  }:root[data-theme="forest"][data-scheme="dark"]{
    --btn-top:var(--accent-2);
    --bg:#0b130e;--bg-glow:rgba(95,208,141,.08);--surface:#131d16;--surface-2:#19251c;--surface-3:#213025;
    --text:#e9f3ec;--text-2:#b3c6b8;--muted:#8aa092;--line:rgba(255,255,255,.07);--line-2:rgba(255,255,255,.13);
    --accent:#5fd08d;--accent-2:#8ae0ad;--accent-ink:#0b130e;--accent-soft:rgba(95,208,141,.13);--accent-soft-2:rgba(95,208,141,.24);--accent-strong:#8ae0ad;
    --grid-thin:#1f2d23;--grid-bold:#63806b;--cell:#111a14;--cell-given-text:#e9f3ec;--cell-user-text:#7ddba2;
    --cell-peer:#17241b;--cell-same:#1d3a27;--cell-selected:#245234;--note-text:#8aa092;--note-text-selected:#c3d6c8;
    --veil:rgba(11,19,14,.45);--seg-pill:#24352a;
  }:root[data-theme="lavender"][data-scheme="dark"]{
    --btn-top:var(--accent-2);
    --bg:#110d1a;--bg-glow:rgba(180,154,255,.10);--surface:#1a1527;--surface-2:#211b31;--surface-3:#2b2340;
    --text:#f0ebfb;--text-2:#c3b9da;--muted:#9c92b6;--line:rgba(255,255,255,.07);--line-2:rgba(255,255,255,.13);
    --accent:#b49aff;--accent-2:#cbb8ff;--accent-ink:#110d1a;--accent-soft:rgba(180,154,255,.13);--accent-soft-2:rgba(180,154,255,.24);--accent-strong:#cbb8ff;
    --grid-thin:#2a2340;--grid-bold:#776d96;--cell:#181324;--cell-given-text:#f0ebfb;--cell-user-text:#c2acff;
    --cell-peer:#201a33;--cell-same:#2e2450;--cell-selected:#3e2f72;--note-text:#9c92b6;--note-text-selected:#d2c9e8;
    --veil:rgba(17,13,26,.45);--seg-pill:#322a4a;
  }

/* avatars with an emoji, larger previews */
.avatar-emoji{font-size:18px;line-height:1;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif}
.avatar.has-emoji{background:color-mix(in srgb,var(--tone) 30%,var(--surface))}
.avatar.small .avatar-emoji{font-size:14px}
.avatar.large{width:56px;height:56px;font-size:24px}
.avatar.large .avatar-emoji{font-size:30px}
.avatar.large.plus{outline-width:3px;outline-offset:3px}
.avatar.large .plus-badge{width:22px;height:22px;font-size:16px;right:-7px;bottom:-7px}

/* the question asked once, after Sudoku+ starts */
.plus-welcome{text-align:center;padding:4px 0}
.plus-welcome-preview{display:inline-flex;align-items:center;gap:16px;margin:6px 0 14px;padding:14px 22px;border-radius:18px;background:var(--surface-2)}
.plus-welcome-preview .lb-name{font-size:17px}
.plus-welcome>p{margin:0 auto 14px;max-width:36em;color:var(--text-2);line-height:1.5}
.plus-welcome-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:12px}
@media (max-width:440px){.plus-welcome-actions{grid-template-columns:1fr}}

/* how a member looks in groups */
.plus-free{display:flex;align-items:center;justify-content:center;gap:6px;margin:-6px 0 16px;font-size:13px;font-weight:650;color:var(--success-ink)}
.plus-free svg{width:16px;height:16px;flex:0 0 auto}
.plus-profile{margin:0 0 16px;padding:16px;border:1px solid var(--line);border-radius:18px;background:var(--surface);text-align:left}
.plus-profile>.section-title{margin-top:0}
.profile-preview{display:flex;align-items:center;gap:16px;margin:8px 0 12px}
.profile-preview b{display:block;font-size:16px}
.profile-preview small{display:block;margin-top:2px;color:var(--muted);font-size:12.5px}
.profile-face{display:inline-flex;padding:6px}
.profile-switch{padding:12px 0;margin-bottom:12px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.pick-set{border:0;margin:0 0 12px;padding:0;min-width:0}
.pick-set legend{padding:0;margin-bottom:8px;font-weight:750;font-size:13.5px;color:var(--text-2)}
.pick-grid{display:flex;flex-wrap:wrap;gap:6px}
.pick{position:relative;display:inline-grid;cursor:pointer}
.pick input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.pick-face{width:40px;height:40px;border-radius:12px;display:grid;place-items:center;background:var(--surface-2);font-size:21px;line-height:1;
  border:2px solid transparent;transition:border-color .15s,transform .15s var(--ease)}
.pick-face.initial{font-size:16px;font-weight:800;color:var(--text)}
.pick-face.tone-auto{border-radius:50%;font-size:13px;font-weight:800;color:#fff;text-shadow:0 1px 2px rgba(0,0,0,.45);
  background:conic-gradient(#4b61e0,#0f766e,#b45309,#be185d,#6d28d9,#15803d,#c2410c,#0369a1,#4b61e0)}
.tones .pick-face.avatar{width:40px;height:40px;border-radius:50%;background:var(--tone)}
.pick input:checked+.pick-face{border-color:var(--accent);box-shadow:inset 0 0 0 2px var(--surface)}
.pick input:focus-visible+.pick-face{outline:2px solid var(--accent);outline-offset:2px}
.pick:hover .pick-face{transform:scale(1.06)}

/* theme picker */
.theme-picks{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.theme-pick{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;padding:10px 4px 8px;border:2px solid var(--line);border-radius:14px;
  cursor:pointer;font-size:12.5px;font-weight:700;text-align:center;color:var(--text)}
.theme-pick input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.theme-pick:has(input:checked){border-color:var(--accent);background:var(--accent-soft)}
.theme-pick:has(input:focus-visible){outline:2px solid var(--accent);outline-offset:2px}
.theme-pick.locked{cursor:not-allowed;color:var(--text-2)}
.theme-pick.locked input{cursor:not-allowed}
.theme-name{display:inline-flex;align-items:center;gap:3px}
.theme-name svg{width:12px;height:12px}
.theme-swatch{display:grid;grid-template-columns:1fr 1fr;grid-template-rows:1fr 1fr;width:44px;height:44px;border-radius:12px;overflow:hidden;box-shadow:inset 0 0 0 1px var(--line-2)}
.theme-swatch i:first-child{grid-row:span 2}
.theme-swatch[data-swatch="sudoku"] i:nth-child(1){background:#f3f5fb}.theme-swatch[data-swatch="sudoku"] i:nth-child(2){background:#4b61e0}.theme-swatch[data-swatch="sudoku"] i:nth-child(3){background:#c6d0ff}
.theme-swatch[data-swatch="paper"] i:nth-child(1){background:#f6f1e7}.theme-swatch[data-swatch="paper"] i:nth-child(2){background:#9a4f12}.theme-swatch[data-swatch="paper"] i:nth-child(3){background:#e9cfa4}
.theme-swatch[data-swatch="slate"] i:nth-child(1){background:#eef0f2}.theme-swatch[data-swatch="slate"] i:nth-child(2){background:#0f6e8c}.theme-swatch[data-swatch="slate"] i:nth-child(3){background:#b9d9e6}
.theme-swatch[data-swatch="forest"] i:nth-child(1){background:#eef4ef}.theme-swatch[data-swatch="forest"] i:nth-child(2){background:#1f7a45}.theme-swatch[data-swatch="forest"] i:nth-child(3){background:#b5dfc1}
.theme-swatch[data-swatch="lavender"] i:nth-child(1){background:#f4f1fa}.theme-swatch[data-swatch="lavender"] i:nth-child(2){background:#6b3fc4}.theme-swatch[data-swatch="lavender"] i:nth-child(3){background:#cfc0f7}
.theme-card>.btn{margin-top:12px}
@media (max-width:440px){.theme-picks{grid-template-columns:repeat(3,minmax(0,1fr))}}

/* advanced stats */
.plus-stats{margin-top:4px}
.cal-heat{display:grid;grid-template-rows:repeat(7,auto);grid-auto-flow:column;grid-auto-columns:minmax(0,20px);justify-content:center;gap:3px;margin:8px 0 12px}
.cal-heat i{aspect-ratio:1;border-radius:3px;background:var(--surface-2)}
.cal-heat i[data-l="2"]{background:color-mix(in srgb,var(--accent) 40%,var(--surface-2))}
.cal-heat i[data-l="3"]{background:color-mix(in srgb,var(--accent) 70%,var(--surface-2))}
.cal-heat i[data-l="4"]{background:var(--accent)}
.month-bars{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;align-items:end;margin:8px 0 4px;padding:12px;border-radius:14px;background:var(--surface-2)}
.month-bar{display:flex;flex-direction:column;align-items:center;gap:5px;min-width:0}
.mb-value{font-size:11px;font-weight:750;font-variant-numeric:tabular-nums;color:var(--text-2);white-space:nowrap}
.mb-track{display:flex;align-items:flex-end;width:100%;max-width:30px;height:88px;border-radius:8px;background:color-mix(in srgb,var(--line-2) 50%,transparent)}
.mb-track i{display:block;width:100%;height:0;border-radius:8px;background:var(--accent)}
.mb-track i.h1{height:10%}.mb-track i.h2{height:20%}.mb-track i.h3{height:30%}.mb-track i.h4{height:40%}.mb-track i.h5{height:50%}
.mb-track i.h6{height:60%}.mb-track i.h7{height:70%}.mb-track i.h8{height:80%}.mb-track i.h9{height:90%}.mb-track i.h10{height:100%}
.mb-label{font-size:11.5px;font-weight:650;color:var(--muted)}
.record-steps{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}
.record-steps li{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 12px;border-radius:12px;background:var(--surface-2);font-size:13px}
.record-steps li:first-child{background:var(--accent-soft)}
.record-steps b{font-size:15px;font-variant-numeric:tabular-nums}
.record-steps span{color:var(--text-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.record-steps small{font-size:12px;font-weight:750;font-variant-numeric:tabular-nums;color:var(--success-ink)}
.plus-teaser{display:flex;align-items:center;flex-wrap:wrap;gap:10px;margin-top:16px;padding:12px;border-radius:14px;
  background:color-mix(in srgb,var(--plus-gold) 12%,var(--surface));font-size:13.5px;color:var(--text-2)}
.plus-teaser>svg{width:20px;height:20px;flex:0 0 auto;color:var(--accent)}
.plus-teaser>span{flex:1 1 200px}
.plus-teaser b{color:var(--text)}
.more-history{width:100%;margin-top:8px}

/* new game sheet: Sudoku+ links */
.plus-links{display:grid;gap:8px;margin-top:8px}
.plus-link{display:flex;align-items:center;gap:12px;width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:16px;background:var(--surface);
  color:var(--text);font:inherit;text-align:left;cursor:pointer}
.plus-link:hover{background:var(--surface-2)}
.plus-link .setting-name{display:inline-flex;align-items:center;gap:6px;font-size:15px}
.plus-link .setting-name svg{width:14px;height:14px;color:var(--muted)}

/* past grilles du jour */
.archive-list{display:grid;gap:6px;margin-top:6px}
.archive-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;padding:8px 10px;border-radius:14px;background:var(--surface-2)}
.archive-day{font-weight:700;font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.archive-levels{display:grid;grid-template-columns:repeat(4,58px);gap:6px}
.archive-level{min-height:40px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border:1px solid var(--line);border-radius:10px;
  background:var(--surface);color:var(--text);font:inherit;font-size:11px;font-weight:750;font-variant-numeric:tabular-nums;cursor:pointer}
.archive-level:hover{border-color:var(--accent)}
.archive-level.done{background:color-mix(in srgb,var(--success) 12%,var(--surface));color:var(--success-ink)}
.archive-level .level-dots i{width:5px;height:5px}
@media (max-width:440px){.archive-row{grid-template-columns:minmax(0,1fr)}.archive-levels{grid-template-columns:repeat(4,minmax(0,1fr))}}

/* group: days before, month, trophies */
.day-nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:10px}
.day-nav[hidden]{display:none}
.day-nav-label{font-weight:750;font-size:14px}
.day-nav [data-step="-1"] svg{transform:rotate(90deg)}
.day-nav .next svg{transform:rotate(-90deg)}
.day-nav .iconbtn:disabled{opacity:.4;cursor:default}
.board-content[aria-busy="true"]{opacity:.55}
.board-caption{margin:10px 0 0;color:var(--muted);font-size:12.5px;font-weight:600}
.trophies{list-style:none;margin:8px 0 0;padding:0;display:grid;gap:6px}
.trophy-row{display:grid;grid-template-columns:22px minmax(64px,auto) 26px minmax(0,1fr) auto;align-items:center;gap:8px;padding:8px 10px;border-radius:14px;background:var(--surface-2)}
.trophy-row.me{background:var(--accent-soft)}
.trophy-cup{display:grid;place-items:center;color:var(--gold)}
.trophy-cup svg{width:18px;height:18px}
.trophy-month{font-size:12.5px;font-weight:700;color:var(--text-2)}
.trophy-row>*{grid-area:auto}
.trophy-row .lb-name{min-width:0}
.trophy-row .lb-detail{font-size:12px;font-weight:600;color:var(--text-2)}
/* the creator's roster */
.member-list{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:6px}
.member-row{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:10px;padding:10px 12px;border-radius:14px;background:var(--surface-2)}
.member-row.me{background:var(--accent-soft)}
.member-text{display:grid;gap:2px;min-width:0}
.member-text>*{grid-area:auto}
.member-text .lb-name{min-width:0}
.member-fact{font-size:12.5px;font-weight:600;color:var(--text-2);overflow-wrap:anywhere}
.btn.member-remove{min-height:36px;padding:0 12px;gap:6px;font-size:13.5px;font-weight:700;color:var(--danger-ink);border-color:color-mix(in srgb,var(--danger-ink) 40%,transparent);background:var(--surface)}
.btn.member-remove svg{width:16px;height:16px}
.btn.member-remove:hover{background:var(--danger-soft)}
@media (max-width:380px){.btn.member-remove span{display:none}.btn.member-remove{padding:0 10px}}
.board-teaser{display:flex;align-items:flex-start;gap:8px;margin:10px 0 0;padding:10px 12px;border-radius:14px;background:var(--surface-2);font-size:13px;line-height:1.45;color:var(--text-2)}
.board-teaser>svg{width:16px;height:16px;margin-top:2px;flex:0 0 auto;color:var(--accent)}

/* grids to print: only this shows on paper */
.print-sheet{display:none}
.print-logo{stroke:none;fill:none;-webkit-print-color-adjust:exact;print-color-adjust:exact}
@media print{
  @page{margin:12mm}
  html,body{background:#fff!important;color:#000!important}
  body>*:not(#printSheet){display:none!important}
  .print-sheet{display:block;color:#000;font-family:var(--font-ui)}
  .print-page{break-after:page}
  .print-page:last-child{break-after:auto}
  .print-sheet{-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .print-page{display:flex;flex-direction:column;min-height:250mm}   /* fits A4 and US Letter */
  .print-head{display:flex;justify-content:space-between;align-items:center;gap:8mm;margin-bottom:4mm;padding-bottom:3.5mm;border-bottom:.6mm solid #e4e8f3}
  .print-brand{display:inline-flex;align-items:center;gap:2.6mm;font-size:15pt;font-weight:800;letter-spacing:-.02em;color:#101828}
  .print-brand svg{width:8mm;height:8mm;stroke:none;fill:none;flex:0 0 auto}
  .print-brand.small{gap:1.6mm;font-size:8.5pt;font-weight:700;letter-spacing:0}
  .print-brand.small svg{width:4.4mm;height:4.4mm}
  .print-level{display:inline-flex;align-items:center;gap:2.4mm;padding:1.6mm 3.6mm;border-radius:99px;background:#eef1fb;color:#3446c4;font-size:10.5pt;font-weight:700}
  .print-dots{display:inline-flex;gap:.9mm}
  .print-dots i{width:1.7mm;height:1.7mm;border-radius:99px;background:#c9d1f4}
  .print-dots i.on{background:#4b61e0}
  .print-rule{margin:0 0 4mm;font-size:9.5pt;line-height:1.4;color:#475069}
  .print-grids{display:grid;grid-template-columns:1fr 1fr;gap:5mm 10mm}
  .print-solutions{display:grid;grid-template-columns:repeat(3,1fr);gap:6mm}
  .print-sheet figure{margin:0;break-inside:avoid}
  .print-sheet figcaption{display:flex;justify-content:space-between;align-items:baseline;width:60mm;margin:1.6mm auto 0;font-size:9pt;color:#475069}
  .print-sheet figcaption b{color:#3446c4;font-weight:700}
  .print-solutions figcaption{width:auto;justify-content:center}
  .print-time{flex:0 0 26mm;padding-bottom:.4mm;border-bottom:.3mm solid #b8bfd0;text-align:left;font-size:8pt}
  .print-grid{margin:0 auto;border-collapse:separate;border-spacing:0;border:.7mm solid #5b647c;border-radius:2.6mm;overflow:hidden}
  .print-grid td{width:6.6mm;height:6.6mm;padding:0;border-right:.25mm solid #c8cede;border-bottom:.25mm solid #c8cede;text-align:center;vertical-align:middle;font-size:13pt;font-weight:650;font-family:var(--font-digit);color:#101828}
  .print-grid td:last-child{border-right:0}
  .print-grid tr:last-child td{border-bottom:0}
  .print-grid td:nth-child(3n):not(:last-child){border-right:.55mm solid #5b647c}
  .print-grid tr:nth-child(3n):not(:last-child) td{border-bottom:.55mm solid #5b647c}
  .print-grid.small{border-width:.5mm;border-radius:1.8mm}
  .print-grid.small td{width:4.6mm;height:4.6mm;font-size:7.5pt;font-weight:550;color:#3446c4}
  .print-foot{margin-top:auto;padding-top:3mm;display:flex;justify-content:space-between;align-items:center;gap:6mm;border-top:.4mm solid #e4e8f3;font-size:7.5pt;color:#5b647c}
}

/* ============================================================
   v18.3.0 — groups, confirmation, smooth sheets
   ============================================================ */
/* the app's own confirmation (never the browser's): above any sheet */
.confirm-overlay{z-index:95;align-items:center;padding:20px}
.confirm-card{width:min(100%,380px);padding:22px 20px 16px;border-radius:24px;background:var(--surface);box-shadow:var(--shadow-lg);text-align:center;
  animation:confirmIn .24s var(--ease) both}
@keyframes confirmIn{from{transform:translateY(10px) scale(.96);opacity:0}}
.confirm-icon{width:48px;height:48px;margin:0 auto 10px;border-radius:16px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent-strong)}
.confirm-icon.danger{background:var(--danger-soft);color:var(--danger)}
.confirm-icon svg{width:24px;height:24px}
.confirm-title{margin:0;font-size:19px;font-weight:800;letter-spacing:-.01em;line-height:1.25;overflow-wrap:anywhere}
.confirm-text{margin:8px 0 0;color:var(--text-2);font-size:14.5px;line-height:1.5}
.confirm-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:18px}
.confirm-actions .btn{min-height:48px;padding:0 12px}
@media (max-width:340px){.confirm-actions{grid-template-columns:1fr}.confirm-actions #confirmOk{order:-1}}

/* rows that act (groups: your data, manage the group) */
.app-row{color:var(--text);font:inherit;cursor:pointer}
:root{--danger-ink:#b4232a;--danger-btn:#c62828;--danger-btn-ink:#ffffff}
@media (prefers-color-scheme:dark){:root:not([data-scheme="light"]){--danger-ink:#ff8a8d;--danger-btn:#ff7a7e;--danger-btn-ink:#1c0204}}
/* dark chosen in Settings, on a light device */
:root[data-scheme="dark"]{--danger-ink:#ff8a8d;--danger-btn:#ff7a7e;--danger-btn-ink:#1c0204}
.app-row-icon.danger{background:var(--danger-soft);color:var(--danger-ink)}
.app-row.danger .app-row-title{color:var(--danger-ink)}
.btn.danger,.confirm-actions .btn.danger{background:var(--danger-btn);border-color:transparent;color:var(--danger-btn-ink)}
.confirm-icon.danger{background:var(--danger-soft);color:var(--danger-ink)}
.app-row-icon svg{width:19px;height:19px}
.group-manage{margin-bottom:4px}

/* groups list */
.data-note.center{text-align:center;padding:8px 2px 2px}
.groups-foot{margin-top:16px;padding-top:12px;border-top:1px solid var(--line)}
.groups-foot .privacy-note{margin:0 0 6px}
.groups-foot .privacy-note svg{color:var(--accent)}
.groups-foot .legal-links{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:12.5px}
.plan-note{margin-top:14px}

/* a group: play + invite on one line, level tabs with how many played */
.group-actions{grid-template-columns:minmax(0,1fr) auto}
.group-actions .invite-btn{min-height:50px;padding:0 14px}
.group-actions .my-result{min-height:50px}
@media (max-width:340px){.group-actions .invite-btn span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}}
.group-levels{margin-bottom:8px}
.group-levels .seg{position:relative}
.seg-count{position:absolute;top:4px;right:5px;display:inline-grid;place-items:center;min-width:17px;height:17px;padding:0 4px;border-radius:99px;
  background:var(--accent-soft-2);color:var(--accent-strong);font-size:10.5px;font-weight:800;line-height:1;font-variant-numeric:tabular-nums}
.text-btn.inline{display:inline;padding:0;font-size:inherit;min-height:24px}

/* placeholders while the server answers (about the final size: the sheet does not jump) */
.sheet-skeleton{display:grid;gap:10px;padding:6px 0 4px}
.sheet-skeleton i{display:block;height:58px;border-radius:14px;background:linear-gradient(90deg,var(--surface-2) 0%,var(--surface-3) 50%,var(--surface-2) 100%);
  background-size:200% 100%;animation:skeleton 1.3s ease-in-out infinite}
.sheet-skeleton .sk-box{height:84px}
.sheet-skeleton .sk-button{height:56px}
.sheet-skeleton .sk-actions{height:50px}
.sheet-skeleton .sk-tabs{height:44px}
.sheet-skeleton.board i{height:52px}
@keyframes skeleton{from{background-position:100% 0}to{background-position:-100% 0}}
@media (prefers-reduced-motion:reduce){.sheet-skeleton i{animation:none}}

/* a grille du jour left half-way */
.daily-level.paused{border-color:var(--accent-soft-2);background:var(--accent-soft)}
.daily-level.paused .dl-state{color:var(--accent-strong)}
.daily-level .dl-state svg{width:12px;height:12px}

/* stats before the first puzzle */
.stats-empty{text-align:center;padding:18px 8px 6px}
.stats-empty h3{margin:0 0 6px;font-size:19px;letter-spacing:-.01em}
.stats-empty p{margin:0 auto 16px;max-width:30em;color:var(--text-2);font-size:14.5px;line-height:1.5}
.stats-empty+.plus-stats{margin-top:18px}
/* Day streak in the header: days in a row with a solved puzzle (dimmed until today is played) */
.streak-chip{display:inline-flex;align-items:center;gap:4px;height:30px;padding:0 10px 0 7px;border:0;border-radius:99px;
  background:linear-gradient(135deg,#fff1e0,#ffe2c2);color:#8a3b00;font-weight:800;font-size:14px;font-variant-numeric:tabular-nums;
  box-shadow:inset 0 0 0 1px rgba(194,65,12,.18);transition:transform .15s var(--ease,ease),filter .2s}
.streak-chip svg{width:17px;height:17px;stroke:#ea580c;fill:#fdba74}
.streak-chip:hover{transform:translateY(-1px)}
.streak-chip.at-risk{background:var(--surface-2);color:var(--text-2);box-shadow:inset 0 0 0 1px var(--line-2)}
.streak-chip.at-risk svg{stroke:var(--text-2);fill:none}
/* no streak yet: grey, with a worried flame */
.streak-chip.none{background:var(--surface-2);color:var(--text-2);box-shadow:inset 0 0 0 1px var(--line-2)}
.streak-chip.none svg{stroke:var(--text-2);fill:none;stroke-width:1.9;width:19px;height:19px}
@media (prefers-color-scheme:dark){:where(:root:not([data-scheme="light"])) .streak-chip:not(.at-risk):not(.none){background:linear-gradient(135deg,#3a2210,#4a2a10);color:#fed7aa;box-shadow:inset 0 0 0 1px rgba(253,186,116,.25)}}
/* dark chosen in Settings, on a light device */
:where(:root[data-scheme="dark"]) .streak-chip:not(.at-risk):not(.none){background:linear-gradient(135deg,#3a2210,#4a2a10);color:#fed7aa;box-shadow:inset 0 0 0 1px rgba(253,186,116,.25)}
/* on a phone the flame takes the name's place (the logo still says which app it is) */
@media (max-width:440px){.brand.has-streak .brand-name{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}}
@media (prefers-reduced-motion:reduce){.streak-chip{transition:none}.streak-chip:hover{transform:none}}

.streak-unit-short{font-weight:700;font-size:12px;opacity:.8;margin-left:-1px}
.streak-unit-long{font-weight:700;font-size:13px;opacity:.85;margin-left:1px}
/* a phone shows « 2 j », wider screens « 2 jours » */
@media (min-width:441px){.streak-unit-short{display:none}}
@media (max-width:440px){.streak-unit-long{display:none}}
/* Day streak sheet */
.streak-hero{display:flex;align-items:center;justify-content:center;gap:10px;margin:4px 0 2px;color:#c2410c}
.streak-hero svg{width:40px;height:40px;stroke:#ea580c;fill:#fdba74}
.streak-hero.at-risk{color:var(--text-2)}
.streak-hero.at-risk svg{stroke:var(--text-2);fill:none}
.streak-hero.none{color:var(--text-2)}
.streak-hero.none svg{stroke:var(--text-2);fill:none;stroke-width:1.8}
.streak-big{font-size:52px;font-weight:850;line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;color:var(--text)}
.streak-unit{font-size:16px;font-weight:700;color:var(--text-2);align-self:flex-end;margin-bottom:8px}
.streak-state{margin:4px 0 14px;text-align:center;font-weight:650;color:var(--text-2)}
.streak-tiles{grid-template-columns:1fr 1fr}
.streak-cal{display:grid;grid-template-columns:repeat(7,1fr);gap:6px;max-width:320px;margin:4px auto 10px}
.streak-cal b{font-size:11px;font-weight:700;color:var(--muted);text-align:center}
.streak-cal i,.streak-cal button{aspect-ratio:1;border-radius:9px;background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--line);border:0;padding:0;min-width:0}
.streak-cal button{cursor:pointer;transition:transform .12s}
.streak-cal button:hover{transform:scale(1.08)}
.streak-cal .on{background:linear-gradient(135deg,#fdba74,#f97316);box-shadow:none}
.streak-cal .today{outline:2px solid var(--accent);outline-offset:1px}
.streak-cal button[aria-pressed="true"]{box-shadow:0 0 0 3px var(--surface),0 0 0 5px var(--text)}
.streak-cal i.future{opacity:.35}
/* the day picked in the calendar */
.streak-day{max-width:360px;margin:0 auto 6px;min-height:58px;padding:10px 12px;border-radius:14px;background:var(--surface-2);text-align:center}
.streak-day p{margin:0}
.streak-day-hint,.streak-day-none{font-size:13px;font-weight:600;color:var(--text-2);line-height:1.4}
.streak-day-hint{padding-top:9px}
.streak-day-date{font-size:14.5px;font-weight:800;margin-bottom:4px!important}
/* the day's numbers: four small tiles, then the levels in their order with "solved / played" */
.sd-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;margin-top:8px}
.sd-stats>div{display:grid;gap:1px;padding:8px 4px;border-radius:12px;background:var(--surface)}
.sd-stats b{font-size:17px;font-weight:850;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.sd-stats small{font-size:11px;font-weight:650;color:var(--text-2);line-height:1.25}
.sd-levels{list-style:none;display:flex;flex-wrap:wrap;justify-content:center;gap:6px;margin:10px 0 0;padding:0}
.sd-levels li{display:inline-flex;align-items:center;gap:6px;padding:4px 5px 4px 10px;border-radius:99px;background:var(--surface);border:1px solid var(--line);
  font-size:12.5px;font-weight:700}
.sd-levels .level-dots i{width:5px;height:5px}
.sd-levels b{min-width:22px;padding:1px 7px;border-radius:99px;background:var(--success);color:var(--surface);font-size:11.5px;font-weight:800;text-align:center;font-variant-numeric:tabular-nums}
.sd-levels b.part{background:var(--accent-soft);color:var(--accent-strong)}
@media (max-width:380px){.sd-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (prefers-color-scheme:dark){:where(:root:not([data-scheme="light"])) .streak-hero{color:#fdba74}}
/* dark chosen in Settings, on a light device */
:where(:root[data-scheme="dark"]) .streak-hero{color:#fdba74}
/* Sudoku+ hub: each perk opens what it gives */
.plus-hero.member .plus-thanks{margin:0 auto 6px;max-width:34ch;color:var(--text-2);font-size:14px}
.app-row-icon.soft{background:var(--accent-soft);color:var(--accent-strong)}
