/* Themes only change these variables. The paper under the drawing is set separately (and shared). */
:root, body[data-theme="strawberry"] { --panel:#fffdfb; --text:#2b1e27; --mute:#8d7a86; --line:#2b1e27; --accent:#ff5d8f; --on-accent:#fff; --soft:#ffe6ee; --hover:#fff0f4; }
body[data-theme="matcha"] { --panel:#fdfff9; --text:#22301f; --mute:#74856f; --line:#22301f; --accent:#5c9d6e; --on-accent:#fff; --soft:#e2f2df; --hover:#eef8ec; }
body[data-theme="lilac"] { --panel:#fefcff; --text:#2a2140; --mute:#857b9c; --line:#2a2140; --accent:#8b6cf0; --on-accent:#fff; --soft:#ebe5ff; --hover:#f4f0ff; }
body[data-theme="butter"] { --panel:#fffef8; --text:#33270f; --mute:#8f8160; --line:#33270f; --accent:#f08a24; --on-accent:#fff; --soft:#ffefc2; --hover:#fff6dc; }
body[data-theme="sky"] { --panel:#fbfdff; --text:#16263d; --mute:#6f8098; --line:#16263d; --accent:#3d8bfd; --on-accent:#fff; --soft:#dcebff; --hover:#ecf4ff; }
body[data-theme="peach"] { --panel:#fffdfb; --text:#3a2218; --mute:#94786c; --line:#3a2218; --accent:#ff7a59; --on-accent:#fff; --soft:#ffe3d6; --hover:#fff1ea; }
body[data-theme="cherry"] { --panel:#3b1622; --text:#ffeef2; --mute:#c79aa6; --line:#17060c; --accent:#ff4d6d; --on-accent:#fff; --soft:#57202f; --hover:#4a1b29; }
body[data-theme="midnight"] { --panel:#2a2238; --text:#f6eefc; --mute:#a99bbd; --line:#0d0a14; --accent:#ff7eb6; --on-accent:#2a1020; --soft:#3b2f52; --hover:#352a49; }

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; }
body { font: 500 14px/1.4 "DM Sans", system-ui, sans-serif; color: var(--text); background: #fff8ef; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { opacity: .35; cursor: default; }
input { font: inherit; color: inherit; }
[hidden] { display: none !important; }
h1, h2 { font-family: "Fraunces", serif; font-weight: 600; margin: 0; }
h1 em, h2 em, .word em { font-style: italic; color: var(--accent); }
p { margin: 0; }
code { font: 500 12px ui-monospace, monospace; background: var(--soft); padding: 1px 5px; border-radius: 5px; }

.pill { background: var(--panel); border: 1.5px solid var(--line); border-radius: 18px; box-shadow: 3px 3px 0 var(--line); }

/* ---------- board ---------- */
#stage { position: fixed; inset: 0; touch-action: none; cursor: crosshair; }
#stage[data-tool="select"] { cursor: default; }
#stage[data-tool="hand"], #stage.grab { cursor: grab; }
#stage.grabbing { cursor: grabbing; }
#stage[data-tool="text"] { cursor: text; }
#stage[data-tool="note"] { cursor: copy; }
#stage[data-tool="sticker"] { cursor: default; }
#stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#overlay { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

#selbox { position: absolute; left: 0; top: 0; border: 1.5px dashed var(--accent); border-radius: 8px; }
.handle { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: var(--panel); border: 1.5px solid var(--line); pointer-events: auto; touch-action: none; }
.handle.scale { right: -10px; bottom: -10px; cursor: nwse-resize; }
.handle.rot { left: 50%; top: -36px; margin-left: -9px; cursor: grab; background: var(--accent); }
.handle.rot::after { content: ""; position: absolute; left: 50%; top: 100%; width: 0; height: 17px; border-left: 1.5px dashed var(--accent); }
@media (pointer: coarse) {
  .handle { width: 28px; height: 28px; }
  .handle.scale { right: -15px; bottom: -15px; }
  .handle.rot { top: -48px; margin-left: -14px; }
  .handle.rot::after { height: 19px; }
}

#marquee { position: absolute; border: 1.5px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 6px; }
.credit { font-size: 11.5px; color: var(--mute); text-align: center; margin-top: 4px; }
#ring { position: absolute; left: 0; top: 0; border: 1.5px solid rgba(60, 40, 60, .55); box-shadow: 0 0 0 1px rgba(255, 255, 255, .6); border-radius: 50%; }

.editor { position: absolute; margin: 0; padding: 0 4px; border: 0; outline: 1.5px dashed var(--accent); outline-offset: 4px; border-radius: 4px; background: transparent; resize: none; overflow: hidden; text-align: center; white-space: pre; pointer-events: auto; caret-color: var(--accent); user-select: text; -webkit-user-select: text; }
.editor.boxed { white-space: pre-wrap; padding: 0; }

.cur { position: absolute; left: 0; top: 0; transition: transform 90ms linear; will-change: transform; }
.cur svg { width: 22px; height: 22px; fill: var(--c); stroke: #fff; stroke-width: 1.5; stroke-linejoin: round; display: block; filter: drop-shadow(1px 2px 0 rgba(0, 0, 0, .25)); }
.cur span { position: absolute; left: 18px; top: 18px; background: var(--c); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }

/* ---------- chrome ---------- */
#top { position: fixed; z-index: 10; top: max(12px, env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px; height: 44px; }
.brand .mark { width: 28px; height: 28px; flex: none; }
.word em, .gate-card h1 em { font: 700 1.36em/1 "Caveat", cursive; font-style: normal; letter-spacing: 0; text-decoration: underline wavy; text-decoration-thickness: .065em; text-underline-offset: .1em; text-decoration-skip-ink: none; }
.gate-logo .mark { width: 62px; height: 62px; display: block; }
.brand .word { font: 600 19px "Fraunces", serif; letter-spacing: -.01em; white-space: nowrap; }
.top-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; }
#people { display: flex; align-items: center; height: 44px; padding: 0 8px; }
.avatar { width: 28px; height: 28px; border-radius: 50%; border: 1.5px solid var(--line); color: #fff; font-weight: 700; font-size: 13px; display: grid; place-items: center; margin-left: -6px; }
.avatar:first-child { margin-left: 0; }
#people .extra { font-weight: 700; font-size: 12px; margin-left: 6px; color: var(--mute); }
#timer { height: 44px; padding: 0 14px; display: grid; place-items: center; font-weight: 700; font-variant-numeric: tabular-nums; background: var(--soft); }
#timer.hot { background: var(--accent); color: var(--on-accent); animation: pulse .5s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.06); } }

svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.tb { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; transition: background .12s, transform .12s; }
.tb b { font-size: 12px; font-weight: 700; letter-spacing: .03em; border: 1.8px solid currentColor; border-radius: 6px; padding: 1px 4px; }
.tb:hover:not(:disabled) { background: var(--hover); }
.tb:active:not(:disabled) { transform: scale(.92); }
.tb.on { background: var(--accent); color: var(--on-accent); }
.sep { flex: none; background: var(--line); opacity: .15; }

#tools { position: fixed; z-index: 10; left: 12px; top: 50%; transform: translateY(-50%); display: flex; flex-direction: column; gap: 2px; padding: 6px; }
@media (max-height: 800px) and (min-width: 721px) { #tools .tb { width: 38px; height: 36px; } #tools { gap: 1px; padding: 5px; } #dock { left: 70px; } }
#tools .sep { height: 1.5px; margin: 4px 6px; }

#hud { position: fixed; z-index: 10; left: 12px; bottom: 12px; display: flex; align-items: center; padding: 4px; gap: 1px; }
#hud .tb { width: 36px; height: 36px; }
#hud .sep { width: 1.5px; height: 20px; margin: 0 4px; }
.zoom-label { width: 50px; height: 36px; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; border-radius: 10px; }
.zoom-label:hover { background: var(--hover); }

#says { position: fixed; z-index: 12; right: 12px; bottom: 66px; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; pointer-events: none; max-width: min(320px, calc(100vw - 24px)); }
.say { display: flex; align-items: flex-start; gap: 7px; padding: 6px 12px 6px 6px; border-radius: 16px; background: var(--panel); border: 1.5px solid var(--line); box-shadow: 2px 2px 0 var(--line); font-size: 14px; font-weight: 500; animation: toastIn .2s ease-out; transition: opacity .4s, transform .4s; overflow-wrap: anywhere; }
.say i { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; color: #fff; font: 700 11px "DM Sans", sans-serif; }
.say span { padding-top: 2px; }
.say.out { opacity: 0; transform: translateY(-6px); }
.say-box { pointer-events: auto; padding: 4px; }
.say-input { width: 240px; max-width: 70vw; border: 0; outline: 0; background: none; color: inherit; font: inherit; font-size: 16px; padding: 6px 10px; }
.cur.saying span { font-size: 13.5px; padding: 5px 11px; border-radius: 14px 14px 14px 4px; white-space: normal; width: max-content; max-width: 220px; }
.ping { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; }
.ping i { position: absolute; left: -9px; top: -9px; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--c); animation: ping 1.3s ease-out 2 both; }
.ping i + i { animation-delay: .35s; }
.ping span { position: absolute; left: 14px; top: 10px; background: var(--c); color: #fff; font-weight: 700; font-size: 12px; padding: 2px 8px; border-radius: 999px; white-space: nowrap; animation: toastIn .2s ease-out; }
@keyframes ping { from { transform: scale(.4); opacity: 1; } to { transform: scale(5); opacity: 0; } }
body.pinging #stage { cursor: crosshair; }
.say.go { pointer-events: auto; cursor: pointer; text-align: left; }
.kiss { position: absolute; left: 0; top: 0; font-size: 22px; margin: -14px 0 0 -11px; pointer-events: none; animation: kiss .9s ease-out forwards; }
@keyframes kiss { from { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.25); opacity: 1; } to { transform: translateY(-34px) scale(1); opacity: 0; } }
#reacts { position: fixed; z-index: 10; right: 12px; bottom: 12px; display: flex; padding: 4px; gap: 1px; }
.react { width: 38px; height: 38px; font-size: 21px; border-radius: 12px; transition: transform .12s; }
.react:hover { transform: scale(1.25) rotate(-8deg); }
.react:active { transform: scale(.9); }
.react.toggle { display: none; }

#status { position: fixed; z-index: 30; top: 68px; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--panel); padding: 6px 14px; border-radius: 999px; font-weight: 700; font-size: 13px; }

/* ---------- dock (brush, colour, size) ---------- */
#dock { position: fixed; z-index: 11; left: 76px; top: 50%; transform: translateY(-50%); width: 236px; max-height: calc(100vh - 150px); overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: none; }
.label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--mute); margin-top: 4px; }
.label:first-child { margin-top: 0; }
.hint { font-size: 12.5px; color: var(--mute); line-height: 1.45; }
.brushes { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.brush { border: 1.5px solid transparent; border-radius: 12px; padding: 5px 2px 4px; display: flex; flex-direction: column; align-items: center; gap: 0; background: var(--hover); }
.brush span { font-size: 11.5px; font-weight: 700; }
.brush.on { border-color: var(--line); background: var(--soft); box-shadow: 2px 2px 0 var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 700; font-size: 13px; transition: transform .1s; white-space: nowrap; }
.chip:hover { background: var(--hover); }
.chip:active { transform: scale(.95); }
.chip.on { background: var(--accent); color: var(--on-accent); }
.chip.shape { padding: 3px 5px; border-radius: 10px; display: grid; }
.swatches { display: flex; flex-wrap: wrap; gap: 7px; }
.sw { width: 27px; height: 27px; border-radius: 50%; border: 1.5px solid var(--line); position: relative; transition: transform .1s; }
.sw:hover { transform: scale(1.12); }
.sw.on { outline: 2.5px solid var(--accent); outline-offset: 2px; }
.sw.big { width: 38px; height: 38px; border-radius: 12px; }
.sw.custom { background: conic-gradient(#ff4d6d, #ffd23f, #52b788, #4d96ff, #9b5de5, #ff4d6d); overflow: hidden; cursor: pointer; }
.sw.custom input { position: absolute; inset: -8px; width: 200%; height: 200%; opacity: 0; cursor: pointer; }
.slider { display: grid; grid-template-columns: 54px 1fr 38px; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; }
.slider .val { text-align: right; color: var(--mute); font-variant-numeric: tabular-nums; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: var(--soft); border: 1.5px solid var(--line); box-sizing: content-box; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--line); margin-top: -7px; }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: var(--soft); border: 1.5px solid var(--line); }
input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--accent); border: 1.5px solid var(--line); }
.current-sticker { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--hover); }
.current-sticker span { font-size: 26px; font-family: "Fraunces", serif; font-style: italic; }
.current-sticker small { font-weight: 700; color: var(--accent); }

/* ---------- sheets (stickers, GIFs, ideas, look, menu, invite) ---------- */
#sheet { position: fixed; z-index: 20; right: 12px; top: 68px; width: 348px; max-height: calc(100vh - 140px); display: flex; flex-direction: column; overflow: hidden; animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 8px 6px 16px; }
.sheet-head h2 { font-size: 22px; font-style: italic; }
.sheet-body { padding: 4px 16px 16px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.sheet-body > * { flex: none; }
.row { display: flex; gap: 8px; align-items: center; }
.row .field { flex: 1; min-width: 0; }
.grow { flex: 1; }
.field { -webkit-appearance: none; appearance: none; flex: none; width: 100%; height: 42px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--panel); outline: none; user-select: text; -webkit-user-select: text; }
.field:focus { box-shadow: 2px 2px 0 var(--accent); border-color: var(--accent); }
.field.big { height: 52px; font-size: 18px; text-align: center; font-weight: 700; }
.field::placeholder { color: var(--mute); font-weight: 500; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--panel); font-weight: 700; box-shadow: 2px 2px 0 var(--line); transition: transform .08s, box-shadow .08s; text-decoration: none; color: var(--text); white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.05); }
.btn.wide { width: 100%; }
.btn.big { height: 54px; font-size: 17px; border-radius: 16px; box-shadow: 3px 3px 0 var(--line); width: 100%; }
.btn.danger { color: #d6336c; }
.btn svg { width: 18px; height: 18px; }

.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.emoji-grid button { font-size: 30px; aspect-ratio: 1; border-radius: 12px; transition: transform .12s; }
.emoji-grid button:hover { background: var(--hover); transform: scale(1.2) rotate(-6deg); }
.emoji-grid.small button { font-size: 20px; border-radius: 9px; }
.emoji-grid.small button.on { background: var(--soft); outline: 1.5px solid var(--line); }
.words { display: flex; flex-wrap: wrap; gap: 10px; padding: 4px 2px; }
.word-sticker { font: italic 700 17px "Fraunces", serif; color: #2b1e27; padding: 7px 16px; border-radius: 999px; border: 1.5px solid #2b1e27; box-shadow: 2px 2px 0 #2b1e27; transition: transform .12s; }
.word-sticker:hover { transform: rotate(-3deg) scale(1.05); }
.gif-grid { columns: 2; column-gap: 8px; }
.gif-grid button { display: block; width: 100%; margin-bottom: 8px; border-radius: 10px; overflow: hidden; border: 1.5px solid var(--line); break-inside: avoid; }
.gif-grid img { display: block; width: 100%; }
.deck { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.deck-card { text-align: left; padding: 12px; border-radius: 14px; border: 1.5px solid #2b1e27; box-shadow: 2px 2px 0 #2b1e27; color: #2b1e27; display: flex; flex-direction: column; gap: 14px; transition: transform .12s; }
.deck-card:nth-child(odd):hover { transform: rotate(-2deg) translateY(-2px); }
.deck-card:nth-child(even):hover { transform: rotate(2deg) translateY(-2px); }
.deck-card b { font: italic 600 17px/1.15 "Fraunces", serif; }
.deck-card span { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme { display: flex; align-items: center; gap: 8px; padding: 6px 10px 6px 6px; border: 1.5px solid var(--line); border-radius: 12px; font-weight: 700; font-size: 13px; text-align: left; background: var(--panel); }
.theme i { width: 28px; height: 28px; border-radius: 8px; border: 1.5px solid var(--line); flex: none; }
.theme.on { background: var(--soft); box-shadow: 2px 2px 0 var(--line); }

.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 0 16px 2px; flex: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.tabs { position: sticky; top: 0; z-index: 2; display: flex; gap: 3px; padding: 3px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--soft); }
.tab { flex: 1; padding: 7px 0; border-radius: 9px; font-weight: 700; font-size: 12.5px; color: var(--mute); border: 1.5px solid transparent; }
.tab:hover { color: var(--text); }
.tab.on { background: var(--panel); color: var(--text); border-color: var(--line); }
.pal-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.pal-grid button { border-radius: 14px; display: grid; place-items: center; padding: 4px 0; transition: transform .12s; }
.pal-grid button:hover { background: var(--hover); transform: scale(1.12) rotate(-5deg); }
.gif-grid.three { columns: 3; }
.gif-grid.three button { border: 0; background: var(--hover); }
.game { display: flex; flex-direction: column; gap: 2px; text-align: left; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); transition: transform .1s, box-shadow .1s; flex: none; }
.game:hover { background: var(--hover); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--line); }
.game b { font: italic 600 17px "Fraunces", serif; }
.game span { font-size: 12.5px; color: var(--mute); }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tiles.three { grid-template-columns: 1fr 1fr 1fr; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 12px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--panel); font-weight: 700; font-size: 13px; box-shadow: 2px 2px 0 var(--line); transition: transform .08s, box-shadow .08s; }
.tile:hover { background: var(--hover); }
.tile:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--line); }
.tile i { font-style: normal; font-size: 28px; line-height: 1; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

#selbar { position: fixed; z-index: 12; display: flex; padding: 4px; gap: 1px; left: 0; top: 0; }
#selbar .tb { width: 38px; height: 38px; }

/* ---------- little moments ---------- */
#fx { position: fixed; inset: 0; z-index: 35; pointer-events: none; overflow: hidden; }
.float { position: absolute; bottom: 60px; opacity: 0; animation: floatUp 2.3s ease-out forwards; }
@keyframes floatUp {
  0% { transform: translate(0, 0) scale(.4); opacity: 0; }
  15% { transform: translate(0, -40px) scale(1.15); opacity: 1; }
  100% { transform: translate(var(--dx), -72vh) scale(1) rotate(var(--rot)); opacity: 0; }
}
.announce.long { font-size: 20px; white-space: normal; text-align: center; width: max-content; max-width: min(520px, 90vw); line-height: 1.25; }
body.poked #stage { animation: poke .45s; }
@keyframes poke { 15% { transform: translate(-10px, 4px) rotate(-.6deg); } 30% { transform: translate(9px, -4px) rotate(.6deg); } 45% { transform: translate(-7px, 2px); } 60% { transform: translate(6px, -2px); } 80% { transform: translate(-3px, 0); } }
.announce { position: absolute; left: 50%; top: 30%; padding: 16px 28px; font: italic 600 28px "Fraunces", serif; white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; animation: announce 2.8s ease forwards; }
@keyframes announce {
  0% { transform: translate(-50%, 20px) scale(.6) rotate(-4deg); opacity: 0; }
  10% { transform: translate(-50%, 0) scale(1.06) rotate(1deg); opacity: 1; }
  16%, 85% { transform: translate(-50%, 0) scale(1) rotate(0); opacity: 1; }
  100% { transform: translate(-50%, -16px) scale(.96); opacity: 0; }
}
#toasts { position: fixed; z-index: 40; left: 50%; bottom: 76px; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.toast { background: var(--text); color: var(--panel); padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: 13px; animation: toastIn .2s ease-out; transition: opacity .3s, transform .3s; max-width: 90vw; text-align: center; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }

/* ---------- front door ---------- */
#gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; overflow: hidden;
  background: radial-gradient(60% 50% at 18% 20%, #ffd9e4 0%, transparent 70%), radial-gradient(55% 50% at 85% 78%, #e3dbff 0%, transparent 70%), radial-gradient(45% 40% at 78% 14%, #fff1c2 0%, transparent 70%), #fff8ef;
  transition: opacity .4s, transform .4s; }
#gate.gone { opacity: 0; transform: scale(1.04); pointer-events: none; }
.gate-card { position: relative; width: min(420px, 100%); padding: 30px 28px 24px; display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; border-radius: 28px; box-shadow: 6px 6px 0 var(--line); --panel:#fffdfb; --text:#2b1e27; --line:#2b1e27; --mute:#8d7a86; color: #2b1e27; background: #fffdfb; }
.gate-logo { font-size: 46px; line-height: 1; animation: bob 3s ease-in-out infinite; }
.gate-card h1 { font-size: clamp(34px, 9vw, 44px); letter-spacing: -.02em; line-height: 1; }
.gate-card p { color: var(--mute); font-size: 15.5px; max-width: 32ch; }
.gate-card small { color: var(--mute); }
.gate-card .swatches { justify-content: center; }
.decor { position: absolute; animation: bob 5s ease-in-out infinite; opacity: .85; }
@keyframes bob { 50% { transform: translateY(-10px) rotate(6deg); } }
.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* ---------- phones ---------- */
@media (max-width: 720px) {
  .brand .word { display: none; }
  .brand { padding: 8px 10px; }
  #inviteBtn { padding: 0 14px; }
  #tools { left: 8px; right: 8px; top: auto; bottom: max(8px, env(safe-area-inset-bottom)); transform: none; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 5px 38px 5px 5px; }
  #tools::-webkit-scrollbar { display: none; }
  #tools::after { content: ''; position: sticky; right: -5px; flex: none; width: 30px; margin-left: -30px; align-self: stretch; pointer-events: none; background: linear-gradient(90deg, transparent, var(--panel) 75%); border-radius: 0 12px 12px 0; }
  #tools .sep { width: 1.5px; height: auto; margin: 6px 3px; }
  #dock { left: 8px; right: 8px; top: auto; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 62px); transform: none; width: auto; max-height: 46vh; }
  .brushes { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -12px; padding: 0 12px 3px; }
  .brush { flex: none; width: 84px; }
  #sheet { left: 0; right: 0; top: auto; bottom: 0; width: auto; max-height: 68vh; border-radius: 22px 22px 0 0; border-bottom: 0; box-shadow: 0 -3px 0 var(--line); padding-bottom: env(safe-area-inset-bottom); animation: rise .2s ease-out; }
  @keyframes rise { from { transform: translateY(30px); opacity: 0; } }
  #hud { left: 8px; top: calc(max(12px, env(safe-area-inset-top)) + 52px); bottom: auto; }
  #hud .zoom { display: none; }
  #reacts { right: 8px; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 62px); flex-direction: column-reverse; }
  #says { right: 60px; bottom: calc(max(8px, env(safe-area-inset-bottom)) + 62px); }
  .react { display: none; }
  .react.toggle, #reacts.open .react { display: block; }
  #toasts { bottom: 130px; }
  .announce { font-size: 22px; padding: 14px 20px; }
  .emoji-grid button { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-logo, .decor, #timer.hot { animation: none; }
}
