/* ============ LENDAS DO VÉU — Interface ============ */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@500;700;900&family=Crimson+Pro:ital,wght@0,400;0,600;1,400&display=swap');

:root {
  --gold: #d4af37;
  --gold-dim: #8a7530;
  --parchment: #d8cfc0;
  --ink: #c9c2b8;
  --ink-dim: #847f76;
  --bg-panel: rgba(13, 12, 18, 0.92);
  --bg-panel2: rgba(22, 20, 30, 0.95);
  --border-ornate: 1px solid rgba(212, 175, 55, 0.35);
  --hp: linear-gradient(180deg, #d8434f, #8c1f28);
  --mp: linear-gradient(180deg, #4a7fd8, #1f3a8c);
  --en: linear-gradient(180deg, #d8b843, #8c731f);
  --xp: linear-gradient(180deg, #9b6dd8, #4a1f8c);
  --r-comum: #9da5b4; --r-incomum: #3fb950; --r-raro: #58a6ff; --r-epico: #bc8cff;
  --r-lendario: #f0883e; --r-mitico: #ff7b9c; --r-reliquia: #ffd700;
  font-size: 15px;
}

* { margin: 0; padding: 0; box-sizing: border-box; user-select: none; }
html, body { width: 100%; height: 100%; overflow: hidden; background: #07060a; }
body { font-family: 'Crimson Pro', Georgia, serif; color: var(--ink); }
.hidden { display: none !important; }
button { font-family: 'Cinzel', serif; cursor: pointer; }
input { font-family: 'Crimson Pro', serif; }
canvas#game { position: fixed; inset: 0; display: block; }

::-webkit-scrollbar { width: 9px; }
::-webkit-scrollbar-track { background: rgba(0,0,0,.35); }
::-webkit-scrollbar-thumb { background: linear-gradient(180deg, #4a4030, #2a2418); border-radius: 5px; border: 1px solid rgba(212,175,55,.25); }

/* ============ PAINEL ORNAMENTADO (base) ============ */
.panel, #dialogue, #tooltip, .window {
  background:
    radial-gradient(ellipse at top, rgba(60,50,90,.18), transparent 60%),
    var(--bg-panel);
  border: var(--border-ornate);
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.8), 0 8px 32px rgba(0,0,0,.7), inset 0 0 24px rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
}

/* ============ HUD ============ */
#hud { position: fixed; inset: 0; pointer-events: none; z-index: 10; }
#hud > * { pointer-events: auto; }

#hud-top-left { position: absolute; top: 14px; left: 14px; display: flex; gap: 10px; align-items: flex-start; }
#portrait-wrap { position: relative; width: 72px; height: 72px; border-radius: 50%;
  border: 2px solid var(--gold-dim); padding: 2px; background: radial-gradient(circle, #1a1626, #0a0810);
  box-shadow: 0 0 18px rgba(0,0,0,.8), inset 0 0 12px rgba(0,0,0,.9); }
#portrait { width: 100%; height: 100%; border-radius: 50%; }
#hud-level { position: absolute; bottom: -4px; right: -4px; min-width: 24px; height: 24px; border-radius: 50%;
  background: radial-gradient(circle, #3a2f12, #1a1408); border: 1px solid var(--gold);
  color: var(--gold); font-family: 'Cinzel', serif; font-weight: 700; font-size: 13px;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 0 8px rgba(212,175,55,.4); }

#hud-bars { display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.bar { position: relative; width: 230px; height: 17px; background: rgba(0,0,0,.72);
  border: 1px solid rgba(212,175,55,.28); border-radius: 3px; overflow: hidden; }
.bar.xp { height: 9px; width: 200px; }
.bar.en { height: 13px; width: 215px; }
.bar-fill { height: 100%; width: 100%; transition: width .25s ease-out; position: relative; }
.bar.hp .bar-fill { background: var(--hp); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.bar.mp .bar-fill { background: var(--mp); box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.bar.en .bar-fill { background: var(--en); }
.bar.xp .bar-fill { background: var(--xp); }
.bar-fill::after { content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,.14) 50%, transparent 70%);
  animation: barShine 3.2s linear infinite; }
@keyframes barShine { from { transform: translateX(-100%);} to { transform: translateX(100%);} }
.bar-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600; color: #fff; text-shadow: 0 1px 2px #000, 0 0 4px #000; letter-spacing: .4px; }

#hud-buffs { position: absolute; top: 100px; left: 16px; display: flex; gap: 5px; flex-wrap: wrap; max-width: 280px; }
.buff-icon { width: 30px; height: 30px; border-radius: 4px; background: var(--bg-panel2);
  border: 1px solid rgba(212,175,55,.4); display: flex; align-items: center; justify-content: center;
  font-size: 15px; position: relative; }
.buff-icon.debuff { border-color: rgba(216, 67, 79, .6); }
.buff-icon.flying { border-color: #9fd4ff; box-shadow: 0 0 12px rgba(159,212,255,.5); animation: flyPulse 1.6s ease-in-out infinite; }
@keyframes flyPulse { 0%,100% { box-shadow: 0 0 8px rgba(159,212,255,.35);} 50% { box-shadow: 0 0 16px rgba(159,212,255,.7);} }
.buff-icon .buff-time { position: absolute; bottom: -3px; right: -2px; font-size: 9px; color: #fff;
  text-shadow: 0 0 3px #000, 0 0 3px #000; font-weight: 700; }

#hud-top-right { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
#zone-info { text-align: right; }
#zone-name { display: block; font-family: 'Cinzel', serif; font-size: 19px; font-weight: 700; color: var(--gold);
  text-shadow: 0 0 12px rgba(212,175,55,.45), 0 2px 4px #000; letter-spacing: 1px; }
#zone-sub { display: block; font-style: italic; font-size: 12px; color: var(--ink-dim); }
#minimap { width: 260px; height: 150px; border: 1px solid rgba(212,175,55,.35); border-radius: 4px; background: #0a0810;
  box-shadow: 0 4px 14px rgba(0,0,0,.6); cursor: pointer; }
#clock-row, #currency-row { display: flex; gap: 10px; font-size: 13px; align-items: center;
  background: rgba(0,0,0,.55); padding: 2px 10px; border-radius: 10px; border: 1px solid rgba(212,175,55,.2); }
#hud-gold { color: var(--gold); } #hud-frag { color: #b48fff; }
/* lista de jogadores online (grupo + troca) */
#online-list { margin-top: 4px; width: 260px; background: rgba(0,0,0,.55); border: 1px solid rgba(212,175,55,.2);
  border-radius: 8px; padding: 5px 8px; font-size: 12.5px; align-self: flex-end; }
#online-list.hidden { display: none; }
#online-list .ol-title { color: var(--ink-dim); font-size: 11px; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 3px; }
#online-list .ol-row { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
#online-list .ol-dot { width: 7px; height: 7px; border-radius: 50%; background: #6a6f78; flex: 0 0 auto; }
#online-list .ol-row.grp .ol-dot { background: #5cda6a; box-shadow: 0 0 6px rgba(92,218,106,.8); }
#online-list .ol-name { flex: 1; color: var(--parchment); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#online-list .ol-row.grp .ol-name { color: #bff0c8; }
#online-list .ol-lv { color: var(--ink-dim); font-size: 11px; }
#online-list .ol-trade { width: 22px; height: 22px; border-radius: 4px; background: rgba(212,175,55,.12);
  border: 1px solid rgba(212,175,55,.4); color: var(--gold); cursor: pointer; font-size: 13px; line-height: 1; padding: 0; }
#online-list .ol-trade:hover { background: rgba(212,175,55,.28); }
#online-list .ol-trade[disabled] { opacity: .35; cursor: default; }
#online-list .ol-star { color: #ffd24a; margin-right: 3px; text-shadow: 0 0 6px rgba(255,210,74,.8); }
#online-list .ol-row.party .ol-name { color: #ffe9a8; }
#online-list .ol-party { width: 22px; height: 22px; border-radius: 4px; background: rgba(92,218,106,.14);
  border: 1px solid rgba(92,218,106,.5); color: #9cffb0; cursor: pointer; font-size: 12px; line-height: 1; padding: 0; }
#online-list .ol-party:hover { background: rgba(92,218,106,.3); }
#online-list .ol-leave { color: #f0a0a0; cursor: pointer; font-size: 11px; }
#online-list .ol-leave:hover { color: #ff8a8a; text-decoration: underline; }
#online-list .ol-row.party { flex-wrap: wrap; }
#online-list .ol-hp { flex-basis: 100%; height: 5px; margin: 2px 0 1px; border-radius: 3px;
  background: rgba(0,0,0,.55); overflow: hidden; border: 1px solid rgba(0,0,0,.4); }
#online-list .ol-hp-fill { height: 100%; width: 100%; background: #5cda6a; transition: width .15s ease-out; }

#quest-tracker { position: absolute; top: 215px; right: 14px; width: 250px; padding: 9px 12px;
  background: rgba(8,7,12,.78); border-left: 2px solid var(--gold-dim); border-radius: 3px; }
#quest-tracker .qt-name { font-family: 'Cinzel', serif; color: var(--gold); font-size: 13px; }
#quest-tracker .qt-step { font-size: 13px; color: var(--ink); margin-top: 3px; }
#quest-tracker .qt-progress { color: #7ee787; font-weight: 600; }

#boss-bar { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); width: 460px; text-align: center; }
#boss-name { font-family: 'Cinzel', serif; font-size: 17px; font-weight: 700; color: #ff9b9b;
  text-shadow: 0 0 14px rgba(216,67,79,.8), 0 2px 3px #000; letter-spacing: 2px; margin-bottom: 4px; }
.bar.boss { width: 100%; height: 15px; border-color: rgba(216,67,79,.5); }
.bar.boss .bar-fill { background: linear-gradient(180deg, #a32533, #5c0f18); }

/* ============ BARRA DE AÇÃO ============ */
#action-bar { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 7px; }
.action-slot { position: relative; width: 52px; height: 52px; border-radius: 6px;
  background: linear-gradient(180deg, rgba(30,26,42,.95), rgba(12,10,18,.95));
  border: 1px solid rgba(212,175,55,.35); box-shadow: 0 4px 12px rgba(0,0,0,.6), inset 0 0 10px rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer;
  transition: transform .08s, border-color .15s; }
.action-slot:hover { border-color: var(--gold); transform: translateY(-2px); }
.action-slot.active { border-color: var(--gold); box-shadow: 0 0 14px rgba(212,175,55,.5); }
.action-slot .key { position: absolute; top: 1px; left: 4px; font-size: 10px; font-family: 'Cinzel', serif;
  color: var(--gold-dim); font-weight: 700; }
.action-slot .cd-overlay { position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
  background: conic-gradient(rgba(0,0,0,.78) calc(var(--cd) * 1%), transparent 0); }
.action-slot .cd-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; text-shadow: 0 0 4px #000; pointer-events: none; }
.action-slot.potion { border-color: rgba(216,67,79,.45); }
.action-slot .count { position: absolute; bottom: 1px; right: 4px; font-size: 11px; color: #fff;
  font-weight: 700; text-shadow: 0 0 3px #000; }
.action-slot.flash { animation: slotFlash .3s; }
@keyframes slotFlash { 0% { box-shadow: 0 0 22px rgba(212,175,55,.9);} 100% { box-shadow: 0 0 0 transparent;} }
.action-slot.autoatk { font-size: 11px; flex-direction: column; gap: 1px; border-color: rgba(126,231,135,.3); }
.action-slot.autoatk .autoatk-label { font-family: 'Cinzel', serif; font-weight: 700; letter-spacing: .5px; color: var(--ink-dim); }
.action-slot.autoatk.on { border-color: #7ee787; box-shadow: 0 0 14px rgba(126,231,135,.45); }
.action-slot.autoatk.on .autoatk-label { color: #7ee787; }
.action-slot.autoatk.on::after { content: '●'; position: absolute; top: 2px; right: 4px; color: #7ee787; font-size: 8px; }

/* ============ LOG ============ */
#log-feed { position: absolute; bottom: 16px; left: 16px; width: 360px; max-height: 200px;
  display: flex; flex-direction: column-reverse; gap: 2px; overflow: hidden; pointer-events: none;
  mask-image: linear-gradient(180deg, transparent, #000 28%); }
.log-line { font-size: 13.5px; padding: 1px 8px; border-radius: 3px; background: rgba(0,0,0,.45);
  text-shadow: 0 1px 2px #000; animation: logIn .25s ease-out; line-height: 1.45; }
@keyframes logIn { from { opacity: 0; transform: translateX(-14px);} to { opacity: 1; transform: none;} }
.log-line.combate { color: #e8a8a8; } .log-line.info { color: var(--ink); }
.log-line.quest { color: #d8c878; } .log-line.system { color: #8fa8c8; font-style: italic; }
.log-line.epic { color: var(--r-epico); font-weight: 600; }

#interact-prompt { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%);
  background: rgba(8,7,12,.85); border: 1px solid var(--gold-dim); border-radius: 5px;
  padding: 6px 16px; font-size: 14px; }
#interact-prompt b { color: var(--gold); font-family: 'Cinzel', serif; }
#interact-prompt .gather-bar { height: 4px; background: rgba(255,255,255,.15); border-radius: 2px; margin-top: 4px; overflow: hidden; }
#interact-prompt .gather-fill { height: 100%; background: var(--gold); width: 0%; }

#menu-buttons { position: absolute; bottom: 16px; right: 16px; display: flex; gap: 5px; }
#menu-buttons button { width: 38px; height: 38px; border-radius: 5px; background: var(--bg-panel2);
  border: 1px solid rgba(212,175,55,.3); color: var(--ink); font-size: 17px;
  transition: border-color .15s, transform .1s; }
#menu-buttons button:hover { border-color: var(--gold); transform: translateY(-2px); color: var(--gold); }

/* ============ ANÚNCIO CENTRAL ============ */
#announce { position: fixed; top: 22%; left: 50%; transform: translateX(-50%); text-align: center;
  z-index: 50; pointer-events: none; animation: announceIn 4.5s ease-out forwards; }
@keyframes announceIn {
  0% { opacity: 0; transform: translateX(-50%) scale(.85); filter: blur(6px); }
  10% { opacity: 1; transform: translateX(-50%) scale(1); filter: blur(0); }
  82% { opacity: 1; } 100% { opacity: 0; }
}
#announce-title { font-family: 'Cinzel', serif; font-size: 42px; font-weight: 900; color: var(--gold);
  text-shadow: 0 0 30px rgba(212,175,55,.6), 0 0 60px rgba(212,175,55,.3), 0 3px 6px #000; letter-spacing: 6px; }
#announce-sub { font-style: italic; font-size: 17px; color: var(--parchment); text-shadow: 0 2px 4px #000; margin-top: 4px; }
#announce.danger #announce-title { color: #e85560; text-shadow: 0 0 30px rgba(216,67,79,.7), 0 3px 6px #000; }

/* ============ JANELAS ============ */
.window { position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 720px; max-width: 94vw; max-height: 84vh; z-index: 30; display: flex; flex-direction: column;
  animation: winIn .18s ease-out; }
@keyframes winIn { from { opacity: 0; transform: translate(-50%, -48%) scale(.97);} to { opacity: 1; transform: translate(-50%, -50%) scale(1);} }
.window-title { font-family: 'Cinzel', serif; font-size: 19px; font-weight: 700; color: var(--gold);
  letter-spacing: 2px; padding: 13px 20px 11px; border-bottom: 1px solid rgba(212,175,55,.25);
  text-shadow: 0 0 10px rgba(212,175,55,.3); display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(180deg, rgba(212,175,55,.07), transparent); }
.window-close { background: none; border: 1px solid rgba(212,175,55,.3); color: var(--ink-dim);
  width: 26px; height: 26px; border-radius: 4px; font-size: 14px; font-family: serif; }
.window-close:hover { color: #e85560; border-color: #e85560; }
.window-body { padding: 16px 20px; overflow-y: auto; flex: 1; }

.btn { background: linear-gradient(180deg, #3a3220, #211c10); border: 1px solid var(--gold-dim);
  color: var(--parchment); padding: 7px 18px; border-radius: 4px; font-size: 14px; letter-spacing: .5px;
  transition: all .15s; }
.btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 12px rgba(212,175,55,.3); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.danger { border-color: #8c2f38; } .btn.danger:hover { border-color: #e85560; color: #e85560; box-shadow: 0 0 12px rgba(216,67,79,.3); }
.btn.small { padding: 3px 10px; font-size: 12px; }

/* Atributos (janela personagem) */
.attr-row { display: flex; align-items: center; justify-content: space-between; padding: 5px 10px;
  border-bottom: 1px solid rgba(255,255,255,.05); }
.attr-row .attr-name { font-family: 'Cinzel', serif; font-size: 14px; }
.attr-row .attr-val { color: var(--gold); font-weight: 700; font-size: 16px; min-width: 34px; text-align: right; }
.attr-plus { width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--gold); background: rgba(212,175,55,.12);
  color: var(--gold); font-size: 15px; line-height: 1; margin-left: 10px; transition: all .12s; }
.attr-plus:hover { background: var(--gold); color: #000; box-shadow: 0 0 10px rgba(212,175,55,.6); }
.attr-plus10 { height: 24px; padding: 0 9px; margin-left: 6px; border-radius: 12px; border: 1px solid var(--gold-dim);
  background: rgba(212,175,55,.1); color: var(--gold); font-size: 12px; font-weight: 700; line-height: 1; cursor: pointer; transition: all .12s; }
.attr-plus10:hover { background: var(--gold); color: #000; box-shadow: 0 0 10px rgba(212,175,55,.5); }
.derived-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 18px; font-size: 13.5px; }
.derived-grid div { display: flex; justify-content: space-between; padding: 3px 8px; background: rgba(255,255,255,.025); border-radius: 3px; }
.derived-grid span { color: #a8c8e8; font-weight: 600; }

/* Inventário */
.inv-layout { display: flex; gap: 18px; }
.equip-paperdoll { width: 240px; display: grid; grid-template-columns: 64px 110px 64px; grid-template-rows: repeat(5, 58px);
  gap: 5px; justify-items: center; align-items: center; }
.equip-doll-canvas { grid-column: 2; grid-row: 1 / 6; width: 110px; height: 290px; }
.equip-slot { width: 56px; height: 56px; border-radius: 6px; background: rgba(0,0,0,.5);
  border: 1px dashed rgba(212,175,55,.3); display: flex; align-items: center; justify-content: center;
  position: relative; cursor: pointer; }
.equip-slot.filled { border-style: solid; }
.equip-slot .slot-label { position: absolute; bottom: -1px; left: 0; right: 0; text-align: center; font-size: 8.5px;
  color: var(--ink-dim); letter-spacing: .5px; pointer-events: none; }
.inv-grid { display: grid; grid-template-columns: repeat(6, 54px); gap: 5px; align-content: start; }
.inv-cell { width: 54px; height: 54px; border-radius: 5px; background: rgba(0,0,0,.45);
  border: 1px solid rgba(255,255,255,.07); position: relative; cursor: pointer; transition: border-color .1s; }
.inv-cell:hover { border-color: rgba(212,175,55,.6); }
.inv-cell canvas { width: 100%; height: 100%; }
.inv-cell .qty { position: absolute; bottom: 1px; right: 3px; font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000; pointer-events: none; }
.inv-cell .ilvl { position: absolute; top: 0px; left: 3px; font-size: 10px; font-weight: 700; color: #ffd700; text-shadow: 0 0 3px #000; pointer-events: none; }
.inv-cell.r-comum { border-color: rgba(157,165,180,.4); } .inv-cell.r-incomum { border-color: rgba(63,185,80,.55); }
.inv-cell.r-raro { border-color: rgba(88,166,255,.55); } .inv-cell.r-epico { border-color: rgba(188,140,255,.6); }
.inv-cell.r-lendario { border-color: rgba(240,136,62,.7); box-shadow: 0 0 8px rgba(240,136,62,.25); }
.inv-cell.r-mitico { border-color: rgba(255,123,156,.7); box-shadow: 0 0 8px rgba(255,123,156,.3); }
.inv-cell.r-reliquia { border-color: rgba(255,215,0,.8); box-shadow: 0 0 10px rgba(255,215,0,.35); }
.equip-slot.r-comum { border-color: rgba(157,165,180,.5);} .equip-slot.r-incomum { border-color: rgba(63,185,80,.6);}
.equip-slot.r-raro { border-color: rgba(88,166,255,.6);} .equip-slot.r-epico { border-color: rgba(188,140,255,.65);}
.equip-slot.r-lendario { border-color: rgba(240,136,62,.75); box-shadow: 0 0 8px rgba(240,136,62,.3);}
.equip-slot.r-mitico { border-color: rgba(255,123,156,.75); box-shadow: 0 0 8px rgba(255,123,156,.35);}
.equip-slot.r-reliquia { border-color: rgba(255,215,0,.85); box-shadow: 0 0 10px rgba(255,215,0,.4);}

/* Tooltip */
#tooltip { position: fixed; z-index: 99; max-width: 320px; padding: 11px 14px; pointer-events: none; font-size: 13.5px; line-height: 1.5; }
#tooltip .tt-name { font-family: 'Cinzel', serif; font-size: 15.5px; font-weight: 700; }
#tooltip .tt-type { color: var(--ink-dim); font-size: 12px; font-style: italic; margin-bottom: 5px; }
#tooltip .tt-stat { color: #a8d8a8; } #tooltip .tt-rune { color: #b48fff; }
#tooltip .tt-socket { color: var(--ink-dim); } #tooltip .tt-evolve { color: #d8b843; }
#tooltip .tt-evolve.locked { color: #555; }
#tooltip .tt-sig { color: var(--gold); font-style: italic; margin-top: 5px; border-top: 1px solid rgba(212,175,55,.25); padding-top: 4px; }
#tooltip .tt-desc { color: var(--ink-dim); font-style: italic; margin-top: 5px; }
#tooltip .tt-price { color: var(--gold); font-size: 12.5px; margin-top: 4px; }
.c-comum { color: var(--r-comum);} .c-incomum { color: var(--r-incomum);} .c-raro { color: var(--r-raro);}
.c-epico { color: var(--r-epico);} .c-lendario { color: var(--r-lendario);} .c-mitico { color: var(--r-mitico);}
.c-reliquia { color: var(--r-reliquia); text-shadow: 0 0 8px rgba(255,215,0,.5);}

/* Habilidades */
.skill-list { display: flex; flex-direction: column; gap: 6px; }
.skill-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: rgba(255,255,255,.03);
  border-radius: 5px; border: 1px solid transparent; }
.skill-row:hover { border-color: rgba(212,175,55,.35); }
.skill-row .sk-icon { width: 42px; height: 42px; border-radius: 5px; background: var(--bg-panel2);
  border: 1px solid var(--gold-dim); display: flex; align-items: center; justify-content: center; font-size: 21px; flex-shrink: 0; }
.skill-row .sk-info { flex: 1; }
.skill-row .sk-name { font-family: 'Cinzel', serif; color: var(--parchment); font-size: 14px; }
.skill-row .sk-desc { font-size: 12.5px; color: var(--ink-dim); }
.skill-row .sk-meta { font-size: 11.5px; color: #8fa8c8; }
.skill-bar-assign { display: flex; gap: 4px; }
.skill-bar-assign button { width: 26px; height: 26px; border-radius: 4px; background: rgba(0,0,0,.5);
  border: 1px solid rgba(212,175,55,.3); color: var(--ink); font-size: 12px; }
.skill-bar-assign button.assigned { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,.15); }

/* Quests */
.quest-entry { padding: 10px 14px; border-left: 3px solid var(--gold-dim); background: rgba(255,255,255,.025);
  border-radius: 0 5px 5px 0; margin-bottom: 8px; }
.quest-entry.done { border-left-color: #3fb950; opacity: .6; }
.quest-entry .q-name { font-family: 'Cinzel', serif; color: var(--gold); font-size: 15px; }
.quest-entry .q-step { font-size: 13.5px; margin-top: 3px; }
.quest-entry .q-rewards { font-size: 12px; color: var(--ink-dim); margin-top: 4px; }

/* Crafting */
.craft-tabs, .shop-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.craft-tabs button, .shop-tabs button { background: rgba(0,0,0,.4); border: 1px solid rgba(212,175,55,.25);
  color: var(--ink); padding: 5px 14px; border-radius: 4px; font-size: 12.5px; }
.craft-tabs button.active, .shop-tabs button.active { border-color: var(--gold); color: var(--gold); background: rgba(212,175,55,.1); }
.recipe-row { display: flex; align-items: center; gap: 12px; padding: 8px 12px; background: rgba(255,255,255,.03);
  border-radius: 5px; margin-bottom: 6px; }
.recipe-row .r-mats { font-size: 12.5px; color: var(--ink-dim); }
.recipe-row .r-mats .ok { color: #7ee787; } .recipe-row .r-mats .missing { color: #f85149; }
.prof-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.prof-row .prof-bar { flex: 1; height: 8px; background: rgba(0,0,0,.6); border-radius: 4px; overflow: hidden; }
.prof-row .prof-fill { height: 100%; background: var(--gold); border-radius: 4px; }

/* Loja do Véu */
.cosmetic-card { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; width: 148px;
  padding: 14px 10px; margin: 5px; background: rgba(255,255,255,.03); border: 1px solid rgba(180,143,255,.25);
  border-radius: 7px; text-align: center; vertical-align: top; }
.cosmetic-card:hover { border-color: #b48fff; box-shadow: 0 0 14px rgba(180,143,255,.25); }
.cosmetic-card .cos-name { font-family: 'Cinzel', serif; font-size: 13px; color: var(--parchment); }
.cosmetic-card .cos-price { color: #b48fff; font-weight: 700; }
.cosmetic-card.owned { border-color: rgba(63,185,80,.4); }
.cosmetic-card.equipped { border-color: var(--gold); box-shadow: 0 0 12px rgba(212,175,55,.35); }

/* Diálogo */
#dialogue { position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%); width: 600px; max-width: 92vw;
  padding: 16px 22px; z-index: 25; }
#dialogue-name { font-family: 'Cinzel', serif; color: var(--gold); font-size: 16px; letter-spacing: 1px; margin-bottom: 6px; }
#dialogue-text { font-size: 15px; line-height: 1.55; font-style: italic; color: var(--parchment); margin-bottom: 12px; }
#dialogue-options { display: flex; flex-direction: column; gap: 5px; }
#dialogue-options button { text-align: left; background: rgba(255,255,255,.04); border: 1px solid rgba(212,175,55,.2);
  color: var(--ink); padding: 7px 14px; border-radius: 4px; font-family: 'Crimson Pro', serif; font-size: 14.5px; transition: all .12s; }
#dialogue-options button:hover { border-color: var(--gold); color: var(--gold); padding-left: 20px; }

/* ============ TELA DE MORTE ============ */
#death-screen { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: radial-gradient(circle, rgba(60,5,10,.55), rgba(5,2,4,.96)); animation: deathIn 1.4s ease-out; }
@keyframes deathIn { from { opacity: 0; backdrop-filter: blur(0);} to { opacity: 1; } }
#death-screen h1 { font-family: 'Cinzel', serif; font-size: 64px; font-weight: 900; color: #a32533;
  text-shadow: 0 0 40px rgba(216,67,79,.6), 0 4px 8px #000; letter-spacing: 10px; }
#death-screen .quote { font-style: italic; color: var(--ink-dim); font-size: 17px; }
#death-losses { color: #e8a8a8; font-size: 15px; text-align: center; line-height: 1.7; min-height: 24px; }
#btn-respawn { margin-top: 12px; padding: 13px 40px; font-size: 17px; background: linear-gradient(180deg, #3a1418, #1c0a0c);
  border: 1px solid #8c2f38; color: #e8a8a8; border-radius: 5px; letter-spacing: 1px; transition: all .2s; }
#btn-respawn:hover { border-color: #e85560; color: #fff; box-shadow: 0 0 24px rgba(216,67,79,.4); }

/* ============ MENU PRINCIPAL ============ */
/* flex COLUNA + margin:auto no eixo principal = centraliza quando cabe e ROLA (sem cortar
   o botão de baixo) quando o conteúdo é mais alto que a tela. -webkit-overflow-scrolling
   suaviza no trackpad/touch. */
#main-menu { position: fixed; inset: 0; z-index: 100; background: #07060a; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; overflow-y: auto; -webkit-overflow-scrolling: touch; }
#menu-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#menu-content { position: relative; text-align: center; max-width: 640px; width: 100%; padding: 24px 20px 64px; margin: auto 0; flex: 0 0 auto; }
#main-menu.creating #game-title { font-size: 30px; letter-spacing: 5px; margin: 4px 0 0; }
#main-menu.creating #game-title span { font-size: 20px; }
#main-menu.creating > #menu-content > .quote { display: none; }
#game-title { font-family: 'Cinzel', serif; font-size: 76px; font-weight: 900; color: var(--parchment);
  letter-spacing: 10px; line-height: 1.05;
  text-shadow: 0 0 24px rgba(212,175,55,.35), 0 0 80px rgba(120,80,200,.3), 0 4px 10px #000;
  animation: titleGlow 4s ease-in-out infinite alternate; }
#game-title span { color: var(--gold); font-size: 42px; letter-spacing: 6px; }
@keyframes titleGlow { from { text-shadow: 0 0 24px rgba(212,175,55,.3), 0 0 80px rgba(120,80,200,.25), 0 4px 10px #000; }
  to { text-shadow: 0 0 40px rgba(212,175,55,.55), 0 0 110px rgba(120,80,200,.45), 0 4px 10px #000; } }
#main-menu .quote { font-style: italic; color: var(--ink-dim); font-size: 18px; margin: 14px 0 34px; letter-spacing: 1px; }
#menu-buttons-main { display: flex; flex-direction: column; gap: 12px; align-items: center; }
#menu-buttons-main button, #btn-start { width: 320px; padding: 14px 0; font-size: 17px; letter-spacing: 2px;
  background: linear-gradient(180deg, rgba(45,38,22,.9), rgba(20,17,10,.95));
  border: 1px solid var(--gold-dim); color: var(--parchment); border-radius: 4px; transition: all .25s; }
#menu-buttons-main button:hover, #btn-start:hover { border-color: var(--gold); color: var(--gold);
  box-shadow: 0 0 28px rgba(212,175,55,.35); letter-spacing: 3px; }
#menu-footer { margin-top: 38px; font-size: 13px; color: #4a4540; font-style: italic; letter-spacing: 1px; }

/* Conta no servidor (login + save na nuvem) */
#account-box { display: flex; flex-direction: column; gap: 9px; align-items: center; width: 320px;
  margin: 0 auto 4px; padding: 16px 16px 12px; border: 1px solid var(--gold-dim); border-radius: 6px;
  background: linear-gradient(180deg, rgba(30,26,16,.5), rgba(12,10,7,.6)); }
#account-box input { width: 100%; padding: 10px 14px; font-size: 15px; text-align: center; box-sizing: border-box;
  background: rgba(0,0,0,.6); border: 1px solid var(--gold-dim); border-radius: 4px; color: var(--parchment); outline: none; }
#account-box input:focus { border-color: var(--gold); box-shadow: 0 0 12px rgba(212,175,55,.22); }
#account-buttons, .acc-btn-row { display: flex; gap: 8px; width: 100%; }
#account-buttons button, .acc-btn-row button { flex: 1; padding: 10px 0; font-size: 14px; letter-spacing: 1px; cursor: pointer;
  background: linear-gradient(180deg, rgba(45,38,22,.9), rgba(20,17,10,.95));
  border: 1px solid var(--gold-dim); color: var(--parchment); border-radius: 4px; transition: all .2s; }
#account-buttons button:hover, .acc-btn-row button:hover { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 18px rgba(212,175,55,.3); }
#account-buttons button:disabled, .acc-btn-row button:disabled { opacity: .5; cursor: default; box-shadow: none; }

/* Recuperação de conta (frase) */
#recovery-form, #recovery-show { display: flex; flex-direction: column; gap: 9px; align-items: center; width: 320px;
  margin: 0 auto 4px; padding: 16px; border: 1px solid var(--gold-dim); border-radius: 6px;
  background: linear-gradient(180deg, rgba(30,26,16,.5), rgba(12,10,7,.6)); }
#recovery-form h3, #recovery-show h3 { font-family: 'Cinzel', serif; color: var(--gold); font-size: 17px; letter-spacing: 2px; margin: 0 0 4px; }
#recovery-form input { width: 100%; padding: 10px 14px; font-size: 15px; text-align: center; box-sizing: border-box;
  background: rgba(0,0,0,.6); border: 1px solid var(--gold-dim); border-radius: 4px; color: var(--parchment); outline: none; }
#recovery-form input:focus { border-color: var(--gold); box-shadow: 0 0 12px rgba(212,175,55,.22); }
#recovery-msg { margin: 0; font-size: 13px; color: #e0a0a0; }
.rec-warn { margin: 0; font-size: 12px; color: var(--ink-dim); line-height: 1.4; }
#recovery-code { display: block; width: 100%; box-sizing: border-box; padding: 12px 8px; user-select: all; cursor: text;
  font-family: 'Courier New', monospace; font-size: 17px; font-weight: 700; letter-spacing: 2px; text-align: center;
  color: var(--gold); background: rgba(0,0,0,.55); border: 1px dashed var(--gold-dim); border-radius: 4px; word-break: break-all; }
#account-msg { margin: 0; font-size: 13px; color: #e0a0a0; }
.acc-status { margin: 0; font-size: 12px; color: var(--ink-dim); font-style: italic; line-height: 1.35; }
.link-ghost { background: none; border: none; color: var(--ink-dim); font-size: 12px; text-decoration: underline;
  cursor: pointer; padding: 2px; letter-spacing: .4px; }
.link-ghost:hover { color: var(--gold); }

/* Paginação / compra de páginas do inventário */
.inv-pager { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.inv-pg-btn { padding: 5px 12px; border-radius: 4px; border: 1px solid var(--gold-dim);
  background: rgba(212,175,55,.12); color: var(--parchment); cursor: pointer; font-size: 14px; }
.inv-pg-btn:hover:not(:disabled) { border-color: var(--gold); color: var(--gold); }
.inv-pg-btn:disabled { opacity: .35; cursor: default; }
.inv-pg-lbl { font-size: 13px; color: var(--ink-dim); min-width: 92px; text-align: center; }
.inv-buy-btn { margin-left: auto; padding: 6px 14px; border-radius: 4px; border: 1px solid var(--gold-dim);
  background: linear-gradient(180deg, rgba(60,40,90,.5), rgba(20,17,30,.75)); color: #d6b8ff; cursor: pointer; font-size: 13px; }
.inv-buy-btn:hover { border-color: var(--gold); color: var(--gold); }
.inv-pg-max { margin-left: auto; font-size: 12px; color: var(--ink-dim); font-style: italic; }
.inv-cell.inv-empty { opacity: .25; cursor: default; }

/* Banner "nova versão disponível" (deploy) */
#update-banner { position: fixed; top: 0; left: 50%; transform: translateX(-50%); z-index: 300;
  background: linear-gradient(180deg, rgba(45,38,22,.97), rgba(20,17,10,.98)); border: 1px solid var(--gold);
  border-top: none; border-radius: 0 0 8px 8px; padding: 9px 18px; color: var(--parchment); font-size: 14px;
  box-shadow: 0 6px 24px rgba(0,0,0,.5); letter-spacing: .4px; }
#update-banner button { margin-left: 10px; padding: 5px 13px; cursor: pointer; border-radius: 4px;
  border: 1px solid var(--gold-dim); background: rgba(212,175,55,.16); color: var(--gold); font-size: 13px; }
#update-banner button:hover { background: rgba(212,175,55,.32); border-color: var(--gold); }

/* Seleção de personagem (múltiplos por conta) */
#char-select { animation: winIn .3s ease-out; }
#char-select h2 { font-family: 'Cinzel', serif; color: var(--gold); letter-spacing: 3px; margin-bottom: 16px; font-size: 24px; }
#char-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 620px; margin: 0 auto; }
.char-card { width: 188px; padding: 14px 12px; border: 1px solid var(--gold-dim); border-radius: 6px;
  background: linear-gradient(180deg, rgba(30,26,16,.55), rgba(12,10,7,.7)); transition: border-color .2s, box-shadow .2s; }
.char-card:hover { border-color: var(--gold); box-shadow: 0 0 22px rgba(212,175,55,.22); }
.char-card .cc-name { font-family: 'Cinzel', serif; font-size: 18px; color: var(--parchment); margin-bottom: 4px; }
.char-card .cc-meta { font-size: 13px; color: var(--ink-dim); }
.char-card .cc-gold { color: #d9b25a; margin-top: 2px; }
.char-card .cc-actions { display: flex; gap: 8px; margin-top: 12px; }
.char-card .cc-actions button { flex: 1; padding: 8px 0; font-size: 13px; cursor: pointer; border-radius: 4px;
  border: 1px solid var(--gold-dim); color: var(--parchment); background: linear-gradient(180deg, rgba(45,38,22,.9), rgba(20,17,10,.95)); transition: all .2s; }
.char-card .cc-actions button:hover { border-color: var(--gold); color: var(--gold); }
.char-card .cc-actions .cc-del { border-color: #8c5050; color: #d88; }
.char-card .cc-actions .cc-del:hover { border-color: #d88; color: #f0a0a0; }
#char-select-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; align-items: center; }
#btn-char-new { width: 320px; padding: 12px 0; font-size: 15px; letter-spacing: 2px; cursor: pointer; border-radius: 4px;
  background: linear-gradient(180deg, rgba(45,38,22,.9), rgba(20,17,10,.95)); border: 1px solid var(--gold-dim); color: var(--parchment); transition: all .25s; }
#btn-char-new:hover { border-color: var(--gold); color: var(--gold); box-shadow: 0 0 24px rgba(212,175,55,.3); }

#charcreate { animation: winIn .3s ease-out; }
#charcreate h2 { font-family: 'Cinzel', serif; color: var(--gold); letter-spacing: 3px; margin-bottom: 16px; font-size: 24px; }
#cc-name { display: block; margin: 0 auto 16px; width: 320px; padding: 11px 16px; font-size: 17px; text-align: center;
  background: rgba(0,0,0,.6); border: 1px solid var(--gold-dim); border-radius: 4px; color: var(--parchment); outline: none; }
#cc-name:focus { border-color: var(--gold); box-shadow: 0 0 14px rgba(212,175,55,.25); }
#cc-layout { display: flex; gap: 20px; justify-content: center; align-items: flex-start; }
#cc-preview { background: radial-gradient(circle at 50% 70%, rgba(60,50,90,.25), rgba(0,0,0,.4));
  border: 1px solid rgba(212,175,55,.25); border-radius: 6px; }
#cc-attrs { display: flex; flex-direction: column; gap: 3px; width: 280px; text-align: left; }
#cc-attrs .attr-row { background: rgba(0,0,0,.35); border-radius: 4px; border: none; padding: 6px 12px; }
#cc-attrs .attr-minus { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #8c5050; background: rgba(140,80,80,.12);
  color: #d88; font-size: 15px; line-height: 1; }
#cc-points { margin: 14px 0 4px; color: var(--gold); font-size: 16px; font-weight: 600; }
.cc-hint { font-size: 13px; color: var(--ink-dim); font-style: italic; margin-bottom: 16px; }

/* Arquétipos (criação de personagem) */
#cc-archetypes { margin: 10px auto 4px; max-width: 620px; }
.cc-arch-intro { font-size: 13px; color: var(--ink-dim); margin-bottom: 10px; }
.cc-arch-intro b { color: var(--gold); }
#cc-arch-cards { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.cc-arch-card { width: 132px; padding: 9px 8px; background: rgba(255,255,255,.03); border: 1px solid rgba(212,175,55,.22);
  border-radius: 7px; cursor: pointer; transition: all .15s; text-align: center; }
.cc-arch-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.cc-arch-card.sel { border-color: var(--gold); background: rgba(212,175,55,.1); box-shadow: 0 0 14px rgba(212,175,55,.28); }
.cc-arch-card .ca-icon { font-size: 24px; }
.cc-arch-card .ca-name { font-family: 'Cinzel', serif; font-size: 14px; color: var(--parchment); margin-top: 2px; }
.cc-arch-card .ca-attr { font-size: 11px; color: #8fa8c8; margin-top: 2px; }
#cc-arch-detail { margin: 12px auto 0; max-width: 560px; padding: 11px 16px; text-align: left;
  background: rgba(8,7,12,.6); border-left: 2px solid var(--gold-dim); border-radius: 0 5px 5px 0; animation: winIn .2s ease-out; }
#cc-arch-detail .cad-title { font-family: 'Cinzel', serif; color: var(--gold); font-size: 16px; display: flex; align-items: center; gap: 8px; }
#cc-arch-detail .cad-become { color: #d8c878; font-style: italic; font-size: 12.5px; margin: 2px 0 8px; }
#cc-arch-detail .cad-row { font-size: 13px; margin: 3px 0; }
#cc-arch-detail .cad-row b { color: var(--parchment); font-family: 'Cinzel', serif; font-weight: 500; }
#cc-arch-detail .cad-desc { font-size: 13px; color: var(--ink-dim); font-style: italic; margin-top: 7px; }
#cc-arch-detail .cad-clear { float: right; background: none; border: 1px solid rgba(212,175,55,.3); color: var(--ink-dim);
  width: 22px; height: 22px; border-radius: 4px; font-size: 12px; }
#cc-arch-detail .cad-clear:hover { color: #e85560; border-color: #e85560; }

/* Mapa */
.win-map { width: 900px; }
#world-map-canvas { width: 100%; aspect-ratio: 2 / 1; max-height: 54vh; border-radius: 5px; border: 1px solid rgba(212,175,55,.25);
  background: #0a0810; cursor: crosshair; display: block; }
.map-celestial { margin-top: 10px; display: flex; align-items: baseline; gap: 10px; color: var(--ink-dim); font-size: 13px; }
.map-celestial span { color: var(--gold); font-family: 'Cinzel', serif; letter-spacing: 1px; }
.map-celestial b { color: var(--parchment); font-size: 15px; }
.map-celestial small { color: #7f7a8a; }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; color: var(--ink-dim); }
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.map-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; border: 1px solid rgba(0,0,0,.6); }
.leg-player { background: #fff; box-shadow: 0 0 0 1px #ffd700; }
.leg-city { background: #ffd700; }
.leg-portal { background: #9fd4ff; }
.leg-dungeon { background: #7dff7a; border-radius: 2px !important; }
.leg-locked { background: #55515d; }
.leg-boss { background: #bc8cff; }
.map-teleports { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.map-dest { min-height: 118px; padding: 10px; border-radius: 6px; border: 1px solid rgba(159,212,255,.28);
  background: rgba(8,7,12,.62); display: flex; flex-direction: column; gap: 6px; }
.map-dest.protected { border-color: rgba(212,175,55,.45); background: rgba(35,28,12,.56); }
.map-dest.locked { border-color: rgba(255,255,255,.08); background: rgba(0,0,0,.32); }
.map-dest-head { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.map-dest-head span { color: var(--parchment); font-family: 'Cinzel', serif; font-size: 13px; line-height: 1.25; }
.map-dest-head small { color: var(--gold); font-size: 10.5px; text-transform: uppercase; letter-spacing: .8px; text-align: left; }
.map-dest-zone, .map-dest-note { color: var(--ink-dim); font-size: 12px; line-height: 1.35; }
.map-dest-note { flex: 1; }
.map-dest .btn { align-self: flex-start; }

/* Misc */
.section-title { font-family: 'Cinzel', serif; font-size: 14px; color: var(--gold); letter-spacing: 1.5px;
  margin: 14px 0 8px; border-bottom: 1px solid rgba(212,175,55,.18); padding-bottom: 4px; }
.muted { color: var(--ink-dim); font-size: 13px; }
.gold-text { color: var(--gold); } .frag-text { color: #b48fff; }
.rep-honrado { color: #7ee787; } .rep-suspeito { color: #e3b341; } .rep-criminoso { color: #f85149; } .rep-amaldicoado { color: #bc8cff; }
.flex-row { display: flex; gap: 12px; align-items: center; }
.spacer { flex: 1; }

/* ============ CHAT MULTIPLAYER ============ */
#chat { position: absolute; bottom: 236px; left: 16px; width: 340px; display: flex; flex-direction: column; gap: 4px; }
#chat-messages { display: flex; flex-direction: column; gap: 2px; max-height: 160px; overflow: hidden; pointer-events: none; }
.chat-line { font-size: 13.5px; padding: 1px 8px; background: rgba(0,0,0,.5); border-radius: 3px;
  text-shadow: 0 1px 2px #000; animation: logIn .2s ease-out; line-height: 1.45; }
.chat-line .chat-name { color: var(--gold); font-weight: 600; }
.chat-line.system { color: #8fa8c8; font-style: italic; }
#chat-input { width: 100%; padding: 6px 10px; background: rgba(8,7,12,.92); border: 1px solid var(--gold-dim);
  border-radius: 4px; color: var(--parchment); font-size: 14px; outline: none; }
#chat-input:focus { border-color: var(--gold); box-shadow: 0 0 10px rgba(212,175,55,.2); }
#net-status { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); font-size: 11.5px;
  color: #7ee787; background: rgba(0,0,0,.55); padding: 1px 12px; border-radius: 9px;
  border: 1px solid rgba(126,231,135,.3); }
#net-status.off { display: none; }

@media (max-width: 900px) {
  #game-title { font-size: 52px; }
  .window { width: 96vw; }
  #log-feed { width: 260px; }
}
