:root { --gold: #ffd23c; --ink: #0d1420; --panel: rgba(13, 20, 32, 0.78); --font: "Segoe UI", "Arial Hebrew", Arial, sans-serif; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--ink); font-family: var(--font); color: #fff; user-select: none; -webkit-user-select: none; touch-action: none; }
#view { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
[hidden] { display: none !important; }
#fade { position: fixed; inset: 0; background: #05070c; opacity: 0; pointer-events: none; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }

#hud { position: fixed; inset: 0; pointer-events: none; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7); }
#hud .ui-block, #hud button { pointer-events: auto; }
#topbar { position: absolute; top: max(14px, env(safe-area-inset-top)); inset-inline-end: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
#stars { font-size: 26px; letter-spacing: 2px; direction: ltr; }
#stars span { color: rgba(255, 255, 255, 0.22); transition: color 0.4s, transform 0.4s; display: inline-block; }
#stars span.on { color: var(--gold); text-shadow: 0 0 12px rgba(255, 210, 60, 0.9); transform: scale(1.12); }
#points { font-size: 22px; font-weight: 800; color: #9df59a; }
#clock { font-size: 15px; opacity: 0.85; font-variant-numeric: tabular-nums; direction: ltr; }

#objective { position: absolute; top: max(16px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); max-width: min(560px, 62vw); background: var(--panel); padding: 9px 18px; border-radius: 12px; font-size: 17px; font-weight: 600; text-align: center; border-bottom: 3px solid var(--gold); }
#meter { position: absolute; top: 74px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; background: var(--panel); padding: 6px 14px; border-radius: 10px; font-size: 14px; }
.bar { width: 170px; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, 0.18); overflow: hidden; direction: ltr; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #ffb13c, #ffe27a); border-radius: 6px; transition: width 0.15s; }

#banner { position: absolute; top: 30%; left: 0; right: 0; text-align: center; animation: bannerIn 0.6s cubic-bezier(.2, 1.4, .4, 1); }
#bannerTop { font-size: 17px; letter-spacing: 4px; color: var(--gold); font-weight: 700; }
#bannerTitle { font-size: clamp(34px, 6.2vw, 74px); font-weight: 900; line-height: 1.05; color: #fff; text-shadow: 0 3px 0 #1b2a4a, 0 6px 24px rgba(0, 0, 0, 0.7); }
#bannerSub { font-size: 20px; color: #9df59a; font-weight: 700; margin-top: 6px; }
#banner.out { transition: opacity 0.6s; opacity: 0; }
@keyframes bannerIn { from { opacity: 0; transform: scale(1.5); } to { opacity: 1; transform: none; } }

#toasts { position: absolute; top: 120px; inset-inline-start: 16px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.toast { background: var(--panel); padding: 7px 13px; border-radius: 10px; font-size: 15px; font-weight: 600; animation: toastIn 0.3s; transition: opacity 0.5s, transform 0.5s; }
.toast.out { opacity: 0; transform: translateY(-8px); }
@keyframes toastIn { from { opacity: 0; transform: translateX(-16px); } }

#prompt { position: absolute; bottom: 24%; left: 50%; transform: translateX(-50%); background: var(--panel); padding: 8px 16px; border-radius: 999px; font-size: 17px; font-weight: 700; border: 2px solid rgba(255, 255, 255, 0.35); white-space: nowrap; }
#prompt kbd { background: #fff; color: var(--ink); border-radius: 6px; padding: 1px 8px; font: inherit; text-shadow: none; margin-inline-end: 6px; }
#hold { position: absolute; bottom: calc(24% - 18px); left: 50%; transform: translateX(-50%); width: 220px; height: 8px; border-radius: 6px; background: rgba(0, 0, 0, 0.5); overflow: hidden; direction: ltr; }
#hold i { display: block; height: 100%; background: var(--gold); width: 0; }

#dialog { position: absolute; bottom: max(26px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); width: min(720px, 92vw); background: var(--panel); border-radius: 16px; padding: 14px 20px 12px; backdrop-filter: blur(6px); border: 1px solid rgba(255, 255, 255, 0.14); cursor: pointer; }
#dlgName { color: var(--gold); font-weight: 800; font-size: 16px; margin-bottom: 3px; }
#dlgText { font-size: 20px; line-height: 1.4; min-height: 2.8em; }
#dlgHint { font-size: 13px; opacity: 0.6; text-align: end; }

#minimap { position: absolute; bottom: max(18px, env(safe-area-inset-bottom)); left: 18px; width: 190px; height: 190px; border-radius: 16px; border: 2px solid rgba(255, 255, 255, 0.55); box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5); background: #1a2230; }
#street { position: absolute; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 198px); left: 18px; width: 190px; text-align: center; font-size: 14px; font-weight: 700; direction: ltr; }
#cornerBtns { position: absolute; top: max(14px, env(safe-area-inset-top)); inset-inline-start: 16px; display: flex; gap: 8px; }
#cornerBtns button { width: 42px; height: 42px; border-radius: 12px; background: var(--panel); font-size: 20px; }

#stick { position: absolute; width: 110px; height: 110px; margin: -55px 0 0 -55px; border-radius: 50%; background: rgba(255, 255, 255, 0.12); border: 2px solid rgba(255, 255, 255, 0.3); display: none; }
#stick.on { display: block; }
#knob { position: absolute; left: 30px; top: 30px; width: 50px; height: 50px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); }
#touchBtns { position: absolute; right: 16px; bottom: max(22px, env(safe-area-inset-bottom)); display: none; grid-template-columns: repeat(2, 64px); gap: 12px; direction: ltr; }
body.touch #touchBtns { display: grid; }
body.touch #minimap { width: 130px; height: 130px; top: 64px; bottom: auto; left: 16px; }
body.touch #street { display: none; }
body.touch #dlgHint { display: none; }
#touchBtns button { width: 64px; height: 64px; border-radius: 50%; background: rgba(13, 20, 32, 0.6); border: 2px solid rgba(255, 255, 255, 0.4); font-size: 26px; }
#touchBtns button.on { background: var(--gold); }
#touchBtns button.hide { visibility: hidden; }
#tAct.ready, #tCar.ready { border-color: var(--gold); box-shadow: 0 0 18px rgba(255, 210, 60, 0.8); }

.overlay { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(8, 12, 20, 0.72); backdrop-filter: blur(5px); z-index: 10; }
#start { background: linear-gradient(180deg, rgba(8, 12, 20, 0.35), rgba(8, 12, 20, 0.86)); backdrop-filter: none; align-items: flex-end; justify-content: flex-start; }
#start.loading { background: radial-gradient(circle at 30% 20%, #27406e, #0d1420 70%); }
.title { padding: clamp(20px, 5vw, 64px); max-width: 760px; }
.kicker { color: var(--gold); letter-spacing: 3px; font-weight: 700; font-size: 15px; }
h1 { font-size: clamp(40px, 7.5vw, 92px); line-height: 1; margin: 8px 0 12px; font-weight: 900; text-shadow: 0 4px 0 #1b2a4a, 0 10px 40px rgba(0, 0, 0, 0.6); }
.tag { font-size: clamp(16px, 2.2vw, 22px); opacity: 0.92; margin: 0 0 22px; }
#loading { display: flex; align-items: center; gap: 12px; font-size: 14px; }
#loading .bar { width: 260px; }
button.primary { background: var(--gold); color: var(--ink); font-weight: 900; font-size: 22px; padding: 13px 34px; border-radius: 14px; box-shadow: 0 6px 0 #b98a00, 0 12px 30px rgba(0, 0, 0, 0.4); }
button.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 #b98a00; }
.keys { margin-top: 22px; display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 14px; opacity: 0.85; }
.keys kbd { background: rgba(255, 255, 255, 0.16); border-radius: 6px; padding: 2px 8px; font: inherit; font-weight: 700; margin-inline-end: 5px; }
body.touch .keys { display: none; }

.panel { background: #131c2c; border-radius: 20px; padding: 24px 28px; width: min(560px, 94vw); max-height: 92vh; overflow: auto; border: 1px solid rgba(255, 255, 255, 0.12); }
.panel h2 { margin: 0 0 12px; font-size: 28px; }
.row { display: flex; gap: 12px; align-items: center; justify-content: space-between; margin-top: 16px; flex-wrap: wrap; }
.row button:not(.primary), select { background: rgba(255, 255, 255, 0.12); border-radius: 10px; padding: 9px 16px; font: inherit; color: #fff; border: 0; }
select option { color: #111; }
#journal { display: grid; gap: 5px; font-size: 15px; }
#journal div { display: flex; gap: 8px; padding: 5px 10px; border-radius: 8px; background: rgba(255, 255, 255, 0.05); }
#journal div.done { color: #9df59a; }
#journal div.locked { opacity: 0.45; }
.credits { font-size: 12px; opacity: 0.55; margin: 16px 0 0; }

#bigmap { flex-direction: column; gap: 10px; }
#bigmapCanvas { max-width: 96vw; max-height: 80vh; border-radius: 14px; border: 2px solid rgba(255, 255, 255, 0.4); }
.legend { display: flex; gap: 18px; font-size: 14px; flex-wrap: wrap; justify-content: center; }
.legend i { font-style: normal; }
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-inline-end: 6px; vertical-align: -1px; }
.dot.gold { background: #ffb400; } .dot.yellow { background: #fff36b; } .dot.blue { background: #5cc8ff; } .dot.pink { background: #ff7eb6; } .dot.teal { background: #4fd8c0; }
.close { background: rgba(255, 255, 255, 0.14); border-radius: 10px; padding: 9px 22px; }
