/* css/oras.css — Autobuzul de Oraș (city bus on real OSM streets) */
#or-stage {
    position: relative; width: 100%; height: 78vh; min-height: 420px;
    border-radius: 12px; overflow: hidden; background: #7fb4e6;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}
#or-canvas { display: block; width: 100%; height: 100%; }
.or-hidden { display: none !important; }

/* HUD */
#or-hud { position: absolute; inset: 0; pointer-events: none; z-index: 7; }   /* above the touch layer (z6) so HUD buttons stack cleanly; HUD is click-through except its own buttons */
.or-hud-top { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.or-box {
    background: rgba(0, 0, 0, 0.55); color: #fff; border-radius: 8px; padding: 0.25rem 0.7rem;
    display: flex; flex-direction: column; align-items: center; min-width: 64px;
}
.or-box .or-label { font-size: 0.6rem; color: #ffd23b; letter-spacing: 0.05em; }
.or-box span:last-child { font-size: 1.15rem; font-weight: 800; }
.or-status {
    position: absolute; top: 148px; right: 8px; left: auto; transform: none;   /* clears the top-right icon stack (quit/fs/cam) below it */
    max-width: 70%; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background: rgba(20, 110, 180, 0.88); color: #fff; font-weight: 700;
    padding: 0.35rem 1rem; border-radius: 10px; font-size: 0.95rem; pointer-events: none;
}
/* door controls — TAPPABLE: door icon opens/closes the unlocked doors (F); numbered chips lock/unlock each door (1·2·3) */
.or-doors {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.6); color: #fff; font-weight: 700; font-size: 1rem;
    padding: 0.3rem 0.55rem; border-radius: 12px; pointer-events: none; display: flex; gap: 8px; align-items: center;
}
.or-doors button {
    pointer-events: auto; cursor: pointer; border: 0; font: inherit; font-weight: 800; color: #fff;
    min-width: 2.6em; min-height: 2.6em; padding: 0.2em 0.45em; border-radius: 8px;
    display: inline-flex; align-items: center; justify-content: center; gap: 0.25em; -webkit-tap-highlight-color: transparent;
}
.or-doors button:active { transform: scale(0.92); }
.od-toggle { background: rgba(255, 255, 255, 0.16); }
.od-toggle.is-open { background: #2ecc71; color: #07260f; }                                                       /* doors currently open */
.or-doors .od-sel { background: rgba(255, 200, 60, 0.22); color: #ffd23b; box-shadow: inset 0 0 0 1px #ffd23b; }   /* unlocked → opens with the door button / F */
.or-doors .od-off { background: rgba(255, 255, 255, 0.1); color: #80868f; }                                       /* locked */
.or-doors .od-open { background: #2ecc71; color: #07260f; }                                                       /* currently open */
.or-doors .od-off i { font-size: 0.72em; }
/* on phones, park the door bar just ABOVE the gas/brake cluster (bottom-right) so it's an easy thumb reach */
#or-stage.is-touch .or-doors { left: auto; right: 14px; bottom: 92px; transform: none; }   /* 14 (cluster bottom) + 70 (button) + 8 gap */
/* center warning banner — wrong-way (sens interzis) + emergency-vehicle priority */
.or-warn {
    position: absolute; top: 16%; left: 50%; transform: translateX(-50%);
    background: rgba(200, 40, 30, 0.92); color: #fff; font-weight: 800; letter-spacing: 0.02em;
    padding: 0.5rem 1.4rem; border-radius: 12px; font-size: 1.15rem; text-align: center; white-space: nowrap;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5); pointer-events: none; animation: or-warn-pulse 0.8s ease-in-out infinite;
}
.or-warn.or-warn-prio { background: rgba(225, 120, 20, 0.94); }   /* emergency priority = amber */
@keyframes or-warn-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
/* current-street location label (top-left, under the compass) — separate from the station status */
.or-loc {
    position: absolute; top: 74px; left: 10px; z-index: 9; max-width: 42%;
    background: rgba(20, 110, 180, 0.8); color: #fff; font-weight: 700; font-size: 0.85rem;
    padding: 0.25rem 0.7rem; border-radius: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none;
}
.or-weather {   /* live current weather + temperature (life-sim) */
    position: absolute; top: 106px; left: 10px; z-index: 9;
    background: rgba(20, 110, 180, 0.72); color: #fff; font-weight: 700; font-size: 0.82rem;
    padding: 0.2rem 0.7rem; border-radius: 9px; white-space: nowrap; pointer-events: none;
}
#or-stage.is-touch .or-weather { top: 198px; }
/* mobile: lift the station-name banner up beside the top-right button stack — clear of the icon column and NOT level with the left map/loc/weather column */
#or-stage.is-touch .or-status { top: 8px; right: 56px; max-width: 52%; font-size: 0.8rem; padding: 0.3rem 0.75rem; }
/* floating "+N lei" reward popup (under the LEI box) */
.or-money-pop {
    position: absolute; top: 52px; left: 50%; transform: translateX(-50%); opacity: 0;
    color: #2ecc71; font-weight: 800; font-size: 1.1rem; text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6); pointer-events: none;
}
.or-money-pop.or-pop-go { animation: or-pop 1.1s ease-out; }
.or-money-pop.or-pop-dmg { color: #ff5252; }   /* daune — repair bill deducted from earnings */
@keyframes or-pop { 0% { opacity: 0; transform: translate(-50%, 6px); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -22px); } }
.or-icon-btn {
    position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 8px; border: 0;
    background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 1.1rem; pointer-events: auto; cursor: pointer;
}
.or-fs-btn { top: 54px; }
.or-cam-btn { top: 100px; }   /* third icon in the top-right stack (chase/inside/orbit camera switch — works on mobile too) */
.or-sound-btn { top: 146px; }   /* fourth icon — mute/unmute engine, horns & Romanian chatter */
.or-voice-btn { top: 192px; }   /* fifth icon — how to enable a Romanian TTS voice */
.or-voice-btn.is-hint {         /* pulse once when we detect no Romanian voice is installed */
    animation: or-voice-pulse 1s ease-in-out 4;
    box-shadow: 0 0 0 2px #ffd23b, 0 0 14px rgba(255, 210, 59, 0.8);
    color: #ffd23b;
}
@keyframes or-voice-pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* Romanian-voice help overlay */
.or-voicehelp {
    position: absolute; inset: 0; z-index: 12; display: flex; align-items: center; justify-content: center;
    padding: 1rem; background: rgba(6, 9, 14, 0.72); pointer-events: auto;
}
.or-voicehelp.or-hidden { display: none; }
.or-voicehelp-card {
    width: min(560px, 94vw); max-height: 88vh; overflow-y: auto; text-align: left;
    background: #141a24; color: #e8edf4; border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px; box-shadow: 0 18px 60px rgba(0, 0, 0, 0.6);
}
.or-voicehelp-hd {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 0.85rem 1.1rem; font-weight: 800; font-size: 1.05rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); background: rgba(255, 255, 255, 0.04);
    border-radius: 14px 14px 0 0;
}
.or-vh-close {
    border: 0; background: rgba(255, 255, 255, 0.1); color: #fff; width: 30px; height: 30px;
    border-radius: 8px; cursor: pointer; font-size: 0.95rem; line-height: 1;
}
.or-vh-close:hover { background: rgba(255, 90, 90, 0.85); }
.or-voicehelp-body { padding: 0.9rem 1.1rem 1.1rem; font-size: 0.92rem; line-height: 1.5; }
.or-voicehelp-body p { margin: 0 0 0.75rem; }
.or-voicehelp-body b { color: #ffd23b; }
.or-vh-note { font-size: 0.82rem; opacity: 0.72; margin-bottom: 0 !important; }

/* overlays */
.or-overlay {
    position: absolute; inset: 0; z-index: 8; display: flex; overflow-y: auto;
    background: radial-gradient(ellipse at center, rgba(12, 16, 24, 0.78), rgba(8, 10, 14, 0.94));
    color: #fff; text-align: center; padding: 1rem;
}
.or-menu-inner { max-width: 620px; width: 100%; margin: auto; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.or-title { font-weight: 900; letter-spacing: 0.02em; margin: 0; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5); }
.or-sub { color: #cfd6e0; font-size: 0.95rem; max-width: 560px; margin: 0; }

/* city picker (multi-city select) — reuses .or-bus-opt visuals, laid out as a scrollable grid */
.or-city-pick { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; margin: 0.2rem 0; width: 100%; }
.or-city-pick-lbl { color: #aeb6c2; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.or-city-opts {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.55rem; width: 100%; max-width: 560px; margin: 0 auto;
    max-height: 34vh; overflow-y: auto; padding: 0.2rem;
}
.or-city-opt { min-width: 0; }
.or-city-region {
    grid-column: 1 / -1; text-align: left; color: #8b93a0; font-size: 0.72rem;
    text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.25rem;
}

/* next-station compass (HUD) */
.or-compass {
    position: absolute; top: 10px; left: 10px; z-index: 9;
    width: 56px; height: 56px; border-radius: 50%;
    background: rgba(18, 22, 28, 0.62); border: 2px solid rgba(255, 255, 255, 0.25);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.or-compass-arrow { display: block; font-size: 2rem; line-height: 1; color: #ff3b6b; transform-origin: 50% 50%; transition: transform 0.12s linear; }
.or-compass-lbl { font-size: 0.5rem; letter-spacing: 0.08em; color: #cfd6e0; margin-top: 1px; }
/* GPS minimap — bottom-left on desktop; top-left on mobile (replaces the compass, which is hidden there) */
.or-map {
    position: absolute; left: 10px; bottom: 10px; width: 172px; height: 172px; z-index: 9;
    border-radius: 10px; border: 2px solid rgba(255, 255, 255, 0.22); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.5);
    pointer-events: none; background: rgba(16, 20, 26, 0.6);
}
#or-stage.is-touch .or-map { left: 8px; bottom: auto; top: 8px; width: 150px; height: 150px; }   /* use the free top-left space (compass is hidden on touch) */
#or-stage.is-touch .or-compass { display: none; }
#or-stage.is-touch .or-loc { top: 166px; }

/* bus-type picker (Solaris big bus vs Karsan minibus) */
.or-bus-pick { display: flex; flex-direction: column; align-items: center; gap: 0.45rem; margin: 0.2rem 0; }
.or-bus-pick-lbl { color: #aeb6c2; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
.or-bus-opts { display: flex; gap: 0.6rem; flex-wrap: wrap; justify-content: center; }
.or-bus-opt {
    display: flex; flex-direction: column; align-items: center; gap: 0.1rem;
    min-width: 150px; padding: 0.55rem 0.9rem; cursor: pointer;
    background: rgba(255, 255, 255, 0.06); color: #e8edf3; font-weight: 700; font-size: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.18); border-radius: 0.7rem; transition: all 0.15s;
}
.or-bus-opt small { font-weight: 400; font-size: 0.72rem; color: #9aa3b0; }
.or-bus-opt:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.35); }
.or-bus-opt.is-active { background: rgba(58, 168, 49, 0.22); border-color: #3aa831; color: #fff; }
.or-bus-opt.is-active small { color: #bfe6b8; }

/* god-mode region picker (fly mode only) — jump the survey camera to any district */
.or-regions {
    position: absolute; top: 50%; left: 8px; transform: translateY(-50%); z-index: 10;
    width: 188px; max-height: 74%; display: flex; flex-direction: column;
    background: rgba(15, 18, 24, 0.84); border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px; padding: 7px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.5);
}
.or-regions-hd { color: #aeb6c2; font-size: 0.72rem; letter-spacing: 0.09em; text-align: center; margin-bottom: 5px; }
.or-region-search {
    width: 100%; box-sizing: border-box; margin-bottom: 6px; pointer-events: auto;
    background: rgba(255, 255, 255, 0.1); color: #fff; border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px; padding: 0.4rem 0.55rem; font-size: 0.82rem; outline: none;
}
.or-region-search::placeholder { color: #8b93a0; }
.or-region-search:focus { border-color: #3aa831; background: rgba(255, 255, 255, 0.15); }
.or-regions-list { display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.or-region-btn {
    background: rgba(255, 255, 255, 0.07); color: #eef3f8 !important; border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px; padding: 0.36rem 0.55rem; font-size: 0.84rem; font-weight: 600; font-style: normal; cursor: pointer;
    text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.65);
}
.or-region-btn:hover, .or-region-btn.is-hi { background: rgba(58, 168, 49, 0.30); border-color: #3aa831; }
#or-regions-list .or-region-btn[data-kind="street"] { color: #d4e6f5 !important; }
#or-regions-list .or-region-btn[data-kind="depot"] { color: #ffe08a !important; }
.or-regions-empty { color: #8b93a0; font-size: 0.74rem; text-align: center; padding: 0.5rem 0.2rem; }

/* attribution (OSM ODbL requirement) */
.or-attrib {
    position: absolute; bottom: 4px; right: 6px; z-index: 9;
    background: rgba(255, 255, 255, 0.7); color: #222; font-size: 0.68rem;
    padding: 1px 6px; border-radius: 4px; pointer-events: none;
}

/* touch controls */
#or-touch { position: absolute; inset: 0; z-index: 6; pointer-events: none; }
.or-touch-left { position: absolute; left: 16px; bottom: 16px; display: flex; gap: 14px; }
.or-touch-right { position: absolute; right: 16px; bottom: 16px; display: flex; gap: 14px; }
.or-touch-btn {   /* bigger, easier-to-press driving buttons */
    width: 96px; height: 96px; border-radius: 50%; border: 0; pointer-events: auto; cursor: pointer;
    background: rgba(255, 255, 255, 0.18); color: #fff; font-size: 1.9rem;
    display: inline-flex; align-items: center; justify-content: center; backdrop-filter: blur(2px);
    -webkit-tap-highlight-color: transparent; touch-action: none;
}
.or-touch-btn:active { background: rgba(255, 255, 255, 0.34); transform: scale(0.95); }
.or-touch-btn.or-gas { background: rgba(46, 204, 113, 0.34); }
.or-touch-btn.or-brake { background: rgba(231, 76, 60, 0.32); }
#or-stage:not(.is-touch) #or-touch { display: none !important; }

/* horn + turn-signal cluster (H / Q / E on desktop; tap on mobile).
   Top-centre (under the KM/H·LEI boxes) so it never overlaps the door / wheel / gas controls at the bottom. */
.or-signals { position: absolute; left: 50%; top: 64px; transform: translateX(-50%); display: flex; gap: 12px; z-index: 7; pointer-events: none; }
.or-sig-btn {
    width: 52px; height: 52px; border-radius: 12px; border: 0; pointer-events: auto; cursor: pointer;
    background: rgba(0, 0, 0, 0.55); color: #fff; font-size: 1.2rem; display: inline-flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent; transition: background 0.1s ease, box-shadow 0.1s ease, color 0.1s ease;
}
.or-sig-btn.is-armed { color: #ff9500; box-shadow: 0 0 0 2px #ff9500; }
.or-sig-btn.is-on { background: #ff9500; color: #2a1c00; box-shadow: 0 0 14px rgba(255, 149, 0, 0.85); }
.or-horn-btn { background: rgba(24, 52, 96, 0.72); }
.or-horn-btn:active { background: #2d6fdb; transform: scale(0.94); }
/* on touch, keep it top-centre and enlarge it for easy tapping */
#or-stage.is-touch .or-signals { gap: 16px; }
#or-stage.is-touch .or-sig-btn { width: 66px; height: 66px; font-size: 1.5rem; }

/* on-screen steering wheel (mobile) — pure-CSS volan, rotated by JS; alternative to the chevron buttons */
.or-wheel {
    position: absolute; left: 16px; bottom: 16px; z-index: 6;
    width: 180px; height: 180px; border-radius: 50%;
    pointer-events: auto; cursor: grab; display: none; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.or-wheel:active { cursor: grabbing; }
.or-wheel-face {   /* a clean, centred circle: dark ring + centre hub + one top indicator (JS rotates it every frame — no CSS transition, so no flick) */
    position: absolute; inset: 0; border-radius: 50%;
    background: radial-gradient(circle at 50% 50%, #2c313a 0 46%, #16191f 46% 100%);
    border: 16px solid #1b1e24;
    box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.10), 0 5px 18px rgba(0, 0, 0, 0.55);
    transform-origin: 50% 50%;
}
.or-wheel-face::before {   /* centre hub */
    content: ""; position: absolute; top: 50%; left: 50%; width: 30%; height: 30%; transform: translate(-50%, -50%);
    border-radius: 50%; background: radial-gradient(circle at 42% 38%, #565d6b, #23262e 72%); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.or-wheel-spoke {   /* single TOP indicator → shows the steering angle as the wheel turns */
    position: absolute; left: 50%; top: 10%; bottom: 52%; width: 12px; transform: translateX(-50%);
    border-radius: 6px; background: linear-gradient(#d2d6dd, #9aa0aa);
}
/* mode switch (touch only): wheel mode shows the volan + hides chevrons; button mode does the opposite */
#or-stage.is-touch.steer-wheel .or-wheel { display: block; }
#or-stage.is-touch.steer-wheel .or-touch-left { display: none; }
#or-stage.is-touch.steer-btns .or-wheel { display: none; }
