@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-sub.woff") format("woff");
  font-weight: 300 700;
  font-display: swap;
}

/* Colour tokens. These are the "classic" Coven theme; the other themes are at the end. */
:root, [data-swatch="classic"] {
  --night: #241a44; --night-2: #33265e; --night-3: #45357a;
  --ink: #fff8ec; --ink-2: #d9cff5; --dim: #a99cd0;
  --accent: #ffd166; --on-accent: #2c2050; --accent-shadow: #b0862e; --bad: #ff7a90;
  --deep: #1b1436; --panel: #251b47; --raised: #3e2f72; --shade: #160f2e; --big-bot: #2b2052; --resume-top: #4a3a7e;
  --logo-bg: #fff4dc; --logo-line: #2c2050;
  /* the grid */
  --cell: #fff6e3; --cell-alt: #f3e6c9; --thin: #cdb894; --thick: #2c2050; --frame: #2c2050;
  --given: #2c2050; --entry: #6a3fc0; --note: #6f5f96;
  --peer: #ead7f7; --peer-alt: #e0c9ef; --same: #ffd98a; --sel: #ffc94d; --sel-ring: #b07a10;
  --wrong-bg: #ffd9df; --wrong-ink: #d0203f; --hint-ink: #1f8a6a; --flash: #fff1b8;
  --sky:
    radial-gradient(2px 2px at 12% 18%, #fff8 50%, transparent 51%),
    radial-gradient(2px 2px at 82% 9%, #fff9 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 66% 30%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 30% 6%, #fff5 50%, transparent 51%),
    radial-gradient(2px 2px at 92% 74%, #fff6 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 6% 88%, #fff5 50%, transparent 51%),
    radial-gradient(60% 40% at 50% 0%, #4b3a8a 0%, transparent 70%),
    radial-gradient(50% 35% at 100% 100%, #3b2a6a 0%, transparent 70%),
    linear-gradient(#2a1f50, #1d1538);
  --radius: 14px;
  --board: min(calc(100vw - 16px), calc(100dvh - 300px), 560px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--night); color: var(--ink);
  font-family: "Fredoka", "Trebuchet MS", system-ui, sans-serif; font-size: 17px;
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none;
  overflow-x: hidden; overscroll-behavior: none;
}
button { font: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
[hidden] { display: none !important; }
.sprite { position: absolute; }
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--sky); }

.app { max-width: 680px; margin: 0 auto; min-height: 100dvh;
  padding: max(8px, env(safe-area-inset-top)) 8px max(10px, env(safe-area-inset-bottom)); }
.screen { display: flex; flex-direction: column; min-height: calc(100dvh - 20px); }

/* ---------- Home ---------- */
#home { gap: 12px; padding: 8px 8px 0; }
.brand { text-align: center; margin-top: 3vh; }
.brand .logo { width: 78px; height: 78px; filter: drop-shadow(0 6px 14px rgba(0,0,0,.45)); }
.brand h1 { margin: 4px 0 0; font-size: 40px; font-weight: 700; letter-spacing: .02em; text-shadow: 0 3px 0 var(--shade); }
.brand .tag { margin: 0; color: var(--dim); }
.brand .goal { margin: 6px auto 0; max-width: 30ch; color: var(--ink-2); font-size: 16px; line-height: 1.3; }
.streak { text-align: center; color: var(--accent); font-weight: 600; margin: -4px 0 0; min-height: 1.2em; }

.big { display: block; width: 100%; text-align: left; border: 2px solid var(--night-3); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--night-2), var(--big-bot)); padding: 14px 18px; min-height: 64px; box-shadow: 0 4px 0 var(--shade); }
.big b { display: block; font-size: 20px; font-weight: 600; }
.big small { display: block; color: var(--dim); font-size: 15px; margin-top: 2px; }
.big:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--shade); }
.big.resume { border-color: var(--accent); background: linear-gradient(180deg, var(--resume-top), var(--night-2)); }
.big.resume b { color: var(--accent); }
.big.daily b span { color: var(--dim); font-weight: 400; font-size: 16px; }
.big.daily.done small { color: var(--accent); }
.label { color: var(--dim); font-size: 14px; margin: 6px 0 -4px; }
.label.center { text-align: center; }
.levels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lvl { border: 2px solid var(--night-3); border-radius: var(--radius); background: var(--panel); padding: 12px 8px; min-height: 66px;
  box-shadow: 0 4px 0 var(--shade); }
.lvl b { display: block; font-size: 19px; font-weight: 600; }
.lvl small { display: block; color: var(--dim); font-size: 13px; min-height: 1.2em; }
.lvl:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--shade); }
.home-foot { margin-top: auto; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 14px 0 6px; }
.chip-btn { border: 2px solid var(--night-3); background: var(--deep); border-radius: 99px; padding: 8px 16px; min-height: 46px; }
.chip-btn[aria-pressed="false"] { color: var(--dim); }

/* ---------- Sheets, modals, toast ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(10, 6, 24, .6); z-index: 20; }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 680px; margin: 0 auto;
  background: var(--night-2); border-radius: 22px 22px 0 0; border-top: 2px solid var(--night-3);
  padding: 18px 16px max(18px, env(safe-area-inset-bottom)); max-height: 92dvh; overflow-y: auto; animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.howto { color: var(--ink-2); line-height: 1.45; margin: 8px 0; }
.go { display: block; width: 100%; margin-top: 18px; min-height: 56px; border: 0; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-size: 20px; font-weight: 600; box-shadow: 0 4px 0 var(--accent-shadow); }
.go:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--accent-shadow); }
.go.small { width: auto; margin: 0; padding: 0 26px; font-size: 18px; }
.go.ghost { background: var(--night-3); color: var(--ink); box-shadow: 0 4px 0 var(--shade); }
.toggles { display: grid; gap: 8px; margin-top: 8px; }
.toggle { display: flex; align-items: center; gap: 12px; background: var(--panel); border: 2px solid var(--night-3); border-radius: 14px; padding: 10px 14px; cursor: pointer; }
.toggle span { flex: 1; }
.toggle b { display: block; font-weight: 600; }
.toggle small { display: block; color: var(--dim); font-size: 14px; }
.toggle input { appearance: none; -webkit-appearance: none; flex: none; width: 64px; height: 40px; border-radius: 99px; background: var(--deep);
  border: 2px solid var(--night-3); position: relative; cursor: pointer; transition: background .15s; margin: 0; }
.toggle input::after { content: ""; position: absolute; top: 5px; left: 5px; width: 26px; height: 26px; border-radius: 50%; background: var(--dim); transition: transform .15s, background .15s; }
.toggle input:checked { background: var(--accent); border-color: var(--accent); }
.toggle input:checked::after { transform: translateX(24px); background: var(--on-accent); }

.modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(10, 6, 24, .62); padding: 16px; }
.modal .card { width: min(100%, 380px); background: var(--night-2); border: 2px solid var(--night-3); border-radius: 20px; padding: 20px 18px; text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.5); animation: up .2s ease-out; }
.modal h3 { margin: 0 0 6px; font-size: 24px; font-weight: 600; }
.modal p { margin: 0 0 8px; color: var(--ink-2); }
.modal-buttons { display: grid; gap: 10px; margin-top: 14px; }
.modal-buttons .go { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0 4px; }
.stats div { background: var(--panel); border-radius: 12px; padding: 8px 4px; }
.stats b { display: block; font-size: 22px; color: var(--accent); }
.stats small { color: var(--dim); font-size: 13px; }
.newbest { color: var(--accent); font-weight: 600; }

.toast { position: fixed; left: 50%; bottom: calc(110px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 50;
  background: var(--ink); color: var(--night); padding: 10px 16px; border-radius: 12px; font-weight: 600; pointer-events: none;
  opacity: 0; transition: opacity .2s; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; }

/* ---------- Themes sheet ---------- */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 10px; }
.themes button { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 8px 10px; text-align: left;
  border-radius: 14px; border: 2px solid var(--night-3); background: var(--panel); color: var(--ink); }
.themes button[aria-pressed="true"] { border-color: var(--accent); background: var(--raised); }
.themes .sw { flex: none; display: grid; grid-template-columns: repeat(3, 1fr); width: 42px; height: 42px; border-radius: 8px; overflow: hidden;
  border: 2px solid var(--frame); background: var(--thin); gap: 1px; }
.themes .sw i { display: grid; place-items: center; background: var(--cell); color: var(--given); font-style: normal; font-size: 10px; font-weight: 600; }
.themes .sw i.s { background: var(--sel); }
.themes .sw i.p { background: var(--peer); }
.themes .sw i.e { color: var(--entry); }

/* ---------- Game ---------- */
#game { align-items: center; gap: 8px; }
.topbar { width: var(--board); display: flex; align-items: center; gap: 6px; }
.icon-btn { flex: none; width: 46px; height: 46px; border-radius: 12px; border: 2px solid var(--night-3); background: var(--night-2); display: grid; place-items: center; padding: 0; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:active { background: var(--night-3); }
.title-box { flex: 1; min-width: 0; text-align: center; line-height: 1.1; }
.mode-label { font-weight: 600; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.clock { color: var(--dim); font-variant-numeric: tabular-nums; font-size: 16px; }
.clock.hide { visibility: hidden; }
.infobar { width: var(--board); display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 40px; }
.info-chip { border: 0; background: none; color: var(--dim); font-size: 15px; padding: 2px 4px; min-height: 40px; display: inline-flex; align-items: center; gap: 4px; }
.info-chip[aria-pressed="true"] b { color: var(--bad); }
.info-chip.plain { cursor: default; }

.board-wrap { position: relative; width: var(--board); height: var(--board); }
.board { width: 100%; height: 100%; display: grid; grid-template-columns: repeat(9, 1fr); grid-template-rows: repeat(9, 1fr);
  background: var(--thin); border: 3px solid var(--frame); border-radius: 10px; overflow: hidden; gap: 1px;
  box-shadow: 0 10px 28px rgba(0,0,0,.4); touch-action: manipulation; }
.cell { position: relative; background: var(--cell); display: grid; place-items: center; cursor: pointer; min-width: 0; min-height: 0;
  font-size: calc(var(--board) * .072); line-height: 1; color: var(--entry); font-weight: 500; transition: background-color .12s; }
.cell.alt { background: var(--cell-alt); }
/* the 3 x 3 boxes: thick lines drawn as inset borders on the cells at their edges */
.cell.br { box-shadow: inset -2px 0 0 var(--thick); }
.cell.bb { box-shadow: inset 0 -2px 0 var(--thick); }
.cell.br.bb { box-shadow: inset -2px 0 0 var(--thick), inset 0 -2px 0 var(--thick); }
.cell.given { color: var(--given); font-weight: 600; }
.cell.hinted { color: var(--hint-ink); }
.cell.peer { background: var(--peer); }
.cell.peer.alt { background: var(--peer-alt); }
.cell.same { background: var(--same); }
.cell.sel { background: var(--sel); }
.cell.sel::after { content: ""; position: absolute; inset: 0; border: 2px solid var(--sel-ring); pointer-events: none; }
.cell.wrong { color: var(--wrong-ink); background: var(--wrong-bg); }
.cell.wrong.sel { background: var(--sel); }
.cell .v { pointer-events: none; }
.cell.pop .v { animation: pop .2s ease-out; }
@keyframes pop { from { transform: scale(.5); opacity: .3; } }
.cell.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }
.notes { position: absolute; inset: 1px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); pointer-events: none; }
.notes i { display: grid; place-items: center; font-style: normal; font-size: calc(var(--board) * .028); color: var(--note); font-weight: 500; border-radius: 4px; }
.notes i.m { background: var(--same); color: var(--given); font-weight: 600; }
.cell.flash { animation: flash .55s ease-out; }
@keyframes flash { 40% { background: var(--flash); } }
.cell.win { animation: winwave .9s ease-in-out both; }
@keyframes winwave { 0% { transform: none; } 40% { transform: scale(.82) rotate(-6deg); background: var(--sel); } 100% { transform: none; } }

.paused { position: absolute; inset: 0; display: grid; place-content: center; gap: 12px; text-align: center;
  background: var(--night-2); border: 3px solid var(--night-3); border-radius: 10px; }
.paused p { margin: 0; font-size: 26px; font-weight: 600; }

.side { width: var(--board); display: grid; gap: 8px; margin-top: auto; }
.tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tool { position: relative; display: grid; justify-items: center; gap: 2px; min-height: 56px; padding: 6px 2px 4px; border-radius: 12px;
  border: 2px solid var(--night-3); background: var(--night-2); font-size: 14px; color: var(--ink-2); }
.tool svg { width: 24px; height: 24px; color: var(--ink); }
.tool:active { background: var(--night-3); }
.tool:disabled { opacity: .4; }
.tool .badge { position: absolute; top: 4px; right: 6px; font-style: normal; font-size: 11px; font-weight: 600; padding: 1px 5px; border-radius: 99px; background: var(--deep); color: var(--dim); }
.tool[aria-pressed="true"] { border-color: var(--accent); background: var(--raised); }
.tool[aria-pressed="true"] .badge { background: var(--accent); color: var(--on-accent); }
.pad { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; margin: 0 -6px; }
.num { position: relative; min-height: 60px; border-radius: 12px; border: 2px solid var(--night-3); background: linear-gradient(180deg, var(--night-2), var(--big-bot));
  font-size: 28px; font-weight: 600; padding: 0; color: var(--ink); box-shadow: 0 3px 0 var(--shade); display: grid; place-items: center; }
.num small { position: absolute; bottom: 3px; left: 0; right: 0; font-size: 11px; font-weight: 400; color: var(--dim); }
.num:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--shade); }
.num.done { opacity: .3; }
.num.notes-mode { color: var(--accent); }
.keys-help { display: none; margin: 4px 0 0; color: var(--dim); font-size: 13px; line-height: 1.4; }

/* Wide screens (PC, tablets, phones on their side): the grid on the left, the tools and a 3 x 3 number pad beside it */
@media (min-aspect-ratio: 6/5) and (min-width: 700px) {
  :root { --board: min(calc(100dvh - 120px), calc(100vw - 380px), 640px); }
  .app { max-width: 1060px; }
  #game { display: grid; grid-template-columns: var(--board) 300px; grid-template-rows: auto auto 1fr; column-gap: 24px; row-gap: 8px;
    justify-content: center; align-items: start; padding-top: 12px; }
  #game .topbar, #game .infobar { grid-column: 1 / span 2; width: 100%; }
  #game .board-wrap { grid-column: 1; grid-row: 3; }
  #game .side { grid-column: 2; grid-row: 3; width: 100%; margin-top: 0; align-content: start; }
  .tools { grid-template-columns: repeat(2, 1fr); }
  .pad { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .num { min-height: 74px; font-size: 32px; }
  .keys-help { display: block; }
  .cell:hover:not(.sel) { filter: brightness(.96); }
  #home { max-width: 520px; margin: 0 auto; width: 100%; }
}
@media (orientation: landscape) and (max-height: 540px) {
  :root { --board: min(calc(100dvh - 28px), calc(100vw - 340px), 640px); }
  .app { max-width: 1060px; }
  #game { display: grid; grid-template-columns: var(--board) minmax(0, 1fr); grid-template-rows: auto auto 1fr; column-gap: 16px; row-gap: 6px;
    justify-content: center; align-items: start; padding-top: 0; min-height: 0; }
  #game .topbar, #game .infobar { grid-column: 2; width: 100%; }
  #game .board-wrap { grid-column: 1; grid-row: 1 / span 3; }
  #game .side { grid-column: 2; grid-row: 3; width: 100%; margin-top: 0; align-content: start; }
  .tools { grid-template-columns: repeat(4, 1fr); }
  .pad { grid-template-columns: repeat(9, 1fr); gap: 4px; }
  .num { min-height: 48px; font-size: 24px; }
  .tool { min-height: 50px; }
  .keys-help { display: none; }
}
/* very short phones: a slightly smaller pad keeps the whole game on one screen */
@media (max-height: 700px) and (max-aspect-ratio: 6/5) {
  :root { --board: min(calc(100vw - 16px), calc(100dvh - 270px), 560px); }
  .num { min-height: 50px; }
  .tool { min-height: 48px; }
}
/* Phones on their side: the title and the small buttons on the left, the puzzles on the right, nothing below the fold */
@media (orientation: landscape) and (max-height: 540px) {
  #home { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); grid-auto-rows: min-content; column-gap: 20px; row-gap: 8px;
    align-content: center; min-height: calc(100dvh - 20px); padding-top: 0; max-width: 900px; margin: 0 auto; width: 100%; }
  #home > * { grid-column: 2; }
  #home .brand { grid-column: 1; grid-row: 1 / span 5; margin-top: 0; align-self: center; }
  #home .brand .logo { width: 48px; height: 48px; }
  #home .brand .tag { display: none; }
  #home .brand h1 { font-size: 34px; }
  #home .brand .goal { font-size: 15px; }
  #home .home-foot { grid-column: 1; grid-row: 6 / span 2; margin-top: 0; padding: 0; gap: 6px; align-self: start; }
  #home .chip-btn { min-height: 42px; padding: 6px 12px; font-size: 16px; }
  #home .cstats-line { font-size: 13px; }
  .big { min-height: 56px; padding: 8px 16px; }
  .levels { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .lvl { min-height: 54px; padding: 6px 2px; }
  .lvl b { font-size: 16px; }
  .label { display: none; }
  .streak { margin: 0; }
}@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- Themes ----------
   Each theme is a set of colour tokens on <html data-theme="...">. "classic" is the :root values above. */
:root[data-theme="midnight"], [data-swatch="midnight"] {
  --night: #0e0f14; --night-2: #1a1c24; --night-3: #2c2f3b; --ink: #eef0f5; --ink-2: #c9ccd6; --dim: #9599a8;
  --accent: #8fb8ff; --on-accent: #0e1626; --accent-shadow: #4f6fa8; --bad: #ff7a85;
  --deep: #08090d; --panel: #15171e; --raised: #263147; --shade: #000; --big-bot: #14161c; --resume-top: #22283a;
  --logo-bg: #1a1c24; --logo-line: #c9ccd6;
  --sky: radial-gradient(60% 40% at 50% 0%, #1d2233 0%, transparent 70%), linear-gradient(#111319, #0a0b0f);
  --cell: #181a22; --cell-alt: #1e2029; --thin: #2c2f3b; --thick: #8a90a3; --frame: #8a90a3;
  --given: #eef0f5; --entry: #8fb8ff; --note: #8b90a2;
  --peer: #232838; --peer-alt: #283043; --same: #2f4166; --sel: #3d5a8f; --sel-ring: #8fb8ff;
  --wrong-bg: #4a1f28; --wrong-ink: #ff8a95; --hint-ink: #7ee0b8; --flash: #34507f;
}
:root[data-theme="parchment"], [data-swatch="parchment"] {
  color-scheme: light;
  --night: #f3ead8; --night-2: #fffaf0; --night-3: #d8c7a4; --ink: #2e2214; --ink-2: #4a3a26; --dim: #6b573d;
  --accent: #a84a24; --on-accent: #fffaf0; --accent-shadow: #6e2f14; --bad: #b3261e;
  --deep: #fffdf8; --panel: #f7eedd; --raised: #f0dcc0; --shade: #c9b48e; --big-bot: #f5ead6; --resume-top: #fff3df;
  --logo-bg: #fffaf0; --logo-line: #3b2616;
  --sky: radial-gradient(60% 40% at 50% 0%, #fff7e6 0%, transparent 70%), linear-gradient(#f6eedd, #eadcc0);
  --cell: #fffdf6; --cell-alt: #f8f0de; --thin: #dccbaa; --thick: #3b2616; --frame: #3b2616;
  --given: #2e2214; --entry: #2f5fb3; --note: #7a6648;
  --peer: #f4e6c8; --peer-alt: #eddcb9; --same: #f6cf8f; --sel: #f0b45c; --sel-ring: #8a4a14;
  --wrong-bg: #f9d3cc; --wrong-ink: #b3261e; --hint-ink: #2d7a4f; --flash: #ffe9a8;
}
:root[data-theme="moss"], [data-swatch="moss"] {
  --night: #12241a; --night-2: #1b3426; --night-3: #2f5240; --ink: #f1f5ec; --ink-2: #d4e2cf; --dim: #a3bca6;
  --accent: #f2c14e; --on-accent: #22301f; --accent-shadow: #a8812a; --bad: #ff8a7a;
  --deep: #0c1a12; --panel: #17301f; --raised: #2c4a36; --shade: #07110b; --big-bot: #16301f; --resume-top: #2a4a35;
  --logo-bg: #eef3e4; --logo-line: #1f3a28;
  --sky: radial-gradient(60% 40% at 50% 0%, #2c5238 0%, transparent 70%), linear-gradient(#173023, #0d1b13);
  --cell: #f4f6ea; --cell-alt: #e6ecd6; --thin: #b8c7a4; --thick: #1f3a28; --frame: #1f3a28;
  --given: #1f2a1f; --entry: #2f7a3f; --note: #5d7360;
  --peer: #dfe9cc; --peer-alt: #d3e0bd; --same: #f4dc8a; --sel: #f2c14e; --sel-ring: #8a6a12;
  --wrong-bg: #f8d4cc; --wrong-ink: #c0392b; --hint-ink: #1f6f8a; --flash: #fff3b0;
}
:root[data-theme="neon"], [data-swatch="neon"] {
  --night: #0a0618; --night-2: #160d2e; --night-3: #3a1d6e; --ink: #f4f1ff; --ink-2: #d6ccff; --dim: #a596d8;
  --accent: #2af5d2; --on-accent: #04201b; --accent-shadow: #0f8f7a; --bad: #ff4f8b;
  --deep: #07041a; --panel: #120a28; --raised: #2a1460; --shade: #000; --big-bot: #110a26; --resume-top: #26135a;
  --logo-bg: #120a28; --logo-line: #ff3fd4;
  --sky: radial-gradient(50% 35% at 15% 0%, rgba(255, 63, 212, .32) 0%, transparent 70%), radial-gradient(50% 35% at 90% 100%, rgba(42, 245, 210, .22) 0%, transparent 70%), linear-gradient(#0d0722, #06030f);
  --cell: #120a28; --cell-alt: #170d33; --thin: #2b1856; --thick: #ff3fd4; --frame: #ff3fd4;
  --given: #f4f1ff; --entry: #2af5d2; --note: #a596d8;
  --peer: #1f1145; --peer-alt: #251452; --same: #3a1d6e; --sel: #5a2aa8; --sel-ring: #2af5d2;
  --wrong-bg: #4a0c2c; --wrong-ink: #ff6aa0; --hint-ink: #ffe066; --flash: #4a2b8f;
}
:root[data-theme="ocean"], [data-swatch="ocean"] {
  --night: #0b2236; --night-2: #12324d; --night-3: #24557a; --ink: #eef7ff; --ink-2: #cfe4f5; --dim: #9dbdd4;
  --accent: #ffb86b; --on-accent: #2b1a08; --accent-shadow: #b0753a; --bad: #ff8a8a;
  --deep: #081a2a; --panel: #0f2b43; --raised: #1f4a6e; --shade: #04121e; --big-bot: #0f2c45; --resume-top: #1d4668;
  --logo-bg: #eef7ff; --logo-line: #0b2236;
  --sky: radial-gradient(60% 40% at 50% 0%, #1f5580 0%, transparent 70%), linear-gradient(#0f2c45, #071724);
  --cell: #f4f9fd; --cell-alt: #e4eff7; --thin: #b3cbdc; --thick: #0b2236; --frame: #0b2236;
  --given: #0b2236; --entry: #1d6fb8; --note: #5d7d95;
  --peer: #d8e9f5; --peer-alt: #cbe0ef; --same: #ffd9ad; --sel: #ffb86b; --sel-ring: #a85f12;
  --wrong-bg: #fcd6d6; --wrong-ink: #c62828; --hint-ink: #1e8a62; --flash: #fff0c8;
}
:root[data-theme="pastel"], [data-swatch="pastel"] {
  color-scheme: light;
  --night: #f7f1fb; --night-2: #ffffff; --night-3: #dccdf0; --ink: #3a2b52; --ink-2: #4f3f6a; --dim: #6a5a86;
  --accent: #f7b6d2; --on-accent: #3a2b52; --accent-shadow: #d98bb0; --bad: #b42848;
  --deep: #ffffff; --panel: #f3ebfa; --raised: #f8dcec; --shade: #d8c8ea; --big-bot: #f6effc; --resume-top: #fde8f2;
  --logo-bg: #ffffff; --logo-line: #4a3a68;
  --sky: radial-gradient(50% 40% at 10% 0%, #ffe3ef 0%, transparent 70%), radial-gradient(50% 40% at 90% 100%, #dff3ee 0%, transparent 70%), linear-gradient(#f9f3fd, #f1eafa);
  --cell: #ffffff; --cell-alt: #fbf6fe; --thin: #e4d8f2; --thick: #9d86d0; --frame: #9d86d0;
  --given: #3a2b52; --entry: #c2508a; --note: #8a7aa6;
  --peer: #f1e8fb; --peer-alt: #eadff7; --same: #ffd9ea; --sel: #f7b6d2; --sel-ring: #b0457a;
  --wrong-bg: #ffd8de; --wrong-ink: #b42848; --hint-ink: #2f8a7a; --flash: #fff2c4;
}
:root[data-theme="contrast"], [data-swatch="contrast"] {
  --night: #000; --night-2: #000; --night-3: #fff; --ink: #fff; --ink-2: #fff; --dim: #e6e6e6;
  --accent: #ffe500; --on-accent: #000; --accent-shadow: #8a7c00; --bad: #ff6b6b;
  --deep: #000; --panel: #000; --raised: #333; --shade: #000; --big-bot: #000; --resume-top: #1a1a1a;
  --logo-bg: #000; --logo-line: #fff; --sky: linear-gradient(#000, #000);
  --cell: #fff; --cell-alt: #fff; --thin: #777; --thick: #000; --frame: #fff;
  --given: #000; --entry: #0040d0; --note: #333;
  --peer: #dde6ff; --peer-alt: #dde6ff; --same: #ffe500; --sel: #ffe500; --sel-ring: #000;
  --wrong-bg: #ffb3b3; --wrong-ink: #b00000; --hint-ink: #006b2e; --flash: #ffe500;
}
:root[data-theme="contrast"] .cell.br { box-shadow: inset -3px 0 0 var(--thick); }
:root[data-theme="contrast"] .cell.bb { box-shadow: inset 0 -3px 0 var(--thick); }
:root[data-theme="contrast"] .cell.br.bb { box-shadow: inset -3px 0 0 var(--thick), inset 0 -3px 0 var(--thick); }

