#monkeyCart[hidden]{display:none!important}#monkeyCart{position:fixed;inset:0;z-index:100005;background:#050d18;color:#ffeab4;display:flex;justify-content:center;align-items:center;font:bold 14px monospace;touch-action:none}.cartFrame{width:min(1100px,100vw);border:3px solid #ffcf65;background:#092537}.cartHeader,.cartHud{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;background:#112f44}.cartHeader{color:#ffde80}.cartHud{border-top:1px solid #345064}.cartHeader button,.cartStart button,.cartResult button,.cartPrize button{font:inherit;padding:10px 14px;border:2px solid #fff0b4;background:#ffcf62;color:#142c3f;cursor:pointer}.cartView{position:relative;overflow:hidden}.raceCanvas{display:block;width:100%;height:min(68vh,720px);min-height:260px}.cartMessage{position:absolute;top:12%;left:8%;right:8%;text-align:center;font:bold clamp(20px,4vw,42px) monospace;color:#fff0b2;text-shadow:3px 3px #102436;pointer-events:none}.cartPrize{position:absolute;bottom:12px;right:12px;display:flex;gap:10px;align-items:center;padding:8px;background:#0a243ce8;border:2px solid #ffd478;min-width:210px}.cartPrize canvas{width:58px;height:58px}.cartPrize b,.cartPrize small{display:block}.cartPrize small{font-size:10px;color:#b8d5df;margin-top:5px}.cartPrize button:disabled{opacity:.4}.cartMap{position:absolute;left:12px;bottom:12px;width:170px;height:120px;background:#071b31c9;border:1px solid #6c9dab;pointer-events:none}.cartStart,.cartResult{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;width:min(420px,86%);box-sizing:border-box;background:#081f35f5;border:3px solid #ffcf65;padding:18px;line-height:1.8;z-index:4}.cartStart small{display:block;margin-top:8px;font-size:10px}.cartStart[hidden],.cartResult[hidden]{display:none}.touchHelp{display:none}.cartPad{display:none}body.monkeyCartPlaying #mobileControls{display:none!important}
@media(pointer:coarse),(max-width:700px){#monkeyCart{align-items:flex-start;padding-top:max(8px,env(safe-area-inset-top))}.cartFrame{margin:0;width:100%;box-sizing:border-box}.cartHeader,.cartHud{padding:8px;font-size:11px;gap:5px}.raceCanvas{height:calc(100dvh - 205px);min-height:230px}.cartPad{position:fixed;bottom:max(14px,env(safe-area-inset-bottom));left:8px;right:8px;display:flex;justify-content:space-between;gap:8px}.cartPad>div{display:flex;gap:6px}.cartPad button{touch-action:none;user-select:none;-webkit-user-select:none;background:#143d58e8;border:2px solid #ffdb7e;border-radius:50%;width:61px;height:61px;color:#ffedb5;font:bold 21px monospace}.cartPad button small{display:block;font-size:9px}.cartPad .driftButton{font-size:11px;width:54px}.cartPad button.held{background:#358aa5}.keyboardHelp{display:none}.touchHelp{display:block}.cartPrize{bottom:8px;right:8px;gap:6px;padding:5px;min-width:0;font-size:11px}.cartPrize canvas{width:42px;height:42px}.cartPrize button{padding:8px;font-size:11px}.cartPrize small{font-size:8px}.cartMap{width:100px;height:70px;left:8px;bottom:8px}.cartStart{font-size:12px;padding:10px}.cartMessage{top:15%;font-size:25px}}
@media(pointer:coarse) and (orientation:landscape){.raceCanvas{height:calc(100dvh - 88px)}.cartPad{bottom:12px}.cartPrize{bottom:80px}.cartMap{bottom:80px}}

.cartPad{display:flex;position:fixed;bottom:max(12px,env(safe-area-inset-bottom));left:16px;right:16px;justify-content:space-between;align-items:flex-end;pointer-events:none}.cartPad .wheelGroup{position:relative;display:block;width:156px;height:178px;pointer-events:auto}.cartPad .steeringWheel{position:absolute;bottom:0;left:13px;width:120px;height:120px;border:9px solid #203b4b;border-radius:50%;box-sizing:border-box;box-shadow:0 0 0 3px #ffd477,inset 0 0 0 2px #658592;background:#071d2980;touch-action:none;cursor:grab;transform:rotate(var(--wheel-angle,0deg));display:grid;place-items:center;color:#ffd477;font-size:88px;user-select:none}.wheelSpokes{line-height:1;pointer-events:none}.cartPad button{pointer-events:auto;background:#143d58ed;border:2px solid #ffdb7e;color:#ffedb5;font:bold 12px monospace;touch-action:none;user-select:none}.cartPad .weaponButton{position:absolute;top:0;left:0;width:74px;height:42px;border-radius:8px}.cartPad .driftButton{position:absolute;top:0;right:0;width:74px;height:42px;border-radius:8px}.cartPad .brakeButton{width:76px;height:76px;border-radius:50%}.cartPad button.held{background:#358aa5}.cartMap{bottom:195px}.cartPrize{bottom:100px}@media(min-width:701px) and (pointer:fine){.raceCanvas{height:min(72vh,720px)}.cartPad{left:max(16px,calc((100vw - 1100px)/2 + 16px));right:max(16px,calc((100vw - 1100px)/2 + 16px))}}

/* Wheel and its two buttons share one fixed layout on every viewport. */
#monkeyCart .cartPad .wheelGroup{width:164px;height:210px;display:block;position:relative}
#monkeyCart .cartPad .steeringWheel{left:2px;bottom:0;width:160px;height:160px;border:0;border-radius:50%;box-shadow:none;background:none;display:block;cursor:grab}
#monkeyCart .cartPad .wheelArt{display:block;width:100%;height:100%;pointer-events:none;filter:drop-shadow(0 3px 2px #0009)}
#monkeyCart .cartPad .weaponButton,#monkeyCart .cartPad .driftButton{top:0;width:78px;height:42px;border-radius:8px;font-size:12px}
#monkeyCart .cartPad .weaponButton{left:0;right:auto}#monkeyCart .cartPad .driftButton{right:0;left:auto}
#monkeyCart .cartPrize{top:8px;bottom:auto;right:8px;z-index:3}#monkeyCart .cartMap{bottom:228px}
@media(max-height:480px){#monkeyCart .cartPad .wheelGroup{width:132px;height:166px}#monkeyCart .cartPad .steeringWheel{width:124px;height:124px;left:4px}#monkeyCart .cartPad .weaponButton,#monkeyCart .cartPad .driftButton{width:64px;height:34px;font-size:10px}#monkeyCart .cartMap{bottom:180px}}

#monkeyCart .cartPad .wheelGroup{height:160px;width:164px}#monkeyCart .cartPad .wheelPrize{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%) rotate(calc(-1 * var(--wheel-angle,0deg)));width:58px;height:58px;border-radius:50%;background:#142c3f;border:2px solid #ffd477;padding:4px;display:grid;place-items:center;z-index:2;pointer-events:auto}#monkeyCart .wheelPrize canvas{width:44px;height:44px;pointer-events:none}#monkeyCart .wheelPrize:disabled{opacity:1;cursor:default}#monkeyCart .wheelPrize b,#monkeyCart .wheelPrize small{display:none}#monkeyCart .cartPad .raceActions{display:flex;align-items:center;gap:12px;pointer-events:auto}#monkeyCart .cartPad .raceActions .driftButton{position:static;width:76px;height:76px;border-radius:50%;font-size:12px}#monkeyCart .cartMap{bottom:180px}@media(max-height:480px){#monkeyCart .cartPad .wheelGroup{height:124px;width:132px}#monkeyCart .cartPad .wheelPrize{width:48px;height:48px}#monkeyCart .wheelPrize canvas{width:36px;height:36px}#monkeyCart .cartPad .raceActions button{width:62px;height:62px}#monkeyCart .cartMap{bottom:142px}}

#monkeyCart{padding:0!important;align-items:stretch!important}#monkeyCart .cartFrame{width:100vw!important;height:100dvh;border:0;display:flex;flex-direction:column;margin:0}#monkeyCart .cartView{flex:1;min-height:0}#monkeyCart .raceCanvas{width:100%!important;height:100%!important;min-height:0!important}#monkeyCart .cartHeader,#monkeyCart .cartHud{flex:none}#monkeyCart .cartPad{left:16px!important;right:16px!important}

.desktopRaceControls{position:absolute;top:10px;left:10px;z-index:2;border-collapse:collapse;background:#071e31e8;color:#ffe7a4;font:bold 11px monospace;pointer-events:none;display:none}.desktopRaceControls th,.desktopRaceControls td{border:1px solid #63808d;padding:5px 8px;text-align:left}.desktopRaceControls th{color:#ffcf65;background:#13384c}@media(pointer:fine){.desktopRaceControls{display:table}}

@media(pointer:coarse){#monkeyCart .cartPad{left:max(8px,env(safe-area-inset-left))!important;bottom:max(8px,env(safe-area-inset-bottom))}#monkeyCart .cartPad .wheelGroup{transform:scale(.5);transform-origin:left bottom;width:82px;height:80px}#monkeyCart .cartMap{bottom:100px}}

#monkeyCart .raceCanvas{background:#062743 url('cart-art/city-course-v49.png') center center/cover no-repeat}#monkeyCart .cartView{background:#062743}

#monkeyCart .cartMap{top:10px;right:10px;left:auto;bottom:auto!important;z-index:2}
