:root{color-scheme:dark;--bg:#151619;--panel:#202126;--line:#37383f;--muted:#9697a1;--text:#ece9e3;--accent:#f2946c;--purple:#ab9cd0;font-family:'DM Sans',sans-serif;font-size:16px}
*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);overflow:hidden}button,textarea,select,input{font:inherit}button{color:inherit;cursor:pointer}button:disabled{opacity:.5;cursor:not-allowed}button:focus-visible,select:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:4px}svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}.svg-defs{position:absolute;width:0;height:0;overflow:hidden}h1,h2,h3,p{margin:0}
.playground{position:relative;width:100vw;height:100vh;height:100dvh;overflow:hidden;background:radial-gradient(ellipse at 50% 65%,#313137 0%,#23242a 38%,#18191d 76%,#151619 100%)}.playground:before{content:'';position:absolute;inset:0;pointer-events:none;opacity:.13;background-image:url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.92' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' opacity='.24' filter='url(%23n)'/%3E%3C/svg%3E");z-index:1}#scene{position:absolute;inset:0}#scene canvas{display:block;width:100%;height:100%;touch-action:manipulation}
.hud-header{position:absolute;top:0;left:0;right:0;z-index:3;display:flex;align-items:center;justify-content:space-between;padding:28px 38px;pointer-events:none}.brand{display:flex;align-items:center;gap:10px;font-family:'Space Grotesk',sans-serif;font-weight:700;font-size:26px;letter-spacing:-1.2px}.brand>span:last-child{color:var(--accent);margin-left:-10px}.brand-mark{display:grid;place-items:center;width:34px;height:31px;border-radius:8px;background:var(--accent);color:#272124;transform:rotate(-7deg)}.brand-mark svg{width:23px}.wallet{pointer-events:auto;display:flex;align-items:center;gap:9px;border:1px solid #494139;border-radius:9px;background:#2c2824c9;padding:11px 14px;color:#e6c29a;backdrop-filter:blur(12px)}.wallet:hover{background:#46372d;border-color:#9d7052}.coin{width:19px;height:19px;display:grid;place-items:center;border:1px solid #c39b65;border-radius:50%;font-family:'Space Grotesk',sans-serif;font-size:10px;font-weight:700;color:#ecc991;background:#493b29}.wallet strong{font-size:14px}.wallet-label{color:#ab9e8e;font-size:12px}.wallet i{height:17px;width:1px;background:#574737;margin:0 5px}.wallet svg{width:16px;color:#baad9a}
.typing-hud{position:absolute;top:clamp(105px,13vh,165px);left:50%;transform:translateX(-50%);width:min(720px,76vw);z-index:2}.race-info{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px;gap:12px}.race-state{color:#c59f89;font-size:10px;font-weight:600;letter-spacing:2.3px}.live-stats{display:flex;align-items:center;gap:19px;font-family:'Space Grotesk',sans-serif;color:#82818c;font-size:12px;font-variant-numeric:tabular-nums}.live-stats strong{font-weight:500;color:#c2bec6}.typing-area{position:relative}.typing-area:focus-within #passage{color:#8d8c99}#passage{font-family:'SFMono-Regular',Consolas,'Liberation Mono',monospace;font-size:clamp(16px,1.65vw,23px);line-height:1.65;letter-spacing:.15px;color:#737480;overflow-wrap:break-word;--passage-lines:3;overflow:hidden;height:calc(var(--passage-lines) * 1lh);text-wrap:wrap;overflow-anchor:none}.char.correct{color:#e9e6df}.char.incorrect{background:#67353e80;color:#ff8b97;border-radius:2px}.char.current{position:relative}.char.current:before{content:'';position:absolute;left:-2px;top:1px;bottom:0;width:2px;border-radius:1px;background:var(--accent);box-shadow:0 0 10px #ef9b6c55;animation:blink 1s step-end infinite}#typing-input{position:absolute;inset:0;width:100%;height:100%;opacity:.01;color:transparent;background:transparent;caret-color:transparent;border:0;resize:none;padding:0;z-index:2;cursor:text}#typing-input:disabled{pointer-events:none}.race-progress{display:flex;gap:24px;margin-top:18px}.progress-row{display:flex;gap:9px;align-items:center;flex:1;font-family:'Space Grotesk',sans-serif;font-size:10px;color:#8e8b98}.progress-row>span:first-child{width:23px}.progress-row>span:last-child{width:30px;text-align:right;font-variant-numeric:tabular-nums}.track-lane{height:3px;border-radius:3px;background:#44444c;flex:1;overflow:hidden}.track-lane>div{height:100%;width:0;transition:width .12s linear;border-radius:3px}.player-fill{background:var(--accent)}.bot-fill{background:var(--purple)}.typing-hint{text-align:center;font-size:11px;color:#8b8590;margin-top:20px;letter-spacing:.2px}kbd{display:inline-grid;place-items:center;font-family:inherit;font-size:10px;min-width:22px;height:23px;padding:0 6px;border:1px solid #515057;border-bottom-width:2px;border-radius:4px;background:#29282fc9;color:#c1b9ba;vertical-align:middle}.typing-hint kbd{height:21px;margin:0 3px}
.hud-footer{position:absolute;left:38px;right:38px;bottom:26px;z-index:2;display:flex;justify-content:space-between;align-items:center;gap:20px;color:#93909b;font-size:11px;pointer-events:none}.hud-footer>span{display:flex;align-items:center;gap:9px}.live-dot{width:5px;height:5px;border-radius:50%;background:#b4b8a0}.footer-separator{color:#56545f;margin:0 4px}.layout-label{font-size:9px;letter-spacing:1.2px;color:#706e7c}.key-feedback{position:absolute;left:50%;transform:translateX(-50%)}.key-feedback kbd{min-width:26px}.sound-status{font-size:9px;letter-spacing:1.4px}.sound-status svg{width:14px;height:14px;color:#a8998b}
.sidebar{position:fixed;inset:0 0 0 auto;margin:0;height:100vh;height:100dvh;max-height:none;width:390px;max-width:100vw;background:#1d1e23;border:0;border-left:1px solid #454047;color:var(--text);padding:0;box-shadow:-20px 0 90px #0005;overflow:hidden}.sidebar[open]{display:flex;flex-direction:column;animation:slide-in .2s ease-out}.sidebar::backdrop{background:#0f101436;backdrop-filter:blur(3px)}.sidebar-top{display:flex;justify-content:space-between;align-items:center;padding:28px 24px 22px;border-bottom:1px solid #35353c;flex-shrink:0}.eyebrow{font-size:9px;letter-spacing:1.6px;color:var(--accent);font-weight:600;margin-bottom:10px}h1{font-family:'Space Grotesk',sans-serif;font-size:29px;font-weight:500;letter-spacing:-1px}h1>span{color:var(--accent)}.icon-button{width:32px;height:32px;padding:0;display:grid;place-items:center;background:#2d2d34;border:1px solid #45444b;border-radius:7px;color:#bdb7c0}.icon-button:hover{background:#424049}.icon-button svg{width:16px;height:16px}.sidebar-content{padding:0 24px 24px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#56505b transparent}.sidebar-wallet{display:flex;align-items:center;gap:10px;padding:22px 0;border-bottom:1px solid #35353c}.sidebar-wallet strong{font-family:'Space Grotesk',sans-serif;font-size:23px;color:#e6c192}.sidebar-wallet>span:last-child{font-size:12px;color:#908895}.race-settings{padding:24px 0;margin-bottom:24px;border-bottom:1px solid #35353c}.section-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:18px}.section-heading h2{font-family:'Space Grotesk',sans-serif;font-size:17px;font-weight:500;letter-spacing:-.3px}.section-heading>span{font-size:11px;color:#89838f}.race-settings>label{display:block;font-size:12px;color:#a49da8;margin-bottom:8px}select{width:100%;background:#28292f;border:1px solid #45434a;border-radius:7px;padding:12px;color:#d1cad4;font-size:14px}.primary-button{width:100%;height:45px;display:flex;align-items:center;justify-content:center;gap:12px;background:var(--accent);border:1px solid #fbb28e;color:#302119;font-size:14px;font-weight:700;border-radius:7px;margin-top:13px;box-shadow:0 2px 0 #9e6146}.primary-button:hover{background:#fca882}.primary-button svg{width:17px;height:17px}.sound-control{display:flex;align-items:center;justify-content:space-between;margin:25px 0 18px;gap:12px}.sound-control strong{font-size:13px;font-weight:500}.sound-control p{font-size:11px;color:#918995;margin-top:5px}.switch{width:37px;height:22px;padding:2px;border:1px solid #ac7a61;background:#b17c5e;border-radius:15px;flex-shrink:0}.switch>span{display:block;width:16px;height:16px;border-radius:50%;background:#f4e9dc;transform:translateX(14px);transition:transform .2s}.switch[aria-checked=false]{background:#38353e;border-color:#56525c}.switch[aria-checked=false]>span{transform:translateX(0);background:#a29aa8}.race-settings>.volume-label{display:flex;justify-content:space-between;font-size:11px;margin-bottom:4px}.volume-label output{color:#857c8c}input[type=range]{width:100%;accent-color:var(--accent);height:14px}
.shop-tabs{display:flex;gap:3px;padding:4px;background:#14151a;border:1px solid #35333b;border-radius:7px;margin-bottom:14px}.shop-tabs>button{flex:1;background:transparent;border:0;border-radius:4px;font-size:12px;color:#9b919f;padding:9px 3px}.shop-tabs>button[aria-selected=true]{background:#38343e;color:#eeebed}.shop-item{border:1px solid #3d3943;background:#25242b;border-radius:9px;overflow:hidden;margin-bottom:13px;position:relative}.shop-item.equipped{border-color:#946d53}.item-preview{height:113px;background:radial-gradient(ellipse at 50% 0%,#3d3945,#29262f);position:relative;overflow:hidden}.item-preview img{display:block;width:100%;height:100%;object-fit:cover}.item-badge{position:absolute;right:10px;top:10px;font-size:9px;letter-spacing:.4px;padding:5px 6px;background:#37312bdc;border:1px solid #745c45;color:#dab78e;border-radius:4px;display:flex;align-items:center;gap:4px}.item-badge svg{width:10px;height:10px}.item-content{display:flex;justify-content:space-between;align-items:center;padding:14px 13px;gap:8px}.item-title{font-size:13px;font-weight:500}.item-subtitle{font-size:11px;color:#98909e;margin-top:5px}.buy-button{display:flex;align-items:center;justify-content:center;gap:5px;border:1px solid #5a473b;background:#382c24;color:#dcb78e;border-radius:5px;padding:8px 9px;min-width:61px;font-size:11px}.buy-button:hover{background:#533d2e}.buy-button .coin{width:13px;height:13px;font-size:7px}.buy-button.equipped-button{background:#2d342d;border-color:#525b46;color:#b7c1a5}.shop-note{display:block;padding:16px 0 0;color:#8d8494;font-size:11px;line-height:1.8}.shop-note svg{float:left;width:20px;margin:4px 10px 18px 0;color:#b5a0c7}
#results{background:#242229;color:var(--text);border:1px solid #51454d;border-radius:17px;width:min(450px,92vw);padding:38px;text-align:center;box-shadow:0 25px 100px #0007}#results::backdrop{background:#101015a8;backdrop-filter:blur(7px)}.dialog-close{position:absolute;right:14px;top:14px}.result-icon{display:grid;place-items:center;width:64px;height:64px;background:#473128;border:1px solid #75503d;border-radius:18px;color:var(--accent);margin:0 auto 22px}.result-icon svg{width:31px;height:31px}#results h2{font-family:'Space Grotesk',sans-serif;font-size:34px;margin:10px 0}#results>p{color:#a99da9;font-size:14px;line-height:1.6}.result-stats{display:flex;justify-content:space-around;gap:12px;margin:26px 0;background:#1c1a20;border:1px solid #3c3540;border-radius:8px;padding:20px 8px}.result-stats strong{display:block;font-family:'Space Grotesk',sans-serif;font-size:23px;color:#ebbb91}.result-stats span{display:block;margin-top:7px;font-size:9px;letter-spacing:.5px;color:#9e90a2}.text-button{background:none;border:0;color:#bcabbc;font-size:12px;margin-top:20px}.toast{position:fixed;bottom:75px;left:50%;transform:translate(-50%,15px);background:#35302f;border:1px solid #755642;border-radius:8px;color:#efdbcb;box-shadow:0 8px 35px #0006;max-width:90vw;padding:13px 19px;font-size:13px;z-index:20;opacity:0;pointer-events:none;transition:.2s}.toast.show{transform:translate(-50%,0);opacity:1}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.scene-error{position:absolute;top:60%;left:50%;transform:translate(-50%,-50%);text-align:center;color:var(--muted);font-size:16px;width:min(500px,80vw)}
@keyframes blink{50%{opacity:0}}@keyframes slide-in{from{transform:translateX(100%)}to{transform:translateX(0)}}
@media(min-width:1800px){.typing-hud{width:840px}#passage{font-size:25px}.hud-header{padding:36px 48px}}
@media(max-width:700px){.hud-header{padding:22px}.brand{font-size:23px}.brand-mark{width:30px;height:29px}.wallet{padding:9px 11px;gap:7px}.typing-hud{top:112px;width:86vw}.race-state{font-size:8px;letter-spacing:1.4px}.race-info{margin-bottom:14px}.live-stats{font-size:10px;gap:12px}#passage{font-size:17px;--passage-lines:4}.typing-hint{font-size:10px;margin-top:15px}.race-progress{gap:14px;margin-top:15px}.hud-footer{left:22px;right:22px;bottom:22px;font-size:10px}.layout-label,.footer-separator,.key-feedback{display:none}.sound-status{font-size:8px}.sidebar{width:370px}}
@media(max-height:650px) and (min-width:701px){.hud-header{padding:18px 28px}.typing-hud{top:75px;width:min(780px,77vw)}#passage{font-size:16px;line-height:1.45;--passage-lines:2}.race-info{margin-bottom:10px}.race-progress{margin-top:10px}.typing-hint{margin-top:10px}.hud-footer{bottom:15px;left:28px;right:28px}}
@media(max-height:500px){.typing-hud{top:65px;width:72vw}.race-info{margin-bottom:7px}#passage{font-size:13px;line-height:1.4;--passage-lines:2}.typing-hint{display:none}.race-progress{margin-top:7px}.hud-header{padding:15px 22px}.brand{font-size:20px}.brand-mark{width:27px;height:25px}.wallet{padding:6px 9px}.hud-footer{bottom:12px}.live-stats{font-size:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
.sidebar>.toast{left:18px;right:18px;max-width:none;width:auto;bottom:18px;transform:translateY(12px)}.sidebar>.toast.show{transform:translateY(0)}

/* The desk is the home screen; race UI appears only while racing. */
body[data-mode=desk] .typing-hud,body[data-mode=desk] .opponent-card{display:none}
.desk-intro{position:absolute;left:50%;top:clamp(108px,13vh,155px);transform:translateX(-50%);z-index:2;text-align:center;pointer-events:none;width:90vw}.desk-intro .eyebrow{display:block;font-size:10px;letter-spacing:2.6px;color:#d4a18e;margin-bottom:12px}.desk-intro h2{font-family:'Space Grotesk',sans-serif;font-size:30px;font-weight:500;letter-spacing:-1px;text-shadow:0 2px 16px #17151b}.desk-intro p{font-size:12px;color:#a397a5;margin-top:11px}.desk-start{display:block;margin-top:20px;font-size:11px;color:#c1b0b9}.desk-start kbd{margin:0 4px}body[data-mode=race] .desk-intro{display:none}
body[data-mode=race] .typing-hud{left:38px;transform:none;width:calc(100vw - 380px);max-width:720px;top:115px}
.opponent-card{position:absolute;right:38px;top:108px;width:260px;border:1px solid #66587855;background:#22212cbb;border-radius:11px;padding:13px 13px 10px;z-index:2;box-shadow:0 10px 40px #0002;backdrop-filter:blur(8px);pointer-events:none}.opponent-heading,.opponent-footer{display:flex;justify-content:space-between;align-items:center;gap:8px}.opponent-heading strong{font-size:10px;letter-spacing:2px;font-weight:600;color:#c1b1e1}.opponent-heading>span{font-size:8px;letter-spacing:1px;color:#9388a7;display:flex;align-items:center;gap:7px}.opponent-heading i{width:4px;height:4px;border-radius:50%;background:#ad98d8}#opponent-scene{width:100%;height:95px;margin:7px 0 6px}#opponent-scene canvas{display:block}.opponent-footer{font-size:8px;letter-spacing:.9px;color:#9c8cb5}#opponent-key{min-width:21px;text-align:center;padding:3px;border:1px solid #51475f;border-radius:3px;color:#cfbaf0}.you-badge{border:1px solid #8f634744;border-radius:4px;padding:5px 6px;font-size:9px;letter-spacing:1.4px;background:#3e2c24aa;color:#edb28b}
.desk-settings{padding-bottom:24px;margin-bottom:24px;border-bottom:1px solid #35353c}.secondary-button{width:100%;border:1px solid #4d4654;border-radius:7px;background:#2e2934;color:#c6bacd;padding:11px;font-size:13px;margin-bottom:9px}.secondary-button:hover{background:#403649}.desk-settings p{font-size:11px;line-height:1.7;color:#998b9f;margin-top:5px}.audio-credit{font-size:10px;line-height:1.7;color:#928394;margin-top:14px}.audio-credit a{color:#bda5c7;text-decoration:none}.audio-credit a:hover{text-decoration:underline}
#results{position:fixed;inset:0 0 0 auto;margin:0;width:390px;max-width:100vw;height:100vh;height:100dvh;max-height:none;border-radius:0;border-width:0 0 0 1px;padding:90px 28px 35px}#results[open]{animation:slide-in .2s ease-out}#results::backdrop{background:#0f101448;backdrop-filter:blur(3px)}
body[data-mode=desk] #scene canvas{touch-action:none}
@media(min-width:1450px){body[data-mode=race] .typing-hud{left:calc((100vw - 1280px)/2 + 30px)}.opponent-card{right:calc((100vw - 1280px)/2 + 30px)}}
@media(max-width:800px){.opponent-card{width:200px;right:22px;padding:10px;top:105px}#opponent-scene{height:73px}body[data-mode=race] .typing-hud{left:22px;top:105px;width:calc(100vw - 260px)}body[data-mode=race] #passage{font-size:15px;--passage-lines:3}.race-info{flex-wrap:wrap;gap:7px}.desk-intro h2{font-size:25px}}
@media(max-width:550px){.opponent-card{width:150px;right:20px;top:91px;padding:8px}#opponent-scene{height:53px;margin:5px 0}.opponent-heading strong{font-size:8px;letter-spacing:1.4px}.opponent-heading>span{font-size:6px;letter-spacing:.7px}.opponent-footer{font-size:6px}body[data-mode=race] .typing-hud{left:22px;top:217px;width:calc(100vw - 44px)}body[data-mode=race] .race-info{flex-wrap:nowrap}body[data-mode=race] #passage{font-size:15px;--passage-lines:3}.desk-intro{top:115px}.desk-intro h2{font-size:23px}.desk-intro p{font-size:11px}.desk-start{font-size:10px}.you-badge{font-size:8px;padding:4px 5px}}
@media(max-height:650px) and (min-width:701px){body[data-mode=race] .typing-hud{top:82px}.opponent-card{top:77px;width:215px}#opponent-scene{height:73px}.desk-intro{top:85px}.desk-intro h2{font-size:25px}.desk-start{margin-top:13px}}
@media(max-height:500px){.desk-intro{top:78px}.desk-intro h2{font-size:21px}.desk-intro p{margin-top:7px}.desk-start{margin-top:9px}.desk-intro .eyebrow{margin-bottom:7px}.opponent-card{top:72px;width:165px;right:20px;padding:8px}#opponent-scene{height:54px}body[data-mode=race] .typing-hud{top:70px;left:22px;width:calc(100vw - 230px)}}


.brand-art{width:44px;height:44px;object-fit:contain;filter:drop-shadow(0 3px 5px #0005);margin:-6px -2px -6px -4px}
.workshop-art-slot{margin:22px 0 0;aspect-ratio:2.1;overflow:hidden;border:1px solid #494049;border-radius:10px;background:#26212b}.workshop-art-slot>img{display:block;width:100%;height:100%;object-fit:cover}
.result-art{display:block;width:230px;height:230px;object-fit:contain;margin:-25px auto 8px;filter:drop-shadow(0 12px 20px #0004)}
.toast{display:flex;align-items:center;gap:11px}.toast:before{content:'';display:block;flex:0 0 27px;width:27px;height:27px;background:url('./art/keyshift-logo.png') center/contain no-repeat}
@media(max-width:550px){.brand-art{width:38px;height:38px}.result-art{width:210px;height:210px}#results{padding-top:65px}}
@media(max-height:600px){.result-art{width:145px;height:145px;margin:-12px auto 0}#results{padding-top:48px;overflow:auto}.result-stats{margin:18px 0;padding:13px 8px}#results h2{font-size:28px}}

body[data-mode=race] #passage{--passage-lines:2}body[data-mode=race] .typing-hud{filter:drop-shadow(0 2px 5px #17131d)}@media(max-width:550px){body[data-mode=race] #passage{--passage-lines:3}}

/* A small, quiet invitation at the bottom leaves the desk itself in focus. */
.desk-intro{top:auto;bottom:72px;width:auto;max-width:calc(100vw - 36px);white-space:nowrap;color:#d0c6c9;text-shadow:0 2px 8px #151319}
.desk-intro h2{font-size:13px;letter-spacing:.1px;font-weight:500;line-height:1.5}
.desk-intro p{display:inline-block;font-size:10px;color:#a49aa6;margin:7px 0 0}
.desk-start{display:inline-block;margin:0 0 0 13px;font-size:10px;color:#c6b6bb}
.desk-start kbd{height:18px;min-width:28px;font-size:9px;margin:0 4px 0 0}
body[data-mode=desk] .key-feedback{display:none}
.shop-tabs>button{font-size:10px;padding:10px 3px;white-space:nowrap}
@media(max-width:550px){.desk-intro{bottom:73px}.desk-intro h2{font-size:12px}.desk-intro p,.desk-start{font-size:9px}.desk-start{margin-left:8px}}
@media(max-height:500px){.desk-intro{bottom:46px}.desk-intro h2{font-size:11px}.desk-intro p{margin-top:4px}}
.sidebar>.toast{position:absolute}
.item-preview.tower-preview{height:auto;aspect-ratio:600 / 320}

.arrange-button{border-color:#896b57;background:#3c302b;color:#ebc3a5}

/* Real-player lobbies live in the workshop sidebar. */
[hidden]{display:none!important}.account-panel{display:flex;align-items:center;gap:13px;padding:23px 0 14px}.account-avatar{width:39px;height:39px;border:1px solid #76628c;background:#3a2f49;color:#dbcaea;border-radius:12px;display:grid;place-items:center;font:600 23px 'Space Grotesk',sans-serif}.account-panel strong{font-size:13px;font-weight:600}.account-panel p{font-size:10px;color:#a99aaa;line-height:1.6;margin-top:5px}.account-panel span{display:block;font-size:9px;color:#b6bd9b;margin-top:5px}.discord-button{background:#aa98cf;border-color:#c4b5e1;box-shadow:0 2px 0 #69567f;color:#241c33}.discord-button:hover{background:#bcabe0}.admin-link{font-size:11px!important;color:#c6b2da!important;border-color:#685370!important}.race-settings h2{font-size:15px}.race-settings .section-heading>span{white-space:nowrap;font-size:9px}
#dev-login label{font-size:11px;color:#beadbf;display:block;margin:8px 0}#dev-login small{float:right;font-size:9px;color:#907d98}#dev-name,.join-row input{width:100%;background:#25232c;border:1px solid #504454;border-radius:6px;padding:11px 12px;color:#e2cbd6;font-size:12px}.join-row{display:flex;gap:8px;margin-top:12px}.join-row input{min-width:0;letter-spacing:2px;text-transform:uppercase}.join-row button{border:1px solid #715942;background:#423127;color:#e9bc97;border-radius:6px;padding:0 18px;font-size:12px}.lobby-note{font-size:10px;line-height:1.8;color:#a699ab;margin:14px 0}.queue-panel{padding:20px 15px;background:#28232f;border:1px solid #584361;border-radius:10px;text-align:center}.queue-panel h3{font:500 17px 'Space Grotesk',sans-serif;margin-top:16px}.queue-panel p{color:#a394ae;font-size:11px;line-height:1.7;margin:10px 0 18px}.queue-orbit{display:block;width:28px;height:28px;border:2px solid #64516f;border-top-color:#eab08b;border-radius:50%;margin:auto;animation:queue-spin 1.4s linear infinite}@keyframes queue-spin{to{transform:rotate(360deg)}}.lobby-code-heading{display:flex;justify-content:space-between;align-items:center}.lobby-code-heading span{display:block;font-size:10px;color:#a590ac}.lobby-code-heading strong{display:block;font:500 28px 'Space Grotesk',sans-serif;letter-spacing:6px;color:#e0b194;margin-top:8px}.lobby-code-heading button{margin:0;font-size:10px}.lobby-player{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#25232d;border:1px solid #423848;border-radius:6px;padding:12px;margin-top:7px}.lobby-player strong{font-size:11px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lobby-player span{font-size:9px;color:#c4bba0;white-space:nowrap}#leave-lobby{font-size:10px;width:100%}#race-clock-note{color:#dda588}.opponent-heading>span{max-width:70%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#opponent-chooser{display:flex;gap:4px;padding:4px 0 8px}#opponent-chooser button{min-width:0;flex:1;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-size:8px;border:1px solid #554454;border-radius:4px;padding:5px;background:#2c2533;color:#ac96b9}#opponent-chooser button.selected{border-color:#bc9c82;color:#ecc3a0}.race-progress{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px 22px}.progress-row>span:first-child{width:65px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.other-fill{background:var(--purple)}#result-standings{font-size:10px;line-height:1.8;color:#b6a5c2;margin-top:13px}#results{max-height:96dvh;overflow:auto}
#admin-panel{width:min(1020px,94vw);max-height:92dvh;border:1px solid #655166;border-radius:16px;background:#201d26;color:#ebdfe7;padding:0;box-shadow:0 25px 100px #0008}#admin-panel::backdrop{background:#101015b0;backdrop-filter:blur(6px)}#admin-panel>header{display:flex;justify-content:space-between;gap:20px;align-items:center;padding:25px 30px;border-bottom:1px solid #453747;position:sticky;top:0;background:#241f2b;z-index:1}#admin-panel h2{font:500 28px 'Space Grotesk',sans-serif;letter-spacing:-1px}#admin-panel>header>div:last-child{display:flex;align-items:center;gap:12px}#admin-panel .secondary-button{margin:0;padding:8px 13px;height:auto;font-size:11px}#admin-content{padding:25px 30px}.admin-note{font-size:11px;color:#a99bb2;line-height:1.7;margin-bottom:20px}.admin-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px}.admin-metrics article{padding:17px;background:#2b2533;border:1px solid #49394f;border-radius:9px}.admin-metrics span{display:block;font-size:10px;color:#c3aecb}.admin-metrics strong{display:block;font:500 29px 'Space Grotesk',sans-serif;color:#efbe9c;margin:12px 0 7px}.admin-metrics small{display:block;font-size:9px;line-height:1.5;color:#95859f}.admin-trend,.admin-table{margin-top:28px}.admin-trend h3,.admin-table h3{font-size:14px;font-weight:500;margin-bottom:20px}.admin-bars{height:155px;display:flex;gap:10px;align-items:end;padding-bottom:20px}.admin-bars>div{position:relative;flex:1;display:flex;flex-direction:column;justify-content:end;align-items:center;height:100%;min-width:0}.admin-bars i{display:block;flex-shrink:0;width:100%;max-width:36px;min-height:2px;background:linear-gradient(#d4ad91,#78577e);border-radius:4px 4px 0 0}.admin-bars strong{font-size:9px;font-weight:400;color:#ceb4c9;margin-bottom:5px}.admin-bars small{position:absolute;bottom:-19px;font-size:8px;color:#a391ad;white-space:nowrap}.admin-table>div{overflow:auto;border:1px solid #49394f;border-radius:8px}.admin-table table{width:100%;border-collapse:collapse;text-align:left;font-size:11px;white-space:nowrap}.admin-table th{font-size:9px;color:#b49abc;font-weight:500;background:#2c2333}.admin-table th,.admin-table td{padding:13px 14px;border-bottom:1px solid #3d3044}.admin-table tbody tr:last-child td{border:0}@media(max-width:700px){.admin-metrics{grid-template-columns:repeat(2,minmax(0,1fr))}#admin-content{padding:20px 16px}#admin-panel>header{padding:20px 16px}.admin-bars{gap:4px}.admin-bars small{font-size:6px}.admin-metrics strong{font-size:25px}.race-progress{gap:7px 12px}.progress-row>span:first-child{width:40px}}
.store-item{display:block;width:100%;border:0;border-top:1px solid #3c3841;background:#211f27;color:#b9a7b3;font-size:10px;padding:9px}.store-item:hover{background:#37303b;color:#f2ddd0}
.desk-editor{position:fixed;right:18px;top:98px;bottom:70px;width:266px;padding:17px;z-index:4;background:#201f27eb;border:1px solid #5c4c55;border-radius:12px;box-shadow:0 16px 60px #0005;backdrop-filter:blur(18px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#615263 transparent}.desk-editor[hidden]{display:none}
.editor-heading{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:17px}.editor-heading .eyebrow{display:block;font-size:7px;letter-spacing:1.3px;margin-bottom:6px}.editor-heading h2{font:500 18px 'Space Grotesk',sans-serif;letter-spacing:-.5px}
.desk-editor button{border:1px solid #534751;border-radius:6px;background:#302a33;color:#d3c4cf;font-size:11px;padding:9px 11px}.desk-editor button:hover:not(:disabled){background:#453744;border-color:#9d7a71}.desk-editor button:disabled{opacity:.32}.desk-editor .editor-done{background:#e7a37a;color:#30221d;border-color:#ecb995;font-weight:700;padding:8px 10px}
.editor-history,.editor-rotate{display:flex;gap:7px}.editor-history button,.editor-rotate button{flex:1}.editor-history{margin-bottom:17px}.editor-selection{padding:16px 0;border-top:1px solid #453944;border-bottom:1px solid #453944;margin-bottom:19px}.editor-selection h3{font-size:13px;font-weight:500}.editor-selection p{font-size:10px;color:#aa96a6;line-height:1.6;margin:7px 0 12px}.desk-editor .editor-store{width:100%;margin-top:8px;font-size:10px;background:transparent}
.editor-inventory-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:11px;gap:8px}.editor-inventory-heading h3{font-size:13px;font-weight:500}.editor-inventory-heading span{font-size:7px;letter-spacing:1px;color:#ae8c77}
.inventory-item{display:flex;align-items:center;gap:6px;border:1px solid #3e3541;border-radius:7px;padding:4px;margin-bottom:7px;background:#24212a}.inventory-item.selected{border-color:#b38968;background:#33292d}.desk-editor .inventory-select{flex:1;min-width:0;background:none;border:0;text-align:left;padding:7px 6px}.inventory-select strong{display:block;font-size:11px;font-weight:500}.inventory-select span{display:block;color:#a894a6;font-size:9px;margin-top:4px}.desk-editor .inventory-place{padding:7px 8px;font-size:10px;background:#463329;color:#e6ba98;border-color:#82614b}.editor-note{font-size:10px;color:#a993a4;line-height:1.7;margin-top:14px}.desk-editor .text-button{border:0;padding:0;background:none;font-size:10px;margin-top:12px;color:#c4a6b7}
.desk-edit-hint{display:none;position:absolute;left:calc((100% - 284px)/2);bottom:78px;transform:translateX(-50%);color:#b8a9b6;font-size:10px;z-index:2;white-space:nowrap;pointer-events:none}.desk-edit-hint kbd{height:19px;font-size:9px;margin:0 3px}body[data-editing=true] .desk-intro{display:none}body[data-editing=true] .desk-edit-hint{display:block}body[data-editing=true] #scene canvas{cursor:grab}
@media(max-width:700px){.desk-editor{top:auto;left:18px;right:18px;bottom:60px;width:auto;max-height:34vh;padding:14px}.editor-heading{margin-bottom:10px}.editor-history{margin-bottom:10px}.editor-selection{padding:10px 0;margin-bottom:13px}#desk-inventory{display:grid;grid-template-columns:1fr 1fr;gap:6px}.inventory-item{margin:0}.desk-edit-hint{left:50%;bottom:calc(34vh + 73px);font-size:8px}.desk-edit-hint kbd{font-size:8px}.editor-note{font-size:9px}}

.sidebar-legal{margin-top:24px;padding-top:20px;border-top:1px solid #ffffff14;font-size:11px;line-height:1.8;color:#a7a6ad}.sidebar-legal p{margin:0 0 10px}.sidebar-legal a{color:#d3c9ff;text-underline-offset:3px}.sidebar-legal>span{display:block;margin-top:12px;color:#8b8992}
.discord-welcome{padding:22px 0 4px}.discord-welcome[hidden],#game-menu-content[hidden]{display:none}.welcome-art{display:block;width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:12px;border:1px solid #62534e;margin-bottom:28px}.discord-welcome h2{font:500 34px/1.08 'Space Grotesk',sans-serif;letter-spacing:-1.2px;margin:0 0 16px}.discord-welcome>p:not(.eyebrow){font-size:13px;line-height:1.8;color:#b3a6b6}.discord-welcome .primary-button{text-decoration:none;margin-top:25px}.discord-welcome>.welcome-signin{font-size:11px!important;line-height:1.7!important;margin:14px 0 20px;color:#a89bab!important}.welcome-details{display:flex;flex-wrap:wrap;gap:7px;margin:14px 0 8px}.welcome-details span{font-size:9px;color:#c6b1ca;border:1px solid #4d3f51;background:#302833;padding:6px 8px;border-radius:5px}a:focus-visible{outline:2px solid var(--accent);outline-offset:4px}body[data-preview=true] .sidebar-content{padding-top:0}body[data-preview=true] .sidebar-legal{margin-top:18px}

/* A fixed number of complete lines, independent of font size and window height. */
.passage-content{display:block;transform:translateY(0);will-change:transform}
.passage-word{display:inline-block;white-space:pre}
.race-info{flex-wrap:wrap}.race-state,.live-stats{white-space:nowrap}
.live-stats{flex-shrink:0}.progress-row{min-width:0}.progress-row>span{flex-shrink:0}.track-lane{min-width:8px}
.typing-hud{min-width:0}
@media(max-width:550px){body[data-mode=race] .race-info{flex-wrap:wrap}body[data-mode=race] .typing-hud{top:205px;left:20px;width:calc(100vw - 40px)}.race-progress{column-gap:12px}.progress-row{gap:5px}.progress-row>span:first-child{width:38px}.progress-row>span:last-child{width:25px}.opponent-card{top:82px}}
@media(max-width:550px) and (max-height:500px){body[data-mode=race] .typing-hud{top:175px}body[data-mode=race] #passage{--passage-lines:2}.opponent-card{top:70px;width:145px}.race-info{margin-bottom:8px}.race-progress{margin-top:10px}}
@media(max-width:550px){body[data-mode=race]:has(#opponent-chooser:not([hidden])) .typing-hud{top:239px}}
@media(max-width:550px) and (max-height:500px){body[data-mode=race]:has(#opponent-chooser:not([hidden])) .typing-hud{top:224px}}

/* Separate the race decision from invitations and make readiness unmistakable. */
#lobby-players{display:grid;gap:9px;margin-bottom:20px}.lobby-player{margin:0;min-height:44px}.lobby-player[data-ready=true]{border-color:#567c67}.lobby-player[data-ready=true] span{color:#addbbb}
.lobby-actions{display:grid;gap:12px;padding:18px 0;border-top:1px solid #433b46;border-bottom:1px solid #433b46}
.ready-button{display:flex;align-items:center;justify-content:center;min-height:54px;width:100%;padding:14px 12px;border:1px solid #ffbd98;border-radius:9px;background:#f2946c;color:#2c201b;font-size:16px;font-weight:700;box-shadow:0 3px 0 #915438}
.ready-button:hover:not(:disabled){background:#ffac84}.ready-button[aria-pressed=true]{background:#294b3b;border-color:#649778;color:#d4f4de;box-shadow:0 3px 0 #172d23}
.ready-button[aria-pressed=true]:hover:not(:disabled){background:#365d48}.lobby-actions .primary-button{margin:0;min-height:48px;height:auto;padding:12px}
#ready-help{margin:0;font-size:11px;line-height:1.6;color:#c4b8cc}.lobby-invites{display:grid;gap:10px;margin-top:20px}.lobby-invites .secondary-button{margin:0;min-height:44px}.lobby-invites .lobby-note{margin:0;font-size:11px;line-height:1.65}#leave-lobby{margin-top:22px;padding:12px 8px;min-height:42px}
#lobby-join-note{font-size:11px;line-height:1.65}.lobby-code-heading{gap:14px}.lobby-code-heading button{flex-shrink:0;min-height:40px;padding:8px}.lobby-code-heading strong{font-size:25px;letter-spacing:4px}
#match-options{display:grid;gap:12px}#match-options>.primary-button,#match-options>.secondary-button,#match-options>.join-row{margin:0}.sidebar-content{min-height:0}

@media(max-width:700px){.hud-footer .key-feedback{display:none}}

/* Main destinations stay visible while either panel scrolls. */
.sidebar-tabs{display:grid;grid-template-columns:1fr 1fr;gap:8px;flex-shrink:0;padding:14px 24px;border-bottom:1px solid #37313e;background:#1d1e23}
.sidebar-tabs>button{display:flex;align-items:center;justify-content:center;gap:9px;min-height:43px;padding:10px;border:1px solid #4b414f;border-radius:8px;background:#25222b;color:#ac9eaf;font-size:13px;font-weight:600}
.sidebar-tabs>button svg{width:17px;height:17px}.sidebar-tabs>button:hover{background:#352b38;color:#eee1e7}
.sidebar-tabs>button[aria-selected=true]{border-color:#bc8764;background:#42312a;color:#ffd0aa;box-shadow:inset 0 0 0 1px #d3a07d15}
#menu-lobby .race-settings{padding-top:14px;margin-bottom:0;border-bottom:0}
.upgrades-summary{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:19px 0 21px}
.upgrades-summary .sidebar-wallet{display:grid;grid-template-columns:19px 1fr;gap:5px 9px;padding:0;border:0;min-width:0}
.upgrades-summary .sidebar-wallet .coin{align-self:center}.upgrades-summary .sidebar-wallet>span:last-child{grid-column:1/-1;font-size:10px;line-height:1.5}
.upgrades-summary .workshop-art-slot{flex:0 0 86px;width:86px;height:64px;aspect-ratio:auto;margin:0;border-radius:9px}
#menu-upgrades .shop-note{padding-top:5px}
.desk-preferences{margin-top:22px;border:1px solid #453a49;border-radius:9px;padding:0 14px;background:#24212a}
.desk-preferences>summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px;font-size:12px;color:#d5c3d1}
.desk-preferences>summary::-webkit-details-marker{display:none}.desk-preferences>summary:after{content:'+';font-size:19px;color:#c99e85}.desk-preferences[open]>summary:after{content:'−'}
.desk-preferences>summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px;border-radius:4px}
.desk-preferences .desk-settings{padding:15px 0;margin-bottom:0;border-top:1px solid #453a49}.desk-preferences .section-heading{margin-bottom:13px}
.audio-settings{padding-bottom:16px}.audio-settings .volume-label{display:flex;justify-content:space-between;font-size:11px;margin-bottom:4px}.audio-settings .sound-control{margin:18px 0}
@media(max-height:600px){.sidebar-top{padding:17px 24px 15px}.sidebar-top h1{font-size:25px}.sidebar-tabs{padding:10px 24px}.sidebar-tabs>button{min-height:40px}.upgrades-summary{padding:14px 0 17px}}
