* {
    box-sizing: border-box;
    user-select: none;
}

body {
    background: #1a0d04;
    font-family: 'Segoe UI', 'Roboto', 'Poppins', sans-serif;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    min-height: 100vh;
    margin: 0;
    padding: 5px;
}

/* Área principal: ocupa o espaço entre o topo e o rodapé */
.page-stack {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 0;
    position: relative;
    z-index: 1;
}

.site-footer {
    flex-shrink: 0;
    position: relative;
    /* Abaixo de .page-stack (z-index 1) para modais fullscreen (instruções, pausa) ficarem por cima */
    z-index: 0;
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 16px 8px 8px;
    text-align: center;
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(233, 200, 145, 0.82);
    letter-spacing: 0.02em;
    user-select: text;
    -webkit-user-select: text;
}

.site-footer a {
    color: rgba(233, 200, 145, 0.85);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.site-footer a:hover {
    color: #f9e0a0;
}

/* ==================== MENU INICIAL ==================== */

.menu-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
}

.menu-card {
    background: rgba(0, 0, 0, 0.45);
    border-radius: 48px;
    padding: 56px 64px;
    text-align: center;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    backdrop-filter: blur(6px);
    border: 2px solid rgba(233, 200, 145, 0.25);
    max-width: 480px;
    width: 100%;
    position: relative;
}

.menu-language-box {
    position: absolute;
    top: 14px;
    right: 14px;
    width: auto;
    background: rgba(10, 6, 3, 0.78);
    border: 1px solid rgba(233, 200, 145, 0.25);
    border-radius: 10px;
    padding: 4px;
}

.menu-language-title {
    font-size: 0.6rem;
    color: #c9a55b;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 6px;
}

.language-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lang-dropdown {
    position: relative;
}

.lang-toggle-btn {
    margin: 0;
    width: auto;
    background: rgba(255, 255, 255, 0.12);
    color: #f0e6a0;
    border: 1px solid rgba(233, 200, 145, 0.35);
    border-radius: 8px;
    padding: 4px 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 700;
}

.lang-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.lang-caret {
    font-size: 0.7rem;
    opacity: 0.9;
}

.lang-btn {
    margin: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.08);
    color: #f0e6a0;
    border-radius: 8px;
    border: 1px solid transparent;
    padding: 4px 8px;
    text-align: center;
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.2;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.16);
}

.lang-btn.active {
    border-color: rgba(249, 224, 160, 0.8);
    background: rgba(249, 224, 160, 0.18);
}

.menu-logo {
    font-size: 5rem;
    margin-bottom: 12px;
    filter: drop-shadow(0 4px 12px rgba(255,215,0,0.4));
}

.menu-title {
    font-size: 2.2rem;
    font-weight: 800;
    color: #f9e0a0;
    margin: 0 0 6px;
    letter-spacing: 1px;
}

.menu-subtitle {
    font-size: 1rem;
    color: #a8c8a0;
    margin: 0 0 28px;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.menu-profile-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}

.menu-name-field {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 32px;
}

.menu-name-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #c9a55b;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

.menu-name-input {
    width: 100%;
    background: rgba(255,255,255,0.08);
    border: 2px solid rgba(233,200,145,0.35);
    border-radius: 14px;
    padding: 10px 16px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #f9e0a0;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s, background 0.15s;
    font-family: inherit;
    caret-color: #f9e0a0;
}

.menu-name-input::placeholder {
    color: rgba(249,224,160,0.35);
    font-weight: 400;
}

.menu-name-input:focus {
    border-color: #c9a55b;
    background: rgba(255,255,255,0.13);
}

.menu-color-picker {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
    align-items: center;
    padding: 4px 0;
    max-width: 100%;
    margin: 0 auto;
}

.menu-color-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    outline: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.menu-color-btn::-moz-focus-inner {
    border: 0;
}

/* Sem anel laranja do browser; teclado: anel na mesma família de cor do botão */
.menu-color-btn:focus {
    outline: none;
}

.menu-color-btn:focus-visible {
    outline: 3px solid;
    outline-offset: 3px;
}

.menu-color-btn.menu-color-amarelo:focus-visible {
    outline-color: #ffd966;
}

.menu-color-btn.menu-color-vermelho:focus-visible {
    outline-color: #ff5555;
}

.menu-color-btn.menu-color-azul:focus-visible {
    outline-color: #6bb8ff;
}

.menu-color-btn.menu-color-verde:focus-visible {
    outline-color: #5edc6e;
}

.menu-color-btn.menu-color-rosa:focus-visible {
    outline-color: #f48fb1;
}

.menu-color-btn.menu-color-branco:focus-visible {
    outline-color: #cfd8dc;
}

.menu-color-btn.menu-color-laranja:focus-visible {
    outline-color: #ffb74d;
}

.menu-color-btn:hover {
    transform: scale(1.15);
}

.menu-color-btn.selected {
    border-color: #fff;
    box-shadow: 0 0 0 3px rgba(255,255,255,0.4), 0 2px 8px rgba(0,0,0,0.5);
    transform: scale(1.15);
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.menu-buttons-group {
    display: flex;
    flex-direction: column !important;
    gap: 18px;
    width: 100%;
}

#menuModeButtons {
    flex-direction: column !important;
    gap: 18px;
    width: 100%;
}

.menu-btn {
    background: linear-gradient(135deg, #9c27b0, #6a1b9a);
    border: none;
    border-radius: 60px;
    padding: 18px 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 6px 20px rgba(156,39,176,0.4);
    width: 100%;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.menu-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 28px rgba(156,39,176,0.6);
    background: linear-gradient(135deg, #ab47bc, #7b1fa2);
}

.menu-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='44' height='44' viewBox='0 0 44 44'%3E%3Cpath d='M22 8 L24 20 L36 22 L24 24 L22 36 L20 24 L8 22 L20 20 Z' fill='white' fill-opacity='0.07'/%3E%3C/svg%3E"),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.08) 0px, rgba(255,255,255,0.08) 1px, transparent 1px, transparent 10px),
        repeating-linear-gradient(-45deg, rgba(255,255,255,0.06) 0px, rgba(255,255,255,0.06) 1px, transparent 1px, transparent 12px);
    background-size: 44px 44px, auto, auto;
    background-repeat: repeat;
    opacity: 0.18;
    pointer-events: none;
    z-index: 0;
}

.menu-btn-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
}

.menu-btn-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.menu-btn-icon {
    position: relative;
    z-index: 1;
}

/* ==================== ECRÃ DE JOGO ==================== */

.game-screen {
    width: 100%;
    max-width: 1500px;
    flex: 1 1 auto;
    min-height: 0;
}

.game-wrapper {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    width: 100%;
}

.game-main {
    flex: 1;
    min-width: 0;
    background: rgba(0, 0, 0, 0.35);
    border-radius: 48px;
    padding: 20px;
    box-shadow: 0 25px 40px rgba(0,0,0,0.5);
    backdrop-filter: blur(2px);
}

/* ==================== MESA DE JOGO ==================== */

.game-table {
    background:
        repeating-linear-gradient(
            92deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.04) 2px,
            rgba(0,0,0,0.04) 4px
        ),
        repeating-linear-gradient(
            180deg,
            rgba(255,255,255,0.03) 0px,
            rgba(255,255,255,0.03) 1px,
            transparent 1px,
            transparent 8px
        ),
        linear-gradient(160deg, #6b3d1e 0%, #4a2610 40%, #5c3318 70%, #3d1f0c 100%);
    border-radius: 64px;
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,200,120,0.15);
    border: 2px solid #2a1408;
    overflow: hidden;
}

.center-panel {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

/* Apenas área flexível: cartas jogadas sobre o fundo da .game-table (sem caixa interior) */
.round-history {
    flex: 1 1 0%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    padding: 4px 6px;
    background: transparent;
    text-align: center;
}

.history-title {
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.history-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: center;
    align-items: center;
    margin-top: 0;
    min-width: 0;
    width: 100%;
    min-height: 122px;
    height: 122px;
    box-sizing: border-box;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}

.history-card {
    background: transparent;
    padding: 0;
    border-radius: 14px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.4);
    width: 88px;
    height: 122px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #d4af37;
    overflow: hidden;
    flex-shrink: 0;
}

.history-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
}

.history-card.pirata-simulado {
    border: 2px solid #9c27b0;
    box-shadow: 0 0 10px rgba(156,39,176,0.6);
}

.discard-pile {
    background: #3e2a1f;
    border-radius: 20px;
    padding: 10px 18px;
    color: #ffdd99;
    text-align: center;
    font-weight: bold;
    min-width: 110px;
    font-size: 0.9rem;
}

/* ==================== JOGADORES ==================== */








.player-card {
    background:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='turbulence' baseFrequency='0.012 0.018' numOctaves='5' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.18'/%3E%3C/feComponentTransfer%3E%3CfeBlend in='SourceGraphic' mode='overlay'/%3E%3C/filter%3E%3Crect width='600' height='400' fill='%23e8d9be' filter='url(%23n)'/%3E%3C/svg%3E"),
        repeating-linear-gradient(
            128deg,
            rgba(255,255,255,0.18) 0px,
            rgba(255,255,255,0.0)  6px,
            rgba(210,185,140,0.22) 12px,
            rgba(255,255,255,0.12) 18px,
            rgba(220,195,155,0.10) 24px,
            rgba(255,255,255,0.0)  30px
        ),
        linear-gradient(160deg, #d4c5a0 0%, #c5b48a 50%, #cec09a 100%);
    border-radius: 24px;
    padding: 10px 12px 8px;
    width: 100%;
    backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s, box-shadow 0.2s, outline-color 0.2s, outline-offset 0.2s;
    border: 3px solid #c9a55b;
    box-shadow: 0 8px 12px black;
    box-sizing: border-box;
}

/* Rebordo de turno: outline + sombra exterior (não altera tamanho/alinhamento da caixa) */
.player-card.active-turn {
    border-color: #ffd966;
    outline: 3px solid #ffb347;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(255, 179, 71, 0.45), 0 10px 20px black;
}

/* Bot sem jogada: pulsar caixa da mão (~1,5s) ao passar */
@keyframes botPassPulse {
    0%, 100% {
        box-shadow: 0 8px 12px rgba(0, 0, 0, 0.65);
        filter: brightness(1);
    }
    33% {
        box-shadow: 0 0 0 5px rgba(255, 210, 120, 0.65), 0 10px 22px rgba(0, 0, 0, 0.55);
        filter: brightness(1.06);
    }
    66% {
        box-shadow: 0 0 0 3px rgba(255, 230, 160, 0.45), 0 8px 14px rgba(0, 0, 0, 0.6);
        filter: brightness(1.03);
    }
}

.player-card.bot-pass-pulse {
    outline: 3px solid #ffb347;
    outline-offset: 8px;
}

/* .bot-thinking: border + pulse por .cor-* abaixo (cor atribuída no início do jogo) */

/* ===== CORES DE JOGADOR ===== */
/* Amarelo (padrão humano) */
.cor-amarelo .player-card       { border-color: #c9a55b; }
.cor-amarelo .player-card.active-turn {
    border-color: #ffd966;
    outline: 3px solid #ffb347;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(255, 179, 71, 0.45), 0 10px 20px black;
    animation: pulseTurnAmarelo 1s ease-in-out infinite;
}
.cor-amarelo .player-card.bot-thinking {
    border-color: #ffd966;
    animation: pulseTurnAmarelo 1s ease-in-out infinite;
}
.cor-amarelo .player-card.bot-pass-pulse {
    border-color: #ffd966;
    box-shadow: 0 0 0 4px rgba(255, 179, 71, 0.45), 0 10px 20px black;
    animation: pulseTurnAmarelo 1s ease-in-out infinite;
}
.cor-amarelo .treasure-card     { border-color: rgba(245,176,66,0.65); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,176,66,0.1); }
.cor-amarelo .slot.filled       { border-color: #d49a2a; box-shadow: 0 3px 10px rgba(245,176,66,0.5); }

/* Vermelho (Marujo) */
.cor-vermelho .player-card      { border-color: #8b2020; }
.cor-vermelho .player-card.active-turn {
    border-color: #ff4444;
    outline: 3px solid #cc2222;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(204, 34, 34, 0.45), 0 10px 20px black;
    animation: pulseTurnVermelho 1s ease-in-out infinite;
}
.cor-vermelho .player-card.bot-thinking {
    border-color: #ff4444;
    animation: pulseTurnVermelho 1s ease-in-out infinite;
}
.cor-vermelho .player-card.bot-pass-pulse {
    border-color: #ff4444;
    outline-color: #cc2222;
    box-shadow: 0 0 0 4px rgba(204, 34, 34, 0.45), 0 10px 20px black;
    animation: pulseTurnVermelho 1s ease-in-out infinite;
}
.cor-vermelho .treasure-card    { border-color: rgba(220,50,50,0.75); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(220,50,50,0.15); }
.cor-vermelho .slot.filled      { border-color: #cc2222; box-shadow: 0 3px 10px rgba(220,50,50,0.5); }

/* Azul */
.cor-azul .player-card          { border-color: #1a4a7a; }
.cor-azul .player-card.active-turn {
    border-color: #4a9edd;
    outline: 3px solid #1a6aaa;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(26, 106, 170, 0.45), 0 10px 20px black;
    animation: pulseTurnAzul 1s ease-in-out infinite;
}
.cor-azul .player-card.bot-thinking {
    border-color: #4a9edd;
    animation: pulseTurnAzul 1s ease-in-out infinite;
}
.cor-azul .player-card.bot-pass-pulse {
    border-color: #4a9edd;
    outline-color: #1a6aaa;
    box-shadow: 0 0 0 4px rgba(26, 106, 170, 0.45), 0 10px 20px black;
    animation: pulseTurnAzul 1s ease-in-out infinite;
}
.cor-azul .treasure-card        { border-color: rgba(74,158,221,0.75); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(74,158,221,0.15); }
.cor-azul .slot.filled          { border-color: #2a7ecc; box-shadow: 0 3px 10px rgba(74,158,221,0.5); }

/* ===== FLASHES DE EVENTO NAS CAIXAS DO JOGADOR ===== */

/* Flash azul — ganhou a rodada (2s) */
.treasure-card.flash-gain {
    animation: boxFlashGain 0.5s ease-in-out 4;
}

@keyframes boxFlashGain {
    0%   { outline: 4px solid transparent; outline-offset: 2px; }
    50%  { outline: 4px solid #3399ff;     outline-offset: 4px; box-shadow: 0 0 20px 6px #3399ff; }
    100% { outline: 4px solid transparent; outline-offset: 2px; }
}

/* Flash roxo — está a roubar (1.5s) */
.treasure-card.flash-robbed {
    animation: boxFlashRobbed 0.5s ease-in-out 4;
}

@keyframes boxFlashRobbed {
    0%   { outline: 4px solid transparent; outline-offset: 2px; }
    50%  { outline: 4px solid #b039e0;     outline-offset: 4px; box-shadow: 0 0 20px 6px #b039e0; }
    100% { outline: 4px solid transparent; outline-offset: 2px; }
}

/* Flash vermelho — está a ser roubado (1.5s) */
.treasure-card.flash-stolen {
    animation: boxFlashStolen 0.5s ease-in-out 4;
}

@keyframes boxFlashStolen {
    0%   { outline: 4px solid transparent; outline-offset: 2px; }
    50%  { outline: 4px solid #e03030;     outline-offset: 4px; box-shadow: 0 0 20px 6px #e03030; }
    100% { outline: 4px solid transparent; outline-offset: 2px; }
}

.player-name {
    font-size: 1.1rem;
    font-weight: bold;
    background: #000000aa;
    display: inline-block;
    padding: 3px 10px;
    border-radius: 30px;
    margin-bottom: 8px;
    color: #f9e0a0;
}

.badge-bot {
    background: #ff6b6b;
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
}

.hand-cards {
    display: grid;
    grid-template-columns: repeat(2, 84px);
    grid-template-rows: repeat(2, 116px);
    gap: 7px;
    justify-content: center;
    align-items: center;
    padding: 4px 2px;
    margin: 0 auto;
}

.card {
    background: transparent;
    width: 84px;
    height: 116px;
    border-radius: 12px;
    display: block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6);
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
    border: none;
    padding: 0;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    pointer-events: none;
}

.card:hover:not(.disabled) {
    transform: translateY(-8px) scale(1.04);
    box-shadow: 0 12px 24px rgba(0,0,0,0.7);
}

.card.card-cover {
    cursor: default;
    pointer-events: none;
    opacity: 1;
}

.card.disabled {
    cursor: not-allowed;
    pointer-events: none;
}

/* Cartas inválidas na nossa vez: aceitam clique para animação de “não podes jogar” */
.card.disabled.interactive-invalid {
    pointer-events: auto;
    cursor: pointer;
}

@keyframes cardShakeInvalid {
    0%, 100% { transform: translateX(0) rotate(0deg); }
    12% { transform: translateX(-7px) rotate(-2.5deg); }
    25% { transform: translateX(7px) rotate(2.5deg); }
    37% { transform: translateX(-5px) rotate(-1.5deg); }
    50% { transform: translateX(5px) rotate(1.5deg); }
    62% { transform: translateX(-3px) rotate(-0.8deg); }
    75% { transform: translateX(3px) rotate(0.8deg); }
    87% { transform: translateX(-1px) rotate(0deg); }
}

.card.shake-invalid {
    animation: cardShakeInvalid 0.42s ease-in-out both;
}

/* Cartas jogáveis: sem rebordo verde; destaque só no hover geral (.card:hover) */

.treasure-slots {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    justify-items: center;
    align-items: center;
}

.slot {
    background: #2a1e14;
    padding: 0;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: bold;
    width: 100%;
    aspect-ratio: 2/3;
    text-align: center;
    color: #5a4a3a;
    border: 1px solid #4a3020;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.slot.filled {
    background: transparent;
    border: 2px solid #d49a2a;
    box-shadow: 0 3px 10px rgba(245,176,66,0.5);
    overflow: hidden;
}

.slot-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* ==================== SEPARAÇÃO MÃO / TESOURO ==================== */

.hand-section {
    background:
        repeating-linear-gradient(
            92deg,
            transparent,
            transparent 2px,
            rgba(0,0,0,0.05) 2px,
            rgba(0,0,0,0.05) 4px
        ),
        linear-gradient(160deg, #5a3318 0%, #3d1f0c 60%, #4a2610 100%);
    border-radius: 20px;
    padding: 8px 10px;
    margin-bottom: 0;
}

.treasure-section {
    background: rgba(20, 10, 5, 0.55);
    border: 2px solid rgba(245, 176, 66, 0.6);
    border-radius: 20px;
    padding: 14px 12px;
    margin-top: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px rgba(245,176,66,0.15);
}

.section-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #c9a55b;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 8px;
    text-align: center;
}

/* ==================== BARALHO + DESCARTE VISUAL ==================== */

.deck-discard-area {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: center;
    transform: translate(-10px, -10px);
}

.deck-visual, .discard-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.deck-header {
    width: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 3px;
}

.mini-card-stack {
    width: 79px;
    height: 110px;
    background: #1a1210;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    transition: box-shadow 0.22s ease;
}

/* Pilha do descarte: mesmo “baralho” 2.5D que o baralho; vazio = invisível (sem rectângulo branco) */
.discard-stack-wrap {
    width: 79px;
    height: 110px;
    border-radius: 10px;
    position: relative;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
    background: transparent;
    transition: box-shadow 0.22s ease, opacity 0.22s ease;
}

.discard-stack-wrap.is-empty {
    opacity: 0;
    pointer-events: none;
    box-shadow: none !important;
}

.discard-stack-wrap:not(.is-empty) {
    opacity: 1;
}

.mini-card-face.mini-card-face-discard {
    width: 100%;
    height: 100%;
    box-shadow: none;
}

.mini-card-face {
    width: 79px;
    height: 110px;
    background: #fcf3da;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 300;
    font-family: monospace;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
    overflow: hidden;
    color: #8a7a5a;
}

.mini-card-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.deck-label {
    font-size: 0.6rem;
    color: #a0b890;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.deck-count {
    font-size: 0.6rem;
    font-weight: 600;
    color: #a0b890;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    line-height: 1;
}

button {
    background: #e0ac69;
    border: none;
    padding: 8px 12px;
    border-radius: 60px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 8px;
    font-size: 0.75rem;
    transition: 0.1s;
}

button:hover {
    background: #d49a4a;
    transform: scale(1.02);
}

.player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.player-header .pass-button,
.player-header .discard-button {
    margin-top: 0;
    padding: 3px 14px;
    font-size: 1.1rem;
    font-weight: bold;
    flex-shrink: 0;
    line-height: 1.4;
}

.log-panel-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(233,200,145,0.2);
    flex-shrink: 0;
}

.back-btn {
    background: #4a3a6a;
    color: #e8d8ff;
    padding: 8px 12px;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 0;
}

.back-btn:hover {
    background: #5a4a7a;
}

.reset-btn {
    background: #3a2a1a;
    color: #f9e0a0;
    padding: 8px 12px;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 0;
}

.reset-btn:hover {
    background: #4a3a2a;
}

/* log-area removido */

.pass-button {
    background: #c9772e;
    color: #1a0e00;
    padding: 6px 20px;
    font-size: 0.9rem;
}

.discard-button {
    background: #8b5a2b;
}

.hidden-hand-placeholder {
    background: #1a2a1a;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    color: #8aa88a;
    font-size: 0.85rem;
    border: 1px dashed #4a6a4a;
}

/* ==================== PAINEL DE CONTROLO LATERAL ==================== */

.game-log-panel {
    width: 110px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 32px;
    padding: 14px 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(233,200,145,0.2);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.log-panel-title { display: none; }

.log-panel-entries { display: none; }

.log-panel-entries::-webkit-scrollbar {
    width: 4px;
}

.log-panel-entries::-webkit-scrollbar-track {
    background: transparent;
}

.log-panel-entries::-webkit-scrollbar-thumb {
    background: rgba(233,200,145,0.3);
    border-radius: 4px;
}

.log-entry {
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 0.88rem;
    color: #d4c080;
    line-height: 1.4;
    border-left: 2px solid rgba(233,200,145,0.3);
    word-break: break-word;
}

.log-entry-vitoria {
    background: rgba(255, 215, 0, 0.18);
    border-left: 3px solid #ffd700;
    color: #ffe066;
    font-weight: 700;
}

.log-entry-tesouro {
    background: rgba(76, 175, 80, 0.15);
    border-left: 3px solid #4caf50;
    color: #a5d6a7;
}

.log-entry-roubo {
    background: rgba(156, 39, 176, 0.18);
    border-left: 3px solid #ce93d8;
    color: #ce93d8;
}

.log-entry-battle {
    background: rgba(74, 158, 221, 0.14);
    border-left: 3px solid #4a9edd;
    color: #a8d4ff;
}

/* ==================== MODAL DE VITÓRIA ==================== */

.winner-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.5s;
}

.winner-content {
    background: linear-gradient(145deg, #ffd700, #ff8c00);
    padding: 40px;
    border-radius: 60px;
    text-align: center;
    color: #1a472a;
    border: 5px solid gold;
    box-shadow: 0 0 50px rgba(255,215,0,0.5);
}

.winner-content h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.winner-content button {
    background: #1a472a;
    color: white;
    font-size: 1.2rem;
    padding: 12px 30px;
    margin-top: 20px;
}

/* ==================== MODAL DE DERROTA ==================== */

.defeat-content {
    background:
        linear-gradient(125deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0) 24%),
        radial-gradient(120% 90% at 8% 50%, rgba(255,255,255,0.1) 0%, rgba(255,255,255,0) 55%),
        repeating-linear-gradient(
            -12deg,
            rgba(255,255,255,0.03) 0px,
            rgba(255,255,255,0.03) 2px,
            rgba(0,0,0,0.04) 2px,
            rgba(0,0,0,0.04) 6px
        ),
        linear-gradient(140deg, #151515 0%, #0f0f0f 52%, #090909 100%) !important;
    border: 1px solid #050505 !important;
    box-shadow:
        0 0 45px rgba(0, 0, 0, 0.85),
        0 0 90px rgba(0, 0, 0, 0.55),
        inset 0 0 45px rgba(0,0,0,0.85) !important;
    color: #f0c8c8 !important;
    position: relative;
    overflow: visible;
    border-radius: 10px 12px 14px 12px !important;
    clip-path: polygon(0% 0%, 100% 0%, 100% 92%, 93% 95%, 96% 100%, 82% 96%, 70% 100%, 58% 96%, 45% 100%, 32% 95%, 20% 100%, 8% 96%, 0% 100%);
    transform: rotate(-0.5deg);
}

.defeat-content::before {
    content: "☠";
    position: absolute;
    top: 48%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-2deg);
    font-size: 5.8rem;
    color: rgba(232, 232, 232, 0.2);
    text-shadow: 0 0 10px rgba(0,0,0,0.9);
    pointer-events: none;
}

.defeat-content::after {
    content: "";
    position: absolute;
    inset: -4px;
    background:
        radial-gradient(circle at 10% 97%, rgba(0,0,0,0.9) 0 8px, transparent 10px),
        radial-gradient(circle at 31% 98%, rgba(0,0,0,0.92) 0 7px, transparent 9px),
        radial-gradient(circle at 54% 97%, rgba(0,0,0,0.9) 0 9px, transparent 11px),
        radial-gradient(circle at 78% 98%, rgba(0,0,0,0.9) 0 7px, transparent 9px);
    pointer-events: none;
}

.defeat-title {
    font-size: 3rem;
    font-weight: 900;
    color: #cc2222;
    letter-spacing: 6px;
    text-shadow: 0 0 20px rgba(204,34,34,0.7), 0 2px 4px rgba(0,0,0,0.8);
    margin: 0 0 12px;
}

.defeat-subtitle {
    font-size: 1.2rem;
    color: #e8a0a0;
    font-weight: 600;
    margin: 0 0 8px;
}

.defeat-msg {
    font-size: 0.95rem;
    color: #a06060;
    font-style: italic;
    margin: 0 0 24px;
}

.defeat-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.defeat-btn-retry {
    background: linear-gradient(135deg, #1565c0, #0d47a1) !important;
    color: white !important;
    font-size: 1.1rem !important;
    padding: 14px 28px !important;
    border-radius: 60px !important;
    box-shadow: 0 6px 20px rgba(21,101,192,0.5) !important;
    margin-top: 0 !important;
    letter-spacing: 0.5px;
}

.defeat-btn-retry:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0) !important;
    transform: translateY(-2px) scale(1.03) !important;
}

.defeat-btn-menu {
    background: linear-gradient(135deg, #3a2a1a, #2a1a0a) !important;
    color: #f9e0a0 !important;
    font-size: 1.1rem !important;
    padding: 14px 28px !important;
    border-radius: 60px !important;
    margin-top: 0 !important;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ==================== SLOT VAZIO NA MÃO ==================== */

.card-empty-slot {
    width: 90px;
    height: 124px;
    border-radius: 12px;
    border: none;
    background: rgba(0,0,0,0.15);
    flex-shrink: 0;
}

/* ==================== MODAL DE INSTRUÇÕES ==================== */

.instrucoes-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.88);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px 0;
    overflow-y: auto;
    /* Acima do menu Pausa (.pause-modal 20000); o overlay do tutorial (.tutorial-overlay) mantém-se por baixo da pausa */
    z-index: 21000;
    animation: fadeIn 0.3s;
    box-sizing: border-box;
}

.instrucoes-content {
    background: linear-gradient(165deg, #f5ebd8, #e8d9bc);
    border: 2px solid rgba(90, 70, 45, 0.35);
    border-radius: 36px;
    padding: 40px 44px;
    max-width: 520px;
    width: 90%;
    color: #1a1208;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55);
    margin: auto;
    flex-shrink: 0;
}

.instrucoes-content h2 {
    font-size: 1.6rem;
    font-weight: 800;
    color: #2a1a0a;
    margin: 0 0 16px;
    text-align: center;
    letter-spacing: 1px;
}

.instrucoes-content .about-us-body {
    font-size: 1.05rem;
    line-height: 1.55;
    margin: 0 0 24px;
    text-align: center;
    color: #1a1208;
}

/* ---- Tabs ---- */
.instrucoes-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.instrucoes-content .instrucoes-tabs .instrucoes-tab {
    flex: 1;
    background: linear-gradient(135deg, #4a3a2a, #2a1a0a);
    color: #f9e0a0;
    border: 1px solid rgba(201, 165, 91, 0.55);
    border-radius: 14px;
    margin-bottom: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 10px 12px;
    cursor: pointer;
    transition: color 0.2s, box-shadow 0.2s, transform 0.15s, border-color 0.2s;
    box-shadow: 0 5px 16px rgba(201, 165, 91, 0.42);
}

.instrucoes-content .instrucoes-tabs .instrucoes-tab:hover {
    color: #ffd966;
    box-shadow: 0 7px 20px rgba(255, 215, 102, 0.48);
    transform: translateY(-1px);
}

.instrucoes-content .instrucoes-tabs .instrucoes-tab.active {
    color: #ffd966;
    border-color: rgba(255, 215, 102, 0.75);
    box-shadow: 0 8px 22px rgba(255, 215, 102, 0.55);
}

.instrucoes-content ul {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.instrucoes-content ul li {
    font-size: 0.92rem;
    line-height: 1.5;
    padding: 8px 14px;
    background: rgba(255,255,255,0.55);
    border-radius: 12px;
    border-left: 3px solid rgba(90, 70, 45, 0.45);
    color: #1a1208;
}

.instrucoes-content ul li > p {
    margin: 0 0 0.55em;
}

.instrucoes-content ul li > p:last-child {
    margin-bottom: 0;
}

.instrucoes-content ul li > p.instructions-battle-intro {
    margin-bottom: 0.85em;
    font-weight: 600;
}

.instrucoes-content ul li strong {
    color: #000;
}

.instrucoes-btn-voltar {
    background: linear-gradient(135deg, #b72c2c, #7d1717) !important;
    color: #ffe2d8 !important;
    font-size: 1rem !important;
    font-weight: 700 !important;
    padding: 12px 32px !important;
    border-radius: 60px !important;
    display: block !important;
    margin: 12px auto 0 !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 6px 18px rgba(183, 44, 44, 0.45) !important;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s !important;
}

.instrucoes-btn-voltar:hover {
    background: linear-gradient(135deg, #d03a32, #961f1f) !important;
    box-shadow: 0 9px 24px rgba(183, 44, 44, 0.55) !important;
    transform: translateY(-2px);
}

/* ==================== BOTÃO INSTRUÇÕES ==================== */

.menu-btn-instrucoes {
    background: linear-gradient(135deg, #eadbbf, #cdb58b) !important;
    box-shadow: 0 6px 20px rgba(120, 90, 55, 0.35) !important;
}

.menu-btn-instrucoes:hover {
    background: linear-gradient(135deg, #f2e5cc, #d9c399) !important;
    box-shadow: 0 10px 28px rgba(120, 90, 55, 0.45) !important;
}

.menu-btn-instrucoes .menu-btn-label {
    color: #2f2414;
}

.menu-btn-about {
    background: linear-gradient(135deg, #eadbbf, #cdb58b) !important;
    box-shadow: 0 6px 20px rgba(120, 90, 55, 0.35) !important;
}

.menu-btn-about:hover {
    background: linear-gradient(135deg, #f2e5cc, #d9c399) !important;
    box-shadow: 0 10px 28px rgba(120, 90, 55, 0.45) !important;
}

.menu-btn-about .menu-btn-label {
    color: #2f2414;
}

.menu-btn-jogar {
    background: linear-gradient(135deg, #ffd76a, #c98f22) !important;
    box-shadow: 0 6px 20px rgba(255, 190, 64, 0.42) !important;
    font-size: 1.2rem;
}

.menu-btn-jogar:hover {
    background: linear-gradient(135deg, #ffe38c, #d99c2f) !important;
    box-shadow: 0 10px 28px rgba(255, 190, 64, 0.58) !important;
}

.menu-btn-jogar .menu-btn-label {
    color: #2a1700;
}

.menu-btn-back {
    background: linear-gradient(135deg, #b72c2c, #7d1717) !important;
    box-shadow: 0 6px 18px rgba(183, 44, 44, 0.42) !important;
    order: 99;
    margin-top: 8px;
}

.menu-btn-back:hover {
    background: linear-gradient(135deg, #d03a32, #961f1f) !important;
    box-shadow: 0 9px 22px rgba(183, 44, 44, 0.52) !important;
}

.menu-btn-back .menu-btn-label {
    color: #ffe2d8;
}

.menu-btn-mode-classic {
    background: linear-gradient(135deg, #eadbbf, #cdb58b) !important;
    box-shadow: 0 6px 20px rgba(120, 90, 55, 0.35) !important;
}

.menu-btn-mode-classic:hover {
    background: linear-gradient(135deg, #f2e5cc, #d9c399) !important;
    box-shadow: 0 10px 28px rgba(120, 90, 55, 0.45) !important;
}

.menu-btn-mode-classic .menu-btn-label {
    color: #2f2414;
}

.menu-btn-mode-battle,
.menu-btn-mode-vs {
    background: linear-gradient(135deg, #ffd76a, #c98f22) !important;
    box-shadow: 0 6px 20px rgba(255, 190, 64, 0.42) !important;
}

.menu-btn-mode-battle:hover,
.menu-btn-mode-vs:hover {
    background: linear-gradient(135deg, #ffe38c, #d99c2f) !important;
    box-shadow: 0 10px 28px rgba(255, 190, 64, 0.58) !important;
}

.menu-btn-mode-battle .menu-btn-label,
.menu-btn-mode-vs .menu-btn-label {
    color: #2a1700;
}

.menu-selected-mode-title {
    margin-top: 6px;
    margin-bottom: 0;
}

/* Green player color */
.cor-verde .player-card { border-color: #2a7a38; }
.cor-verde .player-card.active-turn {
    border-color: #3cb84a;
    outline: 3px solid #2a9438;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(42, 148, 56, 0.45), 0 10px 20px black;
    animation: pulseTurnVerde 1s ease-in-out infinite;
}
.cor-verde .player-card.bot-thinking {
    border-color: #3cb84a;
    animation: pulseTurnVerde 1s ease-in-out infinite;
}
.cor-verde .player-card.bot-pass-pulse {
    border-color: #3cb84a;
    outline-color: #2a9438;
    box-shadow: 0 0 0 4px rgba(42, 148, 56, 0.45), 0 10px 20px black;
    animation: pulseTurnVerde 1s ease-in-out infinite;
}
.cor-verde .treasure-card { border-color: rgba(60,184,74,0.75); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(60,184,74,0.15); }
.cor-verde .slot.filled { border-color: #2a9438; box-shadow: 0 3px 10px rgba(60,184,74,0.5); }

/* Rosa */
.cor-rosa .player-card { border-color: #ad1457; }
.cor-rosa .player-card.active-turn {
    border-color: #f472b6;
    outline: 3px solid #ec407a;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(236, 64, 122, 0.45), 0 10px 20px black;
    animation: pulseTurnRosa 1s ease-in-out infinite;
}
.cor-rosa .player-card.bot-thinking {
    border-color: #f472b6;
    animation: pulseTurnRosa 1s ease-in-out infinite;
}
.cor-rosa .player-card.bot-pass-pulse {
    border-color: #f472b6;
    outline-color: #ec407a;
    box-shadow: 0 0 0 4px rgba(236, 64, 122, 0.45), 0 10px 20px black;
    animation: pulseTurnRosa 1s ease-in-out infinite;
}
.cor-rosa .treasure-card { border-color: rgba(244,114,182,0.8); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(244,114,182,0.2); }
.cor-rosa .slot.filled { border-color: #e91e8c; box-shadow: 0 3px 10px rgba(233,30,140,0.45); }

/* Branco (rebordo escuro para contraste no fundo escuro) */
.cor-branco .player-card { border-color: #78909c; }
.cor-branco .player-card.active-turn {
    border-color: #eceff1;
    outline: 3px solid #b0bec5;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(176, 190, 197, 0.5), 0 10px 20px black;
    animation: pulseTurnBranco 1s ease-in-out infinite;
}
.cor-branco .player-card.bot-thinking {
    border-color: #cfd8dc;
    animation: pulseTurnBranco 1s ease-in-out infinite;
}
.cor-branco .player-card.bot-pass-pulse {
    border-color: #cfd8dc;
    outline-color: #b0bec5;
    box-shadow: 0 0 0 4px rgba(176, 190, 197, 0.5), 0 10px 20px black;
    animation: pulseTurnBranco 1s ease-in-out infinite;
}
.cor-branco .treasure-card { border-color: rgba(207,216,220,0.9); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(207,216,220,0.25); }
.cor-branco .slot.filled { border-color: #90a4ae; box-shadow: 0 3px 10px rgba(144,164,174,0.55); }

/* Laranja (equipa) */
.cor-laranja .player-card { border-color: #e65100; }
.cor-laranja .player-card.active-turn {
    border-color: #ff9800;
    outline: 3px solid #f57c00;
    outline-offset: 8px;
    box-shadow: 0 0 0 4px rgba(245, 124, 0, 0.45), 0 10px 20px black;
    animation: pulseTurnLaranja 1s ease-in-out infinite;
}
.cor-laranja .player-card.bot-thinking {
    border-color: #ffa726;
    animation: pulseTurnLaranja 1s ease-in-out infinite;
}
.cor-laranja .player-card.bot-pass-pulse {
    border-color: #ffa726;
    outline-color: #f57c00;
    box-shadow: 0 0 0 4px rgba(245, 124, 0, 0.45), 0 10px 20px black;
    animation: pulseTurnLaranja 1s ease-in-out infinite;
}
.cor-laranja .treasure-card { border-color: rgba(255,152,0,0.85); box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,152,0,0.2); }
.cor-laranja .slot.filled { border-color: #fb8c00; box-shadow: 0 3px 10px rgba(251,140,0,0.5); }

@keyframes pulseTurnAmarelo {
    0%   { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0.75); }
    70%  { box-shadow: 0 0 0 18px rgba(255, 179, 71, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 179, 71, 0); }
}
@keyframes pulseTurnVermelho {
    0%   { box-shadow: 0 0 0 0 rgba(204, 34, 34, 0.75); }
    70%  { box-shadow: 0 0 0 18px rgba(204, 34, 34, 0); }
    100% { box-shadow: 0 0 0 0 rgba(204, 34, 34, 0); }
}
@keyframes pulseTurnAzul {
    0%   { box-shadow: 0 0 0 0 rgba(74, 158, 221, 0.75); }
    70%  { box-shadow: 0 0 0 18px rgba(74, 158, 221, 0); }
    100% { box-shadow: 0 0 0 0 rgba(74, 158, 221, 0); }
}
@keyframes pulseTurnVerde {
    0%   { box-shadow: 0 0 0 0 rgba(60, 184, 74, 0.75); }
    70%  { box-shadow: 0 0 0 18px rgba(60, 184, 74, 0); }
    100% { box-shadow: 0 0 0 0 rgba(60, 184, 74, 0); }
}
@keyframes pulseTurnRosa {
    0%   { box-shadow: 0 0 0 0 rgba(236, 64, 122, 0.75); }
    70%  { box-shadow: 0 0 0 18px rgba(236, 64, 122, 0); }
    100% { box-shadow: 0 0 0 0 rgba(236, 64, 122, 0); }
}
@keyframes pulseTurnBranco {
    0%   { box-shadow: 0 0 0 0 rgba(176, 190, 197, 0.75); }
    70%  { box-shadow: 0 0 0 18px rgba(176, 190, 197, 0); }
    100% { box-shadow: 0 0 0 0 rgba(176, 190, 197, 0); }
}
@keyframes pulseTurnLaranja {
    0%   { box-shadow: 0 0 0 0 rgba(245, 124, 0, 0.75); }
    70%  { box-shadow: 0 0 0 18px rgba(245, 124, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(245, 124, 0, 0); }
}

/* ==================== BOTÃO PAUSA ==================== */

.pause-btn {
    background: linear-gradient(135deg, #4a3a6a, #2d1f4a) !important;
    color: #e8d8ff !important;
    padding: 8px 12px;
    font-size: 0.8rem;
    width: 100%;
    margin-top: 0;
}

.pause-btn:hover {
    background: linear-gradient(135deg, #5a4a7a, #3a2a5a) !important;
}

/* ==================== MODAL DE PAUSA ==================== */

.pause-modal {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 20000;
    animation: fadeIn 0.25s ease;
    backdrop-filter: blur(6px);
    padding: 20px;
    box-sizing: border-box;
}

/* No tutorial: fundo mais transparente para a caixa do tutorial ficar visível por trás. */
.pause-modal.pause-tutorial-mode {
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}

.pause-content {
    background: linear-gradient(160deg, #1a0f05 0%, #120a02 60%, #1e1208 100%);
    border: 2px solid rgba(233, 200, 145, 0.35);
    border-radius: 40px;
    padding: 36px 40px;
    max-width: 480px;
    width: 100%;
    color: #f0e6a0;
    box-shadow: 0 30px 80px rgba(0,0,0,0.8), 0 0 0 1px rgba(233,200,145,0.1);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.pause-language-box {
    position: relative;
    background: #120a02;
    border: 1px solid rgba(233, 200, 145, 0.25);
    border-radius: 999px;
    padding: 4px;
    z-index: 25;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pause-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 22px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(233,200,145,0.2);
}

.pause-content::-webkit-scrollbar { width: 4px; }
.pause-content::-webkit-scrollbar-track { background: transparent; }
.pause-content::-webkit-scrollbar-thumb { background: rgba(233,200,145,0.3); border-radius: 4px; }

.pause-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: #f9e0a0;
    text-align: left;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Pontuações */
.pause-scores {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.pause-scores-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #c9a55b;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.pause-score-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 10px 14px;
    border: 1px solid rgba(233,200,145,0.12);
}

.pause-score-color {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(255,255,255,0.3);
}

.pause-score-name {
    flex: 0 0 auto;
    font-size: 0.95rem;
    font-weight: 700;
    color: #f0e6a0;
}

.pause-score-badge {
    font-size: 0.78rem;
    font-weight: 600;
    color: #999;
    background: rgba(0,0,0,0.3);
    padding: 2px 8px;
    border-radius: 20px;
    margin-right: 4px;
}

.pause-score-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #ffd966;
    min-width: 52px;
    text-align: right;
}

.pause-score-bar-wrap {
    flex: 1;
    height: 5px;
    background: rgba(255,255,255,0.1);
    border-radius: 99px;
    margin-top: 0;
    overflow: hidden;
}

.pause-score-bar {
    height: 100%;
    border-radius: 99px;
    transition: width 0.5s ease;
}

/* Volume */
.pause-section {
    margin-bottom: 22px;
}

.pause-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    color: #c9a55b;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.pause-section-note {
    color: rgba(240,230,160,0.75);
    font-size: 0.88rem;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(233,200,145,0.14);
    border-radius: 10px;
    padding: 10px 12px;
}

.pause-volume-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pause-volume-subtitle {
    font-size: 0.58rem;
    font-weight: 700;
    color: rgba(201, 165, 91, 0.95);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    margin: 0 0 -4px 0;
    padding-left: 2px;
}

.pause-volume-row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.05);
    border-radius: 14px;
    padding: 12px 16px;
    border: 1px solid rgba(233,200,145,0.12);
}

.pause-volume-icon {
    font-size: 0.68rem;
    font-weight: 700;
    color: #c9a55b;
    flex-shrink: 0;
    min-width: 40px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s, color 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pause-volume-icon:hover { transform: scale(1.05); color: #f9e0a0; }

.pause-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 5px;
    border-radius: 99px;
    background: linear-gradient(to right, #c9a55b 0%, #c9a55b var(--val, 80%), rgba(255,255,255,0.15) var(--val, 80%));
    outline: none;
    cursor: pointer;
}

.pause-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f9e0a0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    transition: transform 0.15s;
}

.pause-volume-slider::-webkit-slider-thumb:hover { transform: scale(1.2); }

.pause-volume-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #c9a55b;
    min-width: 36px;
    text-align: right;
}

/* Histórico no pause */
.pause-log-entries {
    max-height: 160px;
    min-height: 78px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: rgba(0,0,0,0.2);
    border-radius: 14px;
    padding: 10px;
    border: 1px solid rgba(233,200,145,0.1);
}

.pause-log-entries::-webkit-scrollbar { width: 4px; }
.pause-log-entries::-webkit-scrollbar-track { background: transparent; }
.pause-log-entries::-webkit-scrollbar-thumb { background: rgba(233,200,145,0.3); border-radius: 4px; }

/* Botões do pause */
.pause-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(233,200,145,0.2);
}

.pause-btn-retomar {
    background: linear-gradient(135deg, #ffd76a, #c98f22) !important;
    color: #2a1700 !important;
    font-size: 1.12rem !important;
    padding: 18px 34px !important;
    border-radius: 60px !important;
    width: 100% !important;
    max-width: 340px;
    margin-top: 0 !important;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-shadow: 0 8px 24px rgba(255, 190, 64, 0.4) !important;
}

.pause-btn-retomar:hover {
    background: linear-gradient(135deg, #ffe38c, #d99c2f) !important;
    box-shadow: 0 12px 30px rgba(255, 190, 64, 0.58) !important;
}

.pause-secondary-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.pause-secondary-bottom-row {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.pause-info-btn {
    width: 28px;
    height: 28px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(249, 224, 160, 0.14) !important;
    color: #f9e0a0 !important;
    border: 1px solid rgba(249, 224, 160, 0.45) !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem !important;
    font-weight: 900 !important;
    line-height: 1;
    flex-shrink: 0;
    box-shadow: none !important;
}

.pause-info-btn:hover {
    background: rgba(249, 224, 160, 0.26) !important;
    transform: scale(1.06);
}

.lang-globe {
    font-size: 0.82rem;
    line-height: 1;
}

.pause-btn-reiniciar {
    background: linear-gradient(135deg, #eadbbf, #cdb58b) !important;
    color: #2f2414 !important;
    font-size: 0.9rem !important;
    padding: 12px 24px !important;
    border-radius: 60px !important;
    width: 100% !important;
    margin-top: 0 !important;
}

.pause-btn-reiniciar:hover {
    background: linear-gradient(135deg, #f2e5cc, #d9c399) !important;
}

.pause-btn-opcoes {
    background: linear-gradient(135deg, #eadbbf, #cdb58b) !important;
    color: #2f2414 !important;
    font-size: 0.9rem !important;
    padding: 12px 24px !important;
    border-radius: 60px !important;
    width: 100% !important;
    margin-top: 0 !important;
}

.pause-btn-opcoes:hover {
    background: linear-gradient(135deg, #f2e5cc, #d9c399) !important;
}

.pause-btn-about {
    background: linear-gradient(135deg, #eadbbf, #cdb58b) !important;
    color: #2f2414 !important;
    font-size: 0.9rem !important;
    padding: 12px 24px !important;
    border-radius: 60px !important;
    width: 100% !important;
    margin-top: 0 !important;
    border: none;
    cursor: pointer;
}

.pause-btn-about:hover {
    background: linear-gradient(135deg, #f2e5cc, #d9c399) !important;
}

.pause-options-extra-actions {
    gap: 10px;
}

.pause-btn-menu {
    background: linear-gradient(135deg, #b72c2c, #7d1717) !important;
    color: #ffe2d8 !important;
    font-size: 0.9rem !important;
    padding: 12px 24px !important;
    border-radius: 60px !important;
    width: 100% !important;
    margin-top: 0 !important;
}

.pause-btn-menu:hover {
    background: linear-gradient(135deg, #d03a32, #961f1f) !important;
}

.pause-options-content {
    max-width: 440px;
}

/* ==================== EFEITO LANTERNA (ILUMINAÇÃO DINÂMICA) ==================== */

/* Lantern scene canvas — sits behind everything */
#lanternScene {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

/* Conteúdo e rodapé acima do canvas (z-index 0). Modais fullscreen têm z-index alto nas próprias regras. */
.menu-screen,
.game-screen {
    position: relative;
    z-index: 1;
}

/* ==================== ABANÃO DE ERRO (SHAKE) ==================== */

@keyframes cardShake {
    0%   { transform: translateX(0); }
    15%  { transform: translateX(-7px) rotate(-3deg); }
    30%  { transform: translateX(7px)  rotate(3deg); }
    45%  { transform: translateX(-5px) rotate(-2deg); }
    60%  { transform: translateX(5px)  rotate(2deg); }
    75%  { transform: translateX(-3px); }
    90%  { transform: translateX(3px); }
    100% { transform: translateX(0); }
}

.card-shake {
    animation: cardShake 0.42s ease-in-out !important;
}

/* ==================== BALÕES DE FALA DOS BOTS ==================== */

.speech-bubble {
    position: fixed;
    transform: translateY(-50%) scale(1);
    transform-origin: left center;
    --bubble-accent: #c9a55b;
    --bubble-fill: #fef9ed;
    background: var(--bubble-fill);
    border: 2px solid var(--bubble-accent);
    border-radius: 18px;
    padding: 0;
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.9) inset,
        0 8px 28px rgba(20, 10, 5, 0.22),
        0 2px 8px rgba(0, 0, 0, 0.12);
    opacity: 1;
    transition: opacity 0.35s ease, transform 0.35s ease;
    animation: bubblePop 0.32s cubic-bezier(.34, 1.56, .64, 1);
    z-index: 9000;
    pointer-events: none;
}

/* Rabo do balão (aponta para o nome do bot à esquerda) */
.speech-bubble::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 12px 10px 0;
    border-color: transparent var(--bubble-accent) transparent transparent;
}

.speech-bubble::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 8px 9px 8px 0;
    border-color: transparent var(--bubble-fill) transparent transparent;
}

.speech-bubble-text {
    padding: 10px 16px;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.38;
    color: #2a1a0e;
    text-align: center;
    max-width: min(280px, 86vw);
    white-space: normal;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.35);
}

@keyframes bubblePop {
    0% {
        opacity: 0;
        transform: translateY(-50%) scale(0.86);
    }
    100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

/* ==================== PARTÍCULAS DE OURO ==================== */

.gold-particle {
    /* Base styles set inline via JS */
    border-radius: 50%;
    pointer-events: none;
}



@media (max-width: 900px) {
    .game-wrapper {
        flex-direction: column;
    }

    .game-log-panel {
        width: 100%;
        position: static;
        flex-direction: row;
        padding: 10px 14px;
    }

    .log-panel-controls {
        flex-direction: row;
        border-top: none;
        padding-top: 0;
        width: 100%;
    }

    .round-history {
        min-width: 0;
        order: 2;
        width: 100%;
    }
    .discard-pile { order: 3; }
    .center-panel {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .history-card {
        font-size: 1rem;
        padding: 5px 10px;
    }
}

@media (max-width: 780px) {
    .card { width: 70px; height: 96px; }
    .history-card { width: 72px; height: 100px; }
    .history-cards { min-height: 100px; height: 100px; }
    .mini-card-stack,
    .mini-card-face,
    .discard-stack-wrap { width: 58px; height: 82px; }
    .hand-cards {
        grid-template-columns: repeat(2, 70px);
        grid-template-rows: repeat(2, 96px);
    }
    .card-empty-slot { width: 70px; height: 96px; }
    .player-area-group { min-width: 200px; }
    .menu-card { padding: 40px 28px; }
    .menu-title { font-size: 1.8rem; }
}

/* ==================== TESOURO INDEPENDENTE ==================== */

.players-area {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 14px;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
}

.players-area.layout-vs3 .player-area-group {
    flex: 0 0 clamp(230px, calc((100% - 10px) / 2), 320px);
    width: clamp(230px, calc((100% - 10px) / 2), 320px);
    min-width: clamp(230px, calc((100% - 10px) / 2), 320px);
    max-width: clamp(230px, calc((100% - 10px) / 2), 320px);
}

.player-area-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
    flex: 1;
    min-width: 260px;
    max-width: 420px;
}

@media (max-width: 980px) {
    .players-area.layout-vs3 {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
        overflow: visible;
        padding: 0;
    }

    .players-area.layout-vs3 .player-area-group {
        flex: 0 0 clamp(205px, calc((100% - 10px) / 2), 260px);
        width: clamp(205px, calc((100% - 10px) / 2), 260px);
        min-width: clamp(205px, calc((100% - 10px) / 2), 260px);
        max-width: clamp(205px, calc((100% - 10px) / 2), 260px);
    }
}

.treasure-card {
    background: rgba(20, 10, 5, 0.7);
    border: 2px solid rgba(245, 176, 66, 0.65);
    border-radius: 24px;
    padding: 12px;
    width: 100%;
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,176,66,0.1);
    backdrop-filter: blur(4px);
    box-sizing: border-box;
}

.treasure-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.treasure-count {
    font-size: 0.65rem;
    font-weight: 700;
    color: #f9e0a0;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    white-space: nowrap;
}

.treasure-card-name {
    font-size: 0.7rem;
    font-weight: 700;
    color: #c9a55b;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    opacity: 0.9;
}


/* ==================== ANIMAÇÕES DE CARTA VOADORA ==================== */

.anim-flying-card {
    border-radius: 12px;
    overflow: hidden;
    pointer-events: none;
    backface-visibility: hidden;
}

/* Animação de embaralhar no baralho */
@keyframes deckShuffleWiggle {
    0%   { transform: rotate(0deg) scale(1); }
    20%  { transform: rotate(-6deg) scale(1.04); }
    40%  { transform: rotate(5deg) scale(1.03); }
    60%  { transform: rotate(-4deg) scale(1.05); }
    80%  { transform: rotate(3deg) scale(1.02); }
    100% { transform: rotate(0deg) scale(1); }
}

.deck-shuffling .mini-card-stack {
    animation: deckShuffleWiggle 0.55s ease-in-out;
}

/* ==================== REFACTOR: CLASSES UTILITÁRIAS/UI ==================== */

.is-hidden {
    display: none;
}

.menu-logo-cover {
    width: 110px;
    height: 150px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(0,0,0,0.45);
    display: block;
    margin: 0 auto;
}

.menu-options-panel {
    align-items: stretch;
    gap: 14px;
}

.menu-options-heading {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c9a55b;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    text-align: center;
    width: 100%;
}

.menu-options-volume-block {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
}

.menu-options-volume-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #c9a55b;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: left;
    margin: 0;
    padding-left: 2px;
}

.menu-options-volume-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(233, 200, 145, 0.12);
    flex-shrink: 0;
}

.menu-volume-toggle {
    background: rgba(10, 6, 3, 0.78);
    border: 1px solid rgba(233, 200, 145, 0.25);
    border-radius: 10px;
    padding: 6px 10px;
    font-size: 1rem;
    cursor: pointer;
    color: #f0e6a0;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
}

.menu-volume-toggle:hover {
    background: rgba(255, 255, 255, 0.14);
}

.menu-volume-slider-h {
    flex: 1;
    min-width: 0;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 99px;
    background: linear-gradient(to right, #c9a55b 0%, #c9a55b var(--val, 80%), rgba(255,255,255,0.15) var(--val, 80%));
    outline: none;
    cursor: pointer;
}

.menu-volume-slider-h::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f9e0a0;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.menu-volume-slider-h::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f9e0a0;
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.5);
    cursor: pointer;
}

.menu-volume-value-h {
    font-size: 0.75rem;
    font-weight: 700;
    color: #c9a55b;
    min-width: 40px;
    text-align: right;
    flex-shrink: 0;
}

.menu-color-amarelo { background: #ffd966; }
.menu-color-vermelho { background: #cc2222; }
.menu-color-azul { background: #4a9edd; }
.menu-color-verde { background: #3cb84a; }
.menu-color-rosa { background: linear-gradient(145deg, #f48fb1, #ec407a); }
.menu-color-branco {
    background: #eceff1;
    border: 2px solid #90a4ae !important;
    box-sizing: border-box;
}
.menu-color-laranja { background: linear-gradient(145deg, #ffa726, #ef6c00); }

/* Por cima do `button:hover` global (laranja); manter a cor de cada equipa ao pairar */
.menu-color-btn.menu-color-amarelo:hover { background: #ffd966; }
.menu-color-btn.menu-color-vermelho:hover { background: #cc2222; }
.menu-color-btn.menu-color-azul:hover { background: #4a9edd; }
.menu-color-btn.menu-color-verde:hover { background: #3cb84a; }
.menu-color-btn.menu-color-rosa:hover { background: linear-gradient(145deg, #f48fb1, #ec407a); }
.menu-color-btn.menu-color-branco:hover { background: #dde4ea; }
.menu-color-btn.menu-color-laranja:hover { background: linear-gradient(145deg, #ffa726, #ef6c00); }

.mini-card-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    display: block;
}

.pause-score-main {
    flex: 1;
}

.pause-score-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 0;
}

.pause-score-row .pause-score-color {
    background: var(--score-color, #c9a55b);
}

.language-list-pause {
    background: #1b1006;
    border-radius: 10px;
    padding: 6px;
    border: 1px solid rgba(233, 200, 145, 0.12);
}

.language-list-menu,
.language-list-pause {
    position: absolute;
    left: auto;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    min-width: 52px;
}

.pause-score-row .pause-score-value {
    color: var(--score-color, #c9a55b);
}

.pause-score-row .pause-score-bar {
    width: var(--score-width, 0%);
    background: var(--score-color, #c9a55b);
}

.winner-message {
    font-size: 1.2rem;
}

.winner-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.winner-menu-button {
    background: #4a3a6a !important;
    color: #e8d8ff !important;
}

.pirata-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.pirata-dialog {
    padding: 30px;
    border-radius: 30px;
    text-align: center;
    color: #3e2723;
    background: linear-gradient(165deg, #f5e9dc 0%, #e8dcc8 45%, #dccfb8 100%);
    box-shadow: 0 18px 48px rgba(40, 22, 12, 0.35);
}

.pirata-dialog h2 {
    color: #3e2723;
}

.pirata-dialog-info {
    background: linear-gradient(165deg, #f5e9dc 0%, #e8dcc8 45%, #dccfb8 100%);
    border: 6px solid #7b1fa2;
    box-shadow:
        0 0 0 1px rgba(186, 104, 200, 0.35),
        0 0 22px rgba(123, 31, 162, 0.55),
        0 18px 48px rgba(40, 22, 12, 0.35);
    min-width: 320px;
    max-width: 400px;
}

.pirata-dialog-roubo {
    background: linear-gradient(165deg, #f5e9dc 0%, #e8dcc8 45%, #dccfb8 100%);
    border: 6px solid #000;
    min-width: 350px;
}

.battle-power-toast-layer {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 12000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.battle-power-toast {
    background: rgba(18, 10, 6, 0.9);
    color: #f8e7bf;
    border: 1px solid rgba(255, 210, 120, 0.45);
    border-radius: 12px;
    padding: 8px 14px;
    font-size: 0.92rem;
    font-weight: 700;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.22s ease, transform 0.22s ease;
}

.battle-power-toast.is-hiding {
    opacity: 0;
    transform: translateY(-4px);
}

.pirata-subtext {
    color: #5d4037;
}

.pirata-subtext-warning {
    color: #bf360c;
}

.pirata-button {
    border: none;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    padding: 10px 24px;
}

.pirata-button-neutral {
    background: #666;
}

.pirata-button-voltar {
    background: linear-gradient(135deg, #b72c2c, #7d1717);
    color: #ffe2d8;
    box-shadow: 0 4px 14px rgba(183, 44, 44, 0.45);
}

.pirata-button-voltar:hover {
    background: linear-gradient(135deg, #d03a32, #961f1f);
}

.pirata-button-spaced {
    margin-top: 16px;
}

.pirata-button-up {
    background: linear-gradient(180deg, #e8c547 0%, #c9a227 50%, #b8860b 100%);
    color: #4e342e;
    padding: 12px 25px;
    border: 2px solid #a67c00;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.pirata-button-up:hover {
    filter: brightness(1.06);
}

.pirata-button-down {
    background: linear-gradient(180deg, #6d4c41 0%, #5d4037 55%, #4e342e 100%);
    color: #e8c547;
    padding: 12px 25px;
    border: 2px solid #3e2723;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.pirata-button-down:hover {
    filter: brightness(1.08);
}

.pirata-choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 8px;
    justify-items: center;
    margin: 12px 0 8px;
}

.pirata-select-targets {
    margin-top: 10px;
    text-align: left;
}

.pirata-select-targets-empty {
    opacity: 0.8;
}

.pirata-targets-hint {
    margin: 4px 0 0;
    font-size: 0.85rem;
}

.pirata-targets-title {
    margin: 4px 0 6px;
    font-size: 0.9rem;
    font-weight: 600;
}

.pirata-target-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pirata-target-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(93, 64, 55, 0.12);
    border-radius: 999px;
    padding: 6px 12px;
    border: 1px solid rgba(109, 76, 65, 0.65);
    font-size: 0.9rem;
    color: #3e2723;
}

.pirata-target-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(0,0,0,0.7);
}

.pirata-target-label {
    white-space: nowrap;
}

.pirata-choice-actions {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.roubar-btn {
    background: transparent;
    border: 3px solid #8d6e63;
    border-radius: 12px;
    margin: 0;
    padding: 3px;
    cursor: pointer;
}

.roubar-btn.selected {
    border-color: #c9a227;
    box-shadow: 0 0 12px rgba(201, 162, 39, 0.65);
}

/* Escolhas por nome nos popups de poderes (texto castanho sobre fundo castanho + dourado) */
.power-choice-name-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #6d4c41 0%, #5d4037 55%, #4e342e 100%);
    color: #e8c547;
    border: 2px solid #3e2723;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 24px;
    min-height: 44px;
    box-sizing: border-box;
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.power-choice-name-btn:hover {
    filter: brightness(1.06);
}

.power-choice-name-btn span {
    color: inherit;
}

.roubar-btn-img {
    width: 60px;
    height: 82px;
    border-radius: 8px;
    display: block;
}

.pass-button-hidden {
    visibility: hidden;
}

.pass-button-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== ECRÃ DE ENTRADA (SPLASH) ==================== */

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(8, 4, 1, 0.92);
    backdrop-filter: blur(8px);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.splash-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    text-align: center;
    animation: splashFadeIn 0.8s ease;
}

@keyframes splashFadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.splash-logo {
    filter: drop-shadow(0 6px 18px rgba(255,215,0,0.45));
}

.splash-title {
    font-size: 2.4rem;
    font-weight: 800;
    color: #f9e0a0;
    margin: 0;
    letter-spacing: 1px;
}

.splash-subtitle {
    font-size: 0.95rem;
    color: #a8c8a0;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.splash-enter-btn {
    margin-top: 16px;
    background: linear-gradient(135deg, #ffd76a, #c98f22);
    border: none;
    border-radius: 60px;
    padding: 18px 56px;
    font-size: 1.15rem;
    font-weight: 700;
    color: #3e2723;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(201, 143, 34, 0.55);
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
    animation: splashPulse 2s ease-in-out infinite;
}

.splash-enter-btn:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow: 0 12px 32px rgba(201, 143, 34, 0.75);
    background: linear-gradient(135deg, #ffe38c, #d99c2f);
    color: #2f2414;
}

@keyframes splashPulse {
    0%, 100% { box-shadow: 0 6px 24px rgba(201, 143, 34, 0.55); }
    50%       { box-shadow: 0 6px 36px rgba(201, 143, 34, 0.88); }
}

/* ==================== BOTÃO OPÇÕES (MENU) — igual Instruções / pausa bege ==================== */

.menu-btn-opcoes {
    background: linear-gradient(135deg, #eadbbf, #cdb58b) !important;
    box-shadow: 0 6px 20px rgba(120, 90, 55, 0.35) !important;
}

.menu-btn-opcoes:hover {
    background: linear-gradient(135deg, #f2e5cc, #d9c399) !important;
    box-shadow: 0 10px 28px rgba(120, 90, 55, 0.45) !important;
}

.menu-btn-opcoes .menu-btn-label {
    color: #2f2414;
}

/* ==================== BOTÃO TUTORIAL (MENU) — castanho dos popups poder / Pirata ==================== */

.menu-btn-tutorial {
    background: linear-gradient(180deg, #6d4c41 0%, #5d4037 55%, #4e342e 100%) !important;
    box-shadow:
        0 0 0 2px #3e2723,
        0 6px 20px rgba(62, 39, 35, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}

.menu-btn-tutorial:hover {
    filter: brightness(1.08);
    box-shadow:
        0 0 0 2px #3e2723,
        0 10px 28px rgba(62, 39, 35, 0.65),
        inset 0 1px 0 rgba(255, 255, 255, 0.14) !important;
}

.menu-btn-tutorial .menu-btn-label {
    color: #e8c547;
}

/* ==================== TUTORIAL — OVERLAY ==================== */

.tutorial-overlay {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5000;
    width: min(720px, 94vw);
    pointer-events: none;
}

.tutorial-overlay.is-hidden {
    display: none;
}

.tutorial-panel {
    background: linear-gradient(165deg, rgba(245, 235, 216, 0.97), rgba(232, 217, 188, 0.97));
    border: 2px solid rgba(90, 70, 45, 0.55);
    border-radius: 22px;
    padding: 14px 20px 16px;
    color: #1a1208;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
    animation: tutorialPanelIn 0.32s ease;
}

@keyframes tutorialPanelIn {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.tutorial-step-badge {
    background: #2a1700;
    color: #ffd76a;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.6px;
}

.tutorial-title-label {
    font-weight: 800;
    color: #2a1700;
    flex: 1;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.tutorial-close {
    background: transparent;
    border: none;
    color: #2a1700;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 6px;
    border-radius: 8px;
    transition: color 0.15s, background 0.15s;
}

.tutorial-close:hover {
    color: #b72c2c;
    background: rgba(183, 44, 44, 0.1);
}

.tutorial-text {
    font-size: 1rem;
    line-height: 1.45;
    color: #2a1700;
    margin: 6px 0;
}

.tutorial-text strong {
    color: #6a3c00;
}

.tutorial-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.tutorial-action-btn {
    background: linear-gradient(135deg, #ffd76a, #c98f22);
    color: #2a1700;
    border: none;
    border-radius: 60px;
    padding: 10px 26px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 16px rgba(255, 190, 64, 0.42);
    transition: transform 0.15s, box-shadow 0.15s;
}

.tutorial-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(255, 190, 64, 0.58);
}

/* ==================== TUTORIAL — DESTAQUES ==================== */

.tutorial-highlight {
    animation: tutorialPulse 1.4s ease-in-out infinite;
    position: relative;
    z-index: 50;
    border-radius: 12px;
}

.tutorial-highlight-pass {
    animation: tutorialPulsePass 1.4s ease-in-out infinite;
    position: relative;
    z-index: 50;
    border-radius: 60px;
}

.tutorial-highlight-discard {
    animation: tutorialPulseDiscard 1.8s ease-in-out infinite;
    position: relative;
    z-index: 50;
    border-radius: 12px;
}

.tutorial-highlight-discard-strong {
    animation: tutorialPulseDiscardStrong 0.95s ease-in-out infinite;
    position: relative;
    z-index: 50;
    border-radius: 12px;
}

@keyframes tutorialPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.55), 0 0 18px 6px rgba(255, 200, 0, 0.45);
        outline: 3px solid rgba(255, 215, 0, 0.85);
        outline-offset: 2px;
    }
    50% {
        box-shadow: 0 0 0 8px rgba(255, 215, 0, 0), 0 0 28px 12px rgba(255, 200, 0, 0.7);
        outline: 3px solid rgba(255, 215, 0, 1);
        outline-offset: 4px;
    }
}

@keyframes tutorialPulsePass {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 215, 0, 0.5), 0 0 14px 4px rgba(255, 200, 0, 0.45);
        outline: 3px solid rgba(255, 215, 0, 0.85);
        outline-offset: 2px;
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 215, 0, 0), 0 0 22px 10px rgba(255, 200, 0, 0.7);
        outline: 3px solid rgba(255, 215, 0, 1);
        outline-offset: 4px;
    }
}

@keyframes tutorialPulseDiscard {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 180, 70, 0.35), 0 0 12px 3px rgba(255, 180, 70, 0.32);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(255, 180, 70, 0), 0 0 20px 8px rgba(255, 180, 70, 0.55);
    }
}

@keyframes tutorialPulseDiscardStrong {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(255, 110, 0, 0.7), 0 0 22px 8px rgba(255, 120, 0, 0.7);
    }
    50% {
        box-shadow: 0 0 0 12px rgba(255, 110, 0, 0), 0 0 34px 14px rgba(255, 120, 0, 0.95);
    }
}

/* ==================== TUTORIAL — MODAL DE CONCLUSÃO ==================== */

.tutorial-complete-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 7500;
    animation: fadeIn 0.3s;
}

.tutorial-complete-content {
    background: linear-gradient(165deg, #f5ebd8, #e8d9bc);
    border: 3px solid rgba(90, 70, 45, 0.5);
    border-radius: 36px;
    padding: 36px 40px;
    max-width: 480px;
    width: 92%;
    color: #1a1208;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    text-align: center;
    animation: tutorialCompleteIn 0.4s ease;
}

@keyframes tutorialCompleteIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

.tutorial-complete-icon {
    font-size: 3.4rem;
    margin-bottom: 4px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.tutorial-complete-content h2 {
    font-size: 1.85rem;
    margin: 6px 0 14px;
    color: #2a1700;
    letter-spacing: 0.5px;
}

.tutorial-complete-content p {
    font-size: 1.05rem;
    line-height: 1.5;
    margin: 0 0 24px;
    color: #2a1700;
}

.tutorial-complete-actions {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.tutorial-btn-continue,
.tutorial-btn-menu {
    border: none;
    border-radius: 60px;
    padding: 14px 28px;
    font-size: 1.05rem;
    font-weight: 800;
    cursor: pointer;
    letter-spacing: 0.5px;
    transition: transform 0.15s, box-shadow 0.15s;
}

.tutorial-btn-continue {
    background: linear-gradient(135deg, #ffd76a, #c98f22);
    color: #2a1700;
    box-shadow: 0 8px 22px rgba(255, 190, 64, 0.42);
}

.tutorial-btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(255, 190, 64, 0.58);
}

.tutorial-btn-menu {
    background: linear-gradient(135deg, #b72c2c, #7d1717);
    color: #fff;
    box-shadow: 0 8px 22px rgba(160, 30, 30, 0.45);
}

.tutorial-btn-menu:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(160, 30, 30, 0.6);
}

@media (max-width: 600px) {
    .tutorial-overlay {
        top: 8px;
        width: 96vw;
    }
    .tutorial-panel {
        padding: 12px 14px 14px;
    }
    .tutorial-text { font-size: 0.95rem; }
    .tutorial-complete-content { padding: 28px 22px; }
    .tutorial-complete-content h2 { font-size: 1.45rem; }
    .tutorial-complete-content p { font-size: 0.95rem; }
}

