        :root {
            --tibia-gold: var(--gold-primary, #d4af37);
            --tibia-orange: var(--bronze-action, #ff9900);
            --tibia-stone: var(--bg-surface, #16191F);
            --tibia-panel: var(--bg-primary, #0D0F12);
        }

        body {
            font-family: var(--font-body, 'Outfit', 'Inter', sans-serif);
            background-color: var(--bg-primary, #0D0F12);
            color: var(--text-body, #C4BDB0);
            user-select: none;
            -webkit-user-select: none;
            overflow: hidden;
            height: 100dvh;
            width: 100vw;
        }

        .font-tibia {
            font-family: var(--font-display, 'Cinzel', serif);
        }

        .font-pixel {
            font-family: 'VT323', monospace;
        }

        /* Textura e painéis táticos sincronizados com o Design System (theme.css) */
        .tibia-stone-bg {
            background:
                radial-gradient(circle at 50% 18%, rgba(38, 52, 82, 0.55) 0%, transparent 58%),
                radial-gradient(circle at 50% 85%, rgba(212, 175, 55, 0.08) 0%, transparent 50%),
                linear-gradient(180deg, #161C28 0%, #0E121B 55%, #080A0F 100%);
            box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.88);
        }

        .tibia-border {
            border: 2px solid #283042;
            background: linear-gradient(180deg, #121620 0%, #171C28 100%);
            box-shadow: inset 0 3px 6px rgba(0, 0, 0, 0.75), 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 12px rgba(0, 0, 0, 0.5);
        }

        .tibia-gold-border {
            border: 2px solid #3B4459;
            background: linear-gradient(180deg, #1E2432 0%, #151923 100%);
            box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.14), inset 0 -3px 0 rgba(0, 0, 0, 0.55), 0 5px 0 #090B10, 0 10px 24px rgba(0, 0, 0, 0.85);
        }

        /* Animações das Cartas */
        .tcg-card {
            transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.18s ease;
            transform-origin: bottom center;
            touch-action: none;
            user-select: none;
            -webkit-user-select: none;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            transform-style: preserve-3d;
        }

        /* ================= MÃO EM FORMATO DE LEQUE (ESTILO HEARTHSTONE / POKÉMON TCG) ================= */
        #player-hand {
            overflow: visible;
            perspective: 1000px;
            touch-action: none;
        }

        .tcg-card-hand {
            /* Variáveis calculadas dinamicamente via JS para cada carta do leque */
            --fan-angle: 0deg;
            --fan-y: 0px;
            --fan-x: 0px;
            --expand-shift-x: 0px;
            --base-z: 10;

            position: relative;
            z-index: var(--base-z);
            transform-origin: 35% 125%;
            transform: translate3d(var(--fan-x), var(--fan-y), 0) rotate(var(--fan-angle));
            transition: transform 0.22s cubic-bezier(0.2, 0.85, 0.25, 1),
                filter 0.2s ease;
            touch-action: none;
            user-select: none;
            will-change: transform;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0 !important;
            aspect-ratio: 682 / 1024;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            transform-style: preserve-3d;
        }

        /* Cartas da Mesa (Unidades no Tabuleiro) */
        .tcg-board-card {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            padding: 0 !important;
            aspect-ratio: 1000 / 1030;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            transform-style: preserve-3d;
        }

        /* Estado Expandido (Ao passar o dedo no Mobile ou passar o Mouse no Desktop - Tamanho da Coleção) */
        .tcg-card.tcg-card-hand.hand-card-expanded,
        .tcg-card-hand.hand-card-expanded {
            z-index: 95;
            transform-origin: bottom center;
            transform: translate3d(var(--expand-shift-x, 0px), var(--expand-shift-y, -105px), 60px) rotate(0deg) scale(var(--expand-card-scale, 2.65));
            filter: drop-shadow(0 24px 36px rgba(0, 0, 0, 0.98)) drop-shadow(0 0 18px rgba(251, 191, 36, 0.85)) !important;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            height: auto;
            will-change: auto !important;
        }

        /* Ponte invisível que preenche o espaço vazio onde a carta estava no leque antes de subir */
        .tcg-card-hand.hand-card-expanded::after {
            content: '';
            position: absolute;
            left: -12px;
            right: -12px;
            top: 100%;
            height: 120px;
            background: transparent;
            pointer-events: auto;
        }

        @media (min-width: 768px) {
            .tcg-card.tcg-card-hand.hand-card-expanded,
            .tcg-card-hand.hand-card-expanded {
                transform: translate3d(var(--expand-shift-x, 0px), var(--expand-shift-y, -125px), 60px) rotate(0deg) scale(var(--expand-card-scale, 2.45));
            }
        }

        /* Destaque quando a carta foi clicada para mostrar as opções de jogo na mesa */
        .tcg-card.tcg-card-hand.hand-card-selected-play,
        .tcg-card-hand.hand-card-selected-play {
            filter: drop-shadow(0 0 10px #facc15) drop-shadow(0 0 20px rgba(250, 204, 21, 0.9)) !important;
            box-shadow: none !important;
            border: none !important;
            background: transparent !important;
            transform: translate3d(var(--fan-x), calc(var(--fan-y) - 22px), 0) rotate(0deg) scale(1.12);
            z-index: 75;
        }

        /* Brilhos baseados em drop-shadow para recortar o contorno transparente dos Frames WebP */
        .tcg-card.playable-glow,
        .playable-glow {
            box-shadow: none !important;
            border: none !important;
            filter: drop-shadow(0 0 6px #22c55e) drop-shadow(0 0 14px rgba(34, 197, 94, 0.85)) !important;
            animation: playableGlowPulse 1.6s infinite ease-in-out !important;
        }

        @keyframes playableGlowPulse {
            0%, 100% {
                filter: drop-shadow(0 0 4px rgba(34, 197, 94, 0.6)) drop-shadow(0 0 8px rgba(34, 197, 94, 0.45)) !important;
            }
            50% {
                filter: drop-shadow(0 0 8px #4ade80) drop-shadow(0 0 18px rgba(74, 222, 128, 0.95)) !important;
            }
        }

        .tcg-card.unit-ready-attack,
        .unit-ready-attack {
            filter: drop-shadow(0 0 6px #4ade80) drop-shadow(0 0 12px rgba(74, 222, 128, 0.8)) !important;
        }

        .tcg-card.valid-target-glow,
        .valid-target-glow {
            filter: drop-shadow(0 0 8px #ef4444) drop-shadow(0 0 16px rgba(239, 68, 68, 0.85)) !important;
            box-shadow: none !important;
            border: none !important;
            animation: pulseTarget 1.1s infinite ease-in-out;
            cursor: crosshair;
        }

        .tcg-card.selected-attacker-glow,
        .selected-attacker-glow {
            filter: drop-shadow(0 0 8px #f59e0b) drop-shadow(0 0 18px rgba(245, 158, 11, 0.9)) !important;
            box-shadow: none !important;
            border: none !important;
            transform: scale(1.04);
        }

        /* Heróis mantêm bordas brilhantes específicas dos seus avatares */
        #enemy-hero-box.valid-target-glow,
        [id^="hero-"].valid-target-glow {
            box-shadow: 0 0 18px #ef4444, 0 0 8px #f97316, inset 0 0 8px rgba(239, 68, 68, 0.45) !important;
            border-color: #ef4444 !important;
            border-width: 2px !important;
            animation: pulseTarget 1.1s infinite ease-in-out;
            filter: saturate(1.15) brightness(1.08);
        }

        #player-hero-box.selected-attacker-glow,
        [id^="hero-"].selected-attacker-glow {
            box-shadow: 0 0 20px #facc15, inset 0 0 8px #facc15 !important;
            border-color: #facc15 !important;
            border-width: 2px !important;
            transform: scale(1.04);
        }

        /* ================= SISTEMA DE CARTAS EM 3 CAMADAS (LAYERED CARD SYSTEM) ================= */

        .tcg-layered-card {
            container-type: inline-size;
            position: relative;
            width: 100%;
            height: 100%;
            user-select: none;
            -webkit-user-select: none;
            box-sizing: border-box;
            touch-action: pan-y;
            transform-style: preserve-3d;
            backface-visibility: hidden;
            -webkit-backface-visibility: hidden;
            contain: layout style;
        }

        /* Cartas na mão e unidades do tabuleiro precisam de touch-action: none para permitir arraste livre */
        .tcg-card-hand,
        .board-card-item,
        .drag-card-ghost,
        #player-hero-box {
            touch-action: none !important;
        }

        /* Cartas no grimório/coleção precisam explicitamente de touch-action: pan-y para rolagem vertical nativa */
        .tcg-physical-card,
        .tcg-physical-card .tcg-layered-card,
        #grimoire-cards-grid .tcg-layered-card {
            touch-action: pan-y !important;
        }

        /* 1. VERSÃO FULL (aspect-ratio: 682 / 1024) — Mão, Grimório, Loja, Booster, Inspeção */
        .tcg-layered-card--full {
            aspect-ratio: 682 / 1024;
            container-type: inline-size;
        }

        .tcg-layered-card .card-layer-0-art {
            pointer-events: none !important;
            user-select: none !important;
            -webkit-user-select: none !important;
            -webkit-user-drag: none !important;
        }

        .tcg-layered-card--full .card-layer-0-art {
            position: absolute;
            left: 9.2%;
            top: 13.4%;
            width: 81.6%;
            height: 48.6%;
            z-index: 1;
            overflow: hidden;
            border-radius: 2%;
            pointer-events: none !important;
            user-select: none !important;
            -webkit-user-select: none !important;
            -webkit-user-drag: none !important;
        }

        .tcg-layered-card .card-layer-2-frame {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: fill;
            z-index: 2;
            pointer-events: none !important;
            user-select: none !important;
            -webkit-user-select: none !important;
            -webkit-user-drag: none !important;
        }

        .tcg-layered-card .card-layer-3-info {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 3;
            pointer-events: none;
            user-select: none !important;
            -webkit-user-select: none !important;
            -webkit-user-drag: none !important;
        }

        /* Slots Versão Full */
        .tcg-layered-card--full .slot-mana {
            position: absolute;
            left: 5.0%;
            top: 3.8%;
            width: 17.6%;
            height: 11.8%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(11px, calc(11cqw + 1px), 35px);
            line-height: 1;
            color: #ffffff;
            text-shadow: 0 2px 4px #000, 0 0 8px #0284c7, -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
        }

        .tcg-layered-card--full .slot-name {
            position: absolute;
            left: 24.5%;
            top: 5.3%;
            width: 65.5%;
            height: 7.3%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 0 2%;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(8px, 5.4cqw, 18px);
            line-height: 1.05;
            color: #fffbeb;
            text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.95), -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tcg-layered-card--full .slot-name.slot-name--compact {
            font-size: clamp(7px, 4.6cqw, 15px);
        }

        .tcg-layered-card--full .slot-name.slot-name--tight {
            font-size: clamp(6px, 4.1cqw, 13px);
        }

        .tcg-layered-card--full .slot-class-type {
            position: absolute;
            left: 10.5%;
            top: 62.3%;
            width: 79.0%;
            height: 5.0%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            font-family: 'Cinzel', serif;
            font-weight: 800;
            font-size: clamp(6px, 4.1cqw, 13px);
            letter-spacing: 0.04em;
            text-transform: uppercase;
            color: #fffbeb;
            text-shadow: 0 1px 2px #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tcg-layered-card--full .slot-desc {
            position: absolute;
            left: 10.5%;
            top: 69.5%;
            width: 79.0%;
            height: 20.4%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            box-sizing: border-box;
            overflow: hidden;
            font-family: 'Inter', sans-serif;
            font-weight: 700;
            font-size: clamp(6.5px, 4.3cqw, 14px);
            line-height: 1.18;
            color: #1a120b;
            text-shadow: 0 0.5px 0 rgba(255, 255, 255, 0.35);
            padding: 3% 5%;
        }

        .tcg-layered-card--full .slot-desc.slot-desc--with-stats {
            padding: 2% 11% 6% 11%;
        }

        .tcg-layered-card--full .slot-desc-text {
            display: -webkit-box;
            -webkit-line-clamp: 4;
            line-clamp: 4;
            -webkit-box-orient: vertical;
            overflow: hidden;
            max-height: 100%;
        }

        .tcg-layered-card--full .slot-atk {
            position: absolute;
            left: 5.0%;
            top: 84.8%;
            width: 15.6%;
            height: 10.4%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tcg-layered-card--full .slot-def {
            position: absolute;
            right: 5.0%;
            top: 84.8%;
            width: 15.6%;
            height: 10.4%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* 2. VERSÃO SMALL (aspect-ratio: 1000 / 1030) — Cartas na Mesa */
        .tcg-layered-card--small {
            aspect-ratio: 1000 / 1030;
            container-type: inline-size;
        }

        .tcg-layered-card--small .card-layer-0-art {
            position: absolute;
            left: 9.5%;
            top: 19.8%;
            width: 81.0%;
            height: 67.2%;
            z-index: 1;
            overflow: hidden;
            border-radius: 2%;
        }

        .tcg-layered-card--small .slot-mana {
            position: absolute;
            left: 5.2%;
            top: 5.6%;
            width: 17.6%;
            height: 17.0%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(10px, calc(11.5cqw + 1px), 27px);
            line-height: 1;
            color: #ffffff;
            text-shadow: 0 2px 4px #000, 0 0 8px #0284c7, -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
        }

        .tcg-layered-card--small .slot-name {
            position: absolute;
            left: 24.5%;
            top: 8.2%;
            width: 65.5%;
            height: 10.4%;
            display: flex;
            align-items: center;
            justify-content: center;
            text-align: center;
            padding: 0 2%;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(7.5px, 5.8cqw, 15px);
            line-height: 1.05;
            color: #fffbeb;
            text-shadow: 0 1.5px 3px rgba(0, 0, 0, 0.95), -1px -1px 0 #111, 1px -1px 0 #111, -1px 1px 0 #111, 1px 1px 0 #111;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .tcg-layered-card--small .slot-name.slot-name--compact {
            font-size: clamp(6.5px, 4.9cqw, 12px);
        }

        .tcg-layered-card--small .slot-name.slot-name--tight {
            font-size: clamp(5.5px, 4.3cqw, 10.5px);
        }

        .tcg-layered-card--small .slot-atk {
            position: absolute;
            left: 5.0%;
            top: 78.2%;
            width: 15.8%;
            height: 15.4%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tcg-layered-card--small .slot-def {
            position: absolute;
            right: 5.0%;
            top: 78.2%;
            width: 15.8%;
            height: 15.4%;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Camada 0: Artes e Fallbacks */
        .card-art-img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            z-index: 2;
            pointer-events: none !important;
            user-select: none !important;
            -webkit-user-select: none !important;
            -webkit-user-drag: none !important;
        }

        .card-art-fallback {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1;
            pointer-events: none !important;
            user-select: none !important;
            -webkit-user-select: none !important;
            -webkit-user-drag: none !important;
        }

        .tcg-layered-card--full .card-art-fallback-icon {
            font-size: clamp(26px, 18cqw, 64px);
            line-height: 1;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.85));
        }

        .tcg-layered-card--small .card-art-fallback-icon {
            font-size: clamp(18px, 18cqw, 42px);
            line-height: 1;
            filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.85));
        }

        /* Estrutura interna dos medalhões de Ataque e Defesa */
        .stat-class-icon {
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            width: 120%;
            height: 120%;
            min-width: calc(100% + 8px);
            min-height: calc(100% + 8px);
            max-width: none;
            max-height: none;
            object-fit: contain;
            z-index: 1;
            opacity: 0.92;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95));
            pointer-events: none;
        }

        .stat-value-number {
            position: relative;
            top: 2px;
            z-index: 2;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(8px, 9.8cqw, 24px);
            line-height: 1;
            color: #ffffff;
            text-shadow: 0 2px 4px #000, -1.5px -1.5px 0 #000, 1.5px -1.5px 0 #000, -1.5px 1.5px 0 #000, 1.5px 1.5px 0 #000;
            pointer-events: none;
        }

        .tcg-layered-card--small .stat-value-number {
            font-size: clamp(8px, 10.5cqw, 22px);
        }

        .stat-buffed {
            color: #4ade80 !important;
        }

        .stat-damaged {
            color: #f87171 !important;
        }

        .stat-normal {
            color: #ffffff !important;
        }

        #player-hero-box {
            touch-action: none;
            user-select: none;
            -webkit-user-select: none;
            -webkit-user-drag: none;
        }

        #player-hero-box * {
            user-select: none;
            -webkit-user-select: none;
            -webkit-user-drag: none;
        }

        #player-hero-box.unit-ready-attack {
            animation: readyAttackPulse 1.5s infinite ease-in-out !important;
            border-color: #4ade80 !important;
            cursor: grab !important;
        }


        @keyframes pulseTarget {

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

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

        /* 1. Iluminação pulsante do Botão Passar Turno quando não há mais ações */
        @keyframes pulseEndTurnReady {

            0%,
            100% {
                filter: drop-shadow(0 0 6px #facc15) drop-shadow(0 0 14px #22c55e) brightness(1.08);
                transform: scale(1);
            }

            50% {
                filter: drop-shadow(0 0 14px #fde047) drop-shadow(0 0 26px #4ade80) brightness(1.28);
                transform: scale(1.07);
            }
        }

        .end-turn-ready-glow {
            animation: pulseEndTurnReady 1.2s infinite ease-in-out;
        }

        /* 2. Iluminação do Herói ao receber um Equipamento */
        @keyframes heroEquipGlowAnim {
            0% {
                box-shadow: 0 0 0px #facc15, inset 0 0 0px #facc15;
                transform: scale(1);
            }

            40% {
                box-shadow: 0 0 35px #facc15, 0 0 60px #f59e0b, inset 0 0 25px #fef08a;
                border-color: #fef08a;
                transform: scale(1.12);
                filter: brightness(1.35);
            }

            100% {
                box-shadow: 0 0 0px #facc15, inset 0 0 0px #facc15;
                transform: scale(1);
                filter: brightness(1);
            }
        }

        .hero-equip-flash {
            animation: heroEquipGlowAnim 0.75s cubic-bezier(0.22, 1, 0.36, 1);
            z-index: 60;
        }

        /* 3. Elementos Flutuantes de Equipamento e Projéteis (Magia / Flecha) */
        .equip-flying-item {
            position: fixed;
            top: 0;
            left: 0;
            pointer-events: none;
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 54px;
            height: 54px;
            border-radius: 14px;
            background: radial-gradient(circle, rgba(250, 204, 21, 0.9) 0%, rgba(180, 83, 9, 0.95) 100%);
            border: 2px solid #fef08a;
            box-shadow: 0 0 25px #facc15, 0 0 45px rgba(245, 158, 11, 0.8);
            font-size: 28px;
        }

        .combat-projectile {
            position: fixed;
            top: 0;
            left: 0;
            pointer-events: none;
            z-index: 9999;
            display: flex;
            align-items: center;
            justify-content: center;
            transform-origin: center center;
        }

        /* Estilo Challenge (Provocar) */
        .tcg-card.taunt-shield,
        .taunt-shield {
            border-radius: 9px 9px 18px 18px;
            border-width: 2.5px;
            border-color: #eab308;
            box-shadow: 0 0 0 1px #422006, 0 4px 10px rgba(0, 0, 0, 0.85);
        }

        /* Efeito Paralyze / Congelado */
        .tcg-card.frozen-unit,
        .frozen-unit {
            box-shadow: 0 0 14px #38bdf8, inset 0 0 18px #0284c7;
            border-color: #7dd3fc;
        }

        /* Efeito Invisible (Elusivo) */
        .tcg-card.invisible-unit,
        .invisible-unit {
            opacity: 0.84;
            border-style: dashed;
            border-color: #a855f7;
            box-shadow: 0 0 12px rgba(168, 85, 247, 0.55);
        }

        /* Texto Flutuante estilo Tibia (Fala Laranja e Hits) */
        @keyframes floatUpFade {
            0% {
                opacity: 1;
                transform: translateY(0) scale(0.9);
            }

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

            85% {
                opacity: 1;
                transform: translateY(-28px) scale(1);
            }

            100% {
                opacity: 0;
                transform: translateY(-38px) scale(0.95);
            }
        }

        .tibia-floating-text {
            animation: floatUpFade 1.55s forwards cubic-bezier(0.16, 1, 0.3, 1);
            text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000, 0 2px 4px rgba(0, 0, 0, 0.9);
            pointer-events: none;
        }

        /* ================= SISTEMA CANÔNICO DE SKINS DE MESA (1030 × 1526) ================= */
        :root {
            --board-header-h: 40px;
            --board-turn-h: 28px;
            --board-non-stage-h: calc(var(--board-header-h) + var(--board-turn-h) + 6px); /* ~74px */
            --board-max-h: calc(100vh - var(--board-non-stage-h));
            --board-w-by-h: calc(var(--board-max-h) * 1030 / 1526);
        }

        @supports (height: 100dvh) {
            :root {
                --board-max-h: calc(100dvh - var(--board-non-stage-h));
                --board-w-by-h: calc(var(--board-max-h) * 1030 / 1526);
            }
        }

        .game-screen {
            display: grid;
            grid-template-columns: minmax(195px, 1fr) minmax(auto, 760px) minmax(195px, 1fr);
            justify-content: center;
            width: 100vw;
            height: 100dvh;
            max-height: 100dvh;
            overflow: hidden;
            background: radial-gradient(circle at center, #1b1e26 0%, #0d0f13 70%, #050608 100%);
        }

        @media (max-width: 1099px) {
            .game-screen {
                display: flex;
                flex-direction: column;
                width: 100vw;
                height: 100dvh;
                max-height: 100dvh;
                overflow: hidden;
            }

            .desktop-left-panel,
            .desktop-right-panel {
                display: none !important;
            }

            .table-column {
                width: 100%;
                max-width: 760px;
                margin: 0 auto;
            }
        }

        .desktop-left-panel,
        .desktop-right-panel {
            height: 100dvh;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 12px;
            padding: 12px;
            background: rgba(14, 16, 21, 0.94);
            border-left: 1px solid #332e26;
            border-right: 1px solid #332e26;
            z-index: 20;
            scrollbar-width: thin;
        }

        .table-column {
            height: 100dvh;
            max-height: 100dvh;
            overflow: hidden; /* O campo é inteiramente mostrado na janela sem necessidade de scroll */
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-start;
            width: 100%;
            max-width: 760px;
            margin: 0 auto;
            position: relative;
            box-sizing: border-box;
        }

        .game-toolbar {
            width: 100%;
            max-width: 760px;
            min-height: var(--board-header-h);
            max-height: var(--board-header-h);
            flex-shrink: 0;
            overflow: hidden;
        }

        .turn-message {
            width: 100%;
            max-width: 760px;
            min-height: var(--board-turn-h);
            max-height: var(--board-turn-h);
            flex-shrink: 0;
            overflow: hidden;
        }

        /* ÁREA FÍSICA DA MESA: PROPORÇÃO CANÔNICA 1030 / 1526 AJUSTADA À JANELA (SEM CORTES NEM DISTORÇÃO) */
        .board-stage {
            width: min(100%, calc(var(--board-max-h) * 1030 / 1526));
            aspect-ratio: 1030 / 1526;
            height: auto;
            max-width: 100%;
            max-height: var(--board-max-h);
            position: relative;
            margin-inline: auto;
            margin-top: 0;
            margin-bottom: auto;
            flex-shrink: 0;
            border-radius: 4px;
            overflow: hidden;
            background: #10151c;
            box-shadow: 0 14px 40px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(184, 151, 61, 0.28);
            container-type: inline-size;
            container-name: board;
        }

        /* CAMADA 0: SKINS VISUAIS (Composição Híbrida na Divisória Central em 48.6%) */
        .board-skin,
        .skin-layer {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            overflow: hidden;
            pointer-events: none;
            z-index: 0;
            background: #10151c; /* Fallback de contraste */
        }

        .enemy-skin-half {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            clip-path: inset(0 0 51.4% 0);
            z-index: 1;
            pointer-events: none;
        }

        .player-skin-half {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            clip-path: inset(48.6% 0 0 0);
            z-index: 2;
            pointer-events: none;
        }

        .enemy-skin-half img,
        .player-skin-half img {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: fill; /* Preserva geometria exata sem cortes nem distorções */
            display: block;
            pointer-events: none;
            user-select: none;
            -webkit-user-drag: none;
        }

        /* CAMADA 1: SOMBRAS E AMBIENTAÇÃO */
        .board-ambient-layer {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 3;
            background: radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 56%, rgba(0, 0, 0, 0.38) 100%);
        }

        /* CAMADA 2: OVERLAY DE GAMEPLAY (Alinhamento Normalizado 1030 × 1526) */
        .board-gameplay {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            z-index: 5;
            pointer-events: auto;
        }

        /* ZONAS TÁTICAS E HITBOXES TRANSPARENTES ALINHADAS ÀS MOLDURAS DA SKIN */
        .board-zone {
            position: absolute;
            left: 0;
            right: 0;
            background: transparent;
            border: 1.5px dashed transparent;
            border-radius: 10px;
            transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
        }

        .enemy-backline-zone {
            top: 21.2%;
            height: 10.2%;
        }

        .enemy-frontline-zone {
            top: 33.9%;
            height: 10.2%;
        }

        .player-frontline-zone {
            top: 53.4%;
            height: 10.2%;
        }

        .player-backline-zone {
            top: 66.0%;
            height: 10.2%;
        }

        .board-lane {
            transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
            cursor: pointer;
        }

        .board-lane.lane-highlight {
            background-color: rgba(34, 197, 94, 0.14);
            border-color: rgba(74, 222, 128, 0.8);
            box-shadow: inset 0 0 18px rgba(34, 197, 94, 0.28);
        }

        .board-lane.lane-drop-hover {
            background-color: rgba(34, 197, 94, 0.26);
            border-color: #4ade80;
            box-shadow: inset 0 0 26px rgba(74, 222, 128, 0.5), 0 0 14px rgba(34, 197, 94, 0.45);
        }

        /* LABELS DE IMPLANTAÇÃO (OCULTAS EM REPOUSO PARA PRESERVAR A ARTE DA ARENA; VISÍVEIS AO POSICIONAR CARTAS) */
        .lane-tag {
            position: absolute;
            top: -8px;
            left: 50%;
            transform: translate(-50%, 4px);
            opacity: 0;
            z-index: 18;
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 2px 9px;
            border-radius: 8px;
            font-family: 'Cinzel', serif;
            font-size: clamp(7.5px, 1.15cqw, 9.5px);
            font-weight: 800;
            letter-spacing: 0.05em;
            text-transform: uppercase;
            background: linear-gradient(180deg, #1E2534 0%, #11151F 100%);
            pointer-events: none;
            box-shadow: 0 3px 0 #07090E, 0 5px 10px rgba(0, 0, 0, 0.85);
            transition: opacity 0.18s ease, transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        .board-lane.lane-highlight .lane-tag,
        .board-lane.lane-drop-hover .lane-tag {
            opacity: 1;
            transform: translate(-50%, 0);
        }

        .lane-tag--enemy-backline {
            border: 1.5px solid #38BDF8;
            color: #E0F2FE;
        }

        .lane-tag--enemy-frontline {
            border: 1.5px solid #F87171;
            color: #FEE2E2;
        }

        .lane-tag--player-frontline {
            border: 1.5px solid #FBBF24;
            color: #FEF08A;
        }

        .lane-tag--player-backline {
            border: 1.5px solid #38BDF8;
            color: #E0F2FE;
        }

        /* FRONTEIRA DE COMBATE DIEGÉTICA + PAVIO DE BOMBA ESTILO HEARTHSTONE (DIVISÓRIA CENTRAL EM 48.6%) */
        .combat-frontier {
            position: absolute;
            top: 48.6%;
            left: 0;
            right: 0;
            height: 28px;
            transform: translateY(-50%);
            z-index: 32;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: none;
        }

        .combat-frontier-bar {
            width: 100%;
            height: 3px;
            background: linear-gradient(90deg, 
                transparent 0%, 
                rgba(20, 24, 33, 0.65) 18%, 
                rgba(212, 175, 55, 0.38) 50%, 
                rgba(20, 24, 33, 0.65) 82%, 
                transparent 100%
            );
            box-shadow: 0 1px 6px rgba(0, 0, 0, 0.85);
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .combat-frontier-badge {
            display: none;
        }

        /* PAVIO DE BOMBA DE CORDA TRANÇADA REALISTA + CHAMA ORGÂNICA VIVA (CURVA CONECTADA AO BOTÃO DE TURNO) */
        .turn-fuse-container,
        .turn-fuse-frontier {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 34;
            opacity: 0;
            transition: opacity 0.25s ease;
        }

        .turn-fuse-container.is-burning,
        .turn-fuse-frontier.is-burning {
            opacity: 1;
        }

        .turn-fuse-svg-canvas {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            overflow: visible;
            pointer-events: none;
        }

        /* 1. Trilha de Cinzas e Pólvora Queimada na Pedra (Visível onde a corda já foi consumida pelo fogo) */
        .turn-fuse-ash-path {
            fill: none;
            stroke: #0e0a07;
            stroke-width: 7;
            stroke-linecap: round;
            stroke-linejoin: round;
            filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.98));
            stroke-dasharray: 5 3;
        }

        .turn-fuse-ash-embers {
            fill: none;
            stroke: #57534e;
            stroke-width: 3.2;
            stroke-linecap: round;
            stroke-dasharray: 1.5 6.5;
            opacity: 0.78;
        }

        /* 2. Corda de Cânhamo/Sisal Trançada em Múltiplas Camadas 3D */
        .turn-fuse-rope-shadow {
            fill: none;
            stroke: #1c0d04;
            stroke-width: 11.5;
            stroke-linecap: round;
            stroke-linejoin: round;
            filter: drop-shadow(0 3px 4px rgba(0, 0, 0, 0.95));
        }

        .turn-fuse-rope-core {
            fill: none;
            stroke: #78350f;
            stroke-width: 8.5;
            stroke-linecap: round;
            stroke-linejoin: round;
        }

        /* Gomos diagonais principais da corda trançada */
        .turn-fuse-rope-path {
            fill: none;
            stroke: #b45309;
            stroke-width: 7.5;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-dasharray: 7 4.5;
        }

        /* Sulcos escuros entre as torções da fibra da corda */
        .turn-fuse-rope-twist {
            fill: none;
            stroke: #451a03;
            stroke-width: 7.8;
            stroke-linecap: butt;
            stroke-linejoin: round;
            stroke-dasharray: 2.2 9.3;
            stroke-dashoffset: 5.5;
            opacity: 0.92;
        }

        /* Fibras douradas iluminadas no topo de cada gomo da corda */
        .turn-fuse-rope-highlight {
            fill: none;
            stroke: #fcd34d;
            stroke-width: 3.2;
            stroke-linecap: round;
            stroke-linejoin: round;
            stroke-dasharray: 3.8 7.7;
            stroke-dashoffset: 1.5;
            opacity: 0.85;
        }

        .turn-fuse-container.is-enemy-fuse .turn-fuse-rope-core,
        .turn-fuse-frontier.is-enemy-fuse .turn-fuse-rope-core {
            stroke: #7f1d1d;
        }

        .turn-fuse-container.is-enemy-fuse .turn-fuse-rope-path,
        .turn-fuse-frontier.is-enemy-fuse .turn-fuse-rope-path {
            stroke: #b91c1c;
        }

        .turn-fuse-container.is-enemy-fuse .turn-fuse-rope-highlight,
        .turn-fuse-frontier.is-enemy-fuse .turn-fuse-rope-highlight {
            stroke: #fca5a5;
        }

        /* 3. Fogo Vivo Realista Queimando a Ponta da Corda */
        .turn-fuse-spark {
            position: absolute;
            left: 4%;
            top: 48.6%;
            width: 36px;
            height: 36px;
            transform: translate(-50%, -50%);
            pointer-events: none;
            z-index: 36;
        }

        /* Brasa incandescente (carvão em brasa na ponta da corda sendo consumida) */
        .fuse-charred-tip {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 14px;
            height: 9px;
            transform: translate(-45%, -50%);
            border-radius: 50%;
            background: radial-gradient(
                ellipse at 40% 50%,
                #ffffff 0%,
                #fef08a 30%,
                #f97316 62%,
                #7f1d1d 88%,
                #1c0d04 100%
            );
            box-shadow:
                0 0 8px 2px #fef08a,
                0 0 16px 4px #ea580c,
                0 0 26px 6px rgba(220, 38, 38, 0.85);
            animation: fuseCoalPulse 0.14s infinite alternate ease-in-out;
        }

        /* Cluster de línguas de fogo orgânicas */
        .fuse-fire-cluster {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 34px;
            height: 40px;
            transform: translate(-50%, -74%);
            pointer-events: none;
            filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.9)) drop-shadow(0 -3px 14px rgba(220, 38, 38, 0.75));
        }

        .fuse-flame-halo {
            position: absolute;
            left: 50%;
            top: 58%;
            width: 38px;
            height: 38px;
            transform: translate(-50%, -50%);
            border-radius: 50%;
            background: radial-gradient(circle, rgba(251, 146, 60, 0.55) 0%, rgba(220, 38, 38, 0.22) 55%, rgba(0, 0, 0, 0) 75%);
            pointer-events: none;
        }

        .fuse-flame-tongue {
            position: absolute;
            bottom: 4px;
            left: 50%;
            transform-origin: 50% 90%;
            border-radius: 50% 50% 38% 38% / 68% 68% 32% 32%;
            pointer-events: none;
        }

        /* Língua externa rubro-alaranjada turbulenta */
        .fuse-flame-tongue--outer {
            width: 20px;
            height: 30px;
            margin-left: -10px;
            background: linear-gradient(180deg, rgba(220, 38, 38, 0.15) 0%, #dc2626 28%, #ea580c 68%, #f97316 100%);
            clip-path: polygon(50% 0%, 78% 24%, 96% 58%, 84% 92%, 50% 100%, 16% 92%, 4% 58%, 22% 24%);
            filter: blur(0.4px);
            animation: flameTongueOuter 0.19s infinite alternate ease-in-out;
        }

        /* Língua lateral esquerda lambendo o ar */
        .fuse-flame-tongue--left {
            width: 13px;
            height: 23px;
            margin-left: -11px;
            bottom: 5px;
            background: linear-gradient(180deg, rgba(234, 88, 12, 0.1) 0%, #ea580c 35%, #f59e0b 85%, #fde047 100%);
            clip-path: polygon(35% 0%, 82% 32%, 95% 74%, 60% 100%, 15% 88%, 5% 44%);
            animation: flameTongueLeft 0.16s infinite alternate ease-in-out;
        }

        /* Língua lateral direita lambendo o ar */
        .fuse-flame-tongue--right {
            width: 13px;
            height: 22px;
            margin-left: -2px;
            bottom: 5px;
            background: linear-gradient(180deg, rgba(234, 88, 12, 0.1) 0%, #f97316 35%, #fbbf24 85%, #fef08a 100%);
            clip-path: polygon(65% 0%, 95% 44%, 85% 88%, 40% 100%, 5% 74%, 18% 32%);
            animation: flameTongueRight 0.22s infinite alternate ease-in-out;
        }

        /* Chama intermediária dourada intensa */
        .fuse-flame-tongue--mid {
            width: 14px;
            height: 22px;
            margin-left: -7px;
            bottom: 4px;
            background: linear-gradient(180deg, #f97316 0%, #fbbf24 45%, #fef08a 90%);
            clip-path: polygon(50% 0%, 82% 30%, 92% 68%, 74% 96%, 50% 100%, 26% 96%, 8% 68%, 18% 30%);
            animation: flameTongueMid 0.14s infinite alternate ease-in-out;
        }

        /* Núcleo branco-azulado de altíssima temperatura no pavio */
        .fuse-flame-tongue--core {
            width: 8px;
            height: 12px;
            margin-left: -4px;
            bottom: 4px;
            background: radial-gradient(ellipse at 50% 70%, #ffffff 0%, #fef9c3 60%, rgba(253, 224, 71, 0) 100%);
            border-radius: 50%;
            animation: flameCoreFlicker 0.11s infinite alternate;
        }

        /* Fumaça realista subindo acima da chama */
        .fuse-smoke-plume {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 24px;
            height: 36px;
            transform: translate(-50%, -115%);
            pointer-events: none;
        }

        .fuse-smoke-wisp {
            position: absolute;
            bottom: 0;
            left: 50%;
            width: 9px;
            height: 9px;
            margin-left: -4.5px;
            border-radius: 50%;
            background: radial-gradient(circle, rgba(68, 64, 60, 0.65) 0%, rgba(28, 25, 23, 0) 75%);
            filter: blur(1px);
        }

        .fuse-smoke-wisp.w1 {
            animation: fuseSmokeRise1 0.85s infinite ease-out;
        }

        .fuse-smoke-wisp.w2 {
            animation: fuseSmokeRise2 1.05s 0.4s infinite ease-out;
        }

        /* Fagulhas incandescentes de pólvora espirrando da ponta da corda */
        .fuse-sparks-emitter {
            position: absolute;
            inset: 0;
            pointer-events: none;
        }

        .fuse-spark-pt {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 3px;
            height: 3px;
            border-radius: 50%;
            background: #fef9c3;
            box-shadow: 0 0 4px #fde047, 0 0 7px #f97316;
        }

        .fuse-spark-pt.p1 { animation: fuseSparkJet1 0.42s infinite ease-out; }
        .fuse-spark-pt.p2 { animation: fuseSparkJet2 0.36s 0.11s infinite ease-out; }
        .fuse-spark-pt.p3 { animation: fuseSparkJet3 0.48s 0.21s infinite ease-out; }
        .fuse-spark-pt.p4 { animation: fuseSparkJet4 0.39s 0.06s infinite ease-out; }
        .fuse-spark-pt.p5 { animation: fuseSparkJet5 0.45s 0.16s infinite ease-out; }
        .fuse-spark-pt.p6 { animation: fuseSparkJet6 0.34s 0.26s infinite ease-out; }

        /* Etiqueta de contagem regressiva acoplada abaixo da chama para não cobrir o fogo */
        .turn-fuse-bomb-tag {
            position: absolute;
            left: 50%;
            top: 15px;
            transform: translateX(-50%);
            display: inline-flex;
            align-items: center;
            gap: 2.5px;
            padding: 1.5px 6.5px;
            border-radius: 999px;
            background: linear-gradient(180deg, #3b0808 0%, #170303 100%);
            border: 1.5px solid #f59e0b;
            box-shadow:
                0 2px 0 #090303,
                0 4px 10px rgba(0, 0, 0, 0.95),
                0 0 10px rgba(249, 115, 22, 0.65);
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: 9.5px;
            line-height: 1;
            color: #fef08a;
            white-space: nowrap;
            text-shadow: 0 1px 2px #000;
            letter-spacing: 0.04em;
        }

        .turn-fuse-container.is-enemy-fuse .turn-fuse-bomb-tag,
        .turn-fuse-frontier.is-enemy-fuse .turn-fuse-bomb-tag {
            border-color: #f87171;
            color: #fecaca;
        }

        @keyframes fuseCoalPulse {
            0% { transform: translate(-45%, -50%) scale(0.92); filter: brightness(0.95); }
            100% { transform: translate(-45%, -50%) scale(1.12); filter: brightness(1.25); }
        }

        @keyframes flameTongueOuter {
            0% { transform: scaleX(0.92) scaleY(0.9) skewX(-6deg) rotate(-4deg); }
            50% { transform: scaleX(1.06) scaleY(1.12) skewX(5deg) rotate(3deg); }
            100% { transform: scaleX(0.95) scaleY(1.04) skewX(-4deg) rotate(6deg); }
        }

        @keyframes flameTongueLeft {
            0% { transform: rotate(-18deg) scaleY(0.84) skewX(-8deg); opacity: 0.85; }
            100% { transform: rotate(-6deg) scaleY(1.18) skewX(4deg); opacity: 1; }
        }

        @keyframes flameTongueRight {
            0% { transform: rotate(8deg) scaleY(1.15) skewX(6deg); opacity: 1; }
            100% { transform: rotate(22deg) scaleY(0.82) skewX(-5deg); opacity: 0.82; }
        }

        @keyframes flameTongueMid {
            0% { transform: scaleX(0.88) scaleY(0.92) rotate(4deg); }
            100% { transform: scaleX(1.08) scaleY(1.15) rotate(-5deg); }
        }

        @keyframes flameCoreFlicker {
            0% { transform: scale(0.88); opacity: 0.9; }
            100% { transform: scale(1.16); opacity: 1; }
        }

        @keyframes fuseSmokeRise1 {
            0% { transform: translate(0, 0) scale(0.6); opacity: 0.65; }
            100% { transform: translate(-7px, -22px) scale(2.1); opacity: 0; }
        }

        @keyframes fuseSmokeRise2 {
            0% { transform: translate(0, 0) scale(0.5); opacity: 0.55; }
            100% { transform: translate(6px, -25px) scale(2.3); opacity: 0; }
        }

        @keyframes fuseSparkJet1 {
            0% { transform: translate(0, 0) scale(1); opacity: 1; }
            100% { transform: translate(-16px, -14px) scale(0.2); opacity: 0; }
        }
        @keyframes fuseSparkJet2 {
            0% { transform: translate(0, 0) scale(1.1); opacity: 1; }
            100% { transform: translate(14px, -18px) scale(0.15); opacity: 0; }
        }
        @keyframes fuseSparkJet3 {
            0% { transform: translate(0, 0) scale(0.9); opacity: 1; }
            100% { transform: translate(-19px, 7px) scale(0.2); opacity: 0; }
        }
        @keyframes fuseSparkJet4 {
            0% { transform: translate(0, 0) scale(1); opacity: 1; }
            100% { transform: translate(17px, -6px) scale(0.2); opacity: 0; }
        }
        @keyframes fuseSparkJet5 {
            0% { transform: translate(0, 0) scale(1.1); opacity: 1; }
            100% { transform: translate(-6px, -23px) scale(0.1); opacity: 0; }
        }
        @keyframes fuseSparkJet6 {
            0% { transform: translate(0, 0) scale(0.9); opacity: 1; }
            100% { transform: translate(11px, 11px) scale(0.2); opacity: 0; }
        }

        /* ================= CLÍMAX DE FIM DE BARALHO: MORTE SÚBITA / FADIGA ================= */
        /* Screen Shake Sutil de Alta Tensão */
        #board-stage.sudden-death-shake {
            animation: suddenDeathBoardShake 0.58s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
        }

        @keyframes suddenDeathBoardShake {
            0%, 100% { transform: translate3d(0, 0, 0); }
            12% { transform: translate3d(-6px, 4px, 0) rotate(-0.4deg); }
            24% { transform: translate3d(6px, -4px, 0) rotate(0.4deg); }
            38% { transform: translate3d(-5px, -3px, 0) rotate(-0.25deg); }
            52% { transform: translate3d(5px, 3px, 0) rotate(0.25deg); }
            68% { transform: translate3d(-3px, 2px, 0); }
            84% { transform: translate3d(2px, -1px, 0); }
        }

        /* Vinheta Avermelhada & Névoa Abissal Pulsando no Ritmo de Batimentos Cardíacos */
        .sudden-death-vignette {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 42;
            opacity: 0;
            transition: opacity 0.45s ease;
            background:
                radial-gradient(ellipse at 50% 50%, rgba(0, 0, 0, 0) 46%, rgba(127, 29, 29, 0.42) 78%, rgba(69, 10, 10, 0.85) 100%);
            box-shadow:
                inset 0 0 42px rgba(220, 38, 38, 0.65),
                inset 0 0 95px rgba(24, 4, 4, 0.92);
        }

        #board-stage.in-sudden-death .sudden-death-vignette {
            opacity: 1;
            animation: suddenDeathHeartbeat var(--heartbeat-duration, 860ms) infinite ease-in-out;
        }

        @keyframes suddenDeathHeartbeat {
            0% {
                opacity: 0.58;
                box-shadow: inset 0 0 32px rgba(220, 38, 38, 0.45), inset 0 0 75px rgba(15, 2, 2, 0.85);
            }
            16% {
                opacity: 0.96;
                box-shadow: inset 0 0 64px rgba(239, 68, 68, 0.88), inset 0 0 120px rgba(69, 10, 10, 0.96);
            }
            28% {
                opacity: 0.68;
            }
            42% {
                opacity: 0.88;
                box-shadow: inset 0 0 52px rgba(220, 38, 38, 0.78), inset 0 0 105px rgba(45, 6, 6, 0.92);
            }
            100% {
                opacity: 0.58;
                box-shadow: inset 0 0 32px rgba(220, 38, 38, 0.45), inset 0 0 75px rgba(15, 2, 2, 0.85);
            }
        }

        /* Flash Sombrio/Avermelhado de Entrada e Dano de Fadiga */
        .sudden-death-flash {
            position: absolute;
            inset: 0;
            pointer-events: none;
            z-index: 54;
            opacity: 0;
            background: radial-gradient(circle at 50% 50%, rgba(239, 68, 68, 0.45) 0%, rgba(127, 29, 29, 0.78) 60%, rgba(9, 2, 4, 0.95) 100%);
        }

        .sudden-death-flash.is-flashing {
            animation: suddenDeathFlashAnim 0.75s ease-out forwards;
        }

        @keyframes suddenDeathFlashAnim {
            0% { opacity: 0.95; }
            25% { opacity: 0.65; }
            100% { opacity: 0; }
        }

        /* Banner Dramático de Impacto ("MORTE SÚBITA: O VAZIO CONSOME SUA ALMA") */
        .sudden-death-banner {
            position: absolute;
            left: 50%;
            top: 48.6%;
            transform: translate(-50%, -50%) scale(0.82);
            width: min(92%, 440px);
            pointer-events: none;
            z-index: 55;
            opacity: 0;
            transition: opacity 0.28s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .sudden-death-banner.is-visible {
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
        }

        .sudden-death-banner-card {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 14px;
            border-radius: 14px;
            background: linear-gradient(180deg, rgba(42, 6, 10, 0.97) 0%, rgba(15, 3, 6, 0.98) 100%);
            border: 2px solid #ef4444;
            box-shadow:
                0 0 0 1px #450a0a,
                0 10px 28px rgba(0, 0, 0, 0.95),
                0 0 28px rgba(220, 38, 38, 0.75),
                inset 0 1px 0 rgba(254, 202, 202, 0.35);
        }

        .sudden-death-skull-crest {
            width: 38px;
            height: 38px;
            border-radius: 10px;
            background: radial-gradient(circle, #7f1d1d 0%, #2a0508 100%);
            border: 1.5px solid #f87171;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            flex-shrink: 0;
            box-shadow: 0 0 12px rgba(239, 68, 68, 0.65);
        }

        .sudden-death-banner-texts {
            min-width: 0;
            flex: 1;
            text-align: left;
        }

        .sudden-death-banner-title {
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(10.5px, 2.8vw, 13.5px);
            color: #fecaca;
            letter-spacing: 0.05em;
            text-shadow: 0 2px 4px #000, 0 0 10px #dc2626;
            line-height: 1.15;
        }

        .sudden-death-banner-sub {
            font-size: clamp(8.5px, 2.2vw, 10px);
            font-weight: 800;
            color: #fca5a5;
            letter-spacing: 0.04em;
            margin-top: 2px;
        }

        .sudden-death-banner-dmg {
            display: inline-block;
            margin-top: 4px;
            padding: 1.5px 7px;
            border-radius: 999px;
            background: rgba(153, 27, 27, 0.65);
            border: 1px solid rgba(252, 165, 165, 0.55);
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(8.5px, 2.2vw, 10px);
            color: #fef08a;
            text-shadow: 0 1px 2px #000;
        }

        /* Poeira e Brasas Subindo do Monte de Compras Vazio (Grimório Esgotado) */
        .deck-counter-slot.is-deck-empty {
            color: #f87171 !important;
            text-shadow: 0 0 6px rgba(239, 68, 68, 0.85);
        }

        .deck-counter-slot.is-deck-empty i.fa-book-bookmark,
        .deck-counter-slot.is-deck-empty i.fa-skull {
            color: #ef4444 !important;
            filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.9));
            animation: emptyDeckIconPulse 1.1s infinite alternate ease-in-out;
        }

        .fatigue-mini-badge {
            padding: 0.5px 4px;
            border-radius: 4px;
            background: linear-gradient(180deg, #7f1d1d 0%, #3b0707 100%);
            border: 1px solid #f87171;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: 8.5px;
            color: #fef08a;
            line-height: 1.1;
            box-shadow: 0 0 6px rgba(239, 68, 68, 0.6);
        }

        .deck-empty-embers {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 60%;
            height: 26px;
            pointer-events: none;
            opacity: 0;
            overflow: visible;
        }

        .deck-counter-slot.is-deck-empty .deck-empty-embers {
            opacity: 1;
        }

        .ember-speck {
            position: absolute;
            bottom: 0;
            width: 3.5px;
            height: 3.5px;
            border-radius: 50%;
            background: radial-gradient(circle, #fef08a 0%, #f97316 55%, #dc2626 100%);
            box-shadow: 0 0 5px #ef4444;
            opacity: 0;
        }

        .ember-speck.e1 { left: 12%; animation: deckEmberRise 1.3s infinite ease-out; }
        .ember-speck.e2 { left: 34%; animation: deckEmberRise 1.6s 0.35s infinite ease-out; width: 2.5px; height: 2.5px; background: #a8a29e; box-shadow: none; }
        .ember-speck.e3 { left: 56%; animation: deckEmberRise 1.15s 0.65s infinite ease-out; }
        .ember-speck.e4 { left: 74%; animation: deckEmberRise 1.45s 0.2s infinite ease-out; width: 3px; height: 3px; }
        .ember-speck.e5 { left: 88%; animation: deckEmberRise 1.55s 0.8s infinite ease-out; width: 2.5px; height: 2.5px; background: #d6d3d1; box-shadow: none; }

        @keyframes deckEmberRise {
            0% { transform: translateY(4px) scale(0.8); opacity: 0.95; }
            60% { opacity: 0.75; }
            100% { transform: translateY(-22px) translateX(4px) scale(0.2); opacity: 0; }
        }

        @keyframes emptyDeckIconPulse {
            0% { transform: scale(0.94); }
            100% { transform: scale(1.12); }
        }

        /* Alerta Visual no Temporizador / Botão de Turno durante Morte Súbita */
        #end-turn-btn.is-sudden-death-alert {
            border-color: #ef4444 !important;
            box-shadow:
                inset 0 1.5px 0 rgba(255, 255, 255, 0.25),
                0 4px 0 #1f0505,
                0 6px 0 1.5px #000000,
                0 0 18px rgba(239, 68, 68, 0.78) !important;
        }

        /* SLOTS DEMARCADOS NAS LANES DA MESA (1030 × 1526) */
        .board-card-row {
            position: absolute !important;
            top: 0;
            bottom: 0;
            height: 100%;
            display: grid;
            align-items: center;
            justify-items: center;
            pointer-events: auto;
        }

        /* Backline (4 molduras demarcadas: 15.8%–31.2%, 33.5%–48.9%, 51.1%–66.5%, 68.8%–84.2%) */
        .enemy-backline-cards,
        .player-backline-cards {
            left: 15.8%;
            right: 15.8%;
            width: 68.4%;
            grid-template-columns: repeat(4, 1fr);
            column-gap: 3.31%;
        }

        /* Frontline (3 molduras demarcadas: 23.3%–38.7%, 42.3%–57.7%, 61.3%–76.7%) */
        .enemy-frontline-cards,
        .player-frontline-cards {
            left: 23.3%;
            right: 23.3%;
            width: 53.4%;
            grid-template-columns: repeat(3, 1fr);
            column-gap: 6.74%;
        }

        /* Posicionamento centralizado padrão quando a carta não possui grid-column explícito */
        .enemy-frontline-cards > .tcg-board-card:not([style*="grid-column"]):first-child:last-child,
        .player-frontline-cards > .tcg-board-card:not([style*="grid-column"]):first-child:last-child {
            grid-column: 2;
        }

        .enemy-backline-cards > .tcg-board-card:not([style*="grid-column"]):first-child:last-child,
        .player-backline-cards > .tcg-board-card:not([style*="grid-column"]):first-child:last-child {
            grid-column: 2;
        }

        .enemy-backline-cards > .tcg-board-card:not([style*="grid-column"]):first-child:nth-last-child(2),
        .player-backline-cards > .tcg-board-card:not([style*="grid-column"]):first-child:nth-last-child(2) {
            grid-column: 2;
        }

        /* CARTAS DO TABULEIRO PREENCHENDO EXATAMENTE CADA SLOT DEMARCADO DA SKIN */
        .tcg-board-card {
            width: 100%;
            max-width: 100%;
            aspect-ratio: 1000 / 1030;
            position: relative;
            flex-shrink: 0;
        }

        /* HUD DO HERÓI INIMIGO (PLACA 3D ESTILO TORRE DO REI / CLASH ROYALE: 0% A 19.5%) */
        .enemy-hero-hud {
            position: absolute;
            top: 1.3%;
            left: 2.2%;
            width: clamp(160px, 43%, 285px);
            display: flex;
            flex-direction: column;
            gap: 4.5px;
            padding: 5px 8px;
            border-radius: 13px;
            background: linear-gradient(180deg, #27181D 0%, #151218 100%);
            border: 2px solid #5C2831;
            box-shadow:
                inset 0 1.5px 0 rgba(255, 255, 255, 0.16),
                0 4px 0 #09070B,
                0 8px 18px rgba(0, 0, 0, 0.85);
            z-index: 22;
        }

        /* DOCA DA MÃO INIMIGA (SUPERIOR DIREITA AMPLIADA EM LEQUE) */
        .enemy-hand-dock {
            position: absolute;
            top: 1.1%;
            left: clamp(168px, 44.5%, 295px);
            right: 2.2%;
            height: 17.5%;
            display: flex;
            align-items: flex-start;
            justify-content: flex-end;
            padding-top: 3px;
            padding-right: 6px;
            z-index: 20;
            overflow: visible;
            pointer-events: none;
        }

        /* Animação humana da IA folheando e escolhendo cartas */
        .enemy-card-browsing {
            transform: translateY(10px) scale(1.1) !important;
            filter: brightness(1.25) drop-shadow(0 0 12px rgba(250, 204, 21, 0.85)) !important;
            box-shadow: 0 0 16px rgba(250, 204, 21, 0.9), 0 0 0 1.5px #facc15 !important;
            z-index: 35 !important;
        }

        .enemy-card-chosen {
            transform: translateY(16px) scale(1.15) !important;
            filter: brightness(1.3) drop-shadow(0 0 18px rgba(239, 68, 68, 0.95)) !important;
            box-shadow: 0 0 20px rgba(239, 68, 68, 0.95), 0 0 0 2px #ef4444 !important;
            z-index: 40 !important;
        }

        /* BOTÃO PASSAR TURNO 3D FORJADO + PAVIO DE EXPLOSÃO (ALINHADO COM A FRONTLINE DO JOGADOR: 58.2%) */
        .end-turn-dock {
            position: absolute;
            right: 1.2%;
            top: 58.2%;
            transform: translateY(-50%);
            z-index: 46;
            display: flex;
            align-items: center;
            justify-content: center;
            pointer-events: auto;
        }

        #end-turn-btn {
            position: relative;
            width: clamp(68px, 13.8vw, 84px);
            height: clamp(50px, 9.8vw, 62px);
            padding: 4px;
            border-radius: 15px;
            background: linear-gradient(180deg, #3b332b 0%, #1c1815 55%, #0e0c0a 100%);
            border: 2px solid #6b5842;
            box-shadow:
                inset 0 1.5px 0 rgba(255, 255, 255, 0.22),
                0 4px 0 #070605,
                0 6px 0 1.5px #000000,
                0 10px 18px rgba(0, 0, 0, 0.9);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: transform 0.14s cubic-bezier(0.2, 0.9, 0.3, 1.2), filter 0.2s ease, box-shadow 0.2s ease;
            pointer-events: auto;
            touch-action: manipulation;
            user-select: none;
            overflow: visible;
        }

        /* Bocal metálico onde o pavio de bomba entra no topo do botão */
        #end-turn-btn::after {
            content: '';
            position: absolute;
            top: -6px;
            left: 50%;
            transform: translateX(-50%);
            width: 14px;
            height: 7px;
            border-radius: 4px 4px 1px 1px;
            background: linear-gradient(180deg, #92400e 0%, #451a03 100%);
            border: 1.5px solid #fbbf24;
            box-shadow: 0 -1px 3px rgba(0, 0, 0, 0.8), 0 0 6px rgba(245, 158, 11, 0.4);
            z-index: 6;
            pointer-events: none;
        }

        /* Rebites mecânicos nos cantos do alojamento do botão */
        #end-turn-btn::before {
            content: '';
            position: absolute;
            inset: 2px;
            border-radius: 12px;
            border: 1px solid rgba(212, 175, 55, 0.22);
            pointer-events: none;
            z-index: 1;
        }

        /* Cápsula 3D tátil interna (a alavanca/botão que afunda fisicamente) */
        .end-turn-cap {
            position: relative;
            width: 100% !important;
            height: 100% !important;
            border-radius: 10px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 1px;
            padding: 2px 4px;
            flex-shrink: 0;
            box-sizing: border-box;
            min-width: 0;
            background: linear-gradient(180deg, #fbbf24 0%, #d97706 50%, #92400e 100%);
            border: 1.5px solid #fef08a;
            box-shadow:
                inset 0 2px 0 rgba(255, 255, 255, 0.65),
                inset 0 -3px 0 rgba(69, 26, 3, 0.8),
                0 3px 0 #451a03,
                0 4px 8px rgba(0, 0, 0, 0.75);
            transform: translateY(-2px);
            transition: all 0.15s cubic-bezier(0.2, 0.9, 0.3, 1.2);
            z-index: 3;
            overflow: hidden;
        }

        #end-turn-ready-badge {
            display: none !important;
        }

        /* Reflexo vítreo superior estilo Clash Royale / Hearthstone */
        .end-turn-cap::after {
            content: '';
            position: absolute;
            top: 1px;
            left: 3px;
            right: 3px;
            height: 44%;
            border-radius: 7px 7px 50% 50% / 7px 7px 4px 4px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.04) 100%);
            pointer-events: none;
        }

        .end-turn-crest {
            font-size: clamp(11px, 2.2vw, 14px);
            line-height: 1;
            filter: drop-shadow(0 1.5px 1px rgba(0, 0, 0, 0.85));
            margin-bottom: 1px;
        }

        .end-turn-main-label {
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: clamp(9px, 1.85vw, 11.5px);
            line-height: 1.02;
            letter-spacing: 0.05em;
            color: #fffbeb;
            text-transform: uppercase;
            -webkit-text-stroke: 2px #1c0d02;
            paint-order: stroke fill;
            text-shadow: 0 1.5px 0 #1c0d02, 0 2px 3px rgba(0, 0, 0, 0.9);
        }

        .end-turn-sub-label {
            font-family: var(--font-body, 'Outfit', 'Inter', sans-serif);
            font-weight: 800;
            font-size: clamp(7px, 1.35vw, 8.5px);
            line-height: 1;
            letter-spacing: 0.08em;
            color: #fef08a;
            text-transform: uppercase;
            text-shadow: 0 1px 2px #000000;
        }

        /* Hover e clique físicos quando é o turno do jogador */
        #end-turn-btn:not(.is-enemy-turn):hover {
            transform: translateY(-1px) scale(1.04);
            filter: brightness(1.07);
        }

        #end-turn-btn:not(.is-enemy-turn):hover .end-turn-cap {
            transform: translateY(-3px);
            box-shadow:
                inset 0 2px 0 rgba(255, 255, 255, 0.78),
                inset 0 -3px 0 rgba(69, 26, 3, 0.8),
                0 4px 0 #451a03,
                0 0 14px rgba(250, 204, 21, 0.65);
        }

        #end-turn-btn:not(.is-enemy-turn):active .end-turn-cap,
        #end-turn-btn.is-fuse-detonating .end-turn-cap {
            transform: translateY(1.5px) !important;
            box-shadow:
                inset 0 2px 4px rgba(0, 0, 0, 0.65),
                0 0 0 #451a03 !important;
        }

        /* ESTADO 2: PRONTO / SEM JOGADAS RESTANTES (VERDE ESMERALDA RADIANTE) */
        #end-turn-btn.end-turn-ready-glow,
        #end-turn-btn.is-ready-glow {
            border-color: #34d399;
            animation: endTurnReadyPulse 1.5s infinite alternate;
        }

        #end-turn-btn.end-turn-ready-glow .end-turn-cap,
        #end-turn-btn.is-ready-glow .end-turn-cap {
            background: linear-gradient(180deg, #34d399 0%, #10b981 48%, #047857 100%);
            border-color: #a7f3d0;
            box-shadow:
                inset 0 2px 0 rgba(255, 255, 255, 0.7),
                inset 0 -3px 0 rgba(2, 44, 34, 0.85),
                0 3px 0 #022c22,
                0 0 16px rgba(16, 185, 129, 0.75);
        }

        #end-turn-btn.end-turn-ready-glow .end-turn-main-label,
        #end-turn-btn.is-ready-glow .end-turn-main-label {
            -webkit-text-stroke: 2px #022c22;
            text-shadow: 0 1.5px 0 #022c22, 0 2px 3px rgba(0, 0, 0, 0.9);
        }

        #end-turn-btn.end-turn-ready-glow .end-turn-sub-label,
        #end-turn-btn.is-ready-glow .end-turn-sub-label {
            color: #d1fae5;
        }

        /* ESTADO 3: TURNO DO OPONENTE (BOTÃO REBAIXADO EM FERRO ESCURO) */
        #end-turn-btn.is-enemy-turn {
            cursor: default;
            border-color: #334155;
        }

        #end-turn-btn.is-enemy-turn .end-turn-cap {
            background: linear-gradient(180deg, #334155 0%, #1e293b 55%, #0f172a 100%);
            border-color: #475569;
            box-shadow:
                inset 0 2px 4px rgba(0, 0, 0, 0.75),
                inset 0 -1px 0 rgba(255, 255, 255, 0.08),
                0 1px 0 #020617;
            transform: translateY(1px);
        }

        #end-turn-btn.is-enemy-turn .end-turn-main-label {
            color: #94a3b8;
            -webkit-text-stroke: 2px #020617;
        }

        #end-turn-btn.is-enemy-turn .end-turn-sub-label {
            color: #64748b;
        }

        /* ESTADO 4: PAVIO QUEIMANDO NOS ÚLTIMOS 10 SEGUNDOS (ALERTA DE BOMBA NO BOTÃO) */
        .end-turn-fuse-svg {
            position: absolute;
            inset: -4px;
            width: calc(100% + 8px);
            height: calc(100% + 8px);
            pointer-events: none;
            z-index: 5;
            opacity: 0;
            transition: opacity 0.2s ease;
        }

        #end-turn-btn.is-fuse-burning .end-turn-fuse-svg {
            opacity: 1;
        }

        .end-turn-fuse-track-rect {
            fill: none;
            stroke: rgba(28, 10, 4, 0.85);
            stroke-width: 3.5;
        }

        .end-turn-fuse-burn-rect {
            fill: none;
            stroke: #f97316;
            stroke-width: 3.5;
            stroke-linecap: round;
            stroke-dasharray: 260;
            stroke-dashoffset: calc(260 - (260 * var(--fuse-pct-num, 100) / 100));
            filter: drop-shadow(0 0 6px #fef08a) drop-shadow(0 0 10px #ef4444);
            transition: stroke-dashoffset 0.1s linear;
        }

        #end-turn-btn.is-fuse-burning {
            border-color: #f97316 !important;
            box-shadow:
                inset 0 1.5px 0 rgba(255, 255, 255, 0.3),
                0 4px 0 #450a0a,
                0 6px 0 1.5px #000000,
                0 0 20px rgba(249, 115, 22, 0.85) !important;
        }

        #end-turn-btn.is-fuse-critical {
            animation: endTurnBombShake 0.22s infinite alternate !important;
        }

        #end-turn-btn.is-fuse-critical .end-turn-cap {
            background: linear-gradient(180deg, #f87171 0%, #dc2626 52%, #7f1d1d 100%) !important;
            border-color: #fef08a !important;
        }

        /* Selo da Bomba no canto superior do botão durante a contagem de 10s */
        .end-turn-fuse-badge {
            position: absolute;
            top: -11px;
            left: 50%;
            transform: translateX(-50%) scale(0.7);
            display: inline-flex;
            align-items: center;
            gap: 2px;
            padding: 1.5px 6px;
            border-radius: 999px;
            background: linear-gradient(180deg, #7f1d1d 0%, #2a0606 100%);
            border: 1.5px solid #fbbf24;
            box-shadow: 0 2px 0 #000, 0 0 12px rgba(239, 68, 68, 0.95);
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: 9.5px;
            line-height: 1;
            color: #fef08a;
            white-space: nowrap;
            z-index: 8;
            opacity: 0;
            pointer-events: none;
            transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        #end-turn-btn.is-fuse-burning .end-turn-fuse-badge {
            opacity: 1;
            transform: translateX(-50%) scale(1);
        }

        /* ONDA DE CHOQUE DA EXPLOSÃO QUANDO O PAVIO CHEGA AO FIM (0s) */
        .end-turn-explosion-ring {
            position: absolute;
            inset: -8px;
            border-radius: 20px;
            background: radial-gradient(circle, rgba(255, 255, 255, 0.95) 0%, rgba(254, 240, 138, 0.9) 30%, rgba(249, 115, 22, 0.85) 60%, rgba(220, 38, 38, 0) 78%);
            border: 3px solid #fef08a;
            box-shadow: 0 0 32px #f97316, 0 0 60px #dc2626;
            opacity: 0;
            transform: scale(0.3);
            pointer-events: none;
            z-index: 12;
        }

        #end-turn-btn.is-fuse-detonating .end-turn-explosion-ring {
            animation: endTurnBombBlast 0.62s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        @keyframes endTurnReadyPulse {
            0% { box-shadow: 0 4px 0 #070605, 0 6px 0 1.5px #000, 0 0 10px rgba(16, 185, 129, 0.55); }
            100% { box-shadow: 0 4px 0 #070605, 0 6px 0 1.5px #000, 0 0 24px rgba(52, 211, 153, 0.95); }
        }

        @keyframes endTurnBombShake {
            0% { transform: translate(-1.5px, -1px) rotate(-1.5deg); }
            100% { transform: translate(1.5px, 1px) rotate(1.5deg); }
        }

        @keyframes endTurnBombBlast {
            0% { opacity: 1; transform: scale(0.45); }
            45% { opacity: 1; transform: scale(1.75); }
            100% { opacity: 0; transform: scale(2.45); }
        }

        /* CONSOLE DO HERÓI DO JOGADOR (PLACA 3D ESTILO ARENA TCG: 77.8% A 98.6%) */
        .player-hero-console {
            position: absolute;
            top: 78.2%;
            bottom: 1.5%;
            left: 2.2%;
            width: clamp(142px, 33.5%, 228px);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            gap: 4px;
            padding: 5px 8px;
            border-radius: 13px;
            background: linear-gradient(180deg, #1E2536 0%, #111622 100%);
            border: 2px solid #4A5B7C;
            box-shadow:
                inset 0 1.5px 0 rgba(255, 255, 255, 0.18),
                0 4px 0 #080B12,
                0 8px 20px rgba(0, 0, 0, 0.88);
            z-index: 42;
            pointer-events: auto;
            overflow: hidden;
        }

        .player-hero-controls-row {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-wrap: nowrap;
            width: 100%;
        }

        /* Oculta permanentemente os antigos slots inline de arma/artefato da barra do herói */
        #slot-weapon,
        #slot-artifact {
            display: none !important;
        }

        /* ESTILOS DOS SLOTS DO PAPERDOLL DE EQUIPAMENTOS (ESTILO CLÁSSICO TIBIA) */
        .tibia-paperdoll-slot {
            width: 66px;
            height: 66px;
            background: linear-gradient(180deg, #182030 0%, #0d121c 100%);
            border: 2px solid #2f3e58;
            border-radius: 10px;
            box-shadow: inset 0 2px 5px rgba(0,0,0,0.85), 0 2px 4px rgba(0,0,0,0.5);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            position: relative;
            cursor: pointer;
            user-select: none;
            transition: all 0.15s ease;
        }

        .tibia-paperdoll-slot:hover {
            border-color: #64748b;
            transform: translateY(-1px);
            background: linear-gradient(180deg, #222d42 0%, #121927 100%);
        }

        .tibia-paperdoll-slot:active {
            transform: translateY(1px);
        }

        .tibia-paperdoll-slot.equipped {
            background: linear-gradient(180deg, #2a2012 0%, #151009 100%);
            border-color: #eab308;
            box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 0 10px rgba(234, 179, 8, 0.35);
        }

        .tibia-paperdoll-slot.equipped.rune-slot {
            background: linear-gradient(180deg, #26122d 0%, #130917 100%);
            border-color: #c084fc;
            box-shadow: inset 0 2px 6px rgba(0,0,0,0.7), 0 0 10px rgba(192, 132, 252, 0.4);
        }

        .tibia-paperdoll-slot.selected-slot {
            outline: 2px solid #38bdf8;
            outline-offset: 1px;
            border-color: #7dd3fc;
        }

        .tibia-paperdoll-slot .slot-watermark {
            color: rgba(148, 163, 184, 0.22);
            font-size: 20px;
            margin-bottom: 2px;
            transition: color 0.15s ease;
        }

        .tibia-paperdoll-slot:hover .slot-watermark {
            color: rgba(148, 163, 184, 0.45);
        }

        .tibia-paperdoll-slot .slot-label {
            font-size: 8px;
            font-weight: 800;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.04em;
            line-height: 1;
        }

        /* SLOTS DE DECK EM MODO FULL (RESPONSIVO MOBILE-FIRST) */
        .tcg-deck-slot-full {
            width: 100%;
            aspect-ratio: 682 / 1024;
            border-radius: 6px;
            position: relative;
            cursor: pointer;
            overflow: hidden;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
            transition: transform 0.15s ease, box-shadow 0.15s ease;
            user-select: none;
            -webkit-user-select: none;
        }

        .tcg-deck-slot-full:hover {
            transform: translateY(-2px) scale(1.02);
            box-shadow: 0 6px 14px rgba(0, 0, 0, 0.9), 0 0 10px rgba(234, 179, 8, 0.3);
        }

        .tcg-deck-slot-full:active {
            transform: scale(0.96);
        }

        .tcg-deck-slot-full .tcg-layered-card {
            pointer-events: none !important;
        }

        .tcg-deck-slot-empty {
            width: 100%;
            aspect-ratio: 682 / 1024;
            border-radius: 6px;
            border: 1.5px dashed rgba(245, 158, 11, 0.35);
            background: linear-gradient(180deg, rgba(20, 24, 34, 0.6) 0%, rgba(10, 12, 18, 0.8) 100%);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.15s ease;
            user-select: none;
            -webkit-user-select: none;
        }

        .tcg-deck-slot-empty:hover {
            border-color: #f59e0b;
            background: linear-gradient(180deg, rgba(35, 30, 20, 0.7) 0%, rgba(18, 15, 10, 0.9) 100%);
            transform: translateY(-2px);
            box-shadow: 0 0 12px rgba(245, 158, 11, 0.3);
        }

        .tcg-deck-slot-empty:active {
            transform: scale(0.96);
        }

        .tcg-picker-card-item {
            cursor: pointer;
            user-select: none;
            -webkit-user-select: none;
            transition: transform 0.15s ease, box-shadow 0.15s ease;
        }

        .tcg-picker-card-item:hover {
            transform: translateY(-2px) scale(1.03);
            box-shadow: 0 6px 16px rgba(0, 0, 0, 0.9), 0 0 12px rgba(234, 179, 8, 0.35);
        }

        .tcg-picker-card-item:active {
            transform: scale(0.96);
        }

        .tcg-picker-card-item .tcg-layered-card {
            pointer-events: none !important;
        }

        /* Linha 3: Barra de Mana / Elixir Segmentada em 10 Cristais (Estilo Clash Royale) */
        .player-mana-row {
            display: flex;
            align-items: center;
            gap: 5px;
            width: 100%;
            background: #0A0E17;
            border: 2px solid #2A3C5C;
            box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.95), 0 1px 0 rgba(255, 255, 255, 0.1);
            padding: 3px 6px 3px 5px;
            border-radius: 9px;
            box-sizing: border-box;
            user-select: none;
            -webkit-user-select: none;
        }

        .player-mana-row .tibia-mana-icon {
            width: 16px;
            height: 16px;
            object-fit: contain;
            filter: drop-shadow(0 1px 2px #000) drop-shadow(0 0 4px rgba(56, 189, 248, 0.85));
            flex-shrink: 0;
            pointer-events: none;
        }

        .player-mana-row .tibia-mana-track {
            flex: 1 1 auto;
            width: auto;
            min-width: 45px;
            height: 12px;
            display: block !important;
        }

        .player-mana-row .tibia-mana-num {
            font-size: 10px;
            font-weight: 900;
            color: #F0F9FF;
            font-family: 'Cinzel', 'Inter', sans-serif;
            text-shadow: 0 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
            flex-shrink: 0;
            white-space: nowrap;
        }

        /* AJUSTES FLUIDOS VIA CONTAINER QUERIES CONFORME A ALTURA/LARGURA DA MESA */
        @container board (max-width: 580px) {
            #slot-weapon,
            #slot-artifact {
                display: none !important;
            }
            #mobile-equip-btn {
                display: flex !important;
            }
            #hp-desc {
                display: none !important;
            }
            #enemy-equip-summary {
                display: none !important;
            }
            .enemy-hero-hud,
            .player-hero-console {
                padding: 3.5px 6px !important;
                gap: 3px !important;
            }
            #end-turn-img {
                width: 4.4rem !important;
                height: 4.4rem !important;
            }
        }

        @container board (max-width: 460px) {
            #player-name,
            #enemy-name {
                font-size: 9px !important;
            }
            #player-hero-box,
            #enemy-hero-box {
                padding: 2.5px 4px !important;
            }
            #end-turn-img {
                width: 3.8rem !important;
                height: 3.8rem !important;
            }
        }

        /* DOCA DA MÃO DO JOGADOR EM LEQUE (ÁREA INFERIOR AMPLIADA: 77.6% A 98.8%) */
        .player-hand-dock {
            position: absolute;
            top: 77.6%;
            bottom: 1.2%;
            left: clamp(150px, 35.5%, 242px);
            right: 1.8%;
            height: auto;
            min-height: 20.5%;
            display: flex;
            align-items: flex-end;
            justify-content: flex-end;
            padding-bottom: 4px;
            padding-right: 6px;
            z-index: 40;
            overflow: visible;
            pointer-events: auto;
            background: linear-gradient(180deg, transparent 0%, rgba(10, 12, 16, 0.3) 40%, rgba(10, 12, 16, 0.78) 100%);
            border-radius: 10px;
        }

        .tcg-card.target-drop-hover,
        .target-drop-hover,
        #enemy-hero-box.target-drop-hover {
            transform: scale(1.08);
            box-shadow: 0 0 24px #ef4444, 0 0 12px #facc15;
            border-color: #facc15;
        }

        #attack-drag-reticle {
            pointer-events: none;
            will-change: transform, left, top;
        }

        #attack-drag-reticle svg {
            filter: drop-shadow(0 0 12px rgba(239, 68, 68, 0.95));
            animation: reticlePulse 1.4s ease-in-out infinite;
        }

        @keyframes reticlePulse {
            0%, 100% {
                filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.85));
            }
            50% {
                filter: drop-shadow(0 0 18px rgba(248, 113, 113, 1));
            }
        }

        /* ================= MÃO DO ADVERSÁRIO (VERSO DA CARTA) ================= */
        .enemy-card-back {
            position: relative;
            aspect-ratio: 682 / 1024;
            border-radius: 7px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.85), inset 0 0 0 1px rgba(251, 191, 36, 0.35);
            border: 1.5px solid #785a28;
            background-color: #0d0f14;
            transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.25, 1), filter 0.22s ease-out, box-shadow 0.2s ease, opacity 0.25s ease;
            transform-origin: top center;
            overflow: hidden;
            flex-shrink: 0;
            pointer-events: auto;
            cursor: default;
            user-select: none;
            -webkit-user-select: none;
            touch-action: none;
        }

        .enemy-card-back:hover {
            transform: translateY(4px) scale(1.1) !important;
            box-shadow: 0 8px 22px rgba(0, 0, 0, 0.95), 0 0 14px rgba(245, 158, 11, 0.55);
            z-index: 60 !important;
        }

        .enemy-card-back img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            display: block;
        }

        /* Animação da Jogada da IA (3D Card Flip & Trajetória) */
        #ai-playing-card-ghost {
            will-change: transform, left, top, width, height, opacity;
        }

        /* Animação da Seta Pontilhada e Ponto de Origem de Ataque (Estilo Hearthstone) */
        @keyframes attackDashMove {
            to {
                stroke-dashoffset: -20;
            }
        }

        #attack-arrow-path, #attack-arrow-core, #attack-arrow-glow {
            animation: attackDashMove 0.85s linear infinite;
        }

        @keyframes attackOriginPulse {
            0%, 100% {
                r: 7px;
                opacity: 0.85;
                stroke-width: 2px;
            }
            50% {
                r: 13px;
                opacity: 0.2;
                stroke-width: 3.5px;
            }
        }

        #attack-arrow-origin-pulse {
            animation: attackOriginPulse 1.1s ease-in-out infinite;
        }

        /* Barra de Mana / Elixir Segmentada em 10 Cristais (Estilo Clash Royale) */
        .tibia-mana-widget {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            background: #0A0E17;
            border: 1.5px solid #2A3C5C;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.08);
            padding: 2.5px 7px 2.5px 5px;
            border-radius: 8px;
        }

        .tibia-mana-icon {
            width: 16px;
            height: 16px;
            object-fit: contain;
            filter: drop-shadow(0 1px 2px #000) drop-shadow(0 0 4px rgba(56, 189, 248, 0.8));
            flex-shrink: 0;
        }

        .tibia-mana-track {
            position: relative;
            width: 74px;
            height: 12px;
            border-radius: 5px;
            background: #060910;
            border: 1.5px solid #0E1525;
            box-shadow: 0 0 0 1px #3B527A, inset 0 2px 4px rgba(0, 0, 0, 0.95);
            overflow: hidden;
            flex-shrink: 0;
        }

        @media (min-width: 640px) {
            .tibia-mana-track {
                width: 96px;
                height: 13px;
            }

            .tibia-mana-icon {
                width: 18px;
                height: 18px;
            }
        }

        .tibia-mana-fill {
            height: 100%;
            width: 100%;
            border-radius: 3px;
            background: linear-gradient(180deg, #67E8F9 0%, #2563EB 45%, #1D4ED8 80%, #38BDF8 100%);
            box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 0 8px rgba(56, 189, 248, 0.75);
            transition: width 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        /* Divisórias Dinâmicas de Mana / Elixir (Adaptam-se exatamente à quantidade máxima de cada round) */
        .tibia-mana-track::before {
            display: none !important;
        }

        .tibia-mana-dividers {
            position: absolute;
            inset: 0;
            display: flex;
            z-index: 2;
            pointer-events: none;
            border-radius: 4px;
            overflow: hidden;
        }

        .tibia-mana-unit {
            flex: 1 1 0;
            height: 100%;
            border-right: 1.5px solid rgba(6, 9, 16, 0.88);
            box-shadow: 1px 0 0 rgba(255, 255, 255, 0.08);
            box-sizing: border-box;
        }

        .tibia-mana-unit:last-child {
            border-right: none;
            box-shadow: none;
        }

        /* Reflexo especular superior sobre os cristais */
        .tibia-mana-track::after {
            content: '';
            position: absolute;
            top: 1px;
            left: 2px;
            right: 2px;
            height: 3.5px;
            z-index: 3;
            border-radius: 3px;
            background: linear-gradient(180deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0.05) 100%);
            pointer-events: none;
        }

        .tibia-mana-num {
            font-family: 'Cinzel', 'Inter', sans-serif;
            font-weight: 900;
            color: #F0F9FF;
            text-shadow: 0 2px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
            letter-spacing: 0.02em;
            line-height: 1;
            white-space: nowrap;
        }

        /* Ghost da Carta sendo Arrastada */
        #drag-card-ghost {
            position: fixed;
            top: 0;
            left: 0;
            pointer-events: none;
            z-index: 9999;
            transform-origin: center center;
            box-shadow: 0 22px 40px rgba(0, 0, 0, 0.92), 0 0 20px rgba(34, 197, 94, 0.75);
            transition: none;
        }

        /* Scrollbar customizada */
        ::-webkit-scrollbar {
            width: 5px;
            height: 5px;
        }

        ::-webkit-scrollbar-track {
            background: #111317;
        }

        ::-webkit-scrollbar-thumb {
            background: #3f3a32;
            border-radius: 3px;
        }

        ::-webkit-scrollbar-thumb:hover {
            background: #b8973d;
        }

        /* ================= HUB, GRIMÓRIO TIBIANO & ABERTURA DE BOOSTER ESTILO POKÉMON ================= */
        .rarity-glow-common,
        .tcg-card.rarity-glow-common,
        .tcg-layered-card.rarity-glow-common,
        .poke-stack-card .rarity-glow-common {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            filter: drop-shadow(0 0 10px rgba(156, 163, 175, 0.65)) drop-shadow(0 10px 16px rgba(0, 0, 0, 0.85)) !important;
        }

        .rarity-glow-uncommon,
        .tcg-card.rarity-glow-uncommon,
        .tcg-layered-card.rarity-glow-uncommon,
        .poke-stack-card .rarity-glow-uncommon {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.85)) drop-shadow(0 0 24px rgba(56, 189, 248, 0.45)) drop-shadow(0 10px 20px rgba(0, 0, 0, 0.9)) !important;
        }

        .rarity-glow-rare,
        .tcg-card.rarity-glow-rare,
        .tcg-layered-card.rarity-glow-rare,
        .poke-stack-card .rarity-glow-rare {
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            filter: drop-shadow(0 0 18px rgba(250, 204, 21, 0.95)) drop-shadow(0 0 36px rgba(245, 158, 11, 0.65)) drop-shadow(0 12px 24px rgba(0, 0, 0, 0.95)) !important;
            animation: rarePulseCard 1.8s infinite ease-in-out !important;
        }

        @keyframes rarePulseCard {
            0%,
            100% {
                transform: scale(1);
            }
            50% {
                transform: scale(1.025);
            }
        }

        /* Imagem dos Boosters na Loja */
        .booster-pack-img {
            filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.85));
            transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.25s ease;
        }

        .booster-pack-img:hover {
            transform: translateY(-6px) scale(1.05);
            filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 18px rgba(251, 191, 36, 0.5));
        }

        /* Palco de Rasgar o Booster (Dividido em Topo + Corpo via clip-path) */
        .booster-tear-scene {
            position: relative;
            width: 220px;
            height: 310px;
            cursor: grab;
            user-select: none;
            touch-action: none;
        }

        .booster-tear-scene:active {
            cursor: grabbing;
        }

        @media (min-width: 640px) {
            .booster-tear-scene {
                width: 250px;
                height: 350px;
            }
        }

        .booster-half-top {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: contain;
            clip-path: polygon(0 0, 100% 0, 100% 22%, 85% 25%, 65% 20%, 45% 25%, 25% 20%, 0 23%);
            transition: transform 0.15s ease;
            transform-origin: bottom right;
            z-index: 25;
        }

        .booster-half-bottom {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: contain;
            clip-path: polygon(0 22%, 25% 19%, 45% 24%, 65% 19%, 85% 24%, 100% 21%, 100% 100%, 0 100%);
            z-index: 20;
        }

        .booster-tear-scene:hover .booster-half-top {
            transform: translateY(-3px) rotate(-1deg);
        }

        /* Animação Limpa do Topo sendo Rasgado e Corpo Deslizando (Sem brilho amarelo nas bordas) */
        @keyframes ripTopFoilAnim {
            0% {
                transform: translate(0, 0) rotate(0deg);
                opacity: 1;
            }

            30% {
                transform: translate(22px, -18px) rotate(10deg);
                opacity: 1;
            }

            100% {
                transform: translate(160px, -100px) rotate(32deg) scale(0.9);
                opacity: 0;
            }
        }

        @keyframes ripBottomBodyAnim {
            0% {
                transform: scale(1) translateY(0);
                opacity: 1;
            }

            40% {
                transform: scale(1.03) translateY(10px);
                opacity: 1;
            }

            100% {
                transform: scale(0.96) translateY(75px);
                opacity: 0;
            }
        }

        .is-ripping-top {
            animation: ripTopFoilAnim 0.6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        .is-ripping-bottom {
            animation: ripBottomBodyAnim 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        /* Pilha de Cartas Estilo Pokémon TCG */
        .poke-stack-container {
            position: relative;
            width: min(250px, 72vw);
            aspect-ratio: 682 / 1024;
            perspective: 1200px;
            touch-action: pan-y;
            margin: 0 auto;
        }

        @media (min-width: 640px) {
            .poke-stack-container {
                width: 275px;
                aspect-ratio: 682 / 1024;
            }
        }

        .poke-stack-card {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            border-radius: 0;
            background: transparent !important;
            border: none !important;
            box-shadow: none !important;
            transition: transform 0.35s cubic-bezier(0.2, 0.85, 0.25, 1), opacity 0.3s ease, filter 0.3s ease;
            user-select: none;
            -webkit-user-select: none;
            will-change: transform, opacity;
        }

        /* Transição ao soltar a carta da mão para a mesa (Full -> Small) */
        @keyframes unitBoardDropTransition {
            0% {
                transform: scale(1.36) translateY(-22px);
                filter: brightness(1.25) drop-shadow(0 16px 24px rgba(0, 0, 0, 0.85));
                opacity: 0.9;
            }
            60% {
                transform: scale(0.96) translateY(2px);
            }
            100% {
                transform: scale(1) translateY(0);
                filter: none;
                opacity: 1;
            }
        }

        .unit-board-summon-anim {
            animation: unitBoardDropTransition 0.42s cubic-bezier(0.18, 0.89, 0.32, 1.25) forwards;
            will-change: transform, filter, opacity;
            z-index: 40 !important;
        }

        /* Deslizar carta do topo ao clicar ou arrastar para revelar a próxima */
        @keyframes swipeCardOutRight {
            0% {
                transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
                opacity: 1;
            }

            100% {
                transform: translate3d(140%, -15px, 40px) rotate(14deg) scale(0.96);
                opacity: 0;
            }
        }

        @keyframes swipeCardOutLeft {
            0% {
                transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
                opacity: 1;
            }

            100% {
                transform: translate3d(-140%, -15px, 40px) rotate(-14deg) scale(0.96);
                opacity: 0;
            }
        }

        .poke-card-swiping-out,
        .poke-card-swiping-out-right {
            animation: swipeCardOutRight 0.36s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
            pointer-events: none;
        }

        .poke-card-swiping-out-left {
            animation: swipeCardOutLeft 0.36s cubic-bezier(0.2, 0.9, 0.3, 1) forwards;
            pointer-events: none;
        }

        @keyframes popCardIn {
            0% {
                transform: scale(0.93) translateY(12px);
                filter: brightness(1.35);
            }

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

        .poke-card-pop-active {
            animation: popCardIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        /* Estilo Tibia Old School para Grimório & Slots de Backpack */
        .tibia-container-slot {
            background: radial-gradient(circle at center, #26221e 0%, #151310 100%);
            border: 2px solid #4a4336;
            box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.9), 0 1px 0 rgba(255, 255, 255, 0.06);
        }


        .grimoire-unowned-card {
            filter: grayscale(0.88) contrast(0.92);
            opacity: 0.6;
        }

        .grimoire-unowned-card:hover {
            filter: grayscale(0.25);
            opacity: 0.95;
        }

        /* Utilitário para barras deslizantes no mobile sem scrollbar visível */
        .no-scrollbar::-webkit-scrollbar {
            display: none;
        }

        .no-scrollbar {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }

        /* ================= ANIMAÇÃO DA FORJA (3 BATIDAS NA ORBE) ================= */
        @keyframes hammerStrikeAnim {
            0% {
                transform: rotate(35deg) translate(18px, -18px) scale(1);
            }

            45% {
                transform: rotate(55deg) translate(28px, -28px) scale(1.08);
            }

            65% {
                transform: rotate(-28deg) translate(-10px, 12px) scale(1.18);
            }

            80% {
                transform: rotate(-10deg) translate(0px, 4px) scale(1);
            }

            100% {
                transform: rotate(35deg) translate(18px, -18px) scale(1);
            }
        }

        @keyframes orbHitShake {

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

            60% {
                transform: scale(1.02);
                filter: brightness(1);
            }

            68% {
                transform: scale(0.86) rotate(-6deg);
                filter: brightness(2.2) drop-shadow(0 0 28px #fde047);
            }

            82% {
                transform: scale(1.14) rotate(5deg);
                filter: brightness(1.5) drop-shadow(0 0 18px #f59e0b);
            }
        }

        @keyframes forgeCardRevealPop {
            0% {
                transform: scale(0.4) translateY(30px);
                opacity: 0;
                filter: brightness(2.5);
            }

            65% {
                transform: scale(1.08) translateY(-6px);
                opacity: 1;
                filter: brightness(1.3);
            }

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

        .hammer-striking {
            animation: hammerStrikeAnim 0.55s cubic-bezier(0.22, 1, 0.36, 1) 3;
        }

        .orb-being-struck {
            animation: orbHitShake 0.55s ease-in-out 3;
        }

        .forge-card-reveal {
            animation: forgeCardRevealPop 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        /* ================= ANIMAÇÕES DE REFINAMENTO E FUSÃO NA FORJA ================= */
        @keyframes forgeSurgeGlow {
            0% {
                transform: scale(1);
                filter: brightness(1) drop-shadow(0 0 0px rgba(168, 85, 247, 0));
            }

            40% {
                transform: scale(1.25);
                filter: brightness(2) drop-shadow(0 0 16px rgba(192, 132, 252, 0.9));
            }

            100% {
                transform: scale(1);
                filter: brightness(1) drop-shadow(0 0 0px rgba(168, 85, 247, 0));
            }
        }

        @keyframes forgeArrowDash {
            0% {
                transform: translateX(-4px) scale(0.9);
                opacity: 0.5;
            }

            50% {
                transform: translateX(6px) scale(1.35);
                opacity: 1;
                filter: brightness(2) drop-shadow(0 0 12px currentColor);
            }

            100% {
                transform: translateX(0px) scale(1);
                opacity: 0.8;
            }
        }

        @keyframes forgeItemPop {
            0% {
                transform: scale(0.7) rotate(-18deg);
                filter: brightness(2.6) drop-shadow(0 0 28px currentColor);
            }

            45% {
                transform: scale(1.38) rotate(12deg);
                filter: brightness(2) drop-shadow(0 0 24px currentColor);
            }

            75% {
                transform: scale(1.1) rotate(-4deg);
            }

            100% {
                transform: scale(1) rotate(0deg);
                filter: brightness(1);
            }
        }

        @keyframes forgeFloatingFloat {
            0% {
                opacity: 0;
                transform: translate(-50%, 8px) scale(0.65);
            }

            20% {
                opacity: 1;
                transform: translate(-50%, -8px) scale(1.15);
            }

            75% {
                opacity: 1;
                transform: translate(-50%, -24px) scale(1);
            }

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

        .anim-surge-dust {
            animation: forgeSurgeGlow 0.65s cubic-bezier(0.2, 0.8, 0.2, 1);
        }

        .anim-arrow-dash {
            animation: forgeArrowDash 0.65s cubic-bezier(0.22, 1, 0.36, 1);
        }

        .anim-pop-fragment {
            color: #38bdf8;
            animation: forgeItemPop 0.75s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .anim-pop-orb {
            color: #fbbf24;
            animation: forgeItemPop 0.85s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .forge-float-text {
            animation: forgeFloatingFloat 1.2s ease-out forwards;
            pointer-events: none;
        }


        /* ================= AVATARES DE HERÓIS E MOLDURAS ================= */
        .tibia-hero-frame {
            position: relative;
            background: transparent;
            border: none;
            border-radius: 12px;
            /* Cantos levemente arredondados no estilo do jogo */
            box-shadow: none;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .tibia-hero-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center top;
            pointer-events: none;
        }

        /* ================= INDICADORES VISUAIS DE BATALHA (PRONTO VS EXAUSTO / ZZZ) ================= */

        /* 1. Carta Pronta para Atacar (Brilho Verde/Dourado Pulsante) */
        @keyframes readyAttackPulse {

            0%,
            100% {
                box-shadow: 0 0 8px rgba(34, 197, 94, 0.75), 0 0 16px rgba(250, 204, 21, 0.35), inset 0 0 6px rgba(74, 222, 128, 0.3);
                border-color: #4ade80;
            }

            50% {
                box-shadow: 0 0 16px rgba(74, 222, 128, 1), 0 0 28px rgba(250, 204, 21, 0.65), inset 0 0 10px rgba(74, 222, 128, 0.5);
                border-color: #fde047;
            }
        }

        .unit-ready-attack {
            animation: readyAttackPulse 1.5s infinite ease-in-out;
            cursor: grab;
        }

        /* Selo de Espadas (Pronto para Atacar) */
        @keyframes swordReadyBounce {

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

            50% {
                transform: translateY(-2px) scale(1.12);
            }
        }

        .ready-attack-badge {
            animation: swordReadyBounce 1.2s infinite ease-in-out;
            background: linear-gradient(135deg, #065f46 0%, #047857 100%);
            border: 1px solid #6ee7b7;
            box-shadow: 0 0 10px rgba(160, 185, 129, 0.8);
        }

        /* 2. Carta Exausta / Inutilizável no Turno */
        .tcg-card.unit-exhausted-state:not(.valid-target-glow),
        .unit-exhausted-state:not(.valid-target-glow) {
            filter: saturate(0.35) brightness(0.72);
            opacity: 0.88;
            border-color: #374151;
            cursor: not-allowed;
        }

        /* 3. Animação de "Zzz" Dormindo nas Cartas Exaustas */
        .zzz-sleep-container {
            position: absolute;
            top: -8px;
            right: -4px;
            width: 34px;
            height: 36px;
            pointer-events: none;
            z-index: 35;
        }

        .zzz-char {
            position: absolute;
            bottom: 0;
            right: 4px;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            color: #93c5fd;
            text-shadow: 0 0 6px #1d4ed8, 0 1px 2px #000;
            opacity: 0;
            animation: floatSleepingZzz 2.4s infinite ease-in-out;
        }

        .zzz-char.z1 {
            font-size: 10px;
            animation-delay: 0s;
        }

        .zzz-char.z2 {
            font-size: 13px;
            animation-delay: 0.8s;
        }

        .zzz-char.z3 {
            font-size: 16px;
            animation-delay: 1.6s;
        }

        @keyframes floatSleepingZzz {
            0% {
                transform: translate(0px, 6px) scale(0.6) rotate(-10deg);
                opacity: 0;
            }

            25% {
                opacity: 0.95;
            }

            75% {
                opacity: 0.85;
            }

            100% {
                transform: translate(12px, -22px) scale(1.15) rotate(12deg);
                opacity: 0;
            }
        }

        /* Feedback visual na carta original enquanto ela acompanha o dedo no arraste */
        .tcg-card.card-being-dragged,
        .card-being-dragged {
            opacity: 0.25;
            transform: scale(0.92);
        }

        /* ================= BOTÃO BATALHAR ESTILIZADO (COM ASSETS/MENU/BOTAO_BATALHAR.WEBP) ================= */
        .battle-button-wrapper {
            position: relative;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            max-width: 250px;
            margin: 0 auto;
            background: transparent;
            border: none;
            padding: 0;
            cursor: pointer;
            outline: none;
            user-select: none;
            transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.22s ease;
        }

        .battle-button-img {
            width: 100%;
            height: auto;
            display: block;
            object-fit: contain;
            filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.85)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.9));
            transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.22s ease;
        }

        .battle-button-text {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Cinzel', serif;
            font-weight: 900;
            font-size: 1.25rem;
            letter-spacing: 0.08em;
            text-transform: uppercase;
            color: #ffffff;
            -webkit-text-stroke: 1px #000000;
            paint-order: stroke fill;
            text-shadow:
                1px 1px 0 #000,
                -1px -1px 0 #000,
                1px -1px 0 #000,
                -1px 1px 0 #000,
                0 2px 6px rgba(0, 0, 0, 0.9);
            pointer-events: none;
            transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), text-shadow 0.22s ease, filter 0.22s ease;
        }

        @media (min-width: 640px) {
            .battle-button-text {
                font-size: 1.4rem;
                letter-spacing: 0.09em;
                -webkit-text-stroke: 1.1px #000000;
            }
        }

        @media (min-width: 768px) {
            .battle-button-text {
                font-size: 1.55rem;
                letter-spacing: 0.1em;
            }
        }

        /* Animação ao passar o mouse (Hover) */
        .battle-button-wrapper:hover {
            transform: scale(1.04) translateY(-3px);
        }

        .battle-button-wrapper:hover .battle-button-img {
            filter: drop-shadow(0 10px 24px rgba(239, 68, 68, 0.75)) drop-shadow(0 0 22px rgba(245, 158, 11, 0.65)) brightness(1.15);
        }

        .battle-button-wrapper:hover .battle-button-text {
            transform: scale(1.04);
            text-shadow:
                1px 1px 0 #000,
                -1px -1px 0 #000,
                1px -1px 0 #000,
                -1px 1px 0 #000,
                0 0 14px rgba(254, 240, 138, 0.9),
                0 4px 10px rgba(0, 0, 0, 0.95);
        }

        /* Animação ao clicar (Active) */
        .battle-button-wrapper:active {
            transform: scale(0.95) translateY(3px);
            transition-duration: 0.08s;
        }

        .battle-button-wrapper:active .battle-button-img {
            filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.9)) brightness(0.9);
            transition-duration: 0.08s;
        }

        .battle-button-wrapper:active .battle-button-text {
            transform: scale(0.95);
            transition-duration: 0.08s;
        }

        /* ================= ESTILOS DO TUTORIAL E CAMPANHAS ================= */
        @keyframes tutorialPulseHalo {
            0%, 100% {
                box-shadow: 0 0 0 2px #d4af37, 0 0 18px 4px rgba(245, 158, 11, 0.75), inset 0 0 10px rgba(254, 240, 138, 0.5);
            }
            50% {
                box-shadow: 0 0 0 4px #fef08a, 0 0 28px 8px rgba(251, 191, 36, 0.95), inset 0 0 16px rgba(254, 240, 138, 0.8);
            }
        }

        .tutorial-highlighted-element {
            z-index: 35 !important;
            animation: tutorialPulseHalo 1.4s ease-in-out infinite !important;
            border-color: #fef08a !important;
            filter: drop-shadow(0 0 14px rgba(245, 158, 11, 0.9)) !important;
        }

        @keyframes tutorialShake {
            0%, 100% { translate: 0 0; }
            20% { translate: -6px 0; }
            40% { translate: 6px 0; }
            60% { translate: -4px 0; }
            80% { translate: 4px 0; }
        }

        .tutorial-shake-element {
            animation: tutorialShake 0.45s ease-in-out !important;
            border-color: #ef4444 !important;
            box-shadow: 0 0 20px rgba(239, 68, 68, 0.85) !important;
        }

