/* Eldoria 3.0 — camada visual isolada para PC e mobile */
:root{--safe-t:max(8px,env(safe-area-inset-top));--safe-r:max(8px,env(safe-area-inset-right));--safe-b:max(8px,env(safe-area-inset-bottom));--safe-l:max(8px,env(safe-area-inset-left))}
html,body{width:100%;height:100%;overflow:hidden}
img{max-width:100%}
.game-logout-button{right:var(--safe-r)!important;top:calc(var(--safe-t) + 72px)!important;bottom:auto!important;width:34px!important;height:34px!important;min-width:34px!important;padding:0!important;border-radius:50%!important;display:grid!important;place-items:center!important;z-index:88!important}
.game-logout-button b{display:none!important}.game-logout-button span{font-size:17px;line-height:1}
.world-chat-toggle{right:var(--safe-r)!important;bottom:calc(var(--safe-b) + 112px)!important}

/* Inventário reconstruído */
#panel.inventory-open{width:min(1120px,calc(100vw - 24px));max-width:1120px;padding:14px;background:linear-gradient(145deg,#111827,#070b12);border:1px solid #7a6331;box-shadow:0 22px 80px #000d,inset 0 0 40px #d7b75b0c}
.inventory-v3{display:grid;grid-template-columns:minmax(260px,330px) minmax(0,1fr);gap:14px;min-height:470px}
.inventory-v3 .inv-panel{border:1px solid #34445f;border-radius:14px;background:linear-gradient(160deg,#152036,#090f1b);padding:12px;box-shadow:inset 0 0 24px #0007}
.inventory-v3 .inv-title{display:flex;justify-content:space-between;gap:10px;align-items:center;margin-bottom:10px}.inventory-v3 .inv-title h3{margin:0;color:#f3d77c;font-size:.92rem}.inventory-v3 .inv-title small{color:#8ea1c2;font-size:.62rem}
.inv-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin-bottom:10px}.inv-stat{padding:8px 5px;border:1px solid #30405c;border-radius:9px;text-align:center;background:#0a1220}.inv-stat small{display:block;color:#8193b1;font-size:.54rem}.inv-stat b{color:#fff;font-size:.8rem}
.inv-equipment{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.inv-equip-slot{min-height:105px;border:1px dashed #475873;border-radius:11px;padding:7px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;background:#080e19;position:relative;overflow:hidden}.inv-equip-slot[data-filled="1"]{border-style:solid;border-color:#8b7137;background:radial-gradient(circle at 50% 30%,#3c321a,#0b1019 72%)}.inv-equip-slot small{position:absolute;top:5px;left:7px;color:#7f91ad;font-size:.5rem}.inv-equip-slot img{width:58px;height:58px;object-fit:contain;image-rendering:pixelated}.inv-equip-slot b{font-size:.62rem;line-height:1.15;color:#f4e6b4;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.inv-equip-slot em{font-style:normal;font-size:.54rem;color:#8495ae}
.inv-backpack-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:9px}.inv-capacity{min-width:170px}.inv-capacity span{display:flex;justify-content:space-between;font-size:.56rem;color:#95a4be;margin-bottom:4px}.inv-capacity div{height:7px;border-radius:99px;background:#050911;overflow:hidden;border:1px solid #29364d}.inv-capacity i{display:block;height:100%;background:linear-gradient(90deg,#4c8acb,#d3b45d);border-radius:inherit}
.inv-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:8px;max-height:58vh;overflow:auto;padding:2px 4px 8px 2px;scrollbar-width:thin}.inv-item{position:relative;min-height:205px;border:1px solid #35445d;border-radius:12px;padding:9px;background:linear-gradient(160deg,#17233a,#090e18);display:flex;flex-direction:column;align-items:center;text-align:center;overflow:hidden}.inv-item:before{content:"";position:absolute;inset:0 0 auto;height:3px;background:#7a8799}.inv-item.uncommon:before{background:#56a36d}.inv-item.rare:before{background:#478dd4}.inv-item.epic:before{background:#9a61d5}.inv-item.legendary:before{background:#d7a83d}.inv-item img{width:72px;height:72px;object-fit:contain;image-rendering:pixelated;margin:5px 0}.inv-item>b{font-size:.68rem;color:#f4e8bd;line-height:1.15;min-height:30px}.inv-item small{font-size:.54rem;color:#91a1bb;line-height:1.25}.inv-item .qty{position:absolute;right:7px;top:8px;background:#05080dcc;border:1px solid #687995;border-radius:8px;padding:3px 6px;color:#fff;font-size:.58rem}.inv-actions{display:grid;grid-template-columns:1fr auto;gap:5px;width:100%;margin-top:auto;padding-top:8px}.inv-actions button{min-height:31px!important;padding:5px!important;font-size:.56rem!important}.inv-actions .danger-lite{width:32px;color:#f09a9a;border-color:#773f47;background:#2d1218}
.inv-empty{grid-column:1/-1;min-height:200px;display:grid;place-items:center;text-align:center;color:#7f91ad;border:1px dashed #35435a;border-radius:12px}.inv-empty b{display:block;color:#d4bd74;margin-bottom:4px}

@media(max-width:950px){
  html,body{overflow:hidden}.cinematic-entry,.online-auth,#start,#creation{overflow:auto!important;-webkit-overflow-scrolling:touch}
  .cinematic-main{min-height:100dvh;padding:calc(var(--safe-t) + 46px) 12px calc(var(--safe-b) + 22px)}
  .online-auth{height:100dvh!important;padding:calc(var(--safe-t) + 18px) 10px calc(var(--safe-b) + 12px)!important;align-items:flex-start!important;overflow:auto!important}
  .online-auth-card{width:min(100%,400px)!important;max-height:none!important;margin:auto!important;padding:20px 14px!important}
  #panel{width:calc(100vw - 10px)!important;max-height:calc(100dvh - 10px)!important;padding:9px!important;overflow:auto!important}
  #panel.inventory-open{padding:8px!important}.inventory-v3{grid-template-columns:1fr;min-height:0}.inventory-v3 .inv-panel{padding:8px}.inv-equipment{grid-template-columns:repeat(4,minmax(0,1fr))}.inv-equip-slot{min-height:82px;padding:5px}.inv-equip-slot img{width:42px;height:42px}.inv-equip-slot b{font-size:.53rem}.inv-stats{margin-bottom:7px}.inv-grid{grid-template-columns:repeat(3,minmax(0,1fr));max-height:48dvh;gap:5px}.inv-item{min-height:164px;padding:6px}.inv-item img{width:52px;height:52px}.inv-item>b{font-size:.58rem;min-height:26px}.inv-item small{font-size:.48rem}.inv-actions button{font-size:.5rem!important;min-height:28px!important}.inv-capacity{min-width:125px}
  #dialogue{left:var(--safe-l)!important;right:var(--safe-r)!important;bottom:calc(var(--safe-b) + 5px)!important;width:auto!important;max-height:42dvh!important;overflow:auto!important;padding:9px!important;z-index:95!important}#dialogue img{width:48px!important;height:48px!important;flex:0 0 48px!important}#dialogue p{font-size:.69rem!important;line-height:1.35!important}
  .game-logout-button{top:calc(var(--safe-t) + 58px)!important;right:var(--safe-r)!important;width:31px!important;height:31px!important;min-width:31px!important}.world-chat-toggle{bottom:calc(var(--safe-b) + 104px)!important}
}
@media(max-width:600px) and (orientation:portrait){.inv-equipment{grid-template-columns:repeat(3,minmax(0,1fr))}.inv-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.inventory-v3 .inv-title{align-items:flex-start;flex-direction:column}.inv-backpack-head{align-items:flex-start;flex-direction:column}.inv-capacity{width:100%}}
@media(max-height:500px) and (orientation:landscape){.inventory-v3{grid-template-columns:250px 1fr}.inv-equipment{grid-template-columns:repeat(3,minmax(0,1fr))}.inv-equip-slot{min-height:68px}.inv-equip-slot img{width:35px;height:35px}.inv-grid{grid-template-columns:repeat(5,minmax(0,1fr));max-height:63dvh}.inv-item{min-height:145px}.inv-item img{width:44px;height:44px}#dialogue{left:18%!important;right:18%!important;max-height:36dvh!important}}

/* Eldoria V3.0.1 — ajustes exclusivos para telas grandes */
@media (min-width:951px) and (hover:hover) and (pointer:fine){
  .game-logout-button{
    top:116px!important;
    right:max(18px,env(safe-area-inset-right))!important;
    bottom:auto!important;
  }
  .world-chat-toggle{
    right:max(18px,env(safe-area-inset-right))!important;
    bottom:28px!important;
  }
  .world-chat.compact-chat{
    right:max(18px,env(safe-area-inset-right))!important;
    bottom:74px!important;
  }
}

.gamer-logout-confirm{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:18px;background:radial-gradient(circle at 50% 45%,#18233bd9,#02040af2 65%);backdrop-filter:blur(6px);pointer-events:auto}
.gamer-logout-confirm.hidden{display:none!important}
.gamer-logout-card{position:relative;width:min(440px,calc(100vw - 28px));padding:32px 24px 24px;text-align:center;border:1px solid #b88b43;border-radius:18px;background:linear-gradient(155deg,#18243a 0%,#0a101b 52%,#150b10 100%);box-shadow:0 30px 100px #000e,inset 0 0 45px #d6aa4212;overflow:hidden}
.gamer-logout-card:before,.gamer-logout-card:after{content:"";position:absolute;left:12%;right:12%;height:1px;background:linear-gradient(90deg,transparent,#e6bd69,transparent)}
.gamer-logout-card:before{top:9px}.gamer-logout-card:after{bottom:9px}
.gamer-logout-emblem{width:66px;height:66px;margin:0 auto 12px;display:grid;place-items:center;border-radius:50%;font-size:31px;color:#ffb2b8;border:1px solid #a94d58;background:radial-gradient(circle,#712633,#260e16 70%);box-shadow:0 0 28px #e2475760,inset 0 0 18px #0008}
.gamer-logout-card small{display:block;color:#c5a765;letter-spacing:.18em;font-size:.65rem}.gamer-logout-card h2{margin:8px 0 7px;color:#f6df9b;font-size:1.55rem;letter-spacing:.04em}.gamer-logout-card p{margin:0 auto 20px;max-width:330px;color:#aebbd0;font-size:.84rem;line-height:1.45}
.gamer-logout-actions{display:grid;grid-template-columns:1fr 1fr;gap:9px}.gamer-logout-actions button{min-height:44px;border-radius:10px;font-size:.7rem;font-weight:800;letter-spacing:.06em;background:linear-gradient(#283c5e,#131e31);border-color:#5977a5}.gamer-logout-actions .danger{background:linear-gradient(#8b2c39,#3b121a);border-color:#c65c68;color:#fff0f1}
.gamer-logout-actions button:hover{filter:brightness(1.14);transform:translateY(-1px)}
@media(max-width:600px){.gamer-logout-card{padding:25px 15px 17px}.gamer-logout-actions{grid-template-columns:1fr}.gamer-logout-emblem{width:54px;height:54px;font-size:25px}.gamer-logout-card h2{font-size:1.22rem}}


/* King of Chaos V3.0.11 — ajustes finos de posição e controles */
@media (min-width:951px) and (hover:hover) and (pointer:fine){
  .game-logout-button{
    top:158px!important;
  }
}
@media (max-width:950px){
  .game-logout-button{
    width:27px!important;
    height:27px!important;
    min-width:27px!important;
  }
  .game-logout-button span{font-size:14px!important}
  .world-chat-toggle{
    min-width:62px!important;
    height:31px!important;
    padding:0 8px!important;
    gap:4px!important;
    font-size:8px!important;
  }
  .world-chat-toggle .chat-pulse{width:6px!important;height:6px!important}
}
@media (max-height:500px) and (orientation:landscape){
  .game-logout-button{width:25px!important;height:25px!important;min-width:25px!important}
  .world-chat-toggle{min-width:56px!important;height:28px!important;padding:0 6px!important}
}
