/* Missões — visual "HUD de jogo": painéis com cantos de mira, botões chanfrados,
 * brilho neon, scanlines sobre o mapa e raridade das missões estilo loot. */

:root {
  --bg: #0A0D12;
  --panel: #10151D;
  --panel-2: #131A24;
  --card: #161D28;
  --line: #243041;
  --line-2: #34425A;
  --text: #E8ECF1;
  --muted: #9AA5B4;
  --entrega: #F5B82E;
  --servico: #4CC3E0;
  --frete: #F07AB0;
  --gold: #F5B82E;
  --cyan: #36E2F5;
  --ok: #7ED89B;
  --xp: #A98BFF;
  --danger: #FF7A6B;
  --display: 'Chakra Petch', system-ui, sans-serif;
  --body: Inter, system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --cut: 10px;
  --fill: var(--card);
}

* { box-sizing: border-box; }

/* Cantos de mira (HUD): --bk = cor dos cantos, --fill = cor de fundo, --fill-img = gradiente opcional. */
.card, .item, .empty, .stat, .hud, .modal, .alert-card {
  background-image:
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    linear-gradient(var(--bk), var(--bk)), linear-gradient(var(--bk), var(--bk)),
    var(--fill-img, linear-gradient(transparent, transparent));
  background-size: 14px 2px, 2px 14px, 14px 2px, 2px 14px, 14px 2px, 2px 14px, 14px 2px, 2px 14px, 100% 100%;
  background-position: top left, top left, top right, top right, bottom left, bottom left, bottom right, bottom right, 0 0;
  background-repeat: no-repeat;
  background-color: var(--fill, var(--card));
}
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--body); -webkit-font-smoothing: antialiased; }
body { overflow: hidden; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* scanlines + vinheta sobre o mapa */
#map { position: fixed; inset: 0; z-index: 0; }
body::before { content: ''; position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%); }
.maplibregl-ctrl-attrib { background: rgba(10,13,18,.8) !important; color: var(--muted); font-size: 10px; }
.maplibregl-ctrl-attrib a { color: var(--muted) !important; }
.maplibregl-ctrl-attrib-button { filter: invert(1); }
.maplibregl-ctrl-bottom-right { bottom: var(--sheet-h, 0px); transition: bottom .25s; z-index: 2; }

/* ================= abertura ================= */
#boot { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.03) 0 1px, transparent 1px 3px), radial-gradient(circle at 50% 38%, #18202D 0%, #0A0D12 62%);
  transition: opacity .5s, transform .5s; }
#boot.leave { opacity: 0; transform: scale(1.06); pointer-events: none; }
.boot-radar { position: relative; width: 168px; height: 168px; border-radius: 50%; border: 2px solid rgba(245,184,46,.35); display: flex; align-items: center; justify-content: center; color: var(--gold); margin-bottom: 8px;
  background: repeating-radial-gradient(circle, transparent 0 27px, rgba(245,184,46,.12) 27px 28px); box-shadow: 0 0 40px rgba(245,184,46,.15), inset 0 0 30px rgba(245,184,46,.08); }
.boot-radar svg { width: 54px; height: 54px; position: relative; z-index: 2; filter: drop-shadow(0 0 8px rgba(245,184,46,.6)); }
.boot-radar .sweep { position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(from 0deg, rgba(245,184,46,.45), rgba(245,184,46,0) 70deg); animation: spin 2.2s linear infinite; }
.blip { position: absolute; width: 8px; height: 8px; border-radius: 4px; background: var(--gold); opacity: 0; animation: blip 2.2s linear infinite; box-shadow: 0 0 8px currentColor; }
.blip.b1 { top: 30px; left: 104px; animation-delay: .25s; background: var(--servico); }
.blip.b2 { top: 112px; left: 128px; animation-delay: .7s; }
.blip.b3 { top: 98px; left: 34px; animation-delay: 1.5s; background: var(--frete); }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blip { 0% { opacity: 0; transform: scale(.4); } 6% { opacity: 1; transform: scale(1.3); } 40% { opacity: .5; transform: scale(1); } 60%, 100% { opacity: 0; } }
.boot-logo { margin: 0; font: 700 44px var(--display); letter-spacing: 8px; color: var(--gold); text-shadow: 0 0 24px rgba(245,184,46,.45), 2px 0 rgba(54,226,245,.35), -2px 0 rgba(240,122,176,.3); }
.boot-tag { margin: -6px 0 10px; color: var(--muted); font: 600 13px var(--display); letter-spacing: 3px; text-transform: uppercase; }
.boot-bar { width: min(280px, 80vw); height: 8px; background: var(--line); overflow: hidden; clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.boot-bar i { display: block; height: 100%; width: 0; background: repeating-linear-gradient(90deg, var(--gold) 0 10px, #FFD87A 10px 12px); transition: width .4s; box-shadow: 0 0 12px var(--gold); }
.boot-status { margin: 0; font: 600 13px var(--display); letter-spacing: 2px; color: var(--cyan); text-transform: uppercase; min-height: 1.2em; }
.boot-start { margin-top: 8px; height: 58px; padding: 0 30px; font-size: 17px; animation: pulse 1.4s ease-in-out infinite; }
.boot-hint { margin: 0; color: var(--muted); font-size: 12px; text-align: center; max-width: 320px; min-height: 1em; }
@keyframes pulse { 0%, 100% { filter: drop-shadow(0 0 0 rgba(245,184,46,.0)); } 50% { filter: drop-shadow(0 0 14px rgba(245,184,46,.8)); } }

/* ================= topo ================= */
.topbar { position: fixed; top: 0; left: 0; right: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; pointer-events: none;
  background: linear-gradient(180deg, rgba(10,13,18,.85), rgba(10,13,18,0)); }
.topbar > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 8px; color: var(--gold); font-family: var(--display); font-weight: 700; font-size: 22px; letter-spacing: 3px; text-shadow: 0 0 14px rgba(245,184,46,.5); }
.topbar-right { display: flex; align-items: center; gap: 8px; }
.pill { height: 40px; padding: 0 12px; border: 1px solid var(--line-2); background: rgba(10,13,18,.92); display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-weight: 600; font-size: 14px;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.pill.icon { width: 40px; padding: 0; justify-content: center; }
.pill:hover { border-color: var(--gold); color: var(--gold); }
.avatar-btn { position: relative; width: 50px; height: 50px; border-radius: 25px; border: 0; padding: 3px; background: conic-gradient(var(--xp) calc(var(--p, 0) * 1%), #263041 0); box-shadow: 0 0 14px rgba(169,139,255,.35); }
.avatar-btn span.in { width: 100%; height: 100%; border-radius: 50%; background: #1A2130; display: flex; align-items: center; justify-content: center; font: 700 14px var(--display); }
.avatar-btn .lvl { position: absolute; right: -6px; bottom: -4px; min-width: 24px; height: 20px; padding: 0 5px; background: var(--xp); color: var(--bg); font: 700 11px/20px var(--display);
  clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }

.chips { position: fixed; top: 74px; left: 16px; right: 16px; z-index: 5; display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 36px; padding: 0 16px; border: 1px solid var(--line-2); background: rgba(10,13,18,.92); font: 600 13px var(--display); letter-spacing: .5px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 7px;
  clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.chip.active { background: var(--gold); color: var(--bg); border-color: var(--gold); }
.chip.active .dot { box-shadow: none; outline: 1px solid var(--bg); }
.dot { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex: none; box-shadow: 0 0 6px currentColor; }
.dot.entrega { background: var(--entrega); color: var(--entrega); } .dot.servico { background: var(--servico); color: var(--servico); } .dot.frete { background: var(--frete); color: var(--frete); }

.locate { position: fixed; right: 16px; z-index: 5; width: 46px; height: 46px; border: 1px solid var(--line-2); background: rgba(10,13,18,.92); display: flex; align-items: center; justify-content: center; bottom: calc(var(--sheet-h, 320px) + 14px); transition: bottom .25s; color: var(--cyan);
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }

/* ================= marcadores ================= */
.pin { width: 46px; height: 46px; padding: 0; border-radius: 23px; background: var(--bg); border: 3px solid var(--c, var(--gold)); color: #fff; font-family: var(--display); font-weight: 700; font-size: 14px; position: relative;
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 22%, transparent), 0 0 18px color-mix(in srgb, var(--c) 55%, transparent), 0 6px 12px rgba(0,0,0,.5); transition: transform .15s; }
.pin::after { content: ''; position: absolute; inset: -9px; border-radius: 50%; border: 2px solid var(--c); opacity: 0; animation: ping 2.4s ease-out infinite; }
.pin.new::after { animation-duration: 1.2s; }
@keyframes ping { 0% { opacity: .7; transform: scale(.85); } 100% { opacity: 0; transform: scale(1.6); } }
.pin:hover, .pin.selected { transform: scale(1.12); }
.pin.mine { border-style: dashed; }
.pin.mine::after { display: none; }
.pin .badge { position: absolute; right: -8px; top: -8px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--c); color: var(--bg); font: 700 11px/20px var(--body); }
.me-marker { width: 44px; height: 44px; border-radius: 22px; background: rgba(169,139,255,.14); border: 1px solid rgba(169,139,255,.45); display: flex; align-items: center; justify-content: center; position: relative; }
.me-marker::before { content: ''; position: absolute; inset: -1px; border-radius: 50%; border: 2px solid var(--xp); animation: ping 2s ease-out infinite; }
.me-marker::after { content: ''; width: 14px; height: 14px; border-radius: 7px; background: #fff; border: 3px solid var(--xp); box-shadow: 0 0 12px var(--xp); }

/* pontos de encontro / destino / serviço (sem letras) */
.pt { display: flex; flex-direction: column; align-items: center; gap: 3px; filter: drop-shadow(0 4px 8px rgba(0,0,0,.6)); }
.pt .pt-ic { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--bg); background: var(--gold); transform: rotate(45deg); border: 2px solid #FFE3A0; box-shadow: 0 0 16px rgba(245,184,46,.7); }
.pt .pt-ic svg { transform: rotate(-45deg); }
.pt .pt-l { font: 700 10px var(--display); letter-spacing: 1.5px; text-transform: uppercase; padding: 2px 6px; background: rgba(10,13,18,.92); color: var(--gold); border: 1px solid rgba(245,184,46,.5); margin-top: 6px; }
.pt.dest .pt-ic { background: var(--cyan); border-color: #B5F6FD; box-shadow: 0 0 16px rgba(54,226,245,.7); }
.pt.dest .pt-l { color: var(--cyan); border-color: rgba(54,226,245,.5); }
.pt.job .pt-ic { background: var(--servico); border-color: #B8EEF9; box-shadow: 0 0 16px rgba(76,195,224,.7); }
.pt.job .pt-l { color: var(--servico); border-color: rgba(76,195,224,.5); }
.pt-mini { width: 22px; height: 22px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--gold); color: var(--bg); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); margin-right: 6px; vertical-align: middle; }
.pt-mini svg { width: 12px; height: 12px; }
.pt-mini.dest { background: var(--cyan); }
.pt-mini.job { background: var(--servico); }

/* ================= painel ================= */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 58vh; overflow-y: auto; overscroll-behavior: contain;
  background: linear-gradient(180deg, var(--panel-2), var(--panel) 120px); border-top: 1px solid rgba(245,184,46,.35);
  padding: 10px 16px calc(20px + var(--safe-b)); display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 -1px 0 rgba(245,184,46,.25), 0 -12px 40px rgba(0,0,0,.5);
  clip-path: polygon(22px 0, calc(100% - 22px) 0, 100% 22px, 100% 100%, 0 100%, 0 22px); }
.sheet.tall { max-height: 86vh; }
.sheet.compact { max-height: 42vh; }
.sheet::before { content: ''; width: 56px; height: 4px; background: var(--gold); align-self: center; flex: none; box-shadow: 0 0 10px var(--gold); clip-path: polygon(4px 0, calc(100% - 4px) 0, 100% 100%, 0 100%); }
@media (min-width: 900px) {
  .sheet, .sheet.tall { left: 16px; right: auto; top: 124px; bottom: auto; width: 430px; max-height: calc(100vh - 140px); border: 1px solid rgba(245,184,46,.25);
    background: linear-gradient(180deg, var(--panel-2), var(--panel) 160px);
    clip-path: polygon(18px 0, 100% 0, 100% calc(100% - 18px), calc(100% - 18px) 100%, 0 100%, 0 18px); }
  .sheet::before { display: none; }
  .locate { bottom: 24px !important; }
  .chips { right: auto; }
  .maplibregl-ctrl-bottom-right { bottom: 0; }
}

.tabs { display: flex; gap: 2px; padding: 3px; background: var(--bg); border: 1px solid var(--line); flex: none; }
.tabs button { flex: 1; height: 40px; border: 0; background: transparent; color: var(--muted); font: 700 13px var(--display); letter-spacing: 1.5px; text-transform: uppercase; position: relative; }
.tabs button.active { background: linear-gradient(180deg, rgba(245,184,46,.18), rgba(245,184,46,.04)); color: var(--gold); }
.tabs button.active::after { content: ''; position: absolute; left: 12%; right: 12%; bottom: 0; height: 2px; background: var(--gold); box-shadow: 0 0 8px var(--gold); }

.h { margin: 0; font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 1.5px; text-transform: uppercase; }
.h::before { content: '// '; color: var(--gold); }
.label { font-family: var(--display); font-weight: 600; font-size: 12px; letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.row { display: flex; align-items: center; gap: 12px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); font-size: 13px; }
.small { font-size: 12px; }
.empty { padding: 18px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.5; --bk: var(--line-2); }

.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; width: 100%; border: 1px solid var(--line); position: relative;
  --bk: var(--r, var(--line-2)); transition: border-color .15s, box-shadow .15s; }
.item:hover { border-color: var(--r, var(--line-2)); box-shadow: 0 0 16px color-mix(in srgb, var(--r, #000) 30%, transparent); }
.ring { position: relative; width: 40px; height: 40px; flex: none; border-radius: 20px; border: 3px solid var(--c); display: flex; align-items: center; justify-content: center; font: 700 13px var(--display); background: var(--bg); box-shadow: 0 0 10px color-mix(in srgb, var(--c) 40%, transparent); }
.ring.lg { width: 60px; height: 60px; border-radius: 30px; font-size: 19px; }
.ring .lv { position: absolute; right: -7px; bottom: -6px; min-width: 20px; height: 17px; padding: 0 4px; background: var(--xp); color: var(--bg); font: 700 10px/17px var(--display); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price { font: 700 17px var(--display); color: var(--c, var(--gold)); white-space: nowrap; text-shadow: 0 0 10px color-mix(in srgb, var(--c, var(--gold)) 40%, transparent); }
.price.lg { font-size: 21px; }
.xpchip { font: 700 11px var(--display); color: var(--xp); letter-spacing: .5px; white-space: nowrap; }
.col-end { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }

.card { display: flex; flex-direction: column; gap: 12px; padding: 14px; border: 1px solid var(--line); position: relative;
  --bk: var(--r, var(--gold)); --fill-img: linear-gradient(180deg, color-mix(in srgb, var(--r, var(--gold)) 7%, var(--card)), var(--card) 90px); }
.card.rar-lendaria, .item.rar-lendaria, .alert-card.rar-lendaria { box-shadow: 0 0 22px rgba(245,184,46,.18); }
.card.rar-epica, .item.rar-epica { box-shadow: 0 0 18px rgba(176,124,255,.14); }
.tag { height: 24px; padding: 0 10px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); font: 700 11px var(--display); letter-spacing: 1px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 5px;
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
.rar { height: 22px; padding: 0 9px; border: 1px solid var(--r, var(--muted)); color: var(--r, var(--muted)); font: 700 10px var(--display); letter-spacing: 1.5px; text-transform: uppercase; display: inline-flex; align-items: center;
  background: color-mix(in srgb, var(--r, #888) 12%, transparent); text-shadow: 0 0 8px color-mix(in srgb, var(--r, #888) 60%, transparent); }
.specs { display: flex; flex-wrap: wrap; gap: 6px; }
.spec { height: 26px; padding: 0 10px; background: var(--bg); border: 1px solid var(--line); font-size: 12px; color: #CFD6E0; display: inline-flex; align-items: center; gap: 5px; }
.spec svg { flex: none; color: var(--c, var(--gold)); }
.addr { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; color: #CFD6E0; line-height: 1.4; }
.addr-l { display: block; font: 700 10px var(--display); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.status { height: 22px; padding: 0 9px; font: 700 10px var(--display); letter-spacing: 1px; text-transform: uppercase; display: inline-flex; align-items: center; background: var(--line); color: var(--text); clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.status.aceita, .status.entregue { background: rgba(245,184,46,.16); color: var(--gold); }
.status.concluida { background: rgba(126,216,155,.16); color: var(--ok); }
.status.cancelada { background: rgba(255,122,107,.14); color: var(--danger); }
.desc { margin: 0; font-size: 13px; color: #CFD6E0; line-height: 1.5; white-space: pre-line; padding-left: 10px; border-left: 2px solid var(--line-2); }

/* bloco de rota e tempo */
.route-info { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: rgba(54,226,245,.05); border: 1px solid rgba(54,226,245,.22); }
.ri { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.ri-ic { width: 26px; height: 26px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--cyan); background: rgba(54,226,245,.1); }
.ri-l { color: #CFD6E0; }
.ri-v { font: 700 14px var(--display); color: var(--text); white-space: nowrap; }
.ri-v.hot { color: var(--cyan); text-shadow: 0 0 8px rgba(54,226,245,.5); }
.ri-foot { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.ri-foot .linkbtn { min-height: 24px; padding: 0; font-size: 11px; }
.eta { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font: 700 13px var(--display); color: var(--cyan); }

/* garagem / veículo */
.garage { display: flex; align-items: center; gap: 12px; padding: 8px 12px; width: 100%; text-align: left; color: var(--text); border: 1px solid rgba(54,226,245,.3); background: linear-gradient(90deg, rgba(54,226,245,.08), transparent); }
.garage > svg { color: var(--cyan); flex: none; }
.garage b { font: 700 15px var(--display); letter-spacing: 1px; }
.garage .label { font-size: 10px; }
.veh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.veh { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px; border: 1px solid var(--line-2); background: var(--bg); color: var(--muted); text-align: center; }
.veh b { font: 700 13px var(--display); color: var(--text); letter-spacing: .5px; }
.veh small { font-size: 10px; }
.veh.active { border-color: var(--cyan); color: var(--cyan); background: rgba(54,226,245,.08); box-shadow: 0 0 16px rgba(54,226,245,.2); }

.safe { display: flex; align-items: center; gap: 10px; padding: 12px; background: #11221B; border: 1px solid #28453A; color: #CFE9D8; font-size: 13px; line-height: 1.4; }
.safe svg { flex: none; }

/* botões chanfrados */
.btn { height: 48px; padding: 0 18px; border: 0; background: linear-gradient(180deg, #FFCB52, var(--gold)); color: var(--bg); font: 700 15px var(--display); letter-spacing: 1.5px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-transform: uppercase; text-decoration: none;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut)); transition: transform .08s, filter .15s; }
.btn:active { transform: scale(.98); }
.btn:hover { filter: brightness(1.08) drop-shadow(0 0 8px rgba(245,184,46,.6)); }
.btn.block { width: 100%; flex: none; }
.btn.ghost { background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--text); font: 600 13px var(--display); letter-spacing: .5px; }
.btn.ghost:hover { box-shadow: inset 0 0 0 1px var(--cyan); color: var(--cyan); filter: none; }
.btn.danger { background: rgba(255,122,107,.06); box-shadow: inset 0 0 0 1px rgba(255,122,107,.5); color: var(--danger); font: 600 13px var(--display); letter-spacing: .5px; }
.btn.ok { background: linear-gradient(180deg, #9BE7B3, var(--ok)); }
.btn.sm { height: 38px; font-size: 12px; padding: 0 10px; --cut: 7px; }
.btn:disabled { opacity: .5; cursor: default; }
.btns { display: flex; gap: 10px; }
.btns > * { flex: 1; min-width: 0; }
.icon-btn { width: 44px; height: 44px; flex: none; border: 1px solid var(--line-2); background: transparent; display: inline-flex; align-items: center; justify-content: center;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.icon-btn:hover { border-color: var(--gold); color: var(--gold); }

/* ================= formulário ================= */
.field { display: flex; flex-direction: column; gap: 6px; position: relative; }
.field > label, .field > .flabel { font: 700 12px var(--display); letter-spacing: 1px; text-transform: uppercase; color: #CFD6E0; display: flex; align-items: center; }
.input { width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--bg); outline: none; min-width: 0; }
textarea.input { height: 76px; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(54,226,245,.12); }
.input.set { border-color: #3C6B52; background: #0F1C16; }
.seg { display: flex; gap: 8px; flex-wrap: wrap; }
.seg button { flex: 1; min-width: 0; height: 44px; padding: 0 8px; border: 1px solid var(--line-2); background: var(--bg); font: 700 13px var(--display); letter-spacing: .5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.seg button.active { border-color: var(--c, var(--gold)); background: color-mix(in srgb, var(--c, var(--gold)) 14%, transparent); color: var(--c, var(--gold)); box-shadow: 0 0 14px color-mix(in srgb, var(--c, var(--gold)) 25%, transparent); }
.seg.big button { height: 64px; flex-direction: column; gap: 2px; font-size: 13px; text-transform: uppercase; }
.seg.big button small { font: 500 11px var(--body); color: var(--muted); text-transform: none; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; padding: 6px 0; }
.check input { width: 20px; height: 20px; accent-color: var(--gold); }
.addr-tools { display: flex; gap: 14px; flex-wrap: wrap; }
.linkbtn { border: 0; background: transparent; color: var(--gold); font: 600 13px var(--display); letter-spacing: .3px; display: inline-flex; align-items: center; gap: 5px; padding: 4px 0; min-height: 32px; }
.linkbtn:hover { color: #FFD87A; }
.suggest { position: absolute; left: 0; right: 0; top: 74px; z-index: 3; background: var(--panel); border: 1px solid var(--cyan); overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.55), 0 0 18px rgba(54,226,245,.15); margin: 0; padding: 0; list-style: none; }
.suggest li { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; cursor: pointer; border-bottom: 1px solid var(--line); font-size: 14px; }
.suggest li:last-child { border-bottom: 0; }
.suggest li small { color: var(--muted); font-size: 12px; }
.suggest li[aria-selected=true], .suggest li:hover { background: rgba(54,226,245,.08); }
.suggest .info { color: var(--muted); font-size: 13px; cursor: default; }
.err { color: var(--danger); font-size: 13px; min-height: 1em; }
.reward { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: rgba(169,139,255,.08); border: 1px solid rgba(169,139,255,.35); font-size: 13px; }

/* ================= HUD, escolha de ponto ================= */
.hud { position: fixed; top: 74px; left: 16px; right: 16px; z-index: 5; max-width: 460px; padding: 14px 16px; display: flex; flex-direction: column; gap: 6px;
  border: 1px solid rgba(245,184,46,.35); --bk: var(--gold); --fill: rgba(10,13,18,.96); box-shadow: 0 8px 24px rgba(0,0,0,.45), 0 0 20px rgba(245,184,46,.1); }
@media (min-width: 900px) { .hud { left: 462px; } .pickbar { left: 462px !important; } }
.hud .obj { font-size: 17px; font-weight: 600; line-height: 1.35; }
.hud .obj b { color: var(--gold); }
.hud .muted { color: var(--cyan); font: 600 13px var(--display); letter-spacing: .3px; }
.pickbar { position: fixed; top: 74px; left: 16px; right: 16px; max-width: 460px; z-index: 7; padding: 12px 16px; background: var(--gold); color: var(--bg); font: 700 14px var(--display); letter-spacing: .5px; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px); }
.pickbar button { border: 0; background: rgba(10,13,18,.18); height: 36px; padding: 0 12px; font-weight: 700; color: var(--bg); }

.steps { display: flex; flex-direction: column; gap: 12px; padding-left: 4px; position: relative; }
.step { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--muted); }
.step i { width: 26px; height: 26px; flex: none; border: 2px solid var(--line-2); display: flex; align-items: center; justify-content: center; transform: rotate(45deg); }
.step i svg { transform: rotate(-45deg); }
.step.done i { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 10px rgba(126,216,155,.5); }
.step.now { color: var(--text); font-weight: 600; }
.step.now i { border: 3px solid var(--gold); background: var(--bg); box-shadow: 0 0 12px rgba(245,184,46,.6); animation: pulse-dot 1.2s ease-in-out infinite; }

/* ================= ficha do agente / ranking ================= */
.xpbar { height: 12px; background: var(--bg); border: 1px solid var(--line-2); overflow: hidden; clip-path: polygon(5px 0, 100% 0, calc(100% - 5px) 100%, 0 100%); }
.xpbar i { display: block; height: 100%; background: repeating-linear-gradient(90deg, var(--xp) 0 12px, #8B6CF5 12px 14px); width: 0; transition: width 1.2s cubic-bezier(.2,.8,.2,1); box-shadow: 0 0 10px var(--xp); }
.rank-title { font: 700 13px var(--display); letter-spacing: 2px; color: var(--xp); text-transform: uppercase; text-shadow: 0 0 10px rgba(169,139,255,.5); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stat { padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); --bk: var(--cyan); }
.stat b { font: 700 20px var(--display); color: var(--cyan); }
.stat span { font-size: 11px; color: var(--muted); }
.badges { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.badge-it { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; font-size: 11px; color: var(--muted); padding: 8px 2px; background: var(--card); border: 1px solid var(--line); }
.badge-it .ic { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: var(--bg); border: 1px solid var(--line); color: #3E4A5E; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.badge-it.on { color: var(--text); border-color: rgba(245,184,46,.4); }
.badge-it.on .ic { background: rgba(245,184,46,.18); color: var(--gold); }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); background: var(--card); }
.rank-row.me { border-color: var(--xp); box-shadow: 0 0 14px rgba(169,139,255,.25); }
.rank-row .pos { width: 30px; font: 700 18px var(--display); color: var(--muted); text-align: center; }
.rank-row .pos.p1 { color: #F5C542; text-shadow: 0 0 10px rgba(245,197,66,.7); } .rank-row .pos.p2 { color: #C9D2DC; } .rank-row .pos.p3 { color: #D9925B; }

/* ================= alertas de missão próxima ================= */
.alerts { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 40; width: min(440px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.alert-card { pointer-events: auto; position: relative; overflow: hidden; padding: 16px; display: flex; flex-direction: column; gap: 12px;
  border: 2px solid var(--c); --bk: #fff; --fill: #0A0D12; --fill-img: linear-gradient(180deg, color-mix(in srgb, var(--c) 16%, #0A0D12), #0A0D12 70%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--c) 18%, transparent), 0 0 40px color-mix(in srgb, var(--c) 35%, transparent), 0 20px 50px rgba(0,0,0,.6);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  animation: drop .45s cubic-bezier(.2,1.3,.4,1); }
.alert-card.out { animation: rise .3s ease-in forwards; }
@keyframes drop { from { transform: translateY(-120%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes rise { to { transform: translateY(-130%); opacity: 0; } }
.alert-card .head { display: flex; align-items: center; gap: 8px; font: 700 13px var(--display); letter-spacing: 2px; color: var(--c); }
.alert-card .head .rar { margin-left: auto; }
.alert-card .head i { width: 10px; height: 10px; border-radius: 5px; background: var(--c); animation: pulse-dot 1s ease-in-out infinite; box-shadow: 0 0 8px var(--c); }
@keyframes pulse-dot { 50% { opacity: .35; } }
.alert-card .big { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.alert-card .big .price { font-size: 34px; line-height: 1; }
.alert-card .t { font-size: 18px; font-weight: 700; line-height: 1.25; }
.alert-card .timer { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--c); width: 100%; transform-origin: left; animation: timer linear forwards; box-shadow: 0 0 8px var(--c); }
@keyframes timer { to { transform: scaleX(0); } }

/* ================= sobreposições ================= */
.overlay { position: fixed; inset: 0; z-index: 20; background: repeating-linear-gradient(0deg, rgba(255,255,255,.02) 0 1px, transparent 1px 3px), rgba(5,7,10,.86); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.overlay > * { margin: auto; }
.modal { width: 100%; max-width: 420px; padding: 20px; display: flex; flex-direction: column; gap: 14px; border: 1px solid rgba(245,184,46,.3);
  --bk: var(--gold); --fill: var(--panel); --fill-img: linear-gradient(180deg, var(--panel-2), var(--panel) 160px);
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px); }
.win { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.band { width: 100%; padding: 18px 0; background: linear-gradient(90deg, rgba(245,184,46,0), rgba(245,184,46,.18) 30%, rgba(245,184,46,.18) 70%, rgba(245,184,46,0)); border-top: 1px solid rgba(245,184,46,.5); border-bottom: 1px solid rgba(245,184,46,.5); animation: band .6s ease-out; }
.band h2 { margin: 0; font: 700 clamp(26px, 8.5vw, 40px) var(--display); letter-spacing: 4px; color: var(--gold); text-shadow: 0 0 18px rgba(245,184,46,.6), 2px 0 rgba(54,226,245,.3), -2px 0 rgba(240,122,176,.3); }
.band.purple { background: linear-gradient(90deg, rgba(169,139,255,0), rgba(169,139,255,.2) 30%, rgba(169,139,255,.2) 70%, rgba(169,139,255,0)); border-color: rgba(169,139,255,.55); }
.band.purple h2 { color: var(--xp); text-shadow: 0 0 18px rgba(169,139,255,.7); }
.win .amount { font: 700 46px var(--display); color: var(--ok); text-shadow: 0 0 20px rgba(126,216,155,.5); }
.win .xpgain { font: 700 22px var(--display); color: var(--xp); letter-spacing: 1px; text-shadow: 0 0 14px rgba(169,139,255,.6); }
.win .modal { margin-top: 6px; }
@keyframes band { from { transform: scaleX(.2); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
.stars { display: flex; gap: 4px; justify-content: center; }
.stars button { width: 48px; height: 48px; border: 0; background: transparent; padding: 0; color: #4A5566; }
.stars button.on { color: var(--gold); filter: drop-shadow(0 0 6px rgba(245,184,46,.7)); }
.qr { width: 180px; height: 180px; align-self: center; background: #fff; padding: 12px; box-shadow: 0 0 0 4px var(--gold), 0 0 24px rgba(245,184,46,.4); }
.lines { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.lines div { display: flex; justify-content: space-between; gap: 12px; }
.lines div span:last-child, .lines div b:last-child { text-align: right; }
.lines hr { border: 0; border-top: 1px dashed var(--line-2); margin: 2px 0; width: 100%; }

.flash { position: fixed; left: 0; right: 0; top: 38%; z-index: 30; pointer-events: none; text-align: center; }
.flash .band { animation: flash 1.6s ease-in-out forwards; }
.flash h2 { font-size: clamp(24px, 7vw, 36px); }
.flash p { margin: 4px 0 0; color: #CFD6E0; font-size: 14px; }
@keyframes flash { 0% { transform: scaleX(.2); opacity: 0; } 15% { transform: scaleX(1); opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(var(--sheet-h, 0px) + 16px); transform: translateX(-50%); z-index: 45; max-width: calc(100% - 32px); padding: 12px 18px; background: var(--text); color: var(--bg); font: 700 14px var(--display); letter-spacing: .3px; box-shadow: 0 8px 24px rgba(0,0,0,.4);
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.toast.bad { background: var(--danger); }
body.has-overlay .toast { top: 16px; bottom: auto; }
.toast.xp { background: var(--xp); }
@media (min-width: 900px) { .toast { bottom: 24px; } body.has-overlay .toast { top: 16px; bottom: auto; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation-duration: .01s !important; animation-iteration-count: 1 !important; } }
