@font-face { font-family: 'Fraunces'; font-style: normal; font-weight: 100 900; font-display: swap; src: url(/fonts/fraunces-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'Fraunces'; font-style: italic; font-weight: 100 900; font-display: swap; src: url(/fonts/fraunces-latin-wght-italic.woff2) format('woff2'); }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 600; font-display: swap; src: url(/fonts/caveat-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 700; font-display: swap; src: url(/fonts/caveat-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/bricolage-grotesque-latin-wght-normal.woff2) format('woff2'); }
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/instrument-sans-latin-wght-normal.woff2) format('woff2'); }

:root {
  --ink: #25211d; --ink-2: #4a423a; --muted: #7b7166; --line: rgba(37, 33, 29, .12); --line-2: rgba(37, 33, 29, .22);
  --paper: #f6f2ea; --card: #fffdf9; --rose: #b84a62; --gold: #f2b84b; --ok: #2f8a57; --err: #c0392b; --blue: #2f6fec;
  --shadow: 0 1px 2px rgba(40, 30, 20, .06), 0 8px 24px rgba(40, 30, 20, .10); --shadow-lg: 0 24px 60px rgba(40, 30, 20, .2);
  --ui: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; --display: 'Fraunces', Georgia, serif; --hand: 'Caveat', 'Segoe Print', cursive; --grot: 'Bricolage Grotesque', system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font-family: var(--ui); color: var(--ink); background: var(--paper); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body.on-board { overflow: hidden; overscroll-behavior: none; }
button { font-family: inherit; color: inherit; }
p { margin: 0; }
a { color: var(--blue); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- buttons, inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: 600 14px var(--ui); padding: 9px 16px; border-radius: 11px; border: 1.5px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .1s, background .15s; }
.btn:hover { background: #faf6ef; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: #3a332c; }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(37, 33, 29, .06); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding: 13px 22px; font-size: 16px; border-radius: 14px; }
.ibtn { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 0; background: none; border-radius: 9px; color: var(--ink-2); cursor: pointer; flex: none; padding: 0; }
.ibtn:hover { background: rgba(37, 33, 29, .07); }
.ibtn.danger:hover { color: var(--err); background: rgba(192, 57, 43, .08); }
.ic { display: block; }
.link { border: 0; background: none; color: var(--blue); font: 600 13px var(--ui); cursor: pointer; padding: 0; }
.link.muted { color: var(--muted); }
.inp { font: 400 15px/1.45 var(--ui); padding: 9px 12px; border: 1.5px solid var(--line-2); border-radius: 10px; background: #fff; color: var(--ink); width: 100%; }
.inp:focus { outline: none; border-color: var(--ink); }
.inp.sm { padding: 6px 10px; font-size: 13.5px; }
textarea.inp { resize: none; overflow: hidden; min-height: 64px; }
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld > span { font: 600 13.5px/1.35 var(--ui); color: var(--ink); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 8px; }
.row .inp { flex: 1; min-width: 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; line-height: 1.45; }
.err { color: var(--err); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--ink-2); cursor: pointer; }
.callout { background: #faf4e8; border-radius: 12px; padding: 12px 14px; border-left: 3px solid var(--gold); }
.callout strong { font: 600 13.5px var(--ui); }
.callout p { margin-top: 6px; font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; padding: 0; flex: none; }
.sw.on { box-shadow: 0 0 0 2px var(--ink); }
.swatches .sw { width: 30px; height: 30px; }
kbd { font: 600 12px var(--ui); background: #f1ebe1; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; }
.keys { border-collapse: collapse; }
.keys td { padding: 5px 14px 5px 0; font-size: 13.5px; vertical-align: top; }

/* ---------- modal, toast, popover ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(30, 25, 20, .4); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; animation: fade .15s; }
.modal { background: var(--card); border-radius: 20px; box-shadow: var(--shadow-lg); width: min(480px, 100%); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; animation: rise .2s; }
.modal.wide { width: min(880px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 6px; gap: 12px; }
.modal-head h2 { font: 600 21px/1.2 var(--display); margin: 0; }
.modal-body { padding: 8px 20px 18px; overflow-y: auto; font-size: 14.5px; line-height: 1.5; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; border-top: 1px solid var(--line); }
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font: 500 14px var(--ui); box-shadow: var(--shadow-lg); animation: rise .2s; max-width: 90vw; text-align: center; transition: opacity .3s; }
.toast.err { background: var(--err); }
.toast.win { background: var(--gold); color: #3d2b00; font-weight: 600; }
.toast.busy::before { content: ''; display: inline-block; width: 11px; height: 11px; border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff; border-radius: 50%; margin-right: 8px; vertical-align: -1px; animation: spin .8s linear infinite; }
.toast.out { opacity: 0; }
.pop { position: fixed; z-index: 90; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 8px; animation: rise .15s; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 36px); gap: 2px; max-height: 250px; overflow-y: auto; }
.emoji-b { font-size: 22px; height: 36px; border: 0; background: none; border-radius: 8px; cursor: pointer; padding: 0; }
.emoji-b:hover { background: rgba(37, 33, 29, .07); }
.emoji-pop .inp { margin-top: 8px; }
.menu { display: flex; flex-direction: column; min-width: 250px; }
.menu-h { font: 700 11px var(--ui); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 6px 8px; }
.bg-row { display: flex; gap: 6px; padding: 0 8px 8px; }
.bg-sw { flex: 1; height: 40px; border-radius: 10px; border: 1.5px solid var(--line-2); font: 600 11px var(--ui); cursor: pointer; color: #6b5e52; }
.bg-sw[title=Night] { color: #ddd; }
.bg-sw.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.menu-i { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; background: none; font: 500 14px var(--ui); color: var(--ink); border-radius: 9px; cursor: pointer; text-align: left; }
.menu-i:hover { background: rgba(37, 33, 29, .06); }
.menu-i.danger { color: var(--err); }
.menu-i.check input { margin: 0 4px 0 2px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 6px 0; width: 100%; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- board shell ---------- */
.board-app { position: fixed; inset: 0; display: grid; grid-template-rows: 56px 1fr; }
.topbar { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; background: rgba(255, 253, 249, .95); border-bottom: 1px solid var(--line); z-index: 20; min-width: 0; }
.brand { display: grid; place-items: center; flex: none; }
.title-input { font: 650 17px var(--grot); border: 1.5px solid transparent; background: transparent; padding: 6px 8px; border-radius: 9px; width: min(360px, 32vw); min-width: 90px; color: var(--ink); text-overflow: ellipsis; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { border-color: var(--ink); background: #fff; outline: none; }
.conn { display: inline-flex; align-items: center; gap: 6px; font: 500 12.5px var(--ui); color: var(--muted); white-space: nowrap; min-width: 0; overflow: hidden; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: #d4a017; flex: none; }
.conn.live i { background: #2fa36b; box-shadow: 0 0 0 3px rgba(47, 163, 107, .18); }
.conn.offline i, .conn.gone i { background: var(--err); }
.conn.offline { color: var(--err); }
.spacer { flex: 1; }
.peers { display: flex; padding: 0 6px 0 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 2px solid #fff; color: #fff; font: 700 13px var(--ui); margin-left: -7px; cursor: pointer; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); padding: 0; flex: none; }
.avatar.me { box-shadow: 0 0 0 2px var(--ink); }
.avatar.more { background: #e6dfd4; color: var(--ink); display: grid; place-items: center; font-size: 11px; }
.btn.invite { padding: 7px 12px; margin-right: 4px; }
.main { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 370px; min-height: 0; }
.no-panel .main { grid-template-columns: minmax(0, 1fr); }
.no-panel .panel { display: none; }

/* ---------- canvas ---------- */
.stage { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; background-color: var(--bg); background-image: radial-gradient(var(--dot) 1.2px, transparent 1.4px); outline: none; }
.stage[data-bg=paper] { --bg: #f6f2ea; --dot: rgba(60, 45, 30, .14); }
.stage[data-bg=blush] { --bg: #fbefec; --dot: rgba(120, 50, 60, .13); }
.stage[data-bg=sage] { --bg: #edf1e8; --dot: rgba(40, 70, 40, .13); }
.stage[data-bg=night] { --bg: #1f1e2c; --dot: rgba(255, 255, 255, .10); }
.stage.space, .stage.space .it { cursor: grab; }
.stage.panning, .stage.panning .it { cursor: grabbing; }
.stage.glide { transition: background-position .6s cubic-bezier(.2, .7, .2, 1), background-size .6s cubic-bezier(.2, .7, .2, 1); }
.world { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; --z: 1; }
.world.glide { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.layer { position: absolute; left: 0; top: 0; }
.layer.secs { z-index: 0; } .layer.items { z-index: 1; } .layer.rsel { z-index: 2; pointer-events: none; }

.it { position: absolute; left: 0; top: 0; transform-origin: center center; }
.it.sel { outline: calc(2px / var(--z)) solid var(--blue); outline-offset: calc(4px / var(--z)); }
.it.editing { outline-style: dashed; }
.it.editing .txt { cursor: text; user-select: text; -webkit-user-select: text; outline: none; }
.it .txt { white-space: pre-wrap; overflow-wrap: anywhere; }
.it .txt:empty::before { content: attr(data-ph); opacity: .42; }
.it.dragging.t-note, .it.dragging.t-card, .it.dragging .ph { box-shadow: 0 18px 40px rgba(40, 30, 20, .25); }
.it.pop-in { animation: popin .6s ease-out; }
@keyframes popin { 0% { opacity: 0; outline: calc(8px / var(--z)) solid rgba(242, 184, 75, .8); } 100% { opacity: 1; } }
.hdl { position: absolute; width: calc(15px / var(--z)); height: calc(15px / var(--z)); background: #fff; border: calc(2px / var(--z)) solid var(--blue); border-radius: 50%; z-index: 5; touch-action: none; }
.hdl.rs { right: calc(-11px / var(--z)); bottom: calc(-11px / var(--z)); cursor: nwse-resize; }
.hdl.rot { left: 50%; top: calc(-38px / var(--z)); margin-left: calc(-7.5px / var(--z)); cursor: grab; }
.hdl.rot::after { content: ''; position: absolute; left: 50%; top: 100%; width: calc(1.5px / var(--z)); height: calc(18px / var(--z)); background: var(--blue); transform: translateX(-50%); }

.t-note { background: var(--bg); box-shadow: 0 2px 4px rgba(40, 30, 20, .08), 0 10px 22px rgba(40, 30, 20, .12); container-type: size; }
.t-note .txt { position: absolute; left: 8cqw; right: 8cqw; top: 8cqh; bottom: 6cqh; font: 700 11cqmin/1.15 var(--hand); color: #3a3128; overflow: hidden; }
.t-note .tag { position: absolute; left: 8cqw; top: 4cqh; font: 700 5.2cqmin var(--ui); letter-spacing: .08em; text-transform: uppercase; color: rgba(58, 49, 40, .5); }
.t-note.is-tpl .txt { top: 14cqh; color: #4a4035; }
.t-text { line-height: 1.18; padding-top: .08em; }
.t-text.is-tpl .txt { opacity: .6; }
.stage[data-bg=night] .t-text .txt:empty::before { color: #fff; }
.t-image { container-type: size; }
.t-image .ph { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; background: #e9e4dc; box-shadow: 0 3px 6px rgba(40, 30, 20, .1), 0 12px 26px rgba(40, 30, 20, .14); }
.t-image img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; user-select: none; -webkit-user-drag: none; }
.t-image.f-polaroid { background: #fff; box-shadow: 0 3px 6px rgba(40, 30, 20, .1), 0 14px 30px rgba(40, 30, 20, .16); }
.t-image.f-polaroid .ph { inset: auto; left: 5cqw; top: 5cqw; width: 90cqw; bottom: 20cqw; border-radius: 0; box-shadow: none; }
.t-image .cap { position: absolute; left: 5cqw; right: 5cqw; bottom: 0; height: 20cqw; display: flex; align-items: center; justify-content: center; font: 700 7.5cqw/1 var(--hand); color: #3a3128; white-space: nowrap; overflow: hidden; }
.t-image.f-round .ph { border-radius: 50%; border: 6px solid #fff; }
.t-image .tape { position: absolute; top: 2px; width: 26cqw; height: 22px; background: rgba(246, 222, 160, .82); z-index: 2; }
.t-image .tape.a { left: -7cqw; transform: rotate(-28deg); }
.t-image .tape.b { right: -7cqw; transform: rotate(28deg); }
.t-card { container-type: size; border-radius: 20px; background: linear-gradient(135deg, var(--g1), var(--g2)); box-shadow: 0 3px 6px rgba(40, 30, 20, .08), 0 14px 30px rgba(40, 30, 20, .14); }
.t-card .emo { position: absolute; left: 50%; top: 38%; transform: translate(-50%, -50%); font-size: 32cqmin; line-height: 1; }
.t-card .txt { position: absolute; left: 8cqw; right: 8cqw; top: 62cqh; max-height: 34cqh; overflow: hidden; font: 560 8.5cqmin/1.2 var(--display); color: #2b2420; text-align: center; }
.t-card.dark .txt { color: #fff; }
.t-card.slot { background: rgba(255, 255, 255, .55); border: 2px dashed #b9a99a; box-shadow: none; }
.t-card.slot .emo { font-size: 17cqmin; top: 27%; opacity: .75; }
.t-card.slot .txt { top: 46cqh; font: 600 7.6cqmin/1.25 var(--ui); color: #6b5e52; }
.t-card.slot .slot-hint { position: absolute; bottom: 7cqh; left: 6cqw; right: 6cqw; text-align: center; font: 700 4.6cqmin var(--ui); color: #a08f80; text-transform: uppercase; letter-spacing: .06em; }
.t-card.slot.drop-target { border-color: var(--blue); background: rgba(47, 111, 236, .1); }
.stage[data-bg=night] .t-card.slot { background: rgba(255, 255, 255, .1); }
.stage[data-bg=night] .t-card.slot .txt { color: #ddd; }
.t-sticker { container-type: size; }
.t-sticker .emo { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 80cqmin; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .15)); }
.t-section { background: var(--bg); border: 2px solid color-mix(in srgb, var(--fg) 35%, transparent); border-radius: 22px; }
.t-section .sec-title { position: absolute; left: 26px; top: 20px; right: 56px; font: 700 30px/1.2 var(--grot); color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.t-section.editing .sec-title { white-space: normal; text-overflow: clip; }
.lock-badge { position: absolute; right: 18px; top: 18px; font-size: 22px; opacity: .55; }
.won { position: absolute; right: 6px; top: -12px; height: 28px; padding: 0 11px; border-radius: 14px; background: var(--gold); color: #3d2b00; font: 700 18px/28px var(--grot); white-space: nowrap; box-shadow: 0 3px 8px rgba(0, 0, 0, .15); z-index: 3; }
.it.done:not(.t-section):not(.t-text):not(.t-sticker) { box-shadow: 0 0 0 4px var(--gold), 0 14px 30px rgba(40, 30, 20, .14); }
.area-dot { position: absolute; left: -12px; top: -12px; width: 32px; height: 32px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); display: grid; place-items: center; font-size: 17px; z-index: 3; }

.rsel-box { position: absolute; left: 0; top: 0; transform-origin: center; border: calc(2px / var(--z)) solid; border-radius: calc(4px / var(--z)); }
.rsel-name { position: absolute; left: calc(-2px / var(--z)); top: calc(-22px / var(--z)); font: 600 calc(12px / var(--z))/1.6 var(--ui); color: #fff; padding: 0 calc(6px / var(--z)); border-radius: calc(4px / var(--z)); white-space: nowrap; }
.cursors { position: absolute; inset: 0; pointer-events: none; z-index: 8; overflow: hidden; }
.cursor { position: absolute; left: 0; top: 0; transition: transform 90ms linear; will-change: transform; }
.cursor svg { display: block; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); }
.cursor-name { position: absolute; left: 15px; top: 19px; color: #fff; font: 600 12px/1 var(--ui); padding: 4px 7px; border-radius: 3px 7px 7px 7px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .18); }
.marquee { position: absolute; border: 1px solid var(--blue); background: rgba(47, 111, 236, .08); pointer-events: none; z-index: 9; }
.drop-hint { position: absolute; inset: 12px; border: 3px dashed var(--blue); border-radius: 20px; background: rgba(47, 111, 236, .06); display: grid; place-items: center; font: 600 18px var(--ui); color: var(--blue); pointer-events: none; z-index: 20; }

/* toolbar, context bar, zoom */
.toolbar { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 1px; padding: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); z-index: 10; }
.tool { width: 58px; padding: 7px 0 5px; display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 10px; color: var(--ink-2); background: none; border: 0; cursor: pointer; flex: none; }
.tool:hover:not(:disabled) { background: rgba(37, 33, 29, .07); color: var(--ink); }
.tool:disabled { opacity: .3; cursor: default; }
.tool-lbl { font: 600 10.5px/1.1 var(--ui); white-space: nowrap; }
.tool-sep { height: 1px; background: var(--line); margin: 4px 6px; flex: none; }
.ctxbar { position: absolute; left: 0; top: 0; z-index: 12; display: flex; align-items: center; gap: 6px; padding: 6px 8px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); max-width: calc(100% - 16px); flex-wrap: wrap; }
.ctxbar[hidden] { display: none; }
.sw-row { display: flex; gap: 4px; flex-wrap: wrap; max-width: 280px; }
.seg { display: flex; background: rgba(37, 33, 29, .06); border-radius: 9px; padding: 2px; }
.seg-b { border: 0; background: none; padding: 5px 9px; border-radius: 7px; font: 600 13px var(--ui); cursor: pointer; color: var(--ink); white-space: nowrap; }
.seg-b.on { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.cbtn { border: 1px solid var(--line); background: #fff; border-radius: 9px; padding: 5px 9px; font: 600 13px var(--ui); display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--ink); white-space: nowrap; min-height: 32px; }
.cbtn.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cbtn.strong { background: var(--ink); color: #fff; border-color: var(--ink); }
.won-btn.on { background: var(--gold); color: #3d2b00; border-color: transparent; }
.emo-btn { font-size: 18px; padding: 2px 8px; }
.area-wrap { display: inline-flex; align-items: center; gap: 2px; padding-left: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--muted); background: #fff; }
.area-sel { border: 0; background: none; font: 600 13px var(--ui); padding: 6px 4px; color: var(--ink); max-width: 150px; cursor: pointer; }
.ctx-sep { width: 1px; height: 22px; background: var(--line); }
.zoombar { position: absolute; left: 14px; bottom: 14px; display: flex; align-items: center; gap: 1px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); z-index: 10; }
.zoom-pct { min-width: 52px; border: 0; background: none; font: 600 12.5px var(--ui); cursor: pointer; color: var(--ink-2); padding: 6px 2px; border-radius: 8px; }
.zoom-pct:hover { background: rgba(37, 33, 29, .07); }
.confetti { position: fixed; z-index: 300; pointer-events: none; }
.confetti i { position: absolute; width: 8px; height: 12px; border-radius: 2px; animation: conf 1.2s cubic-bezier(.2, .6, .3, 1) forwards; }
@keyframes conf { to { transform: translate(var(--dx), calc(var(--dy) + 170px)) rotate(var(--rot)); opacity: 0; } }

/* ---------- side panel ---------- */
.panel { background: var(--card); border-left: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; z-index: 15; }
.panel-head { display: flex; align-items: center; border-bottom: 1px solid var(--line); padding: 4px 6px 0; }
.tabs { display: flex; flex: 1; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px 9px; border: 0; background: none; font: 600 12px var(--ui); color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; position: relative; }
.tab:hover { color: var(--ink); }
.tab[aria-selected=true] { color: var(--ink); border-bottom-color: var(--ink); }
.tab-badge { position: absolute; top: 3px; right: calc(50% - 30px); font: 700 10px/16px var(--ui); background: var(--gold); color: #3d2b00; border-radius: 8px; padding: 0 5px; }
.tab-badge:empty { display: none; }
.panel-close { display: none; }
.panel-body { overflow-y: auto; padding: 18px 18px 48px; flex: 1; font-size: 14px; line-height: 1.5; overscroll-behavior: contain; }
.panel h3 { font: 600 19px/1.2 var(--display); margin: 0 0 4px; }
.g-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.g-ring { width: 58px; height: 58px; border-radius: 50%; background: conic-gradient(var(--ok) calc(var(--p) * 360deg), rgba(37, 33, 29, .08) 0); display: grid; place-items: center; flex: none; }
.g-ring span { width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: grid; place-items: center; font: 700 14px var(--grot); }
.about { background: #faf4e8; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; }
.about summary { font: 600 13.5px var(--ui); cursor: pointer; }
.about p { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; }
.steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.step { border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.step.open { box-shadow: var(--shadow); }
.step-h { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 0; background: none; text-align: left; cursor: pointer; font: 600 14.5px/1.3 var(--ui); color: var(--ink); }
.step-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: rgba(37, 33, 29, .07); font: 700 13px var(--grot); flex: none; }
.step.done .step-n { background: var(--ok); color: #fff; }
.step-t { flex: 1; display: flex; flex-direction: column; }
.step-t small { font: 500 12px var(--ui); color: var(--muted); margin-top: 2px; }
.chev { transition: transform .2s; color: var(--muted); font-size: 20px; line-height: 1; }
.step.open .chev { transform: rotate(90deg); }
.step-b { padding: 0 16px 16px 54px; font-size: 14px; line-height: 1.55; color: var(--ink-2); }
.tips { padding-left: 18px; margin: 8px 0 12px; }
.tips li { margin: 3px 0; font-size: 13.5px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.manual { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); margin-top: 10px; cursor: pointer; }
.choices, .exp-formats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exp-formats { grid-template-columns: repeat(4, 1fr); }
.choice { text-align: left; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #fff; cursor: pointer; display: flex; flex-direction: column; gap: 3px; }
.choice strong { font: 600 13.5px var(--ui); }
.choice span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.choice.on { border-color: var(--ink); background: #fbf8f2; box-shadow: inset 0 0 0 1px var(--ink); }
.coach { list-style: none; padding: 0; margin: 6px 0; }
.coach li { display: flex; gap: 8px; align-items: baseline; padding: 7px 0; font-size: 13.5px; border-bottom: 1px dashed var(--line); flex-wrap: wrap; }
.coach li > span:nth-child(2) { flex: 1; min-width: 160px; }
.coach .dot { flex: none; width: 16px; text-align: center; font-weight: 700; }
.coach .ok .dot { color: var(--ok); } .coach .todo .dot { color: #c47f16; }
.credit { font-size: 12px; color: var(--muted); margin-top: 18px; }
.credit a { color: inherit; }
.ideas-head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.areas { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 14px 0 6px; }
.area { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; cursor: pointer; position: relative; }
.area-e { font-size: 20px; line-height: 1.2; }
.area-l { font: 600 10.5px/1.15 var(--ui); text-align: center; color: var(--ink-2); }
.area-n { position: absolute; top: -6px; right: -4px; min-width: 18px; height: 18px; border-radius: 9px; background: var(--ok); color: #fff; font: 700 10.5px/18px var(--ui); padding: 0 4px; }
.area.none { border-style: dashed; }
.area.none .area-n { background: #ddd5ca; color: var(--ink-2); }
.area.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #fbf8f2; }
.idea-g h4 { font: 700 11.5px var(--ui); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 8px; display: flex; justify-content: space-between; gap: 8px; }
.idea-g h4 small { text-transform: none; letter-spacing: 0; font-weight: 500; }
.idea-list { display: flex; flex-wrap: wrap; gap: 8px; }
.idea { border: 0; cursor: pointer; transition: transform .12s; }
.idea:hover { transform: translateY(-2px) rotate(-1deg); }
.card-i { width: calc(50% - 4px); min-height: 94px; border-radius: 14px; background: linear-gradient(135deg, var(--g1), var(--g2)); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px; font: 560 13.5px/1.25 var(--display); color: #2b2420; box-shadow: 0 2px 8px rgba(40, 30, 20, .1); text-align: center; }
.ce { font-size: 28px; line-height: 1.1; }
.word-i { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 7px 13px; font: italic 480 14.5px var(--display); color: var(--ink); }
.photo-i { width: 100%; text-align: left; background: rgba(255, 255, 255, .6); border: 1.5px dashed #c9b9aa; border-radius: 12px; padding: 9px 12px; font: 600 13px var(--ui); color: var(--ink-2); display: flex; gap: 8px; }
.prompt-i { width: calc(50% - 4px); background: #fff0a6; padding: 10px; font: 700 17px/1.12 var(--hand); color: #3a3128; text-align: left; box-shadow: 0 2px 6px rgba(40, 30, 20, .12); min-height: 84px; }
.prompt-i:nth-child(4n+2) { background: #ffd4dd; } .prompt-i:nth-child(4n+3) { background: #cbf0dd; } .prompt-i:nth-child(4n+4) { background: #d0e5ff; }
.stickers { display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; width: 100%; }
.sticker-i { font-size: 24px; background: none; border-radius: 10px; padding: 5px 0; }
.sticker-i:hover { background: rgba(37, 33, 29, .06); }
.journal .fld { margin-bottom: 14px; }
.j-head { position: relative; margin-bottom: 16px; }
.j-head .saved { position: absolute; right: 0; top: 2px; color: var(--ok); font-weight: 600; }
.j-dump { font: 600 17px var(--display); margin: 26px 0 12px; }
.journal .acts { margin: -6px 0 16px; }
.wins-head { margin-bottom: 14px; }
.wins-head p { margin-top: 6px; }
.wins-count { font: 600 15px var(--display); color: #8a6200; margin-bottom: 10px; }
.win-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.win { display: flex; gap: 12px; padding: 10px; border-radius: 14px; background: linear-gradient(135deg, #fff6df, #fff); border: 1px solid #f0dca6; }
.win.arch { background: #faf7f1; border-color: var(--line); }
.w-thumb { width: 56px; height: 56px; border-radius: 10px; overflow: hidden; flex: none; background: #fff; display: grid; place-items: center; font-size: 28px; box-shadow: 0 2px 6px rgba(40, 30, 20, .12); }
.w-thumb img { width: 100%; height: 100%; object-fit: cover; }
.w-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.w-body strong { font: 600 14px/1.3 var(--ui); overflow-wrap: anywhere; }
.w-body small { color: var(--muted); }
.w-acts { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.empty { text-align: center; padding: 30px 10px; }
.empty-e { font-size: 44px; }
.empty p { margin-top: 6px; }

/* ---------- daily view ---------- */
.daily-ui { display: none; }
.board-app.daily { grid-template-rows: 1fr; }
.daily .topbar, .daily .toolbar, .daily .zoombar, .daily .panel, .daily .ctxbar, .daily .cursors, .daily .hdl, .daily .layer.rsel { display: none !important; }
.daily .main { grid-template-columns: minmax(0, 1fr); }
.daily .stage { cursor: grab; }
.daily .it.sel { outline: none; }
.daily .daily-ui { display: block; position: fixed; inset: 0; pointer-events: none; z-index: 30; }
.daily-top { pointer-events: auto; position: absolute; top: 14px; left: 16px; right: 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.daily-date { font: 600 14px var(--ui); color: var(--muted); background: rgba(255, 253, 249, .8); padding: 6px 12px; border-radius: 999px; }
.daily-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.daily-btns .btn.ghost { background: rgba(255, 253, 249, .8); }
.daily-text { position: absolute; bottom: calc(26px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); text-align: center; width: max-content; max-width: min(760px, 90vw); background: rgba(255, 253, 249, .88); backdrop-filter: blur(8px); padding: 14px 26px; border-radius: 18px; box-shadow: var(--shadow); }
.daily-word { font: 700 12.5px var(--ui); text-transform: uppercase; letter-spacing: .16em; color: #a87a16; margin-bottom: 4px; }
.daily-intent { font: italic 420 clamp(17px, 2.4vw, 23px)/1.35 var(--display); color: var(--ink); }

/* ---------- home ---------- */
.home { max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.home-top { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; }
.brand-l { display: flex; align-items: center; gap: 10px; font: 700 22px var(--grot); color: var(--ink); text-decoration: none; }
.home-top nav { display: flex; gap: 18px; align-items: center; }
.home-top nav a:not(.btn) { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 44px; align-items: center; padding: 36px 0 64px; }
.hero h1 { font: 600 clamp(38px, 5.4vw, 66px)/1.03 var(--display); letter-spacing: -.02em; margin: 0 0 20px; }
.hero h1 em { font-style: italic; font-weight: 420; color: var(--rose); }
.lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 540px; }
.hero-cta { display: flex; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.hero-art { position: relative; height: 470px; background: radial-gradient(#d6ccbd 1.2px, transparent 1.4px) 0 0/22px 22px, #f0e9dd; border-radius: 28px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.ha { position: absolute; box-shadow: 0 10px 30px rgba(40, 30, 20, .16); }
.ha-pola { left: 7%; top: 8%; width: 196px; background: #fff; padding: 10px 10px 0; transform: rotate(-5deg); }
.ha-photo { height: 152px; background: linear-gradient(160deg, #ffd29a, #f39ab6 55%, #7fb5d8); display: grid; place-items: center; font-size: 56px; }
.ha-pola span { display: block; text-align: center; font: 700 23px/46px var(--hand); color: #3a3128; }
.ha-note { right: 8%; top: 8%; width: 156px; height: 156px; background: #fff0a6; padding: 16px; font: 700 26px/1.1 var(--hand); color: #3a3128; transform: rotate(4deg); }
.ha-word { left: 39%; top: 43%; font: italic 400 66px var(--display); color: #5b2a4e; box-shadow: none; transform: rotate(-3deg); }
.ha-card { right: 7%; bottom: 9%; width: 172px; height: 204px; border-radius: 20px; background: linear-gradient(135deg, #dcf1bd, #86c49c); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; font: 560 18px var(--display); color: #2b2420; transform: rotate(3deg); }
.ha-card .e { font-size: 60px; line-height: 1; }
.ha-aff { left: 7%; bottom: 11%; font: 700 31px/1.08 var(--hand); color: var(--rose); box-shadow: none; max-width: 230px; transform: rotate(-2deg); }
.ha-stick { left: 47%; top: 9%; font-size: 46px; box-shadow: none; }
.ha-stick2 { left: 53%; bottom: 7%; font-size: 40px; box-shadow: none; }
.ha-cur { position: absolute; display: flex; align-items: flex-start; z-index: 2; }
.ha-cur b { margin: 17px 0 0 -4px; color: #fff; font: 600 12px/1 var(--ui); padding: 4px 7px; border-radius: 3px 7px 7px 7px; }
.c1 b { background: #e4572e; } .c2 b { background: #2e86ab; }
.c1 { animation: cur1 9s ease-in-out infinite; } .c2 { animation: cur2 11s ease-in-out infinite; }
@keyframes cur1 { 0%, 100% { left: 30%; top: 32%; } 33% { left: 63%; top: 24%; } 66% { left: 56%; top: 64%; } }
@keyframes cur2 { 0%, 100% { left: 70%; top: 58%; } 35% { left: 34%; top: 72%; } 70% { left: 20%; top: 40%; } }
.home-sec { padding: 34px 0; }
.home-sec h2 { font: 600 30px/1.15 var(--display); margin: 0 0 6px; }
.sec-head { margin-bottom: 20px; }
.sec-head p { max-width: 660px; line-height: 1.55; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.modal .tpl-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tpl { text-align: left; border: 1.5px solid var(--line); border-radius: 18px; background: #fff; padding: 0; overflow: hidden; cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column; }
.tpl:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.tpl.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tpl-prev { position: relative; border-bottom: 1px solid var(--line); }
.preview { display: block; width: 100%; height: auto; }
.tpl-badge { position: absolute; top: 10px; right: 10px; background: var(--rose); color: #fff; font: 700 11px var(--ui); padding: 3px 8px; border-radius: 999px; }
.tpl-meta { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 3px; }
.tpl-meta strong { font: 600 16px var(--display); }
.tpl-layout { font: 700 11px var(--ui); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tpl-meta p { font-size: 13.5px; line-height: 1.45; color: var(--ink-2); margin-top: 3px; }
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.bcard { position: relative; border-radius: 16px; background: #fff; border: 1.5px solid var(--line); overflow: hidden; text-decoration: none; color: var(--ink); transition: transform .15s, box-shadow .15s; }
.bcard:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.bcard-prev { position: relative; border-bottom: 1px solid var(--line); }
.live-badge { position: absolute; left: 8px; bottom: 8px; background: #fff; color: #2fa36b; font: 700 11px var(--ui); padding: 3px 8px; border-radius: 999px; box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.bcard-meta { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; }
.bcard-meta strong { font: 600 15px var(--display); }
.bcard-x { position: absolute; top: 6px; right: 6px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); display: grid; place-items: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.bcard:hover .bcard-x { opacity: 1; }
@media (hover: none) { .bcard-x { opacity: 1; } }
.feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.feat { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.feat-e { font-size: 28px; }
.feat strong { display: block; font: 600 16px var(--display); margin: 8px 0 6px; }
.feat p { font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.method { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.method li { display: flex; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.m-n { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font: 700 14px var(--grot); }
.method strong { font: 600 15.5px var(--display); display: block; margin-bottom: 4px; }
.method p { font-size: 13.5px; line-height: 1.5; color: var(--ink-2); }
.home-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 30px 0 40px; border-top: 1px solid var(--line); margin-top: 30px; font-size: 13.5px; color: var(--muted); }
.home-foot a { color: inherit; }
.create-prev { display: grid; grid-template-columns: 170px 1fr; gap: 14px; align-items: center; }
.create-prev svg { border-radius: 12px; border: 1px solid var(--line); }
.create-prev strong { font: 600 16px var(--display); }
.exp-prev { display: grid; place-items: center; background: repeating-conic-gradient(#ece7df 0 25%, #f8f5f0 0 50%) 0 0/18px 18px; border-radius: 14px; padding: 18px; min-height: 260px; }
.exp-canvas { max-width: 100%; max-height: 46vh; box-shadow: var(--shadow-lg); border-radius: 6px; }
.exp-canvas.phone { border-radius: 24px; }

/* ---------- responsive ---------- */
@media (max-height: 660px) and (min-width: 701px) { .tool-lbl { display: none; } .tool { padding: 8px 0; width: 44px; } }
@media (max-width: 860px) {
  .main { grid-template-columns: minmax(0, 1fr); }
  .panel { position: absolute; left: 0; right: 0; bottom: 0; height: 64%; border-left: 0; border-top: 1px solid var(--line); border-radius: 18px 18px 0 0; box-shadow: var(--shadow-lg); z-index: 25; }
  .panel-close { display: inline-grid; }
}
@media (max-width: 700px) {
  .toolbar { left: 8px; right: 8px; top: auto; bottom: calc(8px + env(safe-area-inset-bottom)); transform: none; flex-direction: row; overflow-x: auto; scrollbar-width: none; }
  .tool { width: 60px; }
  .tool-sep { width: 1px; height: auto; margin: 6px 4px; }
  .zoombar { bottom: calc(86px + env(safe-area-inset-bottom)); left: 8px; }
  .zoombar .ibtn[title^=Shortcuts] { display: none; }
  .toasts { bottom: calc(150px + env(safe-area-inset-bottom)); }
  .hide-sm, .conn-text, .btn.invite .lbl { display: none; }
  .title-input { width: 34vw; font-size: 15px; }
  .topbar { gap: 2px; padding: 0 6px; }
  .peers { padding: 0 4px 0 8px; }
  .exp-formats { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 12px; }
  .hero-art { height: 380px; }
  .feats { grid-template-columns: 1fr 1fr; }
  .method { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .home { padding: 0 16px; }
  .feats, .row2 { grid-template-columns: 1fr; }
  .ha-pola { width: 150px; } .ha-photo { height: 112px; } .ha-note { width: 124px; height: 124px; font-size: 21px; } .ha-card { width: 130px; height: 160px; font-size: 15px; } .ha-word { font-size: 48px; left: 30%; }
  .home-top nav a:not(.btn) { display: none; }
  .create-prev { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.exp-prev { gap: 12px; }
.exp-tip { max-width: 420px; text-align: center; background: rgba(255,255,255,.85); padding: 8px 12px; border-radius: 10px; }
.daily .it.is-tpl, .daily .it.slot { display: none; }
