/* Sketch — draw-and-guess party game.
   Palette and type follow the main automate.help site so the game reads as
   part of it, but everything is namespaced here (the game never loads the
   site's styles.css). */

:root {
    --blue: #275EF5;
    --blue-dark: #1a4acf;
    --cyan: #22d3ee;
    --pink: #ff5fa2;
    --bg: #0b0b0e;
    --bg-deep: #070709;
    --surface: #101016;
    --surface-2: #16161f;
    --text: #f4f6fb;
    --muted: #a8b3cf;
    --line: rgba(255, 255, 255, 0.08);
    --line-strong: rgba(255, 255, 255, 0.16);
    --ok: #10b981;
    --warn: #f59e0b;
    --danger: #ef4444;
    --radius: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* Several components set display explicitly, which would otherwise beat the
   [hidden] attribute and leave "hidden" rows on screen. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg);
    background-image:
        radial-gradient(900px circle at 8% -8%, rgba(39, 94, 245, 0.14), transparent 60%),
        radial-gradient(760px circle at 100% 4%, rgba(200, 16, 46, 0.06), transparent 55%),
        radial-gradient(1100px circle at 50% 120%, rgba(34, 211, 238, 0.07), transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overscroll-behavior: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--cyan); }

/* ── chrome ─────────────────────────────────────────────────────────────── */
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 1.1rem;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 7, 9, 0.85);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 50;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    color: var(--text);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.brand svg { width: 26px; height: 26px; }
.brand .brand-sub {
    color: var(--cyan);
    font-weight: 600;
    letter-spacing: 0.16em;
    font-size: 0.72rem;
    text-transform: uppercase;
}
.topbar-right { display: flex; align-items: center; gap: 0.6rem; font-size: 0.85rem; color: var(--muted); }

.roomchip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-weight: 700;
    letter-spacing: 0.22em;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.07);
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 1.5rem 1.1rem 3rem; }

/* ── screens ────────────────────────────────────────────────────────────── */
.screen { display: none; animation: fade 0.25s ease; }
.screen.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.title {
    font-size: 2.6rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    background: linear-gradient(135deg, #275EF5, #22d3ee);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.sub { color: var(--muted); }
.h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 0.9rem; }
.small { font-size: 0.85rem; color: var(--muted); }

/* ── controls ───────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.35rem;
    border-radius: 10px;
    font-weight: 600;
    background: var(--surface-2);
    border: 1px solid var(--line-strong);
    color: var(--text);
    transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, opacity 0.15s;
}
.btn:hover { transform: translateY(-1px); background: #1c1c27; }
.btn:active { transform: none; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-primary {
    background: linear-gradient(135deg, var(--blue), var(--blue-dark));
    border-color: transparent;
    box-shadow: 0 6px 22px rgba(39, 94, 245, 0.32);
}
.btn-primary:hover { background: linear-gradient(135deg, #3b6ff7, var(--blue)); }
.btn-cyan {
    background: linear-gradient(135deg, #22d3ee, #0ea5b7);
    color: #05161b;
    border-color: transparent;
    box-shadow: 0 6px 22px rgba(34, 211, 238, 0.28);
}
.btn-ghost { background: transparent; }
.btn-lg { padding: 1rem 1.8rem; font-size: 1.05rem; }
.btn-sm { padding: 0.45rem 0.8rem; font-size: 0.85rem; border-radius: 8px; }
.icon-btn { padding: 0.4rem; }
.icon-btn svg {
    width: 18px; height: 18px; display: block;
    stroke: currentColor; fill: none; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round;
}

.field { display: block; margin-bottom: 1rem; }
.field > span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.35rem; }
.input, select.input, textarea.input {
    width: 100%;
    padding: 0.8rem 1rem;
    background: var(--bg-deep);
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(39, 94, 245, 0.18); }
.input.code {
    text-transform: uppercase;
    letter-spacing: 0.5em;
    text-align: center;
    font-weight: 800;
    font-size: 1.5rem;
    padding-left: 1.5rem;
}
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 55%, calc(100% - 15px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }

.row { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.row.tight { gap: 0.4rem; }
.grow { flex: 1 1 auto; min-width: 0; }

/* ── home ───────────────────────────────────────────────────────────────── */
.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
    gap: 2rem;
    align-items: center;
    min-height: 70vh;
}
.home-copy .title { margin-bottom: 0.9rem; }
.home-copy p { color: var(--muted); max-width: 46ch; margin-bottom: 1.2rem; }
.mode-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.mode-chips span {
    padding: 0.3rem 0.7rem;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-size: 0.78rem;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
}
.avatars { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.avatar-pick {
    width: 44px; height: 44px;
    border-radius: 12px;
    border: 2px solid transparent;
    display: grid; place-items: center;
    font-size: 1.35rem;
    background: var(--surface-2);
    transition: transform 0.12s, border-color 0.12s;
}
.avatar-pick:hover { transform: translateY(-2px); }
.avatar-pick.sel { border-color: var(--cyan); box-shadow: 0 0 16px rgba(34, 211, 238, 0.35); }

.divider { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.8rem; margin: 1.2rem 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Entry blocks reorder when the page is opened from an invite link. */
.entry { display: flex; flex-direction: column; }
.entry-block { display: block; }
.entry.invited #joinBlock { order: -2; }
.entry.invited #entryDivider { order: -1; }
.invite-note {
    display: block;
    text-align: center;
    padding: 0.7rem 1rem;
    margin-bottom: 0.8rem;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(39, 94, 245, 0.1));
    border: 1px solid rgba(34, 211, 238, 0.4);
}
.invite-note .lab {
    display: block;
    font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan);
}
.invite-note .txt { display: block; font-size: 1.05rem; font-weight: 700; }
.invite-note b { letter-spacing: 0.2em; color: var(--cyan); }

/* ── lobby ──────────────────────────────────────────────────────────────── */
.lobby-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }

.players { display: flex; flex-direction: column; gap: 0.4rem; }
.player {
    position: relative;
    display: grid;
    grid-template-columns: 30px 1fr auto 20px;
    align-items: center;
    gap: 0.6rem;
    padding: 0.55rem 0.7rem;
    background: var(--surface-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    text-align: left;
}
.player .pa { font-size: 1.35rem; line-height: 1; text-align: center; }
.player .pn { font-weight: 600; font-size: 0.94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.player .tag { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cyan); }
.player.off { opacity: 0.45; }
.player .kick { color: var(--muted); font-size: 1rem; line-height: 1; opacity: 0; transition: opacity 0.15s; }
.player:hover .kick { opacity: 1; }
.player .kick:hover { color: var(--danger); }

.invite {
    display: flex; gap: 0.5rem; align-items: center;
    background: var(--bg-deep);
    border: 1px dashed var(--line-strong);
    border-radius: 10px;
    padding: 0.6rem 0.75rem;
}
.invite input { flex: 1; background: none; border: none; outline: none; color: var(--muted); font-size: 0.85rem; min-width: 0; }

.setting { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0.75rem; padding: 0.55rem 0; border-bottom: 1px solid var(--line); }
.setting:last-of-type { border-bottom: none; }
.setting label { font-size: 0.9rem; }
.setting .hint { display: block; font-size: 0.75rem; color: var(--muted); }
.setting input[type=number], .setting select { width: 120px; padding: 0.4rem 0.6rem; background: var(--bg-deep); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; }
.setting input[type=text] { width: 190px; padding: 0.4rem 0.6rem; background: var(--bg-deep); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; }

/* ── mode picker ────────────────────────────────────────────────────────── */
.mode-pick {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 0.6rem;
}
.mode-card {
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: start;
    gap: 0.6rem;
    padding: 0.7rem;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--line);
    color: var(--muted);
    text-align: left;
    transition: transform 0.12s, border-color 0.12s, background 0.12s;
}
.mode-card:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--line-strong); }
.mode-card.sel {
    border-color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
    box-shadow: 0 0 18px rgba(34, 211, 238, 0.14);
}
.mode-card:disabled { cursor: default; }
.mode-card.sel:disabled { opacity: 1; }
.mode-ico {
    width: 34px; height: 34px; border-radius: 9px;
    display: grid; place-items: center;
    background: rgba(255, 255, 255, 0.05);
}
.mode-card svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mode-card .mn { display: block; font-size: 0.9rem; font-weight: 700; color: var(--text); line-height: 1.25; }
.mode-card .md { display: block; font-size: 0.76rem; line-height: 1.35; margin-top: 0.15rem; }

.flow-builder { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.5rem; }
.flow-step {
    padding: 0.3rem 0.6rem; border-radius: 8px; font-size: 0.78rem; font-weight: 600;
    border: 1px solid var(--line-strong); background: var(--surface-2);
}
.flow-step.draw { color: var(--cyan); border-color: rgba(34, 211, 238, 0.4); }
.flow-step.write { color: var(--pink); border-color: rgba(255, 95, 162, 0.4); }

.chat { display: flex; flex-direction: column; height: 220px; }
.chat-log { flex: 1; overflow-y: auto; font-size: 0.88rem; padding-right: 0.3rem; }
.chat-log p { margin-bottom: 0.2rem; word-break: break-word; }
.chat-log b { color: var(--cyan); }
.chat-log .sys { color: var(--muted); font-style: italic; }

/* ── task / play ────────────────────────────────────────────────────────── */
.taskbar {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    margin-bottom: 0.9rem; flex-wrap: wrap;
}
.taskbar .step { font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.timer {
    font-variant-numeric: tabular-nums;
    font-weight: 800; font-size: 1.5rem;
    padding: 0.15rem 0.8rem; border-radius: 10px;
    border: 1px solid var(--line-strong);
    background: var(--bg-deep);
}
.timer.warn { color: var(--warn); border-color: rgba(245, 158, 11, 0.5); }
.timer.hot { color: var(--danger); border-color: rgba(239, 68, 68, 0.6); animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { transform: scale(1.06); } }

.prompt-box {
    background: linear-gradient(135deg, rgba(39, 94, 245, 0.14), rgba(34, 211, 238, 0.08));
    border: 1px solid rgba(39, 94, 245, 0.35);
    border-radius: 12px;
    padding: 1rem 1.2rem;
    margin-bottom: 1rem;
    text-align: center;
}
.prompt-box .lab { font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--cyan); }
.prompt-box .txt { font-size: 1.35rem; font-weight: 700; line-height: 1.35; }

.canvas-shell { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.9rem; align-items: start; }
.canvas-holder {
    position: relative;
    /* Keep the pad inside the viewport on laptops instead of pushing the
       Done button below the fold. */
    max-width: min(100%, calc((100vh - 300px) * 4 / 3));
    margin: 0 auto;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
    overflow: hidden;
    box-shadow: var(--shadow-md, 0 10px 40px rgba(0, 0, 0, 0.5));
    touch-action: none;
    width: 100%;
    aspect-ratio: 4 / 3;
}
/* Zoom lives on this wrapper so the canvas and its onion-skin move together. */
.pad-wrap {
    position: absolute;
    inset: 0;
    touch-action: none;
    transform-origin: 0 0;
    will-change: transform;
}
#pad {
    display: block; width: 100%; height: 100%; cursor: crosshair;
    touch-action: none;      /* must be on the canvas, not just the holder */
    -webkit-user-select: none; user-select: none;
    -webkit-touch-callout: none;
}

.tools { display: flex; flex-direction: column; gap: 0.6rem; width: 128px; }
.tool-group { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem; }
/* Fixed grids rather than flex-wrap: at this width wrapping was landing on 2
   columns because of sub-pixel rounding. */
.tool-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; place-items: center; }
#colorRow { grid-template-columns: repeat(4, 1fr); }
.tool {
    width: 32px; height: 32px; border-radius: 9px;
    display: grid; place-items: center;
    background: var(--surface-2); border: 1px solid transparent;
    transition: transform 0.12s, border-color 0.12s;
}
.tool svg { width: 18px; height: 18px; stroke: var(--text); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { transform: translateY(-1px); }
.tool.sel { border-color: var(--cyan); background: rgba(34, 211, 238, 0.14); }
.swatch { width: 24px; height: 24px; border-radius: 7px; border: 2px solid transparent; }
.swatch.sel { border-color: #fff; box-shadow: 0 0 0 2px var(--cyan); }
/* Custom colour: the native picker gives the full range, recents make it
   practical to come back to a shade. */
.custom-color { margin-top: 0.4rem; }
.swatch-lg {
    position: relative;
    display: block;
    width: 100%;
    height: 30px;
    border-radius: 8px;
    border: 1px solid var(--line-strong);
    cursor: pointer;
    overflow: hidden;
}
.swatch-lg input[type="color"] {
    position: absolute;
    inset: -4px;
    width: calc(100% + 8px);
    height: calc(100% + 8px);
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}
.swatch-lg .plus {
    position: absolute;
    right: 5px; top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}
.recent { margin-top: 0.35rem; grid-template-columns: repeat(4, 1fr); }

/* Zoom lives in the tool column rather than floating over the drawing. */
.zoom-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 4px;
}
.zoom-level {
    text-align: center;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    color: var(--muted);
}
.zoom-reset { width: 100%; margin-top: 0.4rem; font-size: 0.78rem; padding: 0.35rem 0.4rem; }

/* Opacity */
.slider-row { display: block; cursor: pointer; }
.slider-lab { display: block; font-size: 0.7rem; color: var(--muted); margin-bottom: 0.3rem; text-align: center; }
.slider-lab b { color: var(--text); font-variant-numeric: tabular-nums; }
#alphaRange { width: 100%; accent-color: var(--cyan); }

/* Layers */
.layers-head {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 0.7rem; color: var(--muted); margin-bottom: 0.35rem;
    text-transform: uppercase; letter-spacing: 0.1em;
}
.mini-btn {
    width: 20px; height: 20px; border-radius: 6px; line-height: 1;
    background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
    font-size: 0.85rem; display: grid; place-items: center;
}
.mini-btn:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); }
.mini-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.layers { display: flex; flex-direction: column-reverse; gap: 0.25rem; }
.layer-row {
    display: grid;
    grid-template-columns: 20px 1fr;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.3rem;
    border-radius: 7px;
    border: 1px solid transparent;
    background: var(--surface-2);
    font-size: 0.72rem;
    color: var(--muted);
    text-align: left;
}
.layer-row.sel { border-color: var(--cyan); color: var(--text); background: rgba(34, 211, 238, 0.12); }
.layer-row.hidden-layer .lname { opacity: 0.4; text-decoration: line-through; }
.layer-row .eye, .layer-row .eye svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.lname { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.size-dot { display: grid; place-items: center; }
.size-dot i { display: block; background: var(--text); border-radius: 50%; }
.tool.sel .size-dot i { background: var(--cyan); }

.write-box { max-width: 720px; margin: 0 auto; }
.guess-img {
    width: 100%; border-radius: 12px; border: 1px solid var(--line-strong);
    background: #fff; display: block; margin-bottom: 1rem;
}

.progress-line { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 0.6rem; }
.progress-line i { display: block; height: 100%; background: linear-gradient(90deg, var(--blue), var(--cyan)); width: 0; transition: width 0.3s ease; }

.waitwrap { text-align: center; padding: 3rem 1rem; }
.spinner {
    width: 46px; height: 46px; margin: 0 auto 1.2rem;
    border: 3px solid rgba(255, 255, 255, 0.12);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── presentation ───────────────────────────────────────────────────────── */
.slide {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    min-height: 50vh;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem;
}
.slide .who { font-size: 0.85rem; color: var(--muted); }
.slide .who b { color: var(--cyan); }
.slide-text {
    font-size: clamp(1.4rem, 3.4vw, 2.4rem);
    font-weight: 700;
    max-width: 22ch;
    line-height: 1.3;
}
.slide img.shot {
    max-width: min(100%, 760px);
    max-height: 62vh;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line-strong);
}
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; width: 100%; }
.gallery figure { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gallery img { width: 100%; display: block; background: #fff; }
.gallery figcaption { font-size: 0.8rem; color: var(--muted); padding: 0.45rem; }

.present-bar { display: flex; align-items: center; justify-content: center; gap: 0.6rem; margin-top: 1rem; flex-wrap: wrap; }
.heart-btn { font-size: 1.1rem; }
.abandon-btn { border-color: rgba(239, 68, 68, 0.4); color: #ffb4b4; }
.abandon-btn:hover { background: rgba(239, 68, 68, 0.14); }
.abandon-btn.voted {
    background: rgba(239, 68, 68, 0.2);
    border-color: var(--danger);
    color: #fff;
}
.heart-fly {
    position: fixed; pointer-events: none; font-size: 1.6rem; z-index: 200;
    animation: fly 1.1s ease-out forwards;
}
@keyframes fly { to { transform: translateY(-120px) scale(1.5); opacity: 0; } }

.board { display: flex; flex-direction: column; gap: 0.5rem; max-width: 520px; margin: 0 auto; }
.board .rowx {
    display: grid; grid-template-columns: 34px 34px 1fr auto; align-items: center; gap: 0.7rem;
    padding: 0.7rem 0.9rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
}
.board .rowx.top { border-color: rgba(34, 211, 238, 0.5); box-shadow: 0 0 20px rgba(34, 211, 238, 0.12); }
.board .rk { color: var(--muted); font-weight: 700; text-align: center; }
.board .sc { font-weight: 800; color: var(--cyan); }

/* ── toast ──────────────────────────────────────────────────────────────── */
#toast {
    position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
    background: #17171f; border: 1px solid var(--line-strong); border-radius: 10px;
    padding: 0.7rem 1.1rem; font-size: 0.9rem;
    opacity: 0; pointer-events: none; transition: opacity 0.25s, transform 0.25s; z-index: 300;
    max-width: min(92vw, 460px);
}
#toast.show { opacity: 1; transform: translateX(-50%); }
#toast.err { border-color: rgba(239, 68, 68, 0.6); color: #ffb4b4; }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 940px) {
    .home-grid, .lobby-grid { grid-template-columns: 1fr; }
    .home-grid { min-height: 0; padding-top: 1rem; }
}
@media (max-width: 720px) {
    .wrap { padding: 1rem 0.75rem 2.5rem; }
    .title { font-size: 2rem; }
    .canvas-shell { grid-template-columns: 1fr; }
    .tools { flex-direction: row; width: 100%; order: 2; flex-wrap: wrap; }
    .tool-group { flex: 1 1 auto; }
    .canvas-holder { order: 1; }
    .prompt-box .txt { font-size: 1.1rem; }
    .timer { font-size: 1.25rem; }
    .card { padding: 1.1rem; }
}
