:root{--bg:#46178f;--bg2:#2d0e63;--r:#e21b3c;--b:#1368ce;--y:#d89e00;--g:#26890c;--p:#7c3aed;--o:#e8590c}
*{box-sizing:border-box}body.kl{margin:0;min-height:100vh;font-family:"Montserrat","Trebuchet MS",system-ui,sans-serif;color:#fff;background:radial-gradient(circle at 20% 10%,#5b2aa8,var(--bg) 55%,var(--bg2));display:flex;flex-direction:column}
.kl .top{display:flex;align-items:center;gap:12px;padding:10px 16px}.kl .top img{height:34px;background:#fff;border-radius:8px;padding:3px 8px}.kl .top .sp{flex:1}.kl .top a,.kl .top button{color:#fff;background:#0003;border:0;border-radius:6px;padding:8px 12px;font:inherit;font-weight:700;text-decoration:none;cursor:pointer}
.kl main{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:16px;gap:16px;text-align:center}
.kl .panel{background:#fff;color:#222;border-radius:10px;padding:18px;width:min(92vw,380px);display:flex;flex-direction:column;gap:12px;box-shadow:0 4px 0 #0003}
.kl .panel h2{margin:0;font-size:1.1rem}.kl input,.kl select{font:inherit;font-weight:700;text-align:center;padding:13px;border:2px solid #ccc;border-radius:6px;width:100%;color:#222}
.kl .big{background:#333;color:#fff;border:0;border-radius:6px;padding:14px;font:inherit;font-weight:800;font-size:1.05rem;cursor:pointer;box-shadow:0 4px 0 #000a}.kl .big:disabled{opacity:.5}
.kl .err{color:#ffd7dc;min-height:1.3em;font-weight:700}.kl .panel .err{color:#b00020}
.kl .pinbox{background:#fff;color:#222;border-radius:10px;padding:10px 26px;box-shadow:0 4px 0 #0003}.kl .pinbox small{display:block;font-weight:700;color:#555}.kl .pinbox b{font-size:clamp(1.3rem,5vw,2.6rem);letter-spacing:.12em;word-break:break-all}
.kl .joinat{font-size:1.1rem;font-weight:700}.kl .joinat u{font-weight:800}
.kl .chips{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;max-width:900px}.kl .chip{background:#0004;border-radius:6px;padding:8px 14px;font-weight:800}
.kl .count{background:#0004;border-radius:30px;padding:6px 16px;font-weight:800}
.kl .qcard{background:#fff;color:#222;border-radius:8px;padding:16px 26px;font-weight:800;font-size:clamp(1.1rem,3.4vw,2rem);width:min(94vw,900px);box-shadow:0 4px 0 #0003}
.kl .timer{width:68px;height:68px;border-radius:50%;background:var(--p);display:grid;place-items:center;font-size:1.7rem;font-weight:800;box-shadow:0 3px 0 #0004}
.kl .tiles{display:grid;grid-template-columns:1fr 1fr;gap:10px;width:min(96vw,1100px)}
.kl .tile{position:relative;display:flex;align-items:center;gap:12px;min-height:84px;border:0;border-radius:6px;padding:12px 16px;color:#fff;font:inherit;font-weight:800;font-size:clamp(.95rem,2.6vw,1.5rem);text-align:left;cursor:pointer;box-shadow:inset 0 -5px 0 #0003;text-shadow:0 1px 2px #0004}
.kl .tile[data-i="0"]{background:var(--r)}.kl .tile[data-i="1"]{background:var(--b)}.kl .tile[data-i="2"]{background:var(--y)}.kl .tile[data-i="3"]{background:var(--g)}.kl .tile[data-i="4"]{background:var(--p)}.kl .tile[data-i="5"]{background:var(--o)}
.kl .tile svg{width:34px;height:34px;flex:none;fill:#fff}.kl .tile .t{flex:1}.kl .tile .mk{font-size:1.8rem}.kl .tile .n{background:#0004;border-radius:20px;padding:2px 12px}
.kl .tile.dim{opacity:.35}.kl .tile:disabled{cursor:default}
.kl .tiles.player{grid-template-columns:1fr 1fr;flex:1;align-content:stretch;grid-auto-rows:1fr;width:min(96vw,700px)}.kl .tiles.player .tile{justify-content:center;min-height:120px}.kl .tiles.player .tile .t{display:none}
.kl .bars{display:flex;gap:12px;align-items:flex-end;height:150px}.kl .bar{width:min(18vw,110px);display:flex;flex-direction:column;justify-content:flex-end;height:100%}.kl .bar i{display:block;border-radius:4px 4px 0 0;min-height:6px}.kl .bar span{background:#0004;font-weight:800;padding:3px;border-radius:0 0 4px 4px}
.kl .foot{display:flex;align-items:center;gap:12px;background:#111c;padding:10px 16px;font-weight:700}.kl .foot .sp{flex:1;text-align:center}
.kl .podium{display:flex;align-items:flex-end;gap:8px;height:260px}.kl .step{width:min(28vw,170px);border-radius:6px 6px 0 0;background:#1d0a45;padding:10px 4px;font-weight:800;display:flex;flex-direction:column;gap:6px;align-items:center}.kl .step em{font-style:normal;font-size:1.8rem;background:#d89e00;border-radius:8px 8px 18px 18px;width:44px}
.kl .step[data-p="1"]{height:100%}.kl .step[data-p="2"]{height:72%}.kl .step[data-p="3"]{height:52%}
.kl .rank{list-style:none;margin:0;padding:0;width:min(92vw,520px);display:flex;flex-direction:column;gap:6px}.kl .rank li{display:flex;justify-content:space-between;background:#0004;border-radius:6px;padding:10px 14px;font-weight:800}
.kl .feedback{font-size:clamp(1.4rem,5vw,2.4rem);font-weight:800;padding:14px 28px;border-radius:8px}.kl .feedback.ok{background:#26890c}.kl .feedback.no{background:#e21b3c}.kl .feedback.wait{background:#0004}
@media(max-width:560px){.kl .tiles{grid-template-columns:1fr}.kl .tiles.player{grid-template-columns:1fr 1fr}}
.kl .lockb{background:#0004;color:#fff;border:0;border-radius:6px;padding:8px 12px;font:inherit;font-weight:700;cursor:pointer}.kl button.chip{border:0;color:#fff;font:inherit;font-weight:800;cursor:pointer}.kl button.chip:hover{background:#e21b3c}
.kl .tablewrap{max-width:96vw;overflow:auto;background:#fff;color:#222;border-radius:8px}.kl .rt{border-collapse:collapse;min-width:360px}.kl .rt th,.kl .rt td{padding:10px 14px;border-bottom:1px solid #ddd;font-weight:700;text-align:center}.kl .rt th:first-child,.kl .rt td:first-child{text-align:left}.kl .rt td.ok{color:#26890c}.kl .rt td.no{color:#e21b3c}.kl .rt td.na{color:#999}
.kl .demo{background:#ffd54a;color:#222;border-radius:6px;padding:6px 10px;font-weight:800;font-size:.8rem}.kl a.dl{display:block;text-decoration:none;width:min(92vw,360px);text-align:center}
.kl .tile{transition:transform .08s}.kl .tile:active:not(:disabled){transform:scale(.97)}
.kl .feedback{animation:klpop .35s ease-out}.kl .bar i{transform-origin:bottom;animation:klgrow .6s ease-out}.kl .step{animation:klrise .6s ease-out backwards}.kl .step[data-p="2"]{animation-delay:.3s}.kl .step[data-p="1"]{animation-delay:.6s}
@keyframes klpop{0%{transform:scale(.6);opacity:0}70%{transform:scale(1.08)}100%{transform:scale(1);opacity:1}}@keyframes klgrow{from{transform:scaleY(0)}to{transform:scaleY(1)}}@keyframes klrise{from{transform:translateY(80px);opacity:0}to{transform:none;opacity:1}}
@media(prefers-reduced-motion:reduce){.kl *{animation:none!important;transition:none!important}}
.kl main.rev{gap:8px;justify-content:flex-start;padding-top:6px}.kl main.rev .qcard{padding:10px 20px;font-size:clamp(1rem,2.6vw,1.6rem)}.kl main.rev .bars{height:120px}.kl main.rev .bar{height:100%}.kl main.rev .tile{min-height:56px;padding:8px 14px}.kl main.rev .tiles{gap:8px}.kl main.rev .rank{flex-direction:row;width:min(96vw,900px)}.kl main.rev .rank li{flex:1;padding:8px 12px}.kl main.rev .big{padding:10px 24px}
.kl .ordp,.kl .ordl{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px;text-align:left}.kl .ordp li{display:flex;align-items:center;gap:8px;background:#f3eefb;border-radius:8px;padding:8px 10px;font-weight:800}.kl .ordp .n{background:var(--p);color:#fff;border-radius:50%;width:28px;height:28px;display:grid;place-items:center;flex:none}.kl .ordp .t{flex:1}.kl .ordp .mv{width:44px;height:44px;border:0;border-radius:8px;background:#333;color:#fff;font-size:1.3rem;font-weight:800;cursor:pointer}.kl .ordp .mv:disabled{opacity:.25}
.kl .ordl{width:min(92vw,520px)}.kl .ordl li{background:#0004;border-radius:6px;padding:10px 14px;font-weight:800;font-size:1.1rem}.kl ol.ordl{counter-reset:o}.kl .ordl li::before{counter-increment:o;content:counter(o)'. ';opacity:.8}
.kl .cloud{display:flex;flex-wrap:wrap;gap:6px 16px;justify-content:center;align-items:center;max-width:880px;min-height:120px;padding:10px}.kl .cw{font-weight:800;line-height:1.15;word-break:break-word}
.kl .cw{max-height:4.6em;overflow:hidden;max-width:100%}
.kl button.cw{background:none;border:0;color:inherit;font-family:inherit;cursor:pointer;padding:0}.kl button.cw:hover,.kl button.cw:focus-visible{text-decoration:line-through;outline:2px solid #fff6;outline-offset:2px}
.kl .modlist{display:flex;flex-direction:column;gap:8px}.kl .modrow{display:flex;align-items:center;gap:8px;background:#f3eefb;border-radius:8px;padding:8px 10px;font-weight:800}.kl .modrow span{flex:1;text-align:left;word-break:break-word}.kl .modrow .mv{width:auto;min-width:64px;padding:0 12px;height:44px;border:0;border-radius:8px;background:#333;color:#fff;font-weight:800;cursor:pointer}
.kl .panel #randname{background:#f3eefb;color:#3b1d8f;border:2px solid #7c3aed;border-radius:8px;min-height:44px;font-weight:800;font-family:inherit;cursor:pointer;width:100%}
.kl .panel[hidden],.kl [hidden]{display:none!important}
.kl .av{display:inline-flex;vertical-align:middle;flex:none}.kl .av svg{width:100%;height:100%}.kl .avrow{display:grid;grid-template-columns:repeat(8,1fr);gap:4px}.kl .avb{min-height:44px;border:2px solid transparent;border-radius:8px;background:#f3eefb;cursor:pointer;padding:2px;display:grid;place-items:center}.kl .avb[aria-pressed=true]{border-color:#7c3aed;background:#e4d7fb}@media(max-width:420px){.kl .avrow{grid-template-columns:repeat(4,1fr)}}.kl .chip .av{margin-right:2px}

.qrbox{display:flex;flex-direction:column;align-items:center;gap:6px;margin:8px 0;color:#fff}.qrbox img{background:#fff;border-radius:8px;image-rendering:pixelated}.qrbox small{font-size:13px}
/* Host experience and browser display controls */
.kl main{padding-bottom:76px}.kl .host-tools{position:fixed;right:12px;bottom:10px;display:flex;gap:4px;padding:5px;background:#190e34;border-radius:8px;z-index:40}.kl .host-tools button{background:transparent;color:#fff;border:0;border-radius:5px;padding:10px 12px;font:700 14px inherit;cursor:pointer;min-height:40px}
.kl .host-tools button:hover{background:#ffffff22}.kl .host-drawer{position:fixed;inset:0 0 0 auto;margin:0;padding:0;border:0;width:min(440px,100%);max-width:100%;height:100dvh;max-height:100dvh;background:#fff;color:#222;box-shadow:-8px 0 30px #0004;text-align:left}.kl dialog::backdrop{background:#0009}
.kl .drawer-head{display:flex;gap:10px;align-items:center;border-bottom:1px solid #ddd;padding:20px}.kl .drawer-head h2{font-size:24px;margin:0;flex:1}.kl .drawer-head button{font:700 14px inherit;min-height:40px;border:2px solid #1368ce;border-radius:6px;background:#fff;color:#222;cursor:pointer;padding:8px 12px}.kl .drawer-note{padding:4px 20px;font-size:14px;line-height:1.5;color:#555}
.kl .pref-row{padding:20px;border-bottom:1px solid #ddd;display:flex;gap:20px;align-items:flex-start;cursor:pointer}.kl .pref-row>span{flex:1}.kl .pref-row b,.kl .pref-row small{display:block}.kl .pref-row small{margin-top:6px;color:#555;line-height:1.4}.kl .pref-row input{width:24px;height:24px;accent-color:#26890c;flex:none;margin:0;padding:0}.kl .display-note{position:fixed;bottom:70px;right:12px;background:#fff;color:#222;border-radius:6px;max-width:320px;padding:8px;font-size:13px;z-index:41}.kl .display-note:empty{display:none}
.kl .host-setup{width:min(1100px,96vw);background:#241348;border-radius:16px;padding:30px;text-align:left;box-shadow:0 6px 0 #0003}.kl .host-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.4fr);gap:30px;align-items:center}.kl .host-info h2{font-size:clamp(28px,4vw,44px);margin:10px 0}.kl .host-info p{font-size:16px;line-height:1.5;margin:12px 0}.kl .host-tag{font-size:12px;letter-spacing:.08em;color:#e7dfff;font-weight:800}.kl .host-info p.host-caveat{font-size:13px;color:#e6def1}.kl .host-art{padding:24px;background:#6035a5;border:8px solid #a880e7;border-radius:12px;box-shadow:0 12px 0 #0004;transform:rotate(-2deg)}.kl .art-question{background:#fff;color:#3d0ba6;border-radius:5px;padding:20px;font-size:32px;text-align:center;font-weight:800}.kl .art-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin-top:12px}.kl .art-grid div{padding:14px;color:#fff;font-size:30px}.kl .art-grid div[data-i='0']{background:#e21b3c}.kl .art-grid div[data-i='1']{background:#1368ce}.kl .art-grid div[data-i='2']{background:#906700}.kl .art-grid div[data-i='3']{background:#26890c}
.kl .host-content{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-top:20px}.kl .host-content label{width:100%;font-size:14px;font-weight:800}.kl .host-content select{flex:1;min-width:160px;font-size:14px;text-align:left;background:#120b2e;color:#fff;border-color:#8a6eb0;padding:12px}.kl .host-content button{flex:none;background:#fff;color:#17142b}.kl .setup-options{margin-top:18px;border-top:1px solid #ffffff33;padding:14px 0}.kl .setup-options summary{font-weight:800;cursor:pointer}.kl .setup-options>label{display:block;font-size:14px;margin:14px 0 6px}.kl .setup-options input[type=number]{max-width:160px}.kl .setup-options label.joinat{font-size:14px;display:flex;gap:8px;align-items:center}.kl .setup-options input[type=checkbox]{width:20px;height:20px;flex:none}.kl .host-preview{color:#fff;font-size:14px}.kl .host-setup .err{margin-top:8px;font-size:14px}
.kl .qr-dialog{border:0;border-radius:12px;max-width:94vw;text-align:center;color:#222;padding:18px}.kl .qr-dialog img{display:block;margin:12px auto;width:min(300px,75vw);height:auto;image-rendering:pixelated}.kl .qr-dialog p{max-width:300px;font-weight:800}.kl .qrbox .lockb{font-size:13px;margin-top:4px}
.kl.bj-contrast{--r:#a60a26;--b:#064a9a;--y:#765600;--g:#155400;--p:#4b1e99;--o:#8d3300;background:#180b30}.kl.bj-contrast .tile{text-shadow:none;border:2px solid #fff}.kl button:focus-visible,.kl a:focus-visible,.kl summary:focus-visible,.kl input:focus-visible,.kl select:focus-visible{outline:3px solid #ffc53d;outline-offset:3px}
@media(max-width:700px){.kl .host-hero{grid-template-columns:1fr;gap:20px}.kl .host-setup{padding:20px}.kl .host-art{max-width:260px;margin:0 auto;width:100%;padding:12px;border-width:5px}.kl .art-question{padding:10px;font-size:22px}.kl .art-grid div{padding:8px;font-size:22px}.kl .host-info h2{font-size:30px}.kl .host-tools{right:8px;bottom:8px}.kl .foot{padding-bottom:64px}.kl .top{flex-wrap:wrap}.kl .top .demo{font-size:12px}}
.kl .host-tools button,.kl .drawer-head button{font-family:inherit;font-size:14px;font-weight:700}
.kl .lobby-join{display:flex;gap:40px;align-items:center;justify-content:center;background:#fff;color:#17142b;border-radius:14px;padding:20px 30px;box-shadow:0 5px 0 #0003;max-width:96vw}.kl .lobby-info{display:flex;flex-direction:column;align-items:flex-start;gap:12px;min-width:0}.kl .lobby-info .joinat{font-size:16px;max-width:100%;overflow-wrap:anywhere;text-align:left}.kl .lobby-info .pinbox{box-shadow:none;padding:4px 0}.kl .lobby-info .pinbox b{font-size:clamp(30px,5vw,54px)}.kl .lobby-info .host-preview{color:#3d0ba6;font-size:14px}.kl .lobby-info .lockb,.kl .lobby-qr .lockb{color:#3d0ba6;border-color:#3d0ba6;background:#f3eefb}.kl .lobby-qr .qrbox{color:#333;margin:0;max-width:190px}.kl .lobby-ready{display:flex;align-items:center;justify-content:space-between;gap:30px;min-width:min(520px,90vw)}.kl .lobby-ready .big{background:#fff;color:#222;min-width:140px}.kl .demo-notice{font-size:14px;background:#ffdf4e;color:#241348;border-radius:8px;padding:8px 12px;font-weight:800;max-width:900px}
@media(max-width:700px){.kl .lobby-join{flex-direction:column;gap:14px;width:100%;padding:16px}.kl .lobby-info{align-items:center}.kl .lobby-info .joinat{text-align:center}.kl .lobby-qr .qrbox img{width:116px;height:116px}.kl .lobby-ready{width:100%;min-width:0;gap:10px}.kl .lobby-ready .big{min-width:110px}}
@media(min-width:701px){.kl .foot{padding-right:240px}}
