/* ========== RESET E BASE ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
    background: #000;
    color: #e0e0e0;
    font-family: 'Roboto', Arial, sans-serif;
    font-size: 14px;
    cursor: url('../img/cursor/default.png'), auto;
    user-select: none;
    -webkit-user-select: none;
}

/* Forçar cursor personalizado em TODOS os elementos */
/* Forçar cursor personalizado em TODOS os elementos */
*,
*::before,
*::after {
    cursor: url('../img/cursor/default.png') 0 0, auto !important;
}

body.cursor-hand,
body.cursor-hand *,
body.cursor-hand *::before,
body.cursor-hand *::after {
    /* Style will be injected by JS with resized image */
    cursor: pointer;
}

:root {
    --gold-primary: #d4af37;
    --gold-light: #f4d03f;
    --gold-dark: #8b7355;
    --bg-dark: #1a1410;
    --bg-panel: #2a2218;
    --bg-modal: rgba(20, 16, 12, 0.85);
    --border-gold: rgba(212, 175, 55, 0.6);
    --text-main: #e8e0d5;
    --inventory-slot-size: 36px;
    --app-height: 100vh;
    --keyboard-offset: 0px;
    --keyboard-offset-top: 0px;
}

body.mobile-app {
    --app-height: 100vh;
}

input,
textarea {
    user-select: text;
    -webkit-user-select: text;
}

/* ========== SCROLLBAR GLOBAL - SEMPRE VISÍVEL ========== */
/* 
 * Força scrollbar SEMPRE visível em TODOS os elementos com scroll
 * Design medieval com dourado/bronze para combinar com o tema do jogo
 */

/* Regra universal para QUALQUER elemento com overflow scroll/auto */
*[style*="overflow"],
*[style*="overflow-y"],
*[style*="overflow-x"] {
    scrollbar-width: auto;
    scrollbar-color: rgba(180, 140, 90, 0.8) rgba(40, 32, 24, 0.6);
    scrollbar-gutter: stable;
}

/* Elementos específicos conhecidos com scroll */
.floating-window,
.floating-window *,
.window-body,
.window-content,
.character-info-content,
.kingdom-content,
.changelog-modal-content,
.changelog-entries,
.staff-body,
.staff-tab-content,
.anvil-body,
.shop-body,
.shop-items-list,
.shop-offers-list,
.shop-listings-list,
.global-chat-messages,
.global-chat-players,
.settings-content,
.wiki-content,
.wiki-body,
.map-content,
.modal-body,
.modal-content,
.panel-body,
.scroll-container,
.scrollable,
.coliseum-content,
.coliseum-player-list,
#landModalContent,
[class*="list"],
[class*="body"],
[class*="content"] {
    /* Firefox */
    scrollbar-width: auto;
    scrollbar-color: rgba(180, 140, 90, 0.8) rgba(40, 32, 24, 0.6);
}

/* Webkit (Chrome, Safari, Edge) - Regra universal */
*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: rgba(40, 32, 24, 0.7);
    border-radius: 5px;
    border: 1px solid rgba(139, 115, 85, 0.3);
}

*::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(180, 140, 90, 0.9), rgba(139, 100, 60, 0.9));
    border-radius: 5px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

*::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(212, 175, 55, 0.95), rgba(180, 140, 90, 0.95));
    border-color: rgba(212, 175, 55, 0.6);
}

/* Scrollbar mais elaborado para áreas principais de conteúdo */
.floating-window .window-body::-webkit-scrollbar,
.floating-window .window-content::-webkit-scrollbar,
.character-info-content::-webkit-scrollbar,
.kingdom-content::-webkit-scrollbar,
.changelog-modal-content::-webkit-scrollbar,
.staff-body::-webkit-scrollbar,
.anvil-body::-webkit-scrollbar,
.shop-items-list::-webkit-scrollbar,
.shop-offers-list::-webkit-scrollbar,
.shop-listings-list::-webkit-scrollbar,
.global-chat-messages::-webkit-scrollbar,
.settings-content::-webkit-scrollbar,
.wiki-content::-webkit-scrollbar,
.map-content::-webkit-scrollbar,
.coliseum-content::-webkit-scrollbar,
#landModalContent::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.floating-window .window-body::-webkit-scrollbar-track,
.floating-window .window-content::-webkit-scrollbar-track,
.character-info-content::-webkit-scrollbar-track,
.kingdom-content::-webkit-scrollbar-track,
.changelog-modal-content::-webkit-scrollbar-track,
.staff-body::-webkit-scrollbar-track,
.anvil-body::-webkit-scrollbar-track,
.shop-items-list::-webkit-scrollbar-track,
.shop-offers-list::-webkit-scrollbar-track,
.shop-listings-list::-webkit-scrollbar-track,
.global-chat-messages::-webkit-scrollbar-track,
.settings-content::-webkit-scrollbar-track,
.wiki-content::-webkit-scrollbar-track,
.map-content::-webkit-scrollbar-track,
.coliseum-content::-webkit-scrollbar-track,
#landModalContent::-webkit-scrollbar-track {
    background: rgba(30, 24, 18, 0.8);
    border-radius: 6px;
    border: 1px solid rgba(139, 115, 85, 0.4);
    margin: 2px;
}

.floating-window .window-body::-webkit-scrollbar-thumb,
.floating-window .window-content::-webkit-scrollbar-thumb,
.character-info-content::-webkit-scrollbar-thumb,
.kingdom-content::-webkit-scrollbar-thumb,
.changelog-modal-content::-webkit-scrollbar-thumb,
.staff-body::-webkit-scrollbar-thumb,
.anvil-body::-webkit-scrollbar-thumb,
.shop-items-list::-webkit-scrollbar-thumb,
.shop-offers-list::-webkit-scrollbar-thumb,
.shop-listings-list::-webkit-scrollbar-thumb,
.global-chat-messages::-webkit-scrollbar-thumb,
.settings-content::-webkit-scrollbar-thumb,
.wiki-content::-webkit-scrollbar-thumb,
.map-content::-webkit-scrollbar-thumb,
.coliseum-content::-webkit-scrollbar-thumb,
#landModalContent::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #b4946a, #8b6e4e);
    border-radius: 6px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
}

.floating-window .window-body::-webkit-scrollbar-thumb:hover,
.floating-window .window-content::-webkit-scrollbar-thumb:hover,
.character-info-content::-webkit-scrollbar-thumb:hover,
.kingdom-content::-webkit-scrollbar-thumb:hover,
.changelog-modal-content::-webkit-scrollbar-thumb:hover,
.staff-body::-webkit-scrollbar-thumb:hover,
.anvil-body::-webkit-scrollbar-thumb:hover,
.shop-items-list::-webkit-scrollbar-thumb:hover,
.shop-offers-list::-webkit-scrollbar-thumb:hover,
.shop-listings-list::-webkit-scrollbar-thumb:hover,
.global-chat-messages::-webkit-scrollbar-thumb:hover,
.settings-content::-webkit-scrollbar-thumb:hover,
.wiki-content::-webkit-scrollbar-thumb:hover,
.map-content::-webkit-scrollbar-thumb:hover,
.coliseum-content::-webkit-scrollbar-thumb:hover,
#landModalContent::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #d4af37, #b4946a);
    border-color: rgba(212, 175, 55, 0.8);
}

/* Forçar overflow-y: auto ou scroll para mostrar scrollbar quando necessário */
.floating-window .window-body,
.character-info-content,
.kingdom-content,
.changelog-modal-content,
.staff-body,
.anvil-body,
.settings-content,
.wiki-content,
.map-content {
    overflow-y: auto !important;
    overflow-x: hidden;
}

.hidden {
    display: none !important;
}

/* ========== TOUCH DRAG GHOST ========== */
#touch-ghost-item {
    position: fixed !important;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.95), rgba(40, 30, 20, 0.95));
    border: 2px solid var(--gold-primary);
    border-radius: 8px;
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.5),
        0 8px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none !important;
    z-index: 99999 !important;
    opacity: 0.95;
    /* Performance: usar transform ao invés de top/left para animação mais fluida */
    will-change: transform;
    /* Remover transições para resposta instantânea */
    transition: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

#touch-ghost-item.hidden {
    display: none !important;
    visibility: hidden;
}

#touch-ghost-item img {
    width: 85%;
    height: 85%;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
    pointer-events: none;
}

#touch-ghost-item .item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 4px #000;
    pointer-events: none;
    font-family: 'Roboto', sans-serif;
}

/* ========== CANVAS ========== */
canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: block;
    z-index: 0;
}

/* Garante que o canvas não seja afetado por redimensionamentos agressivos de teclado no mobile */
body.mobile-app canvas {
    width: 100vw;
    height: 100vh;
    top: 0;
}

#deathOverlay {
    position: fixed;
    inset: 0;
    background: #ffffff;
    opacity: 0;
    pointer-events: none;
    z-index: 200;
    transition: opacity 0.9s ease;
}

#deathOverlay.visible {
    opacity: 1;
}

/* ========== HUD ========== */
#hud {
    position: absolute;
    top: calc(-1 * var(--keyboard-offset-top, 0px));
    left: 0;
    right: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent);
    padding: 6px 10px;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    pointer-events: none;
}

#hud>* {
    pointer-events: auto;
}

.hud-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 3px;
    font-family: 'MedievalSharp', cursive;
    font-size: 11px;
    color: var(--text-main);
    text-shadow: 1px 1px 2px #000;
}

.hud-row span {
    color: var(--gold-light);
}

#hud input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-primary);
}

#hud label {
    padding: 4px;
    margin: -4px;
}

/* ========== BOTTOM PANEL ========== */
#bottomPanel {
    position: absolute;
    bottom: 8px;
    left: 0;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    z-index: 120;
    pointer-events: none;
}

body.mobile-app #bottomPanel {
    position: fixed;
}

/* Quando teclado está aberto - posicionar acima do teclado usando visual viewport */
body.keyboard-open #bottomPanel {
    bottom: 0;
    /* Usar CSS variables setadas pelo JS no visualViewport resize */
    transform: translateY(calc(-1 * var(--keyboard-offset, 0px)));
    transition: transform 0.15s ease;
}

/* Esconder inventário quando chat local está focado para dar mais espaço */
body.chat-input-focused #bottomPanel .inventory-wrapper {
    display: none;
}

/* ========== INVENTORY ========== */
.inventory-wrapper {
    position: relative;
    /* Para o botão toggle se posicionar corretamente */
    pointer-events: auto;
    display: flex;
    flex-direction: column;
    width: fit-content;
    /* Ajusta ao conteúdo (grid) */
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.local-health-bar {
    width: 100%;
    height: 6px;
    background: #222;
    border: 1px solid var(--border-gold);
    border-radius: 3px;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    margin-bottom: 4px;
    /* Descolada da bag */
    z-index: 1;
}

.local-health-fill {
    height: 100%;
    background: #19c55f;
    /* Verde igual aos outros players */
    width: 100%;
    transition: width 0.3s ease;
}

.local-health-fill.invincible {
    background: #9ca3af;
}

#localPlayerHealthText {
    display: none;
}

/* ========== BARRA DE REPUTAÇÃO ========== */
.reputation-bar {
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, rgba(20, 15, 10, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid rgba(180, 140, 60, 0.6);
    border-radius: 3px;
    position: relative;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.5),
        inset 0 0 4px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    margin-bottom: 3px;
    z-index: 1;
}

.reputation-bar.hidden,
.reputation-bar[data-hidden="true"] {
    display: none;
}

.reputation-fill {
    height: 100%;
    width: 0%;
    position: absolute;
    top: 0;
    left: 0;
    transition: width 0.5s ease, background 0.3s ease;
    border-radius: 2px;
}

/* Reputação positiva - Dourada imponente */
.reputation-fill.positive {
    background: linear-gradient(90deg,
            #8B7355 0%,
            #D4AF37 30%,
            #F4D03F 50%,
            #FFD700 70%,
            #D4AF37 100%);
    box-shadow:
        0 0 6px rgba(212, 175, 55, 0.6),
        0 0 12px rgba(244, 208, 63, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    animation: reputationShine 2s ease-in-out infinite;
}

/* Reputação negativa - Vermelha */
.reputation-fill.negative {
    background: linear-gradient(90deg,
            #8B0000 0%,
            #DC143C 30%,
            #FF4444 50%,
            #DC143C 70%,
            #8B0000 100%);
    box-shadow:
        0 0 6px rgba(220, 20, 60, 0.6),
        0 0 12px rgba(255, 68, 68, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

@keyframes reputationShine {

    0%,
    100% {
        filter: brightness(1);
    }

    50% {
        filter: brightness(1.15);
    }
}

/* ========== MODAL DE INFORMAÇÕES DO PERSONAGEM ========== */
.character-info-modal {
    min-width: 240px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    /* Permite scroll interno quando o conteúdo excede o max-height do .floating-window */
    min-height: 0;
}

.character-info-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
}

.character-info-paperdoll {
    /* Não deixar encolher até sumir quando o modal fica baixo */
    flex: 0 0 auto;
    width: clamp(130px, 44vw, 160px);
    height: clamp(150px, 32vh, 220px);
    min-height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

.character-info-paperdoll img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.character-info-stats {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.character-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(100, 80, 60, 0.3);
}

.character-stat-row .stat-label {
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: var(--gold-light);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.character-stat-row .stat-value {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #c4b89a;
}

/* Título do jogador */
.title-value {
    color: #B8860B;
}

/* Reputação - mantém padrão mas com cores indicativas */
.reputation-value.positive {
    color: #d4af37;
}

.reputation-value.negative {
    color: #c44;
}

.reputation-value.neutral {
    color: #888;
}

.inventory-panel {
    background: linear-gradient(135deg, var(--bg-modal), rgba(30, 24, 18, 0.95));
    border: 2px solid var(--border-gold);
    border-radius: 8px;
    padding: 5px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.8),
        0 4px 12px rgba(0, 0, 0, 0.7),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: auto;
}

.inventory-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: visible;
    max-width: 380px;
    /* Limit width to force wrapping if needed, or keep it fluid */
}

.item-slot {
    width: var(--inventory-slot-size);
    height: var(--inventory-slot-size);
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.8), rgba(20, 15, 10, 0.8));
    border: 1px solid rgba(100, 80, 60, 0.5);
    border-radius: 4px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    overflow: visible;
}

.item-slot:hover {
    border-color: var(--gold-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.item-slot.hand-slot {
    border-color: var(--gold-primary);
    background:
        radial-gradient(circle at 30% 25%, rgba(212, 175, 55, 0.25), transparent 55%),
        linear-gradient(135deg, rgba(70, 50, 30, 0.95), rgba(35, 25, 15, 0.95));
    box-shadow:
        0 0 0 2px rgba(212, 175, 55, 0.4),
        0 10px 24px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    margin-right: 14px;
    position: relative;
    isolation: isolate;
    overflow: hidden;
}

.item-slot.hand-slot::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: calc(100% - 4px);
    height: calc(100% - 4px);
    transform: translate(-50%, -50%);
    border-radius: inherit;
    box-sizing: border-box;
    border: 1px dashed rgba(212, 175, 55, 0.5);
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
    transition: none;
}

.item-slot.hand-slot:hover {
    transform: none;
}

.item-slot.has-item:not(.hand-slot) {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    box-shadow:
        0 0 8px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.item-slot.hand-slot.has-item {
    border-color: var(--gold-light);
    background:
        radial-gradient(circle at 30% 25%, rgba(212, 175, 55, 0.32), transparent 55%),
        linear-gradient(135deg, rgba(82, 62, 42, 0.96), rgba(48, 32, 20, 0.96));
    box-shadow:
        0 0 10px rgba(212, 175, 55, 0.35),
        0 12px 26px rgba(0, 0, 0, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.item-slot.body-slot {
    margin-right: 16px;
    /* Separar do resto */
    border-color: rgba(150, 150, 150, 0.5);
    position: relative;
}

.item-slot.body-slot:not(.has-item)::after {
    content: '';
    position: absolute;
    inset: 10px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.5;
}

.item-slot.body-slot.has-item {
    border-color: #aaa;
    box-shadow: 0 0 8px rgba(200, 200, 200, 0.3);
}

.item-slot.selected,
.item-slot.has-item.selected {
    box-shadow:
        0 0 15px var(--gold-light),
        inset 0 0 10px rgba(255, 255, 255, 0.5);
    transform: scale(1.1);
    z-index: 20;
    animation: slotPulse 1.5s infinite alternate;
}

@keyframes slotPulse {
    from {
        box-shadow: 0 0 10px var(--gold-primary), inset 0 0 5px var(--gold-light);
    }

    to {
        box-shadow: 0 0 20px var(--gold-light), inset 0 0 10px #e1b438a5;
    }
}

.item-slot img {
    width: 85%;
    height: 85%;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
    pointer-events: none;
    position: relative;
    z-index: 1;
}

.item-count {
    position: absolute;
    bottom: 1px;
    right: 2px;
    font-size: 9px;
    font-weight: bold;
    color: #fff;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 2px #000;
    pointer-events: none;
    font-family: 'Roboto', sans-serif;
    z-index: 2;
}

/* Barra de durabilidade - Estilo Minecraft */
.durability-bar {
    position: absolute;
    bottom: 2px;
    left: 2px;
    right: 2px;
    height: 3px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 1px;
    overflow: hidden;
    pointer-events: none;
    z-index: 3;
}

.durability-fill {
    height: 100%;
    transition: width 0.2s ease, background-color 0.2s ease;
    border-radius: 1px;
}

/* Barra de água para baldes */
.water-bar {
    background: rgba(0, 0, 0, 0.7);
    /* Mesmo fundo da durability-bar */
}

.water-fill {
    background: linear-gradient(90deg, #1d4ed8, #3b82f6, #60a5fa);
    box-shadow: 0 0 4px rgba(59, 130, 246, 0.5);
}

/* ========== CHAT ========== */
#chatWrapper {
    width: min(85%, 280px);
    pointer-events: auto;
    display: none;
    /* Escondido por padrão no desktop */
}

#chatWrapper.visible {
    display: block;
}

/* Forçar chat visível durante gravação de áudio */
#chatWrapper.recording-mode {
    display: block !important;
}



.chat-input-container {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gold-dark);
    border-radius: 18px;
    padding: 2px 10px;
    display: flex;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

#chatInput {
    width: 100%;
    height: 26px;
    background: transparent;
    border: none;
    color: #fff;
    font-family: 'Georgia', serif;
    font-size: 12px;
    padding: 0 6px;
    text-align: center;
}

#chatInput:focus {
    outline: none;
}

#chatInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

/* Mobile: fonte maior para evitar zoom no iOS */
@media (max-width: 768px),
(hover: none) and (pointer: coarse) {
    #chatInput {
        font-size: 16px;
        height: 32px;
    }

    .chat-input-container {
        padding: 4px 12px;
    }
}

/* ========== CHAT LOCAL MIC BUTTON ========== */
.chat-local-mic-btn {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-light, #f8e6c8);
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
    margin-left: 4px;
}

.chat-local-mic-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    display: inline-block;
    flex-shrink: 0;
    pointer-events: none;
}

.chat-local-mic-btn svg * {
    pointer-events: none;
}

.chat-local-mic-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    transform: scale(1.1);
}

.chat-local-mic-btn.recording {
    background: rgba(231, 76, 60, 0.4);
    color: #ff8888;
    animation: micPulseLocal 1s ease-in-out infinite;
}

@keyframes micPulseLocal {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Container de gravação do chat local */
.chat-local-recording-container {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.4);
    border-radius: 18px;
    width: 100%;
}

.chat-local-recording-timer {
    font-family: 'Roboto Mono', monospace;
    font-size: 12px;
    font-weight: 600;
    color: #ff8888;
    min-width: 40px;
}

.chat-local-recording-waveform {
    flex: 1;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.chat-local-recording-bar {
    width: 2px;
    height: 4px;
    background: #ff8888;
    border-radius: 1px;
    transition: height 0.05s ease;
}

.chat-local-recording-actions {
    display: flex;
    gap: 6px;
}

.chat-local-recording-cancel,
.chat-local-recording-send {
    width: 26px;
    height: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.chat-local-recording-cancel svg,
.chat-local-recording-send svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
    display: inline-block;
    flex-shrink: 0;
    pointer-events: none;
}

.chat-local-recording-cancel {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 115, 85, 0.5);
    color: #a09080;
}

.chat-local-recording-cancel:hover {
    background: rgba(231, 76, 60, 0.3);
    border-color: #e74c3c;
    color: #ff8888;
}

.chat-local-recording-send {
    background: linear-gradient(135deg, var(--gold-primary, #d4af37), #a67c52);
    border: none;
    color: #1a120b;
}

.chat-local-recording-send:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #e5c04b, #b88c5c);
}

/* ========== CHAT BUTTON ========== */
#chatBtn {
    position: fixed;
    top: 10px;
    left: 58px;
    /* 10px + 42px + 6px gap */
    width: 42px;
    height: 42px;
    padding: 0;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

#chatBtn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
}

#chatBtn svg {
    width: 24px;
    height: 24px;
    display: inline-block;
    flex-shrink: 0;
    pointer-events: none;
}

#chatBtn.active {
    border-color: var(--gold-primary);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
}

/* Botão Assistente Virtual (ChatGPT) */
#assistantBtn {
    position: fixed;
    top: 10px;
    left: 106px;
    /* 10px + 42px + 6px + 42px + 6px */
    width: 42px;
    height: 42px;
    padding: 0;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

#assistantBtn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
}

#assistantBtn svg {
    width: 22px;
    height: 22px;
}

#assistantBtn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translate(-50%, 0) scale(0.95);
    background: rgba(30, 22, 15, 0.95);
    color: var(--gold-light);
    padding: 4px 8px;
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    font-family: 'MedievalSharp', cursive;
    font-size: 9px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 1100;
}

#assistantBtn:hover::after,
#assistantBtn:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

/* ========== VOICE PANEL ========== */
.voice-panel {
    position: fixed;
    top: max(8px, env(safe-area-inset-top, 8px));
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    z-index: 360;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--gold-dark);
    border-radius: 14px;
    padding: 4px 8px;
    backdrop-filter: blur(4px);
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.voice-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid var(--gold-dark);
    background: rgba(40, 30, 20, 0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: all 0.2s;
    touch-action: manipulation;
}

.voice-btn:hover {
    border-color: var(--gold-primary);
    background: rgba(60, 45, 30, 0.9);
    transform: scale(1.05);
}

.voice-btn.active {
    background: var(--gold-primary);
    border-color: var(--gold-light);
    box-shadow: 0 0 8px var(--gold-primary);
}

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

.voice-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    pointer-events: none;
    display: block;
}

.voice-flag {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer !important;
    transition: all 0.2s;
    color: var(--gold-light);
}

.voice-flag:hover {
    background: rgba(60, 45, 30, 0.5);
    transform: scale(1.05);
}

.voice-flag .flag-segment {
    width: 18px;
    height: 10px;
    border: 1px solid rgba(0, 0, 0, 0.6);
    border-radius: 2px;
}

.voice-tooltip {
    position: absolute;
    bottom: -36px;
    right: 0;
    background: rgba(0, 0, 0, 0.9);
    color: var(--gold-light);
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--gold-dark);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    white-space: nowrap;
    font-family: 'MedievalSharp', cursive;
}

.voice-tooltip.visible {
    opacity: 1;
}

/* ========== FLOATING WINDOWS ========== */
.floating-window {
    position: fixed;
    top: auto;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--bg-modal), rgba(30, 24, 18, 0.98));
    border: 2px solid var(--border-gold);
    border-radius: 8px;
    padding: 10px;
    color: var(--text-main);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.8),
        0 8px 24px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    z-index: 1200;
    user-select: none;
    max-width: 92vw;
    height: fit-content;
    max-height: 70vh;
}

#groupCreationModal,
#groupInviteModal {
    z-index: 1600;
}

.floating-window.chest-window {
    min-width: 220px;
    max-width: 320px;
    width: fit-content;
}

.floating-window.bag-window {
    min-width: unset;
    max-width: 260px;
    width: fit-content;
}

.window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--gold-dark);
    cursor: move;
    user-select: none;
    padding: 6px 8px;
    margin: -10px -10px 8px -10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px 8px 0 0;
}

.window-header strong,
.window-header h2 {
    font-family: 'Cinzel', serif;
    font-size: 11px;
    color: var(--gold-light);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.2px;
    margin: 0;
    font-weight: bold;
}

.window-header button {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(139, 115, 85, 0.5);
    border-radius: 5px;
    color: var(--text-muted, #a09080);
    font-size: 16px;
    line-height: 1;
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-weight: bold;
    cursor: pointer;
}

.window-header button:hover {
    background: rgba(60, 50, 40, 0.6);
    border-color: var(--gold-primary, #d4af37);
    color: var(--gold-primary, #d4af37);
    transform: scale(1.05);
}

/* ========== CHEST & GRIDS ========== */
.chest-grid,
.trade-grid,
.forge-layout,
.table-layout,
.anvil-layout {
    display: grid;
    gap: 4px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(100, 80, 60, 0.3);
    position: relative;
    overflow: visible;
}

.chest-grid {
    --chest-slot-size: 34px;
    --chest-columns: 5;
    grid-template-columns: repeat(var(--chest-columns), var(--chest-slot-size));
    grid-auto-rows: var(--chest-slot-size);
    /* Voltar para fit-content para a janela encolher */
    width: fit-content;
    box-sizing: content-box;
    margin: 0 auto;
}

#chestWindow.bag-window .chest-grid {
    margin: 0 auto;
}

/* Header actions container */
.window-header .header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Botão Pegar Tudo */
.take-all-btn {
    background: rgba(40, 100, 40, 0.6);
    border: 1px solid rgba(80, 150, 80, 0.8);
    border-radius: 50%;
    color: #fff;
    width: 22px;
    height: 22px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer;
}

.take-all-btn svg {
    width: 12px;
    height: 12px;
    fill: #fff;
    pointer-events: none;
}

.take-all-btn:hover {
    background: rgba(60, 140, 60, 0.8);
    border-color: rgba(100, 180, 100, 1);
    transform: scale(1.1);
}

/* ========== BANK WINDOW ========== */
.floating-window.bank-window {
    min-width: unset;
    max-width: 400px;
    width: fit-content;
}

.bank-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 8px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(100, 80, 60, 0.3);
    /* Forçar largura igual ao grid para as abas não esticarem a janela */
    width: 100%;
    box-sizing: border-box;
}

.bank-tab {
    flex: 1;
    padding: 6px 8px;
    font-size: 10px;
    text-transform: none;
    border-radius: 4px;
    background: rgba(40, 30, 20, 0.6);
    border: 1px solid rgba(80, 60, 40, 0.5);
    color: rgba(212, 175, 55, 0.7);
    transition: all 0.2s;
}

.bank-tab:hover {
    background: rgba(60, 45, 30, 0.8);
    border-color: var(--gold-dark);
    color: var(--gold-light);
    transform: translateY(-1px);
}

.bank-tab.active {
    background: linear-gradient(135deg, rgba(80, 60, 40, 0.9), rgba(60, 45, 30, 0.9));
    border-color: var(--gold-primary);
    color: var(--gold-light);
    box-shadow: 0 0 8px rgba(212, 175, 55, 0.3);
}

.bank-grid {
    display: grid;
    gap: 4px;
    padding: 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(100, 80, 60, 0.3);
    grid-template-columns: repeat(5, 34px);
    width: fit-content;
    margin: 0 auto;
    max-height: none;
    overflow: visible;
}

.bank-grid .item-slot {
    width: 34px;
    height: 34px;
}

.bank-total-info {
    margin-bottom: 8px;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-size: 10px;
    text-align: center;
    color: var(--gold-light);
    font-family: 'MedievalSharp', cursive;
    border: 1px solid rgba(120, 100, 60, 0.35);
}

/* ========== MODAL DO REINO (SALA DO TRONO) ========== */
.kingdom-modal {
    min-width: 300px;
    max-width: 380px;
    width: 90vw;
    min-height: 400px;
    max-height: 80vh;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    bottom: auto;
    display: flex;
    flex-direction: column;
    z-index: 2000;
}

.kingdom-modal .window-header {
    flex-shrink: 0;
}

.kingdom-modal .kingdom-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 14px;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
}


.kingdom-paperdoll {
    width: 180px;
    height: 240px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(212, 175, 55, 0.3);
    background: linear-gradient(135deg, rgba(30, 20, 10, 0.9), rgba(60, 40, 20, 0.8));
    border: 2px solid var(--gold-primary);
}

.kingdom-paperdoll img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.kingdom-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--gold-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    text-align: center;
}

.kingdom-info {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(100, 80, 60, 0.4);
}

.kingdom-ruler {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
}

.kingdom-ruler .ruler-crown {
    font-size: 20px;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
}

.kingdom-ruler .ruler-name {
    color: var(--gold-light);
    font-weight: 600;
}

.kingdom-citizens-title {
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: rgba(200, 180, 140, 0.8);
    border-bottom: 1px solid rgba(100, 80, 60, 0.4);
    padding-bottom: 4px;
    width: 100%;
    text-align: center;
}

.kingdom-citizens-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kingdom-citizen-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    border: 1px solid rgba(80, 60, 40, 0.3);
    transition: background 0.2s;
}

.kingdom-citizen-row:hover {
    background: rgba(40, 30, 20, 0.5);
}

.kingdom-citizen-row .citizen-icon {
    font-size: 14px;
    margin-right: 6px;
}

.kingdom-citizen-row .citizen-name {
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: var(--text-main);
    flex: 1;
}

.kingdom-citizen-row.king .citizen-name {
    color: var(--gold-light);
    font-weight: bold;
}

.kingdom-citizen-row.lord .citizen-name {
    color: #87CEEB;
}

.kingdom-citizen-row .citizen-reputation {
    font-family: 'Roboto', sans-serif;
    font-size: 10px;
    color: rgba(180, 160, 120, 0.8);
}

.kingdom-no-citizens {
    text-align: center;
    font-size: 11px;
    color: rgba(150, 130, 100, 0.6);
    font-style: italic;
    padding: 12px;
}

/* ========== ANIMAÇÃO DE COROAÇÃO ========== */
#coronationOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s ease;
}

#coronationOverlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.coronation-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    animation: coronationEnter 0.8s ease-out;
}

@keyframes coronationEnter {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }

    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.coronation-crown {
    font-size: 80px;
    animation: coronationCrown 2s ease-in-out infinite;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
}

@keyframes coronationCrown {

    0%,
    100% {
        transform: translateY(0) scale(1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }

    50% {
        transform: translateY(-10px) scale(1.05);
        filter: drop-shadow(0 0 40px rgba(255, 215, 0, 1));
    }
}

.coronation-title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--gold-light);
    text-shadow:
        0 0 10px rgba(255, 215, 0, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.8);
    text-align: center;
    animation: coronationText 1s ease-out 0.3s both;
}

@keyframes coronationText {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.coronation-subtitle {
    font-family: 'MedievalSharp', cursive;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    animation: coronationText 1s ease-out 0.6s both;
}



.trade-grid {
    grid-template-columns: repeat(3, 34px);
}

.chest-grid .item-slot,
.trade-grid .item-slot {
    width: var(--chest-slot-size, 34px);
    height: var(--chest-slot-size, 34px);
}

/* Slots de mesa e bigorna com hints */
.table-slot,
.anvil-slot {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.8), rgba(20, 15, 10, 0.8));
    border: 1px solid rgba(100, 80, 60, 0.5);
}

.table-slot::after,
.anvil-slot::after {
    content: '';
    position: absolute;
    inset: 5px;
    background-image: var(--hint-image, none);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.25;
    filter: grayscale(1);
    pointer-events: none;
    transition: opacity 0.3s;
}

.table-slot.has-item::after,
.anvil-slot.has-item::after {
    opacity: 0;
}

.table-slot.has-item,
.anvil-slot.has-item {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
}

.table-slot img,
.anvil-slot img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    position: relative;
    z-index: 1;
}

.table-result-slot,
.anvil-result-slot {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.8), rgba(20, 15, 10, 0.8));
    border: 1px solid rgba(100, 80, 60, 0.5);
}

.table-result-slot::after,
.anvil-result-slot::after {
    content: '';
    position: absolute;
    inset: 5px;
    background-image: var(--hint-image, none);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.25;
    filter: grayscale(1);
    pointer-events: none;
    transition: opacity 0.3s;
}

.table-result-slot.has-item::after,
.anvil-result-slot.has-item::after {
    opacity: 0;
}

.table-result-slot.has-item,
.anvil-result-slot.has-item {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
}

.table-result-slot img,
.anvil-result-slot img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    position: relative;
    z-index: 1;
}

/* ========== FORGE ========== */
.forge-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.forge-layout,
.bonfire-layout,
.table-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
}

/* Animação de fogo APENAS na forja */
.forge-layout::before,
.bonfire-layout::before {
    content: '🔥';
    position: absolute;
    top: 30px;
    font-size: 14px;
    animation: fireFlicker 1.5s ease-in-out infinite;
    filter: drop-shadow(0 0 6px rgba(255, 100, 0, 0.8));
    z-index: -1;
}

/* Mesa e bigorna NÃO têm fogo */
.table-layout::before,
.anvil-layout::before {
    content: none;
}

@keyframes fireFlicker {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1) translateY(0);
    }

    25% {
        opacity: 1;
        transform: scale(1.1) translateY(-2px);
    }

    50% {
        opacity: 0.9;
        transform: scale(0.95) translateY(0);
    }

    75% {
        opacity: 1;
        transform: scale(1.05) translateY(-1px);
    }
}

.forge-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.forge-slot,
.forge-result-slot {
    position: relative;
    width: 42px;
    height: 42px;
    border-radius: 6px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.8), rgba(20, 15, 10, 0.8));
    border: 1px solid rgba(100, 80, 60, 0.5);
}

/* Hint de imagem de fundo */
.forge-slot::after,
.forge-result-slot::after {
    content: '';
    position: absolute;
    inset: 5px;
    background-image: var(--hint-image, none);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.25;
    filter: grayscale(1);
    pointer-events: none;
    transition: opacity 0.3s;
}

.forge-slot.has-item::after,
.forge-result-slot.has-item::after {
    opacity: 0;
}

.forge-slot.has-item,
.forge-result-slot.has-item {
    border-color: var(--border-gold);
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
}

.forge-slot img,
.forge-result-slot img {
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    position: relative;
    z-index: 1;
}

.forge-arrow {
    font-size: 28px;
    color: var(--gold-light);
    text-shadow: 0 0 8px rgba(212, 175, 55, 0.5);
    user-select: none;
    font-family: 'Cinzel', serif;
}

/* ========== BUTTONS ========== */
button {
    font-family: 'MedievalSharp', cursive;
    border: 2px solid var(--gold-dark);
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    color: var(--gold-light);
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

button:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.5);
}

button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

button.confirm {
    background: linear-gradient(135deg, rgba(40, 80, 40, 0.9), rgba(20, 60, 20, 0.9));
    border-color: rgba(80, 150, 80, 0.8);
    color: #fff;
}

button.confirm:hover {
    background: linear-gradient(135deg, rgba(60, 100, 60, 1), rgba(40, 80, 40, 1));
    border-color: rgba(100, 180, 100, 1);
}

button.cancel {
    background: linear-gradient(135deg, rgba(80, 40, 40, 0.9), rgba(60, 20, 20, 0.9));
    border-color: rgba(150, 80, 80, 0.8);
    color: #fff;
}

button.cancel:hover {
    background: linear-gradient(135deg, rgba(100, 60, 60, 1), rgba(80, 40, 40, 1));
    border-color: rgba(180, 100, 100, 1);
}

/* ========== RIGHT ACTION PANEL (AÇÕES + MAGIAS) ========== */
/* Definição única (evita conflitos de CSS que encolhiam ícones em alguns breakpoints). */
:root {
    --ui-bottom-clearance: 0px;
}

/* ========== QUANTITY MODAL ========== */
.quantity-box {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.quantity-box label {
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: var(--gold-light);
    text-align: center;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-box input {
    flex: 1;
    padding: 10px;
    border-radius: 6px;
    border: 2px solid var(--gold-dark);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 16px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
}

.quantity-box input:focus {
    outline: none;
}

.quantity-box .actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
}

/* ========== GHOST CURSOR ========== */
#ghostItemCursor,
#touch-ghost-item {
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    width: 52px;
    height: 52px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.3), transparent);
    border: 2px solid var(--gold-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.6);
}

#ghostItemCursor img,
#touch-ghost-item img {
    width: 70%;
    height: 70%;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.8));
}

#ghostItemCursor .count,
#touch-ghost-item .item-count {
    position: absolute;
    bottom: 2px;
    right: 2px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
}

/* ========== PLAYER ACTIONS ========== */
#playerActionsModal {
    min-width: 220px;
    max-width: 280px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#playerActionsModal .window-header {
    padding: 8px 12px;
}

#playerActionsModal .window-header strong {
    font-size: 12px;
}

.player-actions-content {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    padding: 8px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    flex: 1 1 auto;
    min-height: 0;
}

.player-actions-paperdoll {
    flex: 0 0 auto;
    width: clamp(130px, 44vw, 160px);
    height: clamp(150px, 32vh, 220px);
    min-height: 150px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
}

/* Responsividade para telas menores (Mobile) e telas baixas */
@media (max-width: 768px),
(max-height: 600px) {
    #playerActionsModal {
        min-width: 200px;
        max-width: 260px;
    }

    .player-actions-paperdoll {
        width: clamp(110px, 38vw, 140px);
        height: clamp(130px, 26vh, 180px);
        min-height: 130px;
    }

    .player-actions-content {
        gap: 6px;
        padding: 6px;
    }

    .player-actions-grid {
        gap: 6px;
    }

    .player-action-btn {
        padding: 8px 6px;
        min-height: 50px;
        gap: 4px;
    }

    .player-action-btn svg {
        width: 18px;
        height: 18px;
    }

    .player-action-btn span {
        font-size: 10px;
    }
}

.player-actions-paperdoll img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Display de informações no modal de ações - mesmo estilo do modal de informações */
.player-reputation-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    border: 1px solid rgba(100, 80, 60, 0.3);
    width: 100%;
}

.player-reputation-display .reputation-label {
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: var(--gold-light);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.player-reputation-display .stat-value {
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #c4b89a;
}

.player-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
}

.player-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    min-height: 56px;
    transition: all 0.2s;
    border-radius: 6px;
}

.player-action-btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: var(--gold-light);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.5));
    flex-shrink: 0;
}

/* Regras específicas para ícones preenchidos (Invite e Trade) */
.player-action-btn.invite svg,
.player-action-btn.trade svg {
    fill: var(--gold-light);
    stroke: none;
}

/* Regra para partes preenchidas dentro de ícones de contorno (ex: centro do alvo) */
.player-action-btn svg circle[fill="currentColor"] {
    fill: var(--gold-light);
    stroke: none;
}

.player-action-btn span {
    font-size: 11px;
    color: var(--text-main);
    font-family: 'MedievalSharp', cursive;
}

.player-action-btn:hover svg {
    stroke: var(--gold-primary);
    transform: scale(1.1);
}

/* Hover específico para ícones preenchidos */
.player-action-btn.invite:hover svg,
.player-action-btn.trade:hover svg {
    fill: var(--gold-primary);
    stroke: none;
}

.player-action-btn:hover svg circle[fill="currentColor"] {
    fill: var(--gold-primary);
}

.player-action-btn.kick {
    border-color: #ff4444;
    background: rgba(100, 0, 0, 0.4);
}

.player-action-btn.kick svg {
    fill: #ff4444;
    stroke: none;
}

.player-action-btn.kick:hover {
    background: rgba(150, 0, 0, 0.6);
}

/* ========== GROUP MODALS ========== */
.color-picker-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.color-picker-row label {
    flex: 1;
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
    color: var(--gold-light);
}

.color-picker-row input[type="color"] {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.5);
    padding: 2px;
    cursor: pointer;
}

.group-creation-actions,
.group-invite-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.group-creation-actions button,
.group-invite-actions button {
    flex: 1;
}

.group-invite-message {
    text-align: center;
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
    padding: 12px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(100, 80, 60, 0.3);
}

/* ========== GROUP MEMBERS MODAL ========== */
.group-members-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 1px solid rgba(100, 80, 60, 0.3);
}

.group-bonus-hint {
    font-size: 11px;
    color: rgba(224, 210, 180, 0.7);
    text-align: center;
    padding: 6px 8px;
    border: 1px dashed rgba(139, 115, 85, 0.35);
    border-radius: 6px;
    background: rgba(20, 16, 12, 0.35);
    margin-bottom: 8px;
}

.group-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(40, 30, 20, 0.6);
    border: 1px solid rgba(100, 80, 60, 0.4);
    border-radius: 6px;
    margin-bottom: 8px;
    transition: all 0.2s;
}

.group-member-item:hover {
    background: rgba(60, 45, 30, 0.7);
    border-color: var(--gold-dark);
}

.group-member-item:last-child {
    margin-bottom: 0;
}

.group-member-name {
    flex: 1;
    font-size: 14px;
    color: var(--text-main);
    font-family: 'MedievalSharp', cursive;
}

.group-member-remove-btn {
    width: 32px;
    height: 32px;
    padding: 6px;
    border-radius: 50%;
    border: 2px solid rgba(150, 0, 0, 0.6);
    background: rgba(100, 0, 0, 0.4);
    color: #ff6666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    cursor: pointer !important;
}

.group-member-remove-btn:hover {
    background: rgba(150, 0, 0, 0.7);
    border-color: rgba(200, 0, 0, 0.9);
    color: #ff3333;
    transform: scale(1.1);
}

.group-member-remove-btn svg {
    pointer-events: none;
}

.group-members-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.group-members-actions button {
    flex: 1;
}

/* ========== TRADE ========== */
.trade-body {
    display: flex;
    gap: 20px;
}

.trade-column {
    flex: 1;
}

.trade-column h4 {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--gold-light);
    margin-bottom: 10px;
    text-align: center;
}

.trade-actions {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
}

.trade-actions input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--gold-primary);
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 940px) {
    :root {
        --inventory-slot-size: 32px;
    }

    body {
        padding: env(safe-area-inset-top, 6px) env(safe-area-inset-right, 8px) env(safe-area-inset-bottom, 8px) env(safe-area-inset-left, 8px);
    }

    #hud {
        padding: 4px 8px 4px 8px;
    }

    .floating-window {
        position: fixed;
        top: auto;
        left: 50%;
        right: auto;
        bottom: 100px;
        transform: translateX(-50%);
        width: auto;
        max-width: min(95vw, 400px);
        border-radius: 10px;
        border-bottom: none;
        max-height: 60vh;
        overflow-y: auto;
    }

    .floating-window.bank-window,
    .floating-window.chest-window,
    .floating-window.bag-window {
        max-height: none;
        overflow: visible;
    }

    .inventory-grid {
        grid-template-columns: repeat(auto-fit, minmax(var(--inventory-slot-size), 1fr));
        justify-content: center;
        gap: 3px;
        max-width: calc(100vw - 12px);
    }

    .inventory-panel {
        width: 100%;
        max-width: calc(100vw - 6px);
    }

    .item-slot.hand-slot {
        margin-right: 5px;
    }

    #bottomPanel {
        padding: 0 8px;
        bottom: 0;
        padding-bottom: max(34px, env(safe-area-inset-bottom, 34px));
    }

    .player-actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .trade-body {
        flex-direction: column;
        gap: 10px;
    }
}

/* Telas muito pequenas - reduzir ainda mais a barra de inventário */
@media (max-height: 480px) {
    :root {
        --inventory-slot-size: 28px;
    }

    #bottomPanel {
        bottom: 8px;
        gap: 3px;
    }

    .inventory-grid {
        gap: 2px;
    }

    #healthBar {
        height: 6px;
    }
}

@media (max-height: 380px) {
    :root {
        --inventory-slot-size: 24px;
    }

    #bottomPanel {
        bottom: 4px;
        gap: 2px;
    }

    .inventory-grid {
        gap: 1px;
    }

    #healthBar {
        height: 5px;
    }
}

/* ========== TOGGLE BAG BUTTON ========== */
/* Padrão: Oculto em desktop/tablets */
#toggleBagBtn {
    display: none;
}

/* Exibir em dispositivos touch (celulares) - independente da orientação */
@media (hover: none) and (pointer: coarse) {
    #toggleBagBtn {
        display: flex;
        position: absolute;
        top: -20px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 18px;
        background: rgba(58, 29, 0, 0.95);
        border: 2px solid var(--gold-dark);
        border-bottom: none;
        border-radius: 6px 6px 0 0;
        color: var(--gold-light);
        cursor: pointer;
        align-items: center;
        justify-content: center;
        pointer-events: auto;
        transition: all 0.2s ease;
        z-index: 0;
        padding-bottom: 4px;
        box-sizing: border-box;
    }

    /* SVG da seta garantindo visibilidade e cor */
    #toggleBagBtn svg {
        width: 12px;
        height: 12px;
        min-width: 12px;
        min-height: 12px;
        flex-shrink: 0;
        stroke-width: 2.5;
        stroke: #ffffff;
        transition: transform 0.3s ease;
        transform: rotate(0deg);
        display: block;
        filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 1));
    }

    /* Inverter lógica da seta: quando colapsado (fechado) aponta pra cima */
    #toggleBagBtn.collapsed svg {
        transform: rotate(180deg);
    }

    #toggleBagBtn:hover {
        background: rgba(58, 29, 0, 1);
        filter: brightness(1.2);
    }

    /* Ajuste para quando colapsado em mobile */
    #bottomPanel.bag-collapsed {
        bottom: 0 !important;
        padding-bottom: 0 !important;
        transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    /* Fix Agressivo para SVG de slots (vestimenta) em mobile */
    .item-slot svg {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px;
        min-height: 22px;
        max-width: 80%;
        max-height: 80%;
    }
}

/* Ocultar em tablets grandes (telas largas com touch) */
@media (hover: none) and (pointer: coarse) and (min-width: 1024px) {
    #toggleBagBtn {
        display: none;
    }
}

/* Bag collapsed state - Animate Height */
.inventory-panel {
    max-height: 300px;
    opacity: 1;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

#bottomPanel.bag-collapsed .inventory-panel {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

/* Remove transformações antigas */
#bottomPanel.bag-collapsed .inventory-wrapper {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

/* Padrão desktop para SVGs em slots */
.item-slot svg {
    width: 60%;
    height: 60%;
    object-fit: contain;
    display: block;
    margin: auto;
    /* Centraliza */
    pointer-events: none;
}

/* ========== MISC ========== */
body.manual-transfer-active {
    cursor: url('../img/cursor/default.png'), auto !important;
}

body.manual-transfer-active * {
    cursor: inherit !important;
}

body.ranged-aiming {
    cursor: url('../img/cursor/alvo.png') 16 16, crosshair !important;
}

body.ranged-aiming * {
    cursor: inherit !important;
}

/* ========== MODAL VISIBILITY ========== */
#groupCreationModal.visible,
#groupInviteModal.visible {
    display: block !important;
}

/* playerActionsModal precisa ser flex para permitir scroll interno no conteúdo */
#playerActionsModal.visible {
    display: flex !important;
}

#groupCreationModal.hidden,
#groupInviteModal.hidden,
#playerActionsModal.hidden {
    display: none !important;
}

/* ========== CRAFTING HINTS ========== */
#forgeSlot0 {
    --hint-image: url('../img/item/minerios.png');
}

#forgeResultSlot {
    --hint-image: url('../img/item/lingote.png');
}

#forgeSlot1 {
    --hint-image: url('../img/item/madeira.png');
}

#bonfireSlotMeat {
    --hint-image: url('../img/item/carne-crua.png');
}

#bonfireSlotWood {
    --hint-image: url('../img/item/madeira.png');
}

#bonfireResultSlot {
    --hint-image: url('../img/item/carne-assada.png');
}

#tableSlot0 {
    --hint-image: url('../img/item/madeira.png');
}

#tableResultSlot {
    --hint-image: url('../img/item/tabua.png');
}

/* ========== VOICE BUTTON STATES ========== */
.voice-btn.mic-btn .mic-on {
    display: none;
}

.voice-btn.mic-btn .mic-off {
    display: block;
}

.voice-btn.mic-btn.active .mic-on {
    display: block;
}

.voice-btn.mic-btn.active .mic-off {
    display: none;
}

.voice-btn.mic-btn {
    color: #888;
}

.voice-btn.mic-btn.active {
    color: #fff;
}

/* ========== VIRTUAL JOYSTICK ========== */
#virtualJoystick {
    position: fixed;
    bottom: 60px;
    left: 60px;
    width: 120px;
    height: 120px;
    z-index: 300;
    display: none;
    pointer-events: auto;
    touch-action: none;
    touch-action: none;
    opacity: 0.3;
    transition: opacity 0.2s;
}

#virtualJoystick.active {
    opacity: 0.8;
}

#joystickBase {
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid rgba(212, 175, 55, 0.4);
    border-radius: 50%;
    position: relative;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
}

/* Setas direcionais decorativas */
#joystickBase::before {
    content: '▲';
    position: absolute;
    top: 3px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(212, 175, 55, 0.6);
    font-size: 11px;
}

#joystickBase::after {
    content: '▼';
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(212, 175, 55, 0.6);
    font-size: 11px;
}

/* Setas laterais usando elementos adicionais via shadow DOM workaround */
#joystickBase {
    --arrow-left: '◄';
    --arrow-right: '►';
}

.joystick-arrow {
    position: absolute;
    color: rgba(212, 175, 55, 0.6);
    font-size: 11px;
    pointer-events: none;
}

.joystick-arrow-left {
    left: 3px;
    top: 50%;
    transform: translateY(-50%);
}

.joystick-arrow-right {
    right: 3px;
    top: 50%;
    transform: translateY(-50%);
}

/* Criamos as setas laterais usando um wrapper adicional no HTML ou via JS */

#joystickStick {
    width: 40px;
    height: 40px;
    background: radial-gradient(circle at 30% 30%, var(--gold-light), #8b7355);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.6),
        inset 0 1px 3px rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(60, 45, 30, 0.8);
    transition: transform 0.1s;
}

/* Mostrar em mobile (classe via JS) APENAS se estiver em landscape */
body.mobile-app #virtualJoystick {
    display: none;
}

@media (orientation: landscape) {
    body.mobile-app #virtualJoystick {
        display: block;
    }
}

@media (hover: none) and (pointer: coarse) and (orientation: landscape) {
    #virtualJoystick {
        display: block;
    }
}

/* ========== LOGIN SCREEN ========== */
#loginScreen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: #000;
}

.login-background {
    position: fixed;
    inset: 0;
    background: url('../img/fotos/wallpaper.jpg') center center / cover no-repeat;
    background-attachment: fixed;
    filter: brightness(0.7);
    pointer-events: none;
}

.login-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    max-width: 1200px;
    padding: 40px;
}

.login-paperdoll {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.8));
    max-width: 300px;
    width: 100%;
    margin: 0 auto;
    padding: 12px;
    background: #120d09;
    border-radius: 12px;
    overflow: hidden;
}

.login-paperdoll img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 35vh;
    object-fit: contain;
    image-rendering: auto;
    border: 2px solid var(--gold-dark);
    border-radius: 12px 12px 0 0;
}

.login-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 320px;
    max-width: 340px;
}

.login-title {
    font-family: 'Cinzel', serif;
    font-size: 36px;
    font-weight: 700;
    color: var(--gold-light);
    text-align: center;
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.8),
        0 4px 8px rgba(0, 0, 0, 0.9),
        2px 2px 4px rgba(0, 0, 0, 1);
    letter-spacing: 2px;
    margin: 0;
    animation: titleGlow 3s ease-in-out infinite;
}

.login-title-link {
    color: inherit;
    text-decoration: none;
    display: inline-block;
}

.login-title-link:hover,
.login-title-link:focus {
    color: #ffe9b0;
    text-decoration: none;
}


@keyframes titleGlow {

    0%,
    100% {
        text-shadow:
            0 0 20px rgba(212, 175, 55, 0.8),
            0 4px 8px rgba(0, 0, 0, 0.9),
            2px 2px 4px rgba(0, 0, 0, 1);
    }

    50% {
        text-shadow:
            0 0 30px rgba(212, 175, 55, 1),
            0 4px 8px rgba(0, 0, 0, 0.9),
            2px 2px 4px rgba(0, 0, 0, 1);
    }
}

.login-form {
    background: linear-gradient(135deg, rgba(20, 16, 12, 0.95), rgba(30, 24, 18, 0.95));
    border: 3px solid var(--border-gold);
    border-radius: 12px;
    padding: 30px;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.8),
        0 12px 40px rgba(0, 0, 0, 0.9),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: var(--gold-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    letter-spacing: 0.5px;
}

.input-wrapper {
    display: flex;
    gap: 6px;
    align-items: center;
}

#playerNameInput,
#guestNameInput,
#registerName {
    flex: 1;
    height: 38px;
    /* Match button heights */
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.9), rgba(20, 15, 10, 0.9));
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    padding: 0 14px;
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
    color: var(--text-main);
    text-align: center;
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.8);
    transition: all 0.3s;
    box-sizing: border-box;
}

#playerNameInput:focus,
#guestNameInput:focus,
#registerName:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(212, 175, 55, 0.4);
}

#playerNameInput::placeholder,
#guestNameInput::placeholder,
#registerName::placeholder {
    color: rgba(232, 224, 213, 0.4);
}

.refresh-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: pointer;
    box-sizing: border-box;
    flex-shrink: 0;
}


.refresh-btn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
}

.refresh-btn:hover svg {
    transform: rotate(180deg);
}

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

.refresh-btn svg {
    transition: transform 0.3s;
}

.gender-btn {
    width: 38px;
    height: 38px;
    min-height: 38px;
    max-height: 38px;
    padding: 0;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    cursor: pointer;
    box-sizing: border-box;
    flex-shrink: 0;
}

.gender-btn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
}

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

.gender-btn svg {
    transition: transform 0.3s;
}


.play-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.95), rgba(40, 30, 20, 0.95));
    border: 2px solid var(--gold-primary);
    border-radius: 8px;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    font-weight: 700;
    color: var(--gold-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow:
        0 0 15px rgba(212, 175, 55, 0.3),
        0 4px 12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
    cursor: pointer;
    margin-top: 8px;
}


.play-btn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-light);
    box-shadow:
        0 0 30px rgba(212, 175, 55, 0.6),
        0 8px 20px rgba(0, 0, 0, 0.7);
    transform: translateY(-2px);
}

.play-btn:active {
    transform: translateY(0);
}

.login-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
}

.login-meta .changelog-btn {
    max-width: none;
    width: 100%;
}

.version-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(135deg, rgba(50, 40, 25, 0.9), rgba(30, 24, 18, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.version-label {
    font-family: 'MedievalSharp', cursive;
    font-size: 11px;
    letter-spacing: 1px;
    color: rgba(210, 190, 160, 0.8);
    text-transform: uppercase;
}

.version-number {
    font-family: 'Cinzel', serif;
    font-size: 14px;
    color: var(--gold-light);
    letter-spacing: 0.5px;
}

.changelog-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    background: linear-gradient(135deg, #2b1c10, #3a2615);
    border: 1px solid rgba(212, 175, 55, 0.7);
    color: var(--gold-light);
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
    border-radius: 10px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), 0 0 10px rgba(212, 175, 55, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    white-space: nowrap;
    width: 100%;
    max-width: 360px;
}

.changelog-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.55), 0 0 12px rgba(212, 175, 55, 0.5);
    border-color: var(--gold-light);
}

.changelog-btn:active {
    transform: translateY(0);
}

.changelog-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ffd166;
    box-shadow: 0 0 12px rgba(255, 209, 102, 0.8);
}

.changelog-link-btn {
    background: none;
    border: none;
    color: rgba(224, 204, 176, 0.9);
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 0;
    display: inline-block;
}

.changelog-link-btn:hover {
    color: var(--gold-light);
}

.server-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(100, 80, 60, 0.5);
    border-radius: 8px;
    backdrop-filter: blur(4px);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #888;
    box-shadow: 0 0 8px currentColor;
    animation: pulse 2s ease-in-out infinite;
}

.status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 12px #4ade80;
}

.status-dot.offline {
    background: #ef4444;
    box-shadow: 0 0 12px #ef4444;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

.status-text {
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
    color: var(--text-main);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.player-count {
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
    color: var(--gold-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.login-mobile-hint {
    display: none;
    margin: 6px 0 0;
    text-align: center;
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: rgba(232, 224, 213, 0.65);
}

@media (max-width: 768px) {
    .login-mobile-hint {
        display: block;
    }

    .login-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.changelog-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.changelog-modal.hidden {
    display: none;
}

.changelog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
}

.changelog-dialog {
    position: relative;
    background: linear-gradient(145deg, rgba(25, 20, 15, 0.95), rgba(18, 13, 9, 0.95));
    border: 1px solid rgba(212, 175, 55, 0.6);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    border-radius: 12px;
    padding: 18px 18px 20px;
    width: min(90vw, 420px);
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.changelog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: 'Cinzel', serif;
    color: var(--gold-light);
    font-size: 17px;
    letter-spacing: 0.5px;
}

.changelog-close {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid rgba(212, 175, 55, 0.6);
    color: var(--gold-light);
    font-size: 16px;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

.changelog-body {
    overflow-y: auto;
    padding-right: 6px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
}

.changelog-loading {
    color: rgba(235, 226, 210, 0.85);
    text-align: center;
    padding: 20px;
    font-size: 13px;
}

.changelog-entry {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 10px;
    padding: 0;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.changelog-entry-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    color: var(--gold-light);
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.changelog-chevron {
    font-size: 14px;
}

.changelog-entry-body {
    padding: 8px 12px 12px;
    display: none;
}

.changelog-entry.open .changelog-entry-body {
    display: block;
}

.changelog-entry ul {
    list-style: disc;
    padding-left: 16px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: rgba(235, 226, 210, 0.9);
    font-size: 13px;
    line-height: 1.45;
}

/* ========== LOGIN TABBED CONTAINER ========== */
.login-tabbed-container {
    background: rgba(20, 15, 10, 0.85);
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    overflow: hidden;
}

.login-tabbed-container .login-paperdoll {
    width: 100%;
    max-width: none;
    margin: 0;
    filter: none;
}

.login-tabbed-container .login-paperdoll img {
    width: 100%;
    height: auto;
    max-height: 40vh;
    object-fit: contain;
    border: none;
    border-radius: 0;
    background: #120d09;
}

.login-tabs {
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0 4px;
    background: rgba(15, 12, 8, 0.95);
    border-bottom: 2px solid var(--gold-dark);
    position: relative;
    z-index: 5;
}

.login-tab {
    flex: 1;
    padding: 12px 8px;
    background: rgba(20, 15, 10, 0.6);
    border: 2px solid transparent;
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    font-family: 'MedievalSharp', serif;
    font-size: 14px;
    color: rgba(200, 180, 160, 0.5);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.8);
    position: relative;
    margin-bottom: 0;
}

.login-tab:hover {
    color: var(--gold-light);
    background: rgba(30, 22, 15, 0.8);
    border: none;
    transform: translateY(0) !important;
}

.login-tab.active {
    background: rgba(30, 22, 15);
    color: var(--gold-primary);
    border: 2px solid var(--gold-dark);
    border-bottom: 2px solid rgba(30, 22, 15, 0.6);
    margin-bottom: -2px;
    padding-bottom: 14px;
    z-index: 10;
}

.login-tab.active::after {
    display: none;
}

/* Tab Content Container */
.login-tab-content {
    padding: 14px;
    background: rgba(30, 22, 15, 0.6);
}


.tab-content {
    transition: opacity 0.2s ease;
}

.tab-content.hidden {
    display: none !important;
}

/* Form Error */
.form-error {
    background: rgba(220, 38, 38, 0.2);
    border: 1px solid rgba(220, 38, 38, 0.5);
    border-radius: 6px;
    padding: 8px 12px;
    color: #fca5a5;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    text-align: center;
    margin-top: 8px;
}


/* Login/Register Form Inputs */
#loginTab .input-group,
#registerTab .input-group,
#guestTab .input-group,
#forgotTab .input-group,
#resetTab .input-group {
    margin-bottom: 10px;
}

#loginTab input[type="email"],
#loginTab input[type="password"],
#registerTab input[type="email"],
#registerTab input[type="password"],
#forgotTab input[type="email"],
#resetTab input[type="password"] {
    width: 100%;
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.9), rgba(20, 15, 10, 0.9));
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    padding: 10px 14px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: var(--text-main);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 0 1px rgba(0, 0, 0, 0.8);
    transition: all 0.3s;
}



#loginTab input:focus,
#registerTab input:focus,
#forgotTab input:focus,
#resetTab input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow:
        inset 0 2px 8px rgba(0, 0, 0, 0.6),
        0 0 12px rgba(212, 175, 55, 0.4);
}

#loginTab input::placeholder,
#registerTab input::placeholder,
#forgotTab input::placeholder,
#resetTab input::placeholder {
    color: rgba(232, 224, 213, 0.4);
}


/* Play button disabled state */
.play-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.play-btn:disabled:hover {
    transform: none;
    box-shadow:
        0 0 20px rgba(212, 175, 55, 0.3),
        0 6px 16px rgba(0, 0, 0, 0.6);
}

/* Play button loading state */
.play-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

.play-btn .btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--gold-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.play-btn.loading .btn-spinner {
    display: inline-block;
}

.play-btn.loading .btn-text {
    opacity: 0.7;
}

.play-btn.loading svg:not(.btn-spinner) {
    display: none;
}


/* ========== SAVE GUEST BUTTON ========== */
#saveGuestBtn {
    display: none;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'MedievalSharp', cursive;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

#saveGuestBtn.visible {
    display: flex;
}

#saveGuestBtn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.4);
}

#saveGuestBtn:active {
    transform: scale(0.97);
}

#saveGuestBtn svg {
    width: 18px;
    height: 18px;
}

#saveGuestBtn .save-guest-label {
    line-height: 1;
}

/* ========== HELP GUEST BUTTON ========== */
#helpGuestBtn {
    display: none;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'MedievalSharp', cursive;
    font-size: 11px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

#helpGuestBtn.visible {
    display: flex;
}

#helpGuestBtn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.4);
}

#helpGuestBtn:active {
    transform: scale(0.97);
}

#helpGuestBtn svg {
    width: 18px;
    height: 18px;
}

#helpGuestBtn .help-guest-label {
    line-height: 1;
}

/* ========== SAVE GUEST MODAL ========== */
#saveGuestModal {
    min-width: 320px;
    max-width: 400px;
}

#saveGuestModal .input-group {
    margin-bottom: 14px;
}

#saveGuestModal input {
    width: 100%;
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.9), rgba(20, 15, 10, 0.9));
    border: 2px solid var(--gold-dark);
    border-radius: 8px;
    padding: 12px 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: var(--text-main);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
    transition: all 0.3s;
}

#saveGuestModal input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6), 0 0 12px rgba(212, 175, 55, 0.4);
}

#saveGuestModal label {
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    color: var(--gold-light);
    margin-bottom: 6px;
    display: block;
}

#saveGuestModal .save-modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

#saveGuestModal .save-modal-actions button {
    flex: 1;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: 'MedievalSharp', cursive;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

#saveGuestModal .save-modal-actions .confirm {
    background: linear-gradient(135deg, rgba(60, 100, 60, 0.95), rgba(40, 80, 40, 0.95));
    border: 2px solid #4ade80;
    color: #4ade80;
}

#saveGuestModal .save-modal-actions .confirm:hover {
    background: linear-gradient(135deg, rgba(80, 130, 80, 1), rgba(60, 100, 60, 1));
    box-shadow: 0 0 12px rgba(74, 222, 128, 0.4);
}

#saveGuestModal .save-modal-actions .cancel {
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.95), rgba(40, 30, 20, 0.95));
    border: 2px solid var(--gold-dark);
    color: var(--text-main);
}

#saveGuestModal .save-modal-actions .cancel:hover {
    border-color: var(--gold-primary);
}

#saveGuestModal .form-error {
    margin-top: 0;
    margin-bottom: 14px;
}

/* ========== FORGOT PASSWORD ========== */
.forgot-password-link {
    text-align: center;
    margin-top: 14px;
}

.forgot-password-link a {
    color: var(--gold-light);
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.forgot-password-link a:hover {
    opacity: 1;
    text-decoration: underline;
}

.forgot-description {
    text-align: center;
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.form-success {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.5);
    border-radius: 8px;
    padding: 10px 14px;
    color: #4ade80;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    text-align: center;
    margin-top: 10px;
}

/* ========== SAVED SESSION UI ========== */
.saved-session-container {
    margin-bottom: 16px;
    padding: 0;
    text-align: center;
}

.saved-session-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 12px;
}

.saved-session-label {
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    color: rgba(200, 180, 160, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.saved-session-name {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 600;
    color: var(--gold-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.6);
}

.saved-session-container .continue-btn {
    margin-top: 0;
    background: linear-gradient(135deg, rgba(74, 100, 60, 0.95), rgba(50, 80, 40, 0.95));
    border-color: #6aae50;
}

.saved-session-container .continue-btn:hover {
    background: linear-gradient(135deg, rgba(90, 130, 70, 1), rgba(70, 110, 50, 1));
    border-color: #8ece70;
    box-shadow: 0 0 20px rgba(106, 174, 80, 0.4), 0 6px 16px rgba(0, 0, 0, 0.6);
}

.saved-session-divider {
    margin: 14px 0 0;
    font-family: 'Roboto', sans-serif;
    font-size: 12px;
    color: rgba(200, 180, 160, 0.5);
    text-align: center;
}

.switch-account-link {
    display: block;
    margin-top: 16px;
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
    color: rgba(200, 180, 160, 0.6);
    text-decoration: none;
    text-align: center;
    transition: color 0.2s;
}

.switch-account-link:hover {
    color: var(--gold-light);
    text-decoration: underline;
}

/* ========== LOADING SCREEN ========== */

#loadingScreen {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-background {
    position: absolute;
    inset: 0;
    background: url('../img/fotos/wallpaper.jpg') center center / cover no-repeat;
    background-attachment: fixed;
    filter: brightness(0.4);
}

.loading-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    padding: 60px;
    background: linear-gradient(135deg, rgba(20, 16, 12, 0.95), rgba(30, 24, 18, 0.95));
    border: 3px solid var(--border-gold);
    border-radius: 16px;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.8),
        0 12px 40px rgba(0, 0, 0, 0.9);
    min-width: 400px;
}

.loading-reload-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.7), rgba(20, 16, 12, 0.8));
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.loading-reload-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    transition: transform 0.3s ease;
}

.loading-reload-btn:hover {
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.8), rgba(40, 30, 20, 0.9));
    border-color: var(--gold-primary);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    transform: scale(1.05);
}

.loading-reload-btn:hover svg {
    transform: rotate(180deg);
}

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

.loading-reload-btn:focus-visible {
    outline: 2px solid rgba(212, 175, 55, 0.8);
    outline-offset: 2px;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-title {
    font-family: 'Cinzel', serif;
    font-size: 32px;
    font-weight: 700;
    color: var(--gold-light);
    text-align: center;
    text-shadow:
        0 0 20px rgba(212, 175, 55, 0.6),
        0 4px 8px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
    margin: 0;
}

.loading-status {
    font-family: 'MedievalSharp', cursive;
    font-size: 16px;
    color: var(--text-main);
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    margin: 0;
}

.loading-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.6);
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark) 0%, var(--gold-primary) 60%, var(--gold-light) 100%);
    transition: width 0.3s ease;
    width: 0%;
}

/* ========== RECONNECT SCREEN ========== */
#reconnectScreen {
    position: fixed;
    inset: 0;
    z-index: 10000 !important;
    /* Ensure it's above everything, including map modal */
    display: flex;
    align-items: center;
    justify-content: center;
}

.reconnect-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    pointer-events: auto;
    /* Bloqueia cliques no jogo */
}

.reconnect-content {
    position: relative;
    background: linear-gradient(135deg, rgba(30, 24, 18, 0.95), rgba(15, 10, 5, 0.98));
    border: 2px solid var(--gold-dark);
    border-radius: 12px;
    padding: 30px 50px;
    text-align: center;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.8), 0 20px 50px rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.reconnect-title {
    font-family: 'Cinzel', serif;
    font-size: 24px;
    color: var(--gold-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

.reconnect-status {
    color: var(--text-main);
    font-size: 16px;
}

.reconnect-timer {
    font-size: 18px;
    font-weight: bold;
    color: var(--gold-primary);
    margin-top: 10px;
}

@media (max-width: 900px),
(max-height: 720px) {
    .login-container {
        gap: 30px;
        padding: 20px;
    }

    .login-form {
        padding: 20px;
    }

    .login-form .login-paperdoll {
        max-width: 340px;
    }

    .login-form .login-paperdoll img {
        max-width: 340px;
    }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .login-container {
        flex-direction: column;
        gap: 30px;
        padding: 20px;
    }

    .login-paperdoll img {
        max-width: 300px;
        max-height: 500px;
    }

    .login-content {
        min-width: auto;
        width: 100%;
        max-width: 400px;
    }

    .login-form .login-paperdoll img {
        max-width: 320px;
        max-height: 420px;
    }

    .login-title {
        font-size: 36px;
    }

    .loading-content {
        min-width: auto;
        width: 90%;
        padding: 40px 20px;
    }
}

/* Ajustes para telas com altura reduzida (inclusive notebooks com pouca altura útil) */
@media (max-height: 900px) {
    #loginScreen {
        align-items: flex-start;
        padding: 12px 0;
    }

    .login-container {
        gap: 28px;
        padding: 20px 16px;
    }

    .login-content {
        gap: 18px;
        min-width: min(380px, 90vw);
    }

    .login-title {
        font-size: clamp(32px, 5vh, 44px);
    }

    .login-form {
        padding: 20px;
    }

    #playerNameInput {
        padding: 12px 14px;
        font-size: 15px;
    }

    .refresh-btn {
        width: 44px;
        height: 44px;
    }

    .play-btn {
        padding: 16px 22px;
        font-size: 22px;
    }
}

@media (max-height: 720px) {
    .login-container {
        flex-direction: column;
        gap: 20px;
    }

    .login-content {
        width: 100%;
        max-width: 420px;
    }

    .login-paperdoll img {
        max-height: 320px;
    }

    .login-form {
        width: min(420px, 92vw);
        padding: 16px;
    }

    .login-form .login-paperdoll {
        max-width: 260px;
        margin: 0 auto 12px;
    }

    .login-form .login-paperdoll img {
        max-height: 260px;
    }

    .login-title {
        font-size: clamp(28px, 4vh, 34px);
    }

    .play-btn {
        padding: 12px 16px;
        font-size: 18px;
    }
}

/* ========== SETTINGS MENU ========== */
#settingsBtn {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 42px;
    height: 42px;
    padding: 0;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

#settingsBtn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
}

#settingsBtn:hover svg {
    transform: rotate(90deg);
    transition: transform 0.5s ease;
}

#settingsBtn svg {
    width: 24px;
    height: 24px;
}

#settingsBtn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translate(-50%, 0) scale(0.95);
    background: rgba(30, 22, 15, 0.95);
    color: var(--gold-light);
    padding: 4px 8px;
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    font-family: 'MedievalSharp', cursive;
    font-size: 9px;
    letter-spacing: 0.3px;
    white-space: normal;
    text-align: center;
    max-width: calc(100vw - 32px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 1100;
}

#settingsBtn:hover::after,
#settingsBtn:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

#settingsModal {
    width: 280px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2000;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Layout com abas para configurações */
#settingsModal.settings-tabbed {
    width: min(580px, 95vw);
    max-width: 580px;
}

#settingsModal.settings-tabbed .window-header {
    padding: 12px 16px;
}

#settingsModal.settings-tabbed .window-header h2 {
    font-size: 15px;
}

.settings-layout {
    display: flex;
    flex-direction: row;
    overflow: hidden;
    max-height: calc(85vh - 50px);
}

/* Menu lateral de abas */
.settings-tabs {
    display: flex;
    flex-direction: column;
    width: 150px;
    min-width: 150px;
    background: rgba(15, 10, 8, 0.5);
    border-right: 1px solid rgba(212, 175, 55, 0.2);
    padding: 12px 0;
    gap: 4px;
    overflow-y: auto;
    overflow-x: hidden;
}

.settings-tab {
    background: transparent;
    border: none;
    border-left: 3px solid transparent;
    padding: 12px 14px;
    color: rgba(200, 180, 160, 0.8);
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-tab:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--text-main);
}

.settings-tab.active {
    background: rgba(212, 175, 55, 0.15);
    border-left-color: var(--gold-primary);
    color: var(--gold-light);
    font-weight: 500;
}

.settings-tabs-spacer {
    flex: 1;
    min-height: 20px;
}

.settings-tab-exit {
    color: #e57373 !important;
    border-top: 1px solid rgba(212, 175, 55, 0.15);
    margin-top: 8px;
    padding-top: 14px;
}

.settings-tab-exit:hover {
    background: rgba(229, 115, 115, 0.15);
    color: #ff8a8a !important;
}

/* Área de conteúdo dos painéis */
.settings-panels {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    overflow-y: auto;
    overflow-x: hidden;
    min-width: 0;
    background: rgba(25, 18, 12, 0.3);
}

/* Painéis de conteúdo */
.settings-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    animation: fadeIn 0.2s ease;
}

.settings-panel.active {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsividade para mobile */
@media (max-width: 520px) {
    #settingsModal.settings-tabbed {
        width: 95vw;
        max-height: calc(100vh - 20px);
        max-height: calc(100dvh - 20px);
    }

    .settings-layout {
        flex-direction: column;
        max-height: calc(100vh - 90px);
        max-height: calc(100dvh - 90px);
    }

    .settings-tabs {
        flex-direction: row;
        width: 100%;
        min-width: unset;
        border-right: none;
        border-bottom: 1px solid rgba(212, 175, 55, 0.2);
        padding: 0;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-shrink: 0;
    }

    .settings-tabs::-webkit-scrollbar {
        display: none;
    }

    .settings-tab {
        border-left: none;
        border-bottom: 3px solid transparent;
        padding: 10px 12px;
        white-space: nowrap;
        font-size: 12px;
        flex-shrink: 0;
    }

    .settings-tab.active {
        border-left: none;
        border-bottom-color: var(--gold-primary);
    }

    .settings-tabs-spacer {
        display: none;
    }

    .settings-tab-exit {
        border-top: none;
        border-left: 1px solid rgba(212, 175, 55, 0.15);
        margin-top: 0;
        margin-left: 4px;
        padding-top: 10px;
        padding-left: 12px;
    }

    .settings-panels {
        flex: 1;
        padding: 12px;
        min-height: 0;
        overflow-y: auto;
    }

    .settings-header-status {
        font-size: 11px;
    }

    .settings-section h3 {
        font-size: 12px;
    }

    .setting-label {
        font-size: 12px;
    }

    .replay-option,
    .resolution-option {
        font-size: 12px;
        padding: 8px 0;
    }
}

.settings-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 6px;
    overflow-y: auto;
    max-height: calc(85vh - 50px);
}

/* Zoom Controls */
.zoom-controls {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    width: 100%;
}

.medieval-btn.square {
    width: 26px;
    height: 26px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
}

.settings-section {
    border-bottom: 1px solid rgba(212, 175, 55, 0.15);
    padding-bottom: 18px;
    margin-bottom: 18px;
}

.settings-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.settings-section h3 {
    font-family: 'Cinzel', serif;
    color: var(--gold-light);
    font-size: 13px;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.setting-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.setting-row:last-child {
    margin-bottom: 0;
}

.compact-row {
    margin-bottom: 10px;
}

.setting-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'MedievalSharp', cursive;
    color: var(--text-main);
    font-size: 13px;
}

.settings-value {
    font-family: 'Cinzel', serif;
    color: var(--gold-primary);
    font-weight: 700;
}

.setting-hint {
    margin: 0;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    font-family: 'Roboto', sans-serif;
}

.subtle-hint {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

/* Settings Header with Logout Status */
.settings-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-header h2 {
    flex-shrink: 0;
}

.settings-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    margin-right: 4px;
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
}

.settings-header-status .logout-label {
    color: rgba(200, 180, 160, 0.7);
}

.settings-header-status .logout-value {
    font-weight: 600;
    color: #4ade80;
}

.settings-header-status .logout-value.warning {
    color: #fbbf24;
}

.settings-header-status .info-btn {
    opacity: 0.6;
    margin-left: 2px;
}

.settings-header-status .info-btn:hover {
    opacity: 1;
}

/* Logout Tooltip no header - oculto por padrão */
.logout-tooltip.header-tooltip {
    display: none;
    font-size: 11px;
    color: rgba(200, 180, 160, 0.9);
    line-height: 1.5;
    padding: 10px 14px;
    background: rgba(15, 10, 8, 0.95);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    margin: 0;
    border-radius: 0;
}

.logout-tooltip.header-tooltip:not(.hidden) {
    display: block;
}

/* Estilos antigos removidos - logout agora está no header */


.logout-status .warning-icon {
    width: 13px;
    height: 13px;
    fill: #fbbf24;
    flex-shrink: 0;
}

/* Info Button (i) */
.info-btn {
    width: 16px;
    height: 16px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(200, 180, 160, 0.6);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.info-btn:hover {
    color: var(--gold-light);
}

/* Logout Tooltip */
.logout-tooltip {
    font-size: 10px;
    color: #888;
    line-height: 1.4;
    padding: 6px 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    margin-top: 4px;
}

.logout-tooltip.hidden {
    display: none;
}

/* Settings Button Warning Indicator - Alert Icon */
#settingsBtn.has-warning::before {
    content: '⚠';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 14px;
    color: #fbbf24;
    text-shadow: 0 0 4px #fbbf24, 0 1px 2px rgba(0, 0, 0, 0.8);
    animation: warningPulse 1.5s ease-in-out infinite;
    pointer-events: none;
    z-index: 10;
}

#settingsBtn.has-warning {
    position: relative;
}

@keyframes warningPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.7;
        transform: scale(0.9);
    }
}

/* Replay Watch Button Icon */
.replay-watch-icon {
    fill: var(--gold-light);
    flex-shrink: 0;
    margin-right: 4px;
}

#btnReplayWatch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.replay-status-hint {
    font-size: 11px;
    color: rgba(150, 140, 130, 0.9);
    margin: 8px 0 0 0;
    text-align: center;
    line-height: 1.4;
}

.replay-status-hint.warning {
    color: #c9a862;
}

.replay-options {
    display: flex;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 6px;
    overflow: hidden;
}

.replay-option {
    flex: 1;
    border: none;
    border-right: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(30, 22, 15, 0.85);
    color: rgba(200, 180, 160, 0.9);
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.replay-option:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--text-main);
}

.replay-option:last-child {
    border-right: none;
}

.replay-option.active {
    background: rgba(212, 175, 55, 0.25);
    color: var(--gold-light);
    font-weight: 500;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.resolution-options {
    display: flex;
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 6px;
    overflow: hidden;
}

.resolution-option {
    flex: 1;
    border: none;
    border-right: 1px solid rgba(212, 175, 55, 0.25);
    background: rgba(30, 22, 15, 0.85);
    color: rgba(200, 180, 160, 0.9);
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.resolution-option:hover {
    background: rgba(212, 175, 55, 0.1);
    color: var(--text-main);
}

.resolution-option:last-child {
    border-right: none;
}

.resolution-option.active {
    background: rgba(212, 175, 55, 0.25);
    color: var(--gold-light);
    font-weight: 500;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Replay Overlay - blocks interaction during replay playback */
.replay-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 9000;
    cursor: pointer;
}

.replay-overlay.hidden {
    display: none;
}

.replay-bar {
    position: fixed;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    width: min(860px, 96vw);
    background: rgba(18, 12, 8, 0.92);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
    z-index: 9100;
    padding: 10px 12px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.replay-bar.player-hidden {
    opacity: 0;
    transform: translateX(-50%) translateY(100%);
    pointer-events: none;
}

.replay-bar-inner {
    display: flex;
    align-items: center;
    gap: 12px;
}

.replay-control-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    background: rgba(30, 22, 15, 0.9);
    color: var(--gold-light);
    font-size: 16px;
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
    padding: 0;
}

.replay-control-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.replay-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(30, 22, 15, 0.75);
    display: grid;
    place-items: center;
    cursor: pointer;
    padding: 0;
}

.replay-icon-btn svg {
    width: 18px;
    height: 18px;
    fill: var(--gold-light);
}

.replay-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(30, 22, 15, 0.9);
    color: var(--gold-light);
    font-size: 20px;
    cursor: pointer;
    display: grid;
    place-items: center;
    line-height: 1;
    padding: 0;
    transition: all 0.2s;
}

.replay-close-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold-primary);
    color: #fff;
}

.replay-close-btn.replay-live-alert {
    animation: replayClosePulse 1.2s ease-in-out 0s 2;
    background: rgba(212, 175, 55, 0.3);
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.replay-slider-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.replay-slider-track {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    padding: 6px 0;
    --crop-start: 0%;
    --crop-end: 100%;
    --replay-track-muted: rgba(212, 175, 55, 0.12);
    --replay-track-active: rgba(212, 175, 55, 0.35);
}

.replay-interest-layer {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 4px;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
}

.replay-interest {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(160, 20, 20, 0.75);
    box-shadow: 0 0 6px rgba(160, 20, 20, 0.55);
    border-radius: 6px;
}

#replayTimeline,
.replay-crop {
    width: 100%;
    accent-color: var(--gold-primary);
    height: 4px;
    background: linear-gradient(90deg,
            var(--replay-track-muted) 0%,
            var(--replay-track-muted) var(--crop-start),
            var(--replay-track-active) var(--crop-start),
            var(--replay-track-active) var(--crop-end),
            var(--replay-track-muted) var(--crop-end),
            var(--replay-track-muted) 100%);
    border-radius: 6px;
    appearance: none;
}

#replayTimeline {
    position: relative;
    z-index: 1;
}

.replay-crop {
    position: absolute;
    left: 0;
    top: 6px;
    pointer-events: none;
    z-index: 10;
    opacity: 1;
    touch-action: none;
    background: transparent;
}

.replay-crop::-webkit-slider-thumb {
    pointer-events: auto;
    cursor: ew-resize;
}

.replay-crop::-moz-range-thumb {
    pointer-events: auto;
    cursor: ew-resize;
}

#replayTimeline::-webkit-slider-thumb,
.replay-crop::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold-primary);
    border: 1px solid rgba(0, 0, 0, 0.4);
}

#replayTimeline::-moz-range-thumb,
.replay-crop::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--gold-primary);
    border: 1px solid rgba(0, 0, 0, 0.4);
}

.replay-bar.share-mode .replay-slider-track {
    --replay-track-muted: rgba(20, 12, 8, 0.45);
    --replay-track-active: rgba(212, 175, 55, 0.55);
}

.replay-crop-start {
    z-index: 12;
    pointer-events: auto;
}

.replay-crop-end {
    z-index: 11;
    pointer-events: auto;
}

.replay-crop.crop-active {
    z-index: 15;
}

/* Thumbs estilo editor de vídeo [ e ] */
.replay-crop-start::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 28px;
    border-radius: 3px 0 0 3px;
    background: linear-gradient(135deg, var(--gold-primary), #b8860b);
    border: 2px solid var(--gold-light);
    border-right: 3px solid var(--gold-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.3);
    cursor: ew-resize;
}

.replay-crop-start::-moz-range-thumb {
    width: 14px;
    height: 28px;
    border-radius: 3px 0 0 3px;
    background: linear-gradient(135deg, var(--gold-primary), #b8860b);
    border: 2px solid var(--gold-light);
    border-right: 3px solid var(--gold-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.3);
    cursor: ew-resize;
}

.replay-crop-end::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 28px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(135deg, var(--gold-primary), #b8860b);
    border: 2px solid var(--gold-light);
    border-left: 3px solid var(--gold-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.3);
    cursor: ew-resize;
}

.replay-crop-end::-moz-range-thumb {
    width: 14px;
    height: 28px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(135deg, var(--gold-primary), #b8860b);
    border: 2px solid var(--gold-light);
    border-left: 3px solid var(--gold-light);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5), inset 0 0 3px rgba(255, 255, 255, 0.3);
    cursor: ew-resize;
}

.replay-time,
.replay-range {
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: var(--text-main);
    min-width: 52px;
    text-align: center;
}

.replay-empty {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    font-family: 'MedievalSharp', cursive;
    text-align: center;
}

.replay-share-time {
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    letter-spacing: 0.4px;
}

.replay-share-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.replay-share-inline .medieval-btn.small {
    padding: 4px 8px;
    font-size: 10px;
}

.replay-export-badge {
    position: fixed;
    top: 50px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'Cinzel', serif;
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 2px;
    color: #D4AF37;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.8);
    z-index: 1110;
    pointer-events: none;
    text-transform: uppercase;
}

body.replay-exporting #replayBar {
    opacity: 0;
    pointer-events: none;
}

body.replay-exporting #replayExportBadge {
    display: block !important;
}

.replay-bar.share-mode #replayShareBtn,
.replay-bar.share-mode #replayNowBtn {
    display: none;
}

.replay-bar.share-mode #replayTimeline {
    pointer-events: none;
    opacity: 0.5;
}

/* Esconde o thumb da timeline principal no modo crop */
.replay-bar.share-mode #replayTimeline::-webkit-slider-thumb {
    opacity: 0;
    pointer-events: none;
}

.replay-bar.share-mode #replayTimeline::-moz-range-thumb {
    opacity: 0;
    pointer-events: none;
}

.replay-bar.share-mode .replay-crop {
    pointer-events: auto;
}

.replay-exporting-label {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 24px 40px;
    border-radius: 12px;
    background: rgba(18, 12, 8, 0.95);
    border: 2px solid rgba(212, 175, 55, 0.6);
    font-family: 'Cinzel', serif;
    font-size: 18px;
    color: var(--gold-light);
    z-index: 2500;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

.replay-exporting-label::after {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid rgba(212, 175, 55, 0.3);
    border-top-color: var(--gold-primary);
    border-radius: 50%;
    animation: replayExportSpin 0.8s linear infinite;
}

@keyframes replayExportSpin {
    to {
        transform: rotate(360deg);
    }
}

.replay-export-progress-full {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 8px;
    background: rgba(45, 30, 20, 0.9);
    /* Marrom escuro medieval */
    z-index: 3000;
    pointer-events: none;
    border-top: 1px solid rgba(212, 175, 55, 0.3);
}

.replay-export-progress-bar {
    height: 100%;
    width: 0%;
    background: #D4AF37 !important;
    /* Dourado Sólido */
    background: linear-gradient(90deg, #B8860B, #FFD700, #B8860B) !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.9), 0 0 5px rgba(255, 215, 0, 1);
    transition: width 0.05s linear;
}

@keyframes replayClosePulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Modal de Exportação de Vídeo */
.replay-export-modal {
    width: 320px;
    max-width: 90vw;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2600;
}

.replay-export-content {
    padding: 20px;
    text-align: center;
}

.replay-export-preview {
    width: 100px;
    height: 80px;
    margin: 0 auto 16px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.replay-export-icon {
    width: 48px;
    height: 48px;
    color: var(--gold-primary);
}

.replay-export-filename {
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
    color: var(--text-muted);
    margin: 0 0 20px;
    word-break: break-all;
}

.replay-export-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.replay-export-actions .medieval-btn {
    width: 100%;
    padding: 10px 16px;
    font-size: 13px;
}

/* Barra de Progresso de Exportação */
.replay-export-progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    pointer-events: none;
}

.replay-export-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-primary));
    width: 0%;
    transition: width 0.2s linear;
    box-shadow: 0 0 10px var(--gold-primary);
}

@media (max-width: 720px) {
    .replay-bar {
        bottom: 10px;
        padding: 8px;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }

    .replay-bar-inner {
        grid-template-columns: auto 1fr auto;
        grid-template-rows: auto auto auto;
        gap: 6px 8px;
    }

    .replay-control-btn {
        width: 32px;
        height: 32px;
    }

    .replay-time {
        grid-column: 1 / -1;
        grid-row: 2;
        text-align: center;
        min-width: unset;
    }

    .replay-slider-wrap {
        grid-column: 1 / -1;
        grid-row: 1;
    }

    .replay-icon-btn {
        grid-column: 1;
        grid-row: 3;
    }

    .replay-share-inline {
        grid-column: 2 / 3;
        grid-row: 3;
        justify-self: center;
        gap: 4px;
    }

    .replay-share-inline .medieval-btn.small {
        padding: 4px 6px;
    }

    .replay-now-btn {
        grid-column: 3;
        grid-row: 3;
        justify-self: end;
        padding: 5px 8px;
        font-size: 10px;
    }

    .replay-time {
        font-size: 11px;
    }

    .replay-exporting-label {
        right: 10px;
        bottom: 140px;
        font-size: 11px;
    }
}

/* Tooltip genérico */
.has-tooltip {
    cursor: default;
}

/* CSS Tooltips removed in favor of Global JS Tooltip */


/* Tooltip específico para slots de inventário (Bag) para não ser cortado */


/* Toggle Switch */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
    border: 1px solid var(--gold-dark);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 2px;
    bottom: 2px;
    background-color: #888;
    transition: .4s;
}

input:checked+.slider {
    background-color: rgba(60, 45, 30, 0.8);
    border-color: var(--gold-primary);
}

input:checked+.slider:before {
    transform: translateX(20px);
    background-color: var(--gold-light);
}

.slider.round {
    border-radius: 20px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Volume Slider */
.volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #333;
    border-radius: 3px;
    outline: none;
    border: 1px solid var(--gold-dark);
    touch-action: pan-x;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold-primary);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

.volume-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold-primary);
    cursor: pointer;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* Buttons */
.community-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.medieval-btn {
    width: 100%;
    padding: 6px 8px;
    background: linear-gradient(to bottom, #5d4037, #3e2723);
    border: 1px solid var(--gold-dark);
    border-radius: 3px;
    color: var(--gold-light);
    font-family: 'MedievalSharp', cursive;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.8);
}

.medieval-btn:hover {
    background: linear-gradient(to bottom, #6d4c41, #4e342e);
    border-color: var(--gold-primary);
    transform: translateY(-1px);
}

.medieval-btn.danger {
    background: linear-gradient(to bottom, #8b0000, #500000);
    border-color: #ff4444;
    color: #ffcccc;
    margin-top: 6px;
}

.medieval-btn.danger:hover {
    background: linear-gradient(to bottom, #a00000, #600000);
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.3);
}

/* Staff Modal */
#staff-modal.floating-window {
    width: 600px;
    max-width: 90vw;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
}

#staffHeader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}

#staffHeader .header-left strong {
    white-space: nowrap;
}

#staffHeader .header-controls {
    display: flex;
    gap: 6px;
    align-items: center;
}

#staffHeader .header-btn {
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
    background: rgba(60, 45, 30, 0.8);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    border-radius: 4px;
    cursor: pointer;
}

#staffHeader .header-btn.active {
    background: var(--gold-dark);
    color: #fff;
}

.staff-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: 38px;
    flex-shrink: 0;
}

.staff-tabs .tab-btn {
    flex: 1;
    padding: 8px 4px;
    background: transparent;
    border: none;
    color: rgba(212, 175, 55, 0.6);
    font-family: 'MedievalSharp', cursive;
    font-size: 11px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
}

.staff-tabs .tab-btn:hover {
    color: var(--gold-light);
    background: rgba(212, 175, 55, 0.1);
}

.staff-tabs .tab-btn.active {
    color: var(--gold-light);
    border-bottom: 2px solid var(--gold-primary);
    background: rgba(212, 175, 55, 0.15);
}

.staff-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    min-height: 300px;
}

.staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.staff-item {
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.8), rgba(20, 15, 10, 0.8));
    border: 2px solid rgba(100, 80, 60, 0.5);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.staff-item:hover {
    border-color: var(--gold-dark);
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

.staff-item img {
    width: 32px;
    height: 32px;
    margin-bottom: 5px;
    image-rendering: pixelated;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.6));
}

.staff-item span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 11px;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Roboto', sans-serif;
    line-height: 1.2;
    min-height: 2.4em;
    /* Ensure consistent height for alignment */
}

.staff-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.staff-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(40, 30, 20, 0.8), rgba(20, 15, 10, 0.8));
    border: 2px solid rgba(100, 80, 60, 0.5);
    padding: 10px;
    border-radius: 6px;
    color: var(--text-main);
}

.staff-list-item span {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
}

.staff-actions {
    display: flex;
    gap: 6px;
}

.staff-actions button {
    padding: 6px 12px;
    font-size: 11px;
}

.staff-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 250px;
    margin: 0 auto;
}

.staff-form label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
}

.staff-form input {
    width: 120px;
    padding: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(100, 80, 60, 0.5);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Roboto', sans-serif;
}

.staff-form input:focus {
    outline: none;
    border-color: var(--gold-dark);
}

.staff-form button {
    margin-top: 8px;
}

/* Teleport tab compact layout */
.staff-form.compact {
    gap: 8px;
    max-width: 100%;
}

.staff-form .xy-row {
    display: flex;
    gap: 6px;
    align-items: center;
}

.staff-form .xy-row input {
    width: 70px;
    padding: 6px 8px;
    font-size: 12px;
}

#staff-modal .staff-form .xy-row input[type="number"] {
    color-scheme: light;
}

#staff-modal .staff-form .xy-row input[type="number"]::-webkit-inner-spin-button,
#staff-modal .staff-form .xy-row input[type="number"]::-webkit-outer-spin-button {
    filter: invert(1) brightness(1.3);
    opacity: 0.9;
}

.staff-form .xy-row button {
    margin-top: 0;
    padding: 6px 12px;
    font-size: 11px;
}

.places-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    margin-top: 10px;
}

.place-btn {
    padding: 5px 8px !important;
    font-size: 10px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    background: rgba(40, 30, 20, 0.8) !important;
    border: 1px solid rgba(100, 80, 60, 0.6) !important;
    border-radius: 4px !important;
    color: var(--gold-light) !important;
    transition: all 0.15s !important;
    white-space: nowrap;
}

.place-btn:hover {
    background: rgba(60, 45, 30, 0.9) !important;
    border-color: var(--gold-primary) !important;
    transform: translateY(-1px) !important;
}

.staff-footer {
    padding: 12px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.staff-footer button {
    padding: 8px 16px;
    font-size: 12px;
}

.staff-footer span {
    color: var(--gold-light);
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


/* ========== STAFF BUTTON ========== */
#staffBtn {
    position: fixed;
    top: 10px;
    left: 106px;
    /* 10px + 42px + 6px + 42px + 6px */
    width: 42px;
    height: 42px;
    padding: 0;
    z-index: 1000;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 6px;
    color: var(--gold-light);
    display: none;
    /* Hidden by default, shown via JS */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
    transition: all 0.3s;
}

#staffBtn:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-primary);
    transform: scale(1.05);
}

#staffBtn svg {
    width: 24px;
    height: 24px;
}



.construction-tag {
    position: absolute;
    top: 25px;
    right: -70px;
    width: 220px;
    background: #e74c3c;
    color: white;
    text-align: center;
    padding: 4px 0;
    transform: rotate(45deg);
    font-weight: bold;
    font-family: 'Cinzel', serif;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
    z-index: 10;
    border: 1px solid #c0392b;
    text-transform: uppercase;
    font-size: 10px;
    pointer-events: none;
    line-height: 1.2;
}

/* ========== MAP MODAL ========== */
#mapModal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    /* Layout */
    display: flex;
    flex-direction: column;

    /* Size - Content driven (Enforced) */
    width: fit-content !important;
    height: fit-content !important;
    max-width: 95vw !important;
    max-height: 95vh !important;

    /* Reset margins */
    margin: 0;

    z-index: 2000 !important;
}

.map-content {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    background: #0d1217;
    overflow: hidden;

    /* Ensure it doesn't force stretch */
    width: auto;
    height: auto;
    min-width: 300px;
    min-height: 200px;
}

.map-image-container {
    position: relative;
    display: block;

    /* Reset */
    width: auto;
    height: auto;

    border: 1px solid var(--gold-dark);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    background: #000;
}

.world-map-image {
    /* Natural size */
    width: auto;
    height: auto;
    display: block;

    /* Constraints */
    max-width: 90vw;
    max-height: 75vh;

    object-fit: contain;
}

/* Player direction arrow on full map */
#fullMapPlayerArrow {
    position: absolute;
    width: 24px;
    height: 32px;
    display: none;
    transform: translate(-50%, -50%) rotate(0deg);
    transform-origin: center center;
    z-index: 100;
    pointer-events: none;
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(0, 0, 0, 0.8));
    transition: transform 0.1s linear, left 0.1s linear, top 0.1s linear;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .world-map-image {
        max-width: 95vw;
        max-height: 70vh;
    }

    .fullmap-zoom-controls {
        top: 40px;
    }
}

/* ========== CONTROLES DE ZOOM DO MAPA COMPLETO ========== */
.fullmap-zoom-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    gap: 4px;
    pointer-events: auto;
}

.fullmap-zoom-btn {
    width: 32px;
    height: 32px;
    border: 2px solid var(--gold-dark);
    border-radius: 6px;
    background: linear-gradient(180deg, rgba(60, 45, 30, 0.95), rgba(35, 25, 15, 0.95));
    color: var(--gold-light);
    font-size: 20px;
    font-weight: bold;
    font-family: 'Roboto', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.fullmap-zoom-btn:hover {
    background: linear-gradient(180deg, rgba(70, 55, 40, 0.98), rgba(45, 35, 25, 0.98));
    border-color: var(--gold-primary);
    box-shadow:
        0 2px 10px rgba(212, 175, 55, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.fullmap-zoom-btn:active {
    transform: scale(0.95);
    background: linear-gradient(180deg, rgba(50, 35, 20, 0.98), rgba(30, 20, 10, 0.98));
}

.fullmap-zoom-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* Container com zoom ativo - cursor de grab */
.map-content.zoom-active {
    cursor: grab !important;
    overflow: hidden !important;
    /* Dimensões fixadas via JS quando zoom inicia */
}

.map-content.zoom-active.grabbing {
    cursor: grabbing !important;
}

.map-content.zoom-active .map-image-container {
    transform-origin: 0 0;
    will-change: transform;
    /* Manter posição absoluta dentro do container fixo */
    position: absolute;
    top: 0;
    left: 0;
}

/* Imagem do mapa quando zoom está ativo */
.map-content.zoom-active .world-map-image {
    max-width: none;
    max-height: none;
    pointer-events: none;
}

/* Staff Accordion Styles */
.staff-accordion {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.staff-accordion-header {
    background: rgba(60, 45, 30, 0.8);
    border: 1px solid var(--gold-dark);
    padding: 8px 12px;
    color: var(--gold-light);
    cursor: pointer;
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 4px;
    user-select: none;
    transition: background 0.2s;
}

.staff-accordion-header:hover {
    background: rgba(80, 60, 40, 0.9);
}

.staff-accordion-header::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.2s;
}

.staff-accordion-header.collapsed::after {
    transform: rotate(-90deg);
}

.staff-accordion-content {
    display: none;
    padding: 4px 0 4px 8px;
    /* Indent content */
    flex-direction: column;
    gap: 4px;
}

.staff-accordion-content.open {
    display: flex;
}

#anvilWindow .anvil-body {
    overflow-y: auto;
    max-height: 50vh;
    padding-right: 4px;
}


#anvilWindow .anvil-body::-webkit-scrollbar {
    width: 6px;
}

#anvilWindow .anvil-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

#anvilWindow .anvil-body::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

#anvilWindow .anvil-body::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

#tableWindow .forge-body {
    overflow-y: auto;
    max-height: 50vh;
    padding-right: 4px;
}

#tableWindow .forge-body::-webkit-scrollbar {
    width: 6px;
}

#tableWindow .forge-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

#tableWindow .forge-body::-webkit-scrollbar-thumb {
    background: var(--gold-dark);
    border-radius: 3px;
}

#tableWindow .forge-body::-webkit-scrollbar-thumb:hover {
    background: var(--gold-primary);
}

/* Nested levels styling */
.staff-accordion-content .staff-accordion-header {
    background: rgba(50, 40, 30, 0.6);
    font-size: 12px;
    padding: 6px 10px;
    border-color: rgba(100, 80, 60, 0.5);
}

.staff-accordion-content .staff-accordion-content {
    border-left: 2px solid rgba(100, 80, 60, 0.3);
    margin-left: 6px;
    padding-left: 8px;
}

/* Grid inside accordion */
.staff-accordion-content .staff-grid {
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Item Info Modal (Floating Window) */
/* Styles are now handled by .floating-window and inline styles in JS for specific layout */

.item-icon-frame .item-count {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    text-shadow: 1px 1px 0 #000;
    font-family: 'Roboto', sans-serif;
}

.item-title-section {
    flex: 1;
}

.item-title-section h2 {
    font-size: 20px;
    color: var(--gold-light);
    margin-bottom: 4px;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.item-type {
    font-size: 12px;
    color: #aaa;
    font-family: 'Roboto', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.item-details {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #ccc;
    margin-bottom: 20px;
}

.item-description {
    margin-bottom: 15px;
    font-style: italic;
    color: #ddd;
}

.item-stats {
    background: rgba(0, 0, 0, 0.3);
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.stat-row:last-child {
    margin-bottom: 0;
}

.stat-label {
    color: #aaa;
}

.stat-value {
    color: var(--gold-primary);
    font-weight: bold;
}

.item-creator-info {
    font-size: 12px;
    color: #888;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 10px;
}

.item-creator-info p {
    margin-bottom: 2px;
}

.item-actions {
    display: flex;
    justify-content: center;
}

.action-btn {
    background: linear-gradient(to bottom, #4a3b2a, #2a2218);
    border: 1px solid var(--gold-dark);
    color: var(--gold-primary);
    padding: 10px 20px;
    border-radius: 4px;
    font-family: 'Cinzel', serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.action-btn:hover {
    background: linear-gradient(to bottom, #5a4b3a, #3a3228);
    border-color: var(--gold-light);
    color: var(--gold-light);
}

.action-btn:active {
    transform: translateY(1px);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ========== MINIMAP - PREMIUM GLOBE DESIGN ========== */
#minimap-container {
    position: fixed;
    top: 16px;
    left: 16px;
    width: 160px;
    height: 160px;
    z-index: 900;
    pointer-events: auto;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.6));
}

/* Ornate Golden Frame */
#minimap-frame {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: transparent;
    border: 6px solid #d4af37;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.8),
        inset 0 0 10px rgba(0, 0, 0, 0.8),
        0 8px 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 15;
}

/* Decorative inner ring / Metallic Highlight */
#minimap-frame::before {
    content: '';
    position: absolute;
    inset: -6px;
    /* Match parent border */
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: transparent;
    pointer-events: none;
    /* Create a gradient border effect using mask or just simple overlay */
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.5);
}

/* Circular mask for the map */
#minimap-mask {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: #1e2f42;
}

/* The actual map image */
#minimap-image {
    position: absolute;
    top: 0;
    left: 0;
    /* Allow image to be its natural size */
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    transform-origin: 0 0;
    will-change: transform;
    opacity: 0;
    /* Hidden initially until position is updated */
    transition: opacity 0.3s ease;
}

/* Globe lighting and depth effect */
#minimap-overlay {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background:
        radial-gradient(circle at 30% 25%,
            rgba(255, 255, 255, 0.1) 0%,
            rgba(255, 255, 255, 0.15) 15%,
            transparent 30%,
            rgba(0, 0, 0, 0.1) 65%,
            rgba(0, 0, 0, 0.6) 100%);
    pointer-events: none;
    z-index: 8;
}

/* Glossy highlight effect */
#minimap-overlay::before {
    content: '';
    position: absolute;
    top: 10%;
    left: 15%;
    width: 35%;
    height: 25%;
    background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.5) 0%, transparent 70%);
    border-radius: 50%;
    filter: blur(8px);
    transform: rotate(-25deg);
}

/* Shadow on bottom right */
#minimap-overlay::after {
    content: '';
    position: absolute;
    bottom: 5%;
    right: 5%;
    width: 50%;
    height: 50%;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.7) 0%, transparent 60%);
    border-radius: 50%;
    filter: blur(12px);
}

/* Player position indicator */
#minimap-player {
    display: none !important;
    /* Hidden as per user request */
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: radial-gradient(circle, #fff 0%, #ffeb3b 50%, #ff9800 100%);
    border: 2px solid rgba(0, 0, 0, 0.8);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow:
        0 0 8px rgba(255, 235, 59, 0.8),
        0 0 12px rgba(255, 152, 0, 0.6),
        inset 0 1px 2px rgba(255, 255, 255, 0.8);
    animation: playerPulse 2s ease-in-out infinite;
}

/* Player direction arrow (always centered) */
#minimap-player-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 22px;
    transform: translate(-50%, -50%) rotate(0deg);
    transform-origin: center center;
    z-index: 12;
    pointer-events: none;
    opacity: 0.95;
    filter:
        drop-shadow(0 0 6px rgba(212, 175, 55, 0.55)) drop-shadow(0 2px 3px rgba(0, 0, 0, 0.85));
    transition: transform 0.2s ease-out;
}

.player-arrow-svg {
    width: 100%;
    height: 100%;
    display: block;
}

@keyframes playerPulse {

    0%,
    100% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    50% {
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 0.9;
    }
}

/* Zoom controls */
#minimap-controls {
    position: absolute;
    bottom: -32px;
    /* Moved down more for better spacing */
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 0 4px;
    z-index: 20;
    pointer-events: none;
    /* Allow clicks through the container */
}

#minimap-controls button {
    pointer-events: auto;
    width: 34px;
    /* Increased from 28px */
    height: 34px;
    /* Increased from 28px */
    padding: 0;
    font-size: 20px;
    /* Increased from 18px */
    font-weight: bold;
    line-height: 1;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.95), rgba(40, 30, 20, 0.95));
    border: 2px solid var(--gold-dark);
    color: var(--gold-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
    font-family: Arial, sans-serif;
    /* Changed to standard font */
}

#minimap-controls button:hover {
    background: linear-gradient(135deg, rgba(80, 60, 40, 1), rgba(60, 45, 30, 1));
    border-color: var(--gold-light);
    transform: scale(1.1);
    box-shadow:
        0 6px 12px rgba(0, 0, 0, 0.8),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        0 0 12px rgba(212, 175, 55, 0.4);
}

#minimap-controls button:active {
    transform: scale(0.95);
}



/* Top Right UI Container */
#top-right-ui {
    position: fixed;
    top: 16px;
    right: 16px;
    display: flex;
    flex-direction: row-reverse;
    /* Items stack from right to left */
    align-items: center;
    gap: 12px;
    z-index: 800;
    pointer-events: none;
    /* Allow clicks to pass through empty space */
}

#top-right-ui>* {
    pointer-events: auto;
    /* Re-enable clicks on children */
    position: relative !important;
    /* Reset absolute positioning */
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

#top-right-ui .ui-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: -32px;
    left: 50%;
    transform: translate(-50%, 0) scale(0.95);
    background: rgba(30, 22, 15, 0.95);
    color: var(--gold-light);
    padding: 4px 8px;
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    font-family: 'MedievalSharp', cursive;
    font-size: 9px;
    letter-spacing: 0.3px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    z-index: 1100;
}

#top-right-ui .ui-btn:hover::after,
#top-right-ui .ui-btn:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
}

/* Reset specific button styles that might conflict */
#settingsBtn,
#staffBtn {
    margin: 0;
}

/* ========== RESPONSIVE MINIMAP ========== */
/* Escalar o minimapa proporcionalmente em telas menores */

@media (max-height: 600px),
(max-width: 600px) {
    #minimap-container {
        width: 120px;
        height: 120px;
        top: 12px;
        left: 12px;
    }

    #minimap-frame {
        border-width: 4px;
        inset: -4px;
    }

    #minimap-controls {
        bottom: -26px;
    }

    #minimap-controls button {
        width: 28px;
        height: 28px;
        font-size: 16px;
    }
}

@media (max-height: 480px),
(max-width: 480px) {
    #minimap-container {
        width: 100px;
        height: 100px;
        top: 10px;
        left: 10px;
    }

    #minimap-frame {
        border-width: 3px;
        inset: -3px;
    }

    #minimap-controls {
        bottom: -22px;
    }

    #minimap-controls button {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }
}

@media (max-height: 380px),
(max-width: 380px) {
    #minimap-container {
        width: 80px;
        height: 80px;
        top: 8px;
        left: 8px;
    }

    #minimap-frame {
        border-width: 2px;
        inset: -2px;
    }

    #minimap-controls {
        bottom: -20px;
    }

    #minimap-controls button {
        width: 22px;
        height: 22px;
        font-size: 12px;
    }
}

/* ========== STAFF PANEL ========== */
#staff-modal {
    width: 90vw;
    max-width: 900px;
    height: 80vh;
    /* Altura fixa relativa à tela para aproveitar espaço */
    max-height: 800px;
    display: flex;
    flex-direction: column;
    background: rgba(18, 14, 11, 0.85);
    /* Mais transparente conforme pedido */
    border: 1px solid var(--gold-dark);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.9);
    border-radius: 8px;
    overflow: hidden;
    /* Garantir que bordas arredondadas funcionem */
    backdrop-filter: blur(4px);
    /* Blur para legibilidade */
}

#staff-modal.hidden {
    display: none !important;
}

#staff-modal .window-header {
    background: linear-gradient(to right, #2a2218, #3e3224);
    padding: 12px 16px;
    border-bottom: 1px solid var(--gold-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Cinzel', serif;
    font-size: 16px;
    color: var(--gold-light);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#staff-modal .header-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

#staff-modal .header-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    font-size: 8px;
    padding: 3px 6px;
    border-radius: 3px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1;
    display: inline-block;
    width: auto;
    margin-right: 10px;
}

#staff-modal .header-btn:hover {
    background: rgba(212, 175, 55, 0.2);
}

#staff-modal .header-btn.active {
    background: var(--gold-primary);
    color: #000;
    border-color: var(--gold-light);
}

#staff-modal .close-btn {
    background: none;
    border: none;
    color: #cc4444;
    font-size: 24px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.2s;
}

#staff-modal .close-btn:hover {
    color: #ff6666;
}

#staff-modal .staff-tabs {
    display: flex;
    gap: 2px;
    padding: 8px 16px 0;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(139, 115, 85, 0.2);
    flex-wrap: nowrap;
    /* Não quebrar linha */
    overflow-x: auto;
    /* Scroll horizontal se necessário */
}

#staff-modal .tab-btn {
    flex: 1 1 auto;
    min-width: 60px;
    /* Reduzido para caber melhor */
    padding: 8px 10px;
    /* Padding menor */
    background: rgba(30, 25, 20, 0.4);
    border: 1px solid rgba(139, 115, 85, 0.3);
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    color: #a09080;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 11px;
    /* Fonte menor */
    text-transform: uppercase;
    transition: all 0.2s;
    margin-bottom: -1px;
    position: relative;
    white-space: nowrap;
    /* Texto em uma linha só */
}

#staff-modal .tab-btn:hover {
    background: rgba(45, 38, 30, 0.6);
    color: var(--gold-light);
}

#staff-modal .tab-btn.active {
    background: rgba(18, 14, 11, 0.98);
    /* Mesma cor do corpo da modal */
    border-color: var(--gold-dark);
    border-bottom-color: transparent;
    /* "Conectar" com o corpo */
    color: var(--gold-light);
    font-weight: bold;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

#staff-modal .staff-body {
    flex: 1;
    overflow-y: auto;
    background: transparent;
    /* Transparente para usar o fundo da modal */
    padding: 16px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--gold-dark) rgba(0, 0, 0, 0.3);
}

#staff-modal .staff-body::-webkit-scrollbar {
    width: 6px;
}

#staff-modal .staff-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

#staff-modal .staff-body::-webkit-scrollbar-thumb {
    background-color: var(--gold-dark);
    border-radius: 3px;
}

#staff-modal .staff-footer {
    display: none;
    /* Footer removido conforme pedido */
}

#staff-modal .staff-footer button {
    background: linear-gradient(to bottom, #3e3224, #2a2218);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 12px;
    transition: all 0.2s;
}

#staff-modal .staff-footer button:hover {
    filter: brightness(1.2);
    transform: translateY(-1px);
}

/* Grid de Itens Melhorado */
#staff-modal .staff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
    gap: 8px;
    padding: 4px;
}

#staff-modal .staff-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Centralizar verticalmente */
    gap: 6px;
    padding: 8px 4px;
    background: rgba(35, 30, 25, 0.4);
    border: 1px solid rgba(139, 115, 85, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    height: 80px;
    /* Altura fixa para uniformidade */
    position: relative;
}

#staff-modal .staff-item:hover {
    border-color: var(--gold-light);
    background: rgba(212, 175, 55, 0.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
}

#staff-modal .staff-item img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
    transition: transform 0.2s;
}

#staff-modal .staff-item:hover img {
    transform: scale(1.1);
}

#staff-modal .staff-item span {
    font-size: 10px;
    text-align: center;
    color: #ccc;
    line-height: 1.1;
    max-height: 2.2em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Lista de Players/NPCs Compacta */
#staff-modal .staff-list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    /* Reduzido padding */
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background 0.2s;
    min-height: 28px;
    /* Altura mínima reduxida */
}

#staff-modal .staff-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

#staff-modal .staff-list-item span {
    font-size: 11px;
    /* Fonte menor */
}

#staff-modal .staff-list-item strong {
    color: var(--gold-primary);
    font-size: 12px;
    /* Fonte menor */
}

#staff-modal .staff-actions {
    display: flex;
    gap: 4px;
    /* Gap menor */
}

#staff-modal .staff-actions button {
    padding: 2px 6px;
    /* Botões menores */
    font-size: 9px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #666;
    color: #ddd;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.2;
}

#staff-modal .staff-actions button:hover {
    border-color: var(--gold-light);
    color: var(--gold-light);
}

/* Botões diretamente em list-item (ex: Spawn NPCs) */
#staff-modal .staff-list-item>button {
    padding: 2px 8px;
    font-size: 9px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--gold-dark);
    color: var(--gold-light);
    border-radius: 3px;
    cursor: pointer;
    text-transform: uppercase;
    font-family: 'Cinzel', serif;
}

#staff-modal .staff-list-item>button:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--gold-light);
}

/* Accordion Styles */
.staff-accordion {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.staff-accordion-header {
    padding: 8px 12px;
    background: linear-gradient(90deg, rgba(60, 45, 30, 0.9), rgba(40, 30, 20, 0.9));
    border: 1px solid var(--gold-dark);
    border-radius: 4px;
    color: var(--gold-light);
    font-family: 'Cinzel', serif;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    transition: all 0.2s;
}

.staff-accordion-header:hover {
    background: linear-gradient(90deg, rgba(80, 60, 40, 0.9), rgba(50, 40, 25, 0.9));
    border-color: var(--gold-primary);
}

.staff-accordion-header::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s;
}

.staff-accordion-header.collapsed::after {
    transform: rotate(-90deg);
}

.staff-accordion-content {
    display: none;
    padding: 5px;
    border: 1px solid var(--gold-dark);
    border-top: none;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0 0 4px 4px;
    margin-top: -2px;
    margin-bottom: 5px;
}

.staff-accordion-content.open {
    display: block;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Ajustes para mobile horizontal */
@media (max-height: 500px) and (orientation: landscape) {
    #staff-modal {
        max-height: 95vh;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    #staff-modal .staff-tabs {
        margin-bottom: 5px;
    }

    #staff-modal .tab-btn {
        padding: 4px 8px;
        /* Menor padding */
        min-width: 60px;
    }

    #staff-modal .staff-body {
        min-height: 120px;
        /* Menor altura mínima */
    }
}

/* Ajustes gerais para telas pequenas */
@media (max-width: 700px) {
    #staff-modal {
        width: 95vw !important;
        max-width: 95vw !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    #staff-modal .staff-tabs {
        gap: 2px;
        flex-wrap: nowrap;
    }

    #staff-modal .tab-btn {
        padding: 4px 6px;
        font-size: 10px;
        min-width: auto;
        flex: 1;
    }

    #staff-modal .staff-grid {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
        gap: 5px;
        padding: 5px;
    }

    #staff-modal .staff-item {
        padding: 5px;
        gap: 3px;
    }

    #staff-modal .staff-item img {
        width: 26px;
        height: 26px;
    }

    #staff-modal .staff-item span {
        font-size: 8px;
        line-height: 1.1;
    }

    #staff-modal .staff-body {
        min-height: 100px;
        max-height: 50vh;
        padding: 5px;
    }

    #staff-modal .staff-footer {
        padding: 6px;
        flex-direction: column;
        gap: 8px;
    }

    #staff-modal .staff-footer button {
        padding: 5px 10px;
        font-size: 10px;
    }

    .staff-accordion-header {
        padding: 5px 8px;
        font-size: 11px;
    }

    .staff-form.compact .xy-row {
        gap: 4px;
    }

    .staff-form.compact .xy-row input {
        width: 55px;
        padding: 4px;
        font-size: 11px;
    }

    .places-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 3px;
    }

    .place-btn {
        padding: 4px 5px !important;
        font-size: 9px !important;
    }
}

/* ========== RIGHT ACTION PANEL (AÇÕES + MAGIAS) ========== */
/* Layout em coluna vertical reversa para manter botões de magia fixos no topo */
/* O botão de ação fica embaixo e os botões de magia ficam em posição fixa */
#rightActionPanel {
    position: fixed;
    right: 12px;
    bottom: 90px;
    /* BASE (Landscape/Wide): Posição baixa, acima apenas de rodapés pequenos */
    /* Acima do botão de ação */
    z-index: 800;

    display: flex;
    flex-direction: column-reverse;
    /* Magias crescem para cima */
    gap: 10px;
    align-items: center;

    padding: 8px;
    padding-bottom: 0 !important;
    /* Forçar zero no fundo para cálculo preciso do gap */
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
}

/* Safe area para dispositivos com notch/barra de navegação */
@supports (padding: env(safe-area-inset-bottom)) {
    #rightActionPanel {
        right: max(12px, env(safe-area-inset-right));
        bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    }

    #actionButton {
        right: max(20px, env(safe-area-inset-right));
        /* Ajustado para alinhar */
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
}

/* ========== MODO PORTRAIT (Desviar da Bag/Rodapé) ========== */
@media (orientation: portrait) {
    #rightActionPanel {
        bottom: 185px;
        /* Sobe para sair de cima da bag vertical */
    }

    #actionButton {
        bottom: 115px;
        /* Sobe para sair de cima da bag vertical */
    }

    @supports (padding: env(safe-area-inset-bottom)) {
        #rightActionPanel {
            bottom: calc(185px + env(safe-area-inset-bottom, 0px));
        }

        #actionButton {
            bottom: calc(115px + env(safe-area-inset-bottom, 0px));
        }
    }
}

#rightActionPanel>* {
    pointer-events: auto;
}

/* ========== BOTÃO DE AÇÃO (hand.png) - APENAS MOBILE ========== */
/* No desktop: oculto. No mobile touch: visível na parte inferior */
#actionButton {
    display: none;
    /* Oculto por padrão (desktop) */

    /* POSICIONAMENTO FIXO INDEPENDENTE DAS MAGIAS */
    position: fixed;
    right: 20px;
    /* Alinhado com o centro do painel de magia (12px right + 8px padding) */
    bottom: 20px;
    /* BASE (Landscape/Wide): Posição baixa */
    /* Posição original base */
    z-index: 801;
    /* Acima do painel se necessário */

    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;

    /* Visual RPG Premium */
    background: radial-gradient(circle at 35% 35%, #6b5a45, #2a2015 60%, #0f0b08 100%);
    border: none;
    box-shadow:
        inset 0 0 12px rgba(0, 0, 0, 0.9),
        inset 0 2px 3px rgba(255, 255, 255, 0.15),
        0 0 0 2px #3e2b14,
        0 0 0 4px #d4af37,
        0 0 0 5px #5c4010,
        0 5px 12px rgba(0, 0, 0, 0.7),
        0 0 14px rgba(212, 175, 55, 0.25);

    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.15s, filter 0.15s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
    /* Garantir clique */
    padding: 0;
    /* Remove padding padrão nativo de botões que pode diminuir o ícone */
}

#actionButton.hidden {
    visibility: hidden;
    pointer-events: none;
}

#actionButton:active {
    transform: scale(0.94) translateY(2px);
    box-shadow:
        inset 0 0 18px rgba(0, 0, 0, 1),
        0 0 0 2px #3e2b14,
        0 0 0 4px #b08d26,
        0 0 0 5px #5c4010,
        0 3px 6px rgba(0, 0, 0, 0.7);
    filter: brightness(0.92);
}

#actionButton img {
    width: 65%;
    /* Tamanho equilibrado dentro do círculo */
    height: 65%;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
    display: block;
    flex-shrink: 0;
    /* Garante que a imagem não seja esmagada */
}

/* Mostrar botão de ação APENAS em dispositivos mobile/touch */
body.touch-device #actionButton,
body.mobile-app #actionButton {
    display: flex;
}

/* ========== BOTÕES DE MAGIA - SEMPRE VISÍVEIS ========== */
.magic-btn {
    position: relative;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    flex-shrink: 0;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #2a2015;

    border: 2px solid #8a6a12;
    box-shadow:
        inset 0 0 10px rgba(0, 0, 0, 0.8),
        0 0 0 1px #000,
        0 4px 8px rgba(0, 0, 0, 0.6);

    cursor: pointer;
    transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

#rightActionPanel button.magic-btn {
    padding: 0;
    font: inherit;
    text-transform: none;
    letter-spacing: 0;
}

.target-cycle-btn,
.quick-eat-btn {
    background-size: 70% 70% !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    transition: transform 0.1s, border-color 0.2s, box-shadow 0.2s;
}

@media (hover: hover) and (pointer: fine) {

    #rightActionPanel .target-cycle-btn:hover,
    #rightActionPanel .quick-eat-btn:hover {
        border-color: #d4af37;
        box-shadow:
            inset 0 0 5px rgba(0, 0, 0, 0.5),
            0 0 0 2px #d4af37,
            0 6px 12px rgba(0, 0, 0, 0.7),
            0 0 10px rgba(212, 175, 55, 0.35);
        transform: scale(1.08);
    }

    #rightActionPanel .target-cycle-btn:active,
    #rightActionPanel .quick-eat-btn:active {
        transform: scale(0.94);
        filter: brightness(0.88);
    }
}

@media (hover: none) and (pointer: coarse) {

    /* On touch devices keep it simple: no hover scale */
    #rightActionPanel .target-cycle-btn:hover,
    #rightActionPanel .quick-eat-btn:hover,
    #rightActionPanel .target-cycle-btn:active,
    #rightActionPanel .quick-eat-btn:active {
        background-color: #2a2015;
        border-color: #8a6a12;
        box-shadow:
            inset 0 0 10px rgba(0, 0, 0, 0.8),
            0 0 0 1px #000,
            0 4px 8px rgba(0, 0, 0, 0.6);
        transform: none;
    }
}

.magic-btn.slot-hidden {
    display: none;
}

@media (hover: hover) and (pointer: fine) {
    .magic-btn:hover {
        border-color: #d4af37;
        box-shadow:
            inset 0 0 5px rgba(0, 0, 0, 0.5),
            0 0 0 2px #d4af37,
            0 6px 12px rgba(0, 0, 0, 0.7),
            0 0 10px rgba(212, 175, 55, 0.35);
        transform: scale(1.08);
    }
}

@media (hover: none) and (pointer: coarse) {
    #rightActionPanel button.magic-btn:hover {
        background-color: #2a2015;
        background-image: inherit;
        background-size: cover;
        background-position: center;
        border-color: #8a6a12;
        box-shadow:
            inset 0 0 10px rgba(0, 0, 0, 0.8),
            0 0 0 1px #000,
            0 4px 8px rgba(0, 0, 0, 0.6);
        transform: none;
    }

    #rightActionPanel button.magic-btn:active {
        background-color: #2a2015;
        background-image: inherit;
        background-size: cover;
        background-position: center;
        border-color: #8a6a12;
        box-shadow:
            inset 0 0 10px rgba(0, 0, 0, 0.8),
            0 0 0 1px #000,
            0 4px 8px rgba(0, 0, 0, 0.6);
        transform: scale(0.94);
    }

    /* target-cycle-btn and quick-eat-btn inherit standard magic-btn hover/active */
}

.magic-btn:active {
    transform: scale(0.94);
    filter: brightness(0.88);
}

/* Overlay de cooldown */
.cooldown-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 13px;
    text-shadow: 0 0 3px #000;
}

/* Indicador de tecla de atalho (1-6) */
.magic-hotkey {
    position: absolute;
    top: -2px;
    left: -2px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffd700;
    border: 1px solid #8a6a12;
    border-radius: 4px;
    padding: 1px 4px;
    font-size: 10px;
    font-weight: bold;
    font-family: monospace;
    pointer-events: none;
    z-index: 10;
}

/* Esconder atalhos em dispositivos touch/mobile */
body.touch-device .magic-hotkey,
body.mobile-app .magic-hotkey {
    display: none;
}

@media (hover: none) and (pointer: coarse) {
    .magic-hotkey {
        display: none;
    }
}

/* ========== RESPONSIVIDADE ========== */

/* Telas pequenas (mobile portrait) - Layout 3x2 para 6 magias */
@media (max-width: 600px) and (orientation: portrait) {
    #rightActionPanel {
        right: 8px;
        bottom: 175px;
        /* Layout em grid 2 colunas para 6 botões */
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 6px;
        padding: 6px;
        width: auto;
        flex-direction: unset;
    }

    #actionButton {
        right: 14px;
        bottom: 110px;
        width: 46px;
        height: 46px;
    }

    .magic-btn {
        width: 42px;
        height: 42px;
    }

    .target-cycle-btn {
        order: 1000;
    }

    .quick-eat-btn {
        order: 999;
    }

    .cooldown-overlay {
        font-size: 10px;
    }
}

/* Mobile em landscape: grade 3x2 para manter botões na tela */
@media (orientation: landscape) and (hover: none) and (pointer: coarse) {
    #rightActionPanel {
        right: 10px;
        bottom: 90px;
        display: grid !important;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        gap: 8px;
        padding: 6px;
        flex-direction: unset;
        width: auto;
    }

    .magic-btn {
        width: 46px;
        height: 46px;
    }

    .target-cycle-btn {
        order: 1000;
    }

    .quick-eat-btn {
        order: 999;
    }

    .cooldown-overlay {
        font-size: 10px;
    }
}

/* Telas muito pequenas ou landscape compacto */
@media (max-height: 420px) {
    #rightActionPanel {
        right: 6px;
        bottom: 70px;
        /* Reduzido em landscape: Botão (20) + Altura (42) + Gap (8) */
        gap: 6px;
        padding: 4px;
        padding-bottom: 0 !important;
    }

    #actionButton {
        right: 10px;
        /* 6px right + 4px padding do painel */
        bottom: 20px;
        /* Mais próximo do fundo em landscape */
        width: 42px;
        height: 42px;
    }

    .magic-btn {
        width: 42px;
        height: 42px;
    }

    .cooldown-overlay {
        font-size: 10px;
    }
}

/* Telas extremamente pequenas */
@media (max-height: 360px) {
    #rightActionPanel {
        bottom: 55px;
        /* Reduzido: Botão (10) + Altura (38) + Gap (7) */
        gap: 5px;
        padding-bottom: 0 !important;
    }

    #actionButton {
        bottom: 10px;
        /* Bem próximo do fundo */
        width: 38px;
        height: 38px;
    }

    .magic-btn {
        width: 38px;
        height: 38px;
    }

    .cooldown-overlay {
        font-size: 9px;
    }
}

/* ========== LOCATION DISPLAY ========== */
.location-display {
    position: fixed;
    top: 15%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    pointer-events: none;
    opacity: 0;
    text-align: center;
}

.location-display.visible {
    opacity: 1;
    animation: locationFadeIn 0.8s ease-out forwards;
}

.location-display.fade-out {
    animation: locationFadeOut 1s ease-in forwards;
}

.location-display .location-name {
    font-family: 'Cinzel', serif;
    font-size: clamp(10px, 2.5vw, 18px);
    font-weight: 700;
    color: #f4d03f;
    text-shadow:
        0 0 6px rgba(212, 175, 55, 0.8),
        0 0 12px rgba(212, 175, 55, 0.5),
        1px 1px 2px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 0 10px;
}

.location-display .location-safe {
    display: none;
    font-family: 'Cinzel', serif;
    font-size: clamp(8px, 1.8vw, 13px);
    font-weight: 700;
    color: #55ff55;
    text-shadow:
        0 0 6px rgba(85, 255, 85, 0.8),
        0 0 12px rgba(85, 255, 85, 0.5),
        1px 1px 2px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 6px;
    opacity: 0.95;
}

.location-display .location-safe.active {
    display: block;
}

.location-display .location-safe.enemy-territory {
    color: #ff4444;
    text-shadow:
        -1px -1px 0 #000,
        1px -1px 0 #000,
        -1px 1px 0 #000,
        1px 1px 0 #000,
        0 0 8px #000,
        0 0 16px rgba(0, 0, 0, 0.8);
    font-weight: 800;
    letter-spacing: 2px;
}

.location-display .location-line {
    width: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent,
            rgba(212, 175, 55, 0.8) 20%,
            #f4d03f 50%,
            rgba(212, 175, 55, 0.8) 80%,
            transparent);
    margin: 6px auto 0;
    box-shadow: 0 0 6px rgba(212, 175, 55, 0.6);
}

.location-display.visible .location-line {
    animation: lineExpand 0.6s ease-out 0.3s forwards;
}

@keyframes locationFadeIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(15px);
    }

    100% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@keyframes locationFadeOut {
    0% {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-15px);
    }
}

@keyframes lineExpand {
    0% {
        width: 0;
    }

    100% {
        width: min(120px, 40vw);
    }
}

/* Mobile: ainda menor */
@media (max-width: 768px) {
    .location-display .location-name {
        font-size: 14px;
        letter-spacing: 0.5px;
    }

    .location-display .location-safe {
        font-size: 11px;
    }

    .location-display .location-line {
        margin: 4px auto 0;
    }
}

/* ========== MODAL DE ATALHOS DE TECLADO ========== */
#keyboardShortcutsModal {
    min-width: 320px;
    max-width: 420px;
    width: 90vw;
    height: auto;
    overflow: hidden;
}

#keyboardShortcutsModal .window-content {
    max-height: 50vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 14px 18px;
}

.shortcuts-section {
    margin-bottom: 16px;
}

.shortcuts-section:last-child {
    margin-bottom: 0;
}

.shortcuts-section h4 {
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    color: var(--gold-primary);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.shortcut-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    color: var(--text-main);
}

.shortcut-row span {
    margin-left: auto;
    color: rgba(200, 190, 170, 0.9);
    font-size: 11px;
    text-align: right;
    word-break: break-word;
}

.shortcut-row kbd {
    display: inline-block;
    padding: 3px 7px;
    font-family: 'Roboto', sans-serif;
    font-size: 11px;
    font-weight: 500;
    color: var(--gold-light);
    background: linear-gradient(135deg, rgba(60, 45, 30, 0.95), rgba(40, 30, 20, 0.95));
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* Ajuste de player de replay em mobile landscape */
@media (max-height: 500px) and (orientation: landscape) {
    .replay-bar {
        bottom: 2px !important;
        padding: 4px 12px !important;
        padding-bottom: 2px !important;
    }
}

.coliseum-window {
    width: min(92vw, 420px);
    max-height: 92vh;
    overflow: hidden;
    padding: 0;
}

.coliseum-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 8px 12px;
}

.coliseum-content {
    padding: 12px 14px 14px;
    max-height: calc(92vh - 46px);
    overflow-y: auto;
}

.coliseum-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.coliseum-close-btn {
    margin-left: 8px;
}

.coliseum-section {
    margin-bottom: 12px;
}

.coliseum-section-title {
    color: var(--gold-light);
    font-size: 12px;
    margin-bottom: 6px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.coliseum-radio-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.coliseum-radio {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 13px;
}

.coliseum-row {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

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

.coliseum-input {
    width: 100%;
    padding: 8px 10px;
    background: rgba(10, 8, 6, 0.7);
    border: 1px solid var(--border);
    color: var(--text);
    border-radius: 6px;
    box-sizing: border-box;
}

.coliseum-input-error {
    animation: coliseum-shake 0.3s ease;
    border-color: rgba(255, 120, 120, 0.9) !important;
    box-shadow: 0 0 0 2px rgba(255, 120, 120, 0.2);
}

.coliseum-input--search {
    border-color: rgba(201, 162, 39, 0.7);
}

.coliseum-teams {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 10px;
}

.coliseum-team {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.coliseum-team-title {
    font-size: 12px;
    margin-bottom: 6px;
    min-height: 16px;
    display: flex;
    align-items: center;
}

.coliseum-team-title--a {
    color: #7fb1ff;
}

.coliseum-team-title--b {
    color: #ff9a9a;
}

.coliseum-team-slots {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.coliseum-slot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 34px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.35);
    transition: border-color 0.15s ease, background 0.15s ease;
}

.coliseum-slot--team-a {
    border-color: rgba(127, 177, 255, 0.45);
    background: rgba(20, 30, 50, 0.5);
}

.coliseum-slot--team-b {
    border-color: rgba(255, 122, 122, 0.45);
    background: rgba(55, 20, 20, 0.5);
}

.coliseum-slot.is-empty {
    border-style: dashed;
    cursor: pointer;
}

.coliseum-slot.is-locked {
    cursor: default;
}

.coliseum-slot-name {
    color: #f5f1e6;
    font-size: 13px;
}

.coliseum-slot-empty {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

.coliseum-remove-btn {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.35);
    color: #f3d6d6;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.12s ease, background 0.12s ease, border-color 0.12s ease;
}

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

.coliseum-remove-btn:hover {
    border-color: rgba(255, 160, 160, 0.7);
    background: rgba(180, 60, 60, 0.25);
}

.coliseum-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    font-weight: 700;
    font-size: 12px;
}

.coliseum-player-list {
    max-height: 140px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.coliseum-player-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 10px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.coliseum-player-item:last-child {
    border-bottom: none;
}

.coliseum-player-item:hover {
    background: rgba(201, 162, 39, 0.08);
}

.coliseum-player-item.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.coliseum-player-name {
    color: #f5f1e6;
    font-size: 13px;
}

.coliseum-player-rep {
    color: #a7e3a7;
    font-size: 11px;
}

.coliseum-empty-list {
    padding: 12px;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 12px;
}

.coliseum-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.coliseum-primary-btn {
    background: linear-gradient(180deg, #c9a227, #8b7355);
}

.coliseum-picker {
    margin-top: 10px;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.45);
}

.coliseum-picker.hidden {
    display: none;
}

.coliseum-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.coliseum-picker-title {
    color: var(--gold-light);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}


@media (max-width: 520px) {
    .coliseum-window {
        width: 94vw;
    }

    .coliseum-row {
        flex-direction: column;
    }

    .coliseum-teams {
        flex-direction: column;
    }

    .coliseum-vs {
        align-self: center;
    }

    .coliseum-content {
        max-height: calc(92vh - 52px);
        padding: 10px 12px 12px;
    }

    .coliseum-header {
        padding: 8px 10px;
    }
}

@keyframes coliseum-shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(4px);
    }

    75% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

/* ========== SISTEMA DE TERRENOS (LAND PROPERTIES) ========== */

#landPropertyWindow {
    width: 360px;
}

.land-modal-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.land-info-section {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.land-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-size: 13px;
}

.land-label {
    color: rgba(200, 180, 160, 0.8);
    font-weight: 500;
}

.land-value {
    color: var(--gold-light);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.land-value.available {
    color: #90EE90;
}

.land-value.occupied {
    color: #e8e0d5;
}

.land-value.phrase {
    color: #E6B8A2;
    font-style: italic;
}

.land-coin-icon {
    width: 14px;
    height: 14px;
    image-rendering: pixelated;
    vertical-align: middle;
}

.land-warning-section {
    padding: 10px;
    background: rgba(255, 0, 0, 0.15);
    border: 1px solid rgba(255, 68, 68, 0.4);
    border-radius: 6px;
}

.land-warning {
    color: #FF6B6B;
    font-weight: 600;
    font-size: 12px;
    margin-bottom: 4px;
}

.land-warning-text {
    color: rgba(255, 150, 150, 0.9);
    font-size: 11px;
    line-height: 1.4;
}

.land-action-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    background: rgba(60, 45, 30, 0.4);
    border-radius: 6px;
}

.land-balance-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.land-text-input {
    width: 100%;
    padding: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 4px;
    color: #ddd;
    font-family: 'MedievalSharp', cursive;
    font-size: 12px;
}

.land-text-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    background: rgba(0, 0, 0, 0.6);
}

.land-buy-btn,
.land-phrase-btn {
    padding: 10px 16px;
    background: linear-gradient(145deg, #4a7c4e, #2a5a2e);
    color: #fff;
    border: 1px solid rgba(90, 180, 90, 0.4);
    border-radius: 6px;
    font-family: 'MedievalSharp', cursive;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.land-phrase-btn {
    background: linear-gradient(145deg, #4169E1, #1E3A8A);
    border-color: rgba(65, 105, 225, 0.4);
}

.land-buy-btn:hover:not(:disabled),
.land-phrase-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(1.1);
}

.land-buy-btn:disabled {
    background: rgba(80, 80, 80, 0.6);
    color: rgba(180, 180, 180, 0.6);
    cursor: not-allowed;
    border-color: rgba(100, 100, 100, 0.3);
}

/* Success Overlay */
.land-success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: landSuccessFadeIn 0.3s ease-out;
}

.land-success-content {
    text-align: center;
    animation: landSuccessPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes landSuccessFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes landSuccessPop {
    0% {
        transform: scale(0.4);
        opacity: 0;
    }

    50% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.land-success-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: landSuccessBounce 0.6s ease-out;
}

@keyframes landSuccessBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-20px);
    }
}

.land-success-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-light);
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.6), 0 2px 8px rgba(0, 0, 0, 0.8);
    margin-bottom: 10px;
    font-family: 'MedievalSharp', cursive;
}

.land-success-message {
    font-size: 15px;
    color: #e0e0e0;
    max-width: 400px;
    line-height: 1.5;
}

/* Livro Magico */
.book-modal-overlay {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 10010;
    pointer-events: auto;
    touch-action: none;
}

.book-modal-overlay.hidden {
    display: none;
}

.book-window {
    width: min(520px, 90vw);
    max-height: 86vh;
    font-family: 'MedievalSharp', cursive;
    background: linear-gradient(135deg, rgba(40, 26, 14, 0.95), rgba(22, 14, 8, 0.98));
    border: 1px solid rgba(214, 175, 55, 0.45);
    border-radius: 12px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.65);
    overflow: hidden;
}

.book-header {
    cursor: move;
    background: linear-gradient(120deg, rgba(24, 16, 10, 0.95), rgba(52, 34, 18, 0.95));
    border-bottom: 1px solid rgba(214, 175, 55, 0.25);
}

.book-header h2 {
    font-size: 16px;
    letter-spacing: 1px;
}

.book-close {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.book-close:hover {
    filter: brightness(1.1);
}

.book-body {
    padding: 14px 16px 18px;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 230, 180, 0.05), transparent 55%),
        radial-gradient(circle at 80% 30%, rgba(255, 210, 150, 0.05), transparent 55%),
        linear-gradient(180deg, rgba(15, 10, 6, 0.9), rgba(10, 7, 4, 0.95));
}

.book-pages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.book-spread {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}

.book-page {
    position: relative;
    background:
        linear-gradient(180deg, rgba(245, 230, 195, 0.98), rgba(226, 206, 168, 0.98)),
        repeating-linear-gradient(0deg, rgba(120, 90, 50, 0.06), rgba(120, 90, 50, 0.06) 1px, transparent 1px, transparent 6px);
    border: 1px solid rgba(120, 80, 40, 0.45);
    border-radius: 12px;
    padding: 12px;
    min-height: 190px;
    box-shadow:
        inset 0 0 22px rgba(120, 80, 40, 0.2),
        0 6px 12px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.book-page::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px dashed rgba(120, 80, 40, 0.35);
    border-radius: 10px;
    pointer-events: none;
}

.book-page::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    box-shadow: inset 0 0 30px rgba(120, 80, 40, 0.18);
    pointer-events: none;
}

.book-page-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7b5a33;
}

.book-page-name {
    font-size: 16px;
    font-weight: 700;
    color: #3a240f;
}

.book-page-input {
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(120, 80, 40, 0.45);
    background: rgba(255, 248, 230, 0.9);
    font-family: inherit;
    font-size: 14px;
    color: #3a240f;
}

.book-page-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.book-btn.secondary {
    background: linear-gradient(180deg, rgba(244, 227, 194, 0.95), rgba(217, 190, 147, 0.9));
    border: 1px solid rgba(178, 140, 90, 0.6);
    color: #1d1307;
    font-size: 12px;
    letter-spacing: 0.06em;
    padding: 5px 10px;
    box-shadow: inset 0 -2px 0 rgba(150, 100, 60, 0.35);
}

.book-btn-wide {
    width: 100%;
    justify-content: center;
}

.book-page-row {
    display: flex;
    gap: 6px;
}

.book-page-empty {
    font-size: 14px;
    color: #594120;
    margin-bottom: 6px;
}

.book-btn.primary {
    background: linear-gradient(120deg, rgba(214, 175, 90, 0.95), rgba(170, 115, 45, 0.95));
    box-shadow: 0 3px 10px rgba(110, 70, 30, 0.3);
}

.book-btn.danger {
    background: rgba(214, 120, 85, 0.6);
    border-color: rgba(180, 80, 50, 0.5);
    font-size: 12px;
    padding: 4px 9px;
    letter-spacing: 0.04em;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.35);
    align-self: flex-start;
    width: 90px;
    justify-content: center;
}

.book-btn:hover {
    filter: brightness(1.05);
}

.book-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
}

.book-nav-btn {
    width: 34px;
    height: 30px;
    border-radius: 8px;
    border: 1px solid rgba(214, 175, 55, 0.5);
    background: linear-gradient(120deg, rgba(40, 26, 14, 0.95), rgba(20, 12, 6, 0.95));
    color: #f3e4c5;
    cursor: pointer;
}

.book-nav-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.book-nav-info {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 720px) {
    .book-window {
        width: 94vw;
        max-height: 90vh;
    }

    .book-spread {
        grid-template-columns: 1fr;
    }
}

.book-btn {
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid rgba(120, 80, 40, 0.55);
    background: linear-gradient(180deg, rgba(214, 190, 140, 0.95), rgba(179, 138, 70, 0.9));
    cursor: pointer;
    font-family: 'Cinzel', 'MedievalSharp', serif;
    font-size: 12px;
    color: #2f1b0b;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2), 0 4px 6px rgba(0, 0, 0, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.book-btn:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.25), 0 6px 10px rgba(0, 0, 0, 0.5);
}