/* =============================================================
   style.css — Rocket League Idle v2 (partida de futebol).

   DIREÇÃO DE ARTE: "painel de aventura" — floresta, bronze e madeira.
   Portada do Pokédex Idle: tipografia de sistema (Consolas p/ corpo,
   Arial Narrow 900 caixa-alta p/ títulos), molduras grossas de bronze
   com outline escuro, sombra dura (sem blur) e abas coloridas chunky.
   ZERO webfont: tudo font de sistema, sem request externo.

   Convenção das molduras (repetida em header/painel/modal/stage):
     border:4px solid #9b8153; outline:2px solid #2b261c;
     box-shadow: inset 0 0 0 2px #4e422e, 4px 4px 0 rgba(0,0,0,.46);
   ============================================================= */

:root {
  --bg: #081d17;
  --card: #1a302a;
  --card2: #10231f;
  --line: #9b8153;      /* bronze da moldura */
  --line-in: #4e422e;   /* filete interno */
  --line-out: #2b261c;  /* outline escuro */
  --line-soft: #5f6045; /* divisórias internas */
  --gold: #f5c54a;
  --txt: #f7efd4;
  --dim: #aebba4;
  --ok: #6bc978;
  --red: #e2604a;
  --blue: #3da4d3;
  --sp: #f5c54a;
  --ip: #6cc4e8;
  --ec: #e58fc0;
  --hard: 4px 4px 0 rgba(0, 0, 0, .46);
  --mold: inset 0 0 0 2px var(--line-in), 4px 4px 0 rgba(0, 0, 0, .46);
  --body: Consolas, 'Lucida Console', 'Courier New', monospace;
  --head: 'Arial Narrow', 'Trebuchet MS', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--body);
  font-size: 14px;
  font-weight: 600;
  color: var(--txt);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle at 50% 4%, rgba(69, 124, 70, .24), transparent 34%),
    radial-gradient(circle at 8px 8px, rgba(112, 151, 84, .10) 0 3px, transparent 4px),
    radial-gradient(circle at 24px 24px, rgba(24, 79, 51, .24) 0 4px, transparent 5px),
    linear-gradient(155deg, #102d22 0%, #0a211a 48%, #061611 100%);
  background-size: auto, 32px 32px, 32px 32px, auto;
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}
button, input { font-family: var(--body); font-weight: 600; }
button { cursor: pointer; letter-spacing: .2px; }
.hidden { display: none !important; }

/* Títulos: Arial Narrow 900 caixa-alta (a "voz" do layout de referência).
   A classe .pixel-font é legada — hoje aponta pra essa mesma tipografia. */
.pixel-font, .panel-title, .tab .lb, .logo .l1, .card h3,
.rank-chip, .caixa-name, .coach-name, .pro-nick, .meta-t, .cc-name {
  font-family: var(--head);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .6px;
}

/* ---------- Botões (chunky, sombra dura) ---------- */
.btn {
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  letter-spacing: .5px; font-size: 13px; line-height: 1.1;
  color: #fff0ce; padding: 8px 13px;
  background: linear-gradient(#3d7e65, #245643);
  border: 3px solid #173c2e; border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 3px 3px 0 rgba(0, 0, 0, .35);
  transition: filter .1s, transform .06s;
}
.btn:hover:not(:disabled) { filter: brightness(1.14); }
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 1px 1px 0 rgba(0, 0, 0, .35); }
.btn:disabled { filter: saturate(.35); opacity: .45; cursor: not-allowed; }
.btn.gold { color: #2d2109; background: linear-gradient(#f6d45d, #c99628); border-color: #765718; }
.btn.green { color: #fff1cc; background: linear-gradient(#4e8b3f, #2d632e); border-color: #1b401e; }
.btn.purple { color: #fff1cf; background: linear-gradient(#8a6094, #543a65); border-color: #35223f; }
.btn.red { color: #fff0cc; background: linear-gradient(#b4492a, #7d2c20); border-color: #542018; }
.btn.small { font-size: 11px; padding: 5px 9px; border-width: 2px; }
.btn small { display: block; font-family: var(--body); font-weight: 700; font-size: 10px; opacity: .9; margin-top: 2px; text-transform: none; letter-spacing: 0; }

/* Botão gigante de START (centro do palco) */
.btn-start {
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: 19px; letter-spacing: 1.5px; color: #2d2109;
  padding: 14px 30px;
  background: linear-gradient(#f6d45d, #c99628);
  border: 4px solid #765718; border-radius: 2px; outline: 2px solid #2b261c;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22), 5px 5px 0 rgba(0, 0, 0, .5);
  transition: filter .12s, transform .07s;
}
.btn-start:hover:not(:disabled) { filter: brightness(1.12); }
.btn-start:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .22), 3px 3px 0 rgba(0, 0, 0, .5); }
.btn-start.stop { color: #fff0cc; background: linear-gradient(#b4492a, #7d2c20); border-color: #542018; font-size: 14px; padding: 9px 18px; }

/* =============================================================
   LOGIN
   ============================================================= */
#login {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(circle at 50% 8%, rgba(69, 124, 70, .3), transparent 40%),
    linear-gradient(155deg, #102d22 0%, #0a211a 48%, #061611 100%);
  transition: opacity .3s;
}
#login.gone { opacity: 0; pointer-events: none; }
.login-box {
  width: min(400px, 94vw); text-align: center; padding: 26px 22px 20px;
  color: var(--txt); background: linear-gradient(#1f3d37 0%, #102723 52%, #091b1b 100%);
  border: 4px solid var(--line); outline: 2px solid var(--line-out); border-radius: 2px;
  box-shadow: var(--mold);
}
.login-badge { font-size: 46px; line-height: 1; }
.login-box h1 { font-size: 27px; line-height: 1.1; color: var(--gold); margin: 8px 0 6px; text-shadow: 2px 3px 0 #101a16; }
.login-box .sub { color: var(--dim); font-size: 12px; margin-bottom: 16px; line-height: 1.5; }
.login-form { display: flex; flex-direction: column; gap: 9px; }
.login-form input {
  font-size: 14px; padding: 9px 11px; color: var(--txt);
  background: #0b1a17; border: 3px solid #5f6045; border-radius: 2px;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .35);
}
.login-form input:focus { outline: none; border-color: var(--gold); }
.login-hint { color: var(--dim); font-size: 11px; }
.login-toggle { background: none; border: none; color: var(--ip); font-size: 12px; margin-top: 2px; text-decoration: underline dotted; }

/* =============================================================
   HEADER
   ============================================================= */
#topbar {
  position: sticky; top: 0; z-index: 30;
  padding: 10px 14px 8px;
  background: linear-gradient(180deg, #1f3d37 0%, #102723 52%, #091b1b 100%);
  border-bottom: 4px solid var(--line);
  box-shadow: inset 0 0 0 2px var(--line-in), 0 4px 0 rgba(0, 0, 0, .46);
}
.header-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 9px; }
.logo .badge { font-size: 27px; }
.logo .l1 { font-size: 20px; color: #ffe06a; text-shadow: 2px 3px 0 #101a16; line-height: 1; }
.logo .l2 { font-size: 10px; color: #bcd0b1; font-weight: 700; letter-spacing: 2px; text-shadow: 1px 2px 0 #101a16; margin-top: 3px; }

.status-cards { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; align-items: stretch; }
.stat {
  display: flex; flex-direction: column; justify-content: center;
  padding: 6px 10px; min-width: 76px;
  color: #fff3d2; background: linear-gradient(#203832, #122722);
  border: 3px solid #8c7042; border-radius: 2px;
  box-shadow: inset 0 0 0 1px #385347, 2px 2px 0 rgba(0, 0, 0, .4);
}
.stat .k { font-size: 10px; color: #d8dfc5; white-space: nowrap; letter-spacing: .3px; }
.stat .v { font-family: var(--head); font-weight: 900; font-size: 15px; margin-top: 2px; }
.stat.gold .v { color: var(--gold); }
.stat.ip .v { color: var(--ip); }
.stat.ec .v { color: var(--ec); }
.hdr-badge { height: 22px; width: auto; }
.hdr-badge:not([src]), .hdr-badge[src=""] { display: none; }
.player-chip { align-items: flex-start; }
.btn-logout {
  margin-top: 4px; font-family: var(--head); font-weight: 900; font-size: 10px;
  text-transform: uppercase; letter-spacing: .5px;
  color: #fff0cc; background: linear-gradient(#8e3b26, #4f2119);
  border: 2px solid #351c1a; border-radius: 2px; padding: 3px 8px;
}
.btn-logout:hover { filter: brightness(1.2); }

/* ---------- NAV (abas coloridas chunky) ---------- */
#tabs { display: flex; gap: 5px; margin-top: 9px; overflow-x: auto; scrollbar-width: none; }
#tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto; min-width: 74px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 10px; color: #fff2ce;
  border: 3px solid #3c3020; border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(255, 238, 189, .13), 3px 3px 0 rgba(0, 0, 0, .48);
  transition: filter .12s, transform .06s;
}
.tab .ic { font-size: 17px; line-height: 1; }
.tab .lb { font-size: 11px; letter-spacing: .7px; text-shadow: 1px 2px 0 rgba(0, 0, 0, .72); }
.tab:nth-child(1) { background: linear-gradient(#65a947, #347235); }
.tab:nth-child(2) { background: linear-gradient(#348db3, #185a7d); }
.tab:nth-child(3) { background: linear-gradient(#3f987b, #246451); }
.tab:nth-child(4) { background: linear-gradient(#8a6094, #543a65); }
.tab:nth-child(5) { background: linear-gradient(#b4492a, #7d2c20); }
.tab:nth-child(6) { background: linear-gradient(#4a7fb5, #27507a); }
.tab:nth-child(7) { background: linear-gradient(#3f987b, #246451); }
.tab:nth-child(8) { background: linear-gradient(#8a6094, #543a65); }
.tab:nth-child(9) { background: linear-gradient(#b4492a, #7d2c20); }
.tab:nth-child(10) { background: linear-gradient(#8a8a3f, #5a5a24); }
.tab:nth-child(11) { background: linear-gradient(#b08a35, #7a5d1e); }
.tab:hover:not(.active) { filter: brightness(1.14); }
.tab.active { border-color: #f1d17d; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .18), 0 0 9px rgba(245, 197, 74, .34), 3px 3px 0 rgba(0, 0, 0, .48); }
.tab:not(.active) { filter: saturate(.72) brightness(.85); }

/* =============================================================
   MAIN / PAINÉIS
   ============================================================= */
#main { max-width: 1400px; margin: 0 auto; padding: 16px 14px 80px; }
.view { display: flex; flex-direction: column; gap: 14px; }
.panel {
  padding: 14px; color: #f4ead0;
  background: linear-gradient(var(--card), var(--card2));
  border: 4px solid var(--line); outline: 2px solid var(--line-out); border-radius: 2px;
  box-shadow: var(--mold);
}
/* Cabeçalho de painel: faixa verde com filete de bronze (igual .card h3 da referência) */
.panel-title {
  margin: -14px -14px 12px; padding: 8px 12px; text-align: center;
  font-size: 14px; color: #fff0cd;
  background: linear-gradient(#34715a, #1d4939);
  border-bottom: 3px solid #a68b57;
  text-shadow: 2px 2px 0 #10251d;
}
.panel-note { font-family: var(--body); font-weight: 600; font-size: 11px; color: var(--dim); text-transform: none; letter-spacing: 0; }

/* =============================================================
   PALCO (canvas da partida) — Free Play e Rankeds
   ============================================================= */
.stage {
  position: relative; width: 100%;
  /* +30% na horizontal: 16/7 (2.29) -> 2.97. Mapa mais largo e mais cinematográfico. */
  aspect-ratio: 2.97; min-height: 200px; max-height: 430px;
  overflow: hidden; background-size: cover; background-position: center; background-color: #0a1d12;
  border: 4px solid #a48a59; outline: 2px solid #2a251b; border-radius: 2px;
  box-shadow: inset 0 0 0 2px #54462f, 5px 5px 0 rgba(0, 0, 0, .48);
}
.stage::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(4, 10, 17, .3), transparent 62%),
    repeating-linear-gradient(170deg, rgba(255, 255, 255, .025) 0 2px, transparent 2px 18px);
}
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; }
.stage-hud { position: absolute; left: 12px; top: 10px; z-index: 4; }
.fp-sp-pill {
  display: inline-block; font-family: var(--head); font-weight: 900; font-size: 15px;
  color: var(--gold); background: linear-gradient(#253a31, #14241f);
  border: 3px solid #9b8050; padding: 5px 11px;
  box-shadow: inset 0 0 0 1px #50604e, 3px 3px 0 rgba(0, 0, 0, .44);
}
.fp-sub { margin-top: 6px; font-size: 11px; color: #f2e5c2; text-shadow: 1px 1px 0 #000; }

/* Overlay de START (Free Play / Ranked parados) */
.stage-start {
  position: absolute; inset: 0; z-index: 5;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 16px; text-align: center;
  background: rgba(5, 14, 12, .74); backdrop-filter: blur(2px);
}
.ss-title { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 24px; letter-spacing: 2px; color: #ffe06a; text-shadow: 2px 3px 0 #101a16; }
.ss-sub { font-size: 12px; color: #dfebcf; max-width: 460px; line-height: 1.5; }
.ss-note { font-size: 11px; color: #ffb45e; }

/* Botão "parar" flutuante quando o modo está rodando (Free Play usa posição absoluta) */
.stage-stop { position: absolute; right: 12px; top: 10px; z-index: 4; }

/* HUD do oponente (Ranked): coluna top-right — evita tampar o nick com o botão Parar */
.opp-hud {
  position: absolute; right: 12px; top: 10px; z-index: 4;
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  max-width: min(52%, 240px);
}
.opp-hud .stage-stop { position: static; }
.opp-nick {
  font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 11px;
  padding: 4px 9px; background: rgba(7, 20, 16, .88); border: 2px solid #c25c17;
  color: #ffc08f; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.opp-stats {
  font-size: 10px; color: #d8d0bc; background: rgba(7, 20, 16, .82);
  border: 1px solid #6a5438; padding: 4px 8px; text-align: right; line-height: 1.45;
}
.opp-win {
  font-family: var(--head); font-weight: 900; font-size: 12px; letter-spacing: .3px;
  padding: 3px 9px; background: rgba(7, 20, 16, .88); border: 1px solid #6a5438;
}
.opp-win.lo { color: #e87060; border-color: #8a3a32; }
.opp-win.mid { color: #f0c652; border-color: #8a7030; }
.opp-win.hi { color: #8fe0a0; border-color: #3a6840; }

/* gols laterais (rankeds) */
.goal { position: absolute; top: 50%; transform: translateY(-50%); width: 8px; height: 46%; z-index: 3; opacity: .55; }
.goal-l { left: 0; background: linear-gradient(#2f6fd0, transparent); box-shadow: 0 0 12px #2f6fd0; }
.goal-r { right: 0; background: linear-gradient(#e2762a, transparent); box-shadow: 0 0 12px #e2762a; }
.rk-nick {
  position: absolute; top: 10px; z-index: 4;
  font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 12px;
  padding: 4px 9px; background: rgba(7, 20, 16, .84); border: 2px solid;
  max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rk-nick.you { left: 12px; color: #8fc4ff; border-color: #2f6fd0; }

/* =============================================================
   PLACAR DO ROCKET LEAGUE (barra azul | relógio | laranja)
   ============================================================= */
.rl-scorebar {
  display: flex; align-items: stretch; justify-content: center;
  filter: drop-shadow(4px 4px 0 rgba(0, 0, 0, .46));
}
.rl-side {
  display: flex; align-items: center; gap: 14px;
  padding: 0 20px; min-width: 190px; max-width: 42%;
}
.rl-side.you {
  justify-content: flex-end; text-align: right;
  background: linear-gradient(180deg, #3f80e0, #16408c);
  clip-path: polygon(0 0, 100% 0, calc(100% - 20px) 100%, 0 100%);
  padding-right: 30px;
}
.rl-side.opp {
  background: linear-gradient(180deg, #ef8635, #a2470e);
  clip-path: polygon(20px 0, 100% 0, 100% 100%, 0 100%);
  padding-left: 30px;
}
.rl-nm {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: 14px; letter-spacing: 1px; color: #fff; text-shadow: 1px 2px 0 rgba(0, 0, 0, .45);
}
.rl-pts {
  font-family: var(--head); font-weight: 900; font-size: 40px; line-height: 1;
  color: #fff; text-shadow: 2px 3px 0 rgba(0, 0, 0, .4); min-width: 30px; text-align: center;
}
.rl-pts.bump { animation: ptsBump .5s ease; }
@keyframes ptsBump { 0% { transform: scale(1); } 35% { transform: scale(1.55); } 100% { transform: scale(1); } }
.rl-clock {
  display: grid; place-items: center; min-width: 132px; padding: 10px 18px;
  font-family: var(--head); font-weight: 900; font-size: 32px; line-height: 1;
  color: #f7f4ea; background: linear-gradient(180deg, #16202a, #05090b);
  letter-spacing: 1px; text-shadow: 0 0 10px rgba(255, 255, 255, .18);
}
.rl-clock.over { color: #ffd45c; }
.rl-clock small { display: block; font-family: var(--body); font-weight: 700; font-size: 9px; letter-spacing: 1.5px; color: #8fa0ae; margin-top: 3px; text-shadow: none; }

/* Resultado da partida (overlay dentro do palco) */
.match-result {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
  padding: 14px; text-align: center;
  background: rgba(4, 12, 10, .82); backdrop-filter: blur(2px);
  animation: mrIn .25s ease;
}
@keyframes mrIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: scale(1); } }
.mr-seal {
  font-family: var(--head); font-weight: 900; text-transform: uppercase;
  font-size: 32px; letter-spacing: 3px; line-height: 1;
  padding: 6px 22px; border: 3px solid; border-radius: 2px;
}
.mr-seal.win { color: #d6ffe4; background: linear-gradient(#3f8b4a, #1f5a2e); border-color: #8fe0a0; text-shadow: 2px 3px 0 rgba(0, 0, 0, .45); }
.mr-seal.lose { color: #ffd9d0; background: linear-gradient(#a9422c, #6e271d); border-color: #e2907a; text-shadow: 2px 3px 0 rgba(0, 0, 0, .45); }
.mr-score { font-family: var(--head); font-weight: 900; font-size: 24px; color: var(--gold); letter-spacing: 2px; text-shadow: 2px 2px 0 #201807; }
.mr-rewards { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mr-chip {
  font-size: 12px; color: #f2e5c2; padding: 5px 10px;
  background: linear-gradient(#253a31, #14241f); border: 2px solid #9b8050;
  box-shadow: inset 0 0 0 1px #50604e;
}
.mr-chip b { font-family: var(--head); font-weight: 900; font-size: 14px; }
.mr-chip.sp b { color: var(--sp); }
.mr-chip.ip b { color: var(--ip); }
.mr-chip.cr b { color: var(--gold); }
.mr-chip.mmr b { color: #8fe0a0; }
.mr-chip.mmr.neg b { color: #ff8067; }
.mr-rank { font-size: 12px; color: #dfebcf; display: flex; align-items: center; gap: 7px; }
.mr-rank img { height: 26px; width: auto; }
.mr-rank .up { color: #8fe0a0; font-weight: 900; }
.mr-rank .down { color: #ff8067; font-weight: 900; }
.mr-actions { display: flex; flex-direction: column; align-items: center; gap: 7px; margin-top: 4px; }

/* checkbox "auto fill ranked" */
.autofill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none;
  font-size: 12px; color: #e9dfc2; padding: 5px 11px;
  background: rgba(7, 20, 16, .8); border: 2px solid #655d43;
}
.autofill input { display: none; }
.autofill .box {
  width: 17px; height: 17px; flex: 0 0 auto; display: grid; place-items: center;
  font-size: 13px; color: transparent; line-height: 1;
  background: #0b100d; border: 2px solid #8c7042;
}
.autofill input:checked + .box { color: #2d2109; background: linear-gradient(#f6d45d, #c99628); }
.autofill input:checked ~ .lbl { color: var(--gold); }

/* =============================================================
   ÁRVORES (Skills / Noções)
   ============================================================= */
.tree { display: grid; grid-template-columns: 1fr; gap: 7px; }
.tree-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  color: #f0e5c3; background: #11231f;
  border: 2px solid #625a40; box-shadow: inset 0 0 0 1px #344a3d;
}
.tr-main { flex: 1; min-width: 0; }
.tr-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.tr-nm { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 14px; color: #fff0c7; }
.tr-lvl { font-size: 11px; color: var(--gold); font-weight: 800; }
.tr-eff { font-size: 11px; color: #aeb9a4; margin-top: 3px; }
.tr-buy { display: flex; gap: 6px; }
.tr-buy .btn { min-width: 66px; text-align: center; }
.buy1 { background: linear-gradient(#448448, #2b6234); border-color: #183d23; }
.buyx { background: linear-gradient(#5c5390, #35305c); border-color: #241f42; }

/* =============================================================
   RANKEDS — status, MMR, seletor
   ============================================================= */
.rank-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.rank-chip {
  display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--gold);
  background: #10231f; border: 3px solid #776747; padding: 5px 10px;
  box-shadow: inset 0 0 0 1px #34483c;
}
.rank-badge { height: 34px; width: auto; }
.rank-winrate { font-size: 12px; color: var(--dim); }
.rank-winrate b { color: #8fe0a0; }
.mmr-wrap { margin-bottom: 12px; }
.mmr-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--dim); margin-bottom: 4px; }
.mmr-bar { height: 14px; background: #0b100d; border: 2px solid #050806; overflow: hidden; }
.mmr-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #3da4d3, #6cd0ef); transition: width .4s; }
.mmr-bar i.safe { background: linear-gradient(90deg, #568c43, #8fe0a0); }
.mmr-note { font-size: 11px; color: var(--dim); margin-top: 5px; }
.rank-sel-title { font-size: 12px; margin-bottom: 8px; color: #e8ddbd; }
.rank-selector { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 4px; }
.rank-opt {
  position: relative; flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 8px; color: #b8c3aa; font-size: 10px; white-space: nowrap;
  background: #10231f; border: 2px solid #554f39;
}
.ro-badge { height: 36px; width: auto; }
.rank-opt.sel { color: #fff3d1; background: linear-gradient(#568c43, #326630); border-color: #b59a5d; }
.rank-opt.frontier { box-shadow: inset 0 0 0 2px rgba(229, 143, 192, .5); }
.rank-opt.frontier .ro-nm::after { content: ' ⚔'; color: var(--ec); }
.rank-opt.locked { opacity: .55; filter: grayscale(.55); cursor: not-allowed; }
.rank-opt.locked .ro-badge { opacity: .5; }
.ro-lock { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -60%); font-size: 17px; }

/* =============================================================
   RLCS
   ============================================================= */
.rlcs-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.rlcs-sub { font-size: 11px; color: var(--dim); }
.rlcs-banner { font-size: 12px; color: #fff0c9; background: rgba(245, 197, 74, .12); border: 2px solid var(--gold); padding: 9px 11px; margin-bottom: 12px; }
.rlcs-banner b { color: var(--gold); }
.rlcs-grid { display: flex; flex-direction: column; gap: 7px; }
.pro-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px;
  color: #f2e7c8; background: linear-gradient(#203a32, #132824);
  border: 2px solid #756344; box-shadow: inset 0 0 0 1px #344a3d, 3px 3px 0 rgba(0, 0, 0, .3);
  transition: border-color .15s, box-shadow .15s;
}
.pro-row.winnable { border-color: #6bc978; }
.pro-row.target { border-color: #f0c652; box-shadow: inset 0 0 0 1px #736126, 0 0 16px rgba(240, 198, 82, .25), 3px 3px 0 rgba(0, 0, 0, .3); }
.pro-row.locked { opacity: .55; filter: grayscale(.5); }
.pro-row.indispo { opacity: .8; }
.pro-rank { font-family: var(--head); font-weight: 900; font-size: 13px; color: var(--dim); width: 34px; text-align: center; flex: 0 0 auto; }
.photo {
  width: 72px; height: 72px; border-radius: 50%; overflow: hidden; position: relative;
  border: 3px solid #8c7042; background: #10231f; display: grid; place-items: center;
}
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo.noimg { font-family: var(--head); font-weight: 900; font-size: 16px; color: var(--dim); }
.pro-photo { width: 52px; height: 52px; flex: 0 0 auto; }
.pro-main { flex: 1; min-width: 0; }
.pro-nick { font-size: 16px; color: #fff0cb; line-height: 1.15; }
.pro-meta { font-size: 11px; color: #aebba6; }
.pro-ec { font-size: 11px; color: var(--ec); text-align: right; flex: 0 0 auto; min-width: 92px; }
.pro-ec b { font-family: var(--head); font-weight: 900; font-size: 14px; }
.pro-opp-col {
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
  flex: 0 0 auto; min-width: 108px; max-width: 140px;
}
.pro-opp-col .pro-nick {
  font-size: 13px; color: #fff0cb; line-height: 1.15; text-align: right;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pro-opp-col .pro-opp-stats { font-size: 10px; color: #aebba6; text-align: right; line-height: 1.35; }
.pro-opp-col .opp-win { font-size: 11px; padding: 2px 7px; }
.pro-opp-col .desafiar { width: 100%; min-width: 0; font-size: 11px; padding: 6px 8px; }
.pro-state { font-size: 11px; color: var(--dim); text-align: center; flex: 0 0 auto; min-width: 84px; }
.pro-row.winnable .pro-state, .pro-row.target .pro-state { color: #8fe0a0; }
.pro-row .desafiar { flex: 0 0 auto; min-width: 96px; }
.pro-row.beaten .desafiar { background: linear-gradient(#5c5390, #35305c); border-color: #241f42; }
.pro-row.flash-win { animation: flashWin .9s ease; }
.pro-row.flash-lose { animation: flashLose .9s ease; }
@keyframes flashWin { 0% { box-shadow: 0 0 0 0 rgba(107, 201, 120, .9); } 100% { box-shadow: 0 0 0 14px rgba(107, 201, 120, 0); } }
@keyframes flashLose { 0% { box-shadow: 0 0 0 0 rgba(226, 96, 74, .9); } 100% { box-shadow: 0 0 0 14px rgba(226, 96, 74, 0); } }

/* toggle Auto (RLCS) */
.auto-toggle { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.auto-toggle input { display: none; }
.auto-track { width: 44px; height: 22px; background: #0b100d; border: 2px solid #776747; position: relative; transition: background .15s; }
.auto-thumb { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; background: var(--dim); transition: left .15s, background .15s; }
.auto-toggle input:checked + .auto-track { background: #2b4b3b; border-color: #6bc978; }
.auto-toggle input:checked + .auto-track .auto-thumb { left: 24px; background: #8fe0a0; }
.auto-label { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 12px; color: var(--txt); }

/* =============================================================
   PRESTÍGIO
   ============================================================= */
.prestigio-head { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 12px; }
.ph-stats { font-size: 12px; color: var(--dim); }
.ph-stats b { color: var(--gold); }
.coach-current { display: flex; align-items: center; gap: 14px; padding: 12px; margin-bottom: 12px; background: #11231f; border: 2px solid #776747; box-shadow: inset 0 0 0 1px #34483c; }
.cc-photo { width: 84px; height: 84px; flex: 0 0 auto; border-radius: 50%; overflow: hidden; border: 3px solid var(--gold); background: #10231f; display: grid; place-items: center; font-family: var(--head); font-weight: 900; font-size: 20px; color: var(--dim); }
.cc-photo .photo { width: 100%; height: 100%; border: none; }
.cc-label { font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .5px; }
.cc-name { font-size: 18px; color: var(--gold); margin: 2px 0; }
.cc-bonus { font-size: 13px; color: #8fe0a0; }
.cc-next { font-size: 11px; color: var(--dim); margin-top: 4px; }
.prestigio-desc { font-size: 12px; color: #d4dfc7; line-height: 1.55; }
.prestigio-desc b { color: var(--txt); }
.prestigio-req { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 13px; color: var(--red); margin: 8px 0 10px; }
.prestigio-req.ok { color: #8fe0a0; }
.prestigio-btn { width: 100%; font-size: 15px; padding: 12px; }
.ladder-title { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 12px; color: var(--dim); margin: 16px 0 10px; letter-spacing: 1px; }
.coach-ladder { display: flex; flex-direction: column; gap: 5px; }
.coach-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; background: #11231f; border: 2px solid #554f39; opacity: .6; }
.coach-row.reached { opacity: 1; }
.coach-row.atual { border-color: #f0c652; box-shadow: inset 0 0 0 1px rgba(240, 198, 82, .4); }
.coach-ord { font-family: var(--head); font-weight: 900; font-size: 13px; color: var(--dim); width: 22px; text-align: center; }
.coach-photo { width: 46px; height: 46px; flex: 0 0 auto; }
.coach-info { flex: 1; }
.coach-name { font-size: 15px; color: #fff0cb; }
.coach-b { font-size: 11px; color: #aebba6; }
.coach-tag { font-family: var(--head); font-weight: 900; font-size: 11px; color: var(--gold); white-space: nowrap; }

/* =============================================================
   METAS
   ============================================================= */
.metas-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 9px; }
.meta-card { padding: 10px 12px; background: linear-gradient(#203a32, #132824); border: 2px solid #756344; box-shadow: inset 0 0 0 1px #344a3d, 3px 3px 0 rgba(0, 0, 0, .3); }
.meta-card.done { border-color: #6bc978; }
.meta-head { display: flex; align-items: center; gap: 8px; }
.meta-ic { font-size: 18px; }
.meta-t { flex: 1; font-size: 13px; color: #fff0cb; }
.meta-check { font-family: var(--head); font-weight: 900; font-size: 15px; color: #8fe0a0; }
.meta-bar { height: 10px; background: #0b100d; border: 1px solid #050806; overflow: hidden; margin: 8px 0 4px; }
.meta-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #f6d45d, #c99628); transition: width .4s; }
.meta-card.done .meta-bar i { background: linear-gradient(90deg, #568c43, #8fe0a0); }
.meta-lbl { font-size: 11px; color: var(--dim); text-align: right; }

/* =============================================================
   RANKING
   ============================================================= */
.ranking-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.ranking-sub { font-size: 11px; color: var(--dim); }
.ranking-wrap { overflow-x: auto; }
.ranking-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ranking-table th, .ranking-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid #4e4b36; white-space: nowrap; }
.ranking-table th { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 11px; color: var(--dim); letter-spacing: .8px; }
.ranking-table .lb-pos { color: var(--gold); font-family: var(--head); font-weight: 900; font-size: 14px; }
.ranking-table .lb-user { color: var(--txt); }
.ranking-table .lb-pr { color: #b49bff; }
.ranking-table tr.me { background: rgba(245, 197, 74, .12); }
.ranking-table tr.me .lb-user { color: var(--gold); font-weight: 900; }
.lb-empty { text-align: center; color: var(--dim); }

/* =============================================================
   GARAGEM (dex + caixas)
   ============================================================= */
.garagem-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.gh-count { font-size: 12px; color: var(--dim); }
.gh-count b { color: var(--gold); }
.gh-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.gh-badge { font-size: 11px; color: #e9dec2; background: #11231f; border: 2px solid #59634b; padding: 4px 8px; }
.gh-badge.tw b { color: #cfe8ff; }
.gh-badge.bm b { color: #6cf0c8; }
.gh-badge.bonus { color: var(--gold); }
.gh-badge.bonus.zero { opacity: .5; }
.caixa-box { display: flex; align-items: center; gap: 12px; padding: 12px; margin-bottom: 14px; flex-wrap: wrap; color: #f2e7c9; background: #11231f; border: 3px solid #776747; box-shadow: inset 0 0 0 1px #34483c; }
.caixa-icon { font-size: 38px; }
.caixa-info { flex: 1; min-width: 140px; }
.caixa-name { font-size: 15px; color: var(--gold); }
.caixa-sub { font-size: 11px; color: var(--dim); margin-top: 4px; }
.caixa-sub b, .caixa-sub span { color: #f4c542; }
.caixa-actions { display: flex; gap: 8px; }
.dex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.dex-sep { grid-column: 1 / -1; font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 12px; color: var(--dim); margin-top: 8px; letter-spacing: 1px; }
.dex-card { position: relative; padding: 8px 6px; text-align: center; background: linear-gradient(#203a32, #132824); border: 2px solid #756344; box-shadow: inset 0 0 0 1px #344a3d; }
.dex-card canvas { width: 64px; height: 64px; image-rendering: pixelated; }
.dex-card.locked canvas { opacity: .55; }
.dex-card.owned { border-color: #c0a064; }
.dc-name { font-size: 11px; color: #f2e7c8; line-height: 1.15; margin-top: 2px; }
.dc-type { font-size: 10px; color: #aebba6; }
.dc-qty { position: absolute; top: 4px; right: 6px; font-family: var(--head); font-weight: 900; font-size: 12px; color: var(--gold); }
.dc-seals { position: absolute; top: 4px; left: 6px; font-size: 12px; }
.dex-card.rar-blackMarket.owned { border-color: #6cf0c8; }

/* overlay de abertura */
.caixa-overlay { position: fixed; inset: 0; z-index: 45; display: grid; place-items: center; background: rgba(3, 14, 16, .78); padding: 20px; }
.caixa-reveal {
  padding: 20px; max-width: 92vw; text-align: center; color: #f3e9ce;
  background: linear-gradient(#1b302b, #10201d);
  border: 4px solid var(--line); outline: 2px solid var(--line-out); box-shadow: var(--mold);
}
.caixa-reveal-title { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 17px; color: var(--gold); margin-bottom: 14px; letter-spacing: 1px; }
.reveal-stage { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; max-height: 60vh; overflow-y: auto; margin-bottom: 14px; }
.reveal-card { width: 118px; padding: 10px; background: linear-gradient(#203a32, #132824); border: 2px solid #756344; animation: pop .35s both; }
.reveal-card.new { border-color: var(--gold); }
.reveal-card canvas { width: 72px; height: 72px; image-rendering: pixelated; }
.rc-name { font-size: 12px; margin-top: 4px; }
.rc-rar { font-size: 10px; color: var(--dim); }
.rc-seals { font-size: 11px; color: var(--gold); min-height: 15px; }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }

/* =============================================================
   MODAIS (carro, confirmação, bem-vindo de volta)
   ============================================================= */
.modal-overlay { position: fixed; inset: 0; z-index: 48; display: grid; place-items: center; background: rgba(3, 14, 16, .78); padding: 20px; }
.car-choice-box, .modal-box, .offline-box {
  padding: 22px; text-align: center; color: #f3e9ce;
  background: linear-gradient(#1b302b, #10201d);
  border: 4px solid var(--line); outline: 2px solid var(--line-out); box-shadow: var(--mold);
}
.car-choice-box { max-width: 720px; width: 94vw; }
.car-choice-title { font-size: 20px; color: var(--gold); letter-spacing: 1px; }
.car-choice-sub { font-size: 12px; color: var(--dim); margin: 8px 0 18px; }
.car-choice-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.car-card { padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--txt); background: linear-gradient(#213b35, #142a27); border: 3px solid #756746; box-shadow: inset 0 0 0 1px #344a3d, 3px 3px 0 rgba(0, 0, 0, .3); transition: transform .1s, filter .1s, border-color .1s; }
.car-card:hover { border-color: var(--gold); filter: brightness(1.1); transform: translateY(-3px); }
.car-card img { width: 100%; max-width: 160px; height: auto; }
.car-name { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 14px; color: var(--gold); }

.modal-box { max-width: 460px; width: 92vw; }
.modal-title { font-size: 19px; color: var(--gold); margin-bottom: 12px; letter-spacing: .6px; text-shadow: 1px 2px 0 #171107; }
.modal-msg { font-size: 12px; color: #d4dfc7; line-height: 1.6; margin-bottom: 18px; }
.modal-msg b { color: var(--txt); }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { flex: 1; }

/* Bem-vindo de volta (relatório de offline) */
.offline-box { max-width: 480px; width: 94vw; }
.ob-title { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 22px; color: var(--gold); letter-spacing: 1px; text-shadow: 1px 2px 0 #171107; }
.ob-time { font-size: 13px; color: #d4dfc7; margin: 10px 0 4px; line-height: 1.5; }
.ob-time b { color: #fff0cb; }
.ob-mode { display: inline-block; font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 13px; padding: 4px 12px; margin-bottom: 12px; color: #fff3d1; background: linear-gradient(#568c43, #326630); border: 2px solid #b59a5d; }
.ob-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 7px; margin-bottom: 14px; }
.ob-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; font-size: 12px; color: #e9dec2; background: #11231f; border: 2px solid #59634b; }
.ob-item b { font-family: var(--head); font-weight: 900; font-size: 15px; }
.ob-item.sp b { color: var(--sp); }
.ob-item.ip b { color: var(--ip); }
.ob-item.cr b { color: var(--gold); }
.ob-item.pj b { color: #8fc4ff; }
.ob-item.wide { grid-column: 1 / -1; }
.ob-item .mmr-up { color: #8fe0a0; }
.ob-item .mmr-down { color: #ff8067; }
.ob-rank { display: flex; align-items: center; gap: 8px; }
.ob-rank img { height: 28px; width: auto; }

/* =============================================================
   TOASTS
   ============================================================= */
#toasts { position: fixed; left: 50%; bottom: 74px; transform: translateX(-50%); z-index: 60; display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: max-content; max-width: 92vw; }
.toast {
  font-size: 12px; color: #f4ead0; padding: 8px 14px;
  background: linear-gradient(#1a302a, #0e201d); border: 3px solid var(--line);
  box-shadow: inset 0 0 0 1px var(--line-in), 3px 3px 0 rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.good { border-color: #6bc978; color: #d6ffe4; }
.toast.warn { border-color: var(--gold); color: #fff0c9; }
.toast.err { border-color: var(--red); color: #ffd6da; }

/* =============================================================
   RODAPÉ
   ============================================================= */
#footer { text-align: center; font-size: 10px; color: var(--dim); padding: 14px 16px; border-top: 2px solid #4e4b36; line-height: 1.5; }
#footer.in-game { position: fixed; bottom: 0; left: 0; right: 0; background: #091b1b; border-top: 3px solid var(--line); z-index: 20; }

/* =============================================================
   LAYOUT: TUDO EM CASCATA
   Nenhuma tela divide a largura em duas colunas — cada bloco ocupa a
   linha inteira, um embaixo do outro (.view já é flex-column).
   ============================================================= */

/* =============================================================
   MOBILE: nav vira bottom-nav < 640px
   ============================================================= */
@media (max-width: 640px) {
  body { font-size: 13px; }
  #topbar { padding: 8px 10px 6px; }
  .logo .lines { display: none; }
  .status-cards { margin-left: 0; width: 100%; gap: 5px; justify-content: flex-start; }
  .stat { min-width: 62px; padding: 4px 7px; }
  .stat .k { font-size: 9px; }
  .stat .v { font-size: 13px; }
  .stat.player-chip { margin-left: auto; }

  #tabs {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: #0c2417; border-top: 3px solid var(--line); gap: 3px;
  }
  .tab { min-width: 0; flex: 1; padding: 6px 2px; border-width: 2px; }
  .tab .ic { font-size: 15px; }
  .tab .lb { font-size: 9px; letter-spacing: .2px; }
  #main { padding: 12px 10px 84px; }
  #footer.in-game { bottom: 58px; font-size: 9px; padding: 7px; }
  #toasts { bottom: 140px; }
  .car-choice-grid { grid-template-columns: 1fr; }
  .stage { aspect-ratio: 16 / 9; }

  .rl-side { min-width: 104px; padding: 0 12px; gap: 8px; }
  .rl-side.you { padding-right: 20px; }
  .rl-side.opp { padding-left: 20px; }
  .rl-nm { font-size: 10px; letter-spacing: .3px; }
  .rl-pts { font-size: 27px; min-width: 20px; }
  .rl-clock { min-width: 92px; font-size: 22px; padding: 8px 10px; }
  .rl-clock small { font-size: 8px; }
  .mr-seal { font-size: 22px; letter-spacing: 1.5px; padding: 5px 14px; }
  .mr-score { font-size: 19px; }
  .mr-chip { font-size: 10px; padding: 4px 8px; }
  .btn-start { font-size: 15px; padding: 11px 20px; }
  .ss-title { font-size: 19px; }
  .ob-grid { grid-template-columns: 1fr; }
  .ro-badge { height: 30px; }
  .rank-badge { height: 28px; }
  .hdr-badge { height: 18px; }
  .pro-row { flex-wrap: wrap; }
  .pro-photo { width: 44px; height: 44px; }
  .pro-rank { width: 26px; }
  .pro-main { flex: 1 1 40%; }
  .pro-ec { min-width: 0; }
  .pro-state { min-width: 0; flex: 1 1 auto; text-align: left; }
  .pro-row .desafiar { flex: 1 1 100%; }
}

/* =============================================================
   IDIOMA — bandeiras desenhadas em CSS (sem imagem; emoji de bandeira
   nao renderiza no Windows, entao cada uma e montada com gradientes).
   ============================================================= */
.lang-pick { display: flex; gap: 5px; align-items: center; }
.lang-btn {
  padding: 3px; line-height: 0; background: #10231f;
  border: 2px solid #554f39; border-radius: 2px;
  transition: filter .12s, transform .06s;
}
.lang-btn:hover { filter: brightness(1.25); }
.lang-btn.on { border-color: var(--gold); box-shadow: 0 0 8px rgba(245, 197, 74, .45); }
.lang-btn:not(.on) { filter: saturate(.55) brightness(.8); }
.flag { display: block; width: 26px; height: 18px; position: relative; overflow: hidden; }
/* Brasil: verde, losango amarelo, circulo azul */
.flag-pt { background: #009c3b; }
.flag-pt::before {
  content: ""; position: absolute; inset: 2px 3px; background: #ffdf00;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.flag-pt::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px;
  transform: translate(-50%, -50%); border-radius: 50%; background: #002776;
}
/* EUA: listras + cantao azul */
.flag-en { background: repeating-linear-gradient(180deg, #b22234 0 2px, #fff 2px 4px); }
.flag-en::before { content: ""; position: absolute; left: 0; top: 0; width: 44%; height: 54%; background: #3c3b6e; }
/* Espanha: faixas vermelho-amarelo-vermelho */
.flag-es { background: linear-gradient(180deg, #aa151b 0 25%, #f1bf00 25% 75%, #aa151b 75%); }

/* Card de Rank no header (substituiu Nivel + Skill Level) */
.stat.rank { min-width: 132px; }
.stat.rank .v { color: var(--gold); font-size: 13px; }
.rank-row { display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.stat.mp .v { color: var(--sp); }

/* =============================================================
   ABA SKILLS — os 6 atributos
   ============================================================= */
.attr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 9px; }
.attr-card {
  padding: 11px 13px; background: linear-gradient(#203a32, #132824);
  border: 2px solid #756344; box-shadow: inset 0 0 0 1px #344a3d, 3px 3px 0 rgba(0, 0, 0, .3);
  border-left-width: 5px;
}
.attr-card.atk { border-left-color: #e2604a; }
.attr-card.def { border-left-color: #3da4d3; }
.attr-card.vel { border-left-color: #6bc978; }
.attr-card.int { border-left-color: #c89632; }
.attr-card.foc { border-left-color: #b49bff; }
.attr-card.emo { border-left-color: #e58fc0; }
.ac-head { display: flex; align-items: center; gap: 7px; }
.ac-ic { font-size: 17px; }
.ac-nm { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 13px; color: #fff0cb; letter-spacing: .6px; }
.ac-val { font-family: var(--head); font-weight: 900; font-size: 30px; line-height: 1.1; color: var(--gold); margin: 4px 0 2px; }
.ac-desc { font-size: 11px; color: #aebba6; line-height: 1.4; }

/* Pisca quando o atributo sobe (feedback de compra) */
.ac-val.up, .ma-val.up { animation: attrUp .7s ease; }
@keyframes attrUp {
  0% { color: #8fe0a0; transform: scale(1); }
  25% { color: #8fe0a0; transform: scale(1.22); text-shadow: 0 0 12px rgba(143, 224, 160, .7); }
  100% { transform: scale(1); }
}

.attr-poder {
  margin-top: 12px; padding: 13px; text-align: center;
  background: linear-gradient(#34715a, #1d4939);
  border: 3px solid #a68b57; box-shadow: inset 0 0 0 1px #4e422e, 3px 3px 0 rgba(0, 0, 0, .4);
}
.ap-label { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 13px; letter-spacing: 1.4px; color: #d9f0d2; }
.ap-val { font-family: var(--head); font-weight: 900; font-size: 42px; line-height: 1.05; color: #ffe06a; text-shadow: 2px 3px 0 #10251d; }
.ap-desc { font-size: 11px; color: #cfe3c6; margin-top: 3px; }

.attr-extras { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.ae-chip {
  display: flex; align-items: center; gap: 7px; padding: 6px 10px; font-size: 11px;
  color: #e9dec2; background: #11231f; border: 2px solid #59634b;
}
.ae-chip b { font-family: var(--head); font-weight: 900; font-size: 14px; color: var(--gold); }

.attr-fontes { margin-top: 14px; padding: 11px 13px; background: #11231f; border: 2px solid #554f39; }
.af-title { font-family: var(--head); font-weight: 900; text-transform: uppercase; font-size: 12px; color: var(--gold); letter-spacing: .8px; margin-bottom: 6px; }
.attr-fontes ul { margin: 0; padding-left: 18px; }
.attr-fontes li { font-size: 11px; color: #cfd9c4; line-height: 1.7; }

/* Resumo dos atributos no topo de cada arvore */
.tree-desc { font-size: 12px; color: #cfd9c4; line-height: 1.55; margin-bottom: 10px; }
.mini-attrs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.mini-attr {
  display: flex; align-items: center; gap: 6px; padding: 5px 9px; font-size: 11px;
  color: #dce5cf; background: #11231f; border: 2px solid #59634b; border-left-width: 4px;
}
.mini-attr.atk { border-left-color: #e2604a; }
.mini-attr.def { border-left-color: #3da4d3; }
.mini-attr.vel { border-left-color: #6bc978; }
.mini-attr.int { border-left-color: #c89632; }
.mini-attr.foc { border-left-color: #b49bff; }
.mini-attr.emo { border-left-color: #e58fc0; }
.mini-attr.poder { border-left-color: var(--gold); background: #1b3129; }
.ma-ic { font-size: 13px; }
.ma-nm { color: #aebba6; }
.ma-val { font-family: var(--head); font-weight: 900; font-size: 14px; color: var(--gold); display: inline-block; }

/* =============================================================
   HISTORICO DE PARTIDAS (tela de Rankeds)
   ============================================================= */
.hist-list { display: flex; flex-direction: column; gap: 6px; }
.hist-vazio { padding: 14px; text-align: center; font-size: 12px; color: var(--dim); background: #11231f; border: 2px dashed #554f39; }
.hist-row {
  display: flex; align-items: center; gap: 11px; padding: 8px 10px;
  background: linear-gradient(#203a32, #132824);
  border: 2px solid #756344; border-left-width: 5px;
  box-shadow: inset 0 0 0 1px #344a3d;
}
.hist-row.win { border-left-color: #6bc978; }
.hist-row.lose { border-left-color: #e2604a; }
.hr-res {
  flex: 0 0 auto; width: 30px; height: 30px; display: grid; place-items: center;
  font-family: var(--head); font-weight: 900; font-size: 17px; border: 2px solid;
}
.hist-row.win .hr-res { color: #d6ffe4; background: linear-gradient(#3f8b4a, #1f5a2e); border-color: #8fe0a0; }
.hist-row.lose .hr-res { color: #ffd9d0; background: linear-gradient(#a9422c, #6e271d); border-color: #e2907a; }
.hr-mid { flex: 1; min-width: 0; }
.hr-placar { font-family: var(--head); font-weight: 900; font-size: 16px; color: #fff0cb; letter-spacing: 1px; }
.hr-opp { font-size: 10px; color: #aebba6; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr-ganhos { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.hr-g { display: flex; align-items: center; gap: 4px; padding: 3px 7px; font-size: 10px; color: #cfd9c4; background: #11231f; border: 1px solid #59634b; }
.hr-g b { font-family: var(--head); font-weight: 900; font-size: 12px; }
.hr-g.mp b { color: var(--sp); }
.hr-g.ip b { color: var(--ip); }
.hr-g.mmr b { color: #8fe0a0; }
.hr-g.mmr.neg b { color: #ff8067; }
.hr-quando { flex: 0 0 auto; font-size: 10px; color: #8b9a83; min-width: 62px; text-align: right; }

@media (max-width: 640px) {
  .lang-btn { padding: 2px; }
  .flag { width: 22px; height: 15px; }
  .stat.rank { min-width: 108px; }
  .attr-grid { grid-template-columns: 1fr 1fr; }
  .ac-val { font-size: 24px; }
  .ac-desc { display: none; }
  .ap-val { font-size: 32px; }
  .hist-row { flex-wrap: wrap; }
  .hr-mid { flex: 1 1 55%; }
  .hr-ganhos { flex: 1 1 100%; justify-content: flex-start; }
  .hr-quando { text-align: left; }
}
