/* ==========================================================================
   O Último Reduto — design system
   ========================================================================== */
:root {
    --bg: #0c0a08;
    --bg-2: #14110d;
    --panel: rgba(26, 21, 16, .92);
    --panel-2: rgba(38, 30, 22, .95);
    --line: #3b2f21;
    --line-strong: #5a4529;
    --gold: #d4a937;
    --gold-hi: #f2cf6b;
    --ember: #d9622b;
    --text: #eadfc6;
    --muted: #a3957a;
    --good: #6dbf6d;
    --bad: #e2564b;
    --info: #6aa9d8;
    --radius: 12px;
    --shadow: 0 10px 30px rgba(0, 0, 0, .55);
    --font-title: 'Cinzel', Georgia, serif;
    --font-body: 'Montserrat', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body::before {   /* pano de fundo fixo com as ruínas da missão */
    content: '';
    position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(rgba(8, 6, 4, .88), rgba(8, 6, 4, .95)), url('../img/ui/fundo.webp') center / cover no-repeat;
}
[hidden] { display: none !important; }   /* o atributo hidden vale mesmo em elementos com "display" próprio (.btn, .chip…) */
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }

/* Interface de jogo: texto não é selecionável e não mostra o cursor de digitação "|" ao clicar (nem o I-beam ao passar o mouse).
   Só onde a pessoa realmente digita ou pode querer copiar o texto (campos, chat, textos de história) isso continua valendo. */
body { user-select: none; -webkit-user-select: none; cursor: default; caret-color: transparent; -webkit-tap-highlight-color: transparent; }
input, textarea, select { user-select: text; -webkit-user-select: text; cursor: text; caret-color: auto; }
select, input[type="checkbox"], input[type="radio"], input[type="range"], input[type="submit"], input[type="button"] { cursor: pointer; }
.chat-log, .gchat-log { user-select: text; -webkit-user-select: text; cursor: text; }
a, label, summary, [role="button"], [data-tab], [data-type], [data-filter], [data-key], [data-act], [data-close], [data-slot], .clickable { cursor: pointer; }
button:disabled, [disabled] { cursor: not-allowed; }
h1, h2, h3, h4 { font-family: var(--font-title); letter-spacing: .03em; }
:focus-visible { outline: 2px solid var(--gold-hi); outline-offset: 2px; }

/* ---------- botões ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    padding: .65rem 1.3rem;
    font-family: var(--font-title); font-weight: 700; letter-spacing: .05em;
    color: #1a1208;
    background: linear-gradient(160deg, var(--gold-hi), var(--gold));
    border: 0; border-radius: 8px;
    transition: transform .15s, box-shadow .15s, filter .15s;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(212, 169, 55, .35); }
.btn:disabled { filter: grayscale(.8) brightness(.6); cursor: not-allowed; }
.btn.secondary { background: transparent; color: var(--gold-hi); border: 1px solid var(--line-strong); }
.btn.danger { background: linear-gradient(160deg, #e2564b, #a8322a); color: #fff; }
.btn.small { padding: .35rem .8rem; font-size: .8rem; }
.btn.block { width: 100%; }

/* ---------- formulários (login / criação) ---------- */
.field { margin-bottom: 1rem; }
.field label { display: block; margin-bottom: .35rem; font-family: var(--font-title); color: var(--gold); font-size: .9rem; }
.field input {
    width: 100%; padding: .8rem 1rem;
    background: rgba(255, 255, 255, .06); color: var(--text);
    border: 1px solid var(--line-strong); border-radius: 8px; font-size: 1rem;
}
.field input:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 3px rgba(212, 169, 55, .2); }
.alert { padding: .7rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-size: .92rem; }
.alert.error { background: rgba(226, 86, 75, .15); border: 1px solid var(--bad); color: #ffb4ad; }
.alert.ok { background: rgba(109, 191, 109, .12); border: 1px solid var(--good); color: #c9f0c9; }

/* ---------- telas centralizadas (auth / criação) ---------- */
.center-screen { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.card {
    background: var(--panel); border: 1px solid var(--line-strong);
    border-radius: 16px; box-shadow: var(--shadow); padding: 2rem;
}
.auth-card { width: 100%; max-width: 420px; }
.brand { font-size: 2.2rem; text-align: center; color: var(--gold-hi); text-shadow: 0 0 24px rgba(212, 169, 55, .4); line-height: 1.1; }
.tagline { text-align: center; color: var(--muted); margin: .4rem 0 1.5rem; font-size: .95rem; }
.tabs-switch { display: flex; border-bottom: 1px solid var(--line); margin-bottom: 1.4rem; }
.tabs-switch button { flex: 1; padding: .8rem; background: none; border: 0; border-bottom: 3px solid transparent; color: var(--muted); font-family: var(--font-title); font-size: 1rem; }
.tabs-switch button.active { color: var(--gold-hi); border-color: var(--gold); }

.creation-card { width: 100%; max-width: 980px; }
.creation-back { display: flex; justify-content: flex-start; margin: 0 0 .4rem; }
.hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.hero-option { cursor: pointer; }
.hero-option input { position: absolute; opacity: 0; pointer-events: none; }
.hero-option .box {
    height: 100%; padding: .9rem; text-align: center;
    background: var(--panel-2); border: 2px solid var(--line); border-radius: var(--radius);
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.hero-option .box img { width: 100%; aspect-ratio: 1; object-fit: contain; margin-bottom: .6rem; }
.hero-option .box strong { display: block; font-family: var(--font-title); color: var(--gold-hi); }
.hero-option .box span { font-size: .78rem; color: var(--muted); }
.hero-option:hover .box { transform: translateY(-4px); border-color: var(--line-strong); }
.hero-option input:checked + .box { border-color: var(--gold); box-shadow: 0 0 24px rgba(212, 169, 55, .4); }
.hero-option input:focus-visible + .box { outline: 2px solid var(--gold-hi); }

/* ---------- layout do jogo ---------- */
.app-header {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    min-height: 62px; padding: .25rem 1.2rem;
    background: linear-gradient(rgba(16, 11, 7, .97), rgba(10, 8, 6, .93)); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line-strong); box-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.app-logo { margin: 0; line-height: 0; }
.app-logo img { width: auto; height: 56px; filter: drop-shadow(0 3px 5px rgba(0, 0, 0, .75)); }
.header-right { display: flex; align-items: center; gap: .7rem; margin-left: auto; }

/* dinheiro: plaquinha de couro com moeda desenhada em CSS */
.wallet {
    display: inline-flex; align-items: center; gap: .45rem; padding: .28rem .85rem .28rem .4rem;
    color: var(--gold-hi); border-radius: 8px;
    background: linear-gradient(#2c1e12, #180f08); border: 1px solid #6b4a26;
    box-shadow: inset 0 1px 0 rgba(255, 220, 160, .12), 0 2px 6px rgba(0, 0, 0, .55);
}
.wallet b { font-family: var(--font-title); font-weight: 700; font-size: 1rem; letter-spacing: .02em; white-space: nowrap; }
.wallet small { font-size: .7rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: #b9a882; }
.coin {
    flex: none; width: 22px; height: 22px; border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #fff3c4, #e2b44c 45%, #93641a 85%);
    box-shadow: inset 0 0 0 2px rgba(110, 72, 18, .55), inset 0 0 0 4px rgba(255, 236, 170, .35), 0 0 7px rgba(242, 207, 107, .35);
}

/* sair: botão de couro vermelho-escuro com ícone de porta */
.btn-sair {
    display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .85rem;
    font-family: var(--font-title); font-weight: 700; font-size: .8rem; letter-spacing: .07em; text-transform: uppercase;
    color: #ecd9ac; background: linear-gradient(#4e2118, #2b100a); border: 1px solid #7d3b28; border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 200, 170, .14), 0 2px 6px rgba(0, 0, 0, .55);
    transition: filter .15s, transform .15s;
}
.btn-sair:hover { filter: brightness(1.22); transform: translateY(-1px); }
.btn-sair svg { width: 15px; height: 15px; flex: none; }

/* minha conta (assets/js/nucleo/conta.js): couro marrom, par do "Sair"; o ponto dourado avisa e-mail não confirmado */
.btn-conta {
    position: relative; display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .85rem;
    font-family: var(--font-title); font-weight: 700; font-size: .8rem; letter-spacing: .07em; text-transform: uppercase;
    color: #ecd9ac; background: linear-gradient(#3a2814, #1d1309); border: 1px solid #6b4a26; border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 220, 160, .12), 0 2px 6px rgba(0, 0, 0, .55);
    transition: filter .15s, transform .15s;
}
.btn-conta:hover { filter: brightness(1.22); transform: translateY(-1px); }
.btn-conta svg { width: 15px; height: 15px; flex: none; }
.acct-dot { position: absolute; top: -4px; right: -4px; width: 11px; height: 11px; border-radius: 50%; background: var(--gold-hi); border: 2px solid #120d08; box-shadow: 0 0 8px rgba(242, 207, 107, .8); }
.modal-box.account-box { max-width: 520px; }
.acct-id { display: grid; gap: .6rem; margin-bottom: 1rem; }
.acct-row { display: flex; align-items: center; gap: .8rem; padding: .7rem .85rem; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line); }
.acct-row small { display: block; font-size: .66rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.acct-row b { font-size: .98rem; color: var(--text); }
.acct-mail { word-break: break-all; user-select: text; -webkit-user-select: text; }
.acct-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 50%; color: var(--gold-hi); background: radial-gradient(circle, rgba(212, 169, 55, .22), rgba(0, 0, 0, .3)); border: 1px solid rgba(212, 169, 55, .5); }
.acct-ico svg { width: 20px; height: 20px; }
.acct-badge { display: inline-flex; align-items: center; gap: .25rem; margin-left: .4rem; padding: .08rem .5rem; border-radius: 999px; font-size: .66rem; font-weight: 700; vertical-align: middle; }
.acct-badge svg { width: 12px; height: 12px; }
.acct-badge.ok { color: #c9f0c9; background: rgba(109, 191, 109, .12); border: 1px solid rgba(109, 191, 109, .5); }
.acct-badge.warn { color: #ffe3a6; background: rgba(212, 169, 55, .12); border: 1px solid rgba(212, 169, 55, .5); }
.acct-box { display: grid; gap: .6rem; justify-items: start; margin-bottom: .9rem; padding: 1rem; border-radius: 12px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line-strong); }
.acct-box.warn { border-color: rgba(212, 169, 55, .55); background: rgba(212, 169, 55, .06); }
.acct-box h3 { display: flex; align-items: center; gap: .45rem; font-size: 1rem; color: var(--gold-hi); }
.acct-box h3 svg { width: 18px; height: 18px; }
.acct-box p { font-size: .86rem; line-height: 1.55; color: var(--text); }
.acct-box p b { color: var(--gold-hi); overflow-wrap: anywhere; }
.acct-sent { display: flex; gap: .5rem; padding: .6rem .75rem; border-radius: 10px; background: rgba(109, 191, 109, .08); border: 1px solid rgba(109, 191, 109, .4); }
.acct-sent > svg { flex: none; width: 18px; height: 18px; color: var(--good); margin-top: 2px; }
.acct-sent em { display: block; margin-top: .3rem; font-size: .76rem; color: var(--muted); }
.acct-foot { font-size: .76rem; color: var(--muted); text-align: center; }
.chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .25rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
    background: rgba(212, 169, 55, .12); border: 1px solid var(--line-strong); color: var(--gold-hi);
}
.chip.xp { color: #a9d4f5; background: rgba(106, 169, 216, .12); }
.chip.muted { color: var(--muted); background: transparent; }

.layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 1.25rem; max-width: 1500px; margin: 0 auto; padding: 1.25rem 1.5rem 3rem; align-items: start; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.panel-title { font-size: 1.05rem; color: var(--gold); margin-bottom: .8rem; display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; }

/* ---------- ficha do herói ---------- */
/* scrollbar-gutter reserva o espaço da barra de rolagem sempre, mesmo quando ela não aparece: sem isso, o conteúdo
   ficando bem na borda do max-height faz a barra aparecer/sumir em loop (a largura muda, o texto quebra diferente,
   a altura muda, a barra some, alarga de novo… — visível ao passar o mouse, que dispara repaint). */
.hero-card { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; scrollbar-gutter: stable; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
.hero-portrait { position: relative; border-radius: var(--radius); overflow: hidden; border: 2px solid var(--line-strong); background: #000; margin-bottom: 1rem; }
.hero-portrait img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.hero-portrait .lvl-badge {
    position: absolute; right: .6rem; bottom: .6rem;
    font-family: var(--font-title); font-weight: 900; font-size: 1.1rem;
    padding: .2rem .8rem; border-radius: 8px; color: #1a1208;
    background: linear-gradient(160deg, var(--gold-hi), var(--gold)); box-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.hero-name { font-size: 1.5rem; color: var(--gold-hi); text-align: center; word-break: break-word; }
.hero-record { text-align: center; color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.hero-record b.w { color: var(--good); } .hero-record b.l { color: var(--bad); }

.bar { position: relative; height: 16px; border-radius: 999px; background: #0a0806; border: 1px solid var(--line-strong); overflow: hidden; }
.bar > i { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: inherit; transition: width .5s ease; }
.bar.xp > i { background: linear-gradient(90deg, #3b78a8, #6aa9d8); }
/* Barra de vida: fundo avermelhado (vida perdida), rastro vermelho do último dano e a vida atual por cima. */
.bar.hp { height: 18px; background: #3a100d; box-shadow: inset 0 2px 4px rgba(0, 0, 0, .6); }
.bar.hp > i { background: linear-gradient(180deg, #7fd07f, #3f8a3f); }
.bar.hp.mid > i { background: linear-gradient(180deg, #f3d266, #c79a1e); }
.bar.hp.low > i { background: linear-gradient(180deg, #ef6a5e, #b8322a); animation: lowHp 1s ease-in-out infinite; }
.bar.hp > i.trail { background: #d43b30; opacity: .9; animation: none; transition: width .9s ease .35s; }
.bar.hp > i:not(.trail) { z-index: 1; }
.bar.hp::after { content: ''; position: absolute; inset: 0; z-index: 2; border-radius: inherit; background: linear-gradient(rgba(255, 255, 255, .22), transparent 55%); pointer-events: none; }
.bar.hp.flash { animation: barHit .3s; }
@keyframes barHit { 30% { filter: brightness(1.7); transform: scaleY(1.25); } }
@keyframes lowHp { 50% { filter: brightness(1.35); } }
.bar-label { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin: .9rem 0 .3rem; }

.attr-row { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px dashed var(--line); }
.attr-row:last-child { border: 0; }
.attr-row .name { flex: 1; }
.attr-row .name small { display: block; color: var(--muted); font-size: .72rem; }
.attr-row .val { font-family: var(--font-title); font-size: 1.15rem; color: var(--gold-hi); min-width: 2ch; text-align: right; }
.attr-btns { display: flex; gap: .3rem; }
.points-banner { text-align: center; padding: .5rem; margin-bottom: .6rem; border-radius: 8px; background: rgba(217, 98, 43, .15); border: 1px solid var(--ember); color: #ffc7a8; font-weight: 600; font-size: .9rem; }
.points-banner.none { display: none; }

.stat-list { display: grid; grid-template-columns: 1fr auto; gap: .3rem .8rem; font-size: .85rem; }
.stat-list dt { color: var(--muted); }
.stat-list dd { text-align: right; font-weight: 600; }

/* ---------- navegação principal ---------- */
.main-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1.1rem; }
.main-tab {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: .2rem; background: rgba(0, 0, 0, .55); border: 1px solid var(--line); border-radius: var(--radius);
    transition: border-color .2s, transform .2s, background .2s;
}
.main-tab img { width: 100%; max-height: 92px; object-fit: contain; opacity: .55; transition: opacity .2s, filter .2s; }
.main-tab:hover img { opacity: .9; }
.main-tab.active { border-color: var(--gold); background: rgba(212, 169, 55, .08); box-shadow: 0 0 20px rgba(212, 169, 55, .2); }
.main-tab.active img { opacity: 1; filter: drop-shadow(0 0 10px rgba(212, 169, 55, .5)); }
.tab-pane { display: none; animation: fade .3s ease; }
.tab-pane.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section-head { margin-bottom: 1rem; }
.section-head h2 { font-size: 1.6rem; color: var(--gold-hi); }
.section-head p { color: var(--muted); font-size: .92rem; }

/* ---------- sagas e missões ----------
   2026-09-28: 1º redesenho a pedido do dono — os pôsteres antigos (saga{N}button.png) tinham o título da saga
   PINTADO dentro do PNG, numa fonte/cor que destoava do resto da tela (e ~2,8 MB cada). Trocados por ícone SVG +
   cor de destaque por saga (SAGA_STYLE em game.js).
   2026-09-29: o dono mandou uma logo de verdade por saga (medalhão + faixa com o nome já desenhado dentro,
   assets/img/sagas/saga{N}.webp, recortada de logossagas.png por tools/imagens/extrai_logosagas.php) — o card virou vertical
   pra dar destaque à imagem; o `<b>` de título só aparece se por algum motivo a imagem faltar (fallback). */
.saga-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: .8rem; margin-bottom: 1.3rem; }
.saga-card {
    position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem;
    padding: .6rem .5rem .8rem; overflow: hidden;
    background: linear-gradient(180deg, rgba(var(--sc, 212 169 55), .14), var(--panel-2) 70%);
    border: 1px solid var(--line); border-radius: var(--radius);
    transition: transform .18s, border-color .18s, box-shadow .18s, background .18s;
}
.saga-card:hover { transform: translateY(-3px); border-color: rgba(var(--sc, 212 169 55), .6); }
.saga-card.active { border-color: var(--gold); box-shadow: 0 0 22px rgba(212, 169, 55, .28); background: linear-gradient(180deg, rgba(var(--sc, 212 169 55), .24), var(--panel-2) 70%); }
.saga-card-num {
    position: absolute; top: -.3rem; right: .3rem; font-family: var(--font-title); font-size: 1.7rem; font-weight: 700;
    color: rgba(var(--sc, 212 169 55), .4); line-height: 1; pointer-events: none; user-select: none;
}
.saga-card-logo {
    width: 100%; max-width: 152px; height: auto; display: block; opacity: .9; border-radius: 50%;
    border: 2px solid rgba(var(--sc, 212 169 55), .55);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .3), 0 6px 14px rgba(0, 0, 0, .55);
    transition: opacity .2s, transform .2s, box-shadow .2s, border-color .2s;
}
.saga-card:hover .saga-card-logo { opacity: 1; transform: translateY(-2px) scale(1.02); border-color: rgba(var(--sc, 212 169 55), .8); }
.saga-card.active .saga-card-logo {
    opacity: 1; border-color: var(--gold-hi);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, .3), 0 0 18px rgba(212, 169, 55, .55);
}
.saga-card-icon {
    flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--sc, 212 169 55), .3), rgba(var(--sc, 212 169 55), .08));
    border: 1px solid rgba(var(--sc, 212 169 55), .45); color: rgb(var(--sc, 212 169 55));
}
.saga-card-icon svg { width: 20px; height: 20px; }
.saga-card-text b { font-family: var(--font-title); font-size: .92rem; color: var(--text); line-height: 1.2; }
.saga-card.active .saga-card-text b { color: var(--gold-hi); }
.saga-card-progress { font-size: .68rem; color: var(--muted); letter-spacing: .02em; }
.saga-card-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(0, 0, 0, .35); display: block; }
.saga-card-bar i { display: block; height: 100%; background: rgb(var(--sc, 212 169 55)); transition: width .3s; }

.saga-intro { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.1rem; padding-bottom: .9rem; border-bottom: 1px solid var(--line); }
.saga-intro-icon {
    flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
    background: radial-gradient(circle, rgba(var(--sc, 212 169 55), .28), rgba(var(--sc, 212 169 55), .05));
    border: 1px solid rgba(var(--sc, 212 169 55), .4); color: rgb(var(--sc, 212 169 55));
}
.saga-intro-icon svg { width: 26px; height: 26px; }
.saga-intro-text h3 { display: flex; flex-direction: column-reverse; gap: .1rem; font-size: 1.35rem; color: var(--gold-hi); }
.saga-intro-text h3 em { font-style: normal; font-family: var(--font-body); font-size: .68rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.saga-intro-text p { color: var(--muted); font-size: .9rem; margin-top: .2rem; }

/* sempre exatamente 4 missões por saga (data/missions.php) — colunas FIXAS (4/2/1, todas dividem 4 sem sobra) em
   vez de auto-fit/minmax: com o item de largura mínima, o auto-fit cabia 3 numa linha e jogava a 4ª sozinha pra
   uma 2ª linha, deixando um vão em branco à direita (reportado pelo dono, 2026-09-28). */
.mission-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.1rem; }
@media (max-width: 820px) { .mission-grid { grid-template-columns: repeat(2, 1fr); } }
.mission { display: flex; flex-direction: column; overflow: hidden; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transition: transform .2s, border-color .2s, box-shadow .2s; }
.mission:hover:not(.locked) { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 10px 22px rgba(0, 0, 0, .4); }
.mission .thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: #000; cursor: pointer; }
.mission .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.mission:hover .thumb img { transform: scale(1.06); }
.mission-num {
    position: absolute; top: .5rem; left: .5rem; width: 22px; height: 22px; display: grid; place-items: center;
    border-radius: 50%; background: rgba(12, 10, 8, .78); border: 1px solid var(--line-strong);
    font-family: var(--font-title); font-size: .74rem; color: var(--gold-hi); backdrop-filter: blur(2px);
}
.mission .thumb .play { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; color: #fff; background: rgba(0, 0, 0, .35); opacity: 0; transition: opacity .2s; }
.mission:hover .thumb .play { opacity: 1; }
.mission .body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .6rem; flex: 1; }
.mission h4 { font-family: var(--font-title); font-size: 1rem; letter-spacing: .01em; }
.mission .rewards { display: flex; gap: .4rem; flex-wrap: wrap; }
.mission .req { font-size: .78rem; color: var(--muted); }
.mission .body .btn { margin-top: auto; }
.mission.locked .thumb img { filter: grayscale(1) brightness(.4); }
.mission.locked .thumb .play { opacity: 1; font-size: 1.6rem; background: rgba(0, 0, 0, .55); }
.mission.locked .mission-num { color: var(--muted); }
.mission.locked h4 { color: var(--muted); }

/* ---------- batalha ---------- */
.arena-idle { text-align: center; padding: 2.5rem 1rem; }
.arena-idle p { color: var(--muted); margin: .6rem 0 1.4rem; }
.arena { display: none; }
.arena.active { display: block; }
.fighters { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: center; }
.fighter { text-align: center; }
.fighter h3 { color: var(--gold-hi); font-size: 1.15rem; }
.fighter .sub { color: var(--muted); font-size: .8rem; margin-bottom: .6rem; white-space: pre-line; min-height: 2.4em; }
.sprite-box { position: relative; height: 260px; margin: .4rem 0 .8rem; }
.sprite-box img { position: absolute; inset: 0; margin: auto; height: 100%; width: 100%; object-fit: contain; display: none; }
.sprite-box img.on { display: block; }
.sprite-box.flip img { transform: scaleX(-1); }
.sprite-box.hit { animation: shake .35s; }
.sprite-box.hit img.on { filter: brightness(1.25) saturate(1.15) drop-shadow(0 0 3px rgba(226, 86, 75, .55)); }   /* clarão do golpe, discreto */
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-9px); } 75% { transform: translateX(9px); } }

/* efeitos de combate */
.sprite-box.lunge-r { animation: lungeR .34s ease-in-out; }
.sprite-box.lunge-l { animation: lungeL .34s ease-in-out; }
@keyframes lungeR { 0%, 100% { translate: 0 0; } 45% { translate: var(--lx, 90px) -6px; } }
@keyframes lungeL { 0%, 100% { translate: 0 0; } 45% { translate: calc(var(--lx, 90px) * -1) -6px; } }
.sprite-box.dodge { animation: dodge .46s ease-out; }
@keyframes dodge { 0%, 100% { translate: 0 0; opacity: 1; } 35% { translate: var(--dodge, -46px) 0; opacity: .45; } }
.sprite-box.dead img.on { animation: fall .9s ease-in forwards; }
@keyframes fall { to { transform: rotate(75deg) translateY(36px); opacity: 0; filter: grayscale(1) brightness(.6); } }

.fx { position: absolute; pointer-events: none; z-index: 4; }
.fx.slash { left: 50%; top: 42%; width: 150px; height: 7px; margin: -3px 0 0 -75px; border-radius: 50%; background: linear-gradient(90deg, transparent, #fff 30%, #ffe9a8 70%, transparent); box-shadow: 0 0 6px rgba(255, 220, 140, .6); transform: rotate(var(--rot, 35deg)) scaleX(0); animation: slash .34s ease-out forwards; }
.fx.slash.big { width: 230px; height: 11px; margin-left: -115px; background: linear-gradient(90deg, transparent, #fff 25%, #ffd166 70%, transparent); }
@keyframes slash { 0% { transform: rotate(var(--rot)) scaleX(0); opacity: 1; } 45% { transform: rotate(var(--rot)) scaleX(1); opacity: 1; } 100% { transform: rotate(var(--rot)) scaleX(1.08); opacity: 0; } }
.fx.spark { left: 50%; top: 45%; width: 6px; height: 6px; border-radius: 50%; background: var(--c, #ffd166); animation: spark .55s ease-out forwards; }
@keyframes spark { to { transform: translate(var(--dx), var(--dy)) scale(.2); opacity: 0; } }
.fx.ring { left: 50%; top: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; border: 3px solid var(--c, #6aa9d8); border-radius: 50%; animation: ring .65s ease-out forwards; }
@keyframes ring { from { transform: scale(.4); opacity: 1; } to { transform: scale(3.6); opacity: 0; } }
.fx.plus { left: var(--x, 50%); bottom: 24%; font-family: var(--font-title); font-weight: 900; font-size: 1.3rem; color: var(--good); text-shadow: 0 0 6px #000; opacity: 0; animation: plusUp 1s ease-out forwards; }
@keyframes plusUp { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-90px); opacity: 0; } }

/* flecha dos personagens com arco (ver fireArrow em game.js): sai do arco e voa até o alvo */
.arrow-fx { position: absolute; left: 0; top: 0; width: 76px; height: 14px; margin: -7px 0 0 -38px; z-index: 6; pointer-events: none; will-change: transform; filter: drop-shadow(0 0 4px rgba(255, 220, 140, .55)); }
.arrow-fx svg { display: block; }
.arrow-fx::before { content: ''; position: absolute; right: 100%; top: 6px; width: 64px; height: 2px; background: linear-gradient(90deg, transparent, rgba(255, 235, 190, .55)); }   /* rastro */
.arrow-fx.strong { filter: drop-shadow(0 0 7px #ffd166) drop-shadow(0 0 2px #fff); }   /* crítico / dobrado */
.arena.active { position: relative; }
.arena.shake { animation: arenaShake .42s; }
@keyframes arenaShake { 0%, 100% { transform: none; } 20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); } 60% { transform: translate(-4px, 2px); } 80% { transform: translate(3px, -2px); } }
.arena-flash { position: absolute; inset: -8px; z-index: 5; border-radius: 12px; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255, 240, 200, .32), transparent 70%); }
.arena-flash.on { animation: flashFade .36s ease-out; }
@keyframes flashFade { from { opacity: 1; } to { opacity: 0; } }
.float-num { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font-family: var(--font-title); font-weight: 900; font-size: 2rem; pointer-events: none; text-shadow: 0 2px 6px #000; animation: floatUp 1s ease-out forwards; z-index: 3; white-space: nowrap; }
.float-num.dmg { color: var(--bad); } .float-num.crit { color: #ffd166; font-size: 2.6rem; } .float-num.heal { color: var(--good); } .float-num.text { color: var(--info); font-size: 1.4rem; }
@keyframes floatUp { from { opacity: 1; transform: translate(-50%, 0); } to { opacity: 0; transform: translate(-50%, -80px); } }
.vs { font-family: var(--font-title); font-size: 2rem; color: var(--ember); text-shadow: 0 0 16px rgba(217, 98, 43, .6); }
.hp-text { font-size: .85rem; margin-top: .3rem; color: var(--muted); }
.arena-actions { display: flex; gap: .8rem; justify-content: center; margin: 1.2rem 0; }
.battle-log { max-height: 190px; overflow-y: auto; padding: .8rem 1rem; background: rgba(0, 0, 0, .45); border: 1px solid var(--line); border-radius: 8px; font-size: .85rem; scrollbar-width: thin; }
.battle-log p { padding: .15rem 0; color: var(--muted); }
.battle-log p.player { color: #d8e9c8; } .battle-log p.opponent { color: #f0c2b8; }
.battle-log p.crit, .battle-log p.double { color: #ffd166; font-weight: 600; }
.battle-log p.sys { color: var(--info); }

/* ---------- ranking ---------- */
.table-wrap { overflow-x: auto; }
table.rank { width: 100%; border-collapse: collapse; }
table.rank th { text-align: left; padding: .7rem; font-family: var(--font-title); color: var(--gold); border-bottom: 2px solid var(--line-strong); font-size: .85rem; }
table.rank td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.rank tr.me td { background: rgba(212, 169, 55, .1); }
table.rank img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line-strong); }
table.rank .pos { font-family: var(--font-title); font-weight: 900; width: 3rem; }
table.rank tr:nth-child(1) .pos { color: #ffd54f; } table.rank tr:nth-child(2) .pos { color: #cfd8dc; } table.rank tr:nth-child(3) .pos { color: #d98c5f; }
.w { color: var(--good); } .l { color: var(--bad); }

/* ---------- arsenal ---------- */
.sub-tabs { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.sub-tabs button { padding: .5rem 1.1rem; background: transparent; border: 1px solid var(--line-strong); border-radius: 999px; color: var(--muted); font-family: var(--font-title); }
.sub-tabs button.active { background: linear-gradient(160deg, var(--gold-hi), var(--gold)); color: #1a1208; border-color: transparent; }
/* submenu da Batalha com emblemas pintados (2026-10-12): o nome fica na faixa do emblema; o escolhido acende */
.sub-tabs.modos-emblema { justify-content: center; gap: 1.2rem; flex-wrap: nowrap; }
.sub-tabs.modos-emblema button { position: relative; flex: 0 1 150px; padding: 0; border: 0; border-radius: 0; background: none; cursor: pointer;
    filter: saturate(.55) brightness(.72); transition: filter .2s, transform .2s; }
.sub-tabs.modos-emblema button img { display: block; width: 100%; height: auto; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); pointer-events: none; }
.sub-tabs.modos-emblema button span { position: absolute; left: 22%; right: 22%; top: var(--faixa, 84%); transform: translateY(-50%);
    font-family: var(--font-title); font-weight: 800; font-size: clamp(.58rem, 1.1vw, .8rem); line-height: 1.05; color: #f6e7c4;
    text-align: center; letter-spacing: .03em; text-shadow: 0 1px 2px #000, 0 0 6px rgba(0, 0, 0, .8); pointer-events: none; }
.sub-tabs.modos-emblema button:hover { filter: saturate(.85) brightness(.92); transform: translateY(-2px); }
.sub-tabs.modos-emblema button.active { filter: none; transform: translateY(-3px); background: none; }
.sub-tabs.modos-emblema button.active img { filter: drop-shadow(0 0 10px rgba(242, 207, 107, .65)) drop-shadow(0 4px 8px rgba(0, 0, 0, .6)); }
.sub-tabs.modos-emblema button.active span { color: #fff3c4; }
.sub-tabs.modos-emblema .tab-dot { position: absolute; top: 10%; right: 12%; width: 12px; height: 12px; margin: 0; }
@media (max-width: 600px) {
    .sub-tabs.modos-emblema { gap: .4rem; }
    .sub-tabs.modos-emblema button span { font-size: .56rem; left: 18%; right: 18%; }
}
.shop-hint { color: var(--muted); font-size: .85rem; margin-bottom: 1rem; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .9rem; }
.item { display: flex; flex-direction: column; gap: .5rem; padding: 1rem; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .2s; }
.item.equipped { border-color: var(--gold); box-shadow: inset 0 0 0 1px var(--gold), 0 0 16px rgba(212, 169, 55, .2); }
.item.locked { opacity: .55; }
.item h4 { font-size: .98rem; line-height: 1.25; }
.item .desc { color: var(--good); font-size: .85rem; flex: 1; }
.item .meta { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); }
.item .price.no { color: var(--bad); }

/* ---------- modais ---------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: 1rem; background: rgba(0, 0, 0, .82); }
.modal.open { display: grid; animation: fade .2s; }
.modal-box { position: relative; width: 100%; max-width: 760px; max-height: 92vh; overflow-y: auto; background: var(--bg-2); border: 2px solid var(--gold); border-radius: 16px; padding: 1.5rem; box-shadow: var(--shadow); }
.modal-box h2 { color: var(--gold-hi); margin-bottom: .8rem; padding-right: 2rem; }
.modal-close { position: absolute; top: .8rem; right: 1rem; background: none; border: 0; font-size: 1.8rem; color: var(--muted); line-height: 1; }
.modal-close:hover { color: var(--text); }
.modal video { width: 100%; border-radius: 8px; background: #000; margin-bottom: 1rem; max-height: 52vh; }
.modal-actions { display: flex; gap: .7rem; justify-content: flex-end; }
.result-box { text-align: center; max-width: 440px; }
.result-box .big { font-size: 2.4rem; font-family: var(--font-title); margin-bottom: .5rem; }
.result-box .big.win { color: var(--good); } .result-box .big.loss, .result-box .big.flee { color: var(--bad); }
.result-box .chips { display: flex; justify-content: center; gap: .5rem; flex-wrap: wrap; margin: 1rem 0 1.4rem; }

/* ---------- aviso do servidor (painel administrativo: server_settings 'aviso' e modo manutenção) ---------- */
/* flutua embaixo, no centro: no topo cobriria o logo da moldura */
.aviso-servidor { position: fixed; z-index: 60; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; justify-content: center; gap: .8rem;
    width: min(640px, calc(100% - 32px)); padding: .6rem 2.6rem .6rem 1rem; border-radius: 10px;
    font-size: .9rem; text-align: center; color: #f3e6c8; background: rgba(40, 30, 18, .92); border: 1px solid rgba(212, 169, 55, .55);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .45); }
.aviso-servidor.alerta { background: rgba(70, 20, 16, .94); border-color: rgba(226, 86, 75, .7); }
.aviso-servidor + .aviso-servidor { bottom: 76px; }   /* manutenção (só o admin vê) + aviso ao mesmo tempo */
.aviso-servidor.festa { background: rgba(30, 50, 26, .94); border-color: rgba(109, 191, 109, .65); }
.aviso-servidor button { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); width: 1.8rem; height: 1.8rem;
    border: 0; border-radius: 50%; background: rgba(255, 255, 255, .08); color: inherit; font-size: 1.1rem; cursor: pointer; }
.aviso-servidor button:hover { background: rgba(255, 255, 255, .18); }