:root {
  --bg: #0b0d10;
  --panel: #12161b;
  --panel-2: #171c22;
  --line: #1f252d;
  --line-2: #2a323c;
  --text: #e6eaf0;
  --muted: #7d8794;
  --dim: #4d5560;
  --accent: #f5a524;
  --ct: #5b9bd5;
  --tr: #e0b252;
  --ok: #3ddc84;
  --bad: #ff5a5f;
  --display: "Rajdhani", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--text);
  background-color: var(--bg);
  background-image:
    radial-gradient(1200px 600px at -10% -20%, rgb(245 165 36 / 0.07), transparent 60%),
    radial-gradient(900px 500px at 110% 120%, rgb(91 155 213 / 0.05), transparent 60%),
    linear-gradient(rgb(255 255 255 / 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 0.022) 1px, transparent 1px);
  background-size: auto, auto, 32px 32px, 32px 32px;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
img { display: block; }

.titulo {
  font-family: var(--display);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
}

/* Top bar */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 20px;
  background: rgb(11 13 16 / 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.marca { display: flex; align-items: center; gap: 10px; }
.logo { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: 0.2em; }
.logo b { color: var(--accent); }
.selo {
  font-family: var(--display); text-transform: uppercase; letter-spacing: 0.14em;
  font-size: 10px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 3px; padding: 1px 6px;
}
.usuario { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.usuario img { width: 30px; height: 30px; border-radius: 4px; box-shadow: 0 0 0 1px var(--line-2); }
.usuario a { color: var(--muted); font-size: 12px; text-decoration: none; }
.usuario a:hover { color: var(--bad); }

main { max-width: 1280px; margin: 0 auto; padding: 20px; }

/* Card with HUD brackets */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 6px;
}
.card::before, .card::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  border-color: var(--line-2); border-style: solid; pointer-events: none;
}
.card::before { top: -1px; left: -1px; border-width: 1px 0 0 1px; border-top-left-radius: 6px; }
.card::after { bottom: -1px; right: -1px; border-width: 0 1px 1px 0; border-bottom-right-radius: 6px; }

/* Login */
.entrar {
  max-width: 520px; margin: 10vh auto 0; padding: 40px 32px; text-align: center;
  animation: entrar 260ms ease-out both;
}
.entrar h1 { font-family: var(--display); font-size: 34px; letter-spacing: 0.12em; text-transform: uppercase; margin: 18px 0 8px; }
.entrar p { color: var(--muted); font-size: 14px; line-height: 1.6; margin: 0 0 28px; }
.passos { display: flex; justify-content: center; gap: 8px; margin: 0 0 28px; flex-wrap: wrap; }
.passos span { font-family: var(--mono); font-size: 12px; color: var(--muted); border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 10px; }
.passos span b { color: var(--accent); font-weight: 600; }

/* Buttons */
.botao {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px; border-radius: 6px;
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.14em; font-size: 15px;
  color: var(--accent);
  border: 1px solid rgb(245 165 36 / 0.55);
  background: rgb(245 165 36 / 0.1);
  transition: background 150ms, box-shadow 150ms, transform 100ms;
  text-decoration: none;
}
.botao:hover { background: rgb(245 165 36 / 0.18); box-shadow: 0 0 24px -6px var(--accent); }
.botao:active { transform: scale(0.99); }
.botao.ct { color: var(--ct); border-color: rgb(91 155 213 / 0.55); background: rgb(91 155 213 / 0.1); }
.botao.ct:hover { background: rgb(91 155 213 / 0.18); box-shadow: 0 0 24px -6px var(--ct); }
.botao.tr { color: var(--tr); border-color: rgb(224 178 82 / 0.55); background: rgb(224 178 82 / 0.1); }
.botao.tr:hover { background: rgb(224 178 82 / 0.18); box-shadow: 0 0 24px -6px var(--tr); }
.botao.fantasma { color: var(--muted); border-color: var(--line-2); background: transparent; }
.botao.fantasma:hover { color: var(--bad); border-color: rgb(255 90 95 / 0.5); box-shadow: none; }

/* Toolbar */
.barra {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.abas { display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); }
.abas button {
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; font-size: 13px;
  color: var(--muted); padding: 8px 16px; border-radius: 4px; transition: color 150ms, background 150ms;
}
.abas button:hover { color: var(--text); }
.abas button.ativa { color: var(--accent); background: rgb(245 165 36 / 0.13); }

.busca {
  flex: 1; min-width: 220px; display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: rgb(11 13 16 / 0.7);
  transition: border-color 150ms;
}
.busca:focus-within { border-color: rgb(245 165 36 / 0.6); }
.busca input { flex: 1; background: none; border: 0; outline: none; font-size: 14px; }
.busca input::placeholder { color: var(--dim); }
.busca svg { color: var(--dim); flex-shrink: 0; }

.aviso-wp {
  display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted);
  padding: 8px 12px; border: 1px dashed var(--line-2); border-radius: 6px;
}
.aviso-wp code { font-family: var(--mono); color: var(--accent); }

/* Weapons layout */
.armas { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.lista-armas { padding: 8px; position: sticky; top: 72px; max-height: calc(100vh - 92px); overflow-y: auto; }
.grupo {
  width: 100%; display: flex; align-items: center; gap: 8px; text-align: left;
  font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: 0.16em; font-size: 11px; color: var(--muted);
  padding: 10px 10px 8px; margin-top: 4px; border-radius: 4px; transition: color 120ms, background 120ms;
}
.grupo:first-child { margin-top: 0; }
.grupo:hover { color: var(--text); background: rgb(255 255 255 / 0.03); }
.grupo .seta { transition: transform 180ms ease; transform: rotate(-90deg); color: var(--dim); flex-shrink: 0; }
.grupo.aberto .seta { transform: none; color: var(--accent); }
.grupo span { flex: 1; }
.grupo b { font-family: var(--mono); font-weight: 600; font-size: 10px; letter-spacing: 0; color: var(--accent); background: rgb(245 165 36 / 0.12); border-radius: 8px; padding: 1px 7px; }
.itens-grupo.fechado { display: none; }
.arma {
  width: 100%; display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 6px 10px; border-radius: 4px; position: relative; transition: background 120ms;
}
.arma:hover { background: rgb(255 255 255 / 0.035); }
.arma.ativa { background: rgb(245 165 36 / 0.1); }
.arma.ativa::before { content: ""; position: absolute; left: -8px; top: 6px; bottom: 6px; width: 3px; border-radius: 0 2px 2px 0; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.arma img { width: 56px; height: 30px; object-fit: contain; }
.arma span { flex: 1; font-size: 13px; }
.arma .pontos { display: flex; gap: 3px; }

.ponto { width: 6px; height: 6px; border-radius: 50%; }
.ponto.ct { background: var(--ct); box-shadow: 0 0 6px var(--ct); }
.ponto.tr { background: var(--tr); box-shadow: 0 0 6px var(--tr); }

/* Skin grid */
.cabecalho-grade { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 2px 12px; }
.cabecalho-grade h2 { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: 0.1em; text-transform: uppercase; margin: 0; }
.cabecalho-grade span { font-family: var(--mono); font-size: 11px; color: var(--dim); }

.grade { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.item {
  position: relative; text-align: left; padding: 12px; overflow: hidden;
  transition: border-color 150ms, transform 150ms, box-shadow 150ms;
  animation: entrar 220ms ease-out both;
}
.item:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: 0 10px 30px -14px rgb(0 0 0 / 0.8); }
.item .img {
  height: 110px; display: grid; place-items: center; margin-bottom: 10px;
  background: radial-gradient(closest-side, rgb(255 255 255 / 0.05), transparent);
}
.item img { max-width: 100%; max-height: 110px; object-fit: contain; transition: transform 200ms; }
.item:hover img { transform: scale(1.05); }
.item .nome { font-size: 13px; line-height: 1.35; }
.item .sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.item .tags { position: absolute; top: 10px; right: 10px; display: flex; gap: 4px; }
.tag { font-family: var(--display); font-weight: 700; font-size: 10px; letter-spacing: 0.1em; padding: 1px 6px; border-radius: 3px; }
.tag.ct { color: #0b0d10; background: var(--ct); }
.tag.tr { color: #0b0d10; background: var(--tr); }
.item.equipada { border-color: rgb(245 165 36 / 0.35); }
.item.equipada::after { border-color: var(--accent); }

.vazio { padding: 60px 20px; text-align: center; color: var(--dim); font-size: 13px; }

/* Loadout */
.topo-lo { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12px; color: var(--muted); }
.topo-lo b { color: var(--bad); }
.loadout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.coluna-lo { padding: 0 0 6px; overflow: hidden; }
.coluna-lo header { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.coluna-lo.ct header { background: linear-gradient(90deg, rgb(91 155 213 / 0.14), transparent 70%); }
.coluna-lo.tr header { background: linear-gradient(90deg, rgb(224 178 82 / 0.14), transparent 70%); }
.coluna-lo header h2 { margin: 0; font-family: var(--display); font-size: 18px; letter-spacing: 0.12em; text-transform: uppercase; flex: 1; }
.coluna-lo.ct header h2 { color: var(--ct); }
.coluna-lo.tr header h2 { color: var(--tr); }
.coluna-lo header span { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.secao-lo { padding: 12px 14px 4px; }
.secao-lo h3 { margin: 0 0 8px; font-family: var(--display); font-weight: 600; font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.slot { position: relative; animation: entrar 220ms ease-out both; transition: border-color 150ms, transform 150ms; }
.slot:hover { border-color: var(--line-2); transform: translateY(-1px); }
.coluna-lo.ct .slot:not(.vazio-slot) { box-shadow: inset 0 -2px 0 rgb(91 155 213 / 0.55); }
.coluna-lo.tr .slot:not(.vazio-slot) { box-shadow: inset 0 -2px 0 rgb(224 178 82 / 0.55); }
.slot-corpo { width: 100%; display: flex; flex-direction: column; text-align: left; padding: 10px 10px 9px; }
.slot-titulo { font-family: var(--display); font-weight: 600; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 18px; }
.slot-img { height: 70px; display: grid; place-items: center; margin: 4px 0 6px; background: radial-gradient(closest-side, rgb(255 255 255 / 0.05), transparent); }
.slot-img img { max-width: 100%; max-height: 70px; object-fit: contain; transition: transform 200ms; }
.slot:hover .slot-img img { transform: scale(1.05); }
.slot-nome { font-size: 12.5px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot-selos { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; min-height: 16px; }
.selo { font-style: normal; font-family: var(--mono); font-size: 10px; line-height: 16px; padding: 0 5px; border-radius: 3px; color: var(--text); background: var(--line-2); }
.selo.st { color: #ff8a3d; background: rgb(255 138 61 / 0.14); }
.selo.nome { color: var(--muted); background: transparent; border: 1px solid var(--line-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-remover {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 4px;
  color: var(--dim); opacity: 0; transition: opacity 120ms, color 120ms, background 120ms;
}
.slot-remover svg { width: 14px; height: 14px; }
.slot:hover .slot-remover { opacity: 1; }
.slot-remover:hover { color: var(--bad); background: rgb(255 90 95 / 0.14); }
.vazio-slot { opacity: 0.55; }
.vazio-slot:hover { opacity: 0.85; }
.vazio-slot .slot-nome { color: var(--dim); }
.vazio-slot .slot-img img { filter: grayscale(1) brightness(0.8); }
.vazio-slot .slot-img:empty::after {
  content: "+"; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%;
  border: 1px dashed var(--line-2); color: var(--dim); font-size: 20px; font-weight: 300;
}
.sem-skins { margin: 10px 18px 12px; font-size: 12px; color: var(--dim); }
.sem-skins b { color: var(--accent); font-weight: 600; }

/* Agents */
.colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.colunas h2 { font-family: var(--display); letter-spacing: 0.14em; text-transform: uppercase; font-size: 18px; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }

/* Modal */
.modal {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgb(5 6 8 / 0.72); backdrop-filter: blur(6px);
  animation: fade 160ms ease-out both;
}
.modal[hidden] { display: none; }
.janela { width: 100%; max-width: 760px; display: grid; grid-template-columns: 1fr 1fr; animation: subir 220ms cubic-bezier(.2,.8,.2,1) both; }
.janela .vitrine {
  display: grid; place-items: center; padding: 28px; min-height: 300px;
  background: radial-gradient(closest-side, rgb(245 165 36 / 0.09), transparent), linear-gradient(180deg, transparent, rgb(0 0 0 / 0.2));
  border-right: 1px solid var(--line);
}
.janela .vitrine img { max-width: 100%; max-height: 260px; object-fit: contain; filter: drop-shadow(0 16px 24px rgb(0 0 0 / 0.6)); }
.janela .form { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.janela h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.janela .fechar { position: absolute; top: 10px; right: 10px; color: var(--muted); padding: 6px; border-radius: 4px; }
.janela .fechar:hover { color: var(--text); background: rgb(255 255 255 / 0.05); }
.rotulo { font-family: var(--display); font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; font-size: 11px; color: var(--dim); margin-bottom: 6px; display: flex; justify-content: space-between; }
.rotulo b { font-family: var(--mono); color: var(--text); font-weight: 400; letter-spacing: 0; text-transform: none; }

.desgastes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.desgastes button {
  font-family: var(--display); font-weight: 700; font-size: 12px; letter-spacing: 0.08em;
  padding: 6px 0; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); transition: all 120ms;
}
.desgastes button:hover { color: var(--text); border-color: var(--line-2); }
.desgastes button.ativa { color: var(--accent); border-color: rgb(245 165 36 / 0.6); background: rgb(245 165 36 / 0.08); }

input[type=range] { width: 100%; accent-color: var(--accent); margin: 8px 0 0; }
.campo { width: 100%; height: 38px; padding: 0 12px; background: rgb(11 13 16 / 0.7); border: 1px solid var(--line); border-radius: 4px; outline: none; font-size: 13px; }
.campo:focus { border-color: rgb(245 165 36 / 0.6); }
.linha { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.chave { display: flex; align-items: center; gap: 10px; font-size: 13px; cursor: pointer; user-select: none; }
.chave i { width: 34px; height: 20px; border-radius: 10px; background: var(--line-2); position: relative; transition: background 150ms; flex-shrink: 0; }
.chave i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: all 150ms; }
.chave input { display: none; }
.chave input:checked + i { background: rgb(245 165 36 / 0.35); }
.chave input:checked + i::after { left: 17px; background: var(--accent); }

.acoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: auto; }
.acoes .todo { grid-column: 1 / -1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 6px; font-size: 13px;
  background: var(--panel-2); border: 1px solid rgb(61 220 132 / 0.45);
  box-shadow: 0 20px 40px -12px rgb(0 0 0 / 0.8);
  animation: subir 200ms ease-out both;
}
.toast[hidden] { display: none; }
.toast.erro { border-color: rgb(255 90 95 / 0.5); }
.toast code { font-family: var(--mono); color: var(--accent); }

.carregando { display: grid; place-items: center; padding: 120px 0; color: var(--muted); font-family: var(--display); letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px; }

@keyframes entrar { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes subir { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 4px; }

@media (max-width: 820px) {
  main { padding: 12px; }
  .topo { padding: 0 12px; }
  .usuario span { display: none; }
  .armas { grid-template-columns: 1fr; }
  .lista-armas { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 6px; }
  .lista-armas .grupo { display: none; }
  .itens-grupo, .itens-grupo.fechado { display: contents; }
  .loadout { grid-template-columns: 1fr; }
  .slots { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .slot-img { height: 56px; }
  .slot-img img { max-height: 56px; }
  .slot-remover { opacity: 1; }
  .coluna-lo header { padding: 12px 14px; }
  .coluna-lo header h2 { font-size: 14px; letter-spacing: 0.08em; }
  .coluna-lo header span { font-size: 10px; }
  .secao-lo { padding: 10px 10px 2px; }
  .topo-lo span { display: none; }
  .arma { flex-direction: column; width: auto; min-width: 84px; padding: 8px 6px; gap: 4px; }
  .arma span { font-size: 11px; text-align: center; }
  .arma.ativa::before { left: 6px; right: 6px; top: auto; bottom: -6px; width: auto; height: 3px; border-radius: 2px; }
  .grade { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .item .img { height: 84px; }
  .item img { max-height: 84px; }
  .colunas { grid-template-columns: 1fr; }
  .janela { grid-template-columns: 1fr; max-height: calc(100vh - 32px); overflow-y: auto; }
  .janela .vitrine { min-height: 180px; border-right: 0; border-bottom: 1px solid var(--line); }
  .janela .vitrine img { max-height: 160px; }
  .abas { width: 100%; }
  .abas button { flex: 1; padding: 8px 2px; font-size: 11px; letter-spacing: 0.06em; }
}
