/* =====================================================================
   Leggende Vicine — sistema visivo "Reliquario notturno"
   Oro antico su vetro scuro. Mobile-first: tutto pensato per il pollice.
   ===================================================================== */
:root {
  --bg: #0b0a10;
  --bg2: #15131d;
  --panel: rgba(16, 14, 22, 0.86);
  --panel-solid: #14121b;
  --line: rgba(233, 196, 106, 0.14);
  --line-soft: rgba(255, 255, 255, 0.07);
  --text: #f4efe4;
  --muted: #a49d90;
  --gold: #e9c46a;
  --gold-hi: #f8e3a6;
  --gold-lo: #9a6b1c;
  --accent: #e9c46a;
  --accent2: #4fd1c5;
  --rose: #ff5e7a;
  --violet: #a58bff;
  --xp: linear-gradient(90deg, #a58bff, #e9c46a);
  --hp: linear-gradient(90deg, #ff5e7a, #ff9a6b);
  --radius: 20px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45), 0 1px 0 rgba(255, 255, 255, .04) inset;
  --display: 'Cinzel', 'Trajan Pro', Georgia, serif;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --ui-w: min(440px, calc(100vw - 20px));
}
body { background: var(--bg); letter-spacing: .1px; }
.ico { display: block; flex: none; }
h1, h2, h3, h4, .display { font-family: var(--display); letter-spacing: .4px; }

/* ---------- pulsanti ---------- */
.btn { border-radius: 14px; border: 1px solid var(--line-soft); background: rgba(255,255,255,.05); font-weight: 600; letter-spacing: .2px; }
.btn.primary {
  color: #1c1405; border: 0;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, #c99a3c);
  box-shadow: 0 8px 24px rgba(233,196,106,.28), 0 1px 0 rgba(255,255,255,.6) inset;
}
.btn.primary:disabled { background: rgba(255,255,255,.08); color: var(--muted); box-shadow: none; }
.btn.ghost { background: rgba(255,255,255,.04); border-color: var(--line); }
.btn.big { max-width: 360px; padding: 17px; font-size: 16px; border-radius: 16px; }
.icon-btn { border-radius: 14px; background: rgba(255,255,255,.05); border-color: var(--line-soft); color: var(--text); }

/* ---------- schermate iniziali ---------- */
#start-screen, #login-screen {
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(233,196,106,.16) 0%, transparent 55%),
    radial-gradient(90% 60% at 50% 110%, rgba(165,139,255,.14) 0%, transparent 60%),
    var(--bg);
  overflow: hidden;
}
.showcase { position: absolute; left: 0; right: 0; top: 4%; height: 38%; display: flex; justify-content: center; align-items: flex-end; pointer-events: none; opacity: .55; mask-image: linear-gradient(to bottom, #000 40%, transparent 95%); -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 95%); }
.showcase img { height: 70%; margin: 0 -14px; filter: drop-shadow(0 10px 20px rgba(0,0,0,.6)) saturate(.9); animation: float 6s ease-in-out infinite; animation-delay: calc(var(--i) * -1.2s); }
.showcase img:nth-child(3) { height: 92%; z-index: 2; opacity: 1; }
.showcase img:nth-child(2), .showcase img:nth-child(4) { height: 80%; z-index: 1; }
@keyframes float { 50% { transform: translateY(-8px); } }
.start-inner { position: relative; z-index: 2; justify-content: flex-end; padding: 24px 22px calc(34px + var(--safe-bottom)); }
.brand { display: flex; flex-direction: column; align-items: center; margin-bottom: 6px; }
.sigil { width: 46px; height: 46px; margin-bottom: 8px; border: 1.5px solid var(--gold); transform: rotate(45deg); border-radius: 6px; position: relative; box-shadow: 0 0 24px rgba(233,196,106,.35); }
.sigil::after { content: ""; position: absolute; inset: 9px; border: 1px solid var(--gold); border-radius: 3px; opacity: .6; }
.brand h1 { font-size: 40px; line-height: 1.02; margin: 4px 0; font-weight: 800; background: linear-gradient(180deg, #fff6dc, var(--gold) 70%, #b5832e); -webkit-background-clip: text; background-clip: text; color: transparent; text-shadow: none; }
.eyebrow { font-size: 11px; letter-spacing: 4px; text-transform: uppercase; color: var(--muted); margin: 4px 0 0; }
.tagline { font-size: 15px; line-height: 1.55; color: #cfc8ba; max-width: 360px; margin: 14px 0 22px; }
.login-box { gap: 10px; }
.cr-input { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 14px; font-size: 16px; padding: 14px 16px; }
.cr-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233,196,106,.18); }
#start-account, #game-version { margin: 4px 0 0; }

/* ---------- mappa ---------- */
#map, .leaflet-container { background: #0e0d13; }
.leaflet-tile-pane { filter: invert(1) hue-rotate(185deg) saturate(.22) brightness(.78) contrast(1.08) sepia(.28); }
.map-vignette { position: absolute; inset: 0; z-index: 401; pointer-events: none; background: radial-gradient(130% 90% at 50% 45%, transparent 55%, rgba(5,4,8,.75) 100%); }
.leaflet-control-attribution { background: transparent !important; color: rgba(255,255,255,.35) !important; font-size: 8px; }
.leaflet-control-attribution a { color: rgba(255,255,255,.45) !important; }
.leaflet-bottom.leaflet-right { bottom: calc(84px + var(--safe-bottom)); }

/* Leaflet forza width:auto sulle immagini dei marker: lo annulliamo */
.leaflet-container .leaflet-marker-pane .pin img,
.leaflet-container .leaflet-marker-pane .me-marker img,
.leaflet-container .leaflet-marker-pane .other-player img { width: 100% !important; height: 100% !important; max-width: none !important; object-fit: cover; }

/* segnaposto a goccia */
.pin { --c: var(--gold); --c2: #6b4a14; position: relative; width: 40px; height: 48px; cursor: pointer; transition: transform .2s; transform-origin: 50% 100%; }
.pin-body {
  position: absolute; left: 3px; top: 0; width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg);
  background: radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--c) 70%, #fff) 0%, var(--c) 45%, var(--c2) 100%);
  border: 1.5px solid rgba(255,255,255,.85); box-shadow: 0 6px 14px rgba(0,0,0,.55), 0 0 0 3px rgba(0,0,0,.25);
  display: grid; place-items: center; color: #1a1206; overflow: hidden;
}
.pin-body > * { transform: rotate(45deg); }
.pin-body .ico { width: 17px; height: 17px; stroke-width: 2.1; }
.pin-emoji { font-size: 17px; line-height: 1; }
.pin.has-img .pin-body { background: #120f18; padding: 0; }
.pin.has-img .pin-body img { transform: rotate(45deg) scale(1.55) translateY(12%); object-position: 50% 8%; }
.pin-shadow { position: absolute; left: 50%; bottom: 0; width: 16px; height: 5px; margin-left: -8px; border-radius: 50%; background: rgba(0,0,0,.55); filter: blur(1.5px); }
.pin-badge { position: absolute; right: -4px; top: -4px; width: 18px; height: 18px; border-radius: 50%; background: #1a1206; color: var(--gold); display: grid; place-items: center; border: 1.5px solid var(--gold); }
.pin.t-encounter { --c: #ff5e7a; --c2: #7a1326; }
.pin.t-encounter .pin-body { color: #fff; }
.pin.t-relic { --c: #e9c46a; --c2: #7a5216; }
.pin.t-quest { --c: #4fd1c5; --c2: #11615a; }
.pin.t-creation { --c: #f8e3a6; --c2: #9a6b1c; }
.pin.t-sponsor { --c: #e9c46a; --c2: #7a5216; }
.pin.t-encounter.has-img .pin-body { border-color: #ff7d93; box-shadow: 0 6px 14px rgba(0,0,0,.55), 0 0 0 2px rgba(255,94,122,.45), 0 0 14px rgba(255,94,122,.45); }
.pin.t-sponsor .pin-body { box-shadow: 0 6px 14px rgba(0,0,0,.55), 0 0 0 3px rgba(233,196,106,.35), 0 0 18px rgba(233,196,106,.7); }
.pin.divine .pin-body { border-color: var(--gold-hi); }
.pin.personal .pin-body { border-style: dashed; }
.pin.premium .pin-body { border-color: #c8b6ff; }
.pin.in-range { animation: pinHop 1.4s ease-in-out infinite; }
.pin.in-range .pin-body { box-shadow: 0 0 0 4px rgba(255,255,255,.18), 0 0 22px var(--c); }
.pin.done { transform: scale(.72); opacity: .55; filter: grayscale(.8); }
.pin.done .pin-body { background: #2a2733; color: var(--muted); }
.pin.ping .pin-body { animation: pinPing .9s ease-out 2; }
@keyframes pinHop { 50% { transform: translateY(-4px); } }
@keyframes pinPing { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.7); } 100% { box-shadow: 0 0 0 22px rgba(255,255,255,0); } }

/* il giocatore */
.me-marker { position: relative; width: 46px; height: 46px; }
.me-ring { position: absolute; inset: 4px; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 70%, color-mix(in srgb, var(--aura) 55%, #000), #0b0a10 75%); border: 2px solid var(--aura); box-shadow: 0 0 0 3px rgba(0,0,0,.45), 0 0 18px var(--aura); }
.me-ring img { object-position: 50% 6%; transform: scale(1.5) translateY(14%); }
.me-ping { position: absolute; inset: 4px; border-radius: 50%; border: 2px solid var(--aura); animation: mePing 2.2s ease-out infinite; }
@keyframes mePing { to { transform: scale(2.6); opacity: 0; } }

.other-player { position: relative; width: 34px; height: 34px; border: 0; background: none; box-shadow: none; display: block; }
.op-ring { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; border: 2px solid var(--aura); background: #0b0a10; box-shadow: 0 0 10px var(--aura); }
.op-ring img { object-position: 50% 6%; transform: scale(1.5) translateY(14%); }
.op-name { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font-size: 10px; font-weight: 700; white-space: nowrap; padding: 2px 7px; border-radius: 999px; background: rgba(11,10,16,.85); border: 1px solid var(--line-soft); color: #fff; }
.op-crown { position: absolute; top: -9px; left: 50%; width: 14px; height: 9px; margin-left: -7px; background: var(--gold); clip-path: polygon(0 100%, 0 20%, 25% 60%, 50% 0, 75% 60%, 100% 20%, 100% 100%); z-index: 2; }

/* ---------- HUD ---------- */
#hud {
  left: 10px; right: auto; width: var(--ui-w); top: calc(10px + var(--safe-top));
  gap: 10px; padding: 8px 12px 8px 8px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(24,21,32,.9), rgba(14,12,20,.9)); border: 1px solid var(--line); box-shadow: var(--shadow); backdrop-filter: blur(14px);
}
.hud-avatar { position: relative; flex: none; }
.hud-portrait { width: 48px; height: 48px; border-radius: 16px; border: 1.5px solid var(--hero-aura, var(--gold)); }
.hud-portrait img { width: 100%; height: 135%; object-fit: cover; object-position: 50% 6%; }
#hud .lvl { position: absolute; right: -6px; bottom: -6px; width: 24px; height: 24px; font-size: 11px; font-weight: 800; font-family: 'Inter', sans-serif; color: #1c1405; background: conic-gradient(var(--gold) var(--lvlp, 0%), #6b5a35 0); border: 0; }
#hud .lvl::before { inset: 2.5px; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); }
.hud-avatar:not(:has(img)) .lvl { position: static; width: 40px; height: 40px; font-size: 15px; }
.bars { gap: 4px; }
.hud-rank { font-family: var(--display); font-size: 12.5px; letter-spacing: .6px; color: var(--gold-hi); }
.bar-row { gap: 8px; }
.bar { height: 5px; background: rgba(255,255,255,.07); }
.num { width: auto; min-width: 58px; font-size: 10px; color: var(--muted); }
.wallet { gap: 5px; }
.wallet span { display: flex; align-items: center; justify-content: flex-end; gap: 5px; font-size: 13px; }
.wallet b { font-variant-numeric: tabular-nums; font-weight: 700; }

#mission-chip {
  top: calc(86px + var(--safe-top)); left: 10px; max-width: calc(var(--ui-w) - 66px); width: auto;
  flex-wrap: nowrap; gap: 10px; padding: 8px 14px 8px 10px; border-radius: 16px; align-items: center;
  background: rgba(14,12,20,.84); border: 1px solid var(--line-soft); backdrop-filter: blur(12px); box-shadow: var(--shadow);
}
.chip-ico { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--gold); background: rgba(233,196,106,.1); flex: none; }
.chip-ico .ico { width: 18px; height: 18px; }
.chip-txt { display: flex; flex-direction: column; min-width: 0; }
.chip-tag { font-size: 9px; letter-spacing: 1.6px; text-transform: uppercase; }
#mission-chip-title { font-weight: 600; font-size: 13px; }
#mission-chip-progress { width: auto; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* colonna di azioni a destra */
.rail { top: calc(86px + var(--safe-top)); right: 10px; flex-direction: column; gap: 10px; }
.rail-btn { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: var(--text); background: rgba(14,12,20,.84); border: 1px solid var(--line-soft); backdrop-filter: blur(12px); box-shadow: var(--shadow); padding: 0; }
.rail-btn .ico { width: 22px; height: 22px; }
.rail-btn.god { color: #1c1405; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); border: 0; box-shadow: 0 0 18px rgba(233,196,106,.45); }
.rail .switch { cursor: pointer; }
.rail .switch input { display: none; }
.rail .switch:has(input:checked) { color: var(--accent2); border-color: rgba(79,209,197,.5); box-shadow: 0 0 14px rgba(79,209,197,.35); }
@media (min-width: 900px) { .rail { right: 16px; } }

.status-pill { top: auto; bottom: calc(96px + var(--safe-bottom)); background: rgba(14,12,20,.84); border-color: var(--line-soft); font-size: 11px; }
#god-banner { top: auto; bottom: calc(150px + var(--safe-bottom)); background: rgba(26,18,4,.94); border-color: var(--gold); color: var(--gold-hi); }

#sim-pad { right: 10px; bottom: calc(98px + var(--safe-bottom)); }
.sim-help { background: rgba(14,12,20,.84); font-size: 10px; max-width: 150px; }
.pad { grid-template-columns: repeat(3, 40px); grid-template-rows: repeat(3, 40px); }
.pad button { border-radius: 12px; background: rgba(14,12,20,.84); border-color: var(--line-soft); color: var(--muted); font-size: 12px; }

/* ---------- barra inferiore flottante ---------- */
#bottom-bar {
  left: 50%; right: auto; transform: translateX(-50%); width: var(--ui-w); bottom: calc(12px + var(--safe-bottom));
  display: grid; grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr; align-items: end; gap: 0; padding: 6px 6px 7px;
  border-radius: 24px; background: linear-gradient(180deg, rgba(24,21,32,.92), rgba(12,11,17,.95)); border: 1px solid var(--line); box-shadow: 0 14px 40px rgba(0,0,0,.6); backdrop-filter: blur(16px);
}
#bottom-bar button { min-width: 0; padding: 6px 0 2px; gap: 3px; color: var(--muted); font-size: 0; border-radius: 16px; }
#bottom-bar button .ico { width: 23px; height: 23px; }
#bottom-bar button span:last-child { font-size: 10.5px; font-weight: 600; color: inherit; letter-spacing: .2px; }
#bottom-bar button:active, #bottom-bar button.active { color: var(--gold-hi); }
#bottom-bar .radar-btn { position: relative; margin-top: -28px; color: #1c1405; }
#bottom-bar .radar-btn > span:first-child {
  width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto;
  background: radial-gradient(circle at 35% 30%, #fff3c4, var(--gold) 55%, #a8761f); box-shadow: 0 0 0 5px rgba(11,10,16,.9), 0 0 0 6px var(--line), 0 10px 26px rgba(233,196,106,.45);
}
#bottom-bar .radar-btn > span:first-child .ico { width: 28px; height: 28px; stroke-width: 2; animation: radarSpin 6s linear infinite; }
#bottom-bar .radar-btn span:last-child { color: var(--gold-hi); }
@keyframes radarSpin { to { transform: rotate(360deg); } }
.dot { top: -3px; right: -9px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

/* ---------- fogli e pannelli ---------- */
.sheet {
  max-width: 520px; background: linear-gradient(180deg, #1a1723 0%, #121018 60%); border: 1px solid var(--line); border-bottom: 0;
  border-radius: 28px 28px 0 0; padding: 10px 18px calc(20px + var(--safe-bottom)); box-shadow: 0 -20px 50px rgba(0,0,0,.6);
}
.sheet::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); opacity: .6; }
.sheet-grip { width: 44px; height: 5px; background: rgba(255,255,255,.16); margin-bottom: 12px; }
.panel { max-height: 82vh; }
.panel-head { position: sticky; top: -10px; z-index: 2; padding: 6px 0 10px; background: linear-gradient(180deg, #1a1723 70%, transparent); }
.panel-head h3 { font-size: 20px; color: var(--gold-hi); }
.ps-head .close, .panel-head .close { width: 36px; height: 36px; border-radius: 12px; color: var(--muted); }
.ps-head .close .ico, .panel-head .close .ico { width: 18px; height: 18px; }

.ps-head { gap: 14px; }
.ps-icon { width: 72px; height: 86px; border-radius: 18px; flex: none; overflow: hidden; color: #1a1206; background: radial-gradient(circle at 50% 75%, rgba(233,196,106,.35), #0d0b13 75%); border: 1px solid var(--line); }
.ps-icon img { object-fit: contain; object-position: 50% 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.ps-icon.t-encounter { background: radial-gradient(circle at 50% 75%, rgba(255,94,122,.4), #0d0b13 75%); color: var(--rose); }
.ps-icon.t-relic, .ps-icon.t-creation, .ps-icon.t-sponsor { color: var(--gold); }
.ps-icon.t-quest { background: radial-gradient(circle at 50% 75%, rgba(79,209,197,.35), #0d0b13 75%); color: var(--accent2); }
.ps-type { font-size: 10px; letter-spacing: 1.8px; color: var(--gold); }
.ps-head h3 { font-size: 21px; line-height: 1.15; }
#ps-desc { font-size: 14px; line-height: 1.5; margin: 12px 0; }
.ps-meta { padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); border: 1px solid var(--line-soft); font-size: 13px; gap: 10px; }
#ps-reward { color: var(--gold-hi); text-align: right; }

.card { background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); border-radius: 18px; padding: 14px; }
.card h4 { font-size: 15px; color: var(--text); }
.card.hero-card { background: linear-gradient(135deg, rgba(233,196,106,.1), rgba(255,255,255,.02)); border-color: var(--line); }
.hero-card h4 { font-size: 19px; color: var(--gold-hi); }
.link-card { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; color: var(--gold); }
.link-card b { color: var(--text); font-family: var(--display); }
.stat { background: rgba(255,255,255,.035); border: 1px solid var(--line-soft); border-radius: 16px; }
.stat b { font-family: var(--display); font-size: 19px; color: var(--gold-hi); }
.prog { height: 6px; }
.badge { letter-spacing: 1px; font-size: 9.5px; }
.badge.free { background: rgba(79,209,197,.12); color: var(--accent2); }
.setting { border-bottom: 1px solid var(--line-soft); padding: 11px 0; }
.setting:last-child { border-bottom: 0; }
.inv-item { border-radius: 16px; background: rgba(255,255,255,.035); }
.modal-card { background: linear-gradient(180deg, #1c1926, #121018); border: 1px solid var(--line); border-radius: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.7); }

/* toast */
#toasts { top: calc(140px + var(--safe-top)); }
.toast { background: rgba(14,12,20,.94); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); font-size: 13px; }
.toast.gold { border-color: var(--gold); color: var(--gold-hi); }

/* creazione: titoli in stile */
.create-inner h2 { font-size: 26px; color: var(--gold-hi); }
.cr-label { color: var(--gold); letter-spacing: 1.6px; font-size: 11px; }
.char-gallery { background: rgba(0,0,0,.35); border-color: var(--line-soft); }
.char-card { background: radial-gradient(ellipse at 50% 90%, rgba(233,196,106,.12) 0%, #0e0c15 70%); border-radius: 14px; }
.pills button.sel, .lineage-tabs button.sel { background: var(--gold); border-color: var(--gold); color: #1c1405; font-weight: 700; }
.cr-card.sel { border-color: var(--gold); box-shadow: 0 0 0 1.5px var(--gold) inset, 0 0 18px rgba(233,196,106,.2); }

/* schermi grandi: l'interfaccia resta "da telefono", la mappa si allarga */
@media (min-width: 900px) {
  #hud { left: 16px; top: 16px; }
  #mission-chip { left: 16px; top: 94px; }
  .sheet { border-radius: 28px; bottom: 96px; border-bottom: 1px solid var(--line); }
}

.leaflet-bottom, .leaflet-top { z-index: 450; }
.meta-i { display: inline-flex; align-items: center; gap: 5px; }
.meta-i + .meta-i { margin-left: 10px; }
.meta-i .ico { color: var(--gold); }
#ps-reward { display: inline-flex; justify-content: flex-end; flex-wrap: wrap; }
#panel-title { display: flex; align-items: center; gap: 10px; }
#panel-title .ico { color: var(--gold); }

.pin.t-beast { --c: #9fd36b; --c2: #2f5a1a; }
.pin.t-beast.r-raro { --c: #4fd1c5; --c2: #11615a; }
.pin.t-beast.r-epico { --c: #c8b6ff; --c2: #4a2a8a; }
.pin.t-beast.r-leggendario { --c: #f8e3a6; --c2: #9a6b1c; }
.pin.t-beast.r-leggendario .pin-body { box-shadow: 0 0 0 3px rgba(248,227,166,.4), 0 0 22px rgba(248,227,166,.9); }
.leaflet-marker-icon:has(.pin.t-beast) { transition: transform 2.4s linear; }
.leaflet-zoom-anim .leaflet-marker-icon:has(.pin.t-beast) { transition: none; }

.pin.tier-forte .pin-body { --c: #ff8a4a; }
.pin.tier-elite .pin-body { background: radial-gradient(circle at 30% 30%, #e2d4ff, #a58bff 45%, #3d2780); color: #fff; }
.pin.tier-boss { transform: scale(1.18); }
.pin.tier-boss .pin-body { background: radial-gradient(circle at 30% 30%, #fff1c0, #ff5e3a 45%, #6b1206); color: #fff; box-shadow: 0 0 0 3px rgba(255,94,58,.4), 0 0 24px rgba(255,94,58,.85); }
.pin-badge.boss { color: #ff5e3a; border-color: #ff5e3a; }
.pin-badge.elite { color: #c8b6ff; border-color: #c8b6ff; }

/* posizioni dinamiche sotto l'HUD (niente sovrapposizioni) */
#mission-chip { top: var(--hud-b, calc(86px + var(--safe-top))) !important; }
.rail { top: var(--hud-b, calc(86px + var(--safe-top))) !important; }
.hud-rank { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
#mission-chip, .rail-btn, #bottom-bar button, .pin, .btn { transition: transform .18s cubic-bezier(.2,.8,.2,1), box-shadow .2s, opacity .2s; }
#mission-chip:active, .rail-btn:active { transform: scale(.95); }
.sheet { transition: transform .32s cubic-bezier(.2,.9,.25,1); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

body.comfort *, body.comfort *::before, body.comfort *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }

#ar-hint { white-space: normal; max-width: 88vw; text-align: center; }

/* ritratti degli avatar 3D: già inquadrati su testa e spalle */
.hud-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 50%; }
.portrait img { inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 45%; animation: none; }
.me-ring img, .op-ring img { transform: none; object-position: 50% 50%; }
.pr-av img, .ps-icon img { object-fit: cover; object-position: 50% 45%; }

.brand h1 { font-size: 56px; letter-spacing: 6px; font-weight: 800; }
.eyebrow { letter-spacing: 3px; }

/* ---------- intro cinematografica ---------- */
#start-screen .showcase, #login-screen .showcase { top: 0; left: 0; right: 0; height: 66%; opacity: 1; mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); -webkit-mask-image: linear-gradient(to bottom, #000 72%, transparent 100%); }
#start-screen::before, #login-screen::before { content: ""; position: absolute; left: -20%; right: -20%; top: -10%; height: 70%; background: conic-gradient(from 200deg at 50% 0%, transparent 0deg, rgba(233,196,106,.12) 12deg, transparent 24deg, rgba(233,196,106,.08) 40deg, transparent 52deg, rgba(233,196,106,.1) 70deg, transparent 84deg); filter: blur(6px); animation: rays 14s ease-in-out infinite alternate; pointer-events: none; }
@keyframes rays { to { transform: rotate(6deg) scale(1.05); } }
#start-screen .start-inner, #login-screen .start-inner { justify-content: flex-end; padding-bottom: calc(26px + var(--safe-bottom)); background: linear-gradient(to bottom, transparent 40%, rgba(11,10,16,.92) 62%); }
.brand { margin-top: -40px; }
.brand .sigil { display: none; }
.brand h1 { font-size: clamp(40px, 12.4vw, 84px); letter-spacing: 4px; line-height: 1; filter: drop-shadow(0 4px 24px rgba(233,196,106,.45)); animation: titleIn 1.4s cubic-bezier(.2,.8,.2,1) both; }
.eyebrow { font-size: 12px; letter-spacing: 5px; color: #e8dcc0; animation: fadeUp 1.2s .25s cubic-bezier(.2,.8,.2,1) both; }
.tagline { animation: fadeUp 1.2s .45s cubic-bezier(.2,.8,.2,1) both; margin: 10px 0 18px; }
#btn-start-gps, #btn-start-sim, .login-box { animation: fadeUp 1.1s .6s cubic-bezier(.2,.8,.2,1) both; }
@keyframes titleIn { from { opacity: 0; transform: translateY(18px); letter-spacing: 22px; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } }
/* etichette del riquadro eroe */
#hud .lbl { width: auto; min-width: 42px; font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); }
.wallet span { flex-wrap: wrap; row-gap: 0; }
.wallet i { flex-basis: 100%; text-align: right; font-style: normal; font-size: 8.5px; letter-spacing: 1px; text-transform: uppercase; color: var(--muted); margin-top: -2px; }

/* Il nome del gioco sempre incorniciato: riquadro dorato con angoli a rombo */
.brand h1 { position: relative; padding: .32em .5em .26em; margin: 6px 0 4px; }
.brand h1::before, .brand h1::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: 8px; }
.brand h1::before { border: 2px solid rgba(233,196,106,.9); box-shadow: 0 0 22px rgba(255,211,107,.25), inset 0 0 18px rgba(255,211,107,.12); background: rgba(10,8,16,.35); z-index: -1; }
.brand h1::after { inset: 5px; border: 1px solid rgba(233,196,106,.45); }
.brand { isolation: isolate; }

/* QR per passare dal computer al telefono */
.desk-steps { text-align: left; margin: 14px auto; padding-left: 22px; max-width: 420px; line-height: 1.7; color: #e8dcc0; }
.desk-steps b { color: var(--gold); }
.desk-steps .desk-url { margin: 8px 0 10px; padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(233,196,106,.45); background: rgba(233,196,106,.08); font: 700 20px Inter, sans-serif; color: var(--gold-hi, #ffd36b); text-align: center; user-select: all; }
.lg-hint { margin-top: -4px; }

/* ---------- il Sigillo a V: ovunque ---------- */
.v-sigil { display: block; width: 76px; height: 76px; filter: drop-shadow(0 0 14px rgba(255,211,107,.55)) drop-shadow(0 6px 10px rgba(0,0,0,.6)); animation: sigilIn 1.3s cubic-bezier(.2,.8,.2,1) both, sigilGlow 4s 1.3s ease-in-out infinite; }
.brand .v-sigil { position: relative; z-index: 2; margin-bottom: -30px; }
.brand h1 { padding-top: .52em; }
.desk-inner .v-sigil { width: 96px; height: 96px; margin-bottom: 6px; }
@keyframes sigilIn { from { opacity: 0; transform: translateY(-14px) scale(.7); } }
@keyframes sigilGlow { 50% { filter: drop-shadow(0 0 26px rgba(255,211,107,.85)) drop-shadow(0 6px 10px rgba(0,0,0,.6)); transform: translateY(-3px); } }
.map-sigil { position: absolute; z-index: 450; left: 12px; bottom: calc(96px + var(--safe-bottom)); width: 48px; height: 48px; padding: 6px; border-radius: 14px; border: 1px solid rgba(233,196,106,.55); background: radial-gradient(circle at 50% 35%, rgba(58,42,16,.95), rgba(13,11,18,.9)); box-shadow: 0 0 18px rgba(255,211,107,.25), 0 6px 14px rgba(0,0,0,.5); cursor: pointer; }
.map-sigil img { width: 100%; height: 100%; display: block; animation: sigilGlow 4s ease-in-out infinite; }
.gc-mark { width: 40px; height: 40px; flex: none; filter: drop-shadow(0 0 8px rgba(255,211,107,.5)); }
.genesis-mark { width: 64px; height: 64px; margin: 0 auto 4px; }
/* consensi alla registrazione */
.lg-check { display: flex; gap: 10px; align-items: flex-start; text-align: left; font-size: 12.5px; line-height: 1.4; color: #e8dcc0; margin: 2px 2px 8px; cursor: pointer; }
.lg-check input { width: 20px; height: 20px; flex: none; margin: 0; accent-color: var(--gold); }
.lg-check a, .legal-links a { color: var(--gold-hi, #ffd36b); }
.lg-check.lg-need span { color: #ff9a7a; }
.btn.danger { color: #ff9a7a; border-color: rgba(255,120,100,.5); }
.legal-links { text-align: center; margin-top: 14px; }
