@import url("../fonts/fonts.css");

/* ============ tokenuri Wolftrail (din deck: hârtie #ddd, antracit #333, roșu #ec2809, pământ #473a37) ============ */
:root {
  --paper: #dddddd;
  --paper-2: #e9e8e6;
  --paper-3: #cfcdcb;
  --ink: #2b2a29;
  --ink-2: #4a4745;
  --ink-3: #6e6966;
  --char: #333333;
  --char-2: #1c1a19;
  --red: #ec2809;
  --red-2: #ff4b25;
  --red-ink: #c61f04;
  --soil: #473a37;
  --ok: #2f8f4e;
  --warn: #c98a07;
  --line: rgba(43, 42, 41, .16);
  --line-2: rgba(43, 42, 41, .28);
  --bg: var(--paper);
  --surface: rgba(233, 232, 230, .97);
  --surface-2: #f3f2f0;
  --fg: var(--ink);
  --fg-2: var(--ink-2);
  --fg-3: var(--ink-3);
  --on-red: #fff;
  --shadow: 0 10px 30px rgba(28, 26, 25, .28), 0 2px 6px rgba(28, 26, 25, .18);
  --shadow-s: 0 2px 10px rgba(28, 26, 25, .22);
  --r: 14px;
  --r-s: 9px;
  --f-display: "Anton", "Impact", "Arial Narrow Bold", sans-serif;
  --f-body: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-hand: "Permanent Marker", "Comic Sans MS", cursive;
  --top: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --panel-w: 400px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1a19; --surface: rgba(34, 32, 31, .97); --surface-2: #2b2928; --fg: #eeebe8; --fg-2: #c3bdb8; --fg-3: #9a938e;
    --line: rgba(238, 235, 232, .12); --line-2: rgba(238, 235, 232, .24); --paper-3: #3a3735; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1a19; --surface: rgba(34, 32, 31, .97); --surface-2: #2b2928; --fg: #eeebe8; --fg-2: #c3bdb8; --fg-3: #9a938e;
  --line: rgba(238, 235, 232, .12); --line-2: rgba(238, 235, 232, .24); --paper-3: #3a3735; color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--char-2); color: var(--fg); font-family: var(--f-body); font-size: 15px; line-height: 1.45; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.i { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
svg.i.s { width: 16px; height: 16px; }
svg.i.l { width: 24px; height: 24px; }

#map { position: fixed; inset: 0; background: #2a2826; }
.maplibregl-ctrl-attrib { font-size: 11px !important; }
.maplibregl-ctrl-bottom-right, .maplibregl-ctrl-bottom-left { bottom: calc(var(--safe-b) + 0px); }
body.has-dock .maplibregl-ctrl-bottom-right { bottom: calc(var(--safe-b) + 84px); }

/* ============ splash ============ */
#splash { position: fixed; inset: 0; z-index: 100; background: #dcdcdc url("../img/soil.jpg") center / cover no-repeat; display: grid; place-items: center; transition: opacity .6s ease, visibility .6s; }
#splash.gone { opacity: 0; visibility: hidden; }
#splash .in { text-align: center; padding: 24px; }
#splash img.mark { width: 120px; height: auto; }
#splash img.word { display: block; width: min(560px, 80vw); margin: 14px auto 6px; }
#splash .hand { font-family: var(--f-hand); color: #2b2a29; font-size: 22px; transform: rotate(-3deg); }
#splash .sub { margin-top: 18px; color: #333; font-size: 14px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
#splash .bar { width: 220px; height: 4px; background: rgba(0,0,0,.12); border-radius: 4px; margin: 22px auto 0; overflow: hidden; }
#splash .bar i { display: block; height: 100%; width: 30%; background: var(--red); border-radius: 4px; animation: load 1.2s ease-in-out infinite; }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(340%); } }

/* ============ bara de sus ============ */
#top { position: fixed; z-index: 20; left: 12px; right: 12px; top: calc(10px + var(--safe-t)); display: flex; gap: 10px; align-items: center; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; background: var(--char-2); color: #fff; height: 48px; padding: 0 14px 0 10px; border-radius: var(--r); box-shadow: var(--shadow-s); text-decoration: none; }
.brand img.m { height: 30px; width: auto; }
.brand .t { display: flex; flex-direction: column; line-height: 1; }
.brand .t b { font-family: var(--f-display); font-weight: 400; font-size: 21px; letter-spacing: .02em; color: var(--red); }
.brand .t span { font-size: 10.5px; letter-spacing: .2em; font-weight: 700; color: #cfcac6; margin-top: 3px; }
.search { flex: 1; max-width: 460px; position: relative; }
.search input { width: 100%; height: 48px; border-radius: var(--r); border: 0; background: var(--surface); box-shadow: var(--shadow-s); padding: 0 14px 0 42px; font-size: 15px; }
.search > svg { position: absolute; left: 13px; top: 14px; color: var(--fg-3); }
.search .res { position: absolute; top: 54px; left: 0; right: 0; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); max-height: 60vh; overflow: auto; padding: 6px; display: none; }
.search.open .res { display: block; }
.res button { display: flex; width: 100%; text-align: left; gap: 10px; align-items: center; padding: 10px; border-radius: var(--r-s); }
.res button:hover, .res button.act { background: var(--paper-3); }
.res .k { margin-left: auto; font-size: 12px; color: var(--fg-3); white-space: nowrap; }
.topr { margin-left: auto; display: flex; gap: 8px; }
.chipbtn { height: 48px; min-width: 48px; padding: 0 12px; border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow-s); display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 14px; }
.chipbtn:hover { background: var(--surface-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 13px; }
.wx-mini { font-variant-numeric: tabular-nums; }

/* ============ controale hartă (dreapta) ============ */
#ctl { position: fixed; z-index: 15; right: 12px; top: calc(74px + var(--safe-t)); display: flex; flex-direction: column; gap: 8px; }
.cbtn { width: 46px; height: 46px; border-radius: 12px; background: var(--surface); box-shadow: var(--shadow-s); display: grid; place-items: center; position: relative; }
.cbtn:hover { background: var(--surface-2); }
.cbtn.on { background: var(--char-2); color: #fff; }
.cbtn.on.red { background: var(--red); }
.cbtn .lab { position: absolute; right: 54px; background: var(--char-2); color: #fff; font-size: 12px; padding: 4px 8px; border-radius: 6px; white-space: nowrap; opacity: 0; pointer-events: none; transition: opacity .15s; }
@media (hover: hover) { .cbtn:hover .lab { opacity: 1; } }
.cgroup { display: flex; flex-direction: column; background: var(--surface); border-radius: 12px; box-shadow: var(--shadow-s); overflow: hidden; }
.cgroup .cbtn { box-shadow: none; border-radius: 0; background: transparent; }
.cgroup .cbtn + .cbtn { border-top: 1px solid var(--line); }
#compass svg { transition: transform .1s linear; }
.cbtn .pitch { font-weight: 800; font-size: 13px; letter-spacing: .02em; }

/* ============ dock (acțiuni principale) ============ */
#dock { position: fixed; z-index: 18; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); display: flex; gap: 6px; background: var(--char-2); padding: 6px; border-radius: 18px; box-shadow: var(--shadow); }
#dock button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 70px; height: 58px; padding: 0 10px; border-radius: 13px; color: #eee; font-size: 12px; font-weight: 600; letter-spacing: .02em; }
#dock button:hover { background: rgba(255,255,255,.08); }
#dock button.prim { background: var(--red); color: #fff; }
#dock button.prim:hover { background: var(--red-2); }
#dock .sep { width: 1px; background: rgba(255,255,255,.14); margin: 8px 2px; }
body.mode-draw #dock, body.mode-ride #dock, body.mode-place #dock { display: none; }

/* ============ panou (stânga pe desktop, foaie de jos pe telefon) ============ */
#panel { position: fixed; z-index: 16; left: 12px; top: calc(70px + var(--safe-t)); bottom: 12px; width: var(--panel-w); background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; transition: transform .25s ease, opacity .2s; }
#panel.closed { transform: translateX(calc(-100% - 20px)); opacity: 0; pointer-events: none; }
.ph { padding: 14px 16px 10px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); }
.ph h2 { margin: 0; font-family: var(--f-display); font-weight: 400; font-size: 26px; line-height: 1; letter-spacing: .01em; text-transform: uppercase; }
.ph h2 em { font-style: normal; color: var(--red); }
.ph .x { margin-left: auto; width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; }
.ph .x:hover { background: var(--paper-3); }
.ph .back { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; margin-left: -6px; }
.pb { flex: 1; overflow: auto; overscroll-behavior: contain; }
.grab { display: none; }

.tabs { display: flex; gap: 4px; padding: 10px 12px 4px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 8px 12px 10px; font-weight: 700; font-size: 13.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--fg-3); white-space: nowrap; position: relative; }
.tab.on { color: var(--fg); }
.tab.on::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 2px; height: 7px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 8' preserveAspectRatio='none'%3E%3Cpath d='M1 5.5C18 3 34 6.2 52 4.2S84 2.4 99 4.6' fill='none' stroke='%23ec2809' stroke-width='2.6' stroke-linecap='round'/%3E%3C/svg%3E") center / 100% 100% no-repeat; }
.tab .n { font-weight: 600; color: var(--fg-3); margin-left: 4px; font-size: 12px; }

.bar { display: flex; gap: 6px; padding: 6px 12px 10px; flex-wrap: wrap; align-items: center; }
.pill { height: 34px; padding: 0 12px; border-radius: 17px; border: 1px solid var(--line-2); display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; white-space: nowrap; background: transparent; }
.pill.on { background: var(--char-2); color: #fff; border-color: var(--char-2); }
.pill.red.on { background: var(--red); border-color: var(--red); }
.pill select { border: 0; background: transparent; font-weight: 600; font-size: 13.5px; max-width: 150px; }
.seg { display: inline-flex; background: var(--paper-3); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { height: 32px; padding: 0 11px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--fg-2); display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface-2); color: var(--fg); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.seg.full { display: flex; }
.seg.full button { flex: 1; justify-content: center; }

.list { padding: 0 8px 90px; }
.li { display: flex; gap: 12px; padding: 10px 8px; border-radius: 12px; align-items: center; cursor: pointer; }
.li:hover { background: var(--paper-3); }
.li .ic { width: 44px; height: 44px; border-radius: 11px; flex: none; display: grid; place-items: center; color: #fff; background: var(--char); overflow: hidden; }
.li .ic img { width: 100%; height: 100%; object-fit: cover; }
.li .tx { flex: 1; min-width: 0; }
.li .tt { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .mt { font-size: 13px; color: var(--fg-3); display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.li .mt b { color: var(--fg-2); font-weight: 600; }
.vote { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 46px; height: 46px; border-radius: 12px; border: 1px solid var(--line-2); font-weight: 800; font-size: 14px; line-height: 1; gap: 2px; }
.vote.on { background: var(--red); border-color: var(--red); color: #fff; }
.vote:hover { border-color: var(--red); }
.empty { padding: 30px 20px; text-align: center; color: var(--fg-3); }
.empty b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 24px; color: var(--fg); text-transform: uppercase; margin-bottom: 6px; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 700; background: var(--paper-3); color: var(--fg-2); }
.badge.red { background: var(--red); color: #fff; }
.badge.dark { background: var(--char-2); color: #fff; }
.badge.warn { background: #f3d37a; color: #4a3500; }
.badge.ok { background: #bfe5c9; color: #154a25; }

/* ============ detaliu ============ */
.det .hero { position: relative; background: var(--char-2); }
.det .gal { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.det .gal::-webkit-scrollbar { display: none; }
.det .gal img { flex: none; width: 100%; height: 240px; object-fit: cover; scroll-snap-align: center; cursor: zoom-in; }
.det .gal .cnt { position: absolute; right: 10px; bottom: 10px; }
.det .body { padding: 14px 16px 100px; }
.det h3 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 400; font-size: 30px; line-height: 1.05; text-transform: uppercase; }
.det .by { font-size: 13.5px; color: var(--fg-3); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.det .acts { display: flex; gap: 8px; margin: 14px 0; flex-wrap: wrap; }
.btn { height: 42px; padding: 0 14px; border-radius: 11px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; background: var(--paper-3); }
.btn:hover { filter: brightness(.96); }
.btn.red { background: var(--red); color: #fff; }
.btn.dark { background: var(--char-2); color: #fff; }
.btn.ghost { background: transparent; border: 1px solid var(--line-2); }
.btn.big { height: 50px; font-size: 15px; width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: default; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 12px 0; }
.stat { background: var(--paper-3); border-radius: 11px; padding: 8px 10px; }
.stat b { display: block; font-family: var(--f-display); font-weight: 400; font-size: 22px; line-height: 1.1; }
.stat span { font-size: 12px; color: var(--fg-3); }
.sec { margin-top: 18px; }
.sec > h4 { margin: 0 0 8px; font-size: 12.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-3); font-weight: 800; display: flex; align-items: center; gap: 8px; }
.note { white-space: pre-wrap; font-size: 15px; }
.prof { width: 100%; height: 130px; display: block; }
.prof-wrap { background: var(--paper-3); border-radius: 12px; padding: 8px; position: relative; }
.prof-tip { position: absolute; top: 6px; font-size: 12px; background: var(--char-2); color: #fff; padding: 2px 6px; border-radius: 6px; pointer-events: none; transform: translateX(-50%); white-space: nowrap; }
.cm { padding: 10px 0; border-top: 1px solid var(--line); }
.cm .who { font-size: 13px; color: var(--fg-3); }
.cm .who b { color: var(--fg); }
.cmf { display: flex; gap: 8px; margin-top: 10px; }
.cmf textarea { flex: 1; min-height: 44px; resize: vertical; }
.appr { display: flex; flex-direction: column; gap: 6px; }
.apr { display: flex; align-items: flex-start; gap: 10px; padding: 9px 10px; border-radius: 11px; background: var(--paper-3); }
.apr .st { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; background: var(--ink-3); }
.apr .st.ok { background: var(--ok); } .apr .st.asked { background: var(--warn); } .apr .st.no { background: var(--red); }
.apr .t { flex: 1; font-size: 14px; }
.apr .t small { display: block; color: var(--fg-3); font-size: 12.5px; }
.apr select { font-size: 13px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 3px 4px; }

/* ============ formulare ============ */
.form { padding: 12px 16px 120px; display: flex; flex-direction: column; gap: 14px; }
.fl { display: flex; flex-direction: column; gap: 6px; }
.fl > label, .fl > .lab { font-size: 12.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
input.in, textarea.in, select.in { width: 100%; border: 1px solid var(--line-2); background: var(--surface-2); border-radius: 11px; padding: 11px 12px; font-size: 16px; }
textarea.in { min-height: 84px; resize: vertical; }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; text-align: center; line-height: 1.15; }
.cat .ci { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; }
.cat.on { border-color: var(--red); box-shadow: inset 0 0 0 1px var(--red); background: rgba(236, 40, 9, .07); }
.toggle { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.toggle input { width: 44px; height: 26px; appearance: none; background: var(--paper-3); border-radius: 13px; position: relative; flex: none; cursor: pointer; transition: background .15s; border: 1px solid var(--line-2); }
.toggle input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.toggle input:checked { background: var(--red); border-color: var(--red); }
.toggle input:checked::after { transform: translateX(18px); }
.thumbs { display: flex; gap: 6px; flex-wrap: wrap; }
.thumbs .th { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; position: relative; background: var(--paper-3); }
.thumbs .th img { width: 100%; height: 100%; object-fit: cover; }
.thumbs .add { display: grid; place-items: center; border: 2px dashed var(--line-2); color: var(--fg-3); }
.stars { display: flex; gap: 4px; }
.stars button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--fg-3); }
.stars button.on { color: var(--red); border-color: var(--red); }
.stars button.on svg { fill: var(--red); }

/* ============ popover (straturi, soare, vreme) ============ */
.pop { position: fixed; z-index: 30; right: 68px; top: calc(74px + var(--safe-t)); width: 340px; max-height: calc(100vh - 100px); overflow: auto; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; display: none; }
.pop.open { display: block; }
.pop h3 { margin: 0 0 10px; font-family: var(--f-display); font-weight: 400; text-transform: uppercase; font-size: 22px; display: flex; align-items: center; gap: 8px; }
.pop h3 .x { margin-left: auto; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px; }
.pop h5 { margin: 14px 0 8px; font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--fg-3); font-weight: 800; }
.bases { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.base { border-radius: 12px; overflow: hidden; border: 2px solid transparent; text-align: left; background: var(--paper-3); }
.base .im { height: 62px; background-size: cover; background-position: center; }
.base span { display: block; font-size: 12px; font-weight: 700; padding: 5px 7px; line-height: 1.2; }
.base.on { border-color: var(--red); }
.lyr { display: flex; align-items: center; gap: 10px; padding: 8px 2px; }
.lyr .sw { width: 26px; height: 6px; border-radius: 3px; flex: none; }
.lyr .tx { flex: 1; font-size: 14px; }
.lyr .tx small { display: block; color: var(--fg-3); font-size: 12px; }
.range { width: 100%; accent-color: var(--red); }
.sunbar { position: relative; height: 34px; margin: 4px 0 2px; }
.sunbar canvas { width: 100%; height: 34px; border-radius: 8px; display: block; }
.suntime { font-family: var(--f-display); font-size: 40px; line-height: 1; display: flex; align-items: baseline; gap: 10px; }
.suntime small { font-family: var(--f-body); font-size: 13px; color: var(--fg-3); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.wxday { display: grid; grid-template-columns: 1fr repeat(4, auto); gap: 4px 12px; font-size: 13.5px; align-items: center; }
.wxday .h { font-size: 11.5px; color: var(--fg-3); font-weight: 700; text-transform: uppercase; }
.wxrow { padding: 8px 0; border-top: 1px solid var(--line); }

/* ============ desen ============ */
#drawbar { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); background: var(--char-2); color: #fff; border-radius: 18px; box-shadow: var(--shadow); padding: 10px; display: none; flex-direction: column; gap: 8px; width: min(620px, calc(100vw - 24px)); }
body.mode-draw #drawbar { display: flex; }
#drawbar .row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#drawbar .seg { background: rgba(255,255,255,.1); }
#drawbar .seg button { color: #ddd; }
#drawbar .seg button.on { background: #fff; color: var(--ink); }
#drawbar .st { font-family: var(--f-display); font-size: 22px; letter-spacing: .02em; margin-right: auto; display: flex; gap: 14px; align-items: baseline; }
#drawbar .st small { font-family: var(--f-body); font-size: 12px; color: #bbb; }
#drawbar .btn { background: rgba(255,255,255,.12); color: #fff; height: 42px; }
#drawbar .btn.red { background: var(--red); }
#drawbar .btn:disabled { opacity: .4; }
#hint { position: fixed; z-index: 24; left: 50%; transform: translateX(-50%); top: calc(70px + var(--safe-t)); background: var(--char-2); color: #fff; border-radius: 12px; padding: 10px 14px; font-size: 14px; box-shadow: var(--shadow); display: none; max-width: calc(100vw - 24px); text-align: center; }
#hint.on { display: block; }
#hint b { color: var(--red-2); }
.warnline { font-size: 12.5px; color: #ffcf9e; }

/* ============ plasare (țintă în centru) ============ */
#target { position: fixed; z-index: 14; left: 50%; top: 50%; width: 0; height: 0; display: none; pointer-events: none; }
body.mode-place #target { display: block; }
#target .pin { position: absolute; left: -22px; top: -58px; width: 44px; height: 58px; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); transition: transform .15s; }
body.map-moving #target .pin { transform: translateY(-10px); }
#target .dot { position: absolute; left: -5px; top: -3px; width: 10px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.45); }
#placebar { position: fixed; z-index: 25; left: 50%; transform: translateX(-50%); bottom: calc(14px + var(--safe-b)); display: none; gap: 8px; background: var(--char-2); padding: 8px; border-radius: 16px; box-shadow: var(--shadow); align-items: center; color: #fff; }
body.mode-place #placebar { display: flex; }
#placebar .co { font-size: 13px; color: #ccc; padding: 0 8px; font-variant-numeric: tabular-nums; }
#placebar .btn { height: 46px; }

/* ============ fantoma pozei (drag & drop) ============ */
#ghost { position: fixed; z-index: 60; left: 0; top: 0; pointer-events: none; display: none; }
#ghost.on { display: block; }
#ghost .g-pin { position: absolute; left: -24px; top: -64px; width: 48px; height: 64px; opacity: .92; filter: drop-shadow(0 10px 10px rgba(0,0,0,.4)); animation: bob 1s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px); } }
#ghost .g-ring { position: absolute; left: -18px; top: -9px; width: 36px; height: 18px; border-radius: 50%; border: 2px solid var(--red); background: rgba(236, 40, 9, .18); animation: ring 1s ease-out infinite; }
@keyframes ring { 0% { transform: scale(.5); opacity: 1; } 100% { transform: scale(1.6); opacity: 0; } }
#ghost .g-x { position: absolute; left: -1px; top: -1px; width: 3px; height: 3px; background: var(--red); border-radius: 50%; box-shadow: 0 0 0 2px #fff; }
#ghost .g-lab { position: absolute; left: 30px; top: -58px; background: var(--char-2); color: #fff; font-size: 13px; padding: 7px 10px; border-radius: 10px; white-space: nowrap; box-shadow: var(--shadow-s); }
#ghost .g-lab b { display: block; font-size: 14px; }
#ghost .g-lab small { color: #ccc; font-variant-numeric: tabular-nums; }
#dropveil { position: fixed; inset: 0; z-index: 55; pointer-events: none; display: none; border: 4px dashed var(--red); background: rgba(236, 40, 9, .05); }
#dropveil.on { display: block; }

/* ============ markere poze ============ */
.phm { width: 54px; height: 54px; border-radius: 12px; border: 3px solid #fff; box-shadow: 0 4px 12px rgba(0,0,0,.45); overflow: hidden; background: #333; cursor: pointer; position: relative; transition: transform .12s; }
.phm:hover { transform: scale(1.12); z-index: 2; }
.phm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.phm::after { content: ""; position: absolute; left: 50%; bottom: -9px; margin-left: -6px; border: 6px solid transparent; border-top-color: #fff; }
.phm .n { position: absolute; right: 2px; top: 2px; background: var(--red); color: #fff; font-size: 11px; font-weight: 800; border-radius: 8px; padding: 0 5px; }
.phm.dir::before { content: ""; position: absolute; }

/* ============ tură (vehicul) ============ */
#ride-ui { position: fixed; inset: 0; z-index: 26; pointer-events: none; display: none; }
body.mode-ride #ride-ui { display: block; }
body.mode-ride #top, body.mode-ride #ctl, body.mode-ride #panel { display: none; }
body.mode-ride #toasts { bottom: auto; top: calc(70px + var(--safe-t)); }
.hud { position: absolute; left: 16px; bottom: calc(16px + var(--safe-b)); background: rgba(28, 26, 25, .86); color: #fff; border-radius: 16px; padding: 12px 16px; pointer-events: auto; min-width: 200px; }
.hud .spd { font-family: var(--f-display); font-size: 54px; line-height: 1; }
.hud .spd small { font-family: var(--f-body); font-size: 14px; color: #bbb; margin-left: 4px; }
.hud .row { display: flex; gap: 14px; font-size: 13px; color: #ccc; margin-top: 6px; font-variant-numeric: tabular-nums; }
.hud .boost { height: 6px; border-radius: 3px; background: rgba(255,255,255,.15); margin-top: 8px; overflow: hidden; }
.hud .boost i { display: block; height: 100%; background: var(--red); width: 0; transition: width .1s; }
.ride-top { position: absolute; top: calc(12px + var(--safe-t)); left: 12px; right: 12px; display: flex; gap: 8px; pointer-events: auto; align-items: center; }
.ride-top .keys { margin-left: auto; background: rgba(28,26,25,.8); color: #ddd; border-radius: 12px; padding: 8px 12px; font-size: 12.5px; }
.ride-top .keys kbd { background: #fff; color: #222; border-radius: 4px; padding: 0 5px; font: 700 11px var(--f-body); margin: 0 2px; }
.joy { position: absolute; left: 24px; bottom: calc(150px + var(--safe-b)); width: 150px; height: 150px; border-radius: 50%; background: rgba(28,26,25,.35); border: 2px solid rgba(255,255,255,.35); pointer-events: auto; touch-action: none; display: none; }
.joy i { position: absolute; left: 50%; top: 50%; width: 62px; height: 62px; margin: -31px 0 0 -31px; border-radius: 50%; background: rgba(255,255,255,.85); box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.rbtns { position: absolute; right: 20px; bottom: calc(40px + var(--safe-b)); display: none; flex-direction: column; gap: 12px; pointer-events: auto; }
.rbtns button { width: 84px; height: 84px; border-radius: 50%; background: rgba(28,26,25,.6); color: #fff; font-weight: 800; font-size: 13px; border: 2px solid rgba(255,255,255,.4); touch-action: none; }
.rbtns button.boost { background: var(--red); border-color: #fff; }
@media (pointer: coarse) { .joy, .rbtns { display: flex; } .joy { display: block; } .ride-top .keys { display: none; } }
.veh { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.veh button { border: 2px solid var(--line-2); border-radius: 14px; padding: 14px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 700; }
.veh button small { font-weight: 500; color: var(--fg-3); font-size: 12px; }
.veh button.on { border-color: var(--red); background: rgba(236,40,9,.07); }
.veh .vi { font-size: 36px; line-height: 1; }

/* ============ modal + toast ============ */
#modal { position: fixed; inset: 0; z-index: 80; background: rgba(20, 18, 17, .55); display: none; align-items: center; justify-content: center; padding: 16px; }
#modal.open { display: flex; }
#modal .box { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow); width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 18px; }
#modal .box.wide { width: min(980px, 100%); }
#modal h3 { margin: 0 0 12px; font-family: var(--f-display); font-weight: 400; font-size: 28px; text-transform: uppercase; line-height: 1.05; }
#modal p { margin: 0 0 10px; color: var(--fg-2); }
#modal .acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.code { font-family: var(--f-display); font-size: 44px; letter-spacing: .12em; text-align: center; padding: 10px; background: var(--paper-3); border-radius: 12px; user-select: all; }
#lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: none; align-items: center; justify-content: center; }
#lightbox.open { display: flex; }
#lightbox img { max-width: 96vw; max-height: 88vh; object-fit: contain; }
#lightbox .x { position: absolute; right: 14px; top: calc(14px + var(--safe-t)); width: 48px; height: 48px; border-radius: 50%; background: rgba(255,255,255,.15); color: #fff; display: grid; place-items: center; }
#lightbox .cap { position: absolute; left: 0; right: 0; bottom: calc(16px + var(--safe-b)); text-align: center; color: #ddd; font-size: 14px; }
#toasts { position: fixed; z-index: 95; left: 50%; transform: translateX(-50%); bottom: calc(96px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(520px, calc(100vw - 24px)); }
.toast { background: var(--char-2); color: #fff; padding: 11px 14px; border-radius: 12px; box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: center; pointer-events: auto; animation: tin .2s ease; }
.toast.err { background: var(--red-ink); }
.toast button { color: #fff; font-weight: 800; text-decoration: underline; margin-left: auto; white-space: nowrap; }
@keyframes tin { from { transform: translateY(10px); opacity: 0; } }
.upl { position: fixed; z-index: 94; right: 12px; bottom: calc(96px + var(--safe-b)); background: var(--char-2); color: #fff; border-radius: 12px; padding: 10px 12px; font-size: 13px; display: none; min-width: 220px; box-shadow: var(--shadow); }
.upl.on { display: block; }
.upl .pr { height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.upl .pr i { display: block; height: 100%; background: var(--red); width: 0; transition: width .2s; }

/* info pentru obiectele publice (OSM) */
.osm-k { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--fg-3); font-weight: 800; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; margin-top: 8px; }
.kv dt { color: var(--fg-3); }
.kv dd { margin: 0; font-weight: 600; }
.osmc { width: 26px; height: 26px; border-radius: 4px; background: #fff; border: 1px solid #ccc; position: relative; flex: none; }

/* ============ telefon ============ */
@media (max-width: 760px) {
  :root { --top: 58px; }
  #top { left: 8px; right: 8px; top: calc(8px + var(--safe-t)); gap: 6px; }
  .brand { height: 44px; padding: 0 10px 0 8px; }
  .brand .t { display: none; }
  .brand img.m { height: 28px; }
  .search input { height: 44px; }
  .chipbtn { height: 44px; min-width: 44px; padding: 0 9px; }
  .chipbtn .lbl { display: none; }
  #ctl { right: 8px; top: calc(62px + var(--safe-t)); }
  .cbtn { width: 44px; height: 44px; }
  #dock { left: 8px; right: 8px; transform: none; justify-content: space-between; border-radius: 16px; bottom: calc(8px + var(--safe-b)); }
  #dock button { min-width: 0; flex: 1; padding: 0 2px; font-size: 11.5px; height: 56px; }
  #dock .sep { display: none; }
  #panel { left: 0; right: 0; width: auto; top: auto; bottom: 0; height: 52vh; border-radius: 18px 18px 0 0; padding-bottom: var(--safe-b); }
  #panel.closed { transform: translateY(105%); }
  #panel.tall { height: calc(100vh - 70px - var(--safe-t)); }
  #panel.peek { height: 132px; }
  .grab { display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 8px auto 0; flex: none; }
  .grabzone { touch-action: none; }
  .pop { left: 8px; right: 8px; width: auto; top: auto; bottom: calc(8px + var(--safe-b)); max-height: 72vh; border-radius: 18px; }
  #drawbar { bottom: calc(8px + var(--safe-b)); }
  .det .gal img { height: 210px; }
  .cats { grid-template-columns: repeat(4, 1fr); }
  #toasts { bottom: calc(80px + var(--safe-b)); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  body.panel-open .maplibregl-ctrl-bottom-right { display: none; }
}
@media (max-width: 380px) { .cats { grid-template-columns: repeat(3, 1fr); } }
