/* Rei do Mundo — sistema de design
   Base quase preta, texto claro, um accent (verde) para ações e estados positivos,
   cores dos jogadores só no mapa e nos avatares. */

:root {
  --bg: #080808; --bg-2: #0b0b0b; --surface: #0f0f0f; --surface-2: #141414; --surface-3: #1a1a1a;
  --border: #1c1c1c; --border-2: #262626; --border-3: #333;
  --text: #ececec; --text-2: #9b9b9b; --text-3: #5f5f5f;
  --accent: #2ee6a0; --accent-ink: #06130d; --accent-dim: rgba(46, 230, 160, 0.12); --accent-glow: rgba(46, 230, 160, 0.35);
  --warn: #f2a93b; --danger: #f25c54;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --mono: 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace;
  --topbar: 56px; --side-l: 310px; --side-r: 340px; --radius: 6px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body { font-family: var(--sans); background: var(--bg); color: var(--text); font-size: 13px; line-height: 1.45; overflow: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:disabled { cursor: default; opacity: 0.55; }
input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; } ::-webkit-scrollbar-track { background: transparent; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.muted { color: var(--text-2); }
.fine { font-size: 11.5px; color: var(--text-3); line-height: 1.5; margin-top: 10px; }
.fine.center { text-align: center; margin-top: 6px; }
.eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); display: inline-flex; align-items: center; gap: 6px; }
[hidden] { display: none !important; }
.spin { animation: spin 0.9s linear infinite; } @keyframes spin { to { transform: rotate(360deg); } }
.flag { width: 20px; height: auto; border-radius: 2px; flex: none; box-shadow: 0 0 0 1px rgba(255,255,255,0.08); }
.flag-lg { width: 40px; }
.modal-title .flag { width: 26px; display: inline-block; vertical-align: -3px; margin-left: 6px; }

/* Avatares */
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; overflow: hidden; flex: none; color: #0a0a0a; font-weight: 700; vertical-align: middle; box-shadow: 0 0 0 1.5px #0a0a0a; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.avatar-empty { background: var(--surface-3); }

/* ---------- Topo ---------- */
.topbar { position: relative; z-index: 30; display: grid; grid-template-columns: auto minmax(200px, 400px) 1fr auto auto auto; align-items: center; gap: 18px; height: var(--topbar); padding: 0 16px; background: var(--bg); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 20px; height: 20px; border-radius: 50%; position: relative; border: 1.5px solid var(--border-3); background: linear-gradient(var(--border-3), var(--border-3)) center/100% 1px no-repeat, linear-gradient(var(--border-3), var(--border-3)) center/1px 100% no-repeat; }
.brand-mark::after { content: ''; position: absolute; left: 4px; top: 4px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
.brand-name { font-weight: 800; letter-spacing: 0.16em; font-size: 12.5px; }
.brand-logo { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 0 6px rgba(46,230,160,0.35)); }
.hero-logo { width: clamp(120px, 18vw, 180px); height: auto; margin: 0 auto 6px; display: block; filter: drop-shadow(0 0 28px rgba(46,230,160,0.35)); animation: logo-float 6s ease-in-out infinite; }
@keyframes logo-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }
.search { position: relative; display: flex; align-items: center; height: 34px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 0 10px; gap: 8px; }
.search:focus-within { border-color: var(--border-3); }
.search-icon { display: flex; color: var(--text-3); }
.search input { flex: 1; height: 100%; background: none; border: 0; outline: 0; font-size: 13px; min-width: 0; }
.search input::placeholder { color: var(--text-3); }
.search-kbd { font-family: var(--mono); font-size: 10px; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 3px; padding: 1px 5px; }
.search-results { position: absolute; left: -1px; right: -1px; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,0.5); overflow: hidden; z-index: 40; }
.sr { display: flex; align-items: center; width: 100%; text-align: left; padding: 9px 12px; gap: 10px; border-bottom: 1px solid var(--border); }
.sr:last-child { border-bottom: 0; } .sr:hover, .sr.is-active { background: var(--surface-2); }
.sr-main { display: flex; flex-direction: column; flex: 1; min-width: 0; } .sr-title { font-weight: 500; }
.sr-sub { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sr-side { font-family: var(--mono); font-size: 11.5px; color: var(--text-2); white-space: nowrap; } .sr-side.is-owned { color: var(--text); }
.stats { display: flex; gap: 26px; justify-content: center; }
.stat { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; }
.stat-v { font-size: 14px; font-weight: 500; white-space: nowrap; } .stat-l { font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); white-space: nowrap; }
.topnav { display: flex; gap: 2px; } .topnav-link { padding: 7px 10px; border-radius: var(--radius); color: var(--text-2); font-weight: 500; }
.topnav-link:hover { color: var(--text); background: var(--surface-2); }

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: var(--radius); font-weight: 600; font-size: 12.5px; border: 1px solid transparent; white-space: nowrap; transition: background 0.12s, border-color 0.12s, color 0.12s, box-shadow 0.12s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 0 var(--accent-glow); }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 0 18px var(--accent-glow); }
.btn-secondary { background: var(--surface-2); border-color: var(--border-2); color: var(--text); }
.btn-secondary:hover:not(:disabled) { border-color: var(--border-3); background: var(--surface-3); }
.btn-ghost { background: none; border-color: var(--border-2); color: var(--text-2); }
.btn-block { width: 100%; } .btn-lg { height: 42px; font-size: 14px; padding: 0 18px; }
.icon-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--radius); color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.mini-btn { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 4px; color: var(--text-2); vertical-align: middle; }
.mini-btn:hover { background: var(--surface-3); color: var(--text); }
.link-btn { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 500; font-size: 12.5px; }
.link-btn:hover { text-decoration: underline; }
.badge { position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); font-size: 9.5px; font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* Wallet e notificações */
.wallet-slot, .bell-slot { display: flex; justify-content: flex-end; }
.wallet-pill-wrap, .bell-wrap { position: relative; }
.wallet-pill { display: flex; align-items: center; gap: 9px; height: 36px; padding: 0 10px 0 8px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface); }
.wallet-pill:hover { border-color: var(--border-3); } .wallet-pill.is-wrong { border-color: rgba(242,169,59,0.5); }
.wallet-pill-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.1; }
.wallet-pill-label { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); font-family: var(--mono); }
.wallet-pill .mono { font-size: 12px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; } .dot-ok { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); } .dot-warn { background: var(--warn); }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,0.5); padding: 6px; z-index: 50; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; } .menu-head .muted { font-size: 11.5px; }
.menu-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 8px 10px; border-radius: 4px; color: var(--text); }
.menu-item:hover { background: var(--surface-2); } .menu-item.is-danger { color: var(--danger); }
.menu-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-stats > div { display: flex; flex-direction: column; line-height: 1.2; } .menu-stats .muted { font-size: 10.5px; }
.menu-notif { min-width: 300px; max-height: 420px; overflow-y: auto; }
.notif { align-items: flex-start; } .notif > span:last-child { display: flex; flex-direction: column; gap: 2px; } .notif.is-unread { background: var(--accent-dim); }
.feed-icon { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 50%; background: var(--surface-3); color: var(--text-2); flex: none; }
.kind-takeover .feed-icon, .kind-lost .feed-icon { color: var(--danger); } .kind-conquest .feed-icon, .kind-won .feed-icon { color: var(--accent); } .kind-milestone .feed-icon { color: var(--warn); }
.wallet-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0 12px; }
.wallet-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; text-align: left; background: var(--surface-2); border: 1px solid var(--border-2); border-radius: var(--radius); }
.wallet-row:hover:not(:disabled) { border-color: var(--border-3); background: var(--surface-3); }
.wallet-row img { width: 28px; height: 28px; border-radius: 6px; } .wallet-row-name { flex: 1; font-weight: 600; font-size: 13.5px; }
.wallet-row-state { font-size: 11px; color: var(--text-3); } .wallet-row-state.is-on { color: var(--accent); }
.wallet-status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--border-2); margin-bottom: 12px; color: var(--text-2); }
.wallet-status.ok { color: var(--accent); border-color: rgba(46,230,160,0.35); } .wallet-status.error { color: var(--danger); border-color: rgba(242,92,84,0.35); }
.modal-foot { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; padding-top: 4px; } .modal-foot .muted { font-size: 11.5px; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: var(--side-l) 1fr var(--side-r); height: calc(100vh - var(--topbar)); height: calc(100dvh - var(--topbar)); }
.side { background: var(--bg-2); overflow-y: auto; overscroll-behavior: contain; }
.side-left { border-right: 1px solid var(--border); } .side-right { border-left: 1px solid var(--border); }
.sheet-handle { display: none; } .stats-grid { display: none; }
.panel { padding: 16px; border-bottom: 1px solid var(--border); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; } .panel-head.sub { margin-top: 18px; }
.panel-title { font-size: 11px; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-2); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.panel-title .count { font-family: var(--mono); color: var(--text-3); margin-left: 4px; letter-spacing: 0; }
.panel-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; color: var(--text-2); font-size: 12px; font-weight: 500; }
.panel-link:hover { color: var(--text); } .panel-link svg { transform: rotate(-90deg); }
.panel-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.08em; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--accent-dim); } 50% { box-shadow: 0 0 0 6px rgba(46,230,160,0.05); } }
.select-wrap { position: relative; display: flex; align-items: center; }
.select-wrap select { appearance: none; -webkit-appearance: none; background: var(--surface); border: 1px solid var(--border-2); border-radius: 4px; padding: 4px 22px 4px 8px; font-size: 11.5px; color: var(--text-2); cursor: pointer; max-width: 170px; }
.select-wrap select:hover { color: var(--text); border-color: var(--border-3); } .select-wrap svg { position: absolute; right: 7px; pointer-events: none; color: var(--text-3); }
.list { display: flex; flex-direction: column; } .list-scroll { max-height: 44vh; overflow-y: auto; margin-right: -8px; padding-right: 8px; }
.row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 7px 6px; margin: 0 -6px; border-radius: 4px; text-align: left; }
.row + .row { border-top: 1px solid var(--border); } button.row:hover, a.row:hover { background: var(--surface-2); }
.row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.row-title { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .row-feed .row-title { white-space: normal; }
.row-sub { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-side { font-size: 11.5px; color: var(--text-2); flex: none; } .row-actions { display: flex; gap: 6px; flex: none; }
.rank { width: 16px; font-family: var(--mono); font-size: 11px; color: var(--text-3); text-align: right; flex: none; }
.swatch { width: 9px; height: 9px; border-radius: 2px; flex: none; display: inline-block; } .swatch-lg { width: 48px; height: 48px; border-radius: 10px; }
.tag { font-size: 9.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); border: 1px solid var(--border-2); border-radius: 3px; padding: 1px 4px; margin-left: 4px; vertical-align: middle; }
.empty { color: var(--text-3); padding: 12px 0; font-size: 12px; }
.mini-stats { display: flex; gap: 14px; margin: 4px 0 10px; color: var(--text-2); font-size: 11.5px; flex-wrap: wrap; } .mini-stats b { color: var(--text); font-weight: 500; margin-right: 3px; }
.mini-stats.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.mini-stats.three span { background: var(--surface); border: 1px solid var(--border); border-radius: 4px; padding: 8px; display: flex; flex-direction: column; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; padding: 4px 9px; border: 1px solid var(--border-2); border-radius: 999px; color: var(--text-2); }
.chip:hover { color: var(--text); border-color: var(--border-3); background: var(--surface-2); }
.owner-link { display: inline-flex; align-items: center; gap: 6px; } .owner-link:hover { text-decoration: underline; }

/* ---------- Mapa ---------- */
.map-wrap { position: relative; background: var(--bg); overflow: hidden; min-width: 0; }
.map-wrap canvas { display: block; touch-action: none; cursor: grab; } .map-wrap canvas:active { cursor: grabbing; }
.map-wrap .map-fx { position: absolute; left: 0; top: 0; pointer-events: none; cursor: default; }
.map-controls { position: absolute; right: 14px; top: 14px; display: flex; flex-direction: column; gap: 4px; }
.map-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); color: var(--text-2); }
.map-btn:hover { color: var(--text); border-color: var(--border-3); }
.map-legend { position: absolute; left: 14px; bottom: 14px; display: flex; gap: 14px; padding: 6px 10px; background: rgba(15,15,15,0.85); border: 1px solid var(--border-2); border-radius: var(--radius); font-size: 11px; color: var(--text-2); }
.map-legend span { display: flex; align-items: center; gap: 6px; } .lg { width: 10px; height: 10px; border-radius: 2px; }
.lg-available { background: #191919; border: 1px solid #333; } .lg-owned { background: linear-gradient(135deg, #f25c54, #4cc9f0); } .lg-mine { background: var(--accent); }
.tooltip { position: absolute; left: 0; top: 0; pointer-events: none; min-width: 150px; max-width: 240px; padding: 8px 10px; background: rgba(12,12,12,0.96); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.5); z-index: 20; }
.tt-title { font-weight: 600; font-size: 13px; } .tt-sub { font-size: 11px; color: var(--text-2); margin-bottom: 6px; }
.tt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11.5px; } .tt-row > span:first-child { display: flex; align-items: center; gap: 6px; }
.tt-avail { color: var(--accent); } .tt-row .mono { color: var(--text-2); }

/* Homepage (hero sobre o mapa) */
.home { position: absolute; inset: 0; z-index: 15; display: flex; align-items: center; justify-content: center; background: radial-gradient(ellipse at center, rgba(8,8,8,0.55) 0%, rgba(8,8,8,0.85) 60%, rgba(8,8,8,0.95) 100%); overflow-y: auto; }
.hero-inner { text-align: center; max-width: 720px; padding: 32px 24px; }
.hero-eyebrow { justify-content: center; color: var(--accent); }
.hero-title { font-size: clamp(40px, 7vw, 84px); font-weight: 800; letter-spacing: 0.04em; line-height: 1; margin: 14px 0 18px; text-shadow: 0 0 40px rgba(46,230,160,0.18); }
.hero-tagline { font-size: clamp(17px, 2.2vw, 24px); font-weight: 500; line-height: 1.35; color: var(--text); }
.hero-actions { display: flex; gap: 10px; justify-content: center; margin: 26px 0 30px; flex-wrap: wrap; }
.hero-stats { display: flex; justify-content: center; gap: 34px; flex-wrap: wrap; }
.hero-stats > div { display: flex; flex-direction: column; align-items: center; } .hero-stats .stat-v { font-size: 22px; font-weight: 600; }
.hero-rule { margin-top: 30px; font-size: 12.5px; color: var(--text-2); }
body.is-home .side, body.is-home .map-controls, body.is-home .map-legend, body.is-home .mobile-bar { display: none !important; }
body.is-home .app { grid-template-columns: 1fr; }
.hero-charity { margin-top: 14px; color: var(--accent); font-size: 13px; display: flex; gap: 6px; justify-content: center; align-items: center; flex-wrap: wrap; }
.hero-charity a { text-decoration: underline; }
.hero-fine { color: var(--text-3); font-size: 11.5px; margin-top: 8px; }

/* Landing → map transition */
.home { transition: opacity 0.6s ease, transform 0.62s cubic-bezier(0.2, 0.7, 0.2, 1); will-change: opacity, transform; }
.home.is-leaving { opacity: 0; transform: scale(1.14); pointer-events: none; }
.home.is-leaving .hero-inner { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s ease; transform: translateY(-16px); opacity: 0; }
@keyframes side-in-left { from { transform: translateX(-28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes side-in-right { from { transform: translateX(28px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 901px) {
  body.is-entering:not(.is-home) .side-left { animation: side-in-left 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
  body.is-entering:not(.is-home) .side-right { animation: side-in-right 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
}
body.is-entering:not(.is-home) .map-controls, body.is-entering:not(.is-home) .map-legend, body.is-entering:not(.is-home) .mobile-bar { animation: fade-in 0.5s ease both; }
@media (prefers-reduced-motion: reduce) { .home, .home.is-leaving .hero-inner { transition: none; } body.is-entering .side, body.is-entering .map-controls, body.is-entering .map-legend, body.is-entering .mobile-bar { animation: none; } }

/* Purchase confirmations */
.center-btn { justify-content: center; width: 100%; font-size: 11.5px; color: var(--text-2); margin-top: 2px; }
.check-row { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 12.5px; cursor: pointer; }
.check-row input { margin-top: 2px; accent-color: var(--accent); width: 15px; height: 15px; flex: none; }
.notice-info { border-color: rgba(46,230,160,0.3); color: var(--text); }
.notice-info svg { color: var(--accent); flex: none; margin-top: 2px; }

/* ---------- Painel de seleção ---------- */
.city-banner { display: flex; align-items: center; gap: 12px; padding: 12px; margin: 4px 0 8px; border-radius: 8px; background: linear-gradient(135deg, color-mix(in srgb, var(--owner, #2a2a2a) 22%, var(--surface)) 0%, var(--surface) 70%); border: 1px solid var(--border-2); }
.sel-title { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.15; }
.sel-sub { color: var(--text-2); margin-top: 2px; } .sel-sub .link-btn { color: var(--text); font-weight: 500; }
.sel-meta { font-size: 11.5px; color: var(--text-3); margin: 4px 0 12px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kv-list { display: flex; flex-direction: column; border-top: 1px solid var(--border); }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); }
.kv > span { color: var(--text-2); font-size: 12px; } .kv > strong { font-weight: 500; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; text-align: right; }
.kv .price { font-size: 15px; } .kv-total > strong { font-size: 15px; } .kv-total > span { color: var(--text); font-weight: 600; }
.pill { font-size: 10.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; }
.pill-owned { background: var(--surface-3); color: var(--text); } .pill-available { background: var(--accent-dim); color: var(--accent); }
.actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; } .actions .btn { width: 100%; }
.empty-hero { padding: 6px 0 10px; } .empty-hero .muted { margin-top: 6px; font-size: 12.5px; line-height: 1.5; }
.timeline { display: flex; flex-direction: column; gap: 0; position: relative; }
.tl-item { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.tl-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--bg-2); }
.tl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 5px; flex-wrap: wrap; } .tl-time { color: var(--text-3); font-size: 11px; white-space: nowrap; }
.timeline .link-btn { margin-top: 8px; }
.regions { display: flex; flex-direction: column; gap: 4px; }
details.region { border: 1px solid var(--border); border-radius: 4px; padding: 0 10px; }
details.region summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 8px 0; font-weight: 500; font-size: 12.5px; }
details.region summary::-webkit-details-marker { display: none; } details.region summary .muted { font-size: 11px; }
details.region[open] summary { border-bottom: 1px solid var(--border); }

/* ---------- Modais ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.65); opacity: 0; transition: opacity 0.12s; padding: 16px; }
.modal-backdrop.open { opacity: 1; } .modal-backdrop.closing { opacity: 0; }
.modal { width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 20px; box-shadow: 0 24px 64px rgba(0,0,0,0.6); transform: translateY(6px); transition: transform 0.12s; }
.modal-wide { max-width: 640px; } .modal-backdrop.open .modal { transform: none; }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.modal-title { font-size: 20px; font-weight: 700; letter-spacing: -0.01em; margin-top: 2px; display: flex; align-items: center; flex-wrap: wrap; }
.modal-sub { color: var(--text-2); margin-bottom: 14px; line-height: 1.5; }
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; } .modal-actions.row-actions { flex-direction: row; }
.modal .kv-list { margin-top: 6px; }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius); margin-top: 12px; font-size: 12px; background: var(--surface-2); border: 1px solid var(--border-2); color: var(--text-2); }
.notice-warn { background: rgba(242,169,59,0.08); border-color: rgba(242,169,59,0.35); color: var(--warn); }
.notice-ok { background: var(--accent-dim); border-color: rgba(46,230,160,0.35); color: var(--accent); }
.tx-state { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: var(--radius); margin-top: 14px; background: var(--surface-2); border: 1px solid var(--border-2); }
.tx-state div { display: flex; flex-direction: column; gap: 2px; } .tx-state strong { font-weight: 600; } .tx-state span { color: var(--text-2); font-size: 12px; }
.tx-state.ok { border-color: rgba(46,230,160,0.4); color: var(--accent); } .tx-state.error { border-color: rgba(242,92,84,0.4); color: var(--danger); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; } .field > span:first-child { font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.input-wrap { display: flex; align-items: center; height: 40px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--bg); padding: 0 12px; gap: 6px; }
.input-wrap:focus-within { border-color: var(--accent); } .input-prefix { color: var(--text-3); font-family: var(--mono); font-size: 14px; display: inline-flex; }
.input-wrap input, .input-wrap select { flex: 1; background: none; border: 0; outline: 0; font-size: 14px; min-width: 0; height: 100%; } .input-wrap select { color: var(--text); }
.input-wrap select option { background: var(--surface); }
.field-hint { font-size: 11.5px; color: var(--text-3); } .field-hint.is-error { color: var(--danger); } .field-hint.is-ok { color: var(--accent); }
.profile-preview { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 14px; background: var(--bg); }

/* Passo X na compra */
.x-step { margin: 10px 0 4px; padding: 12px; border: 1px solid var(--border-2); border-radius: 8px; background: var(--bg); }
.x-step .field { margin-bottom: 0; } .req { color: var(--accent); font-weight: 600; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; margin-left: 6px; }
.x-input-wrap { padding-right: 6px; } .btn-sm { height: 28px; padding: 0 10px; font-size: 12px; flex: none; }
.x-preview { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 12px; border: 1px solid rgba(46,230,160,0.35); background: var(--accent-dim); border-radius: var(--radius); }
.x-preview > div { flex: 1; min-width: 0; line-height: 1.3; } .x-preview .muted { font-size: 11.5px; } .x-ok { color: var(--accent); }
.pill-hot { background: rgba(255,77,79,0.14); color: #ff6b6d; margin-left: 6px; }
.feed-icon.is-good { color: var(--accent); } .feed-icon.is-bad { color: var(--warn); }
.row-sub.wrap { white-space: normal; } .addr-full { word-break: break-all; text-align: right; font-size: 11.5px; } .mono.small { font-size: 11px; word-break: break-all; }

/* Floating X button */
.x-fab { position: fixed; right: 18px; bottom: 18px; z-index: 60; width: 48px; height: 48px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #000; color: #fff; border: 1px solid var(--border-3); box-shadow: 0 8px 24px rgba(0,0,0,0.55), 0 0 0 0 var(--accent-glow); transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; }
.x-fab:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,0.6), 0 0 18px var(--accent-glow); }
@media (max-width: 900px) { .x-fab { right: 12px; bottom: 60px; width: 44px; height: 44px; } }

/* ---------- Toasts ---------- */
.toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 200; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { padding: 10px 14px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,0.5); opacity: 0; transform: translateY(6px); transition: opacity 0.15s, transform 0.15s; font-size: 12.5px; }
.toast.show { opacity: 1; transform: none; } .toast-ok { border-color: rgba(46,230,160,0.5); box-shadow: 0 8px 24px rgba(0,0,0,0.5), 0 0 24px rgba(46,230,160,0.15); } .toast-warn { border-color: rgba(242,169,59,0.4); }

/* ---------- Páginas ---------- */
.page { position: fixed; left: 0; right: 0; top: var(--topbar); bottom: 0; z-index: 25; background: var(--bg); overflow-y: auto; }
.page-inner { max-width: 1080px; margin: 0 auto; padding: 24px 24px 60px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); font-weight: 500; margin-bottom: 20px; } .back-link:hover { color: var(--text); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; } .page-head.sub { align-items: center; margin: 24px 0 10px; }
.page-title { font-size: 28px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; margin: 4px 0 6px; }
.tabs { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border-2); border-radius: var(--radius); padding: 3px; } .tabs-wrap { flex-wrap: wrap; margin-bottom: 16px; }
.tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 4px; color: var(--text-2); font-weight: 500; font-size: 12.5px; } .tab:hover { color: var(--text); } .tab.is-on { background: var(--surface-3); color: var(--text); }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; min-width: 560px; }
.table th { text-align: left; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-3); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); white-space: nowrap; }
.table td { padding: 9px 14px; border-bottom: 1px solid var(--border); } .table tr:last-child td { border-bottom: 0; } .table tbody tr:hover td { background: var(--surface); } .table .num { text-align: right; }
.owner-cell { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; } .owner-cell:hover { text-decoration: underline; }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.profile-id { display: flex; align-items: center; gap: 18px; } .profile-name { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }
.profile-links { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; } .stat-row.six { grid-template-columns: repeat(6, 1fr); }
.stat-card { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); } .stat-card .stat-v { font-size: 20px; }
.profile-map { border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-2); overflow: hidden; margin-bottom: 8px; } .mini-map { display: block; width: 100%; height: auto; }
.two-col { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: start; }
.admin-form { max-width: 520px; } .admin-form.grid { max-width: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 14px; } .admin-form.grid .modal-actions { grid-column: 1 / -1; }
.admin-toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; } .admin-toolbar .input-wrap { width: 280px; }
.inline-input { width: 90px; background: var(--bg); border: 1px solid var(--border-2); border-radius: 4px; padding: 4px 6px; text-align: right; font-size: 12px; }
.page-admin .panel { padding: 0; border: 0; }

/* ---------- Mobile ---------- */
.mobile-bar { display: none; }
@media (max-width: 1400px) { .stats { gap: 18px; } .stat-v { font-size: 13px; } }
@media (max-width: 1220px) {
  :root { --side-l: 280px; --side-r: 310px; }
  .stats { display: none; } .topbar { grid-template-columns: auto minmax(160px, 1fr) auto auto auto; }
  .stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); border-bottom: 1px solid var(--border); }
  .stats-grid .stat-card { border: 0; border-radius: 0; background: var(--bg-2); padding: 12px 16px; } .stats-grid .stat-v { font-size: 16px; }
  .stat-row.six { grid-template-columns: repeat(3, 1fr); } .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  :root { --topbar: 52px; }
  .topbar { grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; padding: 0 10px; }
  .brand-name, .topnav, .search-kbd, .wallet-pill-label { display: none; }
  .search { min-width: 0; } .wallet-pill { padding: 0 8px 0 6px; gap: 6px; }
  .btn-primary#btn-connect span { display: none; } .btn-primary#btn-connect { width: 34px; padding: 0; }
  .app { display: block; height: calc(100vh - var(--topbar) - 48px); height: calc(100dvh - var(--topbar) - 48px); } .map-wrap { height: 100%; }
  .side { position: fixed; left: 0; right: 0; bottom: 48px; max-height: 66vh; z-index: 28; border: 0; border-top: 1px solid var(--border-2); border-radius: 12px 12px 0 0; transform: translateY(105%); transition: transform 0.22s ease; box-shadow: 0 -12px 32px rgba(0,0,0,0.5); }
  .side.is-open { transform: none; } .side-right { max-height: 50vh; } .list-scroll { max-height: 30vh; }
  .sheet-handle { display: block; width: 36px; height: 4px; border-radius: 2px; background: var(--border-3); margin: 8px auto 2px; cursor: pointer; }
  .mobile-bar { position: fixed; left: 0; right: 0; bottom: 0; height: 48px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--bg); border-top: 1px solid var(--border); z-index: 29; padding-bottom: env(safe-area-inset-bottom); }
  .mobile-bar button { font-size: 11.5px; font-weight: 500; color: var(--text-2); letter-spacing: 0.02em; } .mobile-bar button.is-on { color: var(--accent); }
  .map-legend { bottom: 12px; left: 12px; gap: 10px; padding: 5px 8px; }
  .page { bottom: 0; } .page-inner { padding: 16px 14px 60px; } .stat-row, .stat-row.six { grid-template-columns: 1fr 1fr; } .page-title { font-size: 24px; } .modal { padding: 16px; }
  .admin-form.grid { grid-template-columns: 1fr 1fr; } .hero-stats { gap: 20px; } .home { align-items: flex-start; }
}

/* ---- Owner → X, share on X, multi-city selection ---- */
.x-link { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 3px 9px; margin-left: 6px; border: 1px solid var(--border-3); border-radius: 999px; background: #000; color: #fff; white-space: nowrap; }
.x-link:hover { border-color: var(--accent); box-shadow: 0 0 12px var(--accent-glow); }
.x-mini { width: 20px; height: 20px; color: var(--text-3); } .x-mini:hover { color: #fff; background: #000; }
.share-x { background: #000; color: #fff; border-color: var(--border-3); } .share-x:hover:not(:disabled) { border-color: var(--accent); background: #000; box-shadow: 0 0 14px var(--accent-glow); }
.row-actions .mini-btn { color: var(--text-2); }
.basket { border: 1px solid rgba(46,230,160,0.4); background: var(--accent-dim); border-radius: var(--radius); padding: 10px 12px 12px; margin-bottom: 16px; }
.basket .panel-head { margin-bottom: 4px; } .basket .panel-title { color: var(--accent); }
.basket-list { max-height: 30vh; overflow-y: auto; margin-bottom: 10px; }
.basket-list .row { padding: 6px 0; margin: 0; } .basket-list .row + .row { border-top-color: rgba(46,230,160,0.15); }
.basket-list .row.is-mine { opacity: 0.55; }
.link-plain { text-align: left; padding: 0; } .link-plain:hover { text-decoration: underline; }
.basket .fine { margin-top: 6px; }
.row-city { padding: 0; gap: 0; align-items: stretch; }
.row-city .row-hit { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; padding: 7px 6px; text-align: left; border-radius: 4px; }
.row-city .row-hit:hover { background: var(--surface-2); }
.basket-btn { align-self: center; margin-right: 4px; border: 1px solid var(--border-2); color: var(--text-2); }
.basket-btn:hover, .basket-btn.is-on { border-color: var(--accent); color: var(--accent); background: var(--accent-dim); }
.row-city.is-selected .row-hit { background: var(--accent-dim); }
.checkout-list { max-height: 200px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius); padding: 2px 10px; margin-top: 12px; background: var(--surface); }
.checkout-list .row { margin: 0; padding: 7px 0; }

/* ---- Select mode (click cities on the map to add them to one purchase) ---- */
.map-btn-select { margin-top: 6px; }
.map-btn.is-on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); box-shadow: 0 0 14px var(--accent-glow); }
.map-wrap.select-mode canvas { cursor: crosshair; }
.select-banner { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); z-index: 5; display: inline-flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; border-radius: 999px; background: rgba(8,8,8,0.9); border: 1px solid var(--accent); color: var(--text); font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.5); white-space: nowrap; }
.select-banner b { color: var(--accent); }
.select-banner .btn { height: 26px; padding: 0 10px; font-size: 11.5px; }
@media (max-width: 900px) { .select-banner { top: auto; bottom: 70px; max-width: 94vw; white-space: normal; } }

/* Select-mode button on the empty panel: breathing room above the continent chips */
.select-cta { margin: 14px 0 16px; }

.country-facts { margin: 8px 0 2px; } .country-facts .kv { padding: 7px 0; }

/* ---- Checkout: X account required ---- */
.notice-x { border-color: var(--accent); background: rgba(46,230,160,0.08); color: var(--text); margin-top: 14px; }
.notice-x svg { flex: none; margin-top: 2px; color: #fff; }
.field-hint.is-ok, .fine.is-ok { color: var(--accent); }

/* ---- Thank-you page ---- */
.page-thanks .thanks-head { max-width: 760px; margin-bottom: 26px; }
.page-thanks .page-title { font-size: 34px; }
.thanks-sub { font-size: 14px; line-height: 1.55; margin-top: 8px; }
.thanks-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.thanks-card { background: var(--surface); border: 1px solid var(--border-2); border-radius: 10px; padding: 14px; }
.thanks-img-wrap { position: relative; aspect-ratio: 1200 / 630; border-radius: 8px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.thanks-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thanks-img-fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; gap: 8px; color: var(--text-2); font-size: 12.5px; }
.thanks-img-wrap.is-missing .thanks-img { display: none; } .thanks-img-wrap.is-missing .thanks-img-fallback { display: flex; }
.thanks-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; } .thanks-actions .btn { width: 100%; }
.share-x-primary { background: #000; color: #fff; border-color: var(--accent); } .share-x-primary:hover { box-shadow: 0 0 22px var(--accent-glow); }
.share-link { font-size: 12px; padding: 10px 12px; border: 1px solid var(--border-2); border-radius: var(--radius); background: var(--surface); word-break: break-all; }
.thanks-links { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 18px; }
@media (max-width: 900px) { .thanks-grid { grid-template-columns: 1fr; } .page-thanks .page-title { font-size: 26px; } }
