:root {
  --gold: #c9a227;
  --gold2: #ecd08a;
  --panel: rgba(18, 14, 10, 0.96);
  --border: #5c4526;
  --text: #d8cdb8;
  --dim: #8b7f6c;
  --r0: #e6e6e6;
  --r1: #7f9cff;
  --r2: #ffdc4f;
  --r3: #ff8f26;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%; overflow: hidden;
  background: #000; color: var(--text);
  font-family: 'Crimson Text', Georgia, serif;
  user-select: none; -webkit-user-select: none;
}

canvas#game { position: fixed; inset: 0; display: block; }

#ui { position: fixed; inset: 0; pointer-events: none; }
.hidden { display: none !important; }

button {
  font-family: 'Cinzel', serif; color: var(--gold2); cursor: pointer;
  background: linear-gradient(#2c2117, #17110b); border: 1px solid var(--border);
  padding: 4px 10px; font-size: 12px; letter-spacing: .5px;
}
button:hover { border-color: var(--gold); color: #fff; }
button.big { font-size: 20px; padding: 12px 40px; }
button.wide { width: 100%; margin-top: 10px; padding: 8px; }

/* ---------- Banner / log ---------- */
#areaBanner {
  position: absolute; top: 14%; left: 0; right: 0; text-align: center;
  font-family: 'Cinzel', serif; font-size: 40px; font-weight: 700; color: var(--gold2);
  text-shadow: 0 0 20px #000, 0 2px 4px #000; opacity: 0; transition: opacity 1s;
  letter-spacing: 3px;
}
#areaBanner.show { opacity: 1; }

#log {
  position: absolute; left: 16px; bottom: 150px; width: 420px;
  font-size: 16px; text-shadow: 0 1px 3px #000, 0 0 6px #000;
}
#log div { transition: opacity .8s; margin-top: 2px; }

#depthInfo {
  position: absolute; top: 170px; right: 16px; width: 220px; text-align: center;
  font-family: 'Cinzel', serif; font-size: 13px; color: var(--gold2); text-shadow: 0 1px 3px #000;
}

#minimap {
  position: absolute; top: 16px; right: 16px; border: 1px solid var(--border);
  background: rgba(0, 0, 0, .55); pointer-events: none;
}

/* ---------- Target bar ---------- */
#targetBar {
  position: absolute; top: 16px; left: 50%; transform: translateX(-50%);
  width: 360px; text-align: center; text-shadow: 0 1px 3px #000;
}
#targetName { font-family: 'Cinzel', serif; font-size: 17px; font-weight: 700; }
#targetHp { height: 14px; border: 1px solid #3a1a12; background: #1a0806; margin-top: 3px; }
#targetFill { height: 100%; background: linear-gradient(#c2271c, #6a0f0a); width: 100%; }
#targetSub { font-size: 13px; color: var(--dim); }

/* ---------- HUD ---------- */
#hud {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  display: flex; align-items: flex-end; gap: 14px; pointer-events: auto; padding-bottom: 8px;
}
.orb {
  position: relative; width: 124px; height: 124px; border-radius: 50%; overflow: hidden;
  border: 3px solid #4a3620; background: #0c0606;
  box-shadow: 0 0 0 2px #1a120a, 0 0 18px rgba(0,0,0,.9) inset, 0 4px 14px #000;
}
.orbFill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transition: height .15s; }
.life .orbFill { background: radial-gradient(circle at 40% 30%, #ff5a4a, #a3120c 45%, #4a0503 100%); }
.mana .orbFill { background: radial-gradient(circle at 40% 30%, #6a8cff, #1a32b8 45%, #070f45 100%); }
.orbGlass {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, rgba(255,255,255,.35), rgba(255,255,255,0) 35%),
              radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 60%, rgba(0,0,0,.6) 100%);
}
.orbText {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 14px; color: #fff;
  text-shadow: 0 1px 3px #000, 0 0 4px #000; opacity: 0; transition: opacity .2s;
}
.orb:hover .orbText { opacity: 1; }

#centerBar {
  background: linear-gradient(#1d150e, #0d0906); border: 2px solid #4a3620;
  padding: 6px 10px 6px; margin-bottom: 4px; box-shadow: 0 4px 14px #000;
}
#xpBar { position: relative; height: 10px; background: #0d0a06; border: 1px solid #3a2a16; margin-bottom: 6px; }
#xpFill { height: 100%; width: 0; background: linear-gradient(#e8c25a, #8c6a12); transition: width .3s; }
#xpText { position: absolute; inset: 0; font-size: 10px; line-height: 9px; text-align: center; color: #fff; text-shadow: 0 0 2px #000; opacity: 0; }
#xpBar:hover #xpText { opacity: 1; }

#skillBar { display: flex; gap: 5px; }
.sk {
  position: relative; width: 52px; height: 52px; border: 2px solid #4a3620; background: #120d08;
  display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer;
  overflow: hidden;
}
.sk:hover { border-color: var(--gold); }
.sk.selected { border-color: #ff7a2a; box-shadow: 0 0 8px #ff7a2a; }
.sk.locked { filter: grayscale(1) brightness(.4); }
.sk .key {
  position: absolute; left: 2px; top: 0; font-size: 11px; font-family: 'Cinzel', serif; color: var(--gold2);
  text-shadow: 0 0 2px #000;
}
.sk .cnt { position: absolute; right: 3px; bottom: 0; font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 0 3px #000; }
.sk .cd { position: absolute; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.7); height: 0; }
.sk .lockLvl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; font-family: 'Cinzel', serif; }
.sk.nomana { box-shadow: inset 0 0 14px #2a3cff; }
.sep { width: 8px; }

#menuBtns { display: flex; gap: 4px; margin-top: 6px; justify-content: center; }
#menuBtns button { font-size: 11px; padding: 3px 8px; }
#statAlert { color: #ffd84a; }

/* ---------- Panels ---------- */
.panel {
  position: absolute; top: 20px; background: var(--panel); border: 2px solid var(--border);
  box-shadow: 0 0 0 1px #000, 0 10px 40px #000; pointer-events: auto; padding: 0 14px 14px;
  max-height: calc(100vh - 190px); overflow-y: auto;
}
.panel.left { left: 20px; width: 360px; }
.panel.right { right: 20px; width: 420px; }
.panel.center { left: 50%; top: 80px; transform: translateX(-50%); width: 520px; }
.panelHead {
  font-family: 'Cinzel', serif; font-size: 18px; font-weight: 700; color: var(--gold2); text-align: center;
  padding: 10px 0; border-bottom: 1px solid var(--border); margin: 0 -14px 12px; position: relative;
  background: linear-gradient(#2a1e12, #160f09);
}
.close { position: absolute; right: 12px; top: 8px; cursor: pointer; color: var(--dim); font-size: 16px; }
.close:hover { color: #fff; }

/* Character */
.charTop { text-align: center; margin-bottom: 10px; }
.charTop .cname { font-family: 'Cinzel', serif; font-size: 20px; color: #fff; }
.charTop .clvl { color: var(--dim); }
.statRow { display: flex; justify-content: space-between; align-items: center; padding: 3px 4px; border-bottom: 1px solid #241a10; }
.statRow b { color: #fff; font-weight: 600; }
.statRow .plus { padding: 0 7px; font-size: 14px; margin-left: 8px; }
.statPts { text-align: center; color: #ffd84a; margin: 8px 0; font-family: 'Cinzel', serif; }
.statHead { font-family: 'Cinzel', serif; color: var(--gold); margin: 12px 0 4px; font-size: 14px; }

/* Equipment */
#equipGrid {
  display: grid; grid-template-columns: repeat(3, 60px); grid-template-rows: repeat(4, 60px); gap: 8px;
  justify-content: center; margin-bottom: 14px;
  grid-template-areas:
    "weapon helm amulet"
    "weapon chest gloves"
    "ring1 chest ring2"
    ". boots .";
}
.eslot, .icell {
  border: 1px solid #3e2e18; background: radial-gradient(#1b140c, #0b0805);
  display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer;
}
.eslot { font-size: 30px; }
.eslot:hover, .icell:hover { border-color: var(--gold); }
.eslot .ph { font-size: 10px; color: #4a3b26; font-family: 'Cinzel', serif; text-align: center; }
#invGrid { display: grid; grid-template-columns: repeat(10, 36px); grid-auto-rows: 36px; gap: 3px; justify-content: center; }
.icell { font-size: 22px; }
.item0 { box-shadow: inset 0 0 0 1px #555; }
.item1 { box-shadow: inset 0 0 0 1px #3d55c0, inset 0 0 10px rgba(80,110,255,.35); }
.item2 { box-shadow: inset 0 0 0 1px #b8a030, inset 0 0 10px rgba(255,220,80,.35); }
.item3 { box-shadow: inset 0 0 0 1px #d06a10, inset 0 0 14px rgba(255,140,30,.55); }
.unusable { background: radial-gradient(#4a0c0c, #1a0505) !important; }
#invFoot { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; align-items: center; }
#goldText { color: #ffd84a; font-family: 'Cinzel', serif; font-size: 16px; }
#goldText::before { content: '🪙 '; }
.hint { font-size: 12px; color: var(--dim); text-align: center; }

/* Shop */
.shopSection { font-family: 'Cinzel', serif; color: var(--gold); margin: 8px 0 6px; font-size: 14px; }
#shopPotions { display: flex; gap: 8px; }
#shopPotions button { flex: 1; font-family: 'Crimson Text', serif; font-size: 15px; padding: 6px; }
#shopGrid { display: grid; grid-template-columns: repeat(6, 48px); gap: 6px; justify-content: center; }
#shopGrid .icell { width: 48px; height: 48px; font-size: 26px; }
#shopGrid .price { position: absolute; bottom: -1px; right: 1px; font-size: 10px; color: #ffd84a; text-shadow: 0 0 2px #000; }

/* Waypoint */
.wpText { color: var(--dim); margin: 8px 0; text-align: center; }
#wpList { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
#wpList button { padding: 8px 4px; font-size: 13px; }

table.help { width: 100%; border-collapse: collapse; }
table.help td { padding: 5px; border-bottom: 1px solid #241a10; }
table.help td:first-child { color: var(--gold2); font-family: 'Cinzel', serif; font-size: 13px; white-space: nowrap; width: 150px; }
.r0 { color: var(--r0); } .r1 { color: var(--r1); } .r2 { color: var(--r2); } .r3 { color: var(--r3); }

/* Tooltip */
#tooltip {
  position: fixed; z-index: 50; pointer-events: none; display: flex; gap: 8px; align-items: flex-start;
}
.tip {
  background: rgba(8, 6, 4, .97); border: 1px solid #5c4526; padding: 10px 12px; width: 270px;
  box-shadow: 0 6px 20px #000; font-size: 15px; line-height: 1.3;
}
.tip .tname { font-family: 'Cinzel', serif; font-size: 16px; font-weight: 700; text-align: center; }
.tip .tbase { text-align: center; color: var(--dim); font-size: 14px; }
.tip .ttype { text-align: center; color: var(--dim); font-size: 13px; margin-bottom: 6px; }
.tip .tmain { color: #fff; text-align: center; font-size: 18px; margin: 4px 0; }
.tip .tline { color: var(--dim); text-align: center; font-size: 13px; }
.tip .aff { color: #8fa8ff; text-align: center; }
.tip.leg .aff { color: #ffb066; }
.tip .treq { text-align: center; margin-top: 6px; font-size: 13px; }
.tip .treq.bad { color: #ff4a3a; }
.tip .tval { text-align: center; color: #ffd84a; font-size: 13px; margin-top: 4px; }
.tip .tequip { font-family: 'Cinzel', serif; color: var(--dim); text-align: center; font-size: 11px; letter-spacing: 2px; margin-bottom: 4px; }
.tip .tdesc { color: var(--text); text-align: center; font-size: 14px; margin-top: 4px; }
.tip .up { color: #5cff6a; } .tip .down { color: #ff5a4a; }
.tip .tcmp { text-align: center; font-size: 13px; margin-top: 6px; border-top: 1px solid #2a2014; padding-top: 4px; }

#vignette {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(circle, rgba(0,0,0,0) 45%, rgba(160,0,0,.55) 100%);
}

/* ---------- Start / Death ---------- */
#startScreen, #deathScreen {
  position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at center, #2a0c08 0%, #0a0503 55%, #000 100%); z-index: 100;
}
#deathScreen { background: rgba(30, 0, 0, .75); }
#startScreen h1, #deathScreen h1 {
  font-family: 'Cinzel', serif; font-weight: 900; font-size: 64px; color: #c8341f;
  text-shadow: 0 0 30px #7a0d00, 0 4px 8px #000; letter-spacing: 4px; text-align: center;
}
#startScreen h2 { font-family: 'Cinzel', serif; color: var(--dim); font-weight: 400; letter-spacing: 6px; margin-bottom: 30px; }
#deathScreen p { margin: 14px 0 24px; font-size: 18px; }
#continueBox { text-align: center; margin-bottom: 24px; }
#continueInfo { color: var(--dim); margin-top: 6px; }
.chooseTitle { font-family: 'Cinzel', serif; color: var(--gold); letter-spacing: 3px; margin-bottom: 14px; }
#classCards { display: flex; gap: 18px; flex-wrap: wrap; justify-content: center; padding: 0 16px; }
.ccard {
  width: 230px; padding: 18px; border: 2px solid var(--border); background: linear-gradient(#1f160e, #0e0a06);
  cursor: pointer; text-align: center; transition: transform .15s, border-color .15s;
}
.ccard:hover { transform: translateY(-4px); border-color: var(--gold); box-shadow: 0 0 24px rgba(201,162,39,.25); }
.ccard .cicon { font-size: 48px; }
.ccard .ctitle { font-family: 'Cinzel', serif; font-size: 22px; color: var(--gold2); margin: 6px 0; }
.ccard .cdesc { font-size: 15px; color: var(--text); min-height: 80px; }
.ccard .cskills { font-size: 13px; color: var(--dim); margin-top: 8px; }

@media (max-width: 900px) {
  .orb { width: 84px; height: 84px; }
  .sk { width: 40px; height: 40px; font-size: 20px; }
  #minimap { width: 150px; height: 102px; }
  #startScreen h1 { font-size: 40px; }
  .panel.left, .panel.right, .panel.center { left: 8px; right: 8px; width: auto; transform: none; }
}

/* =====================================================================
   VISUAL APRIMORADO
   ===================================================================== */
.panel {
  background:
    radial-gradient(ellipse at top, rgba(90,60,30,.18), transparent 60%),
    repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 2px, transparent 2px 6px),
    linear-gradient(#17110b, #0d0905);
  border: 1px solid #000;
  box-shadow: 0 0 0 2px #4a3620, 0 0 0 3px #000, 0 0 0 4px #7a5a2a, 0 14px 50px #000, inset 0 0 40px rgba(0,0,0,.8);
}
.panelHead {
  background: linear-gradient(#3a2a18, #1a120a);
  border-bottom: 1px solid #7a5a2a;
  text-shadow: 0 0 10px rgba(255,200,100,.35), 0 2px 2px #000;
}
.panelHead::before, .panelHead::after { content: '❖'; color: #7a5a2a; margin: 0 10px; font-size: 12px; vertical-align: middle; }
.panel.right { width: 470px; }

.icell img, .eslot img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; filter: drop-shadow(0 2px 2px #000); }
.icell, .eslot {
  background: radial-gradient(circle at 50% 40%, #241a10, #0a0704 75%);
  border: 1px solid #2e2214;
  box-shadow: inset 0 0 8px #000;
}
#invGrid { grid-template-columns: repeat(10, 42px); grid-auto-rows: 42px; gap: 2px; }
#equipGrid { grid-template-columns: repeat(3, 70px); grid-template-rows: repeat(4, 70px); }
.eslot { padding: 4px; }
.icell { padding: 2px; }
.item0 { box-shadow: inset 0 0 8px #000, inset 0 0 0 1px #4a4a4a; }
.item1 { box-shadow: inset 0 0 0 1px #3d55c0, inset 0 0 14px rgba(80,110,255,.4); background: radial-gradient(circle, #141a3a, #07080f 75%); }
.item2 { box-shadow: inset 0 0 0 1px #b8a030, inset 0 0 14px rgba(255,220,80,.4); background: radial-gradient(circle, #2e2610, #0c0a04 75%); }
.item3 { box-shadow: inset 0 0 0 1px #e07a10, inset 0 0 18px rgba(255,140,30,.6); background: radial-gradient(circle, #3a1e08, #100804 75%); animation: legGlow 2s ease-in-out infinite; }
@keyframes legGlow { 50% { box-shadow: inset 0 0 0 1px #ffb050, inset 0 0 22px rgba(255,160,50,.85); } }
#shopGrid .icell { width: 52px; height: 52px; }

/* tooltip */
.tip { border: 1px solid #5c4526; box-shadow: 0 0 0 1px #000, 0 8px 24px #000; background: linear-gradient(rgba(14,10,7,.98), rgba(6,4,3,.98)); }
.tip.r1tip { border-color: #3d55c0; }
.tip.r2tip { border-color: #b8a030; }
.tip.r3tip { border-color: #e07a10; box-shadow: 0 0 18px rgba(255,140,30,.35), 0 8px 24px #000; }
.tip .ticon { text-align: center; margin: -2px 0 4px; }
.tip .ticon img { width: 64px; height: 64px; filter: drop-shadow(0 3px 4px #000); }
.tip.r3tip .aff { color: #ffb066; }
.tip .aff.special { color: #ffd84a; font-weight: 600; }
.tip .tflavor { color: #c87a30; font-style: italic; text-align: center; margin-top: 6px; font-size: 14px; }
.tip .tdesc b { color: #fff; }

/* barra de habilidades */
.sk { border: 2px solid #5a4426; box-shadow: inset 0 0 10px #000, 0 0 0 1px #000; }
.sk .skIcon { filter: drop-shadow(0 2px 2px #000); }
.sk .rank { position: absolute; right: 2px; top: 0; font-size: 11px; color: #9fe88a; font-family: 'Cinzel', serif; text-shadow: 0 0 3px #000; }
.potion { display: inline-block; width: 22px; height: 26px; position: relative; }
.potion::before { content: ''; position: absolute; left: 1px; right: 1px; bottom: 0; height: 20px; border-radius: 50%; border: 1px solid #000; }
.potion::after { content: ''; position: absolute; left: 7px; width: 8px; top: 0; height: 8px; background: linear-gradient(#8a5a30 0 35%, #c8d8e0 35%); border: 1px solid #000; }
.potion.hp::before { background: radial-gradient(circle at 35% 30%, #ffb0a0, #e02020 45%, #4a0505); }
.potion.mp::before { background: radial-gradient(circle at 35% 30%, #b0c8ff, #2050e0 45%, #050a4a); }

/* botões de subir de nível */
#levelUpBtns { position: absolute; left: 50%; bottom: 140px; transform: translateX(-50%); display: flex; gap: 10px; pointer-events: auto; }
.lu {
  font-size: 13px; padding: 6px 14px; color: #fff3c0; border: 1px solid #ffd84a;
  background: linear-gradient(#6a4a10, #2a1a06); box-shadow: 0 0 14px rgba(255,200,60,.5);
  animation: luPulse 1.4s ease-in-out infinite;
}
@keyframes luPulse { 50% { box-shadow: 0 0 26px rgba(255,200,60,.9); transform: translateY(-2px); } }

/* painel de habilidades */
.statPts.none { color: var(--dim); font-size: 13px; }
.skRow { display: flex; gap: 10px; align-items: center; padding: 8px 4px; border-bottom: 1px solid #241a10; }
.skRow.unlearned { opacity: .7; }
.skBig { width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center; font-size: 28px; border: 2px solid #5a4426; box-shadow: inset 0 0 10px #000; }
.skRow.unlearned .skBig { filter: grayscale(.8) brightness(.6); }
.skInfo { flex: 1; min-width: 0; }
.skName { font-family: 'Cinzel', serif; color: #ecd08a; font-size: 14px; }
.skRank { font-family: 'Crimson Text', serif; color: #9fe88a; font-size: 13px; margin-left: 4px; }
.skDesc { font-size: 14px; line-height: 1.25; }
.skDesc b { color: #fff; }
.skMeta { font-size: 12px; color: var(--dim); }
.skBar { height: 4px; background: #120c06; border: 1px solid #2e2214; margin-top: 3px; }
.skBar div { height: 100%; background: linear-gradient(90deg, #8a6a12, #ffd84a); }
.plus.big { font-size: 18px; padding: 4px 11px; }
.plus:disabled { opacity: .25; cursor: default; }
.statRow .plus { color: #ffd84a; border-color: #8a6a20; }

/* HUD */
#centerBar {
  background: linear-gradient(#2a1e12, #0e0a06);
  box-shadow: 0 0 0 1px #000, 0 0 0 3px #4a3620, 0 0 0 4px #000, 0 6px 20px #000;
  border: none;
}
.orb { border: 3px solid #6a4e28; box-shadow: 0 0 0 2px #000, 0 0 0 5px #3a2a16, 0 0 0 6px #000, 0 0 22px rgba(0,0,0,.9) inset, 0 6px 18px #000; }

#menuBtns button { white-space: nowrap; }

/* =====================================================================
   ÁRVORE DE HABILIDADES, BUFFS E POLIMENTO DO HUD
   ===================================================================== */
#skillPanel { width: 460px; }
.tree { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 6px 0 10px; }
.branch { display: flex; flex-direction: column; align-items: center; padding: 6px 0 8px;
  background: linear-gradient(rgba(60,40,20,.25), rgba(0,0,0,.2)); border: 1px solid #2e2214; }
.brHead { font-family: 'Cinzel', serif; color: #ecd08a; font-size: 13px; margin-bottom: 8px; text-align: center; }
.brHead small { color: #9fe88a; margin-left: 2px; }
.link { width: 4px; height: 16px; background: #2a2016; border-left: 1px solid #000; border-right: 1px solid #000; }
.link.on { background: linear-gradient(#ffd84a, #b08a20); box-shadow: 0 0 6px rgba(255,200,60,.6); }
.node {
  position: relative; width: 58px; height: 58px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; font-size: 28px;
  background: radial-gradient(circle at 40% 35%, var(--c1), var(--c2) 70%, #0a0704);
  border: 2px solid #4a3620; box-shadow: inset 0 0 12px #000, 0 0 0 1px #000;
  transition: transform .1s, box-shadow .15s;
}
.node.passive { border-radius: 50%; }
.node:hover { transform: scale(1.06); border-color: #c9a227; }
.node.locked { filter: grayscale(1) brightness(.4); }
.node.avail { box-shadow: inset 0 0 12px #000, 0 0 10px rgba(255,216,74,.55); border-color: #8a6a20; animation: nodePulse 1.6s ease-in-out infinite; }
.node.learned { border-color: #c9a227; }
.node.sel { outline: 2px solid #fff3c0; outline-offset: 2px; }
@keyframes nodePulse { 50% { box-shadow: inset 0 0 12px #000, 0 0 18px rgba(255,216,74,.9); } }
.nIcon { filter: drop-shadow(0 2px 2px #000); }
.nRank { position: absolute; bottom: -2px; right: -2px; font-size: 10px; font-family: 'Cinzel', serif; background: #0a0704; border: 1px solid #4a3620; padding: 0 3px; color: #9fe88a; }
.node.passive .nRank { bottom: -4px; right: -6px; }
.nLvl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-family: 'Cinzel', serif; color: #fff; text-shadow: 0 0 3px #000; }
.nPlus { position: absolute; top: -8px; right: -8px; width: 20px; height: 20px; padding: 0; font-size: 15px; line-height: 16px;
  border-radius: 50%; color: #1a1208; background: radial-gradient(#fff0a0, #c9a227); border: 1px solid #000; box-shadow: 0 0 8px rgba(255,216,74,.9); }
.nPlus:hover { color: #000; background: #fff; }
.skDetail { border-top: 1px solid #3a2a16; padding-top: 8px; }
.bindRow { margin-top: 8px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--dim); }
.bindRow button { padding: 3px 9px; font-size: 12px; }
.bindRow button.on { border-color: #ffd84a; color: #fff; background: linear-gradient(#6a4a10, #2a1a06); }
.tip.mini { width: auto; margin-top: 4px; font-size: 12px; color: var(--dim); padding: 4px 8px; }

.sk.empty { background: repeating-linear-gradient(45deg, #120d08 0 4px, #0c0905 4px 8px); }
.sk.offhand { box-shadow: inset 0 0 10px #000, 0 0 0 1px #000, inset 0 0 0 2px rgba(255,90,60,.6); }

#buffBar { position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(100% + 8px); display: flex; gap: 4px; pointer-events: none; }
.buff { position: relative; width: 30px; height: 30px; font-size: 17px; display: flex; align-items: center; justify-content: center;
  border: 1px solid #c9a227; background: radial-gradient(circle, var(--c), #0a0704 80%); box-shadow: 0 0 8px var(--c); }
.buff span { position: absolute; bottom: -2px; right: 1px; font-size: 10px; color: #fff; text-shadow: 0 0 2px #000, 0 0 2px #000; font-family: 'Cinzel', serif; }
#centerBar { position: relative; }

/* orbes: superfície do líquido ondulando */
.orbFill { overflow: hidden; }
.orbFill::before {
  content: ''; position: absolute; left: -50%; top: -6px; width: 200%; height: 12px;
  background: radial-gradient(ellipse at 25% 100%, rgba(255,255,255,.35) 0 30%, transparent 32%) 0 0 / 50% 100% repeat-x;
  animation: orbWave 3s linear infinite; opacity: .7;
}
@keyframes orbWave { to { transform: translateX(25%); } }
.orbFill::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 70%, rgba(255,255,255,.12) 0 6%, transparent 7%),
              radial-gradient(circle at 65% 40%, rgba(255,255,255,.1) 0 4%, transparent 5%);
  animation: orbBubbles 4s ease-in-out infinite alternate;
}
@keyframes orbBubbles { to { transform: translateY(-14px); opacity: .4; } }

/* ---------- CAIXA DE CONFIRMAÇÃO (UI.confirm) ---------- */
#modal {
  position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: radial-gradient(ellipse at center, rgba(40,6,2,.55) 0%, rgba(0,0,0,.85) 70%);
  backdrop-filter: blur(3px); animation: mFade .18s ease-out;
}
#modal.hidden { display: none; }
#modal .mbox {
  position: relative; width: 440px; max-width: 100%; padding: 26px 30px 22px; text-align: center;
  background: linear-gradient(#24190f, #0e0a06); border: 2px solid #6b5326;
  box-shadow: 0 0 0 1px #000, 0 0 40px rgba(200,52,31,.25), 0 20px 60px #000, inset 0 0 30px rgba(0,0,0,.7);
  animation: mPop .22s cubic-bezier(.2,1.4,.4,1);
}
#modal .mcorner { position: absolute; width: 14px; height: 14px; border: 2px solid var(--gold); }
#modal .mcorner.tl { left: -5px; top: -5px; border-right: 0; border-bottom: 0; }
#modal .mcorner.tr { right: -5px; top: -5px; border-left: 0; border-bottom: 0; }
#modal .mcorner.bl { left: -5px; bottom: -5px; border-right: 0; border-top: 0; }
#modal .mcorner.br { right: -5px; bottom: -5px; border-left: 0; border-top: 0; }
#modal .micon { font-size: 40px; filter: drop-shadow(0 0 10px rgba(200,52,31,.6)); }
#modal .micon:empty { display: none; }
#modal .mtitle { font-family: 'Cinzel', serif; font-size: 21px; font-weight: 700; color: var(--gold2); letter-spacing: 2px; margin-top: 4px; }
#modal .mrule { height: 1px; margin: 12px auto 14px; width: 70%; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
#modal .mtext { font-size: 17px; line-height: 1.45; color: var(--text); }
#modal .mtext b { color: #ff8a6a; font-weight: 600; }
#modal .mbtns { display: flex; gap: 14px; justify-content: center; margin-top: 22px; }
#modal .mbtns button { min-width: 130px; padding: 8px 16px; font-size: 15px; }
#modal #modalOk.danger { background: linear-gradient(#6a1a10, #3a0c06); border-color: #a8321f; color: #ffd9cc; }
#modal #modalOk.danger:hover { border-color: #ff6b4a; box-shadow: 0 0 14px rgba(255,80,40,.45); color: #fff; }
@keyframes mFade { from { opacity: 0; } }
@keyframes mPop { from { opacity: 0; transform: scale(.9) translateY(8px); } }

/* ===================== MODELOS 3D ===================== */
#loading3d { margin-top: 18px; font-family: 'Crimson Text', Georgia, serif; color: #8b7f6c; font-size: 15px; letter-spacing: 1px; }
#loading3d.hidden { display: none; }
.cicon.has3d { height: 150px; display: flex; align-items: flex-end; justify-content: center; margin: -6px 0 2px; }
.cportrait { width: 120px; height: 150px; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.7)); transition: transform .25s; }
.ccard:hover .cportrait { transform: scale(1.08) translateY(-3px); }

/* ===================== RECOMPENSAS POR ANÚNCIO ===================== */
#menuBtns .rewardBtn { color: #ffd84a; border-color: #7a5a1a; }
#menuBtns .rewardBtn:hover { box-shadow: 0 0 10px rgba(255, 200, 60, 0.4); }
#rewardList { display: flex; flex-direction: column; gap: 8px; padding: 0 14px; }
.rrow { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border);
  background: linear-gradient(90deg, rgba(60, 42, 18, 0.55), rgba(20, 14, 8, 0.6)); }
.rrow.locked { opacity: 0.6; }
.rrow .ricon { font-size: 30px; width: 40px; text-align: center; filter: drop-shadow(0 0 6px rgba(255, 200, 80, 0.4)); }
.rrow .rinfo { flex: 1; display: flex; flex-direction: column; }
.rrow .rinfo b { font-family: 'Cinzel', serif; color: var(--gold2); font-size: 15px; }
.rrow .rinfo span { font-size: 14px; color: var(--text); }
.rrow button { min-width: 130px; white-space: nowrap; }
.rrow button:disabled { cursor: default; color: var(--dim); border-color: var(--border); }
.rmode { margin: 0 14px 8px; padding: 6px 10px; font-size: 13px; color: #9fd0ff; border: 1px dashed #2a4a6a; background: rgba(20, 40, 70, 0.35); }
.rfoot { padding: 10px 14px 12px; font-size: 13px; color: var(--dim); text-align: center; }
#blessBadge { position: absolute; top: 216px; right: 16px; padding: 4px 10px; font-family: 'Cinzel', serif; font-size: 12px;
  color: #ffe9a0; background: rgba(40, 28, 6, 0.8); border: 1px solid #a07a20; box-shadow: 0 0 12px rgba(255, 200, 60, 0.35);
  pointer-events: none; animation: blessPulse 2.4s ease-in-out infinite; }
#blessBadge.hidden { display: none; }
@keyframes blessPulse { 50% { box-shadow: 0 0 18px rgba(255, 210, 80, 0.6); } }
#deathScreen .adBtn { margin-top: 12px; font-size: 16px; color: #ffb0c4; border-color: #7a3040; }
#deathScreen .adBtn.hidden { display: none; }
#deathScreen .adBtn:disabled { color: var(--dim); cursor: default; }

#adOverlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(0, 0, 0, 0.82); backdrop-filter: blur(3px); }
#adOverlay.hidden { display: none; }
.adBox { width: min(520px, calc(100vw - 32px)); background: #101418; border: 1px solid #3a4a5a; box-shadow: 0 10px 40px #000; }
.adTag { padding: 6px 10px; font: 600 11px/1 system-ui, sans-serif; letter-spacing: 1px; color: #1a1a1a; background: #ffd84a; }
.adBody { height: 220px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  color: #c8d4e0; font: 15px system-ui, sans-serif; text-align: center; padding: 0 20px;
  background: repeating-linear-gradient(45deg, #161c22 0 14px, #12171c 14px 28px); }
.adLogo { font-size: 48px; }
.adFor { color: #ffd84a; }
.adProg { height: 4px; background: #222; }
#adSimBar { height: 100%; width: 0; background: #ffd84a; transition: width 1s linear; }
#adSimClose { display: block; width: 100%; font-family: system-ui, sans-serif; border: 0; padding: 10px; }
#adSimClose.ok { color: #1a1a1a; background: #ffd84a; font-weight: 700; }
#loading3d.err { color: #ff9a80; max-width: 640px; text-align: center; }
#loading3d.err a { color: #ffd84a; }
#privacyLink { margin-top: 14px; font-size: 13px; color: var(--dim); }
.rfoot a, #privacyLink:hover { color: var(--gold2); }
#shopAdGold { margin-top: 6px; color: #ffd84a; border-color: #7a5a1a; } #shopAdGold.hidden { display: none; } #shopAdGold:disabled { color: var(--dim); cursor: default; }
