:root{color-scheme:light;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,sans-serif;background:#132832;color:#24444b;font-synthesis:none;text-rendering:optimizeLegibility}*{box-sizing:border-box}body{margin:0;min-width:320px;min-height:100vh;min-height:100dvh;overflow:hidden;overscroll-behavior:none}.rotate-phone{display:none}button,input,textarea{font:inherit}button{min-height:38px;border:1px solid rgba(36,68,75,.16);border-radius:7px;background:#f8fbf4;color:#24444b;font-weight:750;cursor:pointer;transition:transform .12s ease,background .12s ease,border-color .12s ease}button:hover:not(:disabled){transform:translateY(-1px);border-color:#24444b57}button:disabled{cursor:not-allowed;opacity:.46}input,textarea{width:100%;border:1px solid rgba(36,68,75,.16);border-radius:7px;background:#ffffffc7;color:#24444b;outline:none}input{height:38px;padding:0 10px}input[type=range]{height:24px;padding:0;accent-color:#ff7a59;background:transparent;box-shadow:none}textarea{min-height:96px;padding:10px;resize:vertical;font-family:Cascadia Mono,SFMono-Regular,Consolas,monospace;font-size:12px}input:focus,textarea:focus{border-color:#4f9d95;box-shadow:0 0 0 3px #4f9d952e}#app{display:grid;grid-template-columns:minmax(340px,430px) 1fr;height:100vh;height:100dvh;background:#132832}.side-panel{display:flex;flex-direction:column;gap:14px;min-height:0;padding:18px;background:linear-gradient(180deg,#fff4c2f2,#f8fbf4f5 38%),#f8fbf4;border-right:1px solid rgba(36,68,75,.18);overflow:auto;overflow-x:hidden}.brand{display:flex;align-items:center;justify-content:space-between;gap:16px}.brand h1,.brand p{margin:0}.brand h1{font-size:25px;line-height:1.05;letter-spacing:0}.eyebrow,.label{color:#24444ba8;font-size:11px;font-weight:850;letter-spacing:0;text-transform:uppercase}.connection-dot{width:13px;height:13px;border-radius:999px;background:#dd6f9f;box-shadow:0 0 0 4px #dd6f9f29}.connection-dot.is-online{background:#4f9d95;box-shadow:0 0 0 4px #4f9d952e}.app-screen,.editor-mode{display:none}.app-screen.is-active,.editor-mode.is-active{display:flex;flex-direction:column;gap:14px}.editor-screen{gap:12px}.field-grid,.button-row,.editor-actions,.tile-fields,.tile-feature-tools{display:grid;grid-template-columns:1fr 1fr;gap:8px}label{display:flex;flex-direction:column;gap:5px}label span{color:#24444bb8;font-size:12px;font-weight:800}.primary-button{border-color:#24444b14;background:#ff7a59;color:#fffdf6}.racer-preview{position:relative;height:118px;border:1px solid rgba(36,68,75,.1);border-radius:8px;background:linear-gradient(180deg,#8aa7d64d,#fffdf6d1),#fffdf6;overflow:hidden}.preview-board,.preview-body,.preview-head{position:absolute;left:50%;transform:translate(-50%)}.preview-board{bottom:24px;width:96px;height:12px;border-radius:999px;background:#f8fbf4;box-shadow:0 7px #1b344024}.preview-body{bottom:36px;width:34px;height:50px;border-radius:50%;background:#ff7a59}.preview-head{bottom:82px;width:28px;height:28px;border-radius:50%;background:#ffd4af}.color-group{display:grid;gap:6px}.swatches{display:grid;grid-template-columns:repeat(6,1fr);gap:7px}.swatch{min-height:32px;border:3px solid rgba(255,255,255,.82);box-shadow:inset 0 0 0 1px #24444b29}.swatch.is-selected{border-color:#24444b}.lobby-card,.tuning-panel,.tile-library,.tile-feature-list,.post-game,.race-feed{padding:10px;border:1px solid rgba(36,68,75,.1);border-radius:8px;background:#ffffff8a}.lobby-card{display:grid;grid-template-columns:.7fr 1.3fr;gap:10px}.lobby-card.is-live{border-color:#4f9d9566;background:#d6fff16b}.lobby-card>div{min-width:0}.lobby-card strong{display:block;margin-top:2px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}.player-list,.course-strip,.tile-library,.tile-feature-list{display:flex;gap:7px;margin:0;padding:0;list-style:none}.player-list,.tile-library,.tile-feature-list{flex-direction:column}.course-strip{overflow-x:auto;padding-bottom:6px;scroll-snap-type:x proximity}.player-list li,.course-strip li,.tile-row,.feature-row,.post-game li{display:grid;align-items:center;gap:8px;min-height:42px;padding:8px;border:1px solid rgba(36,68,75,.1);border-radius:8px;background:#ffffff9e}.player-list li{grid-template-columns:16px 1fr auto}.post-game[hidden]{display:none}.post-game{display:grid;gap:8px}.post-game ol{display:grid;gap:6px;margin:0;padding:0;list-style:none}.post-game li{grid-template-columns:34px minmax(0,1fr) auto}.player-list .empty-row{display:block;color:#24444b94;font-weight:750}.player-chip{width:14px;height:14px;border-radius:50%;background:var(--chip);box-shadow:0 0 0 3px #ffffffb3}.course-strip li{flex:0 0 116px;min-height:72px;padding:8px;scroll-snap-align:start}.course-strip li[draggable=true]{cursor:grab}.course-strip li.is-dragging{opacity:.48}.course-strip li.is-drop-target{border-color:#4f9d95;box-shadow:inset 0 0 0 2px #4f9d9538}.course-strip li.is-selected{border-color:#ff7a59;box-shadow:inset 0 0 0 2px #ff7a5933}.course-strip button{display:grid;gap:4px;width:100%;min-height:56px;padding:6px;border:0;background:transparent}.piece-index{justify-self:center;display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#24444b;color:#fffdf6;font-size:12px}.race-feed{min-height:54px;color:#24444bd1;white-space:pre-line;font-size:13px;font-weight:750}.tuning-panel,.tuning-row{display:grid;gap:10px}.tuning-row label{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:10px}.tuning-row strong{font-size:12px;color:#24444b}.mode-tabs{display:grid;grid-template-columns:1fr 1fr;gap:6px;padding:4px;border:1px solid rgba(36,68,75,.12);border-radius:8px;background:#ffffff85}.mode-tabs button{min-height:34px;border:0;background:transparent}.mode-tabs button.is-active{background:#24444b;color:#fffdf6}.palette{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.palette button{display:grid;gap:2px;min-height:58px;padding:8px 6px}.palette strong{justify-self:center;display:inline-grid;place-items:center;width:24px;height:24px;border-radius:50%;background:#24444b;color:#fffdf6;font-size:12px}.palette span,.course-strip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}.course-tools{display:grid;grid-template-columns:repeat(4,1fr);gap:6px}.course-tools button,.tile-row button,.feature-row button{min-height:32px;font-size:12px}#levelCanvas,#tileCanvas{width:100%;border:1px solid rgba(36,68,75,.14);border-radius:8px;background:linear-gradient(180deg,#8aa7d63d,#fffdf6b8);touch-action:none}#levelCanvas{aspect-ratio:45 / 16}#tileCanvas{aspect-ratio:45 / 19}.tile-row{grid-template-columns:minmax(0,1fr) auto auto auto}.feature-row{grid-template-columns:minmax(0,1fr) auto}.feature-row.is-selected{border-color:#ff7a59;box-shadow:inset 0 0 0 2px #ff7a592e}.tile-feature-tools{grid-template-columns:repeat(3,1fr)}.tile-row strong,.feature-row strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.tile-row.is-editing{border-color:#ff7a59}.canvas-menu{position:fixed;z-index:50;display:none;min-width:142px;padding:6px;border:1px solid rgba(36,68,75,.18);border-radius:8px;background:#fffdf6f5;box-shadow:0 16px 34px #1328322e}.canvas-menu.is-open{display:grid;gap:5px}.canvas-menu button{min-height:30px;text-align:left;font-size:12px}.stage-shell{position:relative;min-width:0;min-height:0;overflow:hidden;background:linear-gradient(180deg,#f8b07c,#f3c189 34%,#8aa7d6),#f7d7a6}body.is-racing{overflow:hidden}body.is-racing #app{grid-template-columns:1fr;grid-template-rows:1fr;height:100vh;height:100dvh}body.is-racing .side-panel{display:none}body.is-racing .stage-shell{grid-column:1;grid-row:1;min-height:0}#gameRoot{position:absolute;top:0;right:0;bottom:0;left:0;background:linear-gradient(180deg,#f8b07c,#f3c189 34%,#8aa7d6),#f7d7a6}#gameRoot canvas{display:block;width:100%;height:100%;background:transparent}.hud{position:absolute;top:16px;right:16px;display:grid;grid-template-columns:repeat(4,minmax(74px,auto));gap:8px;pointer-events:none}.hud>div{min-width:74px;padding:8px 10px;border:1px solid rgba(255,255,255,.38);border-radius:8px;background:#fffdf6ad;-webkit-backdrop-filter:blur(8px);backdrop-filter:blur(8px);box-shadow:0 14px 28px #1328321a}.hud strong{display:block;margin-top:2px;color:#24444b}#trickHud.is-hot{color:#ff7a59}@media(max-width:920px){body{overflow:auto}#app{grid-template-columns:1fr;grid-template-rows:minmax(420px,52vh) auto;min-height:100vh;height:auto}.stage-shell{grid-row:1;min-height:420px}.side-panel{grid-row:2;max-height:none;border-right:0;border-top:1px solid rgba(36,68,75,.18)}.hud{top:10px;right:10px;left:10px;grid-template-columns:repeat(4,1fr)}}@media(max-width:920px)and (orientation:landscape){body{overflow:hidden}#app{grid-template-columns:minmax(258px,34vw) minmax(0,1fr);grid-template-rows:1fr;height:100vh;height:100dvh;min-height:0}.stage-shell{grid-column:2;grid-row:1;min-height:0}.side-panel{grid-column:1;grid-row:1;gap:8px;min-height:0;padding:10px;border-top:0;border-right:1px solid rgba(36,68,75,.18);font-size:12px}.brand h1{font-size:18px}.eyebrow,.label,label span{font-size:10px}.app-screen.is-active,.editor-mode.is-active,.tuning-panel,.tuning-row{gap:8px}button,input{min-height:32px;height:32px;font-size:12px}input[type=range]{height:20px}.field-grid,.button-row{gap:6px}.racer-preview{height:72px}.preview-board{bottom:14px;width:78px}.preview-body{bottom:25px;width:28px;height:38px}.preview-head{bottom:58px;width:22px;height:22px}.swatches{gap:5px}.swatch{min-height:24px}.lobby-card,.tuning-panel,.post-game,.race-feed{padding:8px}.player-list li{min-height:34px;padding:6px}.hud{top:8px;right:8px;left:auto;grid-template-columns:repeat(2,minmax(58px,auto));gap:5px}.hud>div{min-width:58px;padding:6px 7px}.hud .label{font-size:9px}.hud strong{font-size:12px}}@media(orientation:portrait)and (pointer:coarse){.rotate-phone{position:fixed;z-index:100;top:0;right:0;bottom:0;left:0;display:grid;place-content:center;gap:10px;padding:28px;background:linear-gradient(180deg,#8aa7d6f0,#132832f5),#132832;color:#fffdf6;text-align:center}.rotate-phone strong{font-size:34px;line-height:1}.rotate-phone span{max-width:300px;color:#fffdf6c7;font-weight:750}}@media(max-width:560px){.field-grid,.button-row,.editor-actions,.tile-fields,.tile-feature-tools,.lobby-card{grid-template-columns:1fr}.palette,.swatches,.course-tools{grid-template-columns:repeat(2,1fr)}.brand h1{font-size:22px}}body.is-editor-open{overflow:hidden}body.is-editor-open #app{grid-template-columns:1fr;grid-template-rows:1fr;height:100vh;height:100dvh}body.is-editor-open .stage-shell{display:none}body.is-editor-open .side-panel{grid-row:1;height:100vh;height:100dvh;max-height:none;padding:14px;border:0;overflow:hidden}body.is-editor-open .brand{flex:0 0 auto}body.is-editor-open #mapEditorScreen.is-active{display:grid;flex:1 1 auto;grid-template-columns:minmax(190px,280px) minmax(0,1fr) minmax(220px,340px);grid-template-rows:auto minmax(0,1fr) minmax(64px,11vh);gap:10px;min-height:0;overflow:hidden}body.is-editor-open #mapEditorScreen>.button-row{grid-column:1;grid-row:1}body.is-editor-open #mapEditorScreen>.mode-tabs{grid-column:2 / 4;grid-row:1;justify-self:end;width:min(420px,100%)}body.is-editor-open #mapEditorScreen>.editor-mode.is-active{grid-column:1 / 4;grid-row:2;min-height:0}body.is-editor-open #mapEditorScreen>.editor-actions{grid-column:1;grid-row:3;align-self:stretch}body.is-editor-open #mapEditorScreen>textarea{grid-column:2 / 4;grid-row:3;min-height:0;height:100%;resize:none}body.is-editor-open #levelMode.is-active,body.is-editor-open #tileMode.is-active{gap:10px;overflow:hidden}body.is-editor-open #levelMode.is-active{display:grid;grid-template-columns:minmax(170px,240px) minmax(0,1fr) minmax(190px,280px);grid-template-rows:minmax(0,1fr) auto auto}body.is-editor-open #levelMode .palette{grid-column:1;grid-row:1 / 4;align-content:start;grid-template-columns:repeat(auto-fit,minmax(74px,1fr));overflow:auto;padding-right:2px}body.is-editor-open #levelMode #levelCanvas{grid-column:2 / 4;grid-row:1;align-self:stretch;height:100%;min-height:0;aspect-ratio:auto}body.is-editor-open #levelMode .course-tools{grid-column:2;grid-row:2}body.is-editor-open #levelMode>.button-row{grid-column:3;grid-row:2}body.is-editor-open #levelMode .course-strip{grid-column:2 / 4;grid-row:3;padding-bottom:0}body.is-editor-open #tileMode.is-active{display:grid;grid-template-columns:minmax(220px,310px) minmax(0,1fr) minmax(220px,330px);grid-template-rows:auto minmax(0,1fr) auto}body.is-editor-open #tileMode .tile-fields{grid-column:1;grid-row:1;grid-template-columns:1fr}body.is-editor-open #tileMode #tileCanvas{grid-column:2;grid-row:1 / 4;align-self:stretch;height:100%;min-height:0;aspect-ratio:auto}body.is-editor-open #tileMode .tile-feature-tools{grid-column:1;grid-row:2;align-self:start;grid-template-columns:1fr}body.is-editor-open #tileMode .editor-actions{grid-column:1;grid-row:3}body.is-editor-open #tileMode .tile-feature-list{grid-column:3;grid-row:1;overflow:auto}body.is-editor-open #tileMode .tile-library{grid-column:3;grid-row:2 / 4;overflow:auto}@media(max-width:860px){body.is-editor-open{overflow:auto}body.is-editor-open .side-panel{height:auto;min-height:100vh;overflow:visible}body.is-editor-open #mapEditorScreen.is-active,body.is-editor-open #levelMode.is-active,body.is-editor-open #tileMode.is-active{display:flex;flex-direction:column;overflow:visible}body.is-editor-open #levelCanvas,body.is-editor-open #tileCanvas{height:58vh;min-height:360px}body.is-editor-open #mapEditorScreen>textarea{height:120px}}@media(max-width:920px)and (orientation:landscape){body.is-editor-open #app{grid-template-columns:1fr}body.is-editor-open .side-panel{padding:8px}body.is-editor-open #mapEditorScreen.is-active{display:grid;grid-template-columns:minmax(152px,190px) minmax(0,1fr) minmax(164px,220px);grid-template-rows:auto minmax(0,1fr) minmax(46px,12vh);gap:7px;overflow:hidden}body.is-editor-open #levelMode.is-active{display:grid;grid-template-columns:minmax(132px,168px) minmax(0,1fr) minmax(150px,190px);gap:7px;overflow:hidden}body.is-editor-open #tileMode.is-active{display:grid;grid-template-columns:minmax(148px,190px) minmax(0,1fr) minmax(150px,210px);gap:7px;overflow:hidden}body.is-editor-open .palette button,body.is-editor-open .course-tools button,body.is-editor-open .tile-feature-tools button{min-height:30px;padding:5px}body.is-editor-open .course-strip li{flex-basis:92px;min-height:52px}body.is-editor-open #mapEditorScreen>textarea{font-size:10px}}
