﻿/*
    fileName: style.css
    Descrição: Estilos completos - Tema Retro 16-bit / Tibia Style (UPSCALED)
    Modificação: Interface aumentada (Barras, Ícones, Fontes) para monitores HD/FullHD.
*/

:root {
    /* Paleta Retro / Tibia Stone */
    --ui-bg: #3f3f3f;            /* Fundo cinza pedra */
    --ui-bg-dark: #2d2d2d;       /* Fundo de slots/inputs */
    --ui-border-light: #6d6d6d;  /* Borda 3D clara */
    --ui-border-dark: #1a1a1a;   /* Borda 3D escura */
    
    --color-text-main: #d4d4d4;  /* Texto cinza claro */
    --color-text-highlight: #ffffff;
    
    /* Cores Funcionais Retro */
    --success-green: #00c800;
    --gold: #ffcc00;
    --danger-red: #d60000;
    --mana-blue: #0044cc;
    
    /* Fontes */
    --font-pixel: 'Verdana', 'Tahoma', sans-serif;
    --font-mono: 'Courier New', monospace;

    /* --- VARIÁVEIS DE TAMANHO (ESCALA AUMENTADA) --- */
    --icon-size: 54px;   /* Aumentado de 36px */
    --slot-size: 48px;   /* Aumentado de 36px */
    --font-base: 14px;   /* Aumentado de 12px */
}

/* --- RESET BÁSICO --- */
html, body {
    width: 100%;
    /* MUDANÇA: '100dvh' garante que a barra do navegador não empurre o jogo */
    height: 100dvh; 
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #000;
    color: var(--color-text-main);
    font-family: var(--font-pixel);
    font-size: var(--font-base);
    touch-action: none; /* Impede zoom e gestos do navegador */
    image-rendering: pixelated;
    position: fixed; /* Trava a rolagem elástica no iPhone/Android */
    top: 0;
    left: 0;
    
    /* Desativa a seleção de texto e o realce azul ao tocar (Mobile) */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* O restante do seu CSS continua igual abaixo... */

canvas {
    image-rendering: optimizeSpeed;             /* Firefox                        */
    image-rendering: -moz-crisp-edges;          /* Firefox                        */
    image-rendering: -webkit-optimize-contrast; /* Chrome (and Safari)            */
    image-rendering: optimize-contrast;         /* CSS3 Proposed                  */
    image-rendering: -webkit-crisp-edges;       /* Safari                         */
    image-rendering: pixelated;                 /* Chrome                         */
    image-rendering: crisp-edges;               /* Native                         */
    -ms-interpolation-mode: nearest-neighbor;   /* IE                             */
    border: none;
}

#gameCanvas {
    width: 100vw;
    height: 100vh;
    display: block;
    background-color: #000;
    cursor: url('/assets/Interface/cursor_hand.png'), auto;
}

#info-avatar-canvas {
    width: 64px;
    height: 64px;
    display: block;
    background: #000;
    border: 2px solid var(--ui-border-light);
}

canvas.selection-mode {
    cursor: crosshair !important;
}

#game-ui-wrapper {
    display: none;
    pointer-events: auto;
}

/* --- CLASSE UTILITÁRIA DE JANELA RETRO --- */
.retro-window {
    background-color: var(--ui-bg);
    border-top: 3px solid var(--ui-border-light); /* Borda mais grossa */
    border-left: 3px solid var(--ui-border-light);
    border-right: 3px solid var(--ui-border-dark);
    border-bottom: 3px solid var(--ui-border-dark);
    box-shadow: 2px 2px 0px #000;
    image-rendering: pixelated;
}

/* Botões Retro Genéricos */
button {
    background: var(--ui-bg);
    border-top: 3px solid var(--ui-border-light);
    border-left: 3px solid var(--ui-border-light);
    border-right: 3px solid var(--ui-border-dark);
    border-bottom: 3px solid var(--ui-border-dark);
    color: var(--color-text-main);
    font-family: var(--font-pixel);
    font-weight: bold;
    cursor: pointer;
    font-size: 13px; /* Fonte do botão maior */
    padding: 6px 10px;
}

button:active {
    border-top: 3px solid var(--ui-border-dark);
    border-left: 3px solid var(--ui-border-dark);
    border-right: 3px solid var(--ui-border-light);
    border-bottom: 3px solid var(--ui-border-light);
    transform: translate(2px, 2px);
}

button:disabled {
    color: #555;
    cursor: not-allowed;
}

/* --- TELA DE LOADING --- */
#loading-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #121212 url('/assets/Interface/Fundos/backgroundlogin.png') no-repeat center center;
    background-size: 100% 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 102;
}

#loading-container {
    width: 450px; /* Mais largo */
    padding: 20px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
}

#loading-title {
    font-size: 20px;
    margin: 0 auto 16px auto;
    font-family: var(--font-pixel);
    font-weight: bold;
    color: #fff;
    text-transform: none;
    text-shadow: 1px 1px 0 #000;
}
#loading-progress-bar-outer {
    width: 100%;
    height: 18px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
    margin-bottom: 15px;
}

#loading-progress-bar-inner {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, rgba(26, 115, 232, 0.9), rgba(64, 169, 255, 0.9));
    transition: width 0.1s steps(10);
}

#loading-status-text {
    font-size: 12px;
    color: var(--color-text-main);
    text-align: center;
    font-family: var(--font-mono);
}

/* --- TELA DE LOGIN --- */
#login-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #121212 url('/assets/Interface/Fundos/backgroundlogin.png') no-repeat center center;
    background-size: 100% 100%;
    /* background-size: repeat; Removido para evitar conflito com 'cover' */
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 5000;
}

body.logged-in #login-overlay {
    display: none !important;
}

#login-container {
    width: 400px;
    max-width: 90vw;
    padding: 20px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    zoom: 1.1; /* Pequeno zoom geral no login */
}

/* Otimização Mobile para Login e Registro - REDUÇÃO AGRESSIVA */
@media (max-width: 768px) {
    #login-container {
        width: 90%;
        padding: 8px; /* Redução máxima de padding */
        zoom: 0.8; /* Redução agressiva de escala */
    }

    #login-title {
        font-size: 18px; /* Título menor */
        margin: 0 auto 8px auto;
    }

    .auth-form {
        gap: 5px; /* Espaçamento mínimo entre campos */
    }

    .auth-input {
        padding: 6px; /* Inputs mais finos */
        font-size: 16px; /* Mantido 16px para evitar zoom do iOS, mas o zoom: 0.8 compensa visualmente */
        border-width: 2px; /* Borda mais fina */
    }

    .auth-button {
        padding: 8px;
        font-size: 14px;
        margin-top: 4px;
    }

    #auth-tabs-wrapper {
        margin-bottom: 6px;
        padding-bottom: 0px;
        border-bottom-width: 2px;
    }

    .auth-tab-btn {
        padding: 6px;
        font-size: 12px;
    }

    #auth-error-message {
        font-size: 10px;
        margin-bottom: 4px;
        padding: 2px;
    }
}

#login-title {
    font-size: 28px;
    margin: 0 auto 20px auto;
    font-family: var(--font-pixel);
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px #000;
    text-align: center;
}

#auth-tabs-wrapper {
    width: 100%;
    display: flex;
    margin-bottom: 15px;
    border-bottom: 3px solid var(--ui-border-dark);
    padding-bottom: 5px;
}

.auth-tab-btn {
    flex: 1;
    padding: 8px;
    margin-right: 2px;
    font-size: 13px;
}

.auth-tab-btn.active {
    background: var(--ui-border-light);
    color: #000;
    border-style: inset;
}

.auth-form {
    display: none;
    flex-direction: column;
    gap: 12px;
}

.auth-form.visible {
    display: flex;
}

.auth-input {
    background: #000;
    border: 3px inset var(--ui-border-light);
    color: #fff;
    padding: 8px;
    font-family: var(--font-mono);
    font-size: 14px;
    outline: none;
    user-select: text; /* Permite seleção apenas em inputs */
    -webkit-user-select: text;
}

.auth-input:focus {
    background: #222;
}

.auth-button {
    margin-top: 10px;
    padding: 10px;
    font-size: 14px;
}

.auth-button:hover {
    background: #555;
}

.google-login-btn {
    background: rgba(26, 115, 232, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.google-login-btn:hover {
    background: #1669d2;
}

.google-login-icon {
    width: 18px;
    height: 18px;
    image-rendering: pixelated;
}

#auth-error-message {
    color: var(--danger-red);
    text-align: center;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 10px;
    padding: 5px;
    background: transparent;
    border: none;
}

#auth-error-message:empty {
    display: none;
    padding: 0;
    margin: 0;
}

/* --- SELEÇÃO DE CLASSE --- */
#class-selection-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: #121212 url('/assets/Interface/Fundos/backgroundlogin.png') no-repeat center center;
    background-size: 100% 100%;
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 100;
    flex-direction: column;
}

#class-container {
    width: 480px;
    max-width: 90vw;
    padding: 16px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(1.5);
    transform-origin: center;
}

@media (max-width: 768px) {
    #class-container {
        width: 90%;
        padding: 15px;
        transform: scale(1);
    }
    
    #class-title {
        font-size: 18px;
        margin-bottom: 10px;
    }

    #class-preview-canvas {
        width: 100px;
        height: 100px;
        margin-bottom: 10px;
    }

    #class-compact {
        gap: 6px;
    }

    #class-label {
        min-width: 80px;
        font-size: 11px;
    }

    .class-row {
        padding: 4px 6px;
    }

    #character-name-input {
        max-width: 180px;
    }
}

#class-title {
    font-family: var(--font-pixel);
    color: var(--gold);
    text-shadow: 2px 2px #000;
    margin-bottom: 8px;
    font-size: 16px;
}

#class-preview-canvas {
    width: 96px;
    height: 96px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    margin-bottom: 8px;
}

#class-compact {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 4px 0 6px 0;
    width: 100%;
    align-items: center;
}

.class-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(25, 25, 25, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px 6px;
    width: 100%;
    justify-content: center;
}

.class-row-label {
    min-width: 60px;
    font-size: 12px;
    color: #bbb;
}

#character-name-input {
    flex: 1;
    max-width: 200px;
    padding: 4px 6px;
    text-align: center;
    height: 24px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
}

.class-row-appearance {
    flex-wrap: wrap;
    gap: 8px;
}

.mini-select {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(20, 20, 20, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.14);
    padding: 2px 6px;
    border-radius: 6px;
}

.mini-label {
    font-size: 11px;
    color: #bbb;
    min-width: 40px;
}

#body-label,
#hair-label {
    min-width: 44px;
    text-align: center;
    font-size: 12px;
    color: #fff;
}

#class-label {
    min-width: 80px;
    text-align: center;
    font-size: 12px;
    color: #fff;
}

.class-row button,
.mini-select button,
#class-actions button {
    background: rgba(60, 60, 60, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    border-radius: 6px;
    height: 24px;
    min-width: 24px;
    padding: 0 8px;
    font-size: 12px;
}

.class-row button:hover,
.mini-select button:hover,
#class-actions button:hover {
    background: rgba(80, 80, 80, 0.65);
}

#class-prev,
#class-next {
    width: 22px;
    height: 22px;
    padding: 0;
}

#class-actions {
    width: 100%;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-top: 8px;
    align-items: stretch;
}

#class-actions button {
    flex: 1;
    height: 24px;
    padding: 0;
    font-size: 12px;
    margin-top: 0;
    line-height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
}

#class-actions .auth-button {
    margin-top: 0;
    padding: 0;
}

/* --- HUD: HP / PA / PM / XP (CENTRALIZADO) --- */
#central-stats-wrapper {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99;
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    gap: 0; /* Removido gap para as cápsulas se unirem */
    background: none !important; /* Remove o fundo cinza escuro */
    border: none !important; /* Remove a borda pesada */
    padding: 0;
    opacity: 1; /* Opacidade controlada pelos containers internos */
}

#hp-mp-container {
    display: flex;
    flex-direction: row;
    gap: 8px;
    background: rgba(200, 200, 200, 0.2); /* Cinza claro transparente */
    padding: 4px;
    border-radius: 8px 8px 0 0;
    backdrop-filter: blur(2px);
}

#ap-pm-container {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 2px;
}

.ap-pm-bubble {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-weight: bold;
    font-size: 12px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: inset 1px 1px 3px rgba(0, 0, 0, 0.5);
}

.pa-bubble {
    background: linear-gradient(180deg, #5f85ff, #3e5fd1);
}

.pm-bubble {
    background: linear-gradient(180deg, #2ecc71, #27ae60);
}

#xp-container {
    width: 190px;
    background: rgba(200, 200, 200, 0.2);
    padding: 0 4px 4px 4px;
    border-radius: 0 0 8px 8px;
    backdrop-filter: blur(2px);
}

/* Ajuste para as barras individuais */
.stat-bar {
    width: 120px;
    height: 18px; /* Mais fina e elegante */
    background-color: rgba(0, 0, 0, 0.3); /* Fundo da barra mais discreto */
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-sizing: border-box;
    position: relative;
    border-radius: 4px;
    overflow: hidden;
}

/* Sobrescreve a largura para a barra de XP */
#xp-container .stat-bar {
    width: 100%; /* Ocupa o 100% do #xp-container */
}

.stat-bar {
    /* Removido o width: 100% e height: 24px que agora estão no bloco anterior */
}

.stat-bar-fill {
    height: 100%;
    width: 100%;
    transition: width 0.1s linear;
}

#hp-bar-fill {
    background: linear-gradient(180deg, #ff5f5f, #d13e3e);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
}

#xp-bar-fill {
    background: linear-gradient(90deg, #00c800, #00ff00);
    border-right: 2px solid #00ff00;
    box-shadow: 0 0 10px rgba(0, 200, 0, 0.8);
}

.stat-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 12px; /* Reduzido para caber melhor */
    font-family: var(--font-mono);
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 0 #000; /* Sombra reduzida para menos volume */
    white-space: nowrap; /* Garante que o texto não quebre a linha */
    z-index: 2;
}

/* --- HUD: PARTY (Grupo) --- */
#party-hud {
    position: fixed;
    top: 90px;
    left: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
    z-index: 2000;
    --party-icon-size: 36px;
}

.party-entry-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-family: var(--font-pixel);
    text-shadow: 1px 1px 0 #000;
    color: #fff;
    position: relative;
    pointer-events: auto;
}

.party-entry {
    width: var(--party-icon-size);
    height: var(--party-icon-size);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    box-shadow: inset 2px 2px 4px #000;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    position: relative;
}

.party-leader-icon {
    position: absolute;
    left: 3px;
    top: 3px;
    color: var(--gold);
    font-size: 10px;
    line-height: 1;
}

.party-leader-level {
    position: absolute;
    left: 3px;
    bottom: 2px;
    font-size: 9px;
    color: #fff;
    background: rgba(0, 0, 0, 0.45);
    padding: 1px 2px;
    border-radius: 3px;
    line-height: 1;
}

.party-leader-level-out {
    position: absolute;
    top: -62px;
    left: 50%;
    transform: translateX(-50%);
    right: auto;
    bottom: auto;
}

.party-bonus-tag {
    position: absolute;
    top: -48px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #ffd36a;
    background: rgba(0, 0, 0, 0.45);
    padding: 1px 2px;
    border-radius: 3px;
    line-height: 1;
    right: auto;
    bottom: auto;
    pointer-events: none;
    white-space: nowrap;
}

.party-drop-tag {
    position: absolute;
    top: -36px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #8fd3ff;
    background: rgba(0, 0, 0, 0.45);
    padding: 1px 2px;
    border-radius: 3px;
    line-height: 1;
    right: auto;
    bottom: auto;
    pointer-events: none;
    white-space: nowrap;
}

.party-entry-name {
    font-size: 10px;
    white-space: nowrap;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.party-leave-btn {
    position: absolute;
    right: 0;
    top: -11px;
    font-size: 9px;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    padding: 1px 2px;
    cursor: pointer;
    z-index: 2;
    pointer-events: auto;
}

.party-leave-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

#party-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #fff;
    color: #fff;
    padding: 6px 8px;
    font-family: var(--font-pixel);
    font-size: 11px;
    z-index: 1200;
    pointer-events: none;
    white-space: nowrap;
}

.hp-fill { background: #d13e3e; }
.mp-fill { background: #3e5fd1; }

/* --- JANELAS FLUTUANTES (Upscaled) --- */
#chat-container,
#status-container,
.ui-scroll-window {
    position: fixed;
    background: var(--ui-bg);
    border: 3px outset var(--ui-border-light);
    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.5);
    pointer-events: auto;
    z-index: 99;
    display: flex;
    flex-direction: column;
    font-family: var(--font-pixel);
    color: var(--color-text-main);
}

#chat-container {
    top: auto;
    bottom: 10px;
    left: 10px;
    width: 420px; /* Chat mais largo */
    height: 250px; /* Chat mais alto */
}

#chat-container.hidden { display: none; }

#status-container {
    /* 10px(top) + ~40px(HP/MP) + 6px(gap) + ~30px(XP) + 10px(gap) = ~96px */
    top: 96px;
    left: 10px;
    right: auto;
    width: 280px; /* Largura igual ao HP */
    max-height: 500px;
    z-index: 98;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#status-container.hidden { display: none; }

.ui-scroll-window {
    top: 100px;
    left: 100px;
    transform: none;
    width: 400px;
    min-height: 250px;
    z-index: 150;
}

.ui-scroll-window.hidden { display: none; }

#status-header,
.ui-scroll-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(30, 30, 30, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 5px 8px;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 1px 1px 0 #000;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#settings-window {
    right: 10px;
    left: auto;
    top: 100px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#settings-content {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.settings-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-weight: bold;
    padding: 8px 10px;
    cursor: pointer;
    text-align: center;
    border-radius: 6px;
}

.settings-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.settings-btn:active { border-style: inset; }

.settings-btn.danger {
    background: rgba(184, 50, 50, 0.8);
    border-color: rgba(255, 120, 120, 0.3);
    color: #fff;
}

#settings-volume {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 10px;
}

#settings-volume-label {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 6px;
}

#settings-volume-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#settings-volume-slider {
    flex: 1;
    accent-color: var(--danger-red);
}

#settings-zoom {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 10px;
}

#settings-zoom-label {
    font-size: 12px;
    color: #bbb;
    margin-bottom: 6px;
}

#settings-zoom-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

#settings-zoom-slider {
    flex: 1;
    accent-color: var(--danger-red);
}

.settings-volume-btn {
    width: 32px;
    height: 28px;
    padding: 0;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 6px;
}

#status-close-btn,
.ui-scroll-close {
    background: #c0392b;
    border: 1px solid #000;
    color: #fff;
    font-weight: bold;
    width: 20px;
    height: 20px;
    cursor: pointer;
    line-height: 18px;
    padding: 0;
    font-family: monospace;
    font-size: 12px;
}

#status-close-btn:hover,
.ui-scroll-close:hover {
    background: #e74c3c;
}

#status-header {
    position: relative;
    justify-content: center;
}

#status-title {
    margin: 0;
    width: 100%;
    text-align: center;
    pointer-events: none;
}

#status-close-btn {
    position: absolute;
    right: 6px;
}

/* --- CHAT STYLES --- */
#chat-toggle-button {
    position: fixed;
    bottom: 265px; /* Ajustado para a nova altura do chat */
    left: 10px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    pointer-events: auto;
    z-index: 99;
    padding: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

#chat-toggle-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

#chat-toggle-button:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.05);
}

#chat-toggle-button img { width: 20px; height: 20px; }

#chat-tabs {
    display: flex;
    background: #2b2b2b;
    border-bottom: 2px solid #000;
}

.chat-tab {
    flex-grow: 1;
    padding: 6px;
    background: #333;
    color: #888;
    border: none;
    border-right: 1px solid #000;
    cursor: pointer;
    font-family: var(--font-pixel);
    font-weight: normal;
    font-size: 12px;
}

.chat-tab.active {
    background: var(--ui-bg);
    color: #fff;
    font-weight: bold;
}

#chat-messages-container {
    flex-grow: 1;
    padding: 6px;
    overflow-y: hidden;
    background: #000;
    border: 3px inset var(--ui-border-light);
    margin: 6px;
}

#chat-messages {
    height: 100%;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #555 #000;
}

#chat-messages p {
    margin: 0 0 6px 0;
    font-size: 13px; /* Fonte do chat legível */
    line-height: 1.3;
    word-wrap: break-word;
    font-family: var(--font-mono);
    color: #e0e0e0;
}

/* Cores de mensagens */
.chat-global { color: #ffcc00; }
.chat-private { color: #dda0dd; }
.chat-system { color: #ff5555; }

#chat-form {
    border-top: none;
    padding: 6px;
}

#chat-input {
    width: 100%;
    border: 3px inset var(--ui-border-light);
    background: #222;
    padding: 6px;
    box-sizing: border-box;
    font-family: var(--font-pixel);
    font-size: 13px;
    color: #fff;
    outline: none;
}

/* --- LISTAS (Status) --- */
#status-content {
    padding: 8px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    height: 100%;
}

.status-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-row {
    display: grid;
    grid-template-columns: 1fr 70px 22px;
    align-items: center;
    gap: 6px;
    padding: 4px 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-size: 12px;
}

.status-row.no-button {
    grid-template-columns: 1fr 70px;
}

.status-key {
    color: #e6e6e6;
}

.status-value {
    text-align: right;
    color: #fff;
}

.status-points-row {
    margin-top: 8px;
    display: grid;
    grid-template-columns: 1fr 70px;
    align-items: center;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-weight: normal;
    color: #fff;
    font-size: 12px;
}

.status-points-label {
    color: #e6e6e6;
}

.reset-stat-btn {
    margin: 6px auto 0 auto;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: bold;
    cursor: pointer;
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.reset-stat-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.reset-stat-btn:active { border-style: inset; }

.status-divider {
    margin: 8px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* --- CHARACTER SELECT FOOTER (PREMIUM TIMER) --- */
.character-select-footer {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.premium-counter {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px 6px;
    min-height: 28px;
    width: 100%;
    box-sizing: border-box;
}

.premium-counter-label {
    font-size: 12px;
    color: #e0e0e0;
    white-space: nowrap;
    line-height: 1;
}

.premium-counter-text {
    font-size: 12px;
    color: #9aa3a9;
    line-height: 1;
}

/* --- CHARACTER SELECT GLASS --- */
#character-select-overlay {
    background: #121212 url('/assets/Interface/Fundos/backgroundlogin.png') no-repeat center center;
    background-size: 100% 100%;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.character-glass-window {
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.character-glass-modal {
    min-width: 280px;
}

.character-select-title {
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 16px;
    text-shadow: 1px 1px 0 #000;
}

.character-glass-card {
    background: rgba(25, 25, 25, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.character-card-title {
    font-weight: bold;
}

.character-card-meta {
    font-size: 12px;
    color: #d7d7d7;
}

.character-card-meta.is-empty {
    color: #b1b1b1;
}

.character-card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

.character-card-header {
    display: flex;
    gap: 8px;
    align-items: center;
}

.character-preview-canvas {
    width: 56px;
    height: 56px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    image-rendering: pixelated;
}

.character-card-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.character-glass-btn {
    background: rgba(60, 60, 60, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    padding: 4px 8px;
}

.character-glass-btn:hover {
    background: rgba(80, 80, 80, 0.7);
}

.character-glass-btn-danger {
    background: rgba(160, 40, 40, 0.6);
    border-color: rgba(255, 120, 120, 0.35);
}

.character-glass-btn-danger:hover {
    background: rgba(190, 50, 50, 0.7);
}


.add-stat-btn {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: bold;
    cursor: pointer;
    margin-left: 0;
    padding: 0 6px;
    font-size: 12px;
    height: 20px;
    border-radius: 4px;
}

.add-stat-btn:active { border-style: inset; }

/* --- BOTÕES HUD (Canto Inferior Direito - AUMENTADO) --- */
#hud-buttons {
    position: fixed;
    bottom: 25px; /* Mais alto por causa da XP bar */
    right: 15px;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    z-index: 95;
    width: auto;
}
.hud-icon {
    width: var(--icon-size);   /* 54px */
    height: var(--icon-size);  /* 54px */
    min-width: var(--icon-size);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.2s ease;
}

.hud-icon:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
}

.hud-icon:active { 
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.05);
}

.hud-icon img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    image-rendering: pixelated;
    display: block;
}


/* --- INVENTÁRIO (GRID Aumentado) --- */
#inventory-window {
    width: 640px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#cash-shop-window {
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#cash-shop-window .ui-scroll-header {
    position: relative;
    justify-content: center;
    background: rgba(30, 30, 30, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

#cash-shop-window .ui-scroll-header span {
    width: 100%;
    text-align: center;
    pointer-events: none;
}

#cash-shop-window .ui-scroll-close {
    position: absolute;
    right: 6px;
}

#inventory-top-section {
    display: flex;
    gap: 10px;
    padding: 10px;
    background: rgba(0,0,0,0.12);
    margin: 5px;
    border-radius: 4px;
    align-items: flex-start;
}

#essence-slots,
#special-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

#equipment-slots {
    margin: 0;
    padding: 6px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

#inventory-grid {
    display: grid;
    grid-template-columns: repeat(12, var(--slot-size));
    gap: 2px;
    padding: 8px;
    max-height: 280px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 8px;
    justify-content: start;
}

#inventory-window .ui-scroll-header {
    background: rgba(30, 30, 30, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.inventory-glass-panel {
    background: rgba(25, 25, 25, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    padding: 8px;
    min-width: 190px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#appearance-preview {
    width: 72px;
    height: 72px;
    align-self: center;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
    image-rendering: pixelated;
}

.appearance-title {
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

.appearance-row {
    display: grid;
    grid-template-columns: 48px 22px 1fr 22px;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 4px 6px;
}

.appearance-label {
    font-size: 11px;
    color: #cfcfcf;
}

.appearance-value {
    font-size: 11px;
    color: #fff;
    text-align: center;
}

.appearance-btn {
    width: 22px;
    height: 22px;
    padding: 0;
    background: rgba(60, 60, 60, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.appearance-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.appearance-note {
    font-size: 10px;
    text-align: center;
    color: #ffb4b4;
}

.inv-slot {
    width: var(--slot-size);  /* 48px */
    height: var(--slot-size); /* 48px */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.essence-slot,
.special-slot {
    width: var(--slot-size);
    height: var(--slot-size);
    background: #333;
    border: 2px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: inset 2px 2px 4px #000;
}

.essence-slot:empty,
.special-slot:empty {
    opacity: 0.45;
    filter: grayscale(100%);
}

.inv-slot:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

.inv-slot.selected {
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px #000;
}

.inv-slot:hover {
    background-color: #444;
}

.inv-slot img,`n.equip-slot img,`n.essence-slot img,`n.special-slot img {`n    max-width: 42px; /* Ícone dentro do slot maior */`n    max-height: 42px;`n}

.inv-qtd {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 12px;
    font-family: var(--font-mono);
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
}

/* --- SISTEMA DE TROCA (TRADE) --- */
#trade-window {
    width: 500px !important;
}

.trade-area {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #333;
    border: 3px inset var(--ui-border-light);
    justify-content: space-between;
    margin: 8px;
}

.trade-side {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #3f3f3f;
    padding: 8px;
    border: 2px solid #000;
}

.trade-side h4 {
    margin: 0 0 8px 0;
    color: #fff;
    font-size: 13px;
    border-bottom: 2px solid #555;
    width: 100%;
    text-align: center;
}

.trade-slots-grid {
    background: #222;
    padding: 5px;
    border: 2px solid #555;
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.trade-slot {
    width: 42px;
    height: 42px;
    border: 1px solid #444;
    background: #2a2a2a;
    position: relative;
    cursor: pointer;
}

.trade-actions {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: var(--ui-bg);
}

.trade-btn {
    flex: 1;
    padding: 8px;
    font-size: 12px;
}

/* --- MENU DE CONTEXTO (Aumentado) --- */
#context-menu {
    position: fixed;
    background: var(--ui-bg);
    border: 3px outset var(--ui-border-light);
    box-shadow: 4px 4px 0 #000;
    display: flex;
    flex-direction: column;
    width: 160px;
    z-index: 500;
}

.context-btn {
    background: transparent;
    border: none;
    padding: 10px;
    text-align: left;
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 13px;
    cursor: pointer;
    border-bottom: 1px solid #555;
}

.context-btn:hover {
    background-color: #3e5fd1;
    color: #fff;
}

/* --- HUD DE CONVITE DE PARTY --- */
#ally-invite-hud {
    position: fixed;
    background: var(--ui-bg);
    border: 2px outset var(--ui-border-light);
    box-shadow: 3px 3px 0 #000;
    padding: 6px 8px;
    z-index: 2000;
    min-width: 160px;
    display: none;
    pointer-events: auto;
}

#ally-invite-name {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: #fff;
    margin-bottom: 6px;
}

#ally-invite-btn {
    width: 100%;
    padding: 6px 8px;
    font-family: var(--font-pixel);
    font-size: 12px;
    cursor: pointer;
    background: #2f7d32;
    border: 1px solid #1f4f21;
    color: #fff;
}

#ally-invite-btn:hover {
    background: #3e9a42;
}

#ally-trade-btn {
    width: 100%;
    margin-top: 6px;
    padding: 6px 8px;
    font-family: var(--font-pixel);
    font-size: 12px;
    cursor: pointer;
    background: #2f5aa8;
    border: 1px solid #1a3566;
    color: #fff;
}

#ally-trade-btn:hover {
    background: #3e72cf;
}

#party-invite-request,
#trade-invite-request {
    position: fixed;
    left: 50%;
    bottom: 40px;
    transform: translateX(-50%);
    background: var(--ui-bg);
    border: 3px outset var(--ui-border-light);
    box-shadow: 4px 4px 0 #000;
    padding: 10px 12px;
    z-index: 2000;
    min-width: 260px;
    text-align: center;
    display: none;
    pointer-events: auto;
}

#trade-invite-request {
    bottom: 110px;
}

#party-invite-text,
#trade-invite-text {
    font-family: var(--font-pixel);
    font-size: 12px;
    color: #fff;
    margin-bottom: 8px;
}

.party-invite-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

#party-invite-accept,
#party-invite-decline,
#trade-invite-accept,
#trade-invite-decline {
    padding: 6px 10px;
    font-family: var(--font-pixel);
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #333;
    color: #fff;
}

#party-invite-accept,
#trade-invite-accept {
    background: #2f7d32;
}

#party-invite-decline,
#trade-invite-decline {
    background: #a33;
}

#party-invite-accept:hover,
#trade-invite-accept:hover {
    background: #3e9a42;
}

#party-invite-decline:hover,
#trade-invite-decline:hover {
    background: #c44;
}

/* --- BARRA DE XP (Visível) --- */

/* --- TOOLTIPS --- */
#item-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #fff;
    color: white;
    padding: 8px;
    pointer-events: none;
    z-index: 20000 !important; /* Valor muito alto para ficar acima de tudo */
    display: none;
    font-size: 13px;
    font-family: var(--font-pixel);
    max-width: 250px;
    box-shadow: 0 0 10px rgba(0,0,0,0.5);
}

/* --- EQUIPAMENTOS --- */
#equipment-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    background: rgba(0, 0, 0, 0.18);
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    margin: 0;
}

.equip-slot {
    width: var(--slot-size); /* 48px */
    height: var(--slot-size);
    background: #333;
    border: 2px solid #555;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    box-shadow: inset 2px 2px 4px #000;
}

.equip-slot:hover { border-color: #fff; }

.equip-slot:empty {
    opacity: 0.4;
    filter: grayscale(100%);
}

/* --- HOTBAR (REFEITA) --- */
#hotbar-container {
    position: fixed;
    bottom: 15px; /* Um pouco mais baixo */
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px; /* Gap reduzido */
    background: rgba(0, 0, 0, 0.4);
    padding: 6px; /* Padding reduzido */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px; /* Raio reduzido */
    z-index: 98;
    max-width: calc(100% - 20px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s;
}

#battle-ui {
    position: fixed;
    bottom: 70px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    gap: 6px;
    z-index: 99;
    pointer-events: auto;
    padding: 6px 8px;
    background: rgba(80, 80, 80, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#battle-ui .battle-btn {
    width: 72px;
    height: 36px;
    background: rgba(35, 35, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    color: #fff;
    font-family: var(--font-pixel);
    font-size: 11px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: inset 2px 2px 4px #000;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#battle-ui .battle-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

#battle-ui .battle-btn-text {
    pointer-events: none;
}

#turn-tracker {
    position: fixed;
    top: 90px;
    right: 14px;
    display: none;
    flex-direction: column;
    gap: 10px;
    z-index: 99;
    pointer-events: none;
    --icon-size: 36px;
}

.turn-entry-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.turn-entry {
    width: var(--icon-size);
    height: var(--icon-size);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    box-shadow: inset 2px 2px 4px #000;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.turn-entry-dim {
    opacity: 0.8;
}

.turn-entry-timer {
    width: var(--icon-size);
    height: 14px;
    display: block;
}

#battle-flee-dialog .battle-flee-title {
    font-family: var(--font-pixel);
    font-size: 13px;
    color: #fff;
    margin-bottom: 6px;
    text-align: center;
}

#battle-flee-dialog .battle-flee-text {
    font-family: var(--font-pixel);
    font-size: 11px;
    color: #e6e6e6;
    margin-bottom: 10px;
    text-align: center;
}

#battle-flee-dialog .battle-flee-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

#hotbar-container:hover {
    opacity: 1;
}

.hotbar-slot {
    width: 36px; /* Reduzido de 44px */
    height: 36px; /* Reduzido de 44px */
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px; /* Raio reduzido */
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    pointer-events: auto !important;
}

.hotbar-slot:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.hotbar-slot.drag-over {
    background: rgba(255, 204, 0, 0.2);
    border-color: var(--gold);
    transform: scale(1.1);
}

.hotbar-slot.clicked {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.3);
}

.hotbar-slot.has-item {
    background: rgba(255, 255, 255, 0.1);
}

.hotbar-slot.is-spell {
    border-color: rgba(0, 123, 255, 0.4);
    box-shadow: inset 0 0 10px rgba(0, 123, 255, 0.2);
}

.hotbar-slot-attack {
    border-color: rgba(255, 204, 0, 0.4);
    box-shadow: inset 0 0 8px rgba(255, 204, 0, 0.2);
}

.hotbar-icon {
    width: 26px; /* Reduzido de 32px */
    height: 26px; /* Reduzido de 32px */
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    pointer-events: none;
}

.hotbar-emoji {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
    pointer-events: none;
}

.key-label {
    display: block;
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
    font-family: var(--font-pixel);
}

.hotbar-slot:hover .key-label {
    color: #fff;
}

/* --- COOLDOWN OVERLAY --- */
.hotbar-cooldown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    pointer-events: none;
    transition: opacity 0.05s linear;
}

.hotbar-cooldown-text {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-pixel);
    font-size: 13px;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
}

.hotbar-slot.on-cooldown {
    filter: brightness(0.6);
}

/* --- STATUS EFFECTS (BUFFS/DEBUFFS) --- */
.status-effects-hud {
    position: relative;
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
    z-index: 50;
    pointer-events: auto;
}

.status-effect-icon {
    width: 23px;
    height: 22px;
    background: transparent;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    opacity: 0.75;
    transition: opacity 0.2s ease;
}

.status-effect-icon:hover {
    opacity: 1;
}

.status-effect-icon img {
    width: 23px;
    height: 22px;
    object-fit: contain;
    pointer-events: none;
}

.status-effect-duration {
    position: absolute;
    bottom: -8px;
    right: -2px;
    background: transparent;
    color: #fff;
    font-size: 9px;
    padding: 0;
    border-radius: 0;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* --- PREMIUM ICON (CP 30 Dias) --- */
.status-bonus-row {
    position: fixed;
    top: 67px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: nowrap;
    z-index: 100;
    pointer-events: none;
}

.premium-status {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    pointer-events: auto;
    cursor: help;
}

.premium-status.hidden {
    display: none;
}

.premium-status img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}

.boost-exp-status {
    display: flex;
    align-items: center;
    opacity: 0.85;
    pointer-events: auto;
    cursor: help;
}

.boost-exp-status img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}

#boost-drop-status-container img {
    width: 24px;
    height: 24px;
    image-rendering: pixelated;
}

.boost-exp-status.hidden {
    display: none;
}

/* --- NPC & SHOPS --- */
#npc-window {
    width: 550px !important;
}

.npc-shop-grid {
    background: #222;
    border: 3px inset var(--ui-border-light);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 6px;
}

/* --- CASH SHOP PREMIUM --- */
.cash-shop-premium {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    text-align: center;
}

.cash-premium-title {
    font-weight: bold;
    font-size: 14px;
    color: #fff;
}

.cash-premium-sub {
    font-size: 12px;
    color: #c9c9c9;
}

.cash-premium-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
}

#cash-exp-boost-icon {
    width: auto;
    height: auto;
    max-width: 64px;
    max-height: 64px;
    image-rendering: pixelated;
    cursor: help;
}

#cash-drop-boost-icon {
    width: auto;
    height: auto;
    max-width: 64px;
    max-height: 64px;
    image-rendering: pixelated;
    cursor: help;
}

.cash-premium-divider {
    height: 1px;
    background: rgba(255,255,255,0.08);
    margin: 10px 0 6px;
}

#cash-premium-icon {
    width: auto;
    height: auto;
    max-width: 64px;
    max-height: 64px;
    image-rendering: pixelated;
    cursor: help;
}

.cash-premium-btn {
    background: #2e7d32;
    color: #fff;
    border: 2px outset #2e7d32;
    font-weight: bold;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 12px;
}

.cash-premium-btn:active { border-style: inset; }

.cash-premium-btn.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    filter: grayscale(0.2);
}

.shop-item-card {
    background: #3f3f3f;
    border: 2px solid #000;
    padding: 6px;
    color: #fff;
}

.shop-item-card:hover {
    background: #505050;
    border-color: #fff;
}

.shop-item-name { color: var(--gold); font-size: 12px; margin-bottom: 4px; }
.shop-item-price { color: #00c800; font-size: 12px; }

.shop-btn-buy {
    background: #222;
    border: 2px outset #555;
    color: #fff;
    width: 100%;
    margin-top: 4px;
    padding: 4px;
    font-size: 12px;
}

.shop-btn-buy:active { border-style: inset; }

/* --- CASH --- */

/* Janela Cash Shop */
.cash-shop-tabs {
    background: #222;
    padding: 4px;
    gap: 4px;
}

.cash-tab {
    background: #333;
    color: #888;
    border: 2px outset #555;
    font-size: 12px;
    padding: 6px;
}

.cash-tab.active {
    background: var(--ui-bg);
    color: #fff;
    border-bottom: none;
}

.cash-item-card {
    background: #2d2d2d;
    border: 2px solid #555;
    box-shadow: 2px 2px 0 #000;
}

/* --- MAP EDITOR TOOLS --- */
#tileset-hub-container {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 560px;
    max-height: 72vh;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 150;
    display: none;
    flex-direction: column;
    overflow: hidden;
    pointer-events: auto;
    transition: transform 0.3s ease;
}

#tileset-hub-header {
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: rgba(30, 30, 30, 0.45);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    cursor: move;
    user-select: none;
}

#tileset-hub-content {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 10px;
    padding: 10px;
    overflow: auto;
}

#tileset-hub-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

/* Melhoria para Mobile Horizontal */
@media (max-width: 932px) and (orientation: landscape) {
    #tileset-hub-container {
        width: 420px;
        max-height: 80vh;
        background: rgba(15, 15, 15, 0.5);
        font-size: 12px;
    }

    #tileset-hub-content {
        grid-template-columns: 1fr;
    }

    #tileset-hub-main {
        order: -1;
    }

    #special-tools {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }

    .special-tool-btn {
        height: 35px !important;
        font-size: 10px !important;
        border-radius: 4px !important;
        background: #333 !important;
        color: #eee !important;
        border: 1px solid #555 !important;
    }

    .special-tool-btn.active {
        background: #ffcc00 !important;
        color: #000 !important;
        border-color: #fff !important;
        font-weight: bold;
    }

    #layer-selector {
        gap: 4px !important;
    }

    .layer-btn {
        flex: 1;
        height: 30px !important;
        font-size: 11px !important;
        background: #444 !important;
        border: 1px solid #666 !important;
    }

    .layer-btn.active {
        background: #007bff !important;
        border-color: #fff !important;
    }

    #tileset-image-wrapper {
        max-height: 180px !important;
        border: 1px solid #ffcc00 !important;
    }

    .entity-tool-row {
        margin-bottom: 5px !important;
    }

    .entity-tool-row select {
        padding: 4px !important;
        font-size: 11px !important;
        background: #222 !important;
        color: #fff !important;
        border: 1px solid #444 !important;
    }
}

#tileset-image-wrapper {
    position: relative;
    border: 2px solid #000;
    background: #111;
    overflow: auto;
    max-height: 260px;
    border-radius: 4px;
}

#tileset-selector {
    position: absolute;
    width: 32px;
    height: 32px;
    border: 2px solid #ffcc00;
    background: rgba(255, 204, 0, 0.4);
    pointer-events: none;
    display: none;
    z-index: 10;
    box-shadow: 0 0 5px #ffcc00;
}

#special-tools {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

#layer-selector {
    display: flex;
    justify-content: space-between;
    gap: 5px;
}

#layer-visibility {
    display: flex;
    justify-content: space-between;
    background: rgba(255,255,255,0.05);
    padding: 5px;
    border-radius: 4px;
    font-size: 10px;
}

#layer-visibility label {
    margin-left: 2px;
    margin-right: 5px;
    color: #aaa;
}

#tileset-select-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    font-size: 11px;
    color: #ddd;
}

#tileset-select-row select {
    flex: 1;
    background: #111;
    color: #fff;
    border: 1px solid #444;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 11px;
}


/* --- DEBUG INFO --- */
#debug-info {
    position: fixed;       /* Fixa na tela */
    top: 10px;             /* Distância do topo */
    left: 50%;             /* Centraliza horizontalmente */
    transform: translateX(-50%);
    z-index: 2000;         /* Garante que fique acima de tudo (Canvas e UI) */
    
    background: rgba(0, 0, 0, 0.7); /* Fundo semi-transparente para leitura */
    color: #ffff00;        /* Texto Amarelo */
    border: 2px solid #fff;
    padding: 5px 10px;
    
    font-family: var(--font-mono); /* Usa a fonte definida no root */
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 0 #000;
    pointer-events: none;  /* Permite clicar através dele */
    display: none;         /* Começa invisível (o JS ativa depois) */
}



	/* ===== SKILLS HUD ===== */
#skills-container, #combat-skills-container {
    position: fixed;
    top: 150px;
    right: 20px;
    width: 280px; /* Aumentado de 220px para 280px */
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 0;
    z-index: 100;
    font-family: var(--font-pixel);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    left: auto; 
    bottom: auto;
    pointer-events: auto !important;
    overflow: hidden;
}

    #combat-skills-container {
        top: 400px; /* Posiciona abaixo da primeira HUD por padrão */
    }

#skills-container.hidden, #combat-skills-container.hidden {
    display: none !important;
}

.skills-title {
    text-align: center;
    color: #fff;
    background: rgba(30, 30, 30, 0.4);
    font-weight: bold;
    font-size: 11px;
    padding: 6px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: move;
    user-select: none;
}

/* Estilos de skill unificados e alinhados */
.skill-item {
    display: flex;
    align-items: center;
    padding: 6px 10px; /* Aumentado o padding */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 10px;
    background: rgba(0, 0, 0, 0.2);
    height: 32px; /* Aumentado de 24px para 32px */
    cursor: help;
}

.skill-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.skill-name {
    width: 100px; /* Aumentado de 75px para 100px */
    flex-shrink: 0;
    color: #eee;
    font-size: 11px; /* Aumentado de 10px para 11px */
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.skill-level {
    width: 45px; /* Aumentado de 35px para 45px */
    text-align: right;
    flex-shrink: 0;
    color: var(--gold);
    font-size: 11px; /* Aumentado de 10px para 11px */
    font-weight: bold;
}

.skill-bar {
    flex-grow: 1;
    height: 12px; /* Aumentado de 8px para 12px */
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    border-radius: 6px;
    overflow: hidden;
}

.skill-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 5px rgba(52, 152, 219, 0.5);
}


/* --- TOOLTIP DE SKILL --- */
.skill-entry {
    position: relative; /* Para posicionar o tooltip */
}

#skill-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--ui-border-light);
    padding: 8px;
    color: var(--color-text-main);
    font-family: var(--font-mono);
    font-size: 12px;
    z-index: 600;
    pointer-events: none;
    display: none;
    min-width: 150px;
    text-align: center;
    box-shadow: 3px 3px 0 #000;
}

#skill-tooltip strong {
    color: var(--gold);
    font-weight: bold;
}

/* --- ESTILOS DA LOJA DE NPC  */
.npc-shop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 itens por linha */
    gap: 10px;
    padding: 10px;
}

.shop-item-card {
    background: #2d2d2d;
    border: 2px outset var(--ui-border-light);
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 2px 2px 0 #000;
}

.shop-item-icon {
    width: 48px;
    height: 48px;
    image-rendering: pixelated;
    margin-bottom: 5px;
    border: 1px solid var(--ui-border-dark);
}

.shop-item-name {
    font-weight: bold;
    font-size: 14px;
    color: var(--color-text-highlight);
    margin-bottom: 5px;
}

.shop-item-price {
    font-size: 12px;
    color: var(--gold);
    margin-bottom: 8px;
}

.shop-btn-buy {
    width: 100%;
    padding: 5px;
    font-size: 12px;
}

/* --- ESTILOS DO FERREIRO (blacksmith) --- */
.blacksmith-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 5px;
    background: #333;
    border: 1px solid #555;
}

.blacksmith-upgrade-btn {
    padding: 5px 10px;
    font-size: 12px;
}

/* --- ESTILOS DA GUILDA --- */
.guild-form {
    padding: 20px;
    text-align: center;
}

.guild-input {
    width: 80%;
    padding: 8px;
    margin: 10px 0;
    background: #000;
    border: 3px inset var(--ui-border-light);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 14px;
}

/* --- HUD: SKILLS  --- */
#skills-container {
    position: fixed;
    top: 10px;
    right: 10px; /* Posicionamento no canto superior direito */
    width: 250px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    z-index: 99;
    display: flex;
    flex-direction: column;
    font-family: var(--font-pixel);
    color: var(--color-text-main);
}

#skills-container.hidden {
    display: none !important; /* Garante que a classe hidden funcione */
}

.skills-title {
    background: rgba(30, 30, 30, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 5px 8px;
    color: #fff;
    font-weight: bold;
    text-align: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* Estilos removidos para evitar duplicidade */

/* --- AJUSTES DO EDITOR DE RECURSOS --- */
#entity-editor-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 6px;
}

.entity-tool-row {
    display: flex;
    flex-direction: row;
    gap: 6px;
    padding: 4px 6px;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.entity-tool-row:last-child {
    border-bottom: none;
}

.entity-tool-row label {
    color: var(--gold);
    font-size: 11px;
    font-weight: bold;
    text-shadow: 1px 1px #000;
    white-space: nowrap;
    width: 110px;
}

.entity-tool-row select {
    background: #000;
    color: #fff;
    border: 1px solid var(--ui-border-light);
    padding: 3px 6px;
    font-family: var(--font-pixel);
    font-size: 11px;
    cursor: pointer;
    outline: none;
    flex-grow: 1;
    max-width: none;
}

.entity-tool-row select:hover {
    border-color: var(--gold);
}

#resourceSelect:hover {
    border-color: var(--gold);
}

#resourceSelect option {
    background: #222;
    padding: 5px;
}

#entity-editor-container .special-tool-btn {
    width: 100%;
}

/* --- JOYSTICK (Nipple.js) --- */
#joystick-container {
    position: fixed;
    bottom: 40px;
    left: 40px;
    width: 150px;
    height: 150px;
    z-index: 1000;
    pointer-events: auto;
}

#chat-container {
    bottom: 10px;
    left: 10px;
    width: 400px;
    height: 250px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.5) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: 8px;
}

/* Garantir que a UI não bloqueie o joystick em dispositivos móveis */
@media (max-width: 768px) {
    #joystick-container {
        bottom: 20px;
        left: 20px;
    }
}

/* --- OTIMIZAÇÃO MOBILE (HUD & INVENTÁRIO) --- */
@media (max-width: 1024px) {
    :root {
        --icon-size: 44px;
        --slot-size: 40px;
    }

    /* Ajuste do Inventário para Mobile (Janela Flutuante Compacta) */
    #inventory-window {
        position: fixed !important;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 92vw !important;
        max-width: none !important;
        height: auto !important;
        max-height: 90vh !important;
        border: 1px solid var(--ui-border-light) !important;
        box-shadow: 0 0 10px rgba(0,0,0,0.8) !important;
        display: flex !important;
        flex-direction: column;
        z-index: 9999 !important;
        background: rgba(10, 10, 10, 0.95) !important;
        backdrop-filter: blur(8px);
        pointer-events: auto !important;
        padding: 2px !important;
        margin: 0 !important;
        user-select: none !important;
        border-radius: 2px !important;
    }

    #inventory-window.hidden {
        display: none !important;
        pointer-events: none !important;
    }

    /* Estilo da Grade de Inventário no Mobile Compacto */
    #inventory-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 42px) !important;
        grid-auto-rows: 42px !important;
        gap: 1px !important;
        flex-grow: 0 !important;
        overflow-y: auto;
        margin: 0 !important;
        padding: 0 !important;
        max-height: 215px !important;
        background: rgba(0,0,0,0.2) !important;
        align-content: start !important;
        justify-content: center !important;
    }

    #inventory-top-section {
        padding: 0 !important;
        margin: 0 0 4px 0 !important; /* Margem apenas embaixo para separar do grid */
        display: flex !important;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px !important;
        align-items: flex-start;
        justify-content: center;
    }

    .ui-scroll-header {
        padding: 1px 4px !important;
        font-size: 9px !important;
        min-height: 14px !important;
        background: rgba(255, 255, 255, 0.03) !important;
        margin-bottom: 2px !important;
    }

    .ui-scroll-header span {
        line-height: 1 !important;
    }

    .ui-scroll-close {
        width: 16px !important; /* Botão fechar menor */
        height: 16px !important;
        font-size: 9px !important;
        line-height: 16px !important;
    }

    /* Ajuste dos Slots de Equipamento */
    #equipment-slots {
        zoom: 0.75; /* Zoom reduzido para 0.75 */
        margin: 0 auto !important;
    }

    #essence-slots,
    #special-slots {
        zoom: 0.75;
    }

    #appearance-panel {
        display: flex !important;
        flex: 1 1 auto;
        min-width: 150px;
        max-width: 240px;
    }

    #appearance-preview {
        width: 56px;
        height: 56px;
    }

    .appearance-row {
        grid-template-columns: 36px 20px 1fr 20px;
        padding: 2px 4px;
    }

    #inventory-grid {
        margin-top: 4px !important;
        max-height: 170px !important;
    }

    .equip-row {
        gap: 1px !important; /* Gap mínimo */
        margin-bottom: 1px !important;
    }

    .equip-slot, .inv-slot {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        max-width: 42px !important;
        max-height: 42px !important;
        border-radius: 2px !important;
        margin: 0 !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }

    .inv-slot img, .equip-slot img, .essence-slot img, .special-slot img {
        max-width: 32px !important;
        max-height: 32px !important;
    }

    /* HUD de Botões (Ajuste para não sobrepor o inventário) */
    #hud-buttons {
        bottom: 15px;
        right: 15px;
        gap: 5px;
    }

    /* Estilo Ultra-Minimalista para TODOS os Botões HUD no Mobile */
    .hud-icon {
        background: none !important;
        border: none !important;
        opacity: 0.75 !important;
        width: 24px !important; /* Reduzido de 32px para 24px */
        height: 24px !important;
        padding: 0 !important;
        cursor: pointer;
        filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.6));
        transition: transform 0.1s ease, opacity 0.1s ease;
    }

    .hud-icon img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    .hud-icon:active {
        transform: scale(0.85) !important;
        opacity: 1 !important;
    }

    /* Agrupamento de TODOS os botões em LINHA no Canto Superior Esquerdo */
    #hud-buttons {
        position: fixed !important;
        top: 8px !important;
        left: 8px !important;
        right: auto !important;
        bottom: auto !important;
        display: flex !important;
        flex-direction: row !important; /* Restaurado para linha */
        align-items: center !important;
        gap: 6px !important; /* Espaçamento horizontal reduzido */
        z-index: 1000 !important;
        background: rgba(0,0,0,0.25) !important;
        padding: 3px 6px !important;
        border-radius: 15px !important;
    }

    /* O inventário agora faz parte do grupo, não precisa de posição fixa própria */
    #btn-inventory {
        position: static !important;
    }

    /* Botão de Chat Minimalista e Padronizado */
    #tab-toggle-button {
        position: fixed !important;
        top: 45px !important;
        left: 12px !important;
        width: 24px !important;
        height: 24px !important;
        background: none !important;
        border: none !important;
        opacity: 0.75 !important;
        z-index: 10000 !important; /* Aumentado para garantir que fique sobre tudo */
        cursor: pointer;
        filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.6));
        padding: 0 !important;
        display: none !important; /* Oculto por padrão, exibido via JS para admins */
        align-items: center;
        justify-content: center;
        transition: transform 0.1s ease, opacity 0.1s ease;
        pointer-events: auto !important; /* Garante que receba cliques */
    }

    #tab-toggle-button img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    #tab-toggle-button:active {
        transform: scale(0.85) translate(2px, 2px) !important;
        opacity: 1 !important;
        filter: brightness(1.2) drop-shadow(1px 1px 1px rgba(0,0,0,0.8));
    }

    #chat-toggle-button {
        position: fixed !important;
        top: 45px !important; /* Mantido abaixo do inventário */
        left: 45px !important; /* Posicionado ao lado do botão TAB */
        width: 24px !important;
        height: 24px !important;
        background: none !important;
        border: none !important;
        opacity: 0.75 !important;
        z-index: 1000 !important;
        cursor: pointer;
        filter: drop-shadow(1px 1px 2px rgba(0,0,0,0.6));
        padding: 0 !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        transition: transform 0.1s ease, opacity 0.1s ease; /* Animação suave */
    }

    #chat-toggle-button img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    #chat-toggle-button:active {
        transform: scale(0.85) translate(2px, 2px) !important; /* Efeito de deslocamento idêntico ao inventário */
        opacity: 1 !important;
        filter: brightness(1.2) drop-shadow(1px 1px 1px rgba(0,0,0,0.8));
    }

    /* Botão de Interação Mobile (Tecla E) */
    .mobile-action-btn {
        position: fixed !important;
        bottom: 40px !important;
        right: 40px !important;
        width: 70px !important;
        height: 70px !important;
        background: none !important;
        border: none !important;
        padding: 0 !important;
        z-index: 1001 !important;
        cursor: pointer;
        display: flex !important;
        align-items: center;
        justify-content: center;
        opacity: 0.75 !important;
        transition: transform 0.1s ease, opacity 0.1s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-action-btn.hidden {
        display: none !important;
    }

    .btn-circle {
        width: 100% !important;
        height: 100% !important;
        background: rgba(200, 200, 200, 0.2) !important; /* Cinza claro transparente */
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 50% !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        backdrop-filter: blur(2px);
    }

    .mobile-action-btn img {
        width: 50% !important;
        height: 50% !important;
        object-fit: contain !important;
        filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
    }

    .mobile-action-btn:active {
        transform: scale(0.9) !important;
        opacity: 1 !important;
    }

    /* Chat Moderno, Transparente e Legível */
    #chat-container {
        width: 380px !important;
        height: 220px !important;
        bottom: 15px !important;
        left: 15px !important;
        background: rgba(0, 0, 0, 0.5) !important;
        border: none !important;
        box-shadow: none !important;
        opacity: 0.75 !important;
        backdrop-filter: blur(2px);
        display: flex !important;
        flex-direction: column;
        pointer-events: auto !important;
        z-index: 900 !important; /* Abaixo dos botões HUD */
    }

    #chat-container.hidden {
        display: none !important;
    }

    #chat-messages {
        flex-grow: 1;
        overflow-y: auto;
        padding: 8px !important;
        font-family: var(--font-pixel);
        font-size: 14px !important;
        /* Legibilidade Máxima: Contorno Preto nas Letras */
        text-shadow: 
            -1px -1px 0 #000,  
             1px -1px 0 #000,
            -1px  1px 0 #000,
             1px  1px 0 #000,
             2px  2px 2px rgba(0,0,0,0.8);
        color: #fff;
    }

    #chat-input-container {
        background: rgba(0, 0, 0, 0.3) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 5px !important;
    }

    #chat-input {
        background: transparent !important;
        border: none !important;
        color: #fff !important;
        text-shadow: 1px 1px 1px #000;
        width: 100%;
    }

    #chat-tabs {
        background: rgba(0, 0, 0, 0.4) !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
        cursor: move !important; /* Indica que a área é arrastável */
        user-select: none;
        touch-action: none;
    }

    .chat-tab {
        background: transparent !important;
        border: none !important;
        color: rgba(255, 255, 255, 0.6) !important;
        font-size: 11px !important;
        padding: 5px 10px !important;
        text-transform: uppercase;
    }

    .chat-tab.active {
        color: #fff !important;
        border-bottom: 2px solid var(--gold) !important;
    }

    #status-container {
        top: 80px;
        left: 10px;
        width: 240px;
    }
}

/* Ajustes específicos para Modo Paisagem no Mobile */
@media (max-width: 1024px) and (orientation: landscape) {
    #inventory-window {
        position: fixed !important;
        top: 50%;
        left: 50%;
        right: auto;
        bottom: auto;
        transform: translate(-50%, -50%);
        width: 92vw !important;
        max-width: none !important;
        height: auto !important;
        max-height: 90vh !important;
        border: 1px solid var(--ui-border-light) !important;
        box-shadow: 0 0 10px rgba(0,0,0,0.8) !important;
        display: flex !important;
        flex-direction: column;
        z-index: 9999 !important;
        background: rgba(10, 10, 10, 0.95) !important;
        backdrop-filter: blur(8px);
        pointer-events: auto !important;
        padding: 2px !important;
        margin: 0 !important;
        user-select: none !important;
        border-radius: 2px !important;
    }

    #chat-container {
        width: 250px;
        height: 140px;
    }

    #central-stats-wrapper {
        top: 5px;
        zoom: 0.8;
    }

    /* Ajuste da HUD de Spells para Mobile Landscape */
    #spells-hud {
        width: 220px !important; /* Reduzido de 250px */
        height: 200px !important; /* Reduzido de 300px */
        background: rgba(25, 25, 25, 0.45) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 8px !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    .spells-grid {
        background: rgba(0, 0, 0, 0.3) !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        padding: 4px !important;
        gap: 4px !important;
    }

    .spell-card {
        background: rgba(255, 255, 255, 0.06) !important;
        border: 1px solid rgba(255, 255, 255, 0.12) !important;
        border-radius: 6px !important;
        padding: 4px !important;
    }

    .spell-card img {
        width: 24px !important; /* Ícones menores */
        height: 24px !important;
    }

    .spell-name {
        font-size: 10px !important;
    }

    .spell-words {
        font-size: 9px !important;
    }

    /* Ajuste da HUD de Status (Char) para Mobile Landscape */
    #status-container {
        width: 220px !important; /* Reduzido de 240px/280px */
        max-height: 250px !important; /* Altura controlada */
        background: rgba(25, 25, 25, 0.45) !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 8px !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        top: 40px !important; /* Posicionamento simétrico */
        left: 10px !important;
    }

    #status-content {
        background: rgba(0, 0, 0, 0.3) !important;
        padding: 4px !important;
    }

    .status-row {
        font-size: 10px !important;
        padding: 3px 6px !important;
    }

    .status-points-row {
        font-size: 11px !important;
        margin-top: 4px !important;
    }

    .add-stat-btn {
        height: 18px !important;
        font-size: 10px !important;
        padding: 0 4px !important;
    }

    #status-header {
        background: linear-gradient(to bottom, #444, #222) !important;
        padding: 3px 8px !important;
        min-height: 20px !important;
    }

    #status-header h3 {
        font-size: 11px !important;
        margin: 0 !important;
    }

    #status-close-btn {
        width: 18px !important;
        height: 18px !important;
        font-size: 10px !important;
        line-height: 18px !important;
    }

    /* Ajuste das HUDs de Skills (Coleta e Combate) para Mobile Landscape */
    #skills-container, #combat-skills-container {
        width: 200px !important; /* Ainda mais estreito */
        max-height: 120px !important; /* Altura fixa reduzida para forçar rolagem */
        background: rgba(30, 30, 30, 0.95) !important;
        border: 2px solid #444 !important;
        border-radius: 8px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6) !important;
        right: 10px !important;
        top: 40px !important;
        overflow-y: auto !important; /* Habilita rolagem vertical */
        scrollbar-width: thin; /* Scrollbar discreta */
        scrollbar-color: #555 transparent;
    }

    #combat-skills-container {
        top: 170px !important; /* Ajustado para ficar logo abaixo da primeira */
    }

    /* Estilo da barra de rolagem para navegadores Webkit (Chrome/Safari) */
    #skills-container::-webkit-scrollbar, #combat-skills-container::-webkit-scrollbar {
        width: 4px;
    }
    #skills-container::-webkit-scrollbar-thumb, #combat-skills-container::-webkit-scrollbar-thumb {
        background: #555;
        border-radius: 2px;
    }

    .skills-title {
        background: linear-gradient(to bottom, #444, #222) !important;
        padding: 4px 0 !important;
        font-size: 10px !important;
        position: sticky; /* Mantém o título fixo no topo ao rolar */
        top: 0;
        z-index: 1;
    }

    .skill-item {
        padding: 4px 8px !important;
        height: 28px !important; /* Reduzido de 32px */
        background: rgba(0, 0, 0, 0.2) !important;
        gap: 6px !important;
    }

    .skill-name {
        width: 80px !important; /* Reduzido de 100px */
        font-size: 10px !important;
    }

    .skill-level {
        width: 35px !important;
        font-size: 10px !important;
    }

    .skill-bar {
        height: 10px !important; /* Reduzido de 12px */
    }
}

@media (max-width: 1024px) {
    /* Cabeçalho do Inventário Compacto para Mobile */
    .ui-scroll-header {
        height: 40px !important;
        padding: 0 10px !important;
        cursor: move !important;
        touch-action: none !important; /* Impede o scroll do navegador ao arrastar */
        user-select: none !important;
    }

    .ui-scroll-header span {
        font-size: 13px !important; /* Letras menores */
    }

    .ui-scroll-close {
        width: 28px !important;
        height: 28px !important;
        font-size: 16px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
        z-index: 3100 !important;
        position: relative;
    }

    /* Ajuste dos slots para toque */
    .inv-slot {
        border-width: 3px;
    }

    .inv-qtd {
        font-size: 14px;
    }
}

/* ===== MODAIS (CONFIRMAÇÃO E QUANTIDADE) ===== */
#modal-confirm, #quantity-modal, #stat-add-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4); /* Fundo escurecido leve */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    pointer-events: auto; /* Garante que cliques fora fechem ou sejam bloqueados apenas aqui */
}

#modal-confirm.hidden, #quantity-modal.hidden, #stat-add-modal.hidden {
    display: none !important;
    pointer-events: none;
}

.modal-box {
    background: rgba(30, 30, 30, 0.75); /* Mais escuro e sofisticado */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 12px;
    min-width: 200px; /* Mais compacta */
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    color: #eee;
    image-rendering: auto;
}

.modal-box h3 {
    margin: 0 0 8px 0;
    font-size: 13px; /* Menor e discreto */
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gold);
    opacity: 0.9;
}

.modal-box p {
    margin: 5px 0;
    font-size: 11px;
    color: #bbb;
}

.modal-btn {
    padding: 5px 12px;
    min-width: 60px;
    cursor: pointer;
    font-family: var(--font-pixel);
    font-size: 11px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    color: #fff;
    transition: all 0.2s ease;
}

.modal-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.modal-btn:active {
    transform: scale(0.95);
}

#quantity-input,
#stat-add-input {
    width: 60px !important;
    padding: 4px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 4px !important;
    color: var(--gold) !important;
    font-size: 16px !important;
    margin: 10px 0 !important;
    outline: none;
}




/* ===================================
   ESTILOS PARA OBJETOS INTERATIVOS (PLACAS)
   =================================== */

#interactable-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, rgba(20, 20, 30, 0.98) 0%, rgba(40, 30, 60, 0.98) 100%);
    border: 3px solid #FFD700;
    border-radius: 12px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 400px;
    z-index: 10000;
    box-shadow: 
        0 0 30px rgba(255, 215, 0, 0.6),
        inset 0 0 20px rgba(255, 215, 0, 0.1),
        0 10px 40px rgba(0, 0, 0, 0.8);
    font-family: Arial, sans-serif;
    color: #fff;
    overflow-y: auto;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

#interactable-dialog h2 {
    color: #FFD700;
    margin: 0 0 15px 0;
    font-size: 24px;
    text-shadow: 0 2px 10px rgba(255, 215, 0, 0.5);
    font-weight: bold;
    letter-spacing: 1px;
}

#interactable-dialog p {
    margin: 0 0 20px 0;
    line-height: 1.8;
    font-size: 14px;
    text-align: left;
    white-space: pre-wrap;
    word-wrap: break-word;
    color: #e0e0e0;
}

#close-interactable-btn {
    background: linear-gradient(135deg, #FFD700 0%, #FFC700 100%);
    color: #000;
    border: 2px solid #FFB700;
    padding: 12px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#close-interactable-btn:hover {
    background: linear-gradient(135deg, #FFC700 0%, #FFB700 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

#close-interactable-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

/* Scrollbar do Diálogo */
#interactable-dialog::-webkit-scrollbar {
    width: 8px;
}

#interactable-dialog::-webkit-scrollbar-track {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 10px;
}

#interactable-dialog::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 10px;
}

#interactable-dialog::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

/* Responsividade para Mobile */
@media (max-width: 600px) {
    #interactable-dialog {
        width: 95%;
        max-height: 70vh;
        padding: 15px;
    }
    
    #interactable-dialog h2 {
        font-size: 20px;
        margin-bottom: 10px;
    }
    
    #interactable-dialog p {
        font-size: 13px;
        line-height: 1.6;
    }
    
    #close-interactable-btn {
        padding: 10px 20px;
        font-size: 12px;
    }
}

/* =================================== */
/* SISTEMA DIA/NOITE - CÓDIGO ADICIONAL */
/* =================================== */

#daynight-container {
    position: fixed;
    pointer-events: none; /* Não interfere com cliques */
    z-index: 50; /* Acima do canvas, abaixo de janelas */
    
    /* Aplicando fundo cinza transparente e bordas arredondadas */
    background: rgba(200, 200, 200, 0.2); /* Cinza claro transparente */
    border-radius: 5px; /* Arredondamento */
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
    padding: 3px; /* Adicionando padding para a imagem não encostar na borda */
    
    /* Oculto por padrão, aparece com a UI do jogo */
    display: none;
    
}

/* Mostra o container quando a UI do jogo está ativa */
body.game-active #daynight-container {
    display: block;
}

#daynight-image {
    display: block;
    width: 16px;
    height: 46px; /* Revertido para a altura original da imagem */
    image-rendering: pixelated; /* Mantém o estilo pixel art */
    opacity: 0.75; /* Opacidade de 75% para combinar com a HUD */
}

/* --- POSICIONAMENTO PC (Telas maiores que 768px) --- */
@media screen and (min-width: 1025px) {
    #daynight-container {
        /* Ajustes do Usuário para PC */
        top: 2.80%; 
        left: 44%;
        transform: translate(250px, -40%); 
    }
}

/* Ajuste para telas mobile */
@media screen and (max-width: 1024px) {
    /* --- POSICIONAMENTO MOBILE: Colado na HUD Central --- */
    #daynight-container {
        /* Mesma altura do top da HUD mobile (5px) */
        top: 4.3px !important; 
        left: 48.48% !important;
        /* Ajuste: 120px é uma estimativa para metade da largura da HUD mobile (240px) */
        transform: translate(120px, 0) !important; 
        right: auto !important;
    }
}

/* --- NOVO LAYOUT DE EQUIPAMENTOS (10 SLOTS) --- */
#equipment-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    margin-bottom: 0;
    width: fit-content;
}

.equip-row {
    display: flex;
    gap: 6px;
    justify-content: center;
}

/* Centraliza o slot de bota na última linha */
.equip-slot-center {
    margin: 0 auto;
}

/* Estilização base dos slots para garantir alinhamento */
.equip-slot {
    width: var(--slot-size);
    height: var(--slot-size);
    background-color: #333;
    border: 2px solid #555;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
    box-shadow: inset 2px 2px 4px #000;
}

.equip-slot:hover {
    background-color: #4a4a4a;
    border-color: var(--gold);
}

/* --- HUD DE MAGIAS --- */
#spells-hud {
    width: 250px;
    height: 300px;
    top: 100px;
    right: 10px;
    background: rgba(25, 25, 25, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#spells-hud .ui-scroll-header {
    background: rgba(30, 30, 30, 0.4);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.spells-grid {
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    flex-grow: 1;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin: 4px;
}

.spell-card {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    user-select: none;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.spell-card:hover {
    background: rgba(255, 255, 255, 0.12);
}

.spell-card img {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
}

.spell-info {
    display: flex;
    flex-direction: column;
}

.spell-name {
    font-size: 12px;
    font-weight: bold;
    color: var(--gold);
}

.spell-words {
    font-size: 10px;
    color: #aaa;
    font-style: italic;
}

.spell-card.dragging {
    opacity: 0.5;
}

.spell-card.locked {
    filter: brightness(0.4) grayscale(0.6);
    cursor: not-allowed;
    opacity: 0.7;
}

.spell-card.locked:hover {
    background: rgba(255, 255, 255, 0.06);
}

.spell-card.locked img {
    opacity: 0.5;
}

#crafting-window, #smelting-window, #carpentry-window, #forging-window, #jewelscraft-window, #cooking-window {
    width: 420px !important; /* Mais compacto */
    height: 320px;
    border-radius: 10px;
    overflow: hidden;
}

#crafting-container, #smelting-container, #carpentry-container, #forging-container, #jewelscraft-container, #cooking-container {
    display: flex;
    height: calc(100% - 35px); /* Ajuste para o header */
    background: rgba(20, 20, 20, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

#crafting-list, #smelting-list, #carpentry-list, #forging-list, #jewelscraft-list, #cooking-list {
    width: 150px; /* Mais estreito */
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.3);
}

.craft-item-row {
    padding: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    transition: background 0.2s;
}

.craft-item-row:hover { background: rgba(255, 255, 255, 0.05); }
.craft-item-row.selected { 
    background: rgba(255, 204, 0, 0.1); 
    border-left: 3px solid var(--gold);
}

.craft-item-row img { 
    width: 28px; 
    height: 28px; 
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.5));
}

#crafting-details, #smelting-details, #carpentry-details, #forging-details, #jewelscraft-details, #cooking-details {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.craft-header { 
    text-align: center; 
    margin-bottom: 10px; 
    width: 100%;
}
.craft-header img { 
    width: 48px; 
    height: 48px; 
    margin-bottom: 4px; 
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}
.craft-header h3 { 
    color: var(--gold); 
    margin: 0; 
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.craft-materials {
    width: 100%;
    background: rgba(0,0,0,0.4);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 10px;
}

.material-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
    font-size: 11px;
    color: #ccc;
}

.material-info { display: flex; align-items: center; gap: 6px; }
.material-info img { width: 20px; height: 20px; }

.btn-craft {
    background: linear-gradient(180deg, rgba(40, 167, 69, 0.6), rgba(30, 126, 52, 0.6));
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    width: 100%; /* Ocupa a largura total do container de detalhes */
    max-width: 180px;
    height: 36px;
    font-size: 13px;
    font-family: var(--font-pixel);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

.btn-craft:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(40, 167, 69, 0.8), rgba(30, 126, 52, 0.8));
    transform: translateY(-1px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.btn-craft:active:not(:disabled) {
    transform: scale(0.95);
}

.btn-craft:disabled { 
    background: rgba(108, 117, 125, 0.2); 
    border-color: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}



/* Desabilita tooltips em imagens das janelas de craft */
.no-tooltip {
    pointer-events: none !important;
}

.no-skill-tooltip * {
    pointer-events: auto !important;
}

.no-skill-tooltip .skill-item, 
.no-skill-tooltip .skill-entry {
    cursor: default !important;
}



/* --- BOTÃO DE INTERAÇÃO (Simula Tecla E) --- */
#interaction-button-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    width: 120px;
    height: 120px;
    z-index: 1000;
    pointer-events: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Otimização Mobile para o Botão de Interação */
@media (max-width: 768px) {
    #interaction-button-container {
        bottom: 20px;
        right: 20px;
        width: 100px;
        height: 100px;
    }
}










