* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    scrollbar-width: thin;
    scrollbar-color: #2a4029 #0d150e;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
*::-webkit-scrollbar-track {
    background: #0d150e;
}
*::-webkit-scrollbar-thumb {
    background: #2a4029;
    border-radius: 3px;
    border: 1px solid #1a2a19;
}
*::-webkit-scrollbar-thumb:hover {
    background: #4a6c47;
}

body {
    background: #080d09;
    color: #e5d8c8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

#app {
    width: 100vw;
    height: 100vh;
    position: relative;
    overflow: hidden;
}

/* =========================================================
   AUTENTICAÇÃO & PERSONAGENS (RESTAURO VISUAL COMPLETO)
   ========================================================= */
#auth-screen, #character-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #080d09;
    z-index: 1000;
}

.auth-card {
    width: 420px;
    background: #101911;
    border: 2px solid #4a6845;
    outline: 1px solid #1c2b1a;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.95), inset 0 1px 0 rgba(255,255,255,0.08);
    overflow: hidden;
}

.auth-card.wide {
    width: 480px;
}

.auth-header {
    background: linear-gradient(90deg, #253924 0%, #1a2718 100%);
    padding: 16px 20px;
    border-bottom: 1px solid #3d5838;
    text-align: center;
}

.auth-header h2 {
    font-size: 18px;
    color: #f5cf7b;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
}

.auth-header p {
    font-size: 11px;
    color: #88b584;
    margin-top: 4px;
}

.auth-tabs {
    display: flex;
    background: #0b110c;
    border-bottom: 1px solid #233423;
}

.auth-tab-btn {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: none;
    color: #8da488;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.auth-tab-btn:hover {
    color: #f5cf7b;
    background: rgba(255,255,255,0.02);
}

.auth-tab-btn.active {
    color: #ffd700;
    background: #101911;
    border-bottom: 2px solid #ffd700;
}

.auth-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.auth-field label {
    font-size: 11px;
    color: #88b584;
    font-weight: bold;
}

.auth-input {
    width: 100%;
    padding: 10px 12px;
    background: #090e0a;
    border: 1px solid #283e27;
    border-radius: 4px;
    color: #f5cf7b;
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s ease;
}

.auth-input:focus {
    border-color: #5c8456;
    box-shadow: 0 0 6px rgba(92,132,86,0.4);
}

.auth-msg {
    min-height: 16px;
    font-size: 11px;
    text-align: center;
    font-weight: bold;
}

.btn-auth-submit {
    width: 100%;
    padding: 12px;
    background: linear-gradient(180deg, #385635 0%, #233721 100%);
    border: 1px solid #557e50;
    border-radius: 4px;
    color: #ffd700;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
}

.btn-auth-submit:hover {
    background: linear-gradient(180deg, #446840 0%, #2b4429 100%);
    border-color: #6da267;
    color: #ffffff;
}


/* GAME SCREEN & UI LAYER */
#game-screen { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; z-index: 1; }
#game-canvas { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; display: block; z-index: 0; background: #111d13; }
#game-ui { position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 10; }
#game-ui > * { pointer-events: auto; }



  * { box-sizing: border-box; margin: 0; padding: 0; user-select: none; }
  body {
    background: #080d09;
    color: #e5d8c8;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
  }
  #game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
  }
  canvas {
    display: block;
    image-rendering: auto;
    background: #111d13;
  }

  /* =========================================================
     ESTILOS VISUAIS RESTAURADOS (MMORPG SANDBOX PREMIUM)
     ========================================================= */
  .rpg-window {
    position: absolute;
    background: rgba(16, 24, 17, 0.98);
    border: 2px solid #4a6845;
    outline: 1px solid #1c2b1a;
    border-radius: 6px;
    box-shadow: 0 16px 45px rgba(0,0,0,0.95), inset 0 1px 0 rgba(255,255,255,0.08);
    display: none;
    flex-direction: column;
    z-index: 100;
    overflow: hidden;
    transition: width 0.2s ease, height 0.2s ease;
  }

  /* Ícone Pixel Art da Moeda de Ouro (Substitui emojis com falhas visuais) */
  .gold-coin-icon {
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url('../assets/sprites/items/gold_coin.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    vertical-align: -2px;
    margin-right: 3px;
    image-rendering: pixelated;
  }
  .gold-coin-icon.big {
    width: 18px;
    height: 18px;
    vertical-align: -3px;
  }

  /* Modal de Diálogo com NPC - Móvel, Altura Automática e Limpo */
  .npc-dialogue-modal-box {
    position: absolute;
    width: 460px;
    max-width: 94vw;
    height: auto;
    min-height: 0;
    background: rgba(16, 24, 17, 0.98);
    border: 2px solid #4a6845;
    outline: 1px solid #1c2b1a;
    border-radius: 6px;
    box-shadow: 0 16px 45px rgba(0,0,0,0.95), inset 0 1px 0 rgba(255,255,255,0.08);
    display: none;
    flex-direction: column;
    z-index: 120;
    overflow: hidden;
    pointer-events: auto;
    user-select: none;
  }
  
  .window-header {
    background: linear-gradient(90deg, #253924 0%, #1a2718 100%);
    padding: 7px 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3d5838;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    cursor: grab;
    flex-shrink: 0;
  }
  .window-header:active { cursor: grabbing; }
  .window-header h3, .window-header h2 {
    font-size: 13px;
    color: #f5cf7b;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 7px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
    pointer-events: none;
    letter-spacing: 0.3px;
  }

  .window-header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .btn-win-action {
    background: transparent;
    border: none;
    color: #8fa68c;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    transition: all 0.15s ease;
    line-height: 1;
  }
  .btn-win-action:hover {
    color: #ffd700;
    background: rgba(255,255,255,0.08);
    transform: scale(1.1);
  }
  .btn-close-win:hover { color: #ff6b6b; }

  /* Abas Superiores */
  .tab-bar {
    display: flex;
    background: #0d150e;
    padding: 5px 6px;
    gap: 4px;
    border-bottom: 1px solid #233423;
    overflow-x: hidden;
    white-space: nowrap;
    flex-shrink: 0;
    scrollbar-width: none;
  }
  .tab-bar::-webkit-scrollbar {
    display: none;
  }
  .tab-btn {
    flex: 1;
    text-align: center;
    background: #152216;
    border: 1px solid #2a4029;
    color: #9cb198;
    font-size: 10.5px;
    padding: 5px 4px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
  }
  .tab-btn:hover { background: #223723; border-color: #4a6c47; color: #fff; }
  .tab-btn.active {
    background: #2b4728;
    border-color: #639c5b;
    color: #f5cf7b;
    font-weight: bold;
    box-shadow: 0 0 6px rgba(99, 156, 91, 0.3);
  }

  /* Inventário */
  #inv-window { width: 400px; }
  #inv-window.expanded { width: 560px; }
  #inv-window.expanded .inv-grid-container {
    grid-template-columns: repeat(7, 1fr);
    max-height: 420px;
  }
  .inv-controls {
    display: flex;
    justify-content: space-between;
    padding: 6px 10px;
    background: #111a12;
    border-bottom: 1px solid #233423;
    gap: 6px;
    flex-shrink: 0;
  }
  .inv-search {
    background: #090e0a;
    border: 1px solid #263825;
    color: #eee;
    font-size: 10.5px;
    padding: 5px 8px;
    border-radius: 4px;
    flex: 1;
    outline: none;
  }
  .inv-search:focus { border-color: #558550; }
  .inv-sort-select {
    background: #090e0a;
    border: 1px solid #263825;
    color: #f5cf7b;
    font-size: 10.5px;
    padding: 4px 6px;
    border-radius: 4px;
    outline: none;
    cursor: pointer;
  }
  .inv-grid-container {
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
    background: #0b110c;
    max-height: 290px;
    overflow-y: auto;
    min-height: 180px;
  }
  .grid-slot {
    aspect-ratio: 1;
    background: #131e14;
    border: 1px solid #2a3d28;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.6);
    border-radius: 4px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .grid-slot:hover {
    border-color: #639c5b;
    background: #1b2b1d;
    box-shadow: 0 0 8px rgba(99, 156, 91, 0.4);
    transform: translateY(-1px);
  }
  .grid-slot .slot-icon { font-size: 26px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.8)); pointer-events: none; }
  .grid-slot .slot-qty {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 10px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 2px #000;
    pointer-events: none;
  }
  .slot-tier {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: 7.5px;
    padding: 1px 4px;
    border-radius: 2px;
    font-weight: bold;
    pointer-events: none;
    line-height: 1.1;
    z-index: 6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.8);
  }
  .tier-bg-1 { background: #2f5431; color: #b7ebb9; border: 1px solid #437045; }
  .tier-bg-2 { background: #1b4566; color: #bde0ff; border: 1px solid #28608d; }
  .tier-bg-3 { background: #5c2061; color: #fabfff; border: 1px solid #82348a; }
  .tier-bg-4 { background: #6e4e14; color: #ffe89e; border: 1px solid #b8860b; }
  .tier-bg-5 { background: #782614; color: #ffbe9e; border: 1px solid #d35400; }

  .item-icon-img {
    max-width: 40px;
    max-height: 40px;
    object-fit: contain;
    image-rendering: pixelated;
    pointer-events: none;
  }

  .inv-footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    background: #101911;
    border-top: 1px solid #233423;
    font-size: 11px;
    color: #b7cab4;
    font-weight: 500;
    flex-shrink: 0;
  }

  /* Personagem */
  #char-window { width: 570px; max-width: 95vw; }
  #char-window.expanded { width: 700px; }
  
  .char-header-progression {
    background: linear-gradient(180deg, #162417 0%, #0f1810 100%);
    padding: 8px 14px;
    border-bottom: 1px solid #283a27;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
  }
  .char-header-progression .char-prog-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: bold;
    color: #f5cf7b;
  }
  .char-header-progression .char-prog-tag {
    font-size: 10.5px;
    padding: 2px 8px;
    background: #1f3020;
    border: 1px solid #3d5838;
    border-radius: 3px;
    color: #ffd700;
  }

  .char-content-box {
    display: flex;
    padding: 12px 14px;
    gap: 16px;
    background: #0b110c;
    min-height: 330px;
    max-height: 480px;
    overflow-y: auto;
    align-items: stretch;
  }
  .char-paperdoll-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: #0f1610;
    padding: 10px 11px;
    border: 1px solid #273b26;
    border-radius: 6px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.6);
    flex-shrink: 0;
    align-self: flex-start;
  }
  .char-paperdoll-section-title {
    font-size: 9.5px;
    font-weight: 700;
    color: #f5cf7b;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    padding-bottom: 2px;
    border-bottom: 1px solid #243823;
    display: flex;
    align-items: center;
    gap: 4px;
  }
  .char-paperdoll-section-title.specials {
    color: #6de0a7;
    border-bottom-color: #1a3821;
    margin-top: 3px;
  }
  .char-paperdoll {
    display: grid;
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(3, 56px);
    gap: 8px;
    align-items: center;
    justify-content: center;
  }
  .char-paperdoll.specials {
    grid-template-rows: 56px;
  }
  .equip-slot {
    width: 56px;
    height: 56px;
    background: #141f15;
    border: 1px solid #2a3d29;
    box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
    border-radius: 5px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.15s ease;
  }
  .equip-slot.special-slot {
    border-color: #274836;
    background: #112015;
  }
  .equip-slot.special-slot:hover {
    border-color: #6de0a7;
    box-shadow: 0 0 10px rgba(109, 224, 167, 0.4);
  }
  .equip-slot.special-slot .equip-slot-label {
    color: #79c99e;
  }
  .equip-slot.has-item {
    border-color: #558750;
    background: radial-gradient(circle at center, #1b301c 0%, #101911 100%);
    box-shadow: inset 0 0 8px rgba(0,0,0,0.4);
  }
  .equip-slot.has-item.special-slot {
    border-color: #3bb273;
    background: radial-gradient(circle at center, #183827 0%, #0d1a12 100%);
  }
  .equip-slot:hover {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    transform: translateY(-1px);
  }
  .equip-slot.drag-over {
    border-color: #ffd700 !important;
    background: rgba(255, 215, 0, 0.18) !important;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.6) !important;
    transform: scale(1.05);
  }
  .equip-slot.is-dragging {
    opacity: 0.4;
    border-style: dashed;
  }
  .equip-slot .equip-slot-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 24px;
    pointer-events: none;
    line-height: 1;
  }
  .equip-slot .equip-slot-icon img,
  .equip-slot img {
    max-width: 36px;
    max-height: 36px;
    object-fit: contain;
    image-rendering: pixelated;
    pointer-events: none;
  }
  .equip-slot:not(.has-item) .equip-slot-icon {
    font-size: 18px;
    opacity: 0.35;
    filter: grayscale(100%);
    margin-bottom: 7px;
  }
  .equip-slot-label {
    position: absolute;
    bottom: 3px;
    font-size: 7.5px;
    font-weight: 700;
    color: #6da361;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    pointer-events: none;
    line-height: 1;
    text-shadow: 0 1px 2px #000;
  }
  .equip-slot .slot-dura-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    font-weight: bold;
    color: #ffd700;
    background: rgba(0, 0, 0, 0.85);
    padding: 1px 3px;
    border-radius: 2px;
    border: 1px solid #4a6845;
    pointer-events: none;
    line-height: 1;
    z-index: 6;
  }
  .char-panel-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    justify-content: flex-start;
  }

  .btn-dock-inv {
    background: linear-gradient(180deg, #2b452a 0%, #1e331e 100%);
    border: 1px solid #4d7a4a;
    color: #f5cf7b;
    padding: 7px 10px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    transition: all 0.15s;
  }
  .btn-dock-inv:hover { background: #365735; border-color: #6da367; color: #fff; }

  .level-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: bold;
    color: #f5cf7b;
  }
  .xp-bar-bg {
    width: 100%;
    height: 9px;
    background: #0e150f;
    border: 1px solid #2a3d29;
    border-radius: 5px;
    overflow: hidden;
    margin: 2px 0 6px 0;
  }
  .xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3d8841, #5cb85c);
    width: 0%;
    transition: width 0.3s ease;
  }
  .stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    color: #b9cdb6;
    padding: 3px 6px;
    border-bottom: 1px solid #162217;
    border-radius: 2px;
    transition: background 0.1s ease;
  }
  .stat-row:hover {
    background: rgba(255,255,255,0.02);
  }
  .stat-row strong { color: #fff; font-weight: 600; text-align: right; }

  /* Mesa Craft & Fogueira */
  #craft-window, #campfire-window { width: 560px; }
  #craft-window.expanded, #campfire-window.expanded { width: 720px; }
  #craft-window.expanded .split-craft-layout, #campfire-window.expanded .split-craft-layout { height: 470px; }
  .split-craft-layout { display: flex; background: #0b110c; height: 430px; }
  .craft-items-list {
    width: 220px;
    border-right: 1px solid #233423;
    overflow-y: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: #0e150f;
    flex-shrink: 0;
  }
  .craft-card-mini {
    background: #141f15;
    border: 1px solid #283a27;
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .craft-card-mini:hover { background: #1b291c; border-color: #4a7047; transform: translateX(2px); }
  .craft-card-mini.selected { background: #223721; border-color: #ffd700; box-shadow: 0 0 8px rgba(255, 215, 0, 0.3); }
  .craft-card-mini.is-tier-locked { opacity: 0.65; border-left: 3px solid #e74c3c; }
  .mini-icon { font-size: 20px; filter: drop-shadow(0 2px 2px rgba(0,0,0,0.6)); }
  .mini-details h5 { font-size: 11px; color: #e5d8c8; font-weight: 600; }
  .mini-details span { font-size: 9.5px; color: #7fad79; }

  .craft-details-panel {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: #0b110c;
    overflow-y: auto;
  }
  .selected-recipe-header {
    display: flex;
    gap: 10px;
    align-items: center;
    border-bottom: 1px solid #233423;
    padding-bottom: 8px;
  }
  .big-recipe-icon {
    font-size: 32px;
    background: #141f15;
    padding: 6px;
    border-radius: 6px;
    border: 1px solid #2d422c;
  }
  .req-materials-box { margin: 10px 0; flex: 1; }
  .req-materials-box h5 { font-size: 11px; color: #8da488; margin-bottom: 6px; text-transform: uppercase; }
  .req-mat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 5px;
    color: #e5d8c8;
    background: #121a12;
    padding: 4px 6px;
    border-radius: 4px;
    border: 1px solid #1f2d1e;
  }
  .craft-action-row { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
  .qty-counter {
    display: flex;
    align-items: center;
    background: #111a12;
    border: 1px solid #2a3d28;
    border-radius: 4px;
    overflow: hidden;
  }
  .qty-counter button { background: #1a291b; border: none; color: #eee; padding: 5px 9px; cursor: pointer; }
  .qty-counter button:hover { background: #2b452a; color: #fff; }
  .qty-counter span { padding: 0 10px; font-size: 11px; font-weight: bold; color: #f5cf7b; }
  .btn-craft-main {
    flex: 1;
    position: relative;
    background: linear-gradient(180deg, #326e38 0%, #204e25 100%);
    border: 1px solid #52965a;
    color: #fff;
    padding: 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    overflow: hidden;
  }
  .btn-craft-main .btn-craft-progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, rgba(243, 156, 18, 0.45), rgba(211, 84, 0, 0.65));
    border-right: 2px solid #ffd700;
    pointer-events: none;
    transition: width 0.05s linear;
  }
  .btn-craft-main .btn-craft-text {
    position: relative;
    z-index: 2;
    pointer-events: none;
  }
  .btn-craft-main:hover:not(:disabled) { background: linear-gradient(180deg, #3c8243 0%, #275d2d 100%); border-color: #6cb875; }
  .btn-craft-main:disabled { background: #19271a; border-color: #273b28; color: #557555; cursor: not-allowed; }
  .btn-craft-main.is-crafting {
    background: #1b2e19 !important;
    border-color: #f39c12 !important;
    color: #f5cf7b !important;
    cursor: wait !important;
  }
  .btn-craft-main.is-ready-collect {
    background: linear-gradient(180deg, #d35400 0%, #b8860b 100%) !important;
    border: 2px solid #ffd700 !important;
    color: #fff !important;
    cursor: pointer !important;
    box-shadow: 0 0 14px rgba(255, 215, 0, 0.7) !important;
    animation: pulseCollect 1s infinite alternate ease-in-out;
  }
  @keyframes pulseCollect {
    from { transform: scale(1); box-shadow: 0 0 8px rgba(255, 215, 0, 0.5); }
    to { transform: scale(1.02); box-shadow: 0 0 18px rgba(255, 215, 0, 0.9); }
  }

  /* Baú integrado da Mesa/Fogueira */
  .station-output-box {
    margin-top: 8px;
    padding: 7px;
    background: linear-gradient(180deg, #121a12 0%, #0b110c 100%);
    border: 1px solid #344c31;
    border-radius: 5px;
    box-shadow: inset 0 0 12px rgba(0,0,0,0.25);
    flex-shrink: 0;
  }
  .station-output-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
  }
  .station-output-title {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #f5cf7b;
    font-size: 10.5px;
    font-weight: bold;
  }
  .station-output-title img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
  .station-output-help { color: #7f9b7a; font-size: 9px; }
  .station-output-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px;
  }
  .station-output-slot {
    position: relative;
    min-width: 0;
    aspect-ratio: 1;
    background: #0d160e;
    border: 1px solid #2b4229;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    user-select: none;
  }
  .station-output-slot.has-item { cursor: grab; border-color: #55764f; background: #162117; }
  .station-output-slot.has-item:active { cursor: grabbing; }
  .station-output-slot:hover { border-color: #6f9668; background: #1a291b; }
  .station-output-slot .station-output-icon { font-size: 20px; line-height: 1; }
  .station-output-slot .station-output-qty {
    position: absolute; right: 2px; bottom: 1px;
    color: #fff; font-size: 9px; font-weight: bold;
    text-shadow: 1px 1px 2px #000;
  }
  .station-output-slot .station-output-tier {
    position: absolute; left: 2px; top: 1px;
    font-size: 7px; padding: 1px 2px; border-radius: 2px;
  }
  .station-output-empty {
    grid-column: 1 / -1;
    padding: 9px 4px; text-align: center;
    color: #60745e; font-size: 9.5px;
  }
  .station-output-full { color: #e7a84d; font-size: 9px; margin-top: 5px; }
  .station-complete-banner {
    margin-top: 6px; padding: 5px 7px;
    background: rgba(255,215,0,0.08);
    border: 1px solid #806f27; border-radius: 4px;
    color: #ffd700; font-size: 9.5px; font-weight: bold;
  }

  /* Baú */
  #chest-window { width: 380px; }
  #chest-window.expanded { width: 540px; }
  #chest-window.expanded .inv-grid-container { grid-template-columns: repeat(7, 1fr); max-height: 380px; }
  .chest-sort-bar { display: flex; background: #111a12; padding: 6px 10px; gap: 6px; border-bottom: 1px solid #233423; }
  .btn-chest-sort {
    flex: 1;
    background: #162416;
    border: 1px solid #2a4029;
    color: #9cb198;
    font-size: 10px;
    padding: 4px 6px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s;
  }
  .btn-chest-sort.active { background: #2b4728; border-color: #639c5b; color: #f5cf7b; font-weight: bold; }
  .chest-footer { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; background: #101911; border-top: 1px solid #233423; }
  .btn-chest-action {
    background: linear-gradient(180deg, #2b452a 0%, #1e331e 100%);
    border: 1px solid #4a7547;
    color: #e5d8c8;
    font-size: 10.5px;
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
  }

  /* Árvore de Talentos */
  #talent-tree-win {
    position: absolute;
    width: 820px;
    max-height: 88vh;
  }
  /* Talent Priority Build Bar */
  .talent-build-priority-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #101911;
    border-bottom: 1px solid #233423;
    padding: 8px 12px;
    gap: 10px;
  }
  .build-priority-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: #a4baa0;
  }
  .build-priority-info strong {
    color: #e5d8c8;
  }
  .build-priority-swatches {
    display: flex;
    gap: 6px;
    align-items: center;
  }
  .btn-build-choice {
    background: #152216;
    border: 1px solid #2a4029;
    color: #9cb198;
    font-size: 10.5px;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .btn-build-choice:hover {
    background: #223723;
    border-color: #4a7547;
    color: #fff;
  }
  .btn-build-choice.active {
    background: #2b4728;
    border-color: #ffd700;
    color: #ffd700;
    font-weight: bold;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.25);
  }

  .talent-body-scroll { padding: 12px; max-height: 74vh; overflow-y: auto; background: #0b110c; }
  .talent-columns { display: flex; gap: 10px; align-items: flex-start; }
  .talent-branch { flex: 1; background: #111a12; border: 1px solid #233423; border-radius: 6px; padding: 10px; display: flex; flex-direction: column; min-width: 0; }
  .branch-title { display: flex; gap: 8px; margin-bottom: 8px; border-bottom: 1px solid #233423; padding-bottom: 6px; align-items: center; }
  .branch-stat-header { background: #0e150f; border: 1px solid #1e2c1e; border-radius: 4px; padding: 6px 8px; margin-bottom: 10px; }
  .branch-level-line { display: flex; justify-content: space-between; font-size: 11px; font-weight: bold; color: #f5cf7b; margin-bottom: 3px; }
  .branch-xp-track { width: 100%; height: 7px; background: #090e0a; border: 1px solid #243524; border-radius: 4px; overflow: hidden; margin-bottom: 4px; }
  .branch-xp-fill { height: 100%; background: linear-gradient(90deg, #3d8841, #5cb85c); width: 0%; transition: width 0.3s; }
  .branch-pts-badge { font-size: 10.5px; color: #88b584; display: flex; justify-content: space-between; font-weight: bold; }
  .branch-pts-badge strong { color: #ffd700; }
  .branch-nodes { display: flex; flex-direction: column; gap: 8px; width: 100%; }

  /* Talent Node Card */
  .talent-node-card {
    width: 100%;
    background: #141f15;
    border: 1px solid #283a27;
    border-radius: 5px;
    padding: 7px 9px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.15s ease;
    box-sizing: border-box;
    position: relative;
  }
  .talent-node-card.recommended-build {
    border-color: #ffd700;
    box-shadow: 0 0 6px rgba(255, 215, 0, 0.18);
  }
  .talent-rec-badge {
    display: inline-block;
    font-size: 8px;
    font-weight: bold;
    color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    border: 1px solid #c8a715;
    padding: 1px 4px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
  }
  .talent-node-card:hover:not(.locked) {
    border-color: #4a7547;
    background: #19271a;
  }
  .talent-node-card.active {
    border-color: #558750;
    background: #172618;
  }
  .talent-node-card.maxed,
  .talent-node-card.mastered {
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.25);
    background: linear-gradient(180deg, #1d2a19 0%, #152214 100%);
  }
  .talent-node-card.locked {
    opacity: 0.55;
    background: #0d140e;
    border-color: #1a2519;
  }

  .talent-node-main {
    display: flex;
    gap: 8px;
    align-items: flex-start;
  }
  .talent-node-icon-box {
    width: 28px;
    height: 28px;
    background: #172417;
    border: 1px solid #334a32;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    flex-shrink: 0;
  }
  .talent-node-info {
    flex: 1;
    min-width: 0;
  }
  .talent-node-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4px;
    margin-bottom: 2px;
  }
  .talent-node-name {
    font-size: 11px;
    font-weight: bold;
    color: #e5d8c8;
  }
  .talent-node-level-pill {
    font-size: 9.5px;
    font-weight: bold;
    color: #8da488;
    background: #0d150e;
    padding: 1px 5px;
    border-radius: 3px;
    border: 1px solid #233423;
  }
  .talent-node-level-pill.active {
    color: #00f7ff;
    border-color: #1b4566;
  }
  .talent-node-level-pill.maxed,
  .talent-node-level-pill.mastered {
    color: #ffd700;
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.12);
    font-weight: 800;
  }
  .talent-node-desc {
    font-size: 9.5px;
    color: #8da488;
    line-height: 1.25;
  }
  .talent-node-prereq {
    font-size: 9px;
    color: #e76d6d;
    margin-top: 3px;
    font-weight: 500;
  }
  .talent-node-action-col {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 2px;
  }
  .talent-node-badge {
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 3px;
    letter-spacing: 0.3px;
  }
  .talent-node-badge.maxed,
  .talent-node-badge.mastered {
    color: #ffd700;
    background: rgba(255, 215, 0, 0.15);
    border: 1px solid #d4af37;
    text-shadow: 0 0 5px rgba(255, 215, 0, 0.4);
    font-weight: 800;
  }
  .talent-node-badge.locked {
    color: #777;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #252525;
  }
  .btn-learn-talent {
    background: linear-gradient(180deg, #2b4f28 0%, #1c361a 100%);
    border: 1px solid #487d44;
    color: #d8edd6;
    font-size: 9.5px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .btn-learn-talent.can-learn:hover {
    background: linear-gradient(180deg, #386934 0%, #254b23 100%);
    border-color: #63a85d;
    color: #fff;
    transform: scale(1.02);
  }
  .btn-learn-talent.no-points {
    background: #152016;
    border-color: #243524;
    color: #557555;
    cursor: not-allowed;
  }

  /* Especializações (Choice / Path) */
  .talent-spec-box {
    width: 100%;
    background: #0e1610;
    border: 1px solid #355034;
    border-radius: 6px;
    padding: 8px 9px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .talent-spec-box.locked {
    opacity: 0.55;
    border-color: #203020;
  }
  .talent-spec-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #203020;
    padding-bottom: 4px;
  }
  .spec-status-tag {
    font-size: 9px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 3px;
  }
  .spec-status-tag.chosen { color: #ffd700; background: rgba(255, 215, 0, 0.15); border: 1px solid #ffd700; }
  .spec-status-tag.avail { color: #88b584; background: rgba(136, 181, 132, 0.15); border: 1px solid #4a6845; }
  .spec-status-tag.lock { color: #777; background: #111; border: 1px solid #333; }
  .talent-spec-desc { font-size: 9.5px; color: #8da488; }
  .talent-spec-lock-msg { font-size: 9px; color: #e76d6d; font-weight: 500; }

  .spec-choices-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 2px;
  }
  .spec-choice-card {
    background: #141f15;
    border: 1px solid #283a27;
    border-radius: 4px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    transition: all 0.15s ease;
  }
  .spec-choice-card.selected {
    border: 1px solid #ffd700;
    background: #1d2b17;
    box-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
  }
  .spec-choice-card.inactive {
    opacity: 0.45;
    border-color: #1a2519;
  }
  .spec-choice-top {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .spec-choice-icon { font-size: 13px; }
  .spec-choice-name { font-size: 10.5px; font-weight: bold; color: #f5cf7b; }
  .spec-choice-body { font-size: 9px; color: #8da488; line-height: 1.25; }
  .spec-choice-action { display: flex; justify-content: flex-end; margin-top: 2px; }
  .btn-choose-spec {
    background: linear-gradient(180deg, #d35400 0%, #a04000 100%);
    border: 1px solid #f39c12;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    padding: 3px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .btn-choose-spec:hover:not(:disabled) {
    background: linear-gradient(180deg, #e67e22 0%, #b94a00 100%);
    border-color: #ffd700;
    transform: scale(1.03);
  }
  .btn-choose-spec.disabled {
    background: #1a1a1a;
    border-color: #333;
    color: #666;
    cursor: not-allowed;
  }
  .spec-chosen-badge {
    color: #ffd700;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.5px;
  }
  .spec-locked-badge {
    color: #555;
    font-size: 10px;
  }

  .talent-footer { display: flex; justify-content: space-between; align-items: center; background: #101911; padding: 8px 12px; border-top: 1px solid #233423; }
  .btn-reset-talents {
    background: linear-gradient(180deg, #6e2a2a 0%, #4f1d1d 100%);
    border: 1px solid #944040;
    color: #fff;
    font-size: 10.5px;
    font-weight: bold;
    padding: 5px 12px;
    border-radius: 4px;
    cursor: pointer;
  }

  /* Catálogo Construções */
  #build-catalog-win { width: 480px; }
  .build-item-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #141f15;
    border: 1px solid #283a27;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 8px;
  }
  .build-item-info { display: flex; align-items: center; gap: 12px; }
  .build-item-info .big-icon { font-size: 26px; background: #1c2a1c; padding: 6px 10px; border-radius: 4px; border: 1px solid #3c543b; }
  .build-item-info h4 { font-size: 12.5px; color: #f5cf7b; }
  .build-item-info p { font-size: 10.5px; color: #9bb396; }
  .cost-ok { color: #7fcf76; }
  .cost-bad { color: #e76d6d; }
  .btn-build-now {
    background: #395c37;
    border: 1px solid #629c5e;
    color: #fff;
    padding: 6px 14px;
    font-size: 11.5px;
    border-radius: 4px;
    cursor: pointer;
  }
  .btn-build-now:disabled { background: #222d22; border-color: #3b473a; color: #667766; cursor: not-allowed; }

  /* Menus Contexto */
  .context-dropdown {
    position: absolute;
    display: none;
    background: #162016;
    border: 1px solid #6b8f62;
    box-shadow: 0 8px 25px rgba(0,0,0,0.9);
    border-radius: 5px;
    z-index: 300;
    min-width: 170px;
    overflow: hidden;
  }
  .context-dropdown .ctx-header { padding: 7px 12px; font-size: 11px; background: #233423; color: #ffd700; font-weight: bold; border-bottom: 1px solid #364d34; }
  .context-dropdown button { width: 100%; text-align: left; background: none; border: none; color: #eeddcc; padding: 8px 14px; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 8px; }
  .context-dropdown button:hover { background: #2f492e; color: #fff; }

  /* Botões genéricos bar-btn (usados em janelas) */
  .bar-btn {
    background: linear-gradient(180deg, #243924 0%, #172617 100%);
    border: 1px solid #3c5e39;
    color: #e5d8c8;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 11.5px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
  }
  .bar-btn:hover {
    background: linear-gradient(180deg, #304d30 0%, #203520 100%);
    border-color: #558750;
    color: #f5cf7b;
    transform: translateY(-1px);
  }

  /* Menu de Atalhos Compacto (canto inferior direito) */
  #shortcut-menu {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(16, 24, 17, 0.92);
    border: 1px solid #4a6845;
    outline: 1px solid #1c2b1a;
    border-radius: 6px;
    padding: 4px;
    display: flex;
    gap: 3px;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.9);
    z-index: 20;
    transition: all 0.2s;
  }
  #shortcut-menu-icons {
    display: flex;
    gap: 3px;
    align-items: center;
    overflow: hidden;
    max-width: 600px;
    transition: max-width 0.25s, opacity 0.2s, padding 0.2s;
    opacity: 1;
  }
  #shortcut-menu.collapsed #shortcut-menu-icons {
    max-width: 0;
    opacity: 0;
    padding: 0;
    pointer-events: none;
  }
  .shortcut-icon-btn {
    width: 34px;
    height: 34px;
    background: linear-gradient(180deg, #243924 0%, #172617 100%);
    border: 1px solid #3c5e39;
    color: #e5d8c8;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
    position: relative;
  }
  .shortcut-icon-btn:hover {
    background: linear-gradient(180deg, #304d30 0%, #203520 100%);
    border-color: #558750;
    transform: translateY(-1px);
    box-shadow: 0 0 6px rgba(255,215,0,0.25);
  }
  #shortcut-menu-toggle {
    width: 34px;
    height: 34px;
    background: linear-gradient(180deg, #2a3f28 0%, #1a2b1a 100%);
    border: 1px solid #558750;
    color: #ffd700;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
    flex-shrink: 0;
  }
  #shortcut-menu-toggle:hover {
    background: linear-gradient(180deg, #355530 0%, #223520 100%);
    border-color: #ffd700;
    box-shadow: 0 0 8px rgba(255,215,0,0.35);
  }
  #shortcut-tooltip {
    position: fixed;
    background: rgba(10, 16, 11, 0.98);
    border: 1px solid #ffd700;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    color: #e5d8c8;
    pointer-events: none;
    z-index: 400;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.8);
    text-align: center;
  }
  #shortcut-tooltip .sc-tip-name {
    display: block;
    color: #ffd700;
    font-weight: bold;
    font-size: 12px;
  }
  #shortcut-tooltip .sc-tip-key {
    display: block;
    color: #8fa68c;
    font-size: 10px;
    margin-top: 2px;
  }

  /* Tooltips & Chat */
  #item-tooltip, #talent-tooltip {
    position: absolute;
    background: rgba(10, 16, 11, 0.98);
    border: 1px solid #ffd700;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 11px;
    color: #e5d8c8;
    pointer-events: none;
    z-index: 400;
    display: none;
    min-width: 180px;
    max-width: 280px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.95), 0 0 10px rgba(255, 215, 0, 0.25);
    line-height: 1.4;
  }
  .tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    border-bottom: 1px solid #283e27;
    padding-bottom: 5px;
  }
  .tooltip-title {
    font-size: 12px;
    font-weight: bold;
    color: #f5cf7b;
  }
  .tooltip-sub {
    font-size: 9.5px;
    color: #7fad79;
    font-weight: 600;
  }
  .tooltip-body {
    font-size: 10.5px;
    color: #c9d8c6;
  }
  .tooltip-stat-row {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    margin-top: 3px;
    padding: 2px 0;
  }
  .tooltip-stat-label { color: #8fa68c; }
  .tooltip-stat-val { color: #ffd700; font-weight: bold; }
  .tooltip-desc {
    font-size: 10px;
    color: #9bb597;
    margin-top: 5px;
    font-style: italic;
    border-top: 1px dashed #233522;
    padding-top: 4px;
  }

  #chat-panel {
    position: absolute;
    bottom: 62px;
    left: 16px;
    width: 350px;
    height: 155px;
    background: rgba(10, 16, 11, 0.92);
    border: 1px solid #2d452a;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    z-index: 20;
    box-shadow: 0 8px 24px rgba(0,0,0,0.85);
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
  #chat-panel.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
  }
  #chat-panel.collapsed .chat-body-wrap {
    display: none;
  }
  #chat-panel.collapsed {
    height: auto;
  }
  #chat-toggle-btn {
    position: absolute;
    bottom: 16px;
    left: 16px;
    z-index: 22;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(10, 16, 11, 0.92);
    border: 1px solid #2d452a;
    color: #7fad79;
    font-size: 18px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.7);
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
  }
  #chat-toggle-btn:hover {
    background: #1e3320;
    border-color: #4a7545;
    transform: scale(1.1);
  }
  .chat-collapse-btn {
    background: transparent;
    border: 1px solid #2c422a;
    color: #8fa68c;
    font-size: 10px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.12s ease;
    flex-shrink: 0;
    white-space: nowrap;
  }
  .chat-collapse-btn:hover {
    color: #ffd700;
    border-color: #4a7545;
    background: #1e3320;
  }
  #chat-panel.collapsed .chat-collapse-btn {
    transform: rotate(180deg);
  }
  .chat-body-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
  }
  .chat-tab-bar {
    display: flex;
    align-items: stretch;
    background: #0d160e;
    border-bottom: 1px solid #223723;
    padding: 3px 4px 0 4px;
    gap: 3px;
    flex-shrink: 0;
  }
  .chat-tabs-scroll {
    display: flex;
    gap: 3px;
    overflow-x: auto;
    flex: 1;
    min-width: 0;
    scrollbar-width: none;
  }
  .chat-tabs-scroll::-webkit-scrollbar {
    display: none;
  }
  .chat-tab-actions {
    display: flex;
    gap: 2px;
    flex-shrink: 0;
    align-items: flex-start;
    margin-left: 2px;
  }
  .chat-tab-btn {
    background: #142215;
    border: 1px solid #2c422a;
    border-bottom: none;
    color: #8fa68c;
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    transition: all 0.12s ease;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .chat-tab-btn:hover {
    background: #1e3320;
    color: #ffd700;
  }
  .chat-tab-btn.active {
    background: #253e27;
    border-color: #4a7545;
    color: #f5cf7b;
    font-weight: bold;
  }
  #chat-messages {
    flex: 1;
    padding: 6px 8px;
    overflow-y: auto;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    line-height: 1.35;
  }
  .chat-input-row {
    display: flex;
    padding: 4px 6px;
    background: #090e0a;
    border-top: 1px solid #1c2b1d;
    gap: 4px;
    flex-shrink: 0;
  }
  .chat-input-field {
    flex: 1;
    background: #101a11;
    border: 1px solid #243825;
    border-radius: 3px;
    color: #e5d8c8;
    font-size: 10.5px;
    padding: 3px 6px;
    outline: none;
  }
  .chat-input-field:focus {
    border-color: #558550;
  }
  .chat-send-btn {
    background: #1f3320;
    border: 1px solid #3c5d39;
    color: #f5cf7b;
    font-size: 10px;
    font-weight: bold;
    padding: 0 8px;
    border-radius: 3px;
    cursor: pointer;
  }
  .chat-send-btn:hover {
    background: #2b472c;
    border-color: #639c5b;
  }
  .chat-sys { color: #f5cf7b; }
  .chat-map-tag { color: #5dade2; font-weight: bold; margin-right: 4px; }
  .chat-global-tag { color: #e67e22; font-weight: bold; margin-right: 4px; }
  .chat-sys-tag { color: #f1c40f; font-weight: bold; margin-right: 4px; }
  .chat-add-tab-btn {
    background: transparent;
    border: 1px solid #2c422a;
    color: #8fa68c;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: all 0.12s ease;
    flex-shrink: 0;
    line-height: 1;
  }
  .chat-add-tab-btn:hover {
    color: #70ffb8;
    border-color: #4a7545;
    background: #1e3320;
  }
  #chat-tab-manager {
    display: none;
    background: #0d160e;
    border-bottom: 1px solid #223723;
    padding: 6px 8px;
    flex-shrink: 0;
    max-height: 200px;
    overflow-y: auto;
  }
  #chat-tab-manager.open {
    display: block;
  }
  .tab-manager-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 0;
    cursor: pointer;
    transition: opacity 0.12s ease;
  }
  .tab-manager-item:hover {
    opacity: 0.8;
  }
  .tab-manager-item label {
    color: #8fa68c;
    font-size: 11px;
    cursor: pointer;
    user-select: none;
    flex: 1;
  }
  .tab-manager-item input[type="checkbox"] {
    accent-color: #4a7545;
    cursor: pointer;
  }

  /* Glow de notificação em abas com mensagens novas */
  @keyframes tab-glow-pulse {
    0%, 100% { box-shadow: 0 0 4px rgba(112, 255, 184, 0.4); }
    50% { box-shadow: 0 0 10px rgba(112, 255, 184, 0.8), 0 0 20px rgba(112, 255, 184, 0.3); }
  }
  .chat-tab-btn.has-new {
    animation: tab-glow-pulse 1.2s ease-in-out infinite;
    border-color: #70ffb8;
    color: #70ffb8;
    font-weight: bold;
  }

  /* Glow no botão toggle quando chat fechado */
  @keyframes toggle-glow-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 215, 0, 0.3); }
    50% { box-shadow: 0 0 14px rgba(255, 215, 0, 0.7), 0 0 28px rgba(255, 215, 0, 0.25); }
  }
  #chat-toggle-btn.has-new {
    animation: toggle-glow-pulse 1s ease-in-out infinite;
    border-color: #ffd700;
    color: #ffd700;
  }

  /* Indicador de Construção */
  #build-mode-indicator {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(210, 45, 45, 0.95);
    border: 1px solid #fff;
    color: #fff;
    padding: 6px 16px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 20px;
    display: none;
    pointer-events: none;
    z-index: 250;
  }

  /* PROMPT DE INTERAÇÃO POR PROXIMIDADE (E) - agora desenhado diretamente no mundo junto aos objetos/NPCs */
  #proximity-prompt {
    display: none !important;
  }
  #proximity-prompt:hover {
    transform: translateX(-50%) scale(1.05);
    border-color: #ffd700;
  }
  #proximity-prompt .prompt-key {
    background: #ffd700;
    color: #111;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 4px;
    font-size: 11px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  }

  /* BARRA DE PROGRESSO DE COLETA */
  #gather-hud {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 60px);
    background: rgba(12, 18, 12, 0.95);
    border: 2px solid #558750;
    border-radius: 8px;
    padding: 8px 16px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.9);
    z-index: 200;
    pointer-events: none;
    min-width: 220px;
  }
  #gather-hud-name { font-size: 12px; font-weight: bold; color: #f5cf7b; }
  .gather-bar-bg {
    width: 100%;
    height: 10px;
    background: #090e0a;
    border: 1px solid #243524;
    border-radius: 5px;
    overflow: hidden;
  }
  .gather-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #3d8841, #7fad79);
    width: 0%;
    transition: width 0.05s linear;
  }
  #gather-hud-time { font-size: 10px; color: #a9bca5; }

  /* Banner de Zona Segura */
  #zone-banner {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    display: none;
    pointer-events: none;
    z-index: 220;
    box-shadow: 0 4px 15px rgba(0,0,0,0.8);
    animation: fadeInOut 2.5s forwards;
  }
  .zone-safe { background: rgba(30, 80, 35, 0.95); border: 1px solid #558750; color: #a8f0ad; }
  .zone-wild { background: rgba(100, 30, 30, 0.95); border: 1px solid #d9534f; color: #ffb8b8; }
  @keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -10px); }
    15% { opacity: 1; transform: translate(-50%, 0); }
    80% { opacity: 1; transform: translate(-50%, 0); }
    100% { opacity: 0; transform: translate(-50%, -15px); }
  }

/* Icones pixel-art dos itens/estruturas; talentos continuam com os icones originais. */
.item-icon-img{width:100%;height:100%;object-fit:contain;image-rendering:pixelated;display:block;}
.mini-icon .item-icon-img{width:42px;height:42px;margin:0 auto;}
.big-recipe-icon .item-icon-img{width:64px;height:64px;margin:0 auto;}
.req-mat-row .item-icon-img{width:20px;height:20px;display:inline-block;vertical-align:middle;}
.build-item-info .big-icon .item-icon-img{width:48px;height:48px;}
/* Ajuste final de escala dos ícones: manter a proporção visual dos ícones originais do inventário. */
.grid-slot .slot-icon .item-icon-img {
  width: 38px !important;
  height: 38px !important;
  max-width: 38px;
  max-height: 38px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.equip-slot > div:first-child .item-icon-img {
  width: 34px !important;
  height: 34px !important;
  max-width: 34px;
  max-height: 34px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
.mini-icon .item-icon-img {
  width: 36px !important;
  height: 36px !important;
}
.big-recipe-icon .item-icon-img {
  width: 52px !important;
  height: 52px !important;
}
.build-item-info .big-icon .item-icon-img {
  width: 42px !important;
  height: 42px !important;
}

/* Corrige os ícones dos materiais usados nos custos das construções. */
#build-catalog-list .build-item-row .cost-ok .item-icon-img,
#build-catalog-list .build-item-row .cost-bad .item-icon-img {
  width: 16px !important;
  height: 16px !important;
  max-width: 16px !important;
  max-height: 16px !important;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  margin: 0 2px 0 0;
}
/* Ícone principal da construção: pequeno e consistente com o inventário. */
#build-catalog-list .build-item-row .big-icon {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
#build-catalog-list .build-item-row .big-icon .item-icon-img {
  width: 32px !important;
  height: 32px !important;
  max-width: 32px !important;
  max-height: 32px !important;
  object-fit: contain;
}
/* NOTIFICAÇÃO DISCRETA DE SALVAMENTO */
#save-toast {
  position: absolute;
  top: 20px;
  right: 20px;
  background: rgba(16, 32, 18, 0.95);
  border: 1px solid #5da856;
  box-shadow: 0 4px 15px rgba(0,0,0,0.8);
  color: #f5cf7b;
  font-size: 11.5px;
  font-weight: bold;
  padding: 7px 14px;
  border-radius: 6px;
  display: none;
  align-items: center;
  gap: 6px;
  z-index: 400;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

/* MODAL DE LOGIN / CRIAR CONTA */
#auth-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(4, 7, 5, 0.96);
  backdrop-filter: blur(10px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}
body.in-auth-screen #player-main-hud,
body.in-auth-screen #game-performance-hud,
body.in-auth-screen #class-selector-widget,
body.in-auth-screen #action-spell-bar,
body.in-auth-screen #chat-panel,
body.in-auth-screen #shortcut-menu,
body.in-auth-screen #shortcut-tooltip {
  display: none !important;
}
.auth-card {
  width: 420px;
  max-width: 95vw;
  background: #101911;
  border: 2px solid #4a6845;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.95);
  overflow: hidden;
  transition: width 0.2s ease;
}
.auth-card.wide {
  width: 520px;
}
.auth-header {
  background: linear-gradient(90deg, #253924 0%, #1a2718 100%);
  padding: 12px 16px;
  text-align: center;
  border-bottom: 1px solid #3d5838;
}
.auth-header h2 { font-size: 16px; color: #f5cf7b; font-weight: bold; }
.auth-header p { font-size: 10.5px; color: #8fa68c; margin-top: 3px; }
.auth-tabs {
  display: flex;
  background: #0b110c;
  border-bottom: 1px solid #233423;
}
.auth-tab-btn {
  flex: 1;
  padding: 9px;
  background: transparent;
  border: none;
  color: #8da488;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s;
}
.auth-tab-btn.active {
  background: #182819;
  color: #f5cf7b;
  border-bottom: 2px solid #ffd700;
}
.auth-body { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.auth-field label { font-size: 11px; color: #b7cab4; font-weight: 600; margin-bottom: 4px; display: block; }
.auth-field input {
  width: 100%;
  background: #090e0a;
  border: 1px solid #283e27;
  color: #fff;
  padding: 7px 10px;
  font-size: 12px;
  border-radius: 4px;
  outline: none;
}
.auth-field input:focus { border-color: #5ea456; }
.btn-auth-submit {
  background: linear-gradient(180deg, #386335 0%, #254423 100%);
  border: 1px solid #5da856;
  color: #fff;
  font-size: 12.5px;
  font-weight: bold;
  padding: 9px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.15s;
  margin-top: 4px;
}
.btn-auth-submit:hover { background: #477d44; border-color: #ffd700; }
.btn-auth-guest {
  background: #162417;
  border: 1px solid #334e31;
  color: #b9cdb6;
  font-size: 11.5px;
  padding: 7px;
  border-radius: 4px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.btn-auth-guest:hover { background: #223723; color: #fff; }
.auth-msg { font-size: 11px; text-align: center; min-height: 16px; }
.auth-msg.error { color: #ff6b6b; }
.auth-msg.success { color: #7fcf76; }

/* SLOTS DE PERSONAGENS */
.char-slots-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 380px;
  overflow-y: auto;
}
.char-slot-card {
  background: #141f15;
  border: 1px solid #283e27;
  border-radius: 6px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}
.char-slot-card:hover {
  background: #1c2b1d;
  border-color: #558750;
}
.char-slot-card.empty {
  border: 1px dashed #345032;
  justify-content: center;
  padding: 14px;
  cursor: pointer;
  background: #0d150e;
}
.char-slot-card.empty:hover {
  border-color: #ffd700;
  background: #142215;
}
.char-slot-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.char-slot-avatar {
  width: 40px;
  height: 40px;
  background: #0b110c;
  border: 1px solid #334d31;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.char-slot-details h4 {
  font-size: 13px;
  color: #f5cf7b;
  font-weight: bold;
}
.char-slot-details span {
  font-size: 10px;
  color: #8da488;
}
.char-slot-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-play-char {
  background: linear-gradient(180deg, #3d7039 0%, #294e26 100%);
  border: 1px solid #5da856;
  color: #fff;
  font-size: 11.5px;
  font-weight: bold;
  padding: 7px 14px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-play-char:hover {
  background: #4a8845;
  border-color: #ffd700;
}
.btn-delete-char {
  background: #2b1717;
  border: 1px solid #5a2626;
  color: #ff8c8c;
  font-size: 11px;
  padding: 6px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}
.btn-delete-char:hover {
  background: #4a1f1f;
  color: #fff;
}

/* PERSONALIZAÇÃO & PREVIEW */
.color-picker-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  flex-wrap: wrap;
}
.color-swatch {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch:hover {
  transform: scale(1.15);
}
.color-swatch.selected {
  border-color: #ffd700;
  box-shadow: 0 0 6px #ffd700;
  transform: scale(1.1);
}
.char-preview-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #090e0a;
  border: 1px solid #233522;
  border-radius: 6px;
}

/* MINIGAME DE PESCA (CENTRO DA TELA EM FRENTE AO JOGADOR) */
#fishing-minigame-hud {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(12, 22, 14, 0.98);
  border: 2px solid #ffd700;
  border-radius: 12px;
  padding: 18px 24px;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 12px 45px rgba(0,0,0,0.95), 0 0 25px rgba(255, 215, 0, 0.4);
  z-index: 300;
  min-width: 330px;
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
@keyframes popIn {
  from { transform: translate(-50%, -50%) scale(0.85); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}
#fishing-minigame-hud h4 {
  font-size: 16px;
  color: #ffd700;
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 8px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.8);
}
.fishing-qte-target-box {
  background: #142216;
  border: 1px solid #3d5e3a;
  border-radius: 8px;
  padding: 8px 16px;
  text-align: center;
  width: 100%;
}
.fishing-qte-target-box span {
  font-size: 12px;
  color: #8fa68c;
}
.fishing-qte-target-box strong {
  font-size: 24px;
  color: #ffd700;
  font-weight: 900;
  display: inline-block;
  margin-left: 6px;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
  animation: pulseTarget 0.6s infinite alternate ease-in-out;
}
@keyframes pulseTarget {
  from { transform: scale(1); color: #f5cf7b; }
  to { transform: scale(1.15); color: #ffffff; }
}
.fishing-qte-buttons {
  display: flex;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.qte-key-btn {
  flex: 1;
  background: linear-gradient(180deg, #243b26 0%, #152417 100%);
  border: 2px solid #3c613a;
  color: #e5d8c8;
  font-size: 20px;
  font-weight: 900;
  padding: 10px 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.12s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}
.qte-key-btn:hover {
  background: linear-gradient(180deg, #325535 0%, #1d3320 100%);
  border-color: #63b868;
  color: #fff;
  transform: translateY(-2px);
}
.qte-key-btn:active {
  transform: translateY(1px);
}
.fishing-track-bar {
  position: relative;
  width: 100%;
  height: 8px;
  background: #090f0a;
  border: 1px solid #334d31;
  border-radius: 4px;
  overflow: hidden;
}
.fishing-reaction-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #e74c3c, #f1c40f, #2ecc71);
  transition: width 0.05s linear;
}
#fishing-timer-text {
  font-size: 11px;
  color: #9cb198;
  font-weight: 500;
}


/* JANELA DE DEFINIÇÕES (SETTINGS) */
#settings-window {
  width: 380px;
}
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #131e14;
  border: 1px solid #283e27;
  border-radius: 6px;
  margin-bottom: 8px;
}
.setting-label {
  font-size: 12px;
  color: #f5cf7b;
  font-weight: bold;
}
.setting-desc {
  font-size: 10px;
  color: #8fa68c;
  margin-top: 2px;
}
.zoom-btn-group {
  display: flex;
  gap: 4px;
}
.zoom-opt-btn {
  background: #19291a;
  border: 1px solid #3c5e39;
  color: #e5d8c8;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
}
.zoom-opt-btn.active {
  background: #2ecc71;
  color: #0b1a0e;
  font-weight: bold;
  border-color: #a3f7be;
}
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background-color: #273827;
  border: 1px solid #4a6845;
  transition: .3s;
  border-radius: 22px;
}
.toggle-slider:before {
  position: absolute; content: ""; height: 14px; width: 14px; left: 3px; bottom: 3px;
  background-color: #e5d8c8;
  transition: .3s;
  border-radius: 50%;
}
input:checked + .toggle-slider { background-color: #27ae60; border-color: #2ecc71; }
input:checked + .toggle-slider:before { transform: translateX(22px); background-color: #fff; }

/* JANELA DO MAPA MUNDO (WORLD MAP - 6x4 Orthogonal Grid) */
#worldmap-window {
  width: 620px;
  max-width: 96vw;
}
.worldmap-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 68px;
  gap: 8px;
  padding: 10px;
  background: #0d140e;
  border-radius: 8px;
  border: 1px solid #233724;
  max-height: 490px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #355034 #0d140e;
}
.worldmap-grid::-webkit-scrollbar {
  width: 6px;
}
.worldmap-grid::-webkit-scrollbar-track {
  background: #0d140e;
  border-radius: 4px;
}
.worldmap-grid::-webkit-scrollbar-thumb {
  background: #355034;
  border-radius: 4px;
}
.worldmap-node {
  background: #142015;
  border: 1.5px solid #355034;
  border-radius: 6px;
  padding: 5px 3px;
  text-align: center;
  position: relative;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 58px;
}
.worldmap-node.pvp-map {
  border-color: #5a2828;
  background: #1c1111;
}
.worldmap-node.empty {
  background: transparent;
  border: none;
}
.worldmap-node.active-map {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.45);
  background: #1d331f;
}
.worldmap-node.active-map.pvp-map {
  border-color: #ffd700;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.45);
  background: #2e1616;
}
.worldmap-node h4 {
  font-size: 11px;
  color: #f5cf7b;
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.worldmap-node p {
  font-size: 9px;
  color: #8fa68c;
  margin-top: 2px;
}
.worldmap-player-pin {
  font-size: 13px;
  animation: bouncePin 1s infinite alternate ease-in-out;
}
.worldmap-tab-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  justify-content: center;
}
.worldmap-tab-btn {
  background: #142015;
  border: 1px solid #355034;
  color: #a8c49e;
  padding: 5px 14px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.2s ease;
}
.worldmap-tab-btn:hover {
  background: #1e3320;
  color: #fff;
  border-color: #4a7548;
}
.worldmap-tab-btn.active {
  background: #254628;
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}
.worldmap-list-scroll {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
}
.worldmap-list-card {
  background: #142015;
  border: 1.5px solid #355034;
  border-radius: 6px;
  padding: 9px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s;
}
.worldmap-list-card:hover {
  border-color: #558053;
  background: #1b2c1d;
}
.worldmap-list-card.active-map {
  border-color: #ffd700;
  background: #1d331f;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}
.worldmap-list-card.pvp-map {
  border-color: #5a2828;
  background: #1c1111;
}
.worldmap-list-card.active-map.pvp-map {
  border-color: #ffd700;
  background: #2e1616;
}

/* BADGES E AVISO VISUAL DE PVP NO HUD */
.hud-pvp-badge {
  font-size: 9.5px;
  font-weight: bold;
  padding: 2px 7px;
  border-radius: 4px;
  margin-left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.hud-pvp-badge.safe {
  background: rgba(39, 174, 96, 0.2);
  color: #2ecc71;
  border: 1px solid #27ae60;
}
.hud-pvp-badge.danger {
  background: rgba(231, 76, 60, 0.25);
  color: #ff6b6b;
  border: 1px solid #e74c3c;
  box-shadow: 0 0 8px rgba(231, 76, 60, 0.4);
  animation: pvpPulse 2s infinite alternate;
}
@keyframes pvpPulse {
  from { box-shadow: 0 0 4px rgba(231, 76, 60, 0.3); }
  to { box-shadow: 0 0 12px rgba(231, 76, 60, 0.6); }
}

#zone-toast-container {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.zone-toast {
  background: rgba(14, 22, 15, 0.96);
  border: 1.5px solid #ffd700;
  border-radius: 8px;
  padding: 8px 22px;
  color: #fff;
  font-size: 13px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 6px 25px rgba(0,0,0,0.85), 0 0 14px rgba(255, 215, 0, 0.25);
  opacity: 0;
  transform: translateY(-16px) scale(0.95);
  transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  margin-bottom: 8px;
}
.zone-toast.show {
  opacity: 1;
  transform: translateY(0) scale(1);
}
.zone-toast.pvp-toast {
  background: rgba(36, 12, 12, 0.96);
  border-color: #e74c3c;
  color: #ff9b9b;
  box-shadow: 0 6px 25px rgba(0,0,0,0.85), 0 0 18px rgba(231, 76, 60, 0.5);
}
@keyframes bouncePin {
  from { transform: translateY(0); }
  to { transform: translateY(-4px); }
}

  /* HUD PRINCIPAL DO JOGADOR */
  #player-main-hud {
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(12, 19, 13, 0.94);
    border: 1.5px solid #3c5e39;
    border-radius: 8px;
    padding: 8px 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.85);
    z-index: 50;
    pointer-events: auto;
  }
  .player-hud-avatar {
    width: 44px;
    height: 44px;
    background: #192a1a;
    border: 2px solid #ffd700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
    transition: transform 0.15s ease;
    flex-shrink: 0;
  }
  .player-hud-avatar:hover {
    transform: scale(1.06);
  }
  .player-hud-lvl-badge {
    position: absolute;
    bottom: -3px;
    right: -3px;
    background: #253e24;
    border: 1px solid #ffd700;
    color: #fff;
    font-size: 9px;
    font-weight: bold;
    padding: 1px 4px;
    border-radius: 10px;
    line-height: 1;
  }
  .player-hud-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 210px;
    max-width: 320px;
  }
  .player-hud-name-row {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(255, 215, 0, 0.18);
  }
  .hud-hero-name {
    font-size: 13.5px;
    font-weight: 800;
    color: #ffd700;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.5), 1px 1px 2px #000;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .player-hud-zone-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
    margin-top: 1px;
    margin-bottom: 2px;
  }
  .player-hud-zone-tag {
    font-size: 10px;
    color: #a4cca0;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
  }
  .hud-bar-wrap {
    position: relative;
    width: 100%;
    height: 12px;
    background: #090e0a;
    border: 1px solid #233522;
    border-radius: 3px;
    overflow: hidden;
  }
  .hud-bar-fill.hp {
    height: 100%;
    background: linear-gradient(90deg, #c0392b 0%, #e74c3c 100%);
    box-shadow: 0 0 6px rgba(231, 76, 60, 0.6);
    transition: width 0.25s ease;
  }
  .hud-bar-fill.mp,
  .hud-bar-fill.mana {
    height: 100%;
    background: linear-gradient(90deg, #1d6fa5 0%, #2980b9 50%, #3498db 100%);
    box-shadow: 0 0 6px rgba(52, 152, 219, 0.6);
    transition: width 0.25s ease;
  }
  .hud-bar-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    font-size: 8px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 1px 2px #000;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    pointer-events: none;
  }
  .player-hud-subrow {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1px;
  }

  /* HUD DE ALVO / CRIATURA SELECIONADA */
  #target-main-hud {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(12, 19, 13, 0.94);
    border: 1.5px solid #3c5e39;
    border-radius: 8px;
    padding: 8px 14px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.85);
    z-index: 50;
    min-width: 270px;
  }
  .target-hud-close-btn {
    background: transparent;
    border: none;
    color: #ff6b6b;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    padding: 2px 6px;
    margin-left: 6px;
    border-radius: 4px;
    line-height: 1;
    transition: all 0.15s ease;
  }
  .target-hud-close-btn:hover {
    color: #fff;
    background: rgba(255, 107, 107, 0.25);
    transform: scale(1.2);
  }

  /* WIDGET DE SELEÇÃO DE CLASSES DINÂMICAS (3 ÍCONES) */
  #class-selector-widget {
    position: absolute;
    top: 16px;
    right: 70px;
    display: flex;
    gap: 8px;
    background: rgba(14, 24, 15, 0.92);
    border: 1px solid #2d472c;
    border-radius: 8px;
    padding: 4px 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    z-index: 100;
  }
  .class-select-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 48px;
    background: #19291b;
    border: 1px solid #365534;
    border-radius: 6px;
    color: #cad8c7;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 2px;
  }
  .class-select-btn:hover {
    background: #243d26;
    border-color: #5c8f58;
    transform: translateY(-2px);
  }
  .class-select-btn.active {
    background: linear-gradient(180deg, #2b4c2e 0%, #17311a 100%);
    border-color: #ffd700;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    color: #ffd700;
  }
  .class-btn-icon {
    font-size: 18px;
    line-height: 1;
    margin-bottom: 2px;
  }
  .class-btn-label {
    font-size: 8.5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  /* BARRA DE 3 MAGIAS / HABILIDADES */
  #action-spell-bar {
    position: absolute;
    bottom: 54px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    background: rgba(13, 22, 14, 0.92);
    border: 1px solid #2d472c;
    border-radius: 10px;
    padding: 6px 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.6);
    z-index: 99;
  }
  .spell-slot-card {
    position: relative;
    width: 62px;
    height: 62px;
    background: #18281a;
    border: 2px solid #365534;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
  }
  .spell-slot-card:hover {
    border-color: #72a86c;
    box-shadow: 0 0 8px rgba(114, 168, 108, 0.5);
  }
  .spell-slot-card:active {
    transform: scale(0.95);
  }
  .spell-slot-card.on-cooldown {
    filter: grayscale(0.6);
    cursor: not-allowed;
  }
  .spell-slot-card.locked {
    opacity: 0.4;
    border-color: #444;
  }
  .spell-slot-key {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 9px;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 0 1px 2px #000;
  }
  .spell-slot-cost {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 8.5px;
    color: #f39c12;
    font-weight: bold;
  }
  .spell-slot-icon {
    font-size: 22px;
    margin-bottom: 1px;
  }
  .spell-slot-name {
    font-size: 7px;
    color: #ccc;
    text-align: center;
    line-height: 1.1;
    max-width: 58px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .spell-cd-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 6px;
    pointer-events: none;
    transition: height 0.1s linear;
  }
  .spell-cd-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 4px #000;
    display: none;
    pointer-events: none;
  }

  /* HUD DE PROGRESSO DE CRAFTING / FABRICO */
  #craft-progress-hud {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, 60px);
    background: rgba(14, 20, 14, 0.96);
    border: 2px solid #f39c12;
    border-radius: 8px;
    padding: 10px 18px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.9), 0 0 15px rgba(243, 156, 18, 0.3);
    z-index: 220;
    pointer-events: none;
    min-width: 230px;
  }
  #craft-hud-name { font-size: 12.5px; font-weight: bold; color: #f5cf7b; }
  .craft-bar-bg {
    width: 100%;
    height: 11px;
    background: #090e0a;
    border: 1px solid #3c2a12;
    border-radius: 5px;
    overflow: hidden;
  }
  .craft-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #d35400, #f39c12);
    width: 0%;
    transition: width 0.05s linear;
  }
  #craft-hud-time { font-size: 10px; color: #f5cf7b; font-weight: 500; }


/* Ensure Game UI visibility when in-auth-screen is removed */
body:not(.in-auth-screen) #game-screen {
    display: block !important;
}
body.in-auth-screen #game-screen {
    display: none !important;
}


/* =========================================================
   REGRAS DE EXPANSÃO DE JANELAS DEDICADAS DO PROJETO ORIGINAL
   ========================================================= */
#inv-window.expanded { width: 560px !important; }
#inv-window.expanded .inv-grid-container {
    grid-template-columns: repeat(7, 1fr) !important;
    max-height: 420px !important;
}

#char-window.expanded { width: 620px !important; }

#craft-window.expanded, #campfire-window.expanded { width: 720px !important; }
#craft-window.expanded .split-craft-layout, #campfire-window.expanded .split-craft-layout { height: 470px !important; }

#chest-window.expanded { width: 540px !important; }
#chest-window.expanded .inv-grid-container { grid-template-columns: repeat(7, 1fr) !important; max-height: 380px !important; }

#talent-tree-win.expanded { width: 940px !important; }

/* HARDENED EXPANSION RULES MATCHING EXACT REFERENCE MATH */
#inv-window.expanded { width: 560px !important; min-width: 560px !important; }
#inv-window.expanded .inv-grid-container { grid-template-columns: repeat(7, 1fr) !important; max-height: 420px !important; }

#char-window.expanded { width: 620px !important; min-width: 620px !important; }

#craft-window.expanded, #campfire-window.expanded { width: 720px !important; min-width: 720px !important; }
#craft-window.expanded .split-craft-layout, #campfire-window.expanded .split-craft-layout { height: 470px !important; }

#chest-window.expanded { width: 540px !important; min-width: 540px !important; }
#chest-window.expanded .inv-grid-container { grid-template-columns: repeat(7, 1fr) !important; max-height: 380px !important; }

#talent-tree-win.expanded { width: 940px !important; min-width: 940px !important; }

/* =========================================================
   ÁRVORE DE TALENTOS DE CLASSE (CLASS TALENT TREE UI)
   ========================================================= */
#class-talent-tree-win {
  width: 880px;
  max-width: 96vw;
}

#class-talent-tree-win.expanded {
  width: 1040px !important;
  min-width: 1040px !important;
}

.class-tree-header-bar {
  background: #0e150f;
  border-bottom: 1px solid #233423;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.class-tree-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.class-tree-class-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #141f15;
  border: 1px solid #334a32;
  padding: 4px 10px;
  border-radius: 4px;
}

.class-badge-icon {
  font-size: 18px;
}

.class-badge-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffd700;
}

.class-tree-pts-box {
  font-size: 11.5px;
  color: #88b584;
  background: #101911;
  border: 1px solid #233423;
  padding: 4px 10px;
  border-radius: 4px;
}

.class-tree-pts-box strong {
  color: #ffd700;
  font-size: 13px;
  margin-left: 4px;
}

.class-tree-paths-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.class-path-btn {
  background: #152216;
  border: 1px solid #293e28;
  color: #9eb89a;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.class-path-btn:hover {
  background: #1c2e1e;
  border-color: #4c7249;
  color: #e0ebd8;
}

.class-path-btn.active {
  background: linear-gradient(180deg, #244227 0%, #172d19 100%);
  border-color: #ffd700;
  color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.25);
}

.class-tree-body-scroll {
  padding: 12px;
  max-height: 68vh;
  overflow-y: auto;
  background: #0b110c;
}

.class-tree-path-intro {
  background: #101a11;
  border: 1px solid #233423;
  border-radius: 5px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.class-tree-path-intro h4 {
  font-size: 12.5px;
  color: #ffd700;
  margin: 0 0 3px 0;
}

.class-tree-path-intro p {
  font-size: 10.5px;
  color: #8da488;
  margin: 0;
}

.class-tree-tiers-container {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  align-items: stretch;
}

.class-tree-tier-column {
  background: #0e1610;
  border: 1px solid #1f2e1f;
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.class-tree-tier-header {
  font-size: 11px;
  font-weight: bold;
  color: #f5cf7b;
  text-align: center;
  border-bottom: 1px solid #203320;
  padding-bottom: 5px;
  margin-bottom: 2px;
}

.class-skill-node-card {
  width: 100%;
  background: #131e14;
  border: 1px solid #263825;
  border-radius: 5px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  box-sizing: border-box;
  transition: all 0.15s ease;
  position: relative;
}

.class-skill-node-card:hover {
  border-color: #4a7547;
  background: #182619;
}

.class-skill-node-card.unlocked {
  border-color: #3b6b37;
  background: #162417;
}

.class-skill-node-card.locked {
  opacity: 0.7;
  background: #0c120d;
  border-color: #1a2519;
}

.skill-future-badge {
  display: inline-block;
  font-size: 7.5px;
  font-weight: bold;
  color: #e59437;
  background: rgba(229, 148, 55, 0.12);
  border: 1px solid #8e581e;
  padding: 1px 4px;
  border-radius: 3px;
  letter-spacing: 0.3px;
  width: fit-content;
}

.class-skill-header {
  display: flex;
  align-items: center;
  gap: 6px;
}

.class-skill-icon {
  width: 28px;
  height: 28px;
  background: #162417;
  border: 1px solid #2f492d;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}

.class-skill-title {
  flex: 1;
  min-width: 0;
}

.class-skill-name {
  font-size: 10.5px;
  font-weight: bold;
  color: #e5d8c8;
  line-height: 1.2;
  word-break: break-word;
}

.class-skill-tier-label {
  font-size: 8.5px;
  color: #7fad79;
}

.class-skill-desc {
  font-size: 9.5px;
  color: #a4bca0;
  line-height: 1.35;
  margin-top: 2px;
}

.class-skill-prereqs {
  font-size: 8.5px;
  color: #cf985e;
  border-top: 1px dashed #243524;
  padding-top: 4px;
  margin-top: 2px;
}

.class-tree-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #0e150f;
  border-top: 1px solid #233423;
}

.class-tree-footer-info {
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-future-notice {
  font-size: 9px;
  font-weight: bold;
  color: #f5cf7b;
  background: rgba(245, 207, 123, 0.12);
  border: 1px solid #7c6225;
  padding: 2px 6px;
  border-radius: 3px;
}

/* ============================================================
   UNIVERSAL SKILLS & MASTERIES — RUNESCAPE PHILOSOPHY UI
   ============================================================ */

#talent-tree-win {
  width: 580px;
  max-width: 95vw;
}

.univ-rs-mastery-banner {
  padding: 8px 12px;
  background: rgba(16, 24, 18, 0.9);
  border-bottom: 1px solid rgba(245, 207, 123, 0.2);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.univ-rs-mastery-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.univ-rs-mastery-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.univ-rs-mastery-icon-box {
  width: 30px;
  height: 30px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(245, 207, 123, 0.3);
  border-radius: 4px;
}

.univ-rs-mastery-title {
  margin: 0;
  font-size: 12px;
  font-weight: bold;
  color: #f5cf7b;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.univ-rs-mastery-sub {
  margin: 0;
  font-size: 9px;
  color: #8da488;
}

.univ-rs-mastery-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.univ-rs-mastery-lvl {
  font-size: 11px;
  font-weight: bold;
  color: #ffd700;
}

.univ-rs-mastery-xp-text {
  font-size: 9.5px;
  color: #70ffb8;
  font-weight: 600;
}

.univ-rs-mastery-bar-track {
  height: 5px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.univ-rs-mastery-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #34d399);
  transition: width 0.3s ease;
}

.univ-rs-body-scroll {
  padding: 10px 12px;
  max-height: 490px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.univ-rs-subgroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.univ-rs-subgroup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(245, 207, 123, 0.15);
  padding-bottom: 3px;
}

.univ-rs-subgroup-title {
  font-size: 10.5px;
  font-weight: bold;
  color: #f5cf7b;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.univ-rs-subgroup-badge {
  font-size: 8.5px;
  color: #8da488;
  font-weight: normal;
}

.univ-rs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.univ-rs-card {
  background: rgba(13, 20, 15, 0.85);
  border: 1px solid rgba(245, 207, 123, 0.18);
  border-radius: 4px;
  padding: 5px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  position: relative;
  transition: all 0.12s ease;
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.univ-rs-card:hover {
  background: rgba(22, 35, 25, 0.95);
  border-color: #ffd700;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.25), inset 0 0 8px rgba(0, 0, 0, 0.4);
}

.univ-rs-card.dominated {
  background: rgba(28, 24, 12, 0.85);
  border-color: rgba(255, 215, 0, 0.5);
}

.univ-rs-card.dominated:hover {
  background: rgba(38, 32, 15, 0.95);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
}

.univ-rs-icon {
  width: 28px;
  height: 28px;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  flex-shrink: 0;
}

.univ-rs-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.univ-rs-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 4px;
}

.univ-rs-name {
  font-size: 10.5px;
  font-weight: bold;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.univ-rs-lvl {
  font-size: 10px;
  font-weight: bold;
  color: #e2e8f0;
  flex-shrink: 0;
}

.univ-rs-lvl strong {
  color: #ffd700;
}

.univ-rs-lvl.dominated {
  font-size: 9px;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.15);
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.univ-rs-bar {
  position: relative;
  height: 11px;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2px;
  overflow: hidden;
}

.univ-rs-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0ea5e9, #38bdf8);
  transition: width 0.25s ease;
}

.univ-rs-bar-fill.dominated {
  background: linear-gradient(90deg, #ffd700, #f59e0b);
}

.univ-rs-bar-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #ffffff;
  text-shadow: 0 1px 2px #000;
  letter-spacing: 0.2px;
}

/* Tooltip Dedicado para Skills Universais */
#univ-skill-tooltip {
  position: fixed;
  background: rgba(10, 16, 12, 0.96);
  border: 1px solid #ffd700;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 11px;
  color: #e5d8c8;
  pointer-events: none;
  z-index: 500;
  display: none;
  min-width: 220px;
  max-width: 300px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.95), 0 0 12px rgba(255, 215, 0, 0.3);
  line-height: 1.4;
}

.univ-tt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(245, 207, 123, 0.2);
  padding-bottom: 5px;
  margin-bottom: 6px;
}

.univ-tt-title-box {
  display: flex;
  align-items: center;
  gap: 6px;
}

.univ-tt-icon {
  font-size: 16px;
}

.univ-tt-title {
  font-size: 12px;
  font-weight: bold;
  color: #f5cf7b;
}

.univ-tt-badge {
  font-size: 8.5px;
  font-weight: bold;
  padding: 1px 5px;
  border-radius: 3px;
}

.univ-tt-badge.pve {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(14, 165, 233, 0.3);
}

.univ-tt-badge.pvp {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.univ-tt-badge.all {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.univ-tt-prog-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
  margin-bottom: 4px;
}

.univ-tt-desc {
  font-size: 10px;
  color: #a3b89e;
  margin: 6px 0;
  line-height: 1.35;
}

.univ-tt-bonus-box {
  background: rgba(0, 0, 0, 0.4);
  border-radius: 4px;
  padding: 5px 7px;
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.univ-tt-bonus-row {
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
}

.univ-tt-bonus-label {
  color: #8da488;
}

.univ-tt-bonus-val {
  color: #ffd700;
  font-weight: bold;
}

.univ-tt-next-val {
  color: #70ffb8;
  font-weight: bold;
}

.univ-tt-dominated-banner {
  margin-top: 6px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.4);
  border-radius: 3px;
  padding: 3px 6px;
  text-align: center;
  font-size: 9.5px;
  font-weight: bold;
  color: #ffd700;
}

/* =========================================================
   MENU DE CONTEXTO DO INVENTÁRIO (RIGHT-CLICK CONTEXT MENU)
   ========================================================= */
.inv-context-menu {
  position: fixed;
  z-index: 100000;
  min-width: 175px;
  background: linear-gradient(180deg, #18251a 0%, #0c140d 100%);
  border: 1.5px solid #d4af37;
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.95), 0 0 12px rgba(212, 175, 55, 0.2);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  backdrop-filter: blur(8px);
  user-select: none;
  animation: ctxFadeIn 0.12s ease-out;
}

@keyframes ctxFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.context-menu-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px 6px 6px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.25);
  margin-bottom: 3px;
}

.ctx-icon {
  font-size: 16px;
}

.ctx-name {
  font-size: 11.5px;
  font-weight: bold;
  color: #ffd700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 130px;
}

.ctx-tier {
  font-size: 8px !important;
  padding: 1px 3px !important;
  margin-left: auto;
}

.context-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ctx-action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
  border-radius: 4px;
  color: #e5d8c8;
  font-size: 11px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.ctx-action-btn:hover {
  background: linear-gradient(90deg, rgba(76, 175, 80, 0.35), rgba(46, 125, 50, 0.15));
  border-color: rgba(120, 230, 130, 0.4);
  color: #ffffff;
  transform: translateX(2px);
}

.ctx-action-btn.ctx-btn-danger:hover {
  background: linear-gradient(90deg, rgba(211, 47, 47, 0.4), rgba(183, 28, 28, 0.2));
  border-color: rgba(255, 100, 100, 0.5);
  color: #ffb8b8;
}

.ctx-btn-icon {
  font-size: 13px;
  line-height: 1;
}

.ctx-btn-label {
  flex: 1;
}

.ctx-divider {
  height: 1px;
  background: rgba(212, 175, 55, 0.15);
  margin: 3px 0;
}

/* =========================================================
   MODAL DE EXAMINAR ITEM (LORE & UTILIZAÇÃO)
   ========================================================= */
.rpg-examine-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.rpg-examine-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}

.rpg-examine-card {
  position: relative;
  z-index: 99999;
  width: 360px;
  max-width: 92vw;
  background: linear-gradient(180deg, #141f15 0%, #0b130c 100%);
  border: 1.5px solid #d4af37;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 20px rgba(212, 175, 55, 0.25);
  overflow: hidden;
  animation: examinePop 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes examinePop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.examine-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 80vh;
  overflow-y: auto;
}

.examine-header-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.examine-icon-wrapper {
  width: 52px;
  height: 52px;
  min-width: 52px;
  background: #182819;
  border: 1.5px solid #ffd700;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6), 0 0 8px rgba(255, 215, 0, 0.2);
}

.examine-icon {
  font-size: 28px;
}

.examine-icon-wrapper .slot-tier {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 9px;
  padding: 1px 4px;
}

.examine-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.examine-item-title {
  font-size: 15px;
  font-weight: bold;
  color: #ffd700;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.examine-item-category {
  font-size: 11px;
  color: #8fa68c;
  font-weight: 500;
}

.examine-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.examine-stat-card {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 5px;
  padding: 6px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.examine-stat-label {
  font-size: 10.5px;
  color: #a4baa2;
}

.examine-stat-val {
  font-size: 11px;
  font-weight: bold;
  color: #f5cf7b;
}

.examine-section-block {
  background: rgba(12, 19, 13, 0.8);
  border: 1px solid rgba(212, 175, 55, 0.15);
  border-radius: 6px;
  padding: 8px 10px;
}

.examine-section-title {
  font-size: 11px;
  font-weight: bold;
  color: #72e08a;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.examine-section-text {
  font-size: 11.5px;
  line-height: 1.45;
  color: #c9d8c7;
  margin: 0;
}

.examine-actions-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
}

.btn-examine-action {
  padding: 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-examine-deposit {
  background: linear-gradient(180deg, #1f3b21, #132715);
  border: 1px solid #3c653a;
  color: #72e08a;
}

.btn-examine-deposit:hover {
  background: linear-gradient(180deg, #2a522d, #1a381d);
  border-color: #559152;
  color: #a2ffb4;
}

.examine-discard-group {
  display: flex;
  gap: 6px;
}

.btn-examine-discard-1 {
  flex: 1;
  background: linear-gradient(180deg, #3d231e, #291612);
  border: 1px solid #6b352c;
  color: #ffb8b8;
}

.btn-examine-discard-1:hover {
  background: linear-gradient(180deg, #572e27, #3b1d17);
  border-color: #8c4235;
  color: #ffffff;
}

.btn-examine-discard-all {
  flex: 1;
  background: linear-gradient(180deg, #571e1e, #361010);
  border: 1px solid #8e2b2b;
  color: #ff8888;
}

.btn-examine-discard-all:hover {
  background: linear-gradient(180deg, #7a2828, #4a1414);
  border-color: #b53838;
  color: #ffffff;
}

/* =========================================================
   MODAL DE QUANTIDADE / DIVIDIR STACK (INTERATIVO)
   ========================================================= */
.rpg-quantity-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 100001;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.rpg-quantity-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}

.rpg-quantity-card {
  position: relative;
  z-index: 100002;
  width: 330px;
  max-width: 90vw;
  background: linear-gradient(180deg, #18251a 0%, #0c140d 100%);
  border: 1.5px solid #d4af37;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 20px rgba(212, 175, 55, 0.3);
  overflow: hidden;
  animation: examinePop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quantity-modal-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quantity-item-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(212, 175, 55, 0.25);
  border-radius: 6px;
}

.quantity-icon {
  font-size: 24px;
}

.quantity-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.quantity-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffd700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quantity-stock-info {
  font-size: 11px;
  color: #9cb597;
}

.quantity-control-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.quantity-input-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-qty-step {
  padding: 6px 10px;
  background: linear-gradient(180deg, #223824, #142215);
  border: 1px solid #3d633f;
  border-radius: 4px;
  color: #d1ffd6;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.12s ease;
}

.btn-qty-step:hover {
  background: linear-gradient(180deg, #2f5233, #1c331e);
  border-color: #5ea062;
  color: #ffffff;
  transform: translateY(-1px);
}

.quantity-number-input {
  width: 75px;
  text-align: center;
  font-size: 16px;
  font-weight: bold;
  color: #ffd700;
  background: #090e0a;
  border: 1.5px solid #d4af37;
  border-radius: 4px;
  padding: 4px;
  font-family: inherit;
  outline: none;
}

.quantity-slider-wrapper {
  padding: 0 4px;
}

.quantity-range-slider {
  width: 100%;
  accent-color: #ffd700;
  cursor: pointer;
}

.quantity-presets {
  display: flex;
  gap: 6px;
}

.btn-qty-preset {
  flex: 1;
  padding: 5px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
  color: #dfd2bf;
  font-size: 10.5px;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.12s ease;
}

.btn-qty-preset:hover {
  background: rgba(212, 175, 55, 0.2);
  border-color: #ffd700;
  color: #ffffff;
}

.quantity-modal-footer {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-quantity-confirm {
  flex: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(180deg, #235429, #153319);
  border: 1.5px solid #3c8246;
  border-radius: 4px;
  color: #7aff96;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  transition: all 0.15s ease;
}

.btn-quantity-confirm:hover {
  background: linear-gradient(180deg, #307038, #1c4522);
  border-color: #5ed66e;
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-quantity-cancel {
  flex: 1;
  padding: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 4px;
  color: #b0a89d;
  font-size: 11.5px;
  font-weight: bold;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
}

.btn-quantity-cancel:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

/* =========================================================
   DRAG & DROP - SLOTS DE INVENTÁRIO E BAÚ
   ========================================================= */
.grid-slot {
  user-select: none;
  -webkit-user-select: none;
  transition: transform 0.1s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.grid-slot * {
  pointer-events: none;
}

.grid-slot[draggable="true"] {
  cursor: grab !important;
}

.grid-slot[draggable="true"]:active {
  cursor: grabbing !important;
}

.grid-slot.is-dragging {
  opacity: 0.4 !important;
  border: 1.5px dashed #ffd700 !important;
  transform: scale(0.96);
}

.grid-slot.drag-over {
  border: 2px solid #5ed66e !important;
  background: rgba(94, 214, 110, 0.22) !important;
  box-shadow: 0 0 10px rgba(94, 214, 110, 0.6) inset, 0 0 8px rgba(94, 214, 110, 0.4) !important;
  transform: scale(1.05);
  z-index: 5;
}

/* =========================================================
   BOTÃO DE AGRUPAR ITENS & SELECT DE ORDENAÇÃO
   ========================================================= */
.btn-stack-all {
  background: linear-gradient(180deg, #2b4528, #182b16) !important;
  border: 1px solid #487344 !important;
  color: #a8e6a3 !important;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s ease;
}

.btn-stack-all:hover {
  background: linear-gradient(180deg, #3d6339, #223e1f) !important;
  border-color: #62a35d !important;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.inv-sort-select {
  background: #141e15;
  border: 1px solid #3c543a;
  color: #ffd700;
  border-radius: 4px;
  padding: 4px 6px;
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
}

.inv-sort-select option {
  background: #101a11;
  color: #f0e6d2;
  padding: 4px;
}

/* Prevenção de Zoom no Navegador */
html, body {
  touch-action: pan-x pan-y;
  -webkit-text-size-adjust: 100%;
}

/* =========================================================
   NPC DIALOGUE & NPC SHOPS (MESTRE FERREIRO & MERCADOR)
   ========================================================= */
.npc-dialogue-modal-box {
  background: rgba(14, 20, 15, 0.98);
  border: 1.5px solid #d4af37;
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.95), 0 0 15px rgba(212, 175, 55, 0.15);
  overflow: hidden;
  font-family: inherit;
  z-index: 120;
}

.npc-tab-bar {
  display: flex;
  background: #101911;
  border-bottom: 1px solid #294028;
}

.npc-tab-btn {
  flex: 1;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #9cb198;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.npc-tab-btn:hover {
  color: #f5cf7b;
  background: rgba(255, 215, 0, 0.05);
}

.npc-tab-btn.active {
  color: #ffd700;
  border-bottom: 2px solid #ffd700;
  background: rgba(255, 215, 0, 0.1);
}

.npc-dialogue-body {
  padding: 12px;
  max-height: 55vh;
  overflow-y: auto;
}

.npc-greeting-box {
  background: rgba(20, 32, 21, 0.8);
  border: 1px solid #2d452c;
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 10px;
  font-style: italic;
  color: #f5cf7b;
  font-size: 12px;
  line-height: 1.4;
}

.npc-shop-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 8px;
  background: #132014;
  border: 1px solid #283e27;
  border-radius: 4px;
  font-size: 11.5px;
}

.npc-shop-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.npc-shop-item-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #162417, #101b11);
  border: 1px solid #2d482b;
  border-radius: 6px;
  padding: 6px 10px;
  transition: all 0.15s ease;
}

.npc-shop-item-card:hover {
  border-color: #558752;
  background: linear-gradient(90deg, #1c301e, #132214);
}

.npc-shop-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.npc-shop-item-icon-box {
  width: 36px;
  height: 36px;
  background: #1c2b1d;
  border: 1px solid #3c5a3a;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  position: relative;
}

.npc-shop-item-icon-box .item-icon-img {
  width: 26px !important;
  height: 26px !important;
  max-width: 26px;
  max-height: 26px;
  object-fit: contain;
  display: block;
}

.npc-shop-item-info {
  display: flex;
  flex-direction: column;
}

.npc-shop-item-name {
  font-size: 12.5px;
  font-weight: bold;
  color: #e5d8c8;
}

.npc-shop-item-meta {
  font-size: 10.5px;
  color: #8da488;
}

.npc-shop-item-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.npc-shop-price-badge {
  font-size: 11.5px;
  font-weight: bold;
  color: #ffd700;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.3);
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.npc-shop-buy-btn {
  background: linear-gradient(180deg, #27ae60, #1b7a43);
  border: 1px solid #2ecc71;
  color: #ffffff;
  font-weight: bold;
  font-size: 11.5px;
  padding: 5px 12px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}

.npc-shop-buy-btn:hover {
  background: linear-gradient(180deg, #2ecc71, #229954);
  box-shadow: 0 0 8px rgba(46, 204, 113, 0.5);
  transform: translateY(-1px);
}

.npc-tab-placeholder {
  text-align: center;
  padding: 24px 12px;
  color: #8da488;
  font-size: 12px;
  line-height: 1.6;
}

/* ========================================================= */
/* ENCICLOPÉDIA & WIKI DO JOGO                              */
/* ========================================================= */
#wiki-window {
  width: 820px;
  max-width: 95vw;
  max-height: 88vh;
}

#wiki-window.expanded {
  width: 960px !important;
  max-width: 98vw !important;
  height: 90vh !important;
}

.wiki-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #111a12;
  border: 1px solid #233423;
  padding: 10px;
  border-radius: 6px;
}

.wiki-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #090e0a;
  border: 1px solid #283e27;
  padding: 6px 10px;
  border-radius: 4px;
}

.wiki-search-box input {
  background: transparent;
  border: none;
  color: #f5cf7b;
  font-size: 12px;
  width: 100%;
  outline: none;
}

.wiki-search-box input::placeholder {
  color: #637a61;
}

.wiki-cat-group {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.wiki-cat-btn {
  background: #172418;
  border: 1px solid #283e27;
  color: #8da488;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.wiki-cat-btn:hover {
  background: #233724;
  color: #e5d8c8;
}

.wiki-cat-btn.active {
  background: #2b472d;
  border-color: #ffd700;
  color: #ffd700;
  font-weight: bold;
}

.wiki-count-badge {
  font-size: 10.5px;
  color: #8fa68c;
}

.wiki-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 4px;
}

.wiki-item-card {
  background: #131e14;
  border: 1px solid #243825;
  border-radius: 6px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.wiki-item-card:hover {
  border-color: #4a7547;
  background: #162417;
}

.wiki-item-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wiki-item-icon-box {
  width: 40px;
  height: 40px;
  background: #1c2b1d;
  border: 1px solid #3c5a3a;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  position: relative;
  flex-shrink: 0;
}

.wiki-item-icon-box .item-icon-img {
  width: 28px !important;
  height: 28px !important;
  max-width: 28px;
  max-height: 28px;
  object-fit: contain;
  display: block;
}

.wiki-item-title-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.wiki-item-name {
  font-size: 13px;
  font-weight: bold;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wiki-item-id-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.wiki-item-id-badge {
  font-size: 10px;
  background: #0d160e;
  border: 1px dashed #3a5438;
  padding: 1px 6px;
  border-radius: 3px;
  color: #ffd700;
  cursor: pointer;
  transition: background 0.15s;
}

.wiki-item-id-badge:hover {
  background: #1c2e1e;
  border-color: #ffd700;
}

.wiki-type-badge {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: bold;
  text-transform: uppercase;
}

.badge-resource { background: #1b381c; color: #7bed9f; border: 1px solid #2ed573; }
.badge-tool { background: #382c16; color: #f5cf7b; border: 1px solid #e1b12c; }
.badge-equip { background: #1b2838; color: #70a1ff; border: 1px solid #1e90ff; }
.badge-consumable { background: #381b28; color: #ff7675; border: 1px solid #d63031; }

.wiki-item-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 10.5px;
  color: #8da488;
  background: rgba(0,0,0,0.25);
  padding: 3px 6px;
  border-radius: 3px;
}

.wiki-item-lore-box, .wiki-item-craft-box {
  font-size: 10.5px;
  line-height: 1.4;
  background: #0e170f;
  border-left: 2px solid #2f4a30;
  padding: 4px 6px;
  border-radius: 2px;
}

.wiki-lore-label, .wiki-craft-label {
  font-weight: bold;
  color: #b3cbb0;
  margin-bottom: 2px;
}

.wiki-lore-text {
  color: #8ca38a;
  font-style: italic;
}

.wiki-craft-text {
  color: #f5cf7b;
}

/* GUIAS & TABELAS NA WIKI */
#wiki-window .tab-bar {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 4px;
  scrollbar-width: thin;
}

#wiki-window .tab-bar .tab-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.wiki-guide-box {
  background: #111a12;
  border: 1px solid #233423;
  padding: 14px;
  border-radius: 6px;
}

.wiki-table-wrap {
  overflow-x: auto;
}

.wiki-guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.wiki-guide-table th {
  background: #18271a;
  color: #ffd700;
  text-align: left;
  padding: 7px 10px;
  border-bottom: 1px solid #334d31;
}

.wiki-guide-table td {
  padding: 7px 10px;
  border-bottom: 1px solid #1a281c;
  color: #b8ccb5;
}

.wiki-guide-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.wiki-guide-table code {
  color: #ffd700;
  background: #090e0a;
  padding: 2px 4px;
  border-radius: 3px;
  border: 1px solid #243825;
}

/* =========================================================
   BADGE DE PERFORMANCE EM TEMPO REAL (PING MS & FPS)
   ========================================================= */
#game-performance-hud {
  position: absolute;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(10, 18, 12, 0.92);
  border: 1px solid #2d4b30;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7), inset 0 0 10px rgba(35, 65, 38, 0.3);
  padding: 5px 12px;
  border-radius: 6px;
  z-index: 120;
  pointer-events: auto;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  user-select: none;
  backdrop-filter: blur(5px);
  cursor: grab;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

#game-performance-hud:hover {
  border-color: #4a754f;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.85), inset 0 0 12px rgba(45, 85, 50, 0.4);
}

#game-performance-hud.dragging {
  cursor: grabbing !important;
  border-color: #ffd700 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.9), 0 0 10px rgba(255, 215, 0, 0.3) !important;
  transition: none !important;
}

.perf-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.perf-label {
  color: #8da488;
  font-size: 10px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.perf-val {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 11.5px;
  font-weight: bold;
  color: #2ecc71;
  background: transparent !important;
  box-shadow: none !important;
  min-width: 24px;
  display: inline-block;
  line-height: 1;
}

.perf-val.good {
  color: #2ecc71 !important;
  text-shadow: 0 0 5px rgba(46, 204, 113, 0.4);
  background: transparent !important;
  box-shadow: none !important;
}

.perf-val.medium {
  color: #f1c40f !important;
  text-shadow: 0 0 5px rgba(241, 196, 15, 0.4);
  background: transparent !important;
  box-shadow: none !important;
}

.perf-val.poor {
  color: #e74c3c !important;
  text-shadow: 0 0 5px rgba(231, 76, 60, 0.4);
  background: transparent !important;
  box-shadow: none !important;
}

.perf-divider {
  color: #2d4b30;
  font-size: 11px;
  user-select: none;
  opacity: 0.7;
}

.perf-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: #2ecc71;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.8);
  display: inline-block;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  flex-shrink: 0;
}

.perf-dot.good {
  background-color: #2ecc71 !important;
  box-shadow: 0 0 6px rgba(46, 204, 113, 0.85);
}

.perf-dot.medium {
  background-color: #f1c40f !important;
  box-shadow: 0 0 6px rgba(241, 196, 15, 0.85);
}

.perf-dot.poor {
  background-color: #e74c3c !important;
  box-shadow: 0 0 6px rgba(231, 76, 60, 0.85);
}

.perf-dot.disconnected {
  background-color: #7f8c8d !important;
  box-shadow: none !important;
}








