:root {
  --bg: #0C0E11;
  --bar: #0F1215;
  --surface: #12161B;
  --well: #0F1317;
  --raised: #1A1F26;
  --line: #1E242C;
  --line-2: #2A313B;
  --text: #E9ECEF;
  --text-2: #B4BCC6;
  --muted: #8C95A1;
  --accent: #F0A23B;
  --accent-hi: #FFC067;
  --on-accent: #17120A;
  --ok: #56C2E0;
  --ok-text: #7FD3EA;
  --ok-bg: #10242B;
  --lock-bg: #2A2012;
  --lock-line: #4A3818;
  --st: #F28A4B;
  --sv: #FFD54A;
  --display: 'Chakra Petch', sans-serif;
  --body: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--body); }
button, input, select { font: inherit; color: inherit; }
a { color: var(--accent); }
a:hover { color: var(--accent-hi); }
h1, h2, h3 { margin: 0; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: 32px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--raised); color: var(--text); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { color: var(--text); border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Topo ---------- */
.top { background: var(--bar); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.top-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--accent); text-decoration: none; }
.logo span { font: 700 20px var(--display); letter-spacing: 1.5px; color: var(--text); }
.logo b { color: var(--accent); }
.top-nav { display: flex; align-items: center; gap: 4px; }
.top-nav > a:not(.btn) { color: var(--text-2); text-decoration: none; font-weight: 500; padding: 12px 14px; }
.top-nav > a:not(.btn):hover { color: var(--text); }

/* ---------- Hero ---------- */
.main { padding-top: 40px; padding-bottom: 64px; display: flex; flex-direction: column; gap: 40px; }
.hero { display: flex; flex-wrap: wrap; gap: 24px; align-items: stretch; }
.profile { flex: 999 1 560px; min-width: 0; padding: 32px; display: flex; flex-direction: column; gap: 24px; }
.who { display: flex; align-items: center; gap: 20px; }
.avatar { width: 84px; height: 84px; flex: none; border-radius: 12px; object-fit: cover; border: 2px solid var(--line-2); background: var(--raised); }
.eyebrow { font: 500 12px var(--mono); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.who h1 { font: 700 34px/1.15 var(--display); overflow-wrap: anywhere; }
.profile p { margin: 0; color: var(--text-2); max-width: 620px; }
.link-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 10px; }
.link-row { display: flex; gap: 10px; flex-wrap: wrap; }
.link-row input {
  flex: 1 1 320px; min-width: 0; height: 48px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line-2); background: var(--bg); color: var(--text-2); font: 13px var(--mono);
}
.link-row .btn { min-height: 48px; }

.stats { flex: 1 1 340px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 4px; }
.stat.wide { grid-column: span 2; padding: 22px 24px; }
.stat .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.stat .value { font: 700 28px var(--mono); font-variant-numeric: tabular-nums; }
.stat.wide .value { font-size: 36px; letter-spacing: -0.5px; }
.stat .hint { font-size: 12px; color: var(--muted); }
.value.ok { color: var(--ok); }
.value.lock { color: var(--accent); }

/* ---------- Inventário ---------- */
.inv { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 90px; }
.inv-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
h2 { font: 700 26px var(--display); }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; flex-wrap: wrap; }
.tabs button { min-height: 40px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--text-2); font-weight: 600; cursor: pointer; }
.tabs button:hover { color: var(--text); }
.tabs button span { font: 12px var(--mono); opacity: .8; margin-left: 2px; }
.tabs button.active { background: var(--accent); color: var(--on-accent); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.search { position: relative; flex: 1 1 260px; }
.search svg { position: absolute; left: 14px; top: 14px; color: var(--muted); pointer-events: none; }
.search input { width: 100%; height: 44px; padding: 0 14px 0 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); outline: none; }
.search input:focus { border-color: var(--accent); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chips button {
  min-height: 44px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text-2); font-weight: 500; font-size: 14px; cursor: pointer;
}
.chips button span { font: 11px var(--mono); opacity: .75; margin-left: 2px; }
.chips button:hover { color: var(--text); border-color: var(--muted); }
.chips button.active { border-color: var(--accent); background: #1C1710; color: #FFD49A; }
.filters select { height: 44px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); font-weight: 500; }

.notice {
  grid-column: 1 / -1; display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px;
  border-radius: 10px; background: #1C1710; border: 1px solid var(--lock-line); color: #E9D9BE;
}
.notice svg { flex: none; margin-top: 2px; color: var(--accent); }
.notice p { margin: 0; }
.notice strong { color: #fff; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.empty { grid-column: 1 / -1; padding: 56px 16px; text-align: center; color: var(--muted); }

/* ---------- Cartão ---------- */
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s; }
.item:hover { border-color: var(--line-2); transform: translateY(-2px); }
.item.locked { border-color: var(--lock-line); }
.item-img { position: relative; height: 150px; display: flex; align-items: center; justify-content: center; background: var(--well); border-top: 3px solid var(--rarity, #B0C3D9); }
.item-img img { width: 82%; height: 120px; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.45)); }
.item.locked .item-img img { opacity: .6; }
.tag { position: absolute; top: 10px; font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; }
.tag.wear { left: 10px; font-family: var(--mono); background: var(--raised); color: var(--text-2); }
.tag.st { right: 10px; background: #2A1A12; color: var(--st); }
.tag.sv { right: 10px; background: #2A2510; color: var(--sv); }
.tag.timer { right: 10px; display: inline-flex; align-items: center; gap: 5px; font: 700 12px var(--mono); background: var(--lock-bg); color: var(--accent-hi); }
.item-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.item-name { display: flex; flex-direction: column; min-width: 0; }
.item-name .weapon { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-name .skin { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.floatbar { position: relative; height: 6px; display: flex; gap: 2px; }
.floatbar i { display: block; }
.floatbar i:nth-child(1) { width: 7%; background: #3C8C6E; border-radius: 3px 0 0 3px; }
.floatbar i:nth-child(2) { width: 8%; background: #5E9A55; }
.floatbar i:nth-child(3) { width: 23%; background: #A7984A; }
.floatbar i:nth-child(4) { width: 7%; background: #B4703E; }
.floatbar i:nth-child(5) { flex: 1; background: #9C4A43; border-radius: 0 3px 3px 0; }
.floatbar b { position: absolute; top: -3px; width: 3px; height: 12px; margin-left: -1px; border-radius: 2px; background: #fff; box-shadow: 0 0 0 2px var(--surface); }
.float-meta { display: flex; justify-content: space-between; margin-top: 5px; font: 11px var(--mono); color: var(--muted); }

.lockbar { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.lockbar i { display: block; height: 100%; background: var(--accent); }
.unlock-at { margin-top: 4px; font-size: 12px; color: var(--muted); }

.item-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.price { display: flex; flex-direction: column; }
.price strong { font: 700 17px var(--mono); }
.price small { font-size: 11px; color: var(--muted); }
.price.estimate strong { color: var(--text-2); }
.status { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 6px; white-space: nowrap; }
.status.ok { background: var(--ok-bg); color: var(--ok-text); }
.status.lock { background: var(--lock-bg); color: var(--accent-hi); }

/* ---------- Como trocar / rodapé ---------- */
.how { display: flex; flex-direction: column; gap: 18px; scroll-margin-top: 90px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.step { padding: 22px; display: flex; flex-direction: column; gap: 8px; border-radius: 12px; }
.step-n { font: 700 15px var(--mono); color: var(--accent); }
.step h3 { font-size: 17px; }
.step p { margin: 0; color: var(--text-2); }
.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

.mobile-cta { display: none; }

.toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { padding: 10px 16px; border-radius: 8px; background: var(--raised); border: 1px solid var(--line-2); box-shadow: 0 8px 24px rgba(0,0,0,.45); animation: in .2s ease; }
.toast.success { border-color: var(--ok); }
.toast.error { border-color: #E5484D; }
@keyframes in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Telemóvel ---------- */
@media (max-width: 720px) {
  .wrap { padding-inline: 16px; }
  .top-inner { height: 60px; }
  .top-nav > a:not(.btn), .top-nav .btn { display: none; }
  .main { padding-top: 20px; padding-bottom: 120px; gap: 28px; }
  .profile { padding: 20px; gap: 16px; }
  .who { gap: 14px; }
  .avatar { width: 60px; height: 60px; border-radius: 10px; }
  .who h1 { font-size: 21px; }
  .link-row input { display: none; }
  .link-row .btn { flex: 1; }
  .link-row .btn-primary { display: none; }
  .stats { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; }
  .stat, .stat.wide { grid-column: auto; padding: 12px; }
  .stat .label { font-size: 11px; }
  .stat .value, .stat.wide .value { font-size: 16px; letter-spacing: 0; }
  .stat .hint { display: none; }
  .tabs { width: 100%; }
  .tabs button { flex: 1; padding: 0 8px; }
  .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; padding-bottom: 2px; }
  .chips button { flex: none; }
  .filters select { width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .item-img { height: 104px; }
  .item-img img { height: 86px; }
  .item-body { padding: 10px 12px 12px; gap: 8px; }
  .item-name .skin { font-size: 13px; }
  .item-foot { flex-wrap: wrap; }
  .price strong { font-size: 14px; }
  .price small { display: none; }
  .status { font-size: 11px; padding: 3px 7px; }
  .mobile-cta { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 12px 16px 20px; background: var(--bar); border-top: 1px solid var(--line); }
  .mobile-cta .btn { width: 100%; min-height: 52px; border-radius: 10px; font-weight: 700; }
  .toasts { bottom: 100px; }
}

/* ---------- Estado e destaques (definidos no painel) ---------- */
.status-line { display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; padding: 6px 12px; border-radius: 999px; background: var(--raised); font-size: 13px; font-weight: 600; color: var(--text-2); }
.status-line .dot { width: 8px; height: 8px; border-radius: 50%; background: #6B7380; }
.status-line.open { background: var(--ok-bg); color: var(--ok-text); }
.status-line.open .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(86,194,224,.2); }
.status-line.busy { background: var(--lock-bg); color: var(--accent-hi); }
.status-line.busy .dot { background: var(--accent); }
.item.pinned { border-color: #5A4320; }
.tag.pin { left: 10px; top: auto; bottom: 10px; background: var(--accent); color: var(--on-accent); }

/* ---------- Ver em 3D (SkinCraft) ---------- */
.view3d {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px;
  min-height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line-2);
  background: rgba(15,19,23,.85); color: var(--text-2); font: 700 12px var(--mono); text-decoration: none;
  transition: color .15s, border-color .15s;
}
.view3d:hover { color: var(--accent-hi); border-color: var(--accent); }
@media (hover: none), (max-width: 720px) {
  .view3d { min-height: 28px; padding: 0 8px; right: 6px; bottom: 6px; }
}

/* ---------- Seletor de idioma ---------- */
.lang { position: relative; display: flex; align-items: center; margin: 0 6px; }
.lang svg { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.lang select {
  height: 40px; padding: 0 10px 0 34px; border-radius: 8px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; cursor: pointer;
}
.lang select:hover { color: var(--text); border-color: var(--muted); }
@media (max-width: 720px) {
  .top-nav .lang { display: flex; margin: 0; }
}
