.brick-rally{position:fixed;inset:0;z-index:140;background:#bfe3ff;color:#202747;font-family:Nunito,system-ui,sans-serif;isolation:isolate}
.rally-stage,.rally-stage canvas{position:absolute;inset:0;width:100%;height:100%;display:block}
.rally-header{position:absolute;top:16px;left:16px;right:16px;display:flex;gap:10px;align-items:center}
.rally-header h1,.rally-stats{background:white;border:3px solid #202747;border-radius:18px;box-shadow:0 5px 0 #202747;padding:10px 16px;margin:0;font-size:24px}
.rally-header h1{font-family:'Lilita One',sans-serif}.rally-stats{display:flex;gap:22px;font-size:20px;font-weight:900;font-variant-numeric:tabular-nums}.rally-pause{margin-left:auto}.rally-hint{position:absolute;top:86px;left:50%;transform:translateX(-50%);margin:0;background:white;border:3px solid #202747;border-radius:20px;padding:10px 20px;text-align:center;font-weight:900;max-width:90%;width:max-content;box-sizing:border-box}
.rally-directions{position:absolute;bottom:40px;left:50%;transform:translateX(-50%);display:grid;grid-template-columns:repeat(3,64px);gap:8px;touch-action:none;user-select:none}
.rally-directions button{width:64px;height:58px;border:3px solid #202747;border-radius:16px;background:white;box-shadow:0 5px 0 #202747;color:#202747;font-size:32px;font-weight:900;touch-action:none;cursor:pointer}.rally-directions [data-direction=up]{grid-column:2}.rally-directions [data-direction=left]{grid-column:1}.rally-directions button.held{background:#ffcf36;transform:translateY(3px);box-shadow:0 2px 0 #202747}.rally-keyboard{position:absolute;bottom:5px;left:0;right:0;text-align:center;margin:0;font-weight:900;font-size:13px}
.rally-overlay{position:absolute;inset:100px 0 0;display:grid;place-items:center;background:#20274722}.rally-overlay[hidden]{display:none}.rally-panel{background:white;border:3px solid #202747;border-radius:28px;box-shadow:0 8px 0 #202747;max-width:480px;width:calc(100% - 36px);box-sizing:border-box;padding:24px;display:flex;flex-direction:column;gap:16px;text-align:center}.rally-panel h2{font:32px 'Lilita One',sans-serif;margin:0}.rally-panel p{margin:0;line-height:1.4}.rally-finish-time{font:48px 'Lilita One',sans-serif}.rally-announcement{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
.play-games{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.play-game{border:3px solid #202747;border-radius:22px;background:#f1e9ff;padding:20px;display:flex;flex-direction:column;gap:10px;text-align:left}.play-game h3{font-size:24px}.play-game p{font-size:15px;line-height:1.4}.play-game .btn{margin-top:auto}.play-game small{font-weight:900;color:#5a6190}.play-visit{margin-top:22px;display:flex;gap:12px;flex-wrap:wrap}
@media(max-width:600px){.rally-header{top:8px;left:8px;right:8px;gap:6px}.rally-header h1{font-size:18px;padding:9px}.rally-stats{font-size:14px;padding:10px;gap:10px}.rally-header .icon-btn{width:40px;height:40px}.rally-hint{top:70px;font-size:13px;padding:8px 12px}.rally-overlay{inset:70px 0 0}.play-games{grid-template-columns:1fr}.rally-directions{bottom:36px;grid-template-columns:repeat(3,56px)}.rally-directions button{width:56px;height:50px}}

.rally-car{display:grid;justify-items:center;gap:6px;border:5px solid #202747;border-radius:22px;background:#e5d6ff;padding:12px;cursor:pointer;color:#202747;font:inherit;box-shadow:0 5px 0 #202747}.rally-car svg{width:100%;max-width:280px;height:130px}.rally-car strong{font:26px 'Lilita One',sans-serif}.rally-car[aria-pressed=true]{border-color:#209a58;background:#dcf4dd;box-shadow:0 5px 0 #18723f}.rally-car-choice{font-weight:900}.rally-start:disabled{opacity:.5;cursor:default}.rally-overlay{overflow:auto;padding:16px;box-sizing:border-box}.rally-panel{margin:auto}
/* Keep touch steering at the side, clear of the road and finish line. */
.rally-directions{left:auto;right:max(16px,env(safe-area-inset-right));bottom:80px;transform:none;grid-template-columns:repeat(3,56px)}
.rally-directions button{width:56px;height:56px;-webkit-user-select:none;-webkit-touch-callout:none}
.rally-keyboard{left:auto;right:16px;bottom:30px;max-width:190px}
@media(max-width:600px){.rally-directions{right:12px;bottom:70px;grid-template-columns:repeat(3,52px);gap:6px}.rally-directions button{width:52px;height:52px}.rally-keyboard{right:12px;bottom:22px;max-width:168px;font-size:12px}}
.rally-worlds{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.rally-worlds button{padding:10px;border:3px solid #202747;border-radius:12px;background:white;color:#202747;font:inherit;font-weight:900;cursor:pointer}.rally-worlds button[aria-pressed=true]{background:#ffcf36}.rally-place{background:#ffcf36;border:3px solid #202747;border-radius:14px;padding:10px;font-weight:900;white-space:nowrap}.rally-sound{margin-left:auto}.rally-pause{margin-left:0}@media(max-width:600px){.rally-header{flex-wrap:wrap}.rally-header h1{font-size:16px}.rally-place{padding:6px}.rally-hint{top:116px}.rally-overlay{inset:110px 0 0}.rally-panel{padding:16px;gap:10px}}
.play-game h3{display:flex;align-items:center;gap:9px}.play-flat-icon{width:30px;height:30px;flex:0 0 30px;color:#202747}
.memory-exit{margin-left:auto}.memory-toolbar{position:absolute;top:88px;left:16px;right:16px;display:flex;gap:12px;justify-content:center;align-items:center;flex-wrap:wrap;font-weight:900}.memory-toolbar select{font:inherit;border:2px solid #202747;border-radius:10px;background:white;padding:8px;color:#202747}.memory-message{flex-basis:100%;text-align:center;margin:0;font-size:14px}.memory-grid{position:absolute;left:50%;transform:translateX(-50%);display:grid;grid-template-columns:repeat(4,1fr);grid-template-rows:repeat(3,1fr)}.memory-grid button{border:0;background:transparent;color:#fff;font:24px 'Lilita One',sans-serif;cursor:pointer;text-shadow:0 1px 3px #202747;display:flex;align-items:flex-end;justify-content:center;padding:0 0 15%;touch-action:manipulation}.memory-grid button:focus-visible{outline:4px solid #ffcf36;outline-offset:-8px;border-radius:12px}.memory-grid button.matched{color:#202747;text-shadow:0 1px white;cursor:default}@media(max-width:600px){.memory-game .rally-header{flex-wrap:nowrap}.memory-score{font-size:12px!important}.memory-toolbar{top:75px;gap:6px}.memory-grid button{font-size:14px}.memory-toolbar label{font-size:13px}.memory-toolbar .btn{padding:8px}}
.memory-sound{margin-left:auto}.memory-exit{margin-left:0}
.mini-sound{margin-left:auto}.mini-task{position:absolute;top:95px;left:50%;transform:translateX(-50%);background:white;border:3px solid #202747;border-radius:18px;padding:12px 20px;text-align:center;font-weight:900;max-width:85%;width:max-content}.mini-controls{position:absolute;bottom:64px;left:50%;transform:translateX(-50%);display:flex;gap:10px;flex-wrap:wrap;justify-content:center;width:min(700px,94%)}.mini-feedback{position:absolute;bottom:12px;left:3%;right:3%;text-align:center;font-weight:900;font-size:14px;background:#ffffffdf;border-radius:12px;padding:8px;margin:0}.pattern-colors{display:flex;gap:8px;justify-content:center;flex-basis:100%}.mini-access{flex-basis:100%;text-align:center;font-size:13px;font-weight:900}.mini-access div{display:flex;gap:6px;justify-content:center;flex-wrap:wrap;background:#fff;padding:10px;border-radius:12px}.mini-controls [hidden]{display:none!important}@media(max-width:600px){.mini-game .rally-header h1{font-size:16px}.mini-game .rally-stats{font-size:12px}.mini-task{top:108px;font-size:15px}.mini-controls{bottom:84px;gap:6px}.mini-controls .btn{padding:8px 12px;font-size:14px}.mini-feedback{font-size:12px}.pattern-colors{gap:5px}}

.rally-camera{border:3px solid #202747;border-radius:14px;padding:10px 12px;background:#fff;color:#202747;font:900 14px Nunito,system-ui;cursor:pointer;box-shadow:0 4px #202747}.rally-camera[aria-pressed=true]{background:#ffcf36}.rally-camera:focus-visible{outline:3px solid #387bff;outline-offset:3px}@media(max-width:600px){.rally-header{flex-wrap:wrap}.rally-header h1{font-size:15px}.rally-camera{padding:8px;font-size:12px}.rally-hint{top:112px}.rally-overlay{top:112px}}

.rally-speed{position:absolute;bottom:30px;left:24px;padding:12px 18px;background:#202747;color:white;border:3px solid white;border-radius:16px;font-size:24px;font-weight:900;font-variant-numeric:tabular-nums}.rally-brake{position:absolute;bottom:46px;right:24px;z-index:3;border:3px solid #202747;border-radius:16px;background:#ff5148;color:white;font:900 16px Nunito,system-ui;padding:16px;touch-action:none;cursor:pointer}.rally-brake.held{background:#ab2329}.rally-cockpit{position:absolute;bottom:0;left:18%;right:18%;height:145px;pointer-events:none;z-index:1}.rally-cockpit[hidden]{display:none}.rally-dash{position:absolute;inset:30px 0 0;background:linear-gradient(#3b4055,#171c2c);border:8px solid #141a2c;border-radius:65% 65% 0 0;display:flex;align-items:center;justify-content:space-around;color:#ccd4e8;box-shadow:0 -6px 0 #ff5148}.rally-dash>span{font-size:12px;letter-spacing:3px}.rally-wheel{font:110px/1 system-ui;color:#111622;text-shadow:0 0 3px #94a5b7;transition:transform .08s;position:relative;top:15px}.rally-dash-speed{font:900 30px monospace;color:#7cffaa;background:#080e18;border-radius:10px;padding:8px 20px}.rally-directions,.rally-keyboard{z-index:3}.rally-keyboard{background:#ffffffd9;width:max-content;max-width:100%;padding:3px 10px;border-radius:12px;margin:auto;box-sizing:border-box}.rally-header{z-index:4}.rally-overlay{z-index:5}.rally-speed{z-index:3}@media(max-width:600px){.rally-cockpit{left:12%;right:12%;height:110px}.rally-dash>span{display:none}.rally-wheel{font-size:75px}.rally-speed{bottom:160px;left:12px;font-size:18px}.rally-brake{bottom:180px;right:12px;padding:10px}.rally-dash-speed{font-size:22px}}

.rally-cameras{display:flex;gap:5px;background:#ffffffb8;padding:4px;border-radius:16px}.rally-cameras .rally-camera{width:42px;height:40px;padding:7px;display:grid;place-items:center;border-width:2px;border-radius:10px;box-shadow:0 3px #202747}.rally-camera svg{width:23px;height:23px}.rally-cameras .rally-camera[aria-pressed=true]{background:#ffcf36}@media(max-width:700px){.rally-header{flex-wrap:wrap}.rally-cameras{order:9}.rally-hint{top:125px}.rally-overlay{top:125px}.rally-header h1{font-size:15px}.rally-cameras .rally-camera{width:36px;height:34px;padding:5px}.rally-camera svg{width:21px;height:21px}}

.rally-brake{right:220px;bottom:80px}@media(max-width:600px){.rally-brake{right:12px;bottom:200px}}

.rally-instruments{position:absolute;bottom:34px;left:24px;z-index:3;width:210px;box-sizing:border-box;padding:12px 14px;border:3px solid #fff;border-radius:18px;background:#151c2e;color:#fff;box-shadow:0 4px #202747}.rally-instrument-top{display:flex;align-items:center;gap:10px}.rally-instruments .rally-speed{position:static;padding:0;border:0;background:none;font-size:22px;white-space:nowrap}.rally-gear{display:grid;place-items:center;min-width:30px;height:32px;background:#ffcf36;color:#202747;border-radius:6px;font:900 25px monospace}.rally-instrument-top small{font-size:10px;text-transform:uppercase;color:#ccd4e8}.rally-tach{height:10px;margin:10px 0 5px;border-radius:5px;overflow:hidden;background:#3a4258}.rally-tach>span{display:block;height:100%;background:linear-gradient(90deg,#3ec78a,#ffcf36);transition:width .08s}.rally-tach.redline>span{background:#ff5148}.rally-rpm{font:700 12px monospace;color:#ccd4e8;letter-spacing:1px}@media(max-width:600px){.rally-instruments{left:10px;bottom:28px;width:155px;padding:9px}.rally-instruments .rally-speed{font-size:17px}.rally-instrument-top{gap:6px}.rally-gear{min-width:25px;font-size:22px}.rally-instrument-top small{font-size:8px}}

.rally-timing{position:absolute;top:125px;left:16px;z-index:3;width:225px;padding:12px;background:#202747eb;color:white;border:2px solid #fff;border-radius:16px;pointer-events:none;font-size:13px;font-variant-numeric:tabular-nums}.rally-timing table,.rally-results table{width:100%;border-collapse:collapse;text-align:left}.rally-timing caption,.rally-results caption{text-align:left;font-weight:900;margin-bottom:8px}.rally-timing th,.rally-timing td,.rally-results th,.rally-results td{padding:5px}.rally-timing thead{color:#c6d2ed}.rally-timing td:last-child,.rally-results td:last-child{text-align:right;white-space:nowrap}.rally-timing .is-you{background:#ffffff20;color:#ffcf36}.rally-timing p{font-size:11px;margin:8px 0 0}.rally-timing small{opacity:.7}.rally-results{margin:16px 0}.rally-results .is-you{background:#fff1b8}@media(max-width:700px){.rally-timing{top:172px;left:8px;width:175px;padding:6px;font-size:11px}.rally-timing th,.rally-timing td{padding:3px}.rally-timing caption{margin-bottom:3px}}@media(max-height:500px){.rally-timing{top:90px;left:8px;width:175px;padding:5px;font-size:10px}.rally-timing p{margin-top:3px}}

.rally-styles{border:0;margin:12px 0 0;padding:0;display:flex;gap:8px;justify-content:center}.rally-styles legend{font-weight:900;margin:auto auto 8px}.rally-styles button{padding:8px 16px;border:2px solid #202747;border-radius:12px;background:white;color:#202747;font:inherit;font-weight:900;cursor:pointer}.rally-styles button[aria-pressed=true]{background:#ffcf36;box-shadow:0 3px #202747}.rally-style-hint{font-size:13px!important;min-height:32px}.rally-panel .rally-car svg{max-height:130px}

.rally-menu{font:inherit;color:inherit;border:0;background:none;cursor:pointer;padding:0}.rally-menu:focus-visible{outline:3px solid #ffcf36;outline-offset:5px;border-radius:4px}
