/* Unknot — paper by day, ink-blue at night; calm, still backgrounds (nothing behind the board moves). */
:root {
  color-scheme: light;
  --bg: #f5efe6;
  --bg-glow: #fbf6ee;
  --surface: #fffdf9;
  --surface2: #f3ebdf;
  --text: #22252f;
  --muted: #5f6474;
  --line: rgba(70, 52, 30, 0.13);
  --accent: #4655c8;
  --accent-ink: #ffffff;
  --accent-soft: rgba(70, 85, 200, 0.12);
  --warm: #d4534c;
  --star: #e6a020;
  --dot: rgba(80, 62, 40, 0.2);
  --ghost: #ebdfcd;
  --tile-ghost: #d4c7b3;
  --bad-hex: #d9433f;
  --glow-hex: #f5b83a;
  --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 10px 30px -14px rgba(60, 40, 20, 0.28);
  --ca-accent: #4655c8;
  --ca-tool-bg: rgba(255, 253, 249, 0.7);
  --display: ui-rounded, "SF Pro Rounded", "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #10131d;
  --bg-glow: #171b2a;
  --surface: #181c29;
  --surface2: #212637;
  --text: #eceef5;
  --muted: #a6acbd;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #8e9bff;
  --accent-ink: #10131d;
  --accent-soft: rgba(142, 155, 255, 0.16);
  --warm: #ff7b72;
  --star: #ffc94d;
  --dot: rgba(215, 222, 255, 0.17);
  --ghost: #1f2537;
  --tile-ghost: #4a5370;
  --bad-hex: #ff6b6b;
  --glow-hex: #ffd36b;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 34px -16px rgba(0, 0, 0, 0.7);
  --ca-accent: #8e9bff;
  --ca-tool-bg: rgba(33, 38, 55, 0.7);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #10131d;
    --bg-glow: #171b2a;
    --surface: #181c29;
    --surface2: #212637;
    --text: #eceef5;
    --muted: #a6acbd;
    --line: rgba(255, 255, 255, 0.1);
    --accent: #8e9bff;
    --accent-ink: #10131d;
    --accent-soft: rgba(142, 155, 255, 0.16);
    --warm: #ff7b72;
    --star: #ffc94d;
    --dot: rgba(215, 222, 255, 0.17);
    --ghost: #1f2537;
    --tile-ghost: #4a5370;
    --bad-hex: #ff6b6b;
    --glow-hex: #ffd36b;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 34px -16px rgba(0, 0, 0, 0.7);
    --ca-accent: #8e9bff;
    --ca-tool-bg: rgba(33, 38, 55, 0.7);
  }
}
* { box-sizing: border-box; }
/* no double-tap zoom on iOS: js/touch-guard.js adds the same rule plus a JS
   fallback; this copy covers Safari before 16.4 under the strict CSP */
:where(html, body, body *) { touch-action: manipulation; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; height: calc(100dvh / var(--ca-zoom, 1)); overflow: hidden; display: flex; flex-direction: column;
  background: radial-gradient(120% 70% at 50% 0%, var(--bg-glow), var(--bg) 70%) fixed, var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* a game page: no text selection or long-press callouts anywhere, HUD and
   menus included; form fields and long text (the Help sheet) opt back in */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea, [contenteditable], .prose p, .ch-desc { -webkit-user-select: text; user-select: text; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
svg { display: block; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* the bar: its ends are the SDK's (the block at the end of this file) */
.bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 8px 12px 8px 16px; flex: none; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.screen { flex: 1; min-height: 0; }

/* ------------------------------------------------------------------ buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font-weight: 650; line-height: 1.15; text-align: center; cursor: pointer; transition: transform .12s ease, background-color .15s ease; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--accent); border-color: transparent; color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.wide { width: 100%; }
.btn.small { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
@media (hover: hover) { .btn:not(:disabled):hover { filter: brightness(1.04); } }

/* ------------------------------------------------------------------ home */
#home { overflow: auto; overscroll-behavior: contain; }
.home-in { max-width: 860px; margin: 0 auto; padding: 6px 16px 28px; display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 14px; border-radius: 26px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; }
.hero-art { display: block; width: 100%; aspect-ratio: 1 / 1; max-height: calc(44dvh / var(--ca-zoom, 1)); border-radius: 18px; background: var(--surface2); overflow: hidden; }
.hero-art canvas { display: block; width: 100%; height: 100%; }
.hero-text { display: grid; gap: 2px; padding: 8px 6px 2px; }
.kicker { margin: 0; color: var(--muted); font-size: 13px; font-weight: 650; letter-spacing: .02em; }
.hero-title { font-family: var(--display); font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.hero-line { color: var(--muted); font-size: 15px; }
.hero-go { margin-top: 12px; justify-self: start; min-width: 150px; pointer-events: none; }
@media (hover: hover) { .hero:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); } }
.hero:active .hero-go { transform: scale(.97); }
@media (min-width: 640px) {
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 20px; padding: 18px; }
  .hero-art { max-height: none; }
  .hero-title { font-size: 38px; }
}
.home-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.chip-btn { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; column-gap: 11px; min-height: 58px; padding: 8px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-weight: 700; line-height: 1.2; cursor: pointer; text-align: left; }
.chip-btn svg { grid-row: span 2; width: 24px; height: 24px; color: var(--accent); }
.chip-btn > span:not(.chip-num) { min-width: 0; overflow-wrap: anywhere; }
.chip-num { color: var(--muted); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.section-title { margin: 8px 2px 0; font-family: var(--display); font-size: 18px; font-weight: 750; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 760px) { .modes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mode { display: grid; grid-template-rows: auto auto 1fr; align-content: start; gap: 4px; min-height: 132px; padding: 14px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); text-align: left; cursor: pointer; transition: transform .12s ease; }
.mode:active { transform: scale(.98); }
.mode-ico { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: 6px; border-radius: 13px; }
.mode-ico svg { width: 22px; height: 22px; }
.m1 { background: color-mix(in srgb, #e9a23b 22%, transparent); color: #b8740d; }
.m2 { background: color-mix(in srgb, #2f8fd3 20%, transparent); color: #1f6fa8; }
.m3 { background: color-mix(in srgb, #8455c2 20%, transparent); color: #6d3fae; }
.m4 { background: color-mix(in srgb, #1c8f86 20%, transparent); color: #127068; }
:root[data-theme="dark"] .m1 { color: #ffc15e; } :root[data-theme="dark"] .m2 { color: #5cb8ff; } :root[data-theme="dark"] .m3 { color: #b78cff; } :root[data-theme="dark"] .m4 { color: #3fd0c0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .m1 { color: #ffc15e; } :root:not([data-theme="light"]) .m2 { color: #5cb8ff; } :root:not([data-theme="light"]) .m3 { color: #b78cff; } :root:not([data-theme="light"]) .m4 { color: #3fd0c0; } }
.mode-t { font-weight: 750; line-height: 1.2; }
.mode-s { color: var(--muted); font-size: 13px; line-height: 1.3; }

/* ------------------------------------------------------------------ the journey and the album */
#levels, #album { overflow: auto; overscroll-behavior: contain; width: 100%; padding: 0 max(16px, calc((100% - 828px) / 2)) 28px; }
.screen-head { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.screen-head h2 { flex: 1; min-width: 0; margin: 0; font-family: var(--display); font-size: 22px; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-stat { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 650; font-variant-numeric: tabular-nums; }
.head-stat svg { width: 18px; height: 18px; color: var(--star); fill: currentColor; }
.tabs { display: flex; gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 4px 2px 10px; scroll-padding: 0 16px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 650; cursor: pointer; white-space: nowrap; }
.tab[aria-selected="true"] { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.tab.locked:not([aria-selected="true"]) { color: var(--muted); }
.tab-n { color: var(--muted); font-weight: 800; font-variant-numeric: tabular-nums; }
.tab[aria-selected="true"] .tab-n { color: inherit; opacity: .75; }
.tab-done svg { width: 15px; height: 15px; fill: var(--star); }
.tabs.small { flex-wrap: wrap; overflow: visible; padding-bottom: 6px; }
.tabs.small .tab, .tabs.small > button { min-height: 36px; }
.chapter-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 2px 2px 10px; }
.chapter-head h3 { margin: 0; font-size: 17px; font-family: var(--display); }
.chapter-head span { color: var(--muted); font-size: 13px; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.tile { position: relative; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; aspect-ratio: 1 / 1.08; padding: 5px 6px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; }
.tile.boss { border-color: color-mix(in srgb, var(--star) 55%, var(--line)); }
.tile.locked { background: var(--surface2); box-shadow: none; cursor: default; color: var(--muted); }
.tile-n { justify-self: start; padding-left: 2px; font-size: 12px; line-height: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.tile-art { display: grid; place-items: center; min-height: 0; padding: 1px 6px; }
.tile-art canvas { width: 100%; height: 100%; max-width: 64px; max-height: 64px; }
.tile-art svg { width: 20px; height: 20px; opacity: .55; }
.tile-stars { display: flex; justify-content: center; gap: 1px; height: 13px; }
.tile-stars svg { width: 13px; height: 13px; fill: var(--line); }
.tile-stars .on svg { fill: var(--star); }
/* a tile not open yet: its number over a small lock, in the middle */
.tile.locked { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.tile.locked .tile-n { padding: 0; }
.tile.locked .tile-art { flex: none; padding: 0; }
.tile.locked .tile-stars { display: none; }
@media (max-width: 360px) { .tiles { gap: 7px; } .tile-stars svg { width: 11px; height: 11px; } }
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.page { display: grid; grid-template-rows: auto auto; justify-items: center; gap: 4px; padding: 10px 6px 8px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface2); }
.page.has { background: var(--surface); box-shadow: var(--shadow); }
.page-art { display: block; width: 100%; max-width: 76px; aspect-ratio: 1; }
.page-art canvas { width: 100%; height: 100%; }
.page-name { font-size: 12px; font-weight: 650; text-align: center; line-height: 1.2; min-height: 2.4em; color: var(--muted); }
.page.has .page-name { color: var(--text); }

/* ------------------------------------------------------------------ a board */
#play { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.hud { display: flex; align-items: center; gap: 10px; padding: 2px 12px 6px; min-width: 0; }
.hud-info { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
.hud-title { font-family: var(--display); font-weight: 800; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-sub { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-stats { display: flex; align-items: center; gap: 6px; flex: none; }
.stat { display: inline-flex; align-items: center; gap: 5px; height: 34px; padding: 0 10px; border-radius: 17px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.stat svg { width: 17px; height: 17px; flex: none; }
.stat.left svg, .stat.score svg { color: var(--accent); }
.stat.score svg { fill: var(--star); color: var(--star); }
.stat.clock svg { color: var(--muted); }
.stat.clock.big { font-size: 17px; }
.stat.clock.low { color: var(--warm); }
.stat.lives { gap: 2px; padding: 0 7px; }
.heart svg { width: 19px; height: 19px; fill: var(--warm); transition: opacity .3s ease, transform .3s ease; }
.heart.gone svg { opacity: .22; fill: var(--muted); }
.heart.pop svg { animation: heart-pop .5s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes heart-pop { 0% { transform: scale(1); } 35% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (max-width: 420px) { .stat.clock:not(.big) { display: none; } .hud { gap: 8px; } .stat { padding: 0 8px; } }
.stage { position: relative; min-height: 0; margin: 0 8px; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; outline: none; border-radius: 18px; }
.stage canvas.over { cursor: pointer; }
html.kbd .stage canvas:focus-visible { box-shadow: inset 0 0 0 3px var(--accent); }
.toast { position: absolute; top: 10px; left: 50%; margin: 0; padding: 7px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); font-weight: 700; font-size: 14px; white-space: nowrap; pointer-events: none; opacity: 0; transform: translate(-50%, -6px); transition: opacity .25s ease, transform .35s cubic-bezier(.3, 1.4, .5, 1); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { color: var(--warm); }
.toast.good { color: var(--accent); }
.target { position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%); margin: 0; padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--muted); font-size: 13px; font-weight: 600; white-space: nowrap; max-width: calc(100% - 16px); overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.dock { display: flex; justify-content: center; gap: 8px; padding: 8px 12px 10px; flex-wrap: nowrap; }
.tool { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; min-width: 46px; padding: 0 15px; border-radius: 23px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap; }
.tool svg { width: 21px; height: 21px; flex: none; }
.tool:disabled { opacity: .45; cursor: default; }
.tool:active:not(:disabled) { transform: scale(.96); }
.badge { position: absolute; top: -4px; right: -4px; display: grid; place-items: center; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 800; box-shadow: 0 0 0 2px var(--bg); }
@media (max-width: 520px) {
  .tool { padding: 0; width: 48px; border-radius: 50%; }
  .tool > span:not(.badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .dock { gap: 14px; }
}
/* a phone held sideways: the HUD and the dock go beside the board */
@media (max-height: 500px) and (orientation: landscape) {
  #play { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto; }
  .hud { flex-direction: column; align-items: stretch; justify-content: center; padding: 6px 0 6px 12px; gap: 8px; }
  .hud .ca-tool { align-self: flex-start; }
  .hud-info { flex: none; }
  .hud-stats { flex-wrap: wrap; }
  .stat.clock:not(.big) { display: inline-flex; }
  .stage { margin: 6px 0; }
  .dock { flex-direction: column; padding: 6px 12px; gap: 10px; justify-content: center; }
  .tool { padding: 0; width: 46px; border-radius: 50%; }
  .tool > span:not(.badge) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* ------------------------------------------------------------------ sheets */
.sheet { border: 0; border-radius: 24px; padding: 0; width: min(calc(94vw / var(--ca-zoom, 1)), 440px); max-height: calc(100dvh / var(--ca-zoom, 1) - 32px); background: var(--surface); color: var(--text); box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .55); overflow: hidden; }
.sheet[open] { display: flex; flex-direction: column; }
.sheet.wide { width: min(calc(94vw / var(--ca-zoom, 1)), 560px); }
.sheet::backdrop { background: rgba(14, 16, 24, 0.46); backdrop-filter: blur(6px); }
html[data-ca-lite] .sheet::backdrop { backdrop-filter: none; background: rgba(14, 16, 24, 0.6); }
.sheet-head { flex: none; padding: 20px 22px 6px; }
.sheet h2 { margin: 0; font-family: var(--display); font-size: 21px; font-weight: 800; }
.sheet h3 { margin: 18px 0 8px; font-size: 15px; }
.sheet-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 6px 22px 8px; }
.sheet-foot { flex: none; padding: 10px 22px 18px; display: flex; justify-content: flex-end; margin: 0; }
.sheet.small { padding: 22px; width: min(calc(92vw / var(--ca-zoom, 1)), 360px); text-align: center; }
.sheet.small h2 { margin-bottom: 6px; }
.stack { display: grid; gap: 10px; margin-top: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.row.col { flex-direction: column; align-items: stretch; gap: 8px; }
.row-t { display: grid; gap: 1px; }
.row small { color: var(--muted); font-size: 12.5px; }
select { font: inherit; min-height: 40px; padding: 0 10px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface2); }
.seg button { display: flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 0 6px; border: 0; border-radius: 10px; background: transparent; font-size: 14px; font-weight: 650; cursor: pointer; line-height: 1.15; text-align: center; }
.seg button[aria-checked="true"] { background: var(--surface); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); color: var(--accent); }
.sw { flex: none; width: 18px; height: 18px; border-radius: 50%; }
.sw-many { background: conic-gradient(#d9534f, #e9a23b, #c29a19, #4f9a3e, #1c8f86, #2f8fd3, #4a5bd0, #8455c2, #c2489a, #d9534f); }
.sw-few { background: conic-gradient(#0072b2 0 25%, #e69f00 0 50%, #009e73 0 75%, #cc79a7 0); }
.sw-one { background: #3b4a86; }
input.switch { -webkit-appearance: none; appearance: none; flex: none; position: relative; width: 50px; height: 30px; margin: 0; border-radius: 15px; background: var(--line); cursor: pointer; transition: background-color .2s ease; }
input.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s cubic-bezier(.3, 1.3, .5, 1); }
input.switch:checked { background: var(--accent); }
input.switch:checked::after { transform: translateX(20px); }
.prose p { margin: 0 0 10px; line-height: 1.5; }
.prose h3:first-child { margin-top: 4px; }
.version { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 4px 0 0; }
.stats div { display: flex; flex-direction: column; justify-content: space-between; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface2); }
.stats dt { color: var(--muted); font-size: 12.5px; line-height: 1.25; }
.stats dd { margin: 2px 0 0; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.board-host { min-height: 120px; }
#board-note { margin: 0 0 8px; }

/* the end of a board */
.sheet.end { padding: 22px 22px 18px; text-align: center; width: min(calc(92vw / var(--ca-zoom, 1)), 380px); overflow: auto; }
.end-art { display: grid; place-items: center; }
.end-art canvas { width: 116px; height: 116px; animation: end-pop .6s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes end-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.sheet.end .kicker { margin-top: 8px; }
.sheet.end h2 { margin: 2px 0 0; font-size: 23px; }
.end-stars { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.end-stars svg { width: 34px; height: 34px; fill: var(--line); }
.end-stars svg.on { fill: var(--star); animation: star-in .5s cubic-bezier(.3, 1.7, .5, 1) var(--d, 0s) both; }
@keyframes star-in { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.end-line { margin: 8px 0 0; color: var(--muted); }
.end-vs { margin: 8px 0 0; font-weight: 700; }
.end-actions { display: grid; gap: 9px; margin-top: 18px; }

/* calm: the sizes */
.sizes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.size { display: grid; justify-items: center; gap: 2px; padding: 14px 8px 12px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface2); cursor: pointer; }
.size.on { border-color: var(--accent); background: var(--accent-soft); }
.size-box { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 6px; }
.sz { display: block; width: 56px; height: 56px; border-radius: 10px; background-image: radial-gradient(circle, var(--accent) 1.6px, transparent 2px); }
.sz0 { background-size: 14px 14px; } .sz1 { background-size: 10px 10px; } .sz2 { background-size: 7.5px 7.5px; } .sz3 { background-size: 6px 6px; }
.size-t { font-weight: 750; }
.size-s { color: var(--muted); font-size: 12.5px; }

/* challenges */
.ch-desc { margin: 4px 0 14px; line-height: 1.45; }
.friend-list { display: grid; gap: 6px; }
.friend-row { display: flex; align-items: center; gap: 10px; min-height: 48px; }
.fig { display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.friend-row .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* cloud-apps bar 1.30.0 */
:root { --ca-brand-icon-w: 89px; } /* the brand's width with the icon alone (the mark, the divider, the app's icon) */
.ca-start { display: flex; align-items: center; flex: 0 100 auto; min-width: min(var(--ca-brand-icon-w), 100%); }
.ca-brand { display: flex; align-items: center; min-width: 0; height: 40px; color: inherit; font-family: inherit; }
.ca-brand a { display: flex !important; align-items: center !important; box-sizing: border-box !important; color: inherit !important; text-decoration: none !important; border-radius: 12px !important; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease; }
.ca-brand-home { flex: none !important; justify-content: center !important; width: 40px !important; height: 40px !important; padding: 0 !important; margin: 0 0 0 -5px !important; }
.ca-brand-home img { display: block !important; width: 30px !important; height: 30px !important; margin: 0 !important; transition: transform .38s cubic-bezier(.34, 1.56, .64, 1); }
.ca-brand-sep { flex: none; display: block; width: 1.5px; height: 18px; margin: 0 4px; border-radius: 1px; background: currentColor; opacity: .22; transform: rotate(18deg); }
.ca-brand-app { flex: 0 1 auto !important; min-width: 44px !important; height: 40px !important; padding: 0 9px 0 5px !important; margin: 0 !important; }
.ca-brand-in { display: flex; flex-wrap: wrap; align-items: center; align-content: flex-start; column-gap: 9px; min-width: 0; height: 40px; overflow: hidden; }
.ca-brand-in img { flex: none; display: block !important; width: 30px !important; height: 30px !important; margin: 5px 0 !important; border-radius: 8px; }
.ca-brand[data-ca-icon] .ca-brand-name { display: none !important; }
.ca-brand[data-ca-icon] .ca-brand-app { padding-right: 5px !important; }
.ca-brand-name { display: block; height: 40px; margin: 0 !important; padding: 0 !important; line-height: 40px !important; white-space: nowrap; font-family: var(--ca-brand-font, inherit); font-size: 17px !important; font-weight: 700; letter-spacing: -.015em; color: inherit; text-shadow: var(--ca-brand-shadow, none); }
@media (hover: hover) { .ca-brand a:hover { background-color: color-mix(in srgb, currentColor 7%, transparent); } .ca-brand-home:hover img { transform: rotate(-6deg) scale(1.06); } }
.ca-brand a:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: -3px; }
.ca-end { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex: none; min-width: 0; }
.ca-tools { display: flex; align-items: center; gap: 6px; }
.ca-tools[hidden] { display: none !important; }
.ca-tool { position: relative; flex: none; display: inline-grid; place-items: center !important; box-sizing: border-box !important; width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important; max-width: none !important; padding: 0 !important; margin: 0; border-radius: 50% !important;
  border: 1px solid var(--ca-tool-line, color-mix(in srgb, currentColor 16%, transparent)) !important; background: var(--ca-tool-bg, color-mix(in srgb, currentColor 6%, transparent)) !important; color: var(--ca-tool-ink, inherit) !important;
  font: inherit; line-height: 0 !important; letter-spacing: 0; text-decoration: none !important; box-shadow: none; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: background-color .15s ease, transform .12s ease; }
.ca-tool[hidden] { display: none !important; }
.ca-tool::before { content: ""; position: absolute; inset: -4px; }
.ca-tool svg { display: block; width: 20px !important; height: 20px !important; margin: 0 !important; pointer-events: none; }
.ca-tool svg[hidden] { display: none !important; }
@media (hover: hover) { .ca-tool:hover { background: var(--ca-tool-hover, color-mix(in srgb, currentColor 13%, transparent)) !important; } }
.ca-tool:active { transform: scale(.94); }
.ca-tool:focus-visible { outline: 3px solid var(--ca-accent, #4f6bff); outline-offset: 2px; }
.ca-tool-talk { color: var(--ca-accent, #4f6bff) !important; border-color: color-mix(in srgb, var(--ca-accent, #4f6bff) 50%, transparent) !important; background: color-mix(in srgb, var(--ca-accent, #4f6bff) 13%, transparent) !important; }
.ca-tool .ca-tlive { position: absolute; top: 1px; right: 1px; width: 9px; height: 9px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 30%, transparent); }
.ca-tool-talk.ca-new::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; pointer-events: none; animation: ca-bar-ring 1.2s ease-out 2; }
@keyframes ca-bar-ring { from { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ca-accent, #4f6bff) 55%, transparent); } to { box-shadow: 0 0 0 11px transparent; } }
.ca-tool .ca-tcount, .ca-tool .ca-tunread { position: absolute; right: -5px; display: grid; place-items: center; box-sizing: border-box; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; color: #fff; font: 700 10.5px/1 -apple-system, BlinkMacSystemFont, Inter, "Segoe UI", Roboto, sans-serif; font-variant-numeric: tabular-nums; letter-spacing: 0; pointer-events: none; }
.ca-tool .ca-tcount { bottom: -5px; background: #1f9d55; }
.ca-tool .ca-tunread { top: -5px; background: #e5484d; }
@media (max-width: 599.98px), (max-height: 499.98px) { .ca-tools-app { display: none !important; } }
.ca-end[data-ca-cramped] .ca-tools-app { display: none !important; }
.ca-end[data-ca-tight] .ca-tool-friends { display: none !important; }
@media (prefers-reduced-motion: reduce) { .ca-tool, .ca-brand a, .ca-brand-home img { transition: none; } .ca-tool-talk.ca-new::after { animation: none; } }
/* end of the cloud-apps bar */
/* ---- cloud-apps: big screens (App Standard §6.5) — written by `cloud-apps vendor-sdk`; do not edit ---- */
/* Past 1584 × 990 the page is laid out at about 1440 × 900 and zoomed to fill the screen; viewport
   units in this file are divided by --ca-zoom. cloud-kit.js turns it off where the engine has no
   standard zoom (html[data-ca-zoom="off"]). */
@media (min-width: 1585px) and (min-height: 991px) { :root { --ca-zoom: 1.1; } }
@media (min-width: 1656px) and (min-height: 1035px) { :root { --ca-zoom: 1.15; } }
@media (min-width: 1728px) and (min-height: 1080px) { :root { --ca-zoom: 1.2; } }
@media (min-width: 1800px) and (min-height: 1125px) { :root { --ca-zoom: 1.25; } }
@media (min-width: 1872px) and (min-height: 1170px) { :root { --ca-zoom: 1.3; } }
@media (min-width: 1945px) and (min-height: 1215px) { :root { --ca-zoom: 1.35; } }
@media (min-width: 2016px) and (min-height: 1260px) { :root { --ca-zoom: 1.4; } }
@media (min-width: 2088px) and (min-height: 1305px) { :root { --ca-zoom: 1.45; } }
@media (min-width: 2160px) and (min-height: 1350px) { :root { --ca-zoom: 1.5; } }
@media (min-width: 2232px) and (min-height: 1395px) { :root { --ca-zoom: 1.55; } }
@media (min-width: 2304px) and (min-height: 1440px) { :root { --ca-zoom: 1.6; } }
@media (min-width: 2376px) and (min-height: 1485px) { :root { --ca-zoom: 1.65; } }
@media (min-width: 2448px) and (min-height: 1530px) { :root { --ca-zoom: 1.7; } }
@media (min-width: 2520px) and (min-height: 1575px) { :root { --ca-zoom: 1.75; } }
@media (min-width: 2592px) and (min-height: 1620px) { :root { --ca-zoom: 1.8; } }
@media (min-width: 2664px) and (min-height: 1665px) { :root { --ca-zoom: 1.85; } }
@media (min-width: 2736px) and (min-height: 1710px) { :root { --ca-zoom: 1.9; } }
@media (min-width: 2808px) and (min-height: 1755px) { :root { --ca-zoom: 1.95; } }
@media (min-width: 2880px) and (min-height: 1800px) { :root { --ca-zoom: 2; } }
@media (min-width: 2952px) and (min-height: 1845px) { :root { --ca-zoom: 2.05; } }
@media (min-width: 3024px) and (min-height: 1890px) { :root { --ca-zoom: 2.1; } }
@media (min-width: 3096px) and (min-height: 1935px) { :root { --ca-zoom: 2.15; } }
@media (min-width: 3169px) and (min-height: 1981px) { :root { --ca-zoom: 2.2; } }
@media (min-width: 3240px) and (min-height: 2025px) { :root { --ca-zoom: 2.25; } }
@media (min-width: 3312px) and (min-height: 2070px) { :root { --ca-zoom: 2.3; } }
@media (min-width: 3384px) and (min-height: 2115px) { :root { --ca-zoom: 2.35; } }
@media (min-width: 3456px) and (min-height: 2160px) { :root { --ca-zoom: 2.4; } }
@media (min-width: 3529px) and (min-height: 2205px) { :root { --ca-zoom: 2.45; } }
@media (min-width: 3600px) and (min-height: 2250px) { :root { --ca-zoom: 2.5; } }
@media (min-width: 3672px) and (min-height: 2295px) { :root { --ca-zoom: 2.55; } }
@media (min-width: 3744px) and (min-height: 2340px) { :root { --ca-zoom: 2.6; } }
@media (min-width: 3816px) and (min-height: 2385px) { :root { --ca-zoom: 2.65; } }
@media (min-width: 3889px) and (min-height: 2430px) { :root { --ca-zoom: 2.7; } }
@media (min-width: 3960px) and (min-height: 2475px) { :root { --ca-zoom: 2.75; } }
@media (min-width: 4032px) and (min-height: 2520px) { :root { --ca-zoom: 2.8; } }
@media (min-width: 4104px) and (min-height: 2565px) { :root { --ca-zoom: 2.85; } }
@media (min-width: 4176px) and (min-height: 2610px) { :root { --ca-zoom: 2.9; } }
@media (min-width: 4248px) and (min-height: 2655px) { :root { --ca-zoom: 2.95; } }
@media (min-width: 4320px) and (min-height: 2700px) { :root { --ca-zoom: 3; } }
@media (min-width: 4392px) and (min-height: 2745px) { :root { --ca-zoom: 3.05; } }
@media (min-width: 4464px) and (min-height: 2790px) { :root { --ca-zoom: 3.1; } }
@media (min-width: 4536px) and (min-height: 2835px) { :root { --ca-zoom: 3.15; } }
@media (min-width: 4608px) and (min-height: 2880px) { :root { --ca-zoom: 3.2; } }
@media (min-width: 4680px) and (min-height: 2925px) { :root { --ca-zoom: 3.25; } }
@media (min-width: 4752px) and (min-height: 2970px) { :root { --ca-zoom: 3.3; } }
@media (min-width: 4824px) and (min-height: 3015px) { :root { --ca-zoom: 3.35; } }
@media (min-width: 4896px) and (min-height: 3060px) { :root { --ca-zoom: 3.4; } }
@media (min-width: 4968px) and (min-height: 3105px) { :root { --ca-zoom: 3.45; } }
@media (min-width: 5040px) and (min-height: 3150px) { :root { --ca-zoom: 3.5; } }
@media (min-width: 5112px) and (min-height: 3195px) { :root { --ca-zoom: 3.55; } }
@media (min-width: 5184px) and (min-height: 3240px) { :root { --ca-zoom: 3.6; } }
@media (min-width: 5256px) and (min-height: 3285px) { :root { --ca-zoom: 3.65; } }
@media (min-width: 5328px) and (min-height: 3330px) { :root { --ca-zoom: 3.7; } }
@media (min-width: 5400px) and (min-height: 3375px) { :root { --ca-zoom: 3.75; } }
@media (min-width: 5472px) and (min-height: 3420px) { :root { --ca-zoom: 3.8; } }
@media (min-width: 5544px) and (min-height: 3465px) { :root { --ca-zoom: 3.85; } }
@media (min-width: 5616px) and (min-height: 3510px) { :root { --ca-zoom: 3.9; } }
@media (min-width: 5688px) and (min-height: 3555px) { :root { --ca-zoom: 3.95; } }
@media (min-width: 5760px) and (min-height: 3600px) { :root { --ca-zoom: 4; } }
@media (min-width: 5832px) and (min-height: 3645px) { :root { --ca-zoom: 4.05; } }
@media (min-width: 5904px) and (min-height: 3690px) { :root { --ca-zoom: 4.1; } }
@media (min-width: 5977px) and (min-height: 3736px) { :root { --ca-zoom: 4.15; } }
@media (min-width: 6048px) and (min-height: 3780px) { :root { --ca-zoom: 4.2; } }
@media (min-width: 6120px) and (min-height: 3825px) { :root { --ca-zoom: 4.25; } }
@media (min-width: 6192px) and (min-height: 3870px) { :root { --ca-zoom: 4.3; } }
@media (min-width: 6264px) and (min-height: 3915px) { :root { --ca-zoom: 4.35; } }
@media (min-width: 6337px) and (min-height: 3961px) { :root { --ca-zoom: 4.4; } }
@media (min-width: 6408px) and (min-height: 4005px) { :root { --ca-zoom: 4.45; } }
@media (min-width: 6480px) and (min-height: 4050px) { :root { --ca-zoom: 4.5; } }
@media (min-width: 6552px) and (min-height: 4095px) { :root { --ca-zoom: 4.55; } }
@media (min-width: 6624px) and (min-height: 4140px) { :root { --ca-zoom: 4.6; } }
@media (min-width: 6697px) and (min-height: 4185px) { :root { --ca-zoom: 4.65; } }
@media (min-width: 6768px) and (min-height: 4230px) { :root { --ca-zoom: 4.7; } }
@media (min-width: 6840px) and (min-height: 4275px) { :root { --ca-zoom: 4.75; } }
@media (min-width: 6912px) and (min-height: 4320px) { :root { --ca-zoom: 4.8; } }
@media (min-width: 6984px) and (min-height: 4365px) { :root { --ca-zoom: 4.85; } }
@media (min-width: 7057px) and (min-height: 4410px) { :root { --ca-zoom: 4.9; } }
@media (min-width: 7128px) and (min-height: 4455px) { :root { --ca-zoom: 4.95; } }
@media (min-width: 7200px) and (min-height: 4500px) { :root { --ca-zoom: 5; } }
@media (min-width: 1585px) and (min-height: 991px) {
  html { zoom: var(--ca-zoom, 1); }
  html[data-ca-zoom='off'] { --ca-zoom: 1 !important; }
}
/* ---- end of big screens ---- */
