@font-face {
    font-family:Rubik; src:url('../fonts/rubik/cyrillic.woff2') format('woff2');
    font-style:normal; font-weight:400 900; font-display:swap;
    unicode-range:U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
    font-family:Rubik; src:url('../fonts/rubik/latin.woff2') format('woff2');
    font-style:normal; font-weight:400 900; font-display:swap;
    unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;
}

.kd-page {
    --kd-blue:#1468ee;
    --kd-ink:#092c67;
    --kd-navy:#103676;
    --kd-yellow:#ffce30;
    --kd-cyan:#8de4ff;
    --kd-edge:#cbdcf1;
    --kd-green:#147943;
    --kg-text:var(--kd-ink);
    --kg-muted:#455d7c;
    --kg-accent:#1459bd;
    --kg-panel:#fff;
    --kg-raised:#edf5ff;
    --kg-border:var(--kd-edge);
    background:var(--kd-blue) url('../img/games/draw-pattern.svg') center top / 478px 332px repeat;
}
.kd-shell {
    width:min(100% - 48px,1176px);
    padding:24px 0 58px;
    color:var(--kd-ink);
    font-family:Rubik,Arial,sans-serif;
    color-scheme:light;
}
.kd-shell .kg-back { color:#fff; font-size:.88rem; font-weight:550; margin-bottom:18px; }
.kd-shell .kg-back:hover { text-decoration:underline; }
.kd-shell :focus-visible { outline:3px solid #0060cc; outline-offset:3px; }
.kd-shell .kg-back:focus-visible { outline-color:#fff; }
.kd-shell [hidden] { display:none !important; }
.kd-shell #kg-app > .kg-muted { color:white; }
.kd-shell .kg-status {
    background:#fff2df; color:#872b21; border:2px solid var(--kd-ink); border-radius:9px;
    padding:10px 14px; font-size:.9rem;
}
.kd-shell .kg-status[data-kind=success] { color:var(--kd-green); background:#e5faee; }
.kd-shell .kg-status:empty { display:none; }
.kd-shell .kg-game-head { color:#fff; }
.kd-shell .kg-game-head p { color:#e4efff; }
.kd-shell :is(button,summary) { -webkit-tap-highlight-color:transparent; }
.kd-shell .kg-btn {
    min-height:40px; gap:7px; border:1px solid #b8cce6; border-radius:8px;
    padding:8px 13px; background:#edf5ff; color:var(--kd-ink); font-size:.85rem; font-weight:650;
    transition:background-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.kd-shell .kg-btn:not(:disabled):hover { background:#dbeeff; transform:translateY(-1px); }
.kd-shell .kg-btn:not(:disabled):active { transform:translateY(2px) scale(.98); }
.kd-shell .kg-btn:disabled { opacity:.56; }
.kd-shell .kg-primary,.kd-shell .kd-cyan {
    border:2px solid var(--kd-ink); background:var(--kd-yellow); box-shadow:0 3px 0 var(--kd-ink);
    font-weight:800;
}
.kd-shell .kg-primary:not(:disabled):hover { background:#ffdb64; }
.kd-shell .kd-cyan { background:var(--kd-cyan); }
.kd-shell .kd-cyan:not(:disabled):hover { background:#bbf1ff; }
.kd-shell .kg-primary:not(:disabled):active,.kd-shell .kd-cyan:not(:disabled):active { box-shadow:0 1px 0 var(--kd-ink); }
.kd-shell :is(input:not([type=checkbox]):not([type=range]):not([type=color]),textarea,select) {
    border:1px solid #b7cde8; border-radius:8px; background:#f5f9ff; color:var(--kd-ink); min-height:42px;
}
.kd-shell .kg-field { color:var(--kd-ink); font-size:.8rem; font-weight:650; }
.kd-shell .kg-check { font-size:.88rem; }
.kd-shell input:is([type=range],[type=checkbox]) { accent-color:#2374eb; }
.kd-icon,.kd-marker,.kd-phase-icon {
    display:inline-block; width:20px; height:20px; flex:none;
    fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round;
}
.kd-surface,.kd-disclosure,.kd-score-deck .kg-panel {
    padding:15px 16px; border:2px solid var(--kd-ink); border-radius:12px; background:#fff;
}
.kd-surface h2,.kd-score-deck h2,.kd-chat h2,.kd-players h2 {
    display:flex; align-items:center; gap:7px; font-size:1.03rem; font-weight:800;
}
.kd-surface,.kd-score-deck,.kd-room-deck { display:grid; align-content:start; gap:11px; }
.kd-disclosure summary {
    color:var(--kd-ink); font-weight:740; cursor:pointer; line-height:1.4;
}
.kd-disclosure summary .kd-icon { vertical-align:middle; margin-right:6px; }
.kd-settings { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; }
.kd-rules { margin:0; padding-inline-start:20px; color:var(--kg-muted); font-size:.87rem; line-height:1.55; }
.kd-rules li+li { margin-top:6px; }
.kd-demo { display:grid; gap:5px; max-width:220px; margin:8px 0 0; }
.kd-demo .kg-draw { border:1px solid var(--kd-edge); background:#fff; touch-action:auto; }
.kd-demo figcaption { color:var(--kg-muted); font-size:.76rem; }

.kd-lobby { max-width:976px; margin:0 auto; }
.kd-lobby-hero {
    display:grid; grid-template-columns:minmax(0,1.08fr) minmax(0,1fr);
    align-items:center; gap:18px; margin:2px 0 25px;
}
.kd-lobby-copy { display:grid; justify-items:start; gap:10px; min-width:0; }
.kd-shell .kd-title {
    display:flex; align-items:baseline; flex-wrap:wrap; column-gap:.16em;
    color:#fff; font-size:clamp(2.7rem,6vw,5rem); font-weight:900; line-height:1.06;
    letter-spacing:-.045em; paint-order:stroke fill; -webkit-text-stroke:4px var(--kd-ink);
    text-shadow:0 5px 0 #0c3d98;
}
.kd-title .kd-title-amp { color:#ffda50; font-size:.86em; }
.kd-tagline { color:#fff; font-size:clamp(.95rem,2vw,1.12rem); font-weight:620; }
.kd-mascot { display:block; width:100%; height:auto; max-height:370px; object-fit:contain; }
.kd-play-form {
    width:min(100%,430px); margin-top:9px; display:grid; gap:13px;
    padding:17px; border:2px solid var(--kd-ink); border-radius:14px; background:#fff;
    box-shadow:0 5px 0 #103b88;
}
.kd-identity { display:grid; grid-template-columns:minmax(0,1.25fr) minmax(0,1fr); gap:10px; }
.kd-play-form > .kg-actions { display:grid; grid-template-columns:1.25fr 1fr; gap:10px; }
.kd-play-form > .kg-actions > .kg-btn { min-height:49px; font-size:.97rem; }
.kd-lobby-columns { display:grid; grid-template-columns:minmax(0,1.55fr) minmax(0,1fr); gap:16px; }
.kd-quick-actions { display:flex; flex-wrap:wrap; gap:8px; align-items:flex-start; }
.kd-quick-actions > details { flex:1 1 180px; }
.kd-quick-actions > details[open] { flex-basis:100%; }
.kd-quick-actions > details[open] + details { flex-grow:0; }
.kd-open { scroll-margin-top:76px; min-height:108px; }
.kd-open-rooms .kg-row { padding:7px 0; }
.kd-room-preview { min-width:0; overflow-wrap:anywhere; }
.kd-room-preview p,.kd-open-rooms > li > .kg-muted { font-size:.86rem; }
.kd-stats { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:11px; margin:0; }
.kd-stats div { display:flex; flex-direction:column-reverse; gap:3px; padding:8px 6px; background:#edf6ff; border-radius:8px; }
.kd-stats dt { color:var(--kg-muted); font-size:.73rem; }
.kd-stats dd { margin:0; font-size:1.15rem; font-weight:800; font-variant-numeric:tabular-nums; }

.kd-room-head {
    display:flex; justify-content:space-between; align-items:center; gap:12px 22px;
    margin:0 0 13px; padding:10px 13px; color:#fff;
    background:var(--kd-ink); border:2px solid #072452; border-radius:12px;
}
.kd-room-title { min-width:0; }
.kd-room-title h1 { color:#fff; font-size:1.16rem; font-weight:780; overflow-wrap:anywhere; }
.kd-phase { color:#c4defc; font-size:.74rem; }
.kd-room-actions { display:flex; flex-wrap:wrap; align-items:center; gap:7px; }
.kd-room-actions .kg-btn {
    min-height:34px; padding:5px 10px; background:#1a4383; border-color:#4771a9; color:#fff;
}
.kd-room-actions .kg-btn:not(:disabled):hover { background:#2860a9; }
.kd-room-actions .kg-btn:focus-visible { outline-color:#fff; }
.kd-room-actions .kd-icon { width:16px; height:16px; }
.kd-table { display:grid; grid-template-columns:218px minmax(0,1fr); gap:13px; align-items:start; }
.kd-main { min-width:0; }
.kd-players,.kd-workspace,.kd-chat { border:2px solid var(--kd-ink); border-radius:12px; background:#fff; }
.kd-players { min-height:260px; overflow:hidden; }
.kd-player-head {
    min-height:48px; display:flex; justify-content:space-between; align-items:center; gap:7px;
    padding:8px 10px; background:#dcefff; border-bottom:1px solid #b6d2ef;
}
.kd-player-count { font-size:.76rem; font-weight:700; color:#33547d; }
.kd-roster { margin:0; padding:4px 6px; list-style:none; max-height:min(64vh,542px); overflow:auto; scrollbar-color:#a3c0e2 transparent; }
.kd-player {
    position:relative; display:grid; grid-template-columns:14px 38px minmax(0,1fr) auto auto;
    gap:5px; align-items:center; min-height:58px; padding:5px 3px; border-bottom:1px solid #e4edf8;
}
.kd-player:last-child { border-bottom:0; }
.kd-player[data-artist=true] { background:#fff0b5; border-radius:8px; }
.kd-player[data-correct=true] { background:#e3f8eb; border-radius:8px; }
.kd-rank { text-align:center; color:#4a6485; font-size:.74rem; font-weight:740; }
.kd-portrait { position:relative; display:block; }
.kd-avatar {
    width:38px; height:38px; display:block; border-radius:50%; object-fit:cover;
    overflow:hidden; border:1px solid #1d4d87; background:#d9efff; flex:none;
}
.kd-avatar use { overflow:hidden; }
.kd-marker {
    position:absolute; bottom:-2px; right:-2px; width:17px; height:17px; padding:2px;
    border-radius:50%; background:#ffcf30; color:var(--kd-ink); border:1px solid #fff;
}
.kd-marker-check { background:#187d48; color:#fff; }
.kd-player-name { display:grid; gap:3px; min-width:0; line-height:1.16; overflow-wrap:anywhere; font-size:.82rem; }
.kd-profile { color:var(--kd-ink); font-weight:750; }
.kd-player-name small { color:#3f5d80; font-size:.66rem; }
.kd-online { display:inline-block; width:6px; height:6px; border-radius:50%; margin-right:4px; background:#23a760; vertical-align:1px; }
.kd-player[data-online=false] .kd-online { background:#96a5b9; }
.kd-points { font-size:.92rem; font-weight:830; font-variant-numeric:tabular-nums; }
.kd-player-menu { position:static; }
.kd-player-menu summary { display:grid; place-items:center; width:23px; height:28px; border-radius:5px; color:var(--kd-ink); }
.kd-player-menu summary::-webkit-details-marker { display:none; }
.kd-player-menu summary .kd-icon { width:16px; }
.kd-player-menu[open] { grid-column:2/-1; }
.kd-player-menu[open] > summary { margin-bottom:4px; }
.kd-player-menu .kg-btn { min-height:30px; padding:4px 6px; font-size:.72rem; }
.kd-departing { pointer-events:none; }

.kd-workspace { min-width:0; position:relative; overflow:hidden; }
.kd-turnbar { display:flex; align-items:center; gap:12px; min-height:63px; padding:7px 13px; background:#edf7ff; }
.kd-stage { display:grid; align-content:center; gap:8px; flex:1; min-width:0; }
.kd-round-line { display:flex; align-items:center; flex-wrap:wrap; gap:4px 9px; }
.kd-round,.kd-round-line p { color:#375982; font-size:.75rem; font-weight:650; }
.kd-round { white-space:nowrap; }
.kd-round-line p::before { content:'·'; margin-right:8px; }
.kd-word { display:block; font-size:1.24rem; font-weight:800; line-height:1.1; white-space:pre-wrap; overflow-wrap:anywhere; }
.kd-room[data-phase=draw] .kd-stage { display:flex; flex-wrap:wrap; align-items:center; column-gap:14px; }
.kd-turn-copy { flex:1; min-width:0; }
.kd-turn-copy .kd-word { margin-top:4px; }
.kd-stage .kd-hint-note { flex-basis:100%; color:var(--kg-muted); font-size:.78rem; }
.kd-count {
    display:flex; align-items:center; gap:5px; flex:none; min-height:35px; padding:3px 8px;
    color:var(--kd-ink); background:#fff; border:1px solid #a9c7e8; border-radius:8px;
}
.kd-count .kd-icon { width:17px; height:17px; }
.kd-clock { font-size:.98rem; font-weight:820; font-variant-numeric:tabular-nums; white-space:nowrap; }
.kd-clock[data-urgent=true] { color:#a83725; }
.kd-time-track {
    position:relative; height:9px; overflow:hidden; background:var(--kd-ink);
    border-top:1px solid var(--kd-ink);
}
.kd-time-fill { position:absolute; inset:0; display:block; transform-origin:left; background:var(--kd-yellow); transition:transform .82s linear; }
.kd-time-track[data-urgent=true] .kd-time-fill { background:#ff9856; }
.kd-progress { position:absolute; width:1px; height:1px; opacity:0; pointer-events:none; }

.kd-board { display:grid; grid-template-columns:minmax(0,1fr); grid-template-areas:"paper"; }
.kd-board[data-artist=true] { grid-template-columns:100px minmax(0,1fr); grid-template-areas:"tools paper"; }
.kd-paper { grid-area:paper; position:relative; overflow:hidden; background:#fff; align-self:center; }
.kd-paper .kg-draw { background:#fff; border-radius:0; max-width:none; }
.kd-paper .kg-draw:not([data-drawing]) { touch-action:auto; }
.kd-shape-preview { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; }
.kd-brush-cursor { position:absolute; pointer-events:none; border:1px solid #132959; background:#ffffff24; border-radius:50%; transform:translate(-50%,-50%); }
.kd-tools {
    grid-area:tools; display:grid; align-content:start; gap:9px; padding:8px 6px;
    background:#123571; color:#fff; border-right:2px solid var(--kd-ink);
}
.kd-tool-grid,.kd-tool-history { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:4px; }
.kd-tools .kg-btn {
    min-height:37px; min-width:0; padding:3px; background:#204a8b; color:#fff; border-color:#577fba;
}
.kd-tools .kg-btn:not(:disabled):hover { background:#3264aa; }
.kd-tools .kg-btn[aria-pressed=true],.kd-tools .kg-btn[aria-pressed=true]:not(:disabled):hover {
    color:var(--kd-ink); background:var(--kd-yellow); border-color:#ffdb69;
}
.kd-tools :focus-visible { outline-color:#ffe36c; }
.kd-swatches { display:grid; gap:6px; }
.kd-palette { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:3px; }
.kd-palette .kg-color {
    width:100%; height:auto; aspect-ratio:1; border:1px solid #ffffff85; border-radius:4px;
    transition:transform .14s ease,outline-color .14s ease;
}
.kd-palette .kg-color:hover { transform:scale(1.13); z-index:1; }
.kd-palette .kg-color[aria-pressed=true] { outline:2px solid #ffde50; outline-offset:1px; z-index:1; }
.kd-custom {
    position:relative; display:flex; align-items:center; justify-content:space-between;
    gap:6px; padding:4px 6px; min-height:33px; border:1px solid #547bb5; border-radius:6px; cursor:pointer;
}
.kd-custom .kd-icon { width:16px; height:16px; }
.kd-custom::after { content:''; width:20px; height:17px; border:1px solid #fff; border-radius:4px; background:var(--custom-color); }
.kd-custom input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.kd-custom:focus-within { outline:2px solid #ffde50; }
.kd-size { display:flex; align-items:center; gap:4px; min-height:28px; }
.kd-size-dot { display:grid; place-items:center; width:24px; flex:none; }
.kd-size-dot::after { content:''; width:var(--dot-size); height:var(--dot-size); border-radius:50%; background:#fff; }
.kd-size input { min-width:0; width:100%; margin:0; accent-color:#ffd548; }
.kd-tool-history { padding-top:6px; border-top:1px solid #5273a7; }

.kd-chat { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,.47fr); margin-top:11px; }
.kd-chat :is(.kd-guessing,.kd-activity) { display:grid; gap:7px; padding:9px 11px; align-content:start; min-width:0; }
.kd-activity { border-left:1px solid #d4e3f5; }
.kd-chat h2 { min-height:21px; }
.kd-chat h2 .kd-icon { width:17px; height:17px; }
.kd-chat .kg-feed {
    height:75px; min-height:0; padding:0 7px; background:#f0f6fe; border-radius:6px;
    font-size:.79rem; scrollbar-color:#a3c0e2 transparent;
}
.kd-chat .kg-feed p { padding:4px 0; border-color:#d8e6f6; }
.kd-chat .kg-feed strong { color:var(--kd-ink); }
.kd-chat .kg-feed .kd-correct,.kd-chat .kg-feed .kd-correct strong,.kd-gain,.kd-award { color:var(--kd-green); }
.kd-answer-marker { width:13px; height:13px; margin-right:4px; vertical-align:-2px; }
.kd-incorrect .kd-answer-marker { color:#ae443b; }
.kd-gain { display:inline-block; margin-left:6px; font-weight:850; }
.kd-activity-entry { display:flex; align-items:center; gap:5px; color:#225eaa; }
.kd-activity-entry .kd-icon { width:13px; height:13px; }
.kd-guess { grid-row:2; }
.kd-guess .kg-inline { flex-wrap:nowrap; align-items:end; gap:5px; }
.kd-guess .kg-inline .kg-field { flex:1 1 auto; }
.kd-guess .kg-inline .kg-field > span { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
.kd-guess .kg-inline .kg-btn { min-height:42px; box-shadow:none; }
.kd-guess .kg-muted,.kd-award { font-size:.79rem; }
.kd-activity > .kg-btn { justify-self:end; min-height:30px; padding:4px 8px; font-size:.73rem; }

.kd-room:is([data-phase=waiting],[data-phase=countdown],[data-phase=pick],[data-phase=reveal],[data-phase=finished],[data-phase=closed]) .kd-board { display:none; }
.kd-room:is([data-phase=waiting],[data-phase=countdown],[data-phase=pick],[data-phase=reveal],[data-phase=finished],[data-phase=closed]) .kd-turnbar {
    align-items:flex-start; min-height:256px; padding:19px; background:#fff;
}
.kd-room:is([data-phase=pick],[data-phase=reveal],[data-phase=finished]) .kd-turnbar { min-height:300px; position:relative; align-items:center; }
.kd-room:is([data-phase=pick],[data-phase=reveal],[data-phase=finished]) .kd-count { position:absolute; top:10px; right:11px; }
.kd-room[data-phase=waiting] .kd-player { min-height:64px; }
.kd-room[data-phase=waiting] .kd-avatar { width:42px; height:42px; }
.kd-room[data-phase=waiting] .kd-player { grid-template-columns:12px 42px minmax(0,1fr) auto auto; }
.kd-wait-heading { display:flex; align-items:center; gap:8px; }
.kd-wait-heading .kd-icon { width:24px; height:24px; color:#2370de; }
.kd-room-summary { display:grid; gap:11px; }
.kd-code-box {
    display:flex; align-items:center; justify-content:space-between; gap:10px;
    padding:8px 10px; border:1px dashed #84addc; border-radius:8px; background:#edf7ff;
}
.kd-code-box > div { display:grid; gap:3px; min-width:0; }
.kd-code-box span { font-size:.75rem; color:var(--kg-muted); }
.kd-code { font-size:.84rem; font-weight:700; color:var(--kd-ink); overflow-wrap:anywhere; }
.kd-code-box button { min-width:42px; }
.kd-room[data-phase=waiting] .kd-stage > .kg-actions { margin-block:5px; }
.kd-word-screen,.kd-result-stage { display:grid; justify-items:center; gap:8px; text-align:center; position:relative; }
.kd-word-screen > h2,.kd-result-stage > h2 { font-size:clamp(1.5rem,3.1vw,2.25rem); font-weight:900; line-height:1.05; }
.kd-word-screen > h2 { color:#ffd447; -webkit-text-stroke:2px var(--kd-ink); paint-order:stroke fill; text-shadow:0 2px 0 var(--kd-ink); }
.kd-phase-icon {
    width:41px; height:41px; padding:7px; border:2px solid var(--kd-ink); border-radius:11px; background:#ffe27b; color:var(--kd-ink);
}
.kd-word-screen > p,.kd-result-stage > p { font-size:.87rem; }
.kd-word-options {
    width:min(100%,550px); display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin-top:9px;
}
.kd-shell .kd-word-options > .kg-btn {
    display:grid; align-content:center; min-height:70px; border:2px solid var(--kd-ink); box-shadow:0 3px 0 var(--kd-ink);
    background:#d9f8e7; overflow-wrap:anywhere; font-weight:800; font-size:.96rem;
}
.kd-shell .kd-word-options > .kg-btn[data-level=normal] { background:#def3ff; }
.kd-shell .kd-word-options > .kg-btn[data-level=hard] { background:#ffe0c5; }
.kd-shell .kd-word-options > .kg-btn:hover,.kd-shell .kd-word-options > .kg-btn[data-busy] { background:#ffe070; }
.kd-word-options small { color:#39577b; font-size:.72rem; font-weight:600; }
.kd-result-stage .kd-word { font-size:2.1rem; color:#1c68c9; }
.kd-result-stage .kg-actions { justify-content:center; }
.kd-podium { display:flex; align-items:end; justify-content:center; gap:7px; width:min(100%,380px); padding:0; margin:11px 0 5px; list-style:none; }
.kd-podium-place { position:relative; display:grid; justify-items:center; gap:3px; flex:1; min-width:0; }
.kd-podium-place strong { max-width:100%; font-size:.85rem; overflow-wrap:anywhere; }
.kd-podium-place:first-child { order:2; }
.kd-podium-place:nth-child(2) { order:1; }
.kd-podium-place:nth-child(3) { order:3; }
.kd-podium-place > .kd-icon { color:#9b6204; }
.kd-podium-place > .kd-avatar { width:48px; height:48px; }
.kd-podium-score { color:#2761a7; font-weight:780; font-variant-numeric:tabular-nums; }
.kd-podium-step {
    display:grid; align-content:start; justify-content:center; width:100%; min-height:33px; padding-top:5px;
    background:#d7eaff; border:2px solid var(--kd-ink); border-radius:7px 7px 3px 3px; font-weight:850;
}
.kd-podium-place:first-child .kd-podium-step { min-height:55px; background:#ffd444; }
.kd-podium-place:nth-child(3) .kd-podium-step { min-height:24px; background:#ffe0c5; }
.kd-victory { position:absolute; inset:0; pointer-events:none; }
.kd-victory i {
    position:absolute; left:50%; top:42%; width:7px; height:6px; border-radius:1px;
    background:#2788ff; animation:kd-burst .7s ease-out both;
}
.kd-victory i:nth-child(3n) { background:#ffc327; }
.kd-victory i:nth-child(3n + 1) { background:#ed7154; }

@media(prefers-reduced-motion:no-preference) {
    .kd-mascot { animation:kd-enter .35s ease-out both; }
    .kd-word-screen > h2,.kd-result-stage > h2 { animation:kd-enter .28s ease-out both; }
    .kd-word-options > .kg-btn { animation:kd-enter .28s calc(35ms * var(--word-index)) ease-out backwards; }
    .kd-podium-place { animation:kd-enter .32s calc(50ms * var(--place)) ease-out both; }
    .kd-reveal .kd-word { animation:kd-pop .34s ease-out both; }
    .kd-pop { animation:kd-pop .25s ease-out both; }
    .kd-new-correct { animation:kd-confirm .5s ease-out both; }
    .kd-new-correct .kd-gain { animation:kd-rise .55s ease-out both; }
    .kd-departing { animation:kd-leave .22s ease-in both; }
    .kd-clock[data-urgent=true] { animation:kd-urgent 1s ease-in-out 10 alternate; }
}
@keyframes kd-enter { from { opacity:.55; transform:translateY(9px); } to { opacity:1; transform:none; } }
@keyframes kd-pop { from { opacity:.6; transform:scale(.74); } 72% { transform:scale(1.1); } to { opacity:1; transform:none; } }
@keyframes kd-leave { to { opacity:0; transform:translateX(-10px); } }
@keyframes kd-confirm { from { background:#bdeed0; } to { background:transparent; } }
@keyframes kd-rise { from { opacity:.3; transform:translateY(8px); } to { opacity:1; transform:none; } }
@keyframes kd-urgent { from { opacity:.76; } to { opacity:1; } }
@keyframes kd-burst { from { opacity:1; transform:scale(.6); } to { opacity:0; transform:translate(var(--dx),var(--dy)) rotate(80deg); } }

@media(min-width:901px) {
    .kd-board[data-artist=true] { grid-template-columns:112px minmax(0,1fr); }
    .kd-tool-grid,.kd-tool-history { grid-template-columns:repeat(3,minmax(0,1fr)); }
    .kd-workspace .kd-paper .kg-draw {
        width:min(100%,max(500px,calc((100svh - 402px) * 1.613)));
        margin-inline:auto;
    }
    .kd-shape-preview { left:50%; width:min(100%,max(500px,calc((100svh - 402px) * 1.613))); transform:translateX(-50%); }
    .kd-roster { min-height:300px; }
}
@media(max-width:900px) {
    .kd-table { grid-template-columns:185px minmax(0,1fr); gap:9px; }
    .kd-board[data-artist=true] { grid-template-columns:84px minmax(0,1fr); }
    .kd-tools .kg-btn { min-height:34px; }
    .kd-tool-grid .kd-icon,.kd-tool-history .kd-icon { width:17px; height:17px; }
    .kd-player { grid-template-columns:12px 32px minmax(0,1fr) auto auto; }
    .kd-avatar { width:32px; height:32px; }
    .kd-room-actions .kg-btn { font-size:.74rem; }
}
@media(max-width:680px) {
    .kd-shell { width:calc(100% - 22px); padding:15px 0 42px; }
    .kd-shell .kg-back { margin-bottom:12px; }
    .kd-lobby-hero { grid-template-columns:minmax(0,1fr) 130px; gap:5px; position:relative; margin-bottom:16px; }
    .kd-lobby-copy { display:contents; }
    .kd-shell .kd-title { align-self:center; font-size:clamp(2.65rem,9vw,3.5rem); -webkit-text-stroke-width:3px; padding-block:2px; }
    .kd-mascot { grid-column:2; grid-row:1; width:100%; }
    .kd-tagline { grid-column:1/-1; margin:2px 0 4px !important; font-size:.92rem; }
    .kd-play-form { grid-column:1/-1; width:100%; margin:0; padding:11px; }
    .kd-play-form > .kg-actions > .kg-btn { min-height:43px; font-size:.85rem; }
    .kd-lobby-columns { grid-template-columns:1fr; gap:10px; }
    .kd-quick-actions > details { flex-basis:125px; }
    .kd-settings { grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
    .kd-room-head { flex-wrap:wrap; gap:7px; padding:8px; }
    .kd-room-actions { gap:4px; }
    .kd-room-actions .kg-btn { padding:4px 7px; min-height:30px; font-size:.7rem; }
    .kd-room-actions .kd-icon { width:12px; height:12px; }
    .kd-table { display:flex; flex-direction:column-reverse; }
    .kd-main,.kd-players { width:100%; min-height:0; }
    .kd-room[data-phase=waiting] .kd-table { flex-direction:column; }
    .kd-roster { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,155px),1fr)); max-height:240px; gap:3px; }
    .kd-player,.kd-room[data-phase=waiting] .kd-player { min-height:49px; grid-template-columns:12px 30px minmax(0,1fr) auto auto; }
    .kd-avatar,.kd-room[data-phase=waiting] .kd-avatar { width:30px; height:30px; }
    .kd-turnbar { min-height:57px; padding:6px 8px; gap:5px; }
    .kd-room:is([data-phase=pick],[data-phase=reveal],[data-phase=finished]) .kd-turnbar { min-height:245px; padding:15px 10px; }
    .kd-room:is([data-phase=pick],[data-phase=reveal],[data-phase=finished]) .kd-count { top:5px; right:5px; }
    .kd-count { min-height:29px; padding:2px 5px; }
    .kd-clock { font-size:.82rem; }
    .kd-board[data-artist=true] { grid-template-columns:minmax(0,1fr); grid-template-areas:"paper" "tools"; }
    .kd-tools { border-right:0; border-top:1px solid #416eab; gap:6px; padding:7px; grid-template-columns:minmax(0,1fr) 58px; }
    .kd-tool-grid { grid-template-columns:repeat(7,minmax(0,1fr)); grid-column:1/-1; }
    .kd-tools .kg-btn { min-height:36px; }
    .kd-swatches { grid-column:1/-1; grid-template-columns:minmax(0,1fr) 45px; align-items:center; gap:5px; }
    .kd-palette { grid-template-columns:repeat(12,minmax(0,1fr)); }
    .kd-palette .kg-color { min-height:22px; }
    .kd-custom { padding:3px 4px; }
    .kd-tool-history { grid-row:3; grid-template-columns:repeat(3,36px); border:0; padding:0; }
    .kd-size { grid-row:3; grid-column:2; }
    .kd-chat { margin-top:8px; grid-template-columns:minmax(0,1fr); }
    .kd-chat .kd-activity { border-left:0; border-top:1px solid var(--kd-edge); grid-template-columns:minmax(0,1fr) auto; }
    .kd-activity .kg-feed { grid-row:2; grid-column:1/-1; height:48px; }
    .kd-activity h2 { grid-row:1; grid-column:1; }
    .kd-activity > .kg-btn { grid-row:1; grid-column:2; }
    .kd-chat .kd-chat-log { height:60px; }
    .kd-guess { grid-row:2; }
    .kd-word-options { gap:5px; }
    .kd-shell .kd-word-options > .kg-btn { min-height:60px; font-size:.78rem; padding:4px; }
    .kd-word-options small { font-size:.61rem; }
}
@media(max-width:370px) {
    .kd-lobby-hero { grid-template-columns:minmax(0,1fr) 100px; }
    .kd-stats { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
