/* b333ps simulator — the test lot (stage 0). */
html body.bal-page.b3-page { background: var(--bal-bg, #10151c); margin: 0; overflow: hidden; touch-action: none; }
/* Nothing on this page is text to select: a pedal held down is HELD, and a phone must not answer that by highlighting its
   word and offering Copy (owner, 2026-12-02, on an iPhone: "I keep selecting the text inside the buttons"). The boxes
   of the car's numbers are the one thing typed into. */
.b3-page, .b3-page * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.b3-page input, .b3-page textarea { -webkit-user-select: text; user-select: text; }
#b3-canvas { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }

#b3-hud { position: fixed; inset: 0; pointer-events: none; color: #fff; font-family: var(--bal-font, 'm6x11plus', monospace); text-shadow: 0 2px 0 rgba(0, 0, 0, 0.55); }
#b3-speed { position: absolute; right: 18px; bottom: 16px; font-size: 54px; line-height: 1; text-align: right; }
#b3-speed small { font-size: 20px; margin-left: 6px; opacity: 0.8; }
#b3-meter { position: absolute; right: 18px; bottom: 78px; width: 170px; height: 14px; border: 2px solid #fff; border-radius: 8px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
#b3-meter-fill { height: 100%; width: 0; background: #ffb400; }
#b3-meter.b3-boost #b3-meter-fill { background: #4ad6ff; }
#b3-tips { position: absolute; left: 18px; top: 14px; font-size: 34px; color: #7dff8a; }
#b3-sky { position: absolute; left: 16px; top: 238px; font-size: 20px; color: #9fd8ff; max-width: 46vw; }   /* the weather, a rush, a speed trap, a parking countdown: under the map */
#b3-task { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); font-size: 22px; text-align: center; max-width: 60vw; }
#b3-pop { position: absolute; left: 50%; top: 26%; transform: translateX(-50%); font-size: 38px; color: #ffe066; text-align: center; opacity: 0; transition: opacity 0.25s; white-space: nowrap; }
#b3-pop.b3-on { opacity: 1; }

#b3-menu-btn { position: fixed; right: 12px; top: 10px; z-index: 5; padding: 6px 14px; font-size: 18px; }

.b3-overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; background: rgba(3, 4, 6, 0.6); padding: 12px; }
.b3-overlay[hidden] { display: none; }
.b3-panel { width: min(560px, 100%); max-height: 100%; overflow: auto; text-align: center; }
.b3-note { color: var(--bal-text-muted, #b9c4c7); font-size: 16px; line-height: 1.25; margin: 8px 0; }
.b3-col { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin-top: 10px; }
.b3-panel .bal-btn.b3-focus { outline: 3px solid var(--bal-attn, #ff9a00); outline-offset: 2px; }
.b3-keys { width: 100%; border-collapse: collapse; font-size: 15px; text-align: left; margin: 8px 0; }
.b3-keys th { color: #fff; padding: 3px 8px 3px 0; white-space: nowrap; vertical-align: top; font-weight: normal; }
.b3-keys td { color: var(--bal-text-muted, #b9c4c7); padding: 3px 0; }
.b3-tune { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; text-align: left; margin: 10px 0; }
.b3-tune label { display: flex; flex-direction: column; font-size: 14px; color: var(--bal-text-muted, #b9c4c7); }
.b3-tune input { font: inherit; font-size: 16px; padding: 3px 6px; border-radius: 6px; border: 2px solid #3a4658; background: #0e141b; color: #fff; width: 100%; box-sizing: border-box; }
.b3-tune label.b3-changed { color: #ffb400; }

/* touch controls: shown once a finger is used (or on a touch-first device) */
#b3-touch { display: none; }
body.b3-touch-on #b3-touch { display: block; }
#b3-wheel { position: fixed; left: max(14px, env(safe-area-inset-left)); bottom: max(18px, env(safe-area-inset-bottom)); width: 190px; height: 110px; border-radius: 55px; background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(255, 255, 255, 0.35); touch-action: none; }
#b3-wheel-nub { position: absolute; left: 50%; top: 50%; width: 74px; height: 74px; margin: -37px 0 0 -37px; border-radius: 50%; background: rgba(255, 255, 255, 0.5); }
#b3-pedals { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); display: grid; grid-template-columns: 78px 78px 92px; gap: 8px; align-items: end; }
.b3-tb { height: 78px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, 0.5); background: rgba(20, 28, 40, 0.55); color: #fff; font: inherit; font-family: var(--bal-font, 'm6x11plus', monospace); font-size: 20px; touch-action: none; }
.b3-tb-gas { height: 110px; background: rgba(60, 170, 90, 0.6); }
.b3-tb-brake { background: rgba(190, 70, 60, 0.6); }
.b3-tb-drift { background: rgba(230, 160, 30, 0.6); }
.b3-tb.b3-down { filter: brightness(1.5); }
body.b3-touch-on #b3-speed { bottom: 150px; font-size: 40px; }
body.b3-touch-on #b3-meter { bottom: 198px; }
@media (orientation: portrait) {
	#b3-wheel { width: 128px; }
	#b3-pedals { grid-template-columns: 58px 58px 72px; }
	#b3-task { font-size: 17px; top: 52px; max-width: 92vw; }
}
#b3-back-btn { position: fixed; right: 84px; top: 10px; z-index: 5; padding: 6px 14px; font-size: 18px; }
/* the game's page has the site's gear and, signed in, its bell in the top right corner (site/topbar.js, compact): the top row stands clear of it */
.b3-bar #b3-menu-btn { right: 106px; }
.b3-bar #b3-back-btn { right: 178px; }
/* the city (js/city.js): the map in the corner, and the map data's credit */
#b3-map { position: absolute; left: 14px; top: 58px; width: 170px; height: 170px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.7); box-shadow: 0 3px 0 rgba(0, 0, 0, 0.4); }
#b3-credit { position: absolute; left: 14px; bottom: 10px; font-size: 13px; opacity: 0.85; }
body.b3-touch-on #b3-credit { left: 50%; transform: translateX(-50%); bottom: 4px; white-space: nowrap; }
@media (orientation: portrait) { #b3-map { width: 120px; height: 120px; top: 176px; } #b3-sky { top: 304px; } }
@media (max-height: 420px) { #b3-map { width: 120px; height: 120px; } #b3-sky { top: 186px; font-size: 16px; } }
#b3-out-btn { position: fixed; right: 228px; top: 10px; z-index: 5; padding: 6px 14px; font-size: 18px; }
#b3-out-btn[hidden] { display: none; }
@media (max-width: 480px) { #b3-out-btn { right: 12px; top: 52px; } }
/* the phone (js/phone.js): the orders on offer */
#b3-room-btn { position: fixed; left: 200px; top: 104px; z-index: 5; padding: 6px 14px; font-size: 18px; }   /* beside the map: clear of the line across the top */
#b3-room-btn[hidden] { display: none; }
/* watching a friend drive: nothing here is this page's to press */
.b3-watching #b3-phone-btn, .b3-watching #b3-out-btn, .b3-watching #b3-back-btn, .b3-watching #b3-menu-btn, .b3-watching #b3-touch { display: none !important; }
@media (orientation: portrait) { #b3-room-btn { left: 148px; top: 222px; } }
@media (max-height: 420px) { #b3-room-btn { left: 148px; } }
#b3-phone-btn { position: fixed; right: 290px; top: 10px; z-index: 5; padding: 6px 14px; font-size: 18px; }
#b3-phone-btn.b3-ph-ring { animation: b3-ring 0.9s ease-in-out infinite; }
@keyframes b3-ring { 50% { filter: brightness(1.45); transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) { #b3-phone-btn.b3-ph-ring { animation: none; outline: 3px solid #fff; } }
@media (max-width: 480px) { #b3-phone-btn { right: 84px; top: 52px; } }
#b3-phone { position: fixed; right: 12px; top: 54px; z-index: 20; width: min(330px, calc(100vw - 24px)); max-height: calc(100vh - 70px); overflow: auto; background: #10161f; border: 3px solid #2b3646; border-radius: 22px; box-shadow: 0 6px 0 rgba(0, 0, 0, 0.45); color: #fff; font-family: var(--bal-font, 'm6x11plus', monospace); font-size: 17px; }
#b3-phone[hidden] { display: none; }
@media (max-width: 480px) { #b3-phone { top: 96px; max-height: calc(100vh - 110px); } }
.b3-ph-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 14px; border-radius: 18px 18px 0 0; font-size: 20px; text-shadow: 0 2px 0 rgba(0, 0, 0, 0.4); }
.b3-ph-stars { font-size: 16px; white-space: nowrap; }
.b3-ph-now { padding: 8px 14px; background: #18212d; color: #ffe066; line-height: 1.25; }
.b3-ph-list { padding: 8px 10px 0; display: flex; flex-direction: column; gap: 8px; }
.b3-ph-none { color: var(--bal-text-muted, #b9c4c7); margin: 6px 4px; }
.b3-ph-card { background: #1b2532; border-left: 8px solid #888; border-radius: 10px; padding: 8px 10px; line-height: 1.25; }
.b3-ph-what, .b3-ph-life { color: var(--bal-text-muted, #b9c4c7); font-size: 15px; }
.b3-ph-nums { color: #7dff8a; }
.b3-ph-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.b3-ph-row .bal-btn, .b3-ph-close { font-size: 17px; padding: 6px 8px; min-height: 40px; }
.b3-ph-row .bal-btn:disabled { opacity: 0.55; }
.b3-ph-foot { padding: 10px; display: flex; }
.b3-ph-close { flex: 1; }
#b3-phone .bal-btn.b3-focus { outline: 3px solid var(--bal-attn, #ff9a00); outline-offset: 2px; }
/* the buttons in two rows, so the dashboard's line has the middle of the screen: Tune and Back above, Phone and Out below */
#b3-out-btn { right: 12px; top: 52px; }
#b3-phone-btn { right: 84px; top: 52px; }
#b3-phone { top: 96px; max-height: calc(100vh - 110px); }
@media (orientation: portrait) { #b3-task { top: 98px; } #b3-phone { top: 170px; max-height: calc(100vh - 184px); } }
/* a text message in the middle of the screen (shell.js pop with a long time): smaller, and it may wrap */
#b3-pop.b3-long { white-space: normal; font-size: 26px; width: min(92vw, 640px); }
/* the day's end (js/city.js) */
.b3-ph-foot { gap: 8px; flex-direction: column; }
.b3-ph-day[hidden] { display: none; }
.b3-day-rows th { color: var(--bal-text-muted, #b9c4c7); } .b3-day-rows td { color: #fff; text-align: right; font-size: 18px; }
.b3-day-rank { font-size: 20px; color: #ffe066; margin: 8px 0 4px; }
.b3-day-bar { height: 14px; border: 2px solid #fff; border-radius: 8px; background: rgba(0, 0, 0, 0.35); overflow: hidden; }
#b3-day-fill { height: 100%; width: 0; background: #7dff8a; }
/* the garage, on the day's screen (js/city.js, js/garage.js) */
.b3-shop-h { font-size: 18px; color: #fff; margin: 12px 0 6px; }
.b3-shop { max-height: 34vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding-right: 4px; }
.b3-shop-row { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.28); }
.b3-shop-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-align: left; }
.b3-shop-text b { color: #fff; font-size: 16px; } .b3-shop-text span { color: var(--bal-text-muted, #b9c4c7); font-size: 13px; }
.b3-shop-row .bal-btn { flex: none; min-width: 108px; font-size: 15px; padding: 6px 10px; }
.b3-shop-locked, .b3-shop-poor { opacity: 0.6; }
.b3-shop-riding { outline: 2px solid #7dff8a; }
