
        @import url('https://fonts.googleapis.com/css2?family=Rajdhani:wght@600;700&display=swap');

        :root {
            /* MGA KULAY NG ZONES */
            --neon-gold: #facc15;
            --neon-gold-glow: rgba(250, 204, 21, 0.4);
            
            --neon-cyan: #06b6d4;
            --neon-cyan-glow: rgba(6, 182, 212, 0.4);
            
            --neon-red: #ef4444;
            --neon-red-glow: rgba(239, 68, 68, 0.4);

            /* MGA BAGONG KULAY NA HININGI MO */
            --neon-green: #39ff14;
            --neon-green-glow: rgba(57, 255, 20, 0.4);

            --yellow-green: #adff2f;
            --yellow-green-glow: rgba(173, 255, 47, 0.4);

            --gray-zone: #9ca3af;
            --black-zone: #000000;

            --bg-dark: #020617;

            /* SCALE FACTOR (HINDI BINAGO) */
            --scale: 1.3;

            /* BASE DIMENSIONS (HINDI BINAGO) */
            --base-card-height: 12cqh;
            --base-card-width: 8.5cqh;
            --base-slot-height: 13cqh;
            --base-slot-width: 10cqh;
            --base-board-width: 75cqh;
            --base-act-zone-height: 18cqh;
            
            /* SCALED DIMENSIONS */
            --card-height: calc(var(--base-card-height) * var(--scale));
            --card-width: calc(var(--base-card-width) * var(--scale));
            --slot-height: calc(var(--base-slot-height) * var(--scale));
            --slot-width: calc(var(--base-slot-width) * var(--scale));
            --board-width: calc(var(--base-board-width) * var(--scale));
            --act-zone-height: calc(var(--base-act-zone-height) * var(--scale));
            
            /* DYNAMIC FONT SIZES */
            --font-size-base: calc(1.2cqmin * var(--scale));
            --font-size-title: calc(1.5cqmin * var(--scale));
            --font-size-large: calc(6cqmin * var(--scale));
        }

        html { 
			width: 100%; 
			height: 100%; 
			background: #000; 
			overflow: hidden; 
		}
		
		body { 
			background-color: var(--bg-dark); 
			left: 0; right: 0;
			top: 0; bottom: 0;
			transform: none; margin: auto;
			padding: 0; 
			font-family: 'Rajdhani', sans-serif; 
			display: flex; 
			flex-direction: column; 
			justify-content: center; 
			align-items: center; 
			width: min(100vw, calc(100vh * 1920 / 920)); 
			height: min(100vh, calc(100vw * 920 / 1920)); 
			color: white; 
			overflow: hidden; 
			user-select: none; 
			-webkit-user-select: none; 
			position: absolute; 
			container-type: size;
		}

        /* === PLAYMAT BACKGROUND === */
        .playmat {
            display: none; 
            flex-direction: column;
            justify-content: center; 
            align-items: center; 
            width: 100cqw;
            min-height: 100cqh;
            padding-top: 14cqh;
            padding-bottom: 14cqh;
            background-color: #030712;
            background-image: 
                linear-gradient(rgba(6, 182, 212, 0.05) 1px, transparent 1px),
                linear-gradient(90deg, rgba(6, 182, 212, 0.05) 1px, transparent 1px);
            background-size: 40px 40px;
            position: relative;
            box-sizing: border-box;
            z-index: auto;
        }

        /* Arcane Circle sa Gitna */
        .bg-portal {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 85cqmin;
            height: 85cqmin;
            border-radius: 50%;
            border: 2px solid rgba(6, 182, 212, 0.15);
            box-shadow: 
                0 0 50px rgba(6, 182, 212, 0.2),
                inset 0 0 50px rgba(6, 182, 212, 0.2);
            background: radial-gradient(circle, rgba(6, 182, 212, 0.08) 0%, transparent 60%);
            z-index: -1;
            pointer-events: none;
        }

        .bg-ring-inner {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            width: 65cqmin;
            height: 65cqmin;
            border-radius: 50%;
            border: 1px dashed rgba(6, 182, 212, 0.3);
            z-index: -1;
            pointer-events: none;
        }

        /* Player Layouts */
        .top-player, .bottom-player {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 0.5cqh;
            width: 100%;
            position: relative;
            z-index: 5;
        }
        .top-player { transform: rotate(180deg); }

        /* Rows */
        .deck-row {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 0.5cqh;
            justify-content: center;
            width: var(--board-width);
        }

        .hero-row {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 2cqh;
            justify-content: center;
            width: var(--board-width); 
        }

        /* === ZONE STYLES === */
        .zone {
			display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            text-align: center;
            border: 2px solid;
            background: rgba(128, 128, 128, 0.3); /* Grayish background na gusto mo */
            border-radius: 6px;
            font-size: var(--font-size-base);
            font-weight: 700;
            letter-spacing: 0.05em;
            line-height: 1.1;
            position: relative;
            height: var(--slot-height);
            min-height: var(--slot-height);
			overflow: visible;
        }
		
		.zone::before {
			content: '';
			position: absolute;
			inset: 0;
			border-radius: inherit;
			backdrop-filter: blur(4px);
			z-index: -1;
			pointer-events: none;
		}

        /* Hero Zone (Neon Green) */
        .hero-zone { 
            border-color: var(--neon-green); 
            color: var(--neon-green); 
            box-shadow: 0 0 10px var(--neon-green-glow), inset 0 0 15px var(--neon-green-glow);
            text-shadow: 0 0 5px var(--neon-green);
        }

        /* Hand Card Zone (Yellow Green) */
        .z-hand { 
            border-color: var(--yellow-green); 
            color: var(--yellow-green); 
            box-shadow: 0 0 10px var(--yellow-green-glow), inset 0 0 15px var(--yellow-green-glow);
            text-shadow: 0 0 5px var(--yellow-green);
        }

        /* History Zone (Dark Gray gaya ng Act Zone) */
        .z-history { 
            border-color: var(--gray-zone); 
            color: var(--gray-zone); 
            box-shadow: 0 0 10px rgba(156, 163, 175, 0.3), inset 0 0 15px rgba(156, 163, 175, 0.3); 
            text-shadow: 0 0 5px var(--gray-zone); 
        }

        /* Tactic Zone (Nanatiling Neon Cyan) */
        .z-tactic { 
            border-color: var(--neon-cyan); 
            color: var(--neon-cyan); 
            box-shadow: 0 0 10px var(--neon-cyan-glow), inset 0 0 15px var(--neon-cyan-glow);
            text-shadow: 0 0 5px var(--neon-cyan);
        }

        /* Main Deck Zone (Nanatiling Neon Red) */
        .z-main-deck { 
            border-color: var(--neon-red); 
            color: var(--neon-red); 
            box-shadow: 0 0 10px var(--neon-red-glow), inset 0 0 15px var(--neon-red-glow);
            text-shadow: 0 0 5px var(--neon-red);
        }

        /* Hero Deck Zone (Nanatiling Neon Gold) */
        .z-hero-deck { 
            border-color: var(--neon-gold); 
            color: var(--neon-gold); 
            box-shadow: 0 0 10px var(--neon-gold-glow), inset 0 0 15px var(--neon-gold-glow);
            text-shadow: 0 0 5px var(--neon-gold);
        }
		
		/* === UNIVERSAL BATTLEFIELD SLOT COLOR STATE === */
		.playmat .zone,
		.playmat .act-zone {
			transition:
				border-color 0.28s ease,
				box-shadow 0.28s ease,
				color 0.28s ease,
				text-shadow 0.28s ease;
		}

		.playmat .battlefield-green-sepia-slot {
			border-color: #065f46 !important;
			color: #065f46 !important;
			box-shadow:
				0 0 10px rgba(6, 95, 70, 0.72),
				inset 0 0 15px rgba(6, 78, 59, 0.48) !important;
			text-shadow:
				0 0 6px rgba(16, 185, 129, 0.7) !important;
		}

		.playmat .act-zone.battlefield-green-sepia-slot::before {
			color: #065f46 !important;
			text-shadow:
				0 0 10px #065f46,
				0 0 20px rgba(6, 95, 70, 0.75) !important;
		}


        /* Tactic Overload uses the same battlefield wave, in blue. */
        .playmat .battlefield-blue-sepia-slot {
            border-color: #3b82f6 !important;
            color: #60a5fa !important;
            box-shadow: 0 0 10px rgba(59, 130, 246, .72),
                inset 0 0 15px rgba(29, 78, 216, .48) !important;
            text-shadow: 0 0 6px rgba(96, 165, 250, .7) !important;
        }
        .playmat .act-zone.battlefield-blue-sepia-slot::before {
            color: #60a5fa !important;
            text-shadow: 0 0 10px #3b82f6, 0 0 20px rgba(59, 130, 246, .75) !important;
        }

        /* === ACT ZONE (Gray Border & Font) === */
        .act-zone {
            height: var(--act-zone-height); 
            min-height: var(--act-zone-height);
            flex-shrink: 0;
            width: var(--board-width); 
            border: 2px solid var(--gray-zone); /* Gray Border */
            background: rgba(128, 128, 128, 0.3); /* Grayish Background */
            display: flex;
            align-items: center; 
            justify-content: center;
            border-radius: 12px;
            position: relative;
            margin: 0.5cqh 0;
            box-shadow: 0 0 15px rgba(156, 163, 175, 0.3), inset 0 0 20px rgba(156, 163, 175, 0.3);
            backdrop-filter: blur(4px);
        }
        .act-zone::before { 
            content: 'ACT ZONE'; 
            position: absolute; 
            top: 50%; 
            left: 50%; 
            transform: translate(-50%, -50%); 
            font-size: var(--font-size-large); 
            font-weight: 700; 
            color: var(--gray-zone); /* Gray Font */
            text-shadow: 0 0 10px var(--gray-zone), 0 0 20px var(--gray-zone);
            letter-spacing: 0.1em;
            opacity: 0.7;
            pointer-events: none; 
        }

        /* Stack Visuals (Decks) */
        .stack-container { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative; z-index: 10;}
        .stack-visual {
			width: auto;
			height: 90%;
			aspect-ratio: 2/3;
			border-radius: 4px;
			background-color: #111;
			background-image: url('https://i.imgur.com/wtdy4Xm.png');
			background-size: cover;
			background-position: center;
			background-repeat: no-repeat;
			position: relative;
			box-shadow:
				0 4px 6px rgba(0, 0, 0, 0.8),
				0 0 8px rgba(255, 255, 255, 0.18);
		}
        .stack-visual.player { border: 1px solid rgba(255,255,255,0.2); }
        .stack-visual.opponent { border: 1px solid rgba(255,255,255,0.2); }

        .stack-count { 
            position: absolute; 
            top: 4px; 
            right: 4px; 
            background: #000; 
            color: #fff; 
            border-radius: 50%; 
            width: 3.5cqmin; 
            height: 3.5cqmin; 
            display: flex; 
            align-items: center; 
            justify-content: center; 
            font-size: var(--ui-subtitle, 1.8cqmin); 
            font-weight: bold; 
            border: 1px solid #fff; 
            z-index: 25; 
        }

        .skip-draw-lock {
            position: absolute;
            top: 50%;
            left: 50%;
            display: none;
            font-size: 4cqmin;
            z-index: 26;
            pointer-events: none;
            opacity: 0;
            transform: translate(-50%, -75%) scale(0.35) rotate(-12deg);
            filter: drop-shadow(0 0 6px #facc15) drop-shadow(0 0 14px rgba(250, 204, 21, 0.85));
            transform-origin: center;
        }

        .skip-draw-lock.skip-draw-lock-enter {
            display: block;
            animation: skipDrawLockEnter 0.65s cubic-bezier(0.22, 1, 0.36, 1) forwards;
        }

        .skip-draw-lock.skip-draw-lock-active {
            display: block;
            opacity: 1;
            transform: translate(-50%, -50%) scale(1);
            animation: skipDrawLockPulse 1.4s ease-in-out infinite;
        }

        .skip-draw-lock.skip-draw-lock-exit {
            display: block;
            animation: skipDrawLockExit 0.45s ease-in forwards;
        }

        .z-main-deck.skip-draw-deck-seal {
            animation: skipDrawDeckSeal 0.65s ease-out;
        }

        @keyframes skipDrawLockEnter {
            0% { opacity: 0; transform: translate(-50%, -90%) scale(0.25) rotate(-14deg); }
            55% { opacity: 1; transform: translate(-50%, -46%) scale(1.28) rotate(5deg); }
            75% { transform: translate(-50%, -52%) scale(0.9) rotate(-2deg); }
            100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
        }

        @keyframes skipDrawLockPulse {
            0%, 
			100% { transform: translate(-50%, -50%) scale(1); filter: drop-shadow(0 0 6px #facc15) drop-shadow(0 0 12px rgba(250, 204, 21, 0.75)); }
            50% { transform: translate(-50%, -50%) scale(1.1); filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 20px #facc15); }
        }

        @keyframes skipDrawLockExit {
            0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
            35% { opacity: 1; transform: translate(-50%, -62%) scale(1.12) rotate(7deg); }
            100% { opacity: 0; transform: translate(-50%, -90%) scale(0.35) rotate(14deg); }
        }

        @keyframes skipDrawDeckSeal {
            0% { box-shadow: 0 0 10px var(--neon-red-glow), inset 0 0 15px var(--neon-red-glow); }
            45% { border-color: #facc15; box-shadow: 0 0 22px #facc15, 0 0 38px rgba(250, 204, 21, 0.7), inset 0 0 24px rgba(250, 204, 21, 0.65); }
            100% { box-shadow: 0 0 10px var(--neon-red-glow), inset 0 0 15px var(--neon-red-glow); }
        }
        
        .stack-container.empty { display: none; } 

        .zone-label {
			position: absolute;
			left: 50%;
			transform: translateX(-50%);
			z-index: 30;
			pointer-events: none;
			text-align: center;
			white-space: nowrap;
		}

		.has-deck .zone-label {
			bottom: 8px;
			font-size: calc(var(--font-size-base) * 0.8);
		}

		/* MGA KULAY NG CARDS (Dito kukuha ng kulay ang database mamaya) */
        .card-hero { background-color: #5c4033; border: 1px solid #facc15; } /* Dark Brown */
        .card-tool { background-color: #2563eb; border: 1px solid #06b6d4; } /* Blue */
        .card-technique { background-color: #dc2626; border: 1px solid #ef4444; } /* Red */

		/* === PREPARATION SCREEN STYLES === */
        #preparation-screen { 
			display: flex; 
			flex-direction: column; 
			width: 100%; 
			height: 100%; 
			background-color: var(--bg-dark); 
			color: white; 
			padding: 2cqh; 
			box-sizing: border-box; 
			z-index: 100; 
			font-family: 'Rajdhani', sans-serif; 
			overflow: hidden; 
		}
		
        .prep-header { 
			text-align: center; 
			margin-bottom: 2cqh; 
			font-size: 4cqh; 
			color: var(--neon-gold); 
			text-shadow: 0 0 10px var(--neon-gold); 
			font-weight: bold;
		}
		
        .prep-layout { 
			display: flex; 
			gap: 2cqw; 
			flex: 1; 
			min-height: 0; 
			overflow: hidden; 
		}
		
        .prep-panel {
            flex: 1; display: flex; flex-direction: column; overflow: hidden;
            padding: 1.5cqh; border: 1px solid #78b6d057; border-radius: 12px;
            background: linear-gradient(140deg, #142638f5, #0b1324fc);
            box-shadow: 0 25px 100px #000a, 0 0 60px #70dcff12;
        }
		
        #preparation-screen .prep-panel.active { background: linear-gradient(140deg, #142638f5, #0b1324fc); }
        
        .prep-deck-cards {
            flex: 1;
            min-height: 0;
            overflow-y: auto;
            overflow-x: hidden;
            scrollbar-width: thin;
            scrollbar-color: var(--gray-zone) transparent;
        }

        #panel-player .prep-deck-cards,
        #panel-enemy .prep-deck-cards {
            display:flex;
            flex-direction:column;
            justify-content:safe center;
            align-items:center;
        }

        #panel-player .slots-container,
        #panel-enemy .slots-container {
            margin-left:auto;
            margin-right:auto;
        }

        #panel-player > .panel-title,
        #panel-enemy > .panel-title,
        .prep-deck-footer {
            flex-shrink: 0;
        }

        .prep-deck-status {
            margin-top:.6cqh; color:var(--gray-zone); font-size: var(--ui-caption, clamp(9px,1.1cqh,12px));
            line-height:1.4; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
        }
        #player-tactics, #enemy-tactics { margin-bottom:0; }

        /* The card database scrolls independently from the deck panels. */

        .db-panel {
            flex:1; min-height:0; border-color:var(--neon-gold); overflow:hidden;
            background:linear-gradient(#081524e8,#061320ee),url('https://i.imgur.com/wtdy4Xm.png') center/cover;
        }
        .db-tabs { display:flex; gap:.5cqh; margin-bottom:1cqh; flex-shrink:0; }
        .db-tab { flex:1; padding:.6cqh; border:1px solid #7096ad77; border-radius:5px; background:#101d30; color:#9db6cc; font:600 var(--ui-caption, 1.2cqh) 'Segoe UI',sans-serif; letter-spacing:1px; cursor:pointer; }
        .db-tab:hover,.db-tab.active { color:#d6f4ff; border-color:#8ce4ff; background:#18314a; }
        .db-cards-scroll { display:flex; flex:1; min-height:0; overflow:auto; scrollbar-width:thin; scrollbar-color:#7096ad77 transparent; }
        .db-cards-scroll > .slots-container { margin:auto; flex-shrink:0; }
        .db-panel[data-card-tab="hero"] #db-tactics,
        .db-panel[data-card-tab="tool"] #db-heroes,
        .db-panel[data-card-tab="technique"] #db-heroes,
        .db-panel[data-card-tab="tool"] .card-technique,
        .db-panel[data-card-tab="technique"] .card-tool { display:none; }
        
        .panel-title {
            text-align: center; color: var(--neon-cyan);
            font: 600 var(--ui-heading, 2.5cqh) "Bahnschrift", "Segoe UI", Arial, sans-serif;
            letter-spacing: 2px; margin-bottom: 1cqh; padding-bottom: 1cqh;
        }
		
		.enemy-panel-title-row {
			position: relative;
			display: flex;
			align-items: center;
			justify-content: center;
			width: 100%;
		}

		.enemy-mode-select {
			position: absolute;
			right: 0;
			top: 50%;
			transform: translateY(-50%);
			min-width: 11cqh;
			height: 3.5cqh;
			padding: 0 1cqh;
			border: 1px solid var(--neon-red);
			border-radius: 5px;
			background: rgba(15, 23, 42, 0.95);
			color: var(--neon-red);
			font-family: 'Rajdhani', sans-serif;
			font-size: var(--ui-caption, 1.4cqh);
			font-weight: 900;
			text-align: center;
			cursor: pointer;
			outline: none;
			box-shadow: 0 0 8px var(--neon-red-glow);
		}

		.enemy-mode-select:focus,
		.enemy-mode-select:hover {
			background: var(--neon-red);
			color: #fff;
			box-shadow: 0 0 14px var(--neon-red-glow);
		}

		.enemy-mode-select option {
			background: #0f172a;
			color: #fff;
		}
		
		.enemy-strategy-select {
			position: absolute;
			left: 0;
			top: 50%;
			transform: translateY(-50%);
			min-width: 13cqh;
			max-width: 16cqh;
			height: 3.5cqh;
			padding: 0 1cqh;
			border: 1px solid var(--neon-gold);
			border-radius: 5px;
			background: rgba(15, 23, 42, 0.95);
			color: var(--neon-gold);
			font-family: 'Rajdhani', sans-serif;
			font-size: var(--ui-caption, 1.4cqh);
			font-weight: 900;
			text-align: center;
			cursor: pointer;
			outline: none;
			box-shadow: 0 0 8px var(--neon-gold-glow);
		}

		.enemy-strategy-select:focus,
		.enemy-strategy-select:hover:not(:disabled) {
			background: var(--neon-gold);
			color: #000;
			box-shadow: 0 0 14px var(--neon-gold-glow);
		}

		.enemy-strategy-select:disabled {
			border-color: #4b5563;
			color: #6b7280;
			background: rgba(15, 23, 42, 0.75);
			box-shadow: none;
			cursor: not-allowed;
		}

		.enemy-strategy-select option {
			background: #0f172a;
			color: #fff;
		}

        #enemy-mode-select { display:none; }
        .enemy-mode-label { display:flex; align-items:center; justify-content:center; cursor:default; }
        .enemy-mode-label:hover { background:rgba(15,23,42,.95); color:var(--neon-red); box-shadow:0 0 8px var(--neon-red-glow); }
        #panel-enemy:not([data-enemy-mode="ai"]) #enemy-strategy-select { display:none; }

        /* BAGO: 5x7 Grid Constraint at Malaking Cards */
        .slots-container { 
            display: grid; 
            grid-template-columns: repeat(5, auto); 
            gap: 1cqh; 
            margin-bottom: 2cqh; 
            justify-content: center; 
        }
        
		.slots-container.tactics-grid {
            grid-template-columns: repeat(6, auto); 
        }

        .prep-slot { width: 7.5cqh; height: 10.5cqh; border: 1px dashed rgba(255,255,255,0.3); display: flex; align-items: center; justify-content: center; font-size: var(--ui-heading, 2.5cqh); font-weight:bold; cursor: pointer; border-radius: 4px; background: rgba(0,0,0,0.5);}		
        .prep-slot.hero { border-color: var(--neon-green); color: var(--neon-green); }
        .prep-slot.tactic { border-color: var(--neon-cyan); color: var(--neon-cyan); }
        .prep-card { width: 7.5cqh; height: 10.5cqh; display: flex; align-items: center; justify-content: center; font-size: var(--ui-subtitle, 2cqh); font-weight: bold; cursor: pointer; border-radius: 4px; color: white; user-select: none; box-shadow: 0 2px 5px rgba(0,0,0,0.8); transition: transform 0.1s;}
        .prep-card:active { transform: scale(0.9); }
        
		#panel-player, #panel-enemy { transition: border-color 0.2s, box-shadow 0.2s, background 0.2s; cursor: pointer; }
		#panel-player.active { border-color: var(--neon-green); box-shadow: 0 0 20px var(--neon-green-glow), inset 0 0 15px rgba(57,255,20,0.12); background: rgba(57,255,20,0.06); }
		#panel-enemy.active { border-color: var(--neon-red); box-shadow: 0 0 20px var(--neon-red-glow), inset 0 0 15px rgba(239,68,68,0.12); background: rgba(239,68,68,0.06); }
        
		.btn-group { display: flex; gap: .6cqw; justify-content: center; margin-top: auto; padding-top: 0; min-width: 0; }

        #preparation-screen .prep-btn, #preparation-screen .start-btn {
            background:#101d30; color:#9db6cc; border:1px solid #7096ad77; border-radius:5px;
            font:600 var(--ui-caption, 1.2cqh) 'Segoe UI',sans-serif; letter-spacing:1px; padding:.8cqh 1cqw;
            width:max-content; max-width:100%; white-space:nowrap; cursor:pointer; box-shadow:none;
        }
        #preparation-screen .prep-btn:hover:not(:disabled), #preparation-screen .start-btn:hover:not(:disabled) { color:#d6f4ff; border-color:#8ce4ff; background:#18314a; box-shadow:none; transform:none; }
        #preparation-screen .start-btn.online-ready { color:#c4ffba; border-color:#39ff14; }
        #preparation-screen .start-btn.online-waiting { color:#fde68a; border-color:#facc15; }
        #preparation-screen .start-btn.online-selecting { color:#fca5a5; border-color:#ef4444; }
        #preparation-screen .start-btn:disabled { opacity:.5; cursor:not-allowed; }
		
		/* === ONLINE ROOM: FIRST PAGE UI === */
		#panel-enemy { position: relative; }

		#online-mode-modal {
			display: none;
			position: absolute;
			inset: 0;
			z-index: 100;
			padding: 1.5cqh;
			align-items: center;
			justify-content: center;
			box-sizing: border-box;
			border-radius: inherit;
			background: rgba(2, 6, 23, 0.92);
			backdrop-filter: blur(7px);
		}

		#online-mode-modal.active {
			display: flex;
		}

		.online-mode-panel {
			width: 100%;
			padding: 2cqh 1.5cqw;
			box-sizing: border-box;
			border: 2px solid var(--neon-cyan);
			border-radius: 10px;
			background: rgba(9, 13, 20, 0.96);
			box-shadow: 0 0 24px var(--neon-cyan-glow);
			text-align: center;
		}

		.online-mode-title {
			color: var(--neon-cyan);
			font-size: var(--ui-heading, 2.6cqh);
			font-weight: 900;
		}

		.online-mode-description,
		.online-room-status {
			margin: 0.7cqh 0 1.4cqh;
			color: #d1d5db;
			font-size: var(--ui-caption, 1.4cqh);
		}

		.online-room-controls {
			display: grid;
			grid-template-columns: 1fr 1fr;
			gap: 0.8cqh 0.8cqw;
		}

		.online-room-input,
		.online-mode-btn {
			min-height: 5cqh;
			padding: 0.7cqh 0.8cqw;
			border: 1px solid var(--neon-cyan);
			border-radius: 6px;
			background: #0f172a;
			color: var(--neon-cyan);
			font-family: inherit;
			font-size: var(--ui-caption, 1.5cqh);
			font-weight: 900;
			box-sizing: border-box;
		}

		.online-room-input {
			grid-column: 1 / -1;
			width: 100%;
			border-color: var(--neon-gold);
			color: white;
			text-align: center;
			text-transform: uppercase;
			outline: none;
		}

		.online-room-status {
			grid-column: 1 / -1;
			min-height: 2cqh;
			margin: 0;
		}

		.online-mode-btn {
			cursor: pointer;
		}

		.online-mode-btn:hover {
			background: var(--neon-cyan);
			color: #000;
		}

		.online-mode-btn.back {
			grid-column: 1 / -1;
			border-color: var(--neon-red);
			color: var(--neon-red);
		}

		.online-mode-btn.back:hover {
			background: var(--neon-red);
			color: white;
		}

		.online-room-list { grid-column:1/-1; max-height:16cqh; overflow-y:auto; display:grid; gap:.6cqh; padding:.4cqh; }
		.online-room-card { width:100%; min-height:4.5cqh; padding:.6cqh .8cqw; display:flex; align-items:center; justify-content:space-between; border:1px solid var(--neon-cyan); border-radius:6px; background:#0f172a; color:#fff; font:900 var(--ui-caption, 1.45cqh) 'Rajdhani',sans-serif; cursor:pointer; }
		.online-room-card:hover { background:var(--neon-cyan); color:#000; }
		.online-room-empty { padding:2cqh; color:#6b7280; font-size: var(--ui-caption, 1.4cqh); text-align:center; border:1px dashed #475569; border-radius:6px; }
		.online-submodal { display:none; position:absolute; inset:0; z-index:3; padding:1.5cqh; align-items:center; justify-content:center; box-sizing:border-box; border-radius:inherit; background:rgba(2,6,23,.96); }
		.online-submodal.active { display:flex; }

		/* === DECK CONSTRUCTION: UNIFORM MODALS === */
		#online-mode-modal .online-mode-panel, #evo-preview-modal {
			border:1px solid #78b6d057 !important; border-radius:12px;
			background:linear-gradient(140deg,#142638f5,#0b1324fc) !important;
			box-shadow:0 25px 100px #000a,0 0 60px #70dcff12 !important;
		}
		#online-mode-modal .online-mode-btn, #online-mode-modal .online-room-card, #online-mode-modal .online-room-input {
			border:1px solid #7096ad77; border-radius:5px; background:#101d30; color:#9db6cc;
			font:600 var(--ui-caption, 1.25cqh) 'Segoe UI',sans-serif;
		}
		#online-mode-modal .online-mode-btn:hover, #online-mode-modal .online-room-card:hover { background:#18314a; border-color:#8ce4ff; color:#d6f4ff; }
		#online-mode-modal .online-mode-btn.back { border-color:#ef444477; color:#fca5a5; }
		#online-mode-modal .online-mode-btn.back:hover { background:#3a1b28; border-color:#ef4444; color:#fecaca; }		
		#panel-enemy.online-connected { 
			border-color:var(--neon-green); 
			box-shadow:0 0 20px var(--neon-green-glow); 
		}
		
		.prep-card.online-facedown,
		.card-in-modal.online-facedown,
		.card-in-playmat.online-facedown,
		.prep-card.ai-facedown, .card-in-modal.ai-facedown,
		.card-in-playmat.ai-facedown:not([data-retain-active="true"]) {
			background:#111 url('https://i.imgur.com/wtdy4Xm.png') center/cover no-repeat !important;
			border-color:var(--neon-cyan) !important;
			color:transparent !important;
			text-shadow:none !important;
			cursor:default !important;
		}
			
		.start-btn.online-incomplete { 
			background:#374151; 
			color:#6b7280; 
			box-shadow:none; 
			cursor:not-allowed; 
		}
		
		.start-btn.online-ready { 
			background:var(--neon-green); 
			color:#000; 
			box-shadow:0 0 20px var(--neon-green); 
		}

		.start-btn.online-waiting { 
			background:var(--neon-gold); 
			color:#000; 
			box-shadow:0 0 18px var(--neon-gold); 
			cursor:wait; 
		}
		
		#preparation-screen.online-deck-locked #panel-player,
		#preparation-screen.online-deck-locked .db-panel { 
			pointer-events:none; 
			filter:grayscale(70%) brightness(.55); 
		}
		
		#preparation-screen.online-hero-selection #panel-player { 
			pointer-events:auto; 
			filter:none; 
		}
		
		#preparation-screen.online-hero-selection .db-panel { 
			pointer-events:none; 
			filter:grayscale(70%) brightness(.45); 
		}
		
		#preparation-screen.online-hero-selection #player-tactics {
			pointer-events: none;
			filter: grayscale(80%) brightness(.45);
		}
		
		.prep-slot.hero.online-hero-selected { 
			border:3px solid var(--neon-red) !important; 
			box-shadow:0 0 18px var(--neon-red-glow); 
		}
		
		#preparation-screen.online-tactic-arrangement #panel-player {
			pointer-events: auto;
			filter: none;
		}

		#preparation-screen.online-tactic-arrangement .db-panel {
			pointer-events: none;
			filter: grayscale(70%) brightness(.45);
		}

		#preparation-screen.online-tactic-arrangement #player-heroes {
			pointer-events: none;
		}

		.prep-slot.tactic.online-tactic-selected {
			border: 3px solid var(--neon-gold) !important;
			box-shadow:
				0 0 12px var(--neon-gold),
				0 0 22px var(--neon-gold-glow) !important;
			transform: scale(1.04);
		}
		
		#player-tactics { 
			position:relative; 
		}
		
		.tactic-insert-point { 
			position:absolute; 
			width:2cqh; 
			height:5cqh; 
			transform:translate(-50%,-50%); 
			z-index:50; 
		}
		
		.tactic-insert-plus { 
			width:2.8cqh; 
			height:2.8cqh; 
			position:absolute; 
			left:50%; 
			top:50%; 
			transform:translate(-50%,-50%) scale(.4); 
			display:flex; 
			align-items:center; 
			justify-content:center; 
			border:2px solid var(--neon-gold); 
			border-radius:50%; 
			background:#111827; 
			color:var(--neon-gold); 
			font-size: var(--ui-heading, 2.5cqh); 
			font-weight:900; 
			opacity:0; 
			pointer-events:none; 
			box-shadow:0 0 14px var(--neon-gold); 
			transition:.15s; 
		}
		
		.tactic-insert-point.ready .tactic-insert-plus { 
			opacity:1; 
			transform:translate(-50%,-50%) scale(1); 
			pointer-events:auto; 
			cursor:pointer; 
		}
		
		.start-btn.online-selecting { 
			background:var(--neon-red); 
			color:#fff; 
			box-shadow:0 0 18px var(--neon-red-glow); 
			cursor:default; 
		}

		/* === MODALS & DRAG/DROP STYLES === */
        /* Tinanggal ang dark background overlay para hindi nakaharang */
        .modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100cqw; height: 100cqh; z-index: 199; }
        .modal-overlay.active { display: block; }
        
        /* Eksaktong sukat at design ng Expanded Hand Box mula sa sample code */
        .expanded-box { 
            display: none; position: fixed; bottom: 3cqh; left: 50%; transform: translateX(-50%); 
            width: fit-content; max-width: 80cqw; min-height: var(--card-height); 
            background: rgba(15, 23, 42, 0.75); backdrop-filter: blur(12px); 
            border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 16px; 
            z-index: 2500; padding: 2cqh 2cqw; 
            box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 1px 1px rgba(255,255,255,0.1); 
            flex-wrap: wrap; gap: 1cqw; align-items: center; justify-content: center; 
        }
        .expanded-box.active { display: flex; }
        .expanded-box.player.active { animation: slideUpBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
        .expanded-box.enemy.active { animation: slideDownBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
        
        @keyframes slideUpBounce { 0% { transform: translate(-50%, 50px); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }
        @keyframes slideDownBounce { 0% { transform: translate(-50%, -50px); opacity: 0; } 100% { transform: translate(-50%, 0); opacity: 1; } }

        /* DRAGGING FIX: Siguradong baon sa ilalim ang overlay para lusot ang drop */
        body.dragging-mode #modal-overlay {
			background: transparent;
			opacity: 0;
			pointer-events: none;
		}
        
        /* Siguraduhin ding hindi haharang ang expanded box */
        body.dragging-mode .expanded-box { 
            opacity: 0.1 !important; 
            z-index: 2500 !important; 
            pointer-events: none !important; 
        }

        .close-btn { 
            position: absolute; top: -15px; right: -15px; background: linear-gradient(135deg, #ef4444, #991b1b); 
            color: white; border: 2px solid white; border-radius: 50%; width: 35px; height: 35px; 
            font-weight: bold; cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.6); 
            display: flex; align-items: center; justify-content: center; font-size: var(--ui-heading, 1.2rem); transition: transform 0.2s;
        }
        .close-btn:hover { transform: scale(1.1); }

        .modal-title { 
            position: static; transform: none; margin: 0; padding: .3cqh .6cqh;
            color: var(--gray-zone); font-size: var(--ui-caption, 1.2cqh); font-weight: 700; text-transform: uppercase;
            background: transparent; border: 0; text-shadow: none; box-shadow: none;
        }
        .expanded-box > .modal-title { order: 2; flex-basis: 100%; text-align: center; }
        .side-modal-footer { order: 2; display: flex; gap: 1cqh; align-items: center; justify-content: center; width: 100%; z-index: 220; }
        .side-modal-footer .page-btn { font-size: var(--ui-caption, 1.5cqh); padding: .3cqh 1cqh; }
        .expanded-box .modal-title { color: var(--gray-zone); font-size: var(--ui-caption, 1.2cqh); }
        .expanded-box > [id^="content-"] { order: 1; }

        /* Eksaktong Physical Appearance ng Cards */
        .card-in-modal, .card-in-playmat { 
            width: var(--card-width); height: var(--card-height); 
            display: flex; align-items: center; justify-content: center; flex-direction: column;
            font-size: calc(1.1cqmin * var(--scale)); font-weight: 900; border-radius: 8px; 
            color: white; user-select: none; text-align: center; line-height: 1.1; white-space: pre-wrap;
            box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.2); 
            border: 2px solid #64748b; text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
        }
        
        .card-in-modal {
            cursor: grab;
            position: relative;
            transition:
                transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.2s ease,
                border-color 0.18s ease,
                filter 0.18s ease;
        }

        .card-in-modal:hover {
            transform: translateY(-10px) scale(1.1);
            z-index: 100;
            box-shadow: 0 15px 30px rgba(0,0,0,0.8);
        }

        .card-in-modal:active {
            cursor: grabbing;
        }

        /* MSTACK cards should not zoom on hover; subtle border glow only. */
        #mstack-modal .card-in-modal {
            cursor: default !important;
            transition:
                border-color 0.18s ease,
                box-shadow 0.18s ease,
                filter 0.18s ease !important;
        }

        #mstack-modal .card-in-modal:hover {
            transform: none !important;
            z-index: auto !important;
            border-color: var(--neon-gold) !important;
            box-shadow:
                0 0 8px rgba(250, 204, 21, 0.65),
                inset 0 0 8px rgba(250, 204, 21, 0.35) !important;
            filter: brightness(1.08);
        }
        
        .drag-over { background: rgba(255, 255, 255, 0.1) !important; border-style: dashed !important; transform: scale(1.05); box-shadow: 0 0 20px rgba(255,255,255,0.2) !important; }
	
		/* Saktong 3 cards lang ang kasya sa isang row para di masira ang name */
        #content-player, #content-enemy {
            min-width: calc((var(--card-width) * 3) + 3cqw);
        }

		/* === TURN SELECTION UI === */
		#turn-selection-overlay {
			display: none;
			position: fixed;
			inset: 0;
			width: 100cqw;
			height: 100cqh;
			background: rgba(0, 0, 0, 0.88);
			z-index: 300;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			backdrop-filter: blur(6px);
			box-sizing: border-box;
		}

		.turn-panel {
			display: flex;
			flex-direction: column;
			align-items: center;
			gap: 2cqh;
			margin: 7.5cqh 0;
		}

		#turn-selection-overlay .top-player {
			transform: rotate(180deg);
		}

		.turn-title {
			font-size: var(--ui-title, 3cqh);
			font-weight: 900;
			letter-spacing: 0.1em;
		}

		.player-turn-title {
			color: var(--neon-green);
			text-shadow: 0 0 10px var(--neon-green);
		}

		.enemy-turn-title {
			color: var(--neon-red);
			text-shadow: 0 0 10px var(--neon-red);
		}

		#turn-selection-overlay.online-turn-selection
		.enemy-turn-title {
			display: none;
		}

		.turn-btn-group {
			display: flex;
			gap: 5cqw;
			perspective: 90cqh;
		}

		.turn-btn {
			position: relative;
			width: 12cqh;
			height: 12cqh;
			padding: 0;
			border: 3px solid;
			border-radius: 50%;
			background: transparent;
			color: white;
			font-family: 'Rajdhani', sans-serif;
			font-size: var(--ui-subtitle, 2.2cqh);
			font-weight: 900;
			cursor: pointer;
			transition: transform 0.2s ease, opacity 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease;
			transform-style: preserve-3d;
		}

		.player-turn-btn {
			border-color: var(--neon-green);
		}

		.enemy-turn-btn {
			border-color: var(--neon-red);
		}

		#turn-selection-overlay.online-turn-selection
		.enemy-turn-btn {
			pointer-events: none;
		}

		.turn-btn:hover:not(:disabled) {
			transform: scale(1.1);
		}

		.turn-coin-inner {
			position: absolute;
			inset: 0;
			border-radius: 50%;
			transform-style: preserve-3d;
			transition: transform 0.85s cubic-bezier(0.2, 0.75, 0.25, 1);
		}

		.turn-coin-face {
			position: absolute;
			inset: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			box-sizing: border-box;
			border-radius: 50%;
			backface-visibility: hidden;
			-webkit-backface-visibility: hidden;
			text-align: center;
			line-height: 1.05;
		}

		.turn-coin-front {
			border: 0.7cqh solid #fef08a;
			background: radial-gradient( circle at 34% 28%, #fff7ae 0%, #facc15 30%, #b45309 72%, #78350f 100% );
			color: #111827;
			text-shadow: 0 1px 0 rgba(255, 255, 255, 0.55);
			box-shadow: inset 0 0 1.5cqh rgba(255, 255, 255, 0.75), inset 0 0 3cqh rgba(120, 53, 15, 0.65);
		}

		.turn-coin-back {
			transform: rotateY(180deg);
			border: 0.7cqh solid #64748b;
			background: radial-gradient( circle at 35% 30%, #475569 0%, #1e293b 45%, #020617 100% );
			color: transparent;
			box-shadow: inset 0 0 2cqh rgba(148, 163, 184, 0.4), 0 0 1.2cqh rgba(15, 23, 42, 0.9);
		}

		.turn-coin-back::before {
			content: '?';
			color: #94a3b8;
			font-size: 4cqh;
			font-weight: 900;
			text-shadow: 0 0 8px #64748b, 2px 2px 0 #000;
		}

		/* Local player starts face-up. */
		.player-turn-btn .turn-coin-inner {
			transform: rotateY(0deg);
		}

		/* Opponent starts face-down. */
		.enemy-turn-btn .turn-coin-inner {
			transform: rotateY(0deg);
		}

		#turn-selection-overlay.online-turn-selection
		.enemy-turn-btn .turn-coin-inner {
			transform: rotateY(180deg);
		}

		/* Local selection lock. */
		.player-turn-btn.selected {
			border-color: #ffffff;
			box-shadow: 0 0 12px #ffffff, 0 0 28px var(--neon-green), inset 0 0 12px rgba(57, 255, 20, 0.35);
			transform: scale(1.08);
		}

		.enemy-turn-btn.selected {
			border-color: #ffffff;
			box-shadow: 0 0 12px #ffffff, 0 0 28px var(--neon-red), inset 0 0 12px rgba(239, 68, 68, 0.35);
			transform: scale(1.08);
		}

		/* All local choices lock after committing. */
		#turn-selection-overlay.online-choice-locked
		.player-turn-btn {
			pointer-events: none;
		}

		#turn-selection-overlay.online-choice-locked
		.player-turn-btn:not(.selected) {
			opacity: 0.4;
			filter: grayscale(100%) brightness(0.55);
		}

		/* Reveal state dims all non-selected coins. */
		#turn-selection-overlay.online-choice-reveal
		.turn-btn:not(.online-revealed-choice) {
			opacity: 0.22;
			filter: grayscale(100%) brightness(0.45);
			pointer-events: none;
			transform: scale(0.94);
		}

		/* Selected opponent coin flips from back to front. */
		#turn-selection-overlay.online-choice-reveal
		.enemy-turn-btn.online-revealed-choice
		.turn-coin-inner {
			animation: revealEnemyTurnCoin 0.6s ease-in-out forwards;
		}

		#turn-selection-overlay.online-choice-reveal
		.player-turn-btn.online-revealed-choice
		.turn-coin-inner {
			animation: revealPlayerTurnCoin 0.6s ease-in-out forwards;
		}

		#turn-selection-overlay.online-choice-reveal
		.player-turn-btn.online-revealed-choice {
			opacity: 1;
			filter: none;
			border-color: #ffffff;
			box-shadow: 0 0 12px #ffffff, 0 0 30px var(--neon-green);
			transform: scale(1.08);
		}

		#turn-selection-overlay.online-choice-reveal
		.enemy-turn-btn.online-revealed-choice {
			opacity: 1;
			filter: none;
			border-color: #ffffff;
			box-shadow: 0 0 12px #ffffff, 0 0 30px var(--neon-red);
			transform: scale(1.08);
		}

		@keyframes revealEnemyTurnCoin {
			from { transform: rotateY(180deg); }
			to { transform: rotateY(360deg); }
		}

		@keyframes revealPlayerTurnCoin {
			from { transform: rotateY(0deg); }
			to { transform: rotateY(360deg); }
		}

		/* === TRAINING TURN SELECTION === */
		#turn-selection-overlay.training-turn-selection .top-player,
		#turn-selection-overlay.training-turn-selection #p-btn-fate {
			display: none;
		}

		#turn-selection-overlay.training-turn-selection .bottom-player {
			gap: 2cqh;
			margin: 0;
		}

		/* === ONLINE TIE-TOSS COIN === */
		#coin-container {
			display: none;
			position: absolute;
			left: 50%;
			top: 50%;
			z-index: 20;
			flex-direction: column;
			align-items: center;
			margin: 0;
			perspective: 80cqh;
			transform: translate(-50%, -50%);
			pointer-events: none;
		}

		#coin {
			position: relative;
			width: 9.5cqh;
			height: 9.5cqh;
			border-radius: 50%;
			transform-style: preserve-3d;
		}

		.tie-coin-face {
			position: absolute;
			inset: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			box-sizing: border-box;
			border: 0.65cqh solid #fef08a;
			border-radius: 50%;
			backface-visibility: hidden;
			-webkit-backface-visibility: hidden;
			background: radial-gradient( circle at 32% 25%, #fffde0 0%, #fde68a 18%, #facc15 38%, #b45309 72%, #451a03 100% );
			color: #111827;
			font-family: 'Rajdhani', sans-serif;
			font-size: var(--ui-body, 1.65cqh);
			font-weight: 900;
			text-align: center;
			text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
			box-shadow: inset 0 0 1.2cqh rgba(255, 255, 255, 0.85), inset 0 0 2.4cqh rgba(120, 53, 15, 0.7), 0 0 1.5cqh rgba(250, 204, 21, 0.75);
		}

		.tie-coin-face::after {
			content: '';
			position: absolute;
			inset: 0.65cqh;
			border: 1px dashed rgba(120, 53, 15, 0.65);
			border-radius: 50%;
		}

		.tie-coin-back {
			transform: rotateY(180deg);
			background: radial-gradient( circle at 32% 25%, #ecfeff 0%, #67e8f9 20%, #0891b2 48%, #164e63 78%, #083344 100% );
			border-color: #cffafe;
			color: transparent;
			text-shadow: none;
			box-shadow: inset 0 0 1.2cqh rgba(255, 255, 255, 0.75), inset 0 0 2.4cqh rgba(8, 51, 68, 0.75), 0 0 1.5cqh rgba(6, 182, 212, 0.8);
		}
		
		.tie-coin-back::after {
			content: 'ENEMY';
			display: flex;
			align-items: center;
			justify-content: center;
			color: #ecfeff;
			text-shadow: 0 1px 2px #083344;
		}
		
		#coin.tie-final-you {
			transform: rotateY(0deg);
		}

		#coin.tie-final-enemy {
			transform: rotateY(180deg);
		}

		#coin.tie-win {
			animation: realisticTossWin 1.2s cubic-bezier(.18,.72,.2,1) forwards;
		}

		#coin.tie-lose {
			animation: realisticTossLose 1.2s cubic-bezier(.18,.72,.2,1) forwards;
		}

		@keyframes realisticTossWin {
			0% { transform: translateY(2cqh) rotateX(0deg) rotateY(0deg) scale(.82); }
			22% { transform: translateY(-7cqh) rotateX(35deg) rotateY(420deg) scale(1); }
			58% { transform: translateY(-4cqh) rotateX(10deg) rotateY(1040deg) scale(1.04); }
			82% { transform: translateY(.6cqh) rotateX(0deg) rotateY(1440deg) scale(.96); }
			92% { transform: translateY(-.7cqh) rotateX(0deg) rotateY(1440deg) scale(1.03); }
			100% { transform: translateY(0) rotateX(0deg) rotateY(1440deg) scale(1); }
		}

		@keyframes realisticTossLose {
			0% { transform: translateY(2cqh) rotateX(0deg) rotateY(0deg) scale(.82); }
			22% { transform: translateY(-7cqh) rotateX(35deg) rotateY(450deg) scale(1); }
			58% { transform: translateY(-4cqh) rotateX(10deg) rotateY(1130deg) scale(1.04); }
			82% { transform: translateY(.6cqh) rotateX(0deg) rotateY(1620deg) scale(.96); }
			92% { transform: translateY(-.7cqh) rotateX(0deg) rotateY(1620deg) scale(1.03); }
			100% { transform: translateY(0) rotateX(0deg) rotateY(1620deg) scale(1); }
		}
		
		#turn-selection-overlay.online-tossing .turn-panel {
			opacity: .22;
			filter: grayscale(1);
			pointer-events: none;
		}

		#turn-selection-overlay.online-fate-choice .top-player,
		#turn-selection-overlay.online-fate-choice #p-btn-fate {
			display: none;
		}

		#turn-selection-overlay.online-fate-choice
		.bottom-player {
			transform: translateY(8cqh);
		}

		#turn-selection-overlay.online-fate-choice
		.bottom-player .turn-btn {
			opacity: 1;
			filter: none;
			pointer-events: auto;
		}

		#turn-selection-overlay.online-fate-waiting
		.turn-btn {
			pointer-events: none;
			opacity: .22;
			filter: grayscale(1);
		}
		
		/* === STAGE INDICATOR (Left Side) === */
        .stage-indicator {
            position: absolute;
            right: 2cqw;
            top: 50%;
            transform: translateY(-50%);
            display: flex;
            flex-direction: column;
            gap: 1.5cqh;
            z-index: 100;
        }
		
        .stage-circle {
            width: 4.5cqh;
            height: 4.5cqh;
            border-radius: 50%;
            background: #1f2937;
            border: 2px solid #4b5563;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 900;
            font-size: var(--ui-subtitle, 2cqh);
            color: #9ca3af;
            transition: 0.3s;
            box-shadow: 0 4px 6px rgba(0,0,0,0.5);
        }
		
        .stage-circle.active {
            background: #facc15;
            color: #000;
            border-color: #fff;
            /* BAGO: Doble at mas matingkad na Yellow Glow */
            box-shadow: 0 0 20px #facc15, 0 0 40px #facc15; 
            transform: scale(1.15);
        }
		
        .stage-circle.done {
            background: #166534;
            color: #fff;
            border-color: var(--neon-green);
        }

		/* === SIDE MODALS (Nasa Kaliwang Gilid) === */
        @keyframes slideInFromLeft { 0% { transform: translateX(50px); opacity: 0; } 100% { transform: translateX(0); opacity: 1; } }

        /* 1. Green Hand Modal (Tugma sa Hand Zone) */
        .expanded-box.hand-green {
            background: rgba(20, 35, 10, 0.9) !important; /* Dark Greenish Black background */
            border: 2px solid var(--yellow-green) !important;
            box-shadow: 10px 0 30px var(--yellow-green-glow), inset 0 1px 1px rgba(255,255,255,0.1) !important;
            left: auto !important; 
            right: 2cqw !important; 
            transform: none !important;
            /* 5.4: three card widths, three gaps, side padding, and the border. */
            width: calc((var(--card-width) * 3) + 7cqw + min(4px, .44cqh));
            border-width: min(2px, .22cqh) !important;
            max-width: 35cqw; box-sizing: border-box;
            flex-direction: column; flex-wrap: nowrap; gap: 1cqh;
	    z-index: 2000 !important; /* BAGO: Pinilit ibabaw sa mga cards at menus */

        }
        .hand-green > [id^="content-hand-"] {
            flex-wrap: nowrap !important; flex-shrink: 0;
            min-height: calc(var(--card-height) + 4px);
        }
        .hand-green .card-in-modal { flex-shrink: 0; box-sizing: border-box; }
        .hand-green > .close-btn {
            width: 3.8cqh; height: 3.8cqh; padding: 0; box-sizing: border-box;
            font-size: var(--ui-subtitle, 2cqh); border-width: .2cqh;
            top: -1.6cqh; right: -1.6cqh;
        }
        .hand-green.enemy > .close-btn { top: auto; bottom: -1.6cqh !important; }
		
        .expanded-box.hand-green.player, .expanded-box.hand-green.enemy {
            animation: slideInFromLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
		
        .expanded-box.hand-green.player { bottom: 5cqh !important; top: auto !important; }
        .expanded-box.hand-green.enemy { top: 5cqh !important; bottom: auto !important; }

        /* 2. Yellow Hero Modal */
        .expanded-box.hero-yellow {
            background: rgba(30, 25, 5, 0.9) !important;
            border: 2px solid var(--neon-gold) !important;
            box-shadow: 10px 0 30px var(--neon-gold-glow), inset 0 1px 1px rgba(255,255,255,0.1) !important;
            left: auto !important; 
            right: 2cqw !important;
            transform: none !important;
            width: 50cqh; max-width: calc(100cqw - 4cqh); box-sizing: border-box; padding: 2cqh; border-radius: 2cqh;
            z-index: 2000; /* Medyo mas mataas ng konti sa hand modal para kung bukas pareho, umibabaw siya */
        }

		/* 3. Gray History Modal */
        .expanded-box.history-gray {
            background: rgba(15, 15, 15, 0.95) !important; /* Very Dark Gray */
            border: 2px solid var(--gray-zone) !important;
            box-shadow: 10px 0 30px rgba(156, 163, 175, 0.4), inset 0 1px 1px rgba(255,255,255,0.1) !important;
            left: auto !important; 
            right: 2cqw !important;
            transform: none !important;
            max-width: 35cqw;
            z-index: 2000; /* Para umibabaw kung bukas ang tatlo */
        }
		
        .expanded-box.history-gray.player, .expanded-box.history-gray.enemy {
            animation: slideInFromLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
		
        .expanded-box.history-gray.player { bottom: 5cqh !important; top: auto !important; }
        .expanded-box.history-gray.enemy { top: 5cqh !important; bottom: auto !important; }

        #content-history-player, #content-history-enemy {
            min-width: calc((var(--card-width) * 3) + 3cqw); /* Minimum size kahit walang laman */
        }

        /* Color Override para sa History Buttons */
        .btn-gray { color: var(--gray-zone); border-color: var(--gray-zone); }
        .btn-gray:hover { background: var(--gray-zone) !important; color: black !important; }

        .expanded-box.hero-yellow.player, .expanded-box.hero-yellow.enemy {
            animation: slideInFromLeft 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
        .expanded-box.hero-yellow.player { bottom: 5cqh !important; top: auto !important; }
        .expanded-box.hero-yellow.enemy { top: 5cqh !important; bottom: auto !important; }

        #content-ingame-hero-player, #content-ingame-hero-enemy {
            min-width: 0; gap: 1cqh !important;
        }
		.hero-yellow .hero-modal-controls { position: static; order: 2; width: 100%; display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto auto; gap: .8cqh; align-items: center; z-index: 220; }
		.hero-yellow .page-btn { font-size: var(--ui-body, 1.6cqh); padding: .6cqh .9cqh; border-radius: .8cqh; white-space: nowrap; }
		.hero-yellow .modal-title { min-width: 0; text-align: center; }
		.hero-yellow .close-btn { width: 4.5cqh; height: 4.5cqh; top: -2cqh; right: -2cqh; font-size: var(--ui-heading, 2.5cqh); }

		/* === PAGE BUTTONS PARA SA HAND MODAL === */
        .page-btn {
            background: rgba(15, 23, 42, 0.9); color: var(--yellow-green); border: 1px solid var(--yellow-green);
            border-radius: 6px; cursor: pointer; font-weight: 900; font-size: var(--ui-subtitle, 0.9rem); 
            padding: 4px 12px; box-shadow: 0 4px 10px rgba(0,0,0,0.5); transition: 0.2s;
            display: flex; align-items: center; justify-content: center; height: fit-content; text-transform: uppercase;
        }
		
        .page-btn:hover { background: var(--yellow-green); color: black; }
        .page-btn:disabled { background: #374151; color: #6b7280; border-color: #4b5563; box-shadow: none; cursor: not-allowed; }

		/* === ACTION BUTTONS (Lock Heroes / Done Prep) === */
        .action-btn {
            position: fixed;
            right: 13.5cqw; /* Inusog para pumantay sa gitna ng Modal */
            transform: translateX(50%); /* Para saktong naka-center */
            z-index: 250;
            padding: 1cqh 2cqw;
            font-size: var(--ui-subtitle, 1.8cqh);
            font-family: 'Rajdhani', sans-serif;
            font-weight: bold;
            border-radius: 6px;
            cursor: pointer;
            text-align: center;
            transition: 0.2s;
            text-transform: uppercase;
            box-shadow: 0 4px 10px rgba(0,0,0,0.5);
            display: none; /* Nakatago by default */
            letter-spacing: 0.05em;
        }
		
        .action-btn.player {
            bottom: 40cqh; /* Itinaas para saktong nasa ibabaw ng name tag */
            background: var(--neon-green);
            color: black;
            border: 2px solid white;
            box-shadow: 0 0 15px var(--neon-green-glow);
        }
		
        .action-btn.enemy {
            top: 40cqh; /* Ibinaba para saktong nasa ibabaw ng name tag */
            background: var(--neon-red);
            color: black;
            border: 2px solid white;
            box-shadow: 0 0 15px var(--neon-red-glow);
        }
		
        .action-btn:hover { transform: translateX(50%) scale(1.05); }

		/* === TURN INDICATOR BOX === */
        .turn-box {
            position: fixed !important;
            right: 13.5cqw !important; /* BAGO: Itinapat sa 13.5cqw ng Action Buttons */
            top: 50cqh !important;
            transform: translate(50%, -50%) !important; /* BAGO: Pinagsamang X at Y sa iisang linya */
            display: none;
            
            background: rgba(15, 23, 42, 0.95);
            padding: 1.5cqh 2.5cqw;
            border-radius: 6px;
            border: 2px solid #6b7280; 
            color: white;
            font-family: 'Rajdhani', sans-serif;
            font-size: var(--ui-heading, 2.5cqh);
            font-weight: bold;
            text-align: center;
            z-index: 9999; /* Tinaasan natin para di matabunan */
            box-shadow: 0 0 15px rgba(107, 114, 128, 0.4);
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 0.1em;
            white-space: nowrap;
        }

		.turn-box[data-ai-thinking]::after { content:'THINKING...'; display:block; font-size: var(--ui-caption, 1.5cqh); line-height:1.4; animation:ai-think-pulse 1.2s ease-in-out infinite; }
		@keyframes ai-think-pulse { 50% { opacity:.4; } }

        /* ILAW KAPAG TURN NG PLAYER */
        .turn-box.player-active {
            border-color: var(--neon-green);
            color: var(--neon-green);
            box-shadow: 0 0 20px var(--neon-green-glow), inset 0 0 10px rgba(57, 255, 20, 0.2);
        }

        /* ILAW KAPAG TURN NG ENEMY */
        .turn-box.enemy-active {
            border-color: var(--neon-red);
            color: var(--neon-red);
            box-shadow: 0 0 20px var(--neon-red-glow), inset 0 0 10px rgba(239, 68, 68, 0.2);
        }

		/* === CARD PREVIEW BOX (LOWER LEFT) === */
        .preview-container {
            display: none;
            position: fixed;
            bottom: 3cqh; /* Inangat ng konti para hindi sumayad sa dulo ng screen */
            left: .5cqw;
            width: 25cqw; box-sizing: border-box;
            max-width: 25cqw; /* Limitasyon para hindi humarang sa gitna ng board */
            height: auto; /* BAGO: Tinanggal ang fixed height para hindi ma-clip ang card! */
            background: rgba(15, 23, 42, 0.95);
            border: 2px solid #6b7280;
            border-radius: 12px;
            z-index: 5000;
            box-shadow: 0 10px 30px rgba(0,0,0,0.8);
            padding: 2cqh 1.5cqw;
            flex-direction: row; 
            gap: 1.5cqw;
            align-items: center;
            backdrop-filter: blur(10px);
        }

        /* Clean Card Style - BAGO: Saktong DOBLE ng laki ng nakalapag na card */
        .clean-card {
            width: calc(var(--card-width) * 2); 
            height: calc(var(--card-height) * 2); 
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: calc(2.5cqmin * var(--scale) * 2.5); /* Doble din ang laki ng font sa loob */
            font-weight: 900;
            border-radius: 2px;
            color: white;
            border: 2px solid #fff; 
            box-shadow: 0 4px 10px rgba(0,0,0,0.5);
            flex-shrink: 0; 
        }

        .preview-details {
            flex: 1; min-width: 0; height: calc(var(--card-height) * 2);
            display: flex;
            flex-direction: column;
            gap: 1cqh;
            color: white;
            text-align: left;
        }

        .preview-title {
            font-size: var(--ui-subtitle, 1.8cqh);
            font-weight: bold; flex-shrink: 0; overflow-wrap: anywhere;
            color: var(--neon-gold);
            border-bottom: 1px solid rgba(255,255,255,0.2);
            padding-bottom: 0.5cqh;
            text-transform: uppercase;
        }

        .preview-type {
            font-size: var(--ui-caption, 1.3cqh);
            color: #9ca3af; flex-shrink: 0; white-space: pre-line; line-height: 1.35;
            letter-spacing: 0.1em;
        }

        .preview-effect {
            font-size: var(--ui-body, 1.6cqh);
            line-height: 1.3;
            color: #e5e7eb; flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; white-space: pre-line; overflow-wrap: anywhere; user-select: text;
        }

		/* === HERO STATS (DEFAULT/INSIDE PARA SA MODALS/HAND) === */
        /* Kapag hawak mo pa ang card, malinis silang nakasiksik sa loob */
        .PWR-badge { position: absolute; top: 0.5cqh; right: 0.5cqh; width: 2.8cqh; height: 2.8cqh; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.85); border: 2px solid var(--neon-red); color: var(--neon-red); font-size: var(--ui-caption, 1.2cqh); font-weight: bold; border-radius: 4px; box-shadow: 0 0 5px var(--neon-red-glow); z-index: 15; text-shadow: 0 0 5px var(--neon-red); }
        .tc-badge { position: absolute; top: 0.5cqh; left: 0.5cqh; width: 2.8cqh; height: 2.8cqh; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.85); border: 2px solid var(--neon-cyan); color: var(--neon-cyan); font-size: var(--ui-subtitle, 2cqh); font-weight: bold; border-radius: 4px; box-shadow: 0 0 5px var(--neon-cyan-glow); z-index: 15; text-shadow: 0 0 5px var(--neon-cyan); }
        .lv-badge { position: absolute; top: 0.5cqh; left: 3.5cqh; width: 2.8cqh; height: 2.8cqh; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,0.85); border: 2px solid var(--neon-gold); color: var(--neon-gold); font-size: var(--ui-subtitle, 2cqh); font-weight: bold; border-radius: 4px; box-shadow: 0 0 5px var(--neon-gold-glow); z-index: 15; text-shadow: 0 0 5px var(--neon-gold); }
        .hp-text { position: absolute; top: 3.5cqh; right: 0.5cqh; font-size: var(--ui-caption, 1cqh); font-weight: bold; color: var(--neon-green); text-shadow: 0 0 5px var(--neon-green), 1px 1px 2px #000; z-index: 15; }
        .hp-bar-container { position: absolute; top: 5cqh; right: 0.5cqh; width: 75%; height: 0.6cqh; background: rgba(0,0,0,0.8); border: 1px solid #374151; border-radius: 4px; z-index: 15; overflow: hidden; }
        .hp-fill { height: 100%; background: var(--neon-green); width: 100%; transition: width 0.3s ease-out; box-shadow: 0 0 10px var(--neon-green); }

        /* === HERO ZONE OVERRIDES (NASA KALIWA LAHAT - BALANCED POPOUT) === */
        /* Dito sila tatalsik palabas sa kaliwang gilid at bubuo ng perpektong linya */
        
        /* 1. TC at LV - Nasa Taas (Umusod pakanan) */
        .hero-zone .tc-badge { top: 8%; left: -86%; width: 38%; height: 3.5cqh; font-size: var(--ui-subtitle, 2cqh); right: auto; bottom: auto; }
        .hero-zone .lv-badge { top: 8%; left: -44%; width: 38%; height: 3.5cqh; font-size: var(--ui-subtitle, 2cqh); right: auto; bottom: auto; }

        /* 2. HP TEXT at BAR - Saktong nasa Gitna (Ibinaba nang kaunti at kinapalan ang bar) */
        .hero-zone .card-hero > .hp-text { top: 38%; left: -86%; width: 80%; font-size: var(--ui-subtitle, 2cqh); right: auto; bottom: auto; display: flex; justify-content: center; }
        
        .hero-zone .hp-bar-container { 
            top: 51%; left: -86%; width: 80%; height: 1.2cqh; 
            right: auto; bottom: auto; 
            position: absolute; 
            overflow: hidden !important; /* Para hindi tumagas ang glow sa labas ng bar */
        } 
        
        /* BAGO: Bulletproof Green Juice! */
        .hero-zone .hp-fill { 
            position: absolute !important;
            top: 0; left: 0; bottom: 0;
            height: 100% !important; 
            background-color: #39ff14 !important; /* Pinilit ang pure Neon Green hex code */
            box-shadow: 0 0 15px #39ff14 !important; 
            z-index: 10 !important;
            transition: width 0.3s ease-out;
        }

        /* 3. PWR - Nasa Ibaba (Umusod pakanan) */
        .hero-zone .card-hero > .PWR-badge { 
            bottom: 8%; 
            left: -86%; 
            width: 80%; 
            height: 3.8cqh; 
            font-size: var(--ui-heading, 2.5cqh); 
            letter-spacing: 1px; 
            right: auto; 
            top: auto; 
            display: flex; 
            justify-content: center; 
            align-items: center; 
        }
		
		/* === RETAIN FORM: BOTTOM STATS LAYOUT === */

		#act-zone
		.card-retain-form[data-retain-form="true"]
		.tc-badge {
			top: auto;
			bottom: 0.5cqh;
			left: 0.5cqh;
			right: auto;
			width: 2.8cqh;
			height: 2.8cqh;
			font-size: var(--ui-body, 1.6cqh);
			z-index: 25;
		}

		#act-zone
		.card-retain-form[data-retain-form="true"]
		.lv-badge {
			top: auto;
			bottom: 0.5cqh;
			left: 3.6cqh;
			right: auto;
			width: 2.8cqh;
			height: 2.8cqh;
			font-size: var(--ui-body, 1.6cqh);
			z-index: 25;
		}

		#act-zone
		.card-retain-form[data-retain-form="true"]
		.PWR-badge {
			top: auto;
			bottom: 0.5cqh;
			left: auto;
			right: 0.5cqh;
			width: 3.8cqh;
			height: 2.8cqh;
			font-size: var(--ui-caption, 1.3cqh);
			z-index: 25;
		}

		#act-zone
		.card-retain-form[data-retain-form="true"]
		.hp-text {
			top: auto;
			bottom: 4.1cqh;
			left: 0.5cqh;
			right: 0.5cqh;
			width: auto;
			font-size: var(--ui-caption, 1.3cqh);
			line-height: 1;
			text-align: center;
			color: var(--neon-green);
			z-index: 25;
		}

		#act-zone
		.card-retain-form[data-retain-form="true"]
		.hp-bar-container {
			top: auto;
			bottom: 3.2cqh;
			left: 0.5cqh;
			right: 0.5cqh;
			width: auto;
			height: 0.75cqh;
			box-sizing: border-box;
			overflow: hidden !important;
			background: rgba(0, 0, 0, 0.9);
			border: 1px solid #166534;
			border-radius: 999px;
			z-index: 25;
		}

		#act-zone
		.card-retain-form[data-retain-form="true"]
		.hp-fill {
			position: absolute;
			top: 0;
			left: 0;
			bottom: 0;
			height: 100% !important;
			min-height: 100%;
			background: var(--neon-green) !important;
			box-shadow:
				0 0 6px var(--neon-green),
				inset 0 0 3px #ffffff;
			transition: width 0.3s ease-out;
			z-index: 26;
		}
		
		#act-zone
		.card-retain-form[data-retain-form="true"] {
			filter: none;
			isolation: isolate;
			overflow: hidden;
		}

		#act-zone
		.card-retain-form[data-retain-form="true"]::before {
			content: '';
			position: absolute;
			inset: 0;
			border-radius: inherit;
			background: rgba(126, 34, 206, 0.58);
			mix-blend-mode: color;
			box-shadow:
				inset 0 0 22px rgba(168, 85, 247, 0.7),
				0 0 8px rgba(168, 85, 247, 0.75);
			pointer-events: none;
			z-index: 5;
		}
		
		#act-zone
		.card-retain-form[data-retain-form="true"]
		.retain-form-duration-badge {
			top: 0.5cqh;
			right: 0.5cqh;
			bottom: auto;
			left: auto;
			min-width: 2.8cqh;
			height: 2.8cqh;
			padding: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: var(--ui-body, 1.6cqh);
			border: 2px solid var(--neon-gold);
			color: var(--neon-gold);
			box-shadow:
				0 0 8px var(--neon-gold);
			z-index: 30;
		}

		/* Eksaktong Physical Appearance ng Cards */
        .card-in-modal, .card-in-playmat { 
            width: var(--card-width); height: var(--card-height); 
            display: flex; align-items: center; justify-content: center; flex-direction: column;
            font-size: calc(1.1cqmin * var(--scale)); font-weight: 900; border-radius: 8px; 
            color: white; user-select: none; text-align: center; line-height: 1.1; white-space: pre-wrap;
            box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.2); 
            border: 2px solid #64748b; text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
            position: relative; /* BAGO: Ito ang pipigil para hindi tumalsik sa labas ang stats! */
        }
		
		/* === UNIVERSAL MOVE ICON === */
		.move-icon-overlay {
			position: fixed;
			z-index: 220;
			display: grid;
			place-items: center;
			font-family: "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
			font-size: 6cqh;
			line-height: 1;
			opacity: 0;
			pointer-events: none;
			transform: scale(0.35);
			transform-origin: center;
			filter: drop-shadow(0 0 6px #fff) drop-shadow(0 0 14px #000);
			transition: opacity 160ms ease, transform 180ms cubic-bezier(.34, 1.56, .64, 1);
		}

		.move-icon-overlay.is-visible {
			opacity: 1;
			transform: scale(1);
		}

		.move-icon-overlay.is-leaving {
			opacity: 0;
			transform: scale(0.35);
		}

		/* === WAR STAGE: ACTION MENU === */

		.zone:has(.action-menu), #playmat > :has(.action-menu) {
            z-index: 1000 !important;
		}

        .action-menu { 
            position: absolute; 
            left: 50%; 
            top: 50%; 
            transform: translate(-50%, -50%); 
            background: rgba(15, 23, 42, 0.95); 
            backdrop-filter: blur(8px);
            border: 2px solid var(--neon-gold); 
            border-radius: 8px; 
            padding: 1cqh; 
            display: flex; 
            flex-direction: column; 
            gap: 1cqh; 
            z-index: 999; 
            width: max-content; 
            box-shadow: 0 10px 25px rgba(0,0,0,0.8);
            animation: pop-in 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
        }
		
        @keyframes pop-in {
            0% { transform: translate(-50%, -50%) scale(0.8); opacity: 0; }
            100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
        }
		
        .action-menu-btn {
            background: rgba(0,0,0,0.8);
            border: 1px solid var(--neon-cyan);
            color: var(--neon-cyan);
            font-family: 'Rajdhani', sans-serif;
            font-weight: bold;
            font-size: var(--ui-caption, 1.5cqh);
            padding: 0.5cqh 1cqh;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.2s;
            
            /* BAGO: Fixed height para pantay-pantay lahat kahit iba ang font size */
            height: 4cqh; 
            display: flex;
            align-items: center;
            justify-content: center;
            box-sizing: border-box;
        }
		
        .action-menu-btn:hover { 
            background: var(--neon-gold); 
            color: black;
            box-shadow: 0 0 10px var(--neon-gold-glow); 
            transform: translateY(-2px); 
        }

		.action-menu-btn.mstack-hero-kind-passive {
			background: #facc15 !important;
			border-color: #fef08a !important;
			color: #000 !important;
		}

		.action-menu-btn.mstack-hero-kind-passive:hover {
			background: #b45309 !important;
			border-color: #facc15 !important;
			color: #fff !important;
			transform: none !important;
		}

		.action-menu-btn.mstack-hero-kind-reactive {
			background: #ef4444 !important;
			border-color: #fecaca !important;
			color: #fff !important;
		}

		.action-menu-btn.mstack-hero-kind-reactive:hover {
			background: #991b1b !important;
			border-color: #ef4444 !important;
			color: #fff !important;
			transform: none !important;
		}

		.action-menu-btn.mstack-hero-kind-command {
			background: #39ff14 !important;
			border-color: #bbf7d0 !important;
			color: #000 !important;
		}

		.action-menu-btn.mstack-hero-kind-command:hover {
			background: #166534 !important;
			border-color: #39ff14 !important;
			color: #fff !important;
			transform: none !important;
		}

		.action-menu-btn.tool-action-btn {
			background: #1e3a8a !important;
			border-color: #3b82f6 !important;
			color: #fff !important;
		}

		.action-menu-btn.tool-action-btn:hover {
			background: #3b82f6 !important;
			border-color: #93c5fd !important;
			color: #fff !important;
			box-shadow: 0 0 10px rgba(59, 130, 246, 0.5) !important;
			transform: none !important;
		}

        body.is-targeting .card-in-playmat:not(.target-highlight) {
            filter: grayscale(60%) brightness(0.5);
            transition: filter 0.3s ease;
            position: relative;
            z-index: 1;
        }

        body.is-targeting .hero-zone::after,
        body.is-targeting .z-tactic::after {
            content: '';
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.6);
            z-index: 2;
            pointer-events: none;
            border-radius: inherit;
        }

        body.is-targeting .hero-zone,
        body.is-targeting .z-tactic {
            position: relative;
            overflow: visible;
        }

        body.is-targeting .card-in-playmat.target-highlight:not(.dummy-hero-overlay) {
            position: relative !important;
            z-index: 10 !important;
            filter: none !important;
        }

        .target-highlight {
            box-shadow: 0 0 20px var(--neon-red) !important;
            border: 2px solid var(--neon-red) !important;
            transform: scale(1.05);
            z-index: 50;
            filter: none !important;
            cursor: crosshair !important;
        }
        
		/* BAGO: Dynamic Highlights para sa MSTACK (Mataas na Specificity) */
        .card-in-playmat.target-highlight.mstack-highlight-reactive {
            box-shadow: 0 0 20px var(--neon-red) !important;
            border: 2px solid var(--neon-red) !important;
            transform: scale(1.05) !important;
            z-index: 50 !important;
            filter: none !important;
            cursor: pointer !important;
        }

        .card-in-playmat.target-highlight.mstack-highlight-passive {
            box-shadow: 0 0 20px var(--neon-gold) !important;
            border: 2px solid var(--neon-gold) !important;
            transform: scale(1.05) !important;
            z-index: 50 !important;
            filter: none !important;
            cursor: pointer !important;
        }
		
		/* PATCH 4: Mixed Passive and Reactive selector preview */
		body.is-targeting .card-in-playmat.target-highlight.mstack-highlight-mixed {
			border: 2px solid var(--neon-gold) !important;
			box-shadow:
				-8px 0 18px rgba(250, 204, 21, 0.80),
				8px 0 18px rgba(239, 68, 68, 0.80),
				inset 6px 0 10px rgba(250, 204, 21, 0.30),
				inset -6px 0 10px rgba(239, 68, 68, 0.30) !important;
			transform: scale(1.05) !important;
			z-index: 80 !important;
			filter: none !important;
			opacity: 1 !important;
			cursor: pointer !important;
		}

		/* === TARGETING VISUAL PRIORITY PATCH === */
		/* 1. Base Target Highlight (Pinakamalakas na Override laban sa .moved at skip) */
		body.is-targeting .card-in-playmat.target-highlight:not(.dummy-hero-overlay),
		body.is-targeting .skip-card.target-highlight {
			position: relative !important;
			z-index: 80 !important;
			filter: none !important;
			opacity: 1 !important;
			transform: scale(1.05) !important;
			box-shadow: 0 0 20px var(--neon-red) !important;
			border: 2px solid var(--neon-red) !important;
			cursor: crosshair !important;
		}
		
		body.is-targeting .card-in-playmat.target-highlight.dummy-hero-overlay {
			z-index: 120 !important;
			filter: none !important;
			opacity: 1 !important;
			box-shadow: 0 0 20px var(--neon-red) !important;
			border: 2px solid var(--neon-red) !important;
			cursor: crosshair !important;
		}

		/* 2. Patayin ang dark overlay sa mga pagod na hero kapag naging target sila */
		body.is-targeting .card-in-playmat.moved.target-highlight::before {
			display: none !important;
		}

		/* FIX: Retain Technique cards in ACT ZONE must stay in place while highlighted/clickable. */
        body.is-targeting #act-zone .card-in-playmat.card-technique[data-retain-active="true"].target-highlight {
            position: absolute !important;
            transform: none !important;
        }

        body.is-targeting #act-zone .card-in-playmat.card-technique[data-retain-active="true"][data-owner="enemy"].target-highlight {
            transform: rotate(180deg) !important;
        }
		
		/* FIX: Hero Retain Forms must stay in their ACT ZONE position while targeted. */
		body.is-targeting #act-zone .card-in-playmat.card-retain-form[data-retain-form="true"].target-highlight {
			position: absolute !important;
			transform: scale(1.05) !important;
		}

		body.is-targeting #act-zone .card-in-playmat.card-retain-form[data-retain-form="true"][data-owner="enemy"].target-highlight {
			transform: rotate(180deg) scale(1.05) !important;
		}

		.mstack-play-act-signal {
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 120;
            pointer-events: none;
            font-family: 'Rajdhani', sans-serif;
            font-weight: 900;
            font-size: 7cqh;
            letter-spacing: 0.12em;
            color: var(--neon-gold);
            text-shadow:
                0 0 10px var(--neon-gold),
                0 0 24px var(--neon-gold),
                4px 4px 0 #000;
            background:
                radial-gradient(circle, rgba(250,204,21,0.18) 0%, rgba(15,23,42,0.12) 48%, transparent 72%);
            animation: mstackPlayActSignal 0.85s ease-out forwards;
        }

        @keyframes mstackPlayActSignal {
            0% { opacity: 0; transform: scale(0.65); filter: brightness(1); }
            18% { opacity: 1; transform: scale(1.08); filter: brightness(2); }
            55% { opacity: 1; transform: scale(1); filter: brightness(1.4); }
            100% { opacity: 0; transform: scale(1.18); filter: brightness(1); }
        }

		/* 3. MSTACK Highlights (Papalitan ang cursor at kulay para sa Passive/Reactive) */
		body.is-targeting .card-in-playmat.target-highlight.mstack-highlight-reactive,
		body.is-targeting .skip-card.target-highlight.mstack-highlight-reactive {
			box-shadow: 0 0 20px var(--neon-red) !important;
			border: 2px solid var(--neon-red) !important;
			cursor: pointer !important;
		}

		body.is-targeting .card-in-playmat.target-highlight.mstack-highlight-passive,
		body.is-targeting .skip-card.target-highlight.mstack-highlight-passive {
			box-shadow: 0 0 20px var(--neon-gold) !important;
			border: 2px solid var(--neon-gold) !important;
			cursor: pointer !important;
		}

		/* 4. Non-highlighted cards at skip cards ay magdidilim */
		body.is-targeting .card-in-playmat:not(.target-highlight):not(.attached-tool):not(.attached-token),
		body.is-targeting .skip-card:not(.target-highlight) {
			filter: grayscale(100%) brightness(0.4) blur(1px) !important;
		}

        /* EXHAUSTED HERO (Tapos na umatake) */
        .card-in-playmat.moved {
            border-color: #374151 !important; 
            box-shadow: inset 0 0 20px rgba(0,0,0,0.9) !important; 
        }

		/* === Z-INDEX FIXES (MODAL & OTHERS) === */
        #modal-overlay { z-index: 199 !important; }
        .modal-content { z-index: 210 !important; 
			pointer-events: none;
			}

		#tool-replace-modal .modal-content,
		#tool-replace-modal .modal-content * {
    	    pointer-events: auto !important;
		}

        /* === MOVE ECONOMY FIX === */
        .move-circle { font-size: var(--ui-title, 3cqh) !important; font-weight: bold !important; }

        /* === ATTACHED TOOL CARDS (PERFECT CENTER & PEEK) === */
        .hero-zone { 
            position: relative !important; 
            display: flex !important; 
            justify-content: center !important; 
            align-items: center !important; 
        } 
        
        /* Siguraduhing ang Hero ang laging nasa ibabaw */
        .hero-zone .card-in-playmat:not(.attached-tool):not(.dummy-hero-overlay) {
            z-index: 10 !important; 
            position: relative !important;
        }

        .attached-tool {
            position: absolute !important;
            z-index: 1 !important; /* Nasa ilalim ng Hero */
            top: 50% !important; 
            left: 50% !important;
            transform: translate(-50%, -50%); /* Saktong nakasentro sa likod ng Hero */
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
            pointer-events: auto; 
            box-shadow: 0 4px 10px rgba(0,0,0,0.8);
            margin: 0 !important;
        }
		
		body.is-targeting .attached-tool {
			pointer-events: none !important;
		}

		/* === BAGO: ATTACHED TOKEN SYSTEM === */
        @keyframes dropTokenFromSky {
            0% { top: -80%; opacity: 0; transform: translateX(-50%) scale(0.9); }
            100% { top: var(--target-top, -12%); opacity: 1; transform: translateX(-50%) scale(1); }
        }

        .attached-token, .hero-zone > .attached-decoy {
            position: absolute !important;
            z-index: var(--target-z, 5) !important; /* BAGO: Nasa likod ng Hero (10) pero ibabaw ng Zone */
            top: var(--target-top, -12%);  /* FIX: Tinanggal ang !important para gumana ang animation */
            left: 50% !important;
            transform: translateX(-50%);
            box-shadow: none !important;
            pointer-events: auto;
            margin: 0 !important;
            animation: dropTokenFromSky 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
        }

		/* BAGO: Peeking View Animation */
        .attached-token.peek-active, .hero-zone > .attached-decoy.peek-active {
            top: -115% !important; /* Aangat pataas sa Act Zone */
            z-index: 500 !important; /* Umibabaw sa lahat ng cards */
            transform: translateX(-50%) scale(1.1) !important; /* Lalaki nang kaunti para mas kita */
            box-shadow: 0 10px 25px rgba(0,0,0,0.9), 0 0 15px var(--neon-cyan) !important;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important; /* FIX: Pilitin ang smooth animation! */
        }
		
		/* === ACT ZONE RETAIN CARD PEEK === */
		#act-zone
		.card-in-playmat.retain-peek-active {
			z-index: 500 !important;
			transform: scale(1.05) !important;
			box-shadow: 0 10px 25px rgba(0, 0, 0, 0.9), 0 0 15px var(--neon-cyan) !important;
			transition: transform 0.2s ease, box-shadow 0.2s ease !important;
		}

		#act-zone
		.card-in-playmat.retain-peek-active[data-owner="enemy"] {
			transform: rotate(180deg) scale(1.05) !important;
		}
		
		/* === STEP 5: INACTIVE TOOL VISUAL STATE === */
        .attached-tool.inactive-tool {
            filter: grayscale(100%) brightness(0.6);
            opacity: 0.75;
            box-shadow: none !important; /* BAGO: Pinatay ang glow */
            animation: none !important; /* BAGO: Pinatay ang animation */
            border-color: #4b5563 !important; /* BAGO: Gray border */
        }

        /* Naka-tago sa likod pero mas kita ang Tools sa gilid ng Hero */
		.attached-tool[data-tool-slot="1"] { transform: translate(-35%, -50%); z-index: 4 !important; }
		.attached-tool[data-tool-slot="2"] { transform: translate(-15%, -50%); z-index: 3 !important; }
		.attached-tool[data-tool-slot="3"] { transform: translate(5%, -50%); z-index: 2 !important; }
		.attached-tool[data-tool-slot="4"] { transform: translate(25%, -50%); z-index: 1 !important; }
	
		/* PEEK: Pag nag-hover sa Hero, mas lalabas pakanan ang Tools */
		.hero-zone:has(.attached-tool:hover) .attached-tool[data-tool-slot="1"] { transform: translate(25%, -50%) rotate(5deg); z-index: 9 !important; }
		.hero-zone:has(.attached-tool:hover) .attached-tool[data-tool-slot="2"] { transform: translate(55%, -50%) rotate(10deg); z-index: 8 !important; }
		.hero-zone:has(.attached-tool:hover) .attached-tool[data-tool-slot="3"] { transform: translate(85%, -50%) rotate(15deg); z-index: 7 !important; }
		.hero-zone:has(.attached-tool:hover) .attached-tool[data-tool-slot="4"] { transform: translate(115%, -50%) rotate(20deg); z-index: 6 !important; }

        /* Attached Tools remain clickable and anchored while they are valid targets.
           Fan by the attachment slots so selecting one Tool never moves the rest. */
        body.is-targeting .hero-zone:has(.attached-tool[data-tool-slot="2"]) { --tool-target-start: -75%; }
        body.is-targeting .hero-zone:has(.attached-tool[data-tool-slot="3"]) { --tool-target-start: -100%; }
        body.is-targeting .hero-zone:has(.attached-tool[data-tool-slot="4"]) { --tool-target-start: -125%; }
        body.is-targeting .hero-zone .card-in-playmat.attached-tool.target-highlight {
            position: absolute !important;
            pointer-events: auto !important;
            z-index: 80 !important;
            transition: none !important;
            transform: translate(calc(var(--tool-target-start, -50%) + var(--tool-target-step, 0%)), -50%) scale(1.05) !important;
        }
        body.is-targeting .attached-tool[data-tool-slot="2"].target-highlight { --tool-target-step: 50%; }
        body.is-targeting .attached-tool[data-tool-slot="3"].target-highlight { --tool-target-step: 100%; }
        body.is-targeting .attached-tool[data-tool-slot="4"].target-highlight { --tool-target-step: 150%; }

        /* BAGO: "Lens Overlay" na magpapapale at magpapadilim nang kaunti sa picture sa likod, ligtas ang badges sa ibabaw! */
        .card-in-playmat.moved::before {
            content: '';
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0, 0, 0, 0.25); /* BAGO: Binawasan ang itim para hindi masyadong madilim */
            backdrop-filter: grayscale(50%) brightness(0.75); /* BAGO: Pale effect na lang imbes na full gray */
            -webkit-backdrop-filter: grayscale(50%) brightness(0.75); 
            border-radius: inherit;
            z-index: 5; 
            pointer-events: none;
        }

        /* Patayin ang gray filter kapag tinarget ang hero para umilaw ulit ng buo! */
        .card-in-playmat.moved.target-highlight::before {
            display: none;
        }

		/* === ATTACK ANIMATIONS === */
		
        @keyframes shakeImpact {
            0% { transform: translate(0, 0) scale(1.05); filter: brightness(2) invert(1); }
            20% { transform: translate(-10px, 5px) scale(1.05); }
            40% { transform: translate(10px, -5px) scale(1.05); }
            60% { transform: translate(-10px, -5px) scale(1.05); }
            80% { transform: translate(10px, 5px) scale(1.05); }
            100% { transform: translate(0, 0) scale(1); filter: none; }
        }
		
        .shake-impact { animation: shakeImpact 0.4s ease-out; }
        
        .damage-popup {
            position: absolute;
            top: 40%;
            left: 50%;
            transform: translate(-50%, -50%);
            font-size: 5cqh;
            font-weight: 900;
            color: #ff003c;
            text-shadow: 0 0 10px #ff003c, 2px 2px 0 #000;
            z-index: 999;
            pointer-events: none;
            animation: floatUpFade 1.2s forwards ease-out;
        }
        @keyframes floatUpFade {
            0% { opacity: 1; transform: translate(-50%, -10%); }
            100% { opacity: 0; transform: translate(-50%, -100%); }
        }
		
		/* Universal Hardening VFX: diagonal light across a hexagonal shield grid */
		.vfx-hardening-hex {
			position: absolute;
			inset: 3%;
			z-index: 72;
			border-radius: inherit;
			pointer-events: none;
			overflow: hidden;
			opacity: 0;
			background-color: rgba(8, 47, 73, .16);
			background-image:
				linear-gradient(30deg, rgba(103, 232, 249, .78) 12%, transparent 12.5%, transparent 87%, rgba(103, 232, 249, .78) 87.5% ),
				linear-gradient( 150deg, rgba(103, 232, 249, .78) 12%, transparent 12.5%, transparent 87%, rgba(103, 232, 249, .78) 87.5% ),
				linear-gradient( 30deg, rgba(103, 232, 249, .78) 12%, transparent 12.5%, transparent 87%, rgba(103, 232, 249, .78) 87.5% ),
				linear-gradient( 150deg, rgba(103, 232, 249, .78) 12%, transparent 12.5%, transparent 87%, rgba(103, 232, 249, .78) 87.5% ),
				linear-gradient( 60deg,rgba(255, 255, 255, .42) 25%, transparent 25.5%, transparent 75%, rgba(255, 255, 255, .42) 75% );
			background-size: 3.2cqh 5.6cqh;
			background-position: 0 0, 0 0, 1.6cqh 2.8cqh, 1.6cqh 2.8cqh, 0 0;
			filter: drop-shadow(0 0 5px #22d3ee) drop-shadow(0 0 12px #0ea5e9);
			animation: hardeningHexGrid 1.05s ease-out forwards;
		}

		.vfx-hardening-hex::after {
			content: '';
			position: absolute;
			inset: -70%;
			background: linear-gradient( 135deg, transparent 42%, rgba(255, 255, 255, .08) 46%, rgba(207, 250, 254, .95) 50%, rgba(34, 211, 238, .42) 54%, transparent 58% );
			transform: translate(-42%, 42%);
			mix-blend-mode: screen;
			animation: hardeningDiagonalSweep .72s ease-in-out forwards;
		}

		@keyframes hardeningHexGrid {
			0% { opacity: 0; transform: scale(.92); }
			18% { opacity: .5; }
			52% { opacity: 1; transform: scale(1.03); box-shadow: inset 0 0 22px rgba(103, 232, 249, .65), 0 0 22px rgba(14, 165, 233, .75); }
			78% { opacity: .88; transform: scale(1); }
			100% { opacity: 0; transform: scale(1.04); }
		}

		@keyframes hardeningDiagonalSweep {
			0% { opacity: 0; transform: translate(-42%, 42%); }
			15% { opacity: 1; }
			75% { opacity: 1; }
			100% { opacity: 0; transform: translate(42%, -42%); }
		}
		
		.card-in-playmat.card-hero[data-enemy-control-pending="true"] {
			box-shadow: 0 0 10px rgba(192, 132, 252, .9), 0 0 24px rgba(126, 34, 206, .85), inset 0 0 18px rgba(88, 28, 135, .55) !important;
		}

		.card-in-playmat.card-hero[data-enemy-control-pending="true"]::after {
			content: '';
			position: absolute;
			inset: 0;
			z-index: 10;
			border-radius: inherit;
			pointer-events: none;
			background: rgba(88, 28, 135, .1);
			backdrop-filter: invert(.22) hue-rotate(205deg) saturate(1.25) brightness(.92);
			animation: enemyControlNegativePulse 1.1s ease-in-out infinite alternate;
		}

		.vfx-mind-control-lock {
			position: absolute;
			inset: -12%;
			z-index: 76;
			border-radius: 50%;
			pointer-events: none;
			border: 2px solid rgba(216, 180, 254, .9);
			box-shadow: 0 0 10px #e9d5ff, 0 0 24px #a855f7, inset 0 0 18px rgba(126, 34, 206, .7);
			animation: mindControlLockIn .8s ease-out forwards;
		}

		.vfx-mind-control-lock::before,
		.vfx-mind-control-lock::after {
			content: '';
			position: absolute;
			inset: 12%;
			border-radius: 50%;
			border: 1px dashed rgba(233, 213, 255, .95);
			animation: mindControlRingSpin .55s linear infinite;
		}

		.vfx-mind-control-lock::after {
			inset: 28%;
			border-style: solid;
			animation-direction: reverse;
		}

		@keyframes enemyControlNegativePulse {
			0% { opacity: .82; transform: scale(.99); }
			100% { opacity: 1; transform: scale(1.015); }
		}

		@keyframes mindControlLockIn {
			0% { opacity: 0; transform: scale(1.55) rotate(-18deg); }
			35% { opacity: 1; }
			72% { opacity: 1; transform: scale(.94) rotate(8deg); }
			100% { opacity: 0; transform: scale(.82) rotate(14deg); }
		}

		@keyframes mindControlRingSpin {
			to { transform: rotate(360deg); }
		}
		
		/* Universal copied-command aura absorption */
		.vfx-copy-aura-source {
			animation: copyAuraDrain .9s ease-in-out forwards;
		}

		.vfx-copy-aura-wisp {
			position: fixed;
			width: 1.15cqh;
			height: 1.15cqh;
			z-index: 99998;
			border-radius: 48% 52% 62% 38%;
			pointer-events: none;
			background: radial-gradient( circle, #fff 0 10%, #67e8f9 28%, #a855f7 58%, transparent 76% );
			box-shadow: 0 0 8px #67e8f9, 0 0 18px #a855f7;
			transform: translate(-50%, -50%) scale(.45);
			animation: copyAuraWispTravel .72s cubic-bezier(.38, .02, .2, 1) var(--copy-delay) forwards;
		}

		.vfx-copy-aura-received {
			animation: copyAuraReceive .26s ease-out forwards;
		}

		@keyframes copyAuraDrain {
			0% { filter: brightness(1) saturate(1); }
			45% { filter: brightness(1.35) saturate(2.2) drop-shadow( 0 0 16px #a855f7 ); }
			100% { filter: brightness(.72) saturate(.55); }
		}

		@keyframes copyAuraWispTravel {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(.35); }
			16% { opacity: 1; }
			52% { transform: translate( calc( -50% + var(--copy-curve) ), calc(-50% - 3cqh) ) scale(1.15); }
			100% { left: var(--copy-end-x); top: var(--copy-end-y); opacity: 0; transform: translate(-50%, -50%) scale(.15); }
		}

		@keyframes copyAuraReceive {
			0% { filter: brightness(1); }
			55% { filter: brightness(1.8) saturate(2.1) drop-shadow( 0 0 20px #67e8f9 ) drop-shadow( 0 0 32px #a855f7 ); }
			100% { filter: brightness(1); }
		}

		/* === ATTACK VFX (VISUAL EFFECTS) === */
		
		.attack-vfx-shadow {
			opacity: 0.58 !important;
			filter: 
				grayscale(100%) 
				brightness(1.45) 
				contrast(1.1)
				drop-shadow( 0 0 8px rgba(255, 255, 255, 0.85) )
				drop-shadow( 0 0 18px rgba(156, 163, 175, 0.9) ) !important;
		}
		
		/* === WEAPON DETECTOR SCANNING VFX === */
		.vfx-target-scan-reticle {
			position: fixed;
			pointer-events: none;
			z-index: 99999;
			border: 2px solid var(--scan-color);
			border-radius: 50%;
			box-sizing: border-box;
			box-shadow: 0 0 10px #fff, 0 0 22px var(--scan-color), inset 0 0 18px var(--scan-color);
			background:
				linear-gradient( var(--scan-color), var(--scan-color) ) center / 2px 100% no-repeat,
				linear-gradient( 90deg, var(--scan-color), var(--scan-color) ) center / 100% 2px no-repeat,
				radial-gradient( circle, transparent 0 18%, var(--scan-color) 19% 21%, transparent 22% 45%, var(--scan-color) 46% 48%, transparent 49% );
			filter: drop-shadow( 0 0 7px var(--scan-color) );
			animation: targetScanLock .9s ease-out forwards;
		}

		.vfx-target-scan-reticle::before,
		.vfx-target-scan-reticle::after {
			content: '';
			position: absolute;
			top: 18%;
			bottom: 18%;
			width: 36%;
			border: 3px solid var(--scan-color);
			box-shadow: 0 0 10px var(--scan-color), inset 0 0 10px var(--scan-color);
		}

		.vfx-target-scan-reticle::before {
			left: -16%;
			border-right: 0;
			border-radius: 70% 0 0 70%;
		}

		.vfx-target-scan-reticle::after {
			right: -16%;
			border-left: 0;
			border-radius: 0 70% 70% 0;
		}

		@keyframes targetScanLock {
			0% { opacity: 0; transform: scale(1.55); filter: blur(2px) drop-shadow( 0 0 4px var(--scan-color) ); }
			28% { opacity: 1; transform: scale(.92); filter: blur(0) drop-shadow( 0 0 14px var(--scan-color) ); }
			55% { opacity: 1; transform: scale(1.04); }
			80% { opacity: 1; transform: scale(1); filter: brightness(2) drop-shadow( 0 0 18px var(--scan-color) ); }
			100% { opacity: 0; transform: scale(.88); filter: brightness(1) drop-shadow( 0 0 5px var(--scan-color) ); }
		}
		
		.vfx-card-scanner {
			position: fixed;
			overflow: hidden;
			pointer-events: none;
			z-index: 99998;
			border-radius: 8px;
			box-sizing: border-box;
			background: linear-gradient(
				to bottom,
				color-mix(in srgb, var(--scanner-color, #06b6d4) 4%, transparent),
				color-mix(in srgb, var(--scanner-color, #06b6d4) 12%, transparent),
				color-mix(in srgb, var(--scanner-color, #06b6d4) 4%, transparent)
			);
			box-shadow:
				inset 0 0 12px color-mix(in srgb, var(--scanner-color, #06b6d4) 35%, transparent),
				0 0 12px color-mix(in srgb, var(--scanner-color, #06b6d4) 25%, transparent);
		}

		.vfx-card-scanner::before {
			content: '';
			position: absolute;
			left: -5%;
			top: -8%;
			width: 110%;
			height: 4px;
			border-radius: 999px;
			background: linear-gradient(
				90deg,
				transparent 0%,
				var(--scanner-color, #06b6d4) 15%,
				#ffffff 50%,
				var(--scanner-color, #06b6d4) 85%,
				transparent 100%
			);
			box-shadow:
				0 0 8px #ffffff,
				0 0 16px var(--scanner-color, #06b6d4),
				0 0 28px var(--scanner-color, #06b6d4);
			animation: weaponDetectorScanLine 0.72s linear forwards;
		}

		.vfx-card-scanner::after {
			content: '';
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 22%;
			background: linear-gradient(
				to bottom,
				color-mix(in srgb, var(--scanner-color, #06b6d4) 20%, transparent),
				transparent
			);
			opacity: 0;
			animation: weaponDetectorScanGlow 0.72s linear forwards;
		}

		@keyframes weaponDetectorScanLine {
			0% { top: -8%; opacity: 0; }
			10% { opacity: 1; }
			90% { opacity: 1; }
			100% { top: 102%; opacity: 0; }
		}

		@keyframes weaponDetectorScanGlow {
			0% { top: -22%; opacity: 0; }
			12% { opacity: 0.75; }
			88% { opacity: 0.75; }
			100% { top: 100%; opacity: 0; }
		}
        
        /* 1. Melee Slash */
        .vfx-slash {
            position: absolute;
            width: 100%; height: 100%;
            top: 0; left: 0;
            background: 
                linear-gradient(45deg, transparent 45%, var(--neon-red) 48%, transparent 55%),
                linear-gradient(-45deg, transparent 45%, var(--neon-red) 48%, transparent 55%);
            background-size: 100% 100%;
            opacity: 0;
            z-index: 60;
            pointer-events: none;
            animation: slashAnim 0.3s cubic-bezier(0.17, 0.67, 0.83, 0.67) forwards;
            filter: drop-shadow(0 0 8px var(--neon-red)) drop-shadow(0 0 14px #fff);
        }
		
        @keyframes slashAnim {
            0% { transform: scale(1.5); opacity: 0; }
            50% { transform: scale(1); opacity: 1; }
            100% { transform: scale(1.2); opacity: 0; }
        }

        /* 2. Ranged Projectile */
        .vfx-projectile {
			position: fixed;
			width: 34px;
			height: 8px;
			border-radius: 999px;
			background:
				linear-gradient(
					90deg,
					#f59e0b 0%,
					#facc15 38%,
					#fff 72%,
					#fff7ed 100%
				);
			clip-path: polygon(0 20%, 72% 20%, 100% 50%, 72% 80%, 0 80%);
			box-shadow:
				0 0 8px #fff,
				0 0 16px var(--neon-gold),
				0 0 28px rgba(250, 204, 21, 0.85);
			filter: brightness(1.35);
			z-index: 9999;
			pointer-events: none;
			transition:
				left var(--ranged-travel, 220ms) linear,
				top var(--ranged-travel, 220ms) linear;
		}

		.vfx-projectile::before {
			content: '';
			position: absolute;
			right: 65%;
			top: 50%;
			width: var(--ranged-trail, 75px);
			height: 180%;
			transform: translateY(-50%);
			transform-origin: right center;
			border-radius: 999px 0 0 999px;
			background:
				linear-gradient(
					90deg,
					transparent 0%,
					rgba(249, 115, 22, 0.18) 25%,
					rgba(250, 204, 21, 0.75) 72%,
					#fff 100%
				);
			filter: blur(3px);
		}

		.vfx-projectile::after {
			content: '';
			position: absolute;
			right: -4px;
			top: 50%;
			width: 9px;
			height: 9px;
			transform: translateY(-50%);
			border-radius: 50%;
			background: #fff;
			box-shadow:
				0 0 8px #fff,
				0 0 16px var(--neon-gold);
		}

        /* 3. Magic Orb */
        .vfx-orb {
            position: fixed;
            width: 25px; height: 25px;
            background: #fff;
            border-radius: 50%;
            box-shadow: 0 0 15px var(--neon-cyan), 0 0 30px var(--neon-cyan), inset 0 0 10px var(--neon-cyan);
            z-index: 9999;
            pointer-events: none;
            transition: all 0.4s ease-in;
        }
		
        .vfx-magic-explosion {
            animation: magicBoom 0.3s ease-out forwards !important;
        }
		
        @keyframes magicBoom { 
 	    0% { transform: scale(1); opacity: 1; } 
 	    100% { transform: scale(var(--magic-boom-scale, 4)); opacity: 0; } 
        }
		
		/* Soft explosion: a small dust burst and fading shock ring. */
		.vfx-soft-explosion { position: fixed; left: var(--explode-x); top: var(--explode-y); width: 10cqh; height: 10cqh; border-radius: 50%; pointer-events: none; z-index: 9999; background: radial-gradient(circle, #d1d5db99 0%, var(--explode-color, #737373) 32%, #3f3f3f80 52%, transparent 72%); animation: softExplosionBurst .65s ease-out forwards; }
		.vfx-soft-explosion::before { content: ''; position: absolute; inset: 15%; background: linear-gradient(135deg, #d1d5db, var(--explode-color, #737373) 55%, #525252); opacity: .8; clip-path: polygon(50% 0%, 61% 28%, 86% 10%, 75% 39%, 100% 50%, 72% 61%, 87% 87%, 60% 76%, 50% 100%, 39% 72%, 13% 87%, 25% 61%, 0% 50%, 28% 39%, 13% 13%, 39% 25%); }
		.vfx-soft-explosion::after { content: ''; position: absolute; inset: -10%; border: 2px dashed var(--explode-color, #737373); box-shadow: 0 0 0 1px #d1d5db80; border-radius: 50%; animation: softExplosionRing .65s ease-out forwards; }
		@keyframes softExplosionBurst { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.3); filter: blur(0); } 18% { opacity: 1; transform: translate(-50%, -50%) scale(.9); } 45% { opacity: .9; transform: translate(-50%, -50%) scale(1.2); filter: blur(0); } 100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); filter: blur(2px); } }
		@keyframes softExplosionRing { 0% { opacity: 0; transform: scale(.4); } 25% { opacity: .85; } 50% { opacity: .6; } 100% { opacity: 0; transform: scale(1.7); filter: blur(1px); } }

		/* === RETAIN FORM EXPLOSION VFX === */
		.vfx-retain-explosion {
			position: fixed;
			left: var(--explode-x);
			top: var(--explode-y);
			width: 12cqh;
			height: 12cqh;
			border-radius: 50%;
			transform: translate(-50%, -50%) scale(0.15);
			background: radial-gradient( circle, #ffffff 0%, var(--explode-color, #f5d0fe) 16%, var(--explode-color, #c084fc) 34%, var(--explode-color, #7e22ce) 58%, var(--explode-color, #3b0764) 72%, transparent 80% );
			box-shadow: 0 0 18px #ffffff, 0 0 34px var(--explode-color, #c084fc), 0 0 60px var(--explode-color, #7e22ce), 0 0 90px var(--explode-color, rgba(88, 28, 135, 0.9));
			mix-blend-mode: screen;
			z-index: 220;
			pointer-events: none;
			animation: retainExplosionBurst 1.15s cubic-bezier(0.16, 0.84, 0.24, 1) forwards;
		}

		.vfx-retain-explosion::before {
			content: '';
			position: absolute;
			inset: -30%;
			border: 4px solid var(--explode-color, #d8b4fe);
			border-radius: 50%;
			box-shadow: 0 0 20px var(--explode-color, #c084fc), inset 0 0 18px var(--explode-color, rgba(192, 132, 252, 0.75));
			animation: retainExplosionRing 1.15s ease-out forwards;
		}

		.vfx-retain-explosion::after {
			content: '';
			position: absolute;
			inset: -70%;
			border-radius: 50%;
			background: radial-gradient( circle, rgba(255, 255, 255, 0.8) 0%, var(--explode-color, rgba(192, 132, 252, 0.45)) 28%, var(--explode-color, rgba(88, 28, 135, 0.2)) 55%, transparent 75% );
			animation: retainExplosionFlash 0.8s ease-out forwards;
		}

		@keyframes retainExplosionBurst {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(0.15); filter: brightness(1); }
			18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); filter: brightness(3); }
			52% { opacity: 1; transform: translate(-50%, -50%) scale(1.4); filter: brightness(1.8); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(14); filter: brightness(0.6) blur(5px); }
		}

		@keyframes retainExplosionRing {
			0% { opacity: 0; transform: scale(0.25); }
			22% { opacity: 1; transform: scale(0.9); }
			100% { opacity: 0; transform: scale(11); }
		}

		@keyframes retainExplosionFlash {
			0% { opacity: 0; transform: scale(0.4); }
			20% { opacity: 1; transform: scale(1); }
			100% { opacity: 0; transform: scale(12); }
		}
        
		/* 4. Universal Beam */
		.vfx-beam {
			position: fixed;
			z-index: 9999;
			pointer-events: none;
			transform-origin: left center;
			border-radius: 0 999px 999px 0;
			background: linear-gradient(90deg, #fff, var(--neon-green) 35%, #fff 72%, transparent);
			box-shadow: 0 0 12px #fff, 0 0 26px var(--neon-green), 0 0 45px var(--neon-green);
			animation: animeBeamDrain var(--beam-time, 520ms) ease-out forwards;
		}
		.vfx-beam::before {
			content: '';
			position: absolute;
			inset: 28% 0;
			border-radius: inherit;
			background: #fff;
			box-shadow: 0 0 12px #fff;
		}
		@keyframes animeBeamDrain {
			0% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateY(-50%) rotate(var(--beam-angle)) scaleY(.35); }
			18% { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(-50%) rotate(var(--beam-angle)) scaleY(1.18); }
			62% { opacity: 1; clip-path: inset(0 0 0 0); transform: translateY(-50%) rotate(var(--beam-angle)) scaleY(1); }
			100% { opacity: 0; clip-path: inset(0 0 0 100%); transform: translateY(-50%) rotate(var(--beam-angle)) scaleY(.15); }
		}

		/* 5. Universal Power Smash */
		.vfx-smash-core {
			position: fixed;
			width: var(--smash-size, 28px);
			height: var(--smash-size, 28px);
			border-radius: 35% 65% 65% 35%;
			z-index: 9999;
			pointer-events: none;
			background: radial-gradient(circle at 70%, #fff 0 18%, #facc15 32%, #f97316 58%, #7f1d1d 78%);
			box-shadow: 0 0 12px #fff, 0 0 26px #f97316, 0 0 44px #ef4444;
			transition: left var(--smash-travel, 260ms) cubic-bezier(.1,.75,.2,1), top var(--smash-travel, 260ms) cubic-bezier(.1,.75,.2,1);
		}
		.vfx-smash-core::before {
			content: '';
			position: absolute;
			right: 60%;
			top: 20%;
			width: 75px;
			height: 60%;
			border-radius: 999px 0 0 999px;
			background: linear-gradient(90deg, transparent, #ef4444 28%, #f97316 68%, #fff);
			filter: blur(4px);
		}
		.vfx-smash-ring {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 35%;
			height: 35%;
			border: 5px solid #f97316;
			border-radius: 50%;
			z-index: 65;
			pointer-events: none;
			box-shadow: 0 0 15px #fff, 0 0 30px #f97316, inset 0 0 20px #ef4444;
			animation: smashRingAnim .55s ease-out forwards;
		}
		.vfx-smash-ring.echo {
			border-width: 3px;
			border-color: #facc15;
			animation-delay: 90ms;
		}
		@keyframes smashRingAnim {
			0% { opacity: 0; transform: translate(-50%,-50%) scale(.15); }
			18% { opacity: 1; transform: translate(-50%,-50%) scale(.75); }
			100% { opacity: 0; transform: translate(-50%,-50%) scale(2.4); }
		}
		
		.vfx-hammer-impact {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 52%;
			height: 52%;
			border: 5px solid #ef4444;
			border-radius: 20%;
			transform: translate(-50%, -50%) scale(0.22) rotate(45deg);
			background: radial-gradient( circle, rgba(255, 255, 255, 0.75) 0%, rgba(249, 115, 22, 0.38) 30%, rgba(239, 68, 68, 0.2) 58%, transparent 76% );
			box-shadow: 0 0 14px #ffffff, 0 0 30px #f97316, 0 0 55px #ef4444, inset 0 0 24px rgba(239, 68, 68, 0.85);
			z-index: 96;
			pointer-events: none;
			animation: hammerImpactBurst 0.62s cubic-bezier(0.12, 0.8, 0.22, 1) forwards;
		}

		.vfx-hammer-echo {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 54%;
			height: 54%;
			border: 4px solid rgba(249, 115, 22, 0.9);
			border-radius: 20%;
			transform: translate(-50%, -50%) scale(0.28) rotate(45deg);
			box-shadow: 0 0 18px rgba(255, 255, 255, 0.85), 0 0 34px rgba(249, 115, 22, 0.9), inset 0 0 20px rgba(239, 68, 68, 0.55);
			z-index: 95;
			pointer-events: none;
			opacity: 0;
			animation: hammerEchoBurst 0.68s ease-out forwards;
		}

		.vfx-hammer-echo.echo-two {
			width: 60%;
			height: 60%;
			border-width: 3px;
			border-color: rgba(239, 68, 68, 0.72);
			animation-delay: 0.13s;
		}

		.vfx-hammer-echo.echo-three {
			width: 68%;
			height: 68%;
			border-width: 2px;
			border-color: rgba(127, 29, 29, 0.7);
			animation-delay: 0.26s;
		}

		.vfx-hammer-impact-flash {
			position: absolute;
			inset: -12%;
			border-radius: 20%;
			background: radial-gradient( circle, rgba(255, 255, 255, 1) 0%, rgba(249, 115, 22, 0.8) 22%, rgba(239, 68, 68, 0.48) 48%, transparent 76% );
			mix-blend-mode: screen;
			z-index: 94;
			pointer-events: none;
			animation: hammerImpactFlash 0.5s ease-out forwards;
		}

		@keyframes hammerImpactBurst {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(0.18) rotate(45deg); filter: brightness(1); }
			18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(45deg); filter: brightness(3); }
			48% { opacity: 1; transform: translate(-50%, -50%) scale(0.92) rotate(45deg); filter: brightness(1.8); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(2.15) rotate(45deg); filter: brightness(0.65); }
		}

		@keyframes hammerEchoBurst {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3) rotate(45deg); }
			20% { opacity: 0.95; }
			72% { opacity: 0.7; }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(2.5) rotate(45deg); }
		}

		@keyframes hammerImpactFlash {
			0% { opacity: 0; transform: scale(0.55); filter: brightness(1); }
			16% { opacity: 1; transform: scale(1); filter: brightness(3.2); }
			100% { opacity: 0; transform: scale(1.65); filter: brightness(0.7); }
		}
		
		.vfx-hammer-target-shake {
			animation: hammerTargetShake 0.24s linear;
		}

		@keyframes hammerTargetShake {
			0%, 100% { translate: 0 0; }
			20% { translate: -2px 1px; }
			40% { translate: 2px -1px; }
			60% { translate: -1px 1px; }
			80% { translate: 1px 0; }
		}

		/* 6. Fire Burst */
		.vfx-fireball {
			position: fixed;
			width: 24px;
			height: 24px;
			border-radius: 50%;
			background: radial-gradient(circle, #fff7ed 0%, #fb923c 35%, #dc2626 70%, transparent 100%);
			box-shadow: 0 0 15px #fb923c, 0 0 30px #ef4444;
			z-index: 9999;
			pointer-events: none;
			transition: all 0.3s ease-in;
		}

		.vfx-fire-burst {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 40%;
			height: 40%;
			border-radius: 50%;
			background: radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(251,146,60,0.9) 30%, rgba(220,38,38,0.6) 60%, transparent 75%);
			transform: translate(-50%, -50%) scale(0.5);
			filter: blur(1px);
			z-index: 66;
			pointer-events: none;
			animation: fireBurstAnim 0.35s ease-out forwards;
		}
	
		@keyframes fireBurstAnim {
			0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
			70% { opacity: 1; transform: translate(-50%, -50%) scale(1.5); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(2); }
		}
		
		/* Universal residual flame VFX after a fire impact */
		.vfx-lingering-flames {
			position: absolute;
			left: 8%;
			right: 8%;
			bottom: 2%;
			height: 42%;
			z-index: 67;
			pointer-events: none;
			overflow: hidden;
			opacity: 0;
			filter:
				drop-shadow(0 0 6px #fb923c)
				drop-shadow(0 0 12px #dc2626);
			animation: lingeringFlamesFade 0.95s ease-out forwards;
		}

		.vfx-lingering-flames::before,
		.vfx-lingering-flames::after {
			content: '';
			position: absolute;
			bottom: -12%;
			width: 34%;
			height: 82%;
			border-radius: 55% 45% 60% 40%;
			background:
				radial-gradient(
					ellipse at 50% 78%,
					#fff7ed 0 12%,
					#fb923c 28%,
					#ef4444 52%,
					rgba(127,29,29,.35) 70%,
					transparent 76%
				);
			transform-origin: 50% 100%;
			mix-blend-mode: screen;
		}

		.vfx-lingering-flames::before {
			left: 7%;
			animation: lingeringFlameLeft 0.24s ease-in-out infinite alternate;
		}

		.vfx-lingering-flames::after {
			right: 7%;
			height: 68%;
			animation: lingeringFlameRight 0.19s ease-in-out infinite alternate-reverse;
		}

		@keyframes lingeringFlamesFade {
			0% { opacity: 0; transform: scaleY(.55); }
			18% { opacity: .95; transform: scaleY(1); }
			72% { opacity: .82; }
			100% { opacity: 0; transform: translateY(-12%) scaleY(.72); }
		}

		@keyframes lingeringFlameLeft {
			0% { transform: translateY(3%) rotate(-5deg) scale(.88, .92); }
			100% { transform: translateY(-8%) rotate(7deg) scale(1.08, 1.16); }
		}

		@keyframes lingeringFlameRight {
			0% { transform: translateY(1%) rotate(6deg) scale(.9, .86); }
			100% { transform: translateY(-11%) rotate(-8deg) scale(1.06, 1.18); }
		}
	
		/* 7. Enhanced Shared Attack Effects */
		.vfx-impact-spark {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 35%;
			height: 35%;
			border-radius: 50%;
			background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(250,204,21,0.9) 25%, rgba(239,68,68,0.55) 55%, transparent 75%);
			transform: translate(-50%, -50%) scale(0.4);
			filter: blur(0.5px);
			z-index: 67;
			pointer-events: none;
			animation: impactSparkAnim 0.28s ease-out forwards;
		}

		@keyframes impactSparkAnim {
			0% { opacity: 1; transform: translate(-50%, -50%) scale(0.3); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(1.8); }
		}

		.vfx-muzzle-flash {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 28%;
			height: 28%;
			border-radius: 50%;
			background: radial-gradient(circle, #fff 0%, #facc15 35%, transparent 70%);
			transform: translate(-50%, -50%) scale(0.4);
			box-shadow: 0 0 15px #facc15, 0 0 25px #fff;
			z-index: 68;
			pointer-events: none;
			animation: quickFlashAnim 0.22s ease-out forwards;
		}	

		.vfx-cast-circle {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 70%;
			height: 70%;
			border: 2px dashed var(--neon-cyan);
			border-radius: 50%;
			transform: translate(-50%, -50%) scale(0.6) rotate(0deg);
			box-shadow: 0 0 12px var(--neon-cyan), inset 0 0 12px rgba(6,182,212,0.35);
			z-index: 62;
			pointer-events: none;
			animation: castCircleAnim 0.35s ease-out forwards;
		}

		@keyframes castCircleAnim {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
			40% { opacity: 1; }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(1.1) rotate(160deg); }
		}

		.vfx-target-rune {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 75%;
			height: 75%;
			border: 2px solid var(--neon-cyan);
			border-radius: 50%;
			transform: translate(-50%, -50%) scale(0.5);
			box-shadow: 0 0 15px var(--neon-cyan), inset 0 0 15px rgba(6,182,212,0.4);
			z-index: 63;
			pointer-events: none;
			animation: targetRuneAnim 0.35s ease-out forwards;
		}

		@keyframes targetRuneAnim {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
			40% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
		}
	
		.vfx-beam-charge {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 45%;
			height: 45%;
			border-radius: 50%;
			background: radial-gradient(circle, rgba(255,255,255,1) 0%, rgba(57,255,20,0.85) 35%, transparent 75%);
			transform: translate(-50%, -50%) scale(0.35);
			box-shadow: 0 0 20px var(--neon-green), 0 0 35px #fff;
			z-index: 68;
			pointer-events: none;
			animation: beamChargeAnim 0.28s ease-out forwards;
		}
	
		@keyframes beamChargeAnim {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(0.2); }
			60% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(1.25); }
		}
	
		@keyframes quickFlashAnim {
			0% { opacity: 1; transform: translate(-50%, -50%) scale(0.4); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(1.5); }
		}

		/* 8. PWR Overflow / Overkill Effects */
		.vfx-overkill-flash {
			position: absolute;
			top: 0;
			left: 0;
			width: 100cqw;
			height: 100cqh;
			background:
			radial-gradient(circle at center, rgba(255,255,255,0.45) 0%, rgba(250,204,21,0.25) 25%, rgba(239,68,68,0.18) 45%, transparent 70%);
			z-index: 9998;
			pointer-events: none;
			animation: overkillFlashAnim 0.45s ease-out forwards;
		}

		@keyframes overkillFlashAnim {
			0% { opacity: 0; }
			20% { opacity: 1; }
			100% { opacity: 0; }
		}

		.vfx-burn-overlay {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			border-radius: inherit;
			background:
			radial-gradient(circle, rgba(255,255,255,0.75) 0%, rgba(251,146,60,0.45) 30%, rgba(0,0,0,0.75) 70%);
			mix-blend-mode: screen;
			z-index: 70;
			pointer-events: none;
			animation: burnOverlayAnim 0.75s ease-out forwards;
		}

		@keyframes burnOverlayAnim {
			0% { opacity: 0; filter: brightness(1); }
			20% { opacity: 1; filter: brightness(2); }
			100% { opacity: 0; filter: brightness(0.6); }
		}

		/* 9. Phantom Slice / After Image (Fire Stealth) */
        .vfx-phantom-slice {
            position: absolute;
            width: 150%; height: 150%;
            top: -25%; left: -25%;
            background: 
                linear-gradient(45deg, transparent 48%, var(--neon-red) 49%, #fff 50%, var(--neon-red) 51%, transparent 52%),
                linear-gradient(-45deg, transparent 48%, var(--neon-red) 49%, #fff 50%, var(--neon-red) 51%, transparent 52%);
            background-size: 200% 200%;
            background-position: center;
            opacity: 0;
            z-index: 80;
            pointer-events: none;
            animation: phantomSliceAnim 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.67) forwards;
            filter: drop-shadow(0 0 10px var(--neon-red)) drop-shadow(0 0 20px #fff);
        }
        @keyframes phantomSliceAnim {
            0% { transform: scale(2) rotate(0deg); opacity: 0; }
            20% { transform: scale(1) rotate(0deg); opacity: 1; }
            40% { transform: scale(1.1) rotate(10deg); opacity: 1; }
            100% { transform: scale(1.5) rotate(20deg); opacity: 0; }
        }
		
		/* Universal RE_ATTACK violent spectral-flame state */
		.re-attack-stealth-state {
			opacity: .48;
			filter:
				saturate(.9)
				brightness(.76)
				drop-shadow(0 0 8px #86efac)
				drop-shadow(0 0 20px #22c55e);
			box-shadow:
				0 0 12px rgba(187,247,208,.8),
				0 0 28px rgba(34,197,94,.8),
				0 0 48px rgba(21,128,61,.65),
				inset 0 0 18px rgba(34,197,94,.35) !important;
			animation: reAttackFlamePulse .5s ease-in-out infinite alternate;
			will-change: opacity, filter, box-shadow;
		}

		.re-attack-stealth-state::after {
			content: '';
			position: absolute;
			inset: -24%;
			z-index: 95;
			border-radius: 42% 58% 35% 65%;
			pointer-events: none;
			opacity: .9;
			mix-blend-mode: screen;
			transform-origin: center center;
			background:
				radial-gradient(
					ellipse at 50% 50%,
					transparent 0 45%,
					rgba(220,252,231,.88) 52%,
					rgba(74,222,128,.78) 61%,
					rgba(34,197,94,.52) 72%,
					transparent 84%
				),
				conic-gradient(
					from 15deg,
					transparent,
					rgba(34,197,94,.75),
					transparent 18%,
					rgba(134,239,172,.9) 29%,
					transparent 43%,
					rgba(21,128,61,.78) 57%,
					transparent 71%,
					rgba(74,222,128,.82) 86%,
					transparent
				);
			filter: blur(4px);
			animation: reAttackViolentFlame .42s ease-in-out infinite alternate;
			will-change: transform, opacity, border-radius, filter;
		}

		.re-attack-stealth-state.re-attack-stealth-exit {
			animation: reAttackAuraFadeOut .38s ease-out forwards;
		}

		.re-attack-stealth-state.re-attack-stealth-exit::after {
			animation: reAttackFlameFadeOut .38s ease-out forwards;
		}

		@keyframes reAttackFlamePulse {
			0% { opacity: .4; filter: saturate(.75) brightness(.68) drop-shadow(0 0 7px #86efac) drop-shadow(0 0 15px #22c55e); }
			100% { opacity: .55; filter: saturate(1.1) brightness(.88) drop-shadow(0 0 12px #bbf7d0) drop-shadow(0 0 30px #16a34a); }
		}

		@keyframes reAttackViolentFlame {
			0% { transform: scale(.9,.96) rotate(-3deg); border-radius: 38% 62% 31% 69%; filter: blur(5px); opacity: .65; }
			25% { transform: scale(1.08,1.16) rotate(2deg); border-radius: 64% 36% 58% 42%; filter: blur(3px); opacity: 1; }
			55% { transform: scale(.97,1.25) rotate(-2deg); border-radius: 29% 71% 43% 57%; filter: blur(5px); opacity: .78; }
			100% { transform: scale(1.14,1.1) rotate(4deg); border-radius: 59% 41% 68% 32%; filter: blur(3px); opacity: .96; }
		}

		@keyframes reAttackAuraFadeOut {
			from { opacity: .48; }
			to { opacity: 1; filter: none; box-shadow: none; }
		}

		@keyframes reAttackFlameFadeOut {
			from { opacity: .9; transform: scale(1); }
			to { opacity: 0; transform: scale(1.4); filter: blur(10px); }
		}
		
		/* Universal mechanical repair VFX */
		.vfx-gear-repair {
			position: absolute;
			inset: -12%;
			z-index: 96;
			pointer-events: none;
			filter: drop-shadow(0 0 8px #22c55e);
		}

		.vfx-gear-repair::before,
		.vfx-gear-repair::after {
			content: '⚙';
			position: absolute;
			color: #86efac;
			font-size: 5.5cqh;
			line-height: 1;
			text-shadow:
				0 0 6px #fff,
				0 0 14px #22c55e,
				0 0 24px #15803d;
		}

		.vfx-gear-repair::before {
			left: 4%;
			top: 12%;
			animation: gearRepairClockwise .9s linear forwards;
		}

		.vfx-gear-repair::after {
			right: 3%;
			bottom: 10%;
			font-size: 4.2cqh;
			animation: gearRepairCounter .9s linear forwards;
		}

		@keyframes gearRepairClockwise {
			0% { transform: rotate(0deg) scale(.45); opacity: 0; }
			20% { transform: rotate(90deg) scale(1); opacity: 1; }
			80% { transform: rotate(420deg) scale(1.08); opacity: 1; }
			100% { transform: rotate(540deg) scale(.7); opacity: 0; }
		}

		@keyframes gearRepairCounter {
			0% { transform: rotate(0deg) scale(.4); opacity: 0; }
			20% { transform: rotate(-80deg) scale(1); opacity: 1; }
			80% { transform: rotate(-360deg) scale(1.12); opacity: 1; }
			100% { transform: rotate(-500deg) scale(.7); opacity: 0; }
		}

		/* 10. Lightning / Electrocute Effect */
        .vfx-lightning {
			position: absolute;
			inset: -35%;
			border-radius: 28%;
			background:
				radial-gradient(
					ellipse at center,
					rgba(255,255,255,.75) 0 8%,
					rgba(6,182,212,.48) 26%,
					rgba(250,204,21,.32) 48%,
					transparent 72%
				);
			box-shadow:
				inset 0 0 28px #06b6d4,
				0 0 22px #fff,
				0 0 48px #06b6d4,
				0 0 72px rgba(250,204,21,.7);
			mix-blend-mode: hard-light;
			z-index: 80;
			pointer-events: none;
			animation: lightningFlash 0.6s steps(6, end) forwards;
		}
		
		@keyframes lightningFlash {
			0% { opacity: 0; scale: .75; filter: invert(0) brightness(1); }
			16% { opacity: 1; scale: 1; filter: invert(1) brightness(2.2); }
			33% { opacity: .2; scale: .88; filter: invert(0) brightness(1.2); }
			50% { opacity: 1; scale: 1; filter: invert(1) brightness(2.8); }
			68% { opacity: .3; scale: .92; filter: invert(0) brightness(1.4); }
			84% { opacity: .95; scale: 1; filter: invert(1) brightness(2.4); }
			100% { opacity: 0; scale: 1; filter: brightness(2) contrast(1.7); }
		}
		
        .shake-electrocute {
            animation: shakeZap 0.5s ease-in-out;
        }
		
        @keyframes shakeZap {
            0% { transform: translate(3px, 2px) rotate(0deg); }
            10% { transform: translate(-2px, -3px) rotate(-2deg); }
            20% { transform: translate(-4px, 0px) rotate(3deg); }
            30% { transform: translate(0px, 3px) rotate(0deg); }
            40% { transform: translate(2px, -2px) rotate(3deg); }
            50% { transform: translate(-2px, 3px) rotate(-2deg); }
            60% { transform: translate(-4px, 2px) rotate(0deg); }
            70% { transform: translate(3px, 2px) rotate(-3deg); }
            80% { transform: translate(-2px, -2px) rotate(3deg); }
            90% { transform: translate(3px, 3px) rotate(0deg); }
            100% { transform: translate(0, 0) rotate(0deg); }
        }

		/* 11. Blitz Beam (Machine Gun) */
        .vfx-blitz-bullet {
            position: fixed;
            width: 25px;
            height: 6px;
            background: #fff;
            box-shadow: 0 0 5px var(--neon-gold), 0 0 10px var(--neon-gold), 0 0 15px #fff;
            border-radius: 4px;
            z-index: 9999;
            pointer-events: none;
            transition: all 0.1s linear; /* Mabilis na lipad */
        }

		.mstack-card-shake-overheat {
            animation: mstackCardShakeOverheat 0.75s cubic-bezier(.36,.07,.19,.97) forwards !important;
            filter:
                brightness(1.85)
                saturate(2)
                drop-shadow(0 0 10px var(--neon-red))
                drop-shadow(0 0 24px var(--neon-red)) !important;
            border-color: var(--neon-red) !important;
            box-shadow:
                0 0 14px var(--neon-red),
                0 0 30px rgba(239, 68, 68, 0.85),
                inset 0 0 18px rgba(239, 68, 68, 0.6) !important;
            z-index: 99999 !important;
            opacity: 1 !important;
        }

        @keyframes mstackCardShakeOverheat {
            0% { transform: translate(0, 0) rotate(0deg) scale(1); }
            8% { transform: translate(-6px, 2px) rotate(-4deg) scale(1.04); }
            16% { transform: translate(6px, -2px) rotate(4deg) scale(1.04); }
            24% { transform: translate(-7px, -1px) rotate(-5deg) scale(1.05); }
            32% { transform: translate(7px, 2px) rotate(5deg) scale(1.05); }
            40% { transform: translate(-6px, 3px) rotate(-4deg) scale(1.06); filter: brightness(2.4) saturate(2.4); }
            48% { transform: translate(6px, -3px) rotate(4deg) scale(1.06); }
            56% { transform: translate(-5px, 2px) rotate(-3deg) scale(1.05); }
            64% { transform: translate(5px, -2px) rotate(3deg) scale(1.05); }
            74% { transform: translate(-3px, 1px) rotate(-2deg) scale(1.03); }
            84% { transform: translate(3px, -1px) rotate(2deg) scale(1.03); }
            100% { transform: translate(0, 0) rotate(0deg) scale(1); }
        }

		/* === SPIRIT OUT VFX (Soul Orb Dissolve) === */
        .vfx-spirit-out-burst {
            position: absolute;
            inset: 4%;
            border-radius: inherit;
            pointer-events: none;
            z-index: 88;
            background:
                radial-gradient(circle, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.35) 32%, rgba(180,220,255,0.18) 58%, transparent 76%);
            mix-blend-mode: screen;
            animation: spiritOutBurst 0.75s ease-out forwards;
        }

        .vfx-spirit-out-orb {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 5.5cqh;
            height: 5.5cqh;
            border-radius: 50%;
            pointer-events: none;
            z-index: 90;
            background:
                radial-gradient(circle, #ffffff 0%, #ffffff 30%, rgba(220,240,255,0.95) 50%, rgba(255,255,255,0.35) 72%, transparent 100%);
            box-shadow:
                0 0 20px #ffffff,
                0 0 42px rgba(255,255,255,1),
                0 0 70px rgba(180,220,255,0.9),
                inset 0 0 18px rgba(255,255,255,1);
            transform: translate(-50%, -50%) scale(0);
            animation: spiritOutOrb 0.75s ease-out forwards;
        }

        .vfx-spirit-out-orb::after {
            content: '';
            position: absolute;
            inset: -80%;
            border-radius: 50%;
            border: 2px solid rgba(255,255,255,0.9);
            box-shadow: 0 0 24px rgba(255,255,255,1);
            animation: spiritOutRing 0.75s ease-out forwards;
        }

        .vfx-spirit-out-shard {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 0.8cqh;
            height: 0.8cqh;
            border-radius: 50%;
            pointer-events: none;
            z-index: 91;
            background: #ffffff;
            box-shadow: 0 0 12px #ffffff, 0 0 22px rgba(180,220,255,0.95);
            transform: translate(-50%, -50%) scale(0.4);
            animation: spiritOutShard 0.72s ease-out forwards;
        }

        @keyframes spiritOutBurst {
            0% { opacity: 0; transform: scale(0.65); filter: brightness(1); }
            18% { opacity: 1; transform: scale(1); filter: brightness(2.5); }
            55% { opacity: 0.9; transform: scale(1.15); filter: brightness(1.7) blur(0.5px); }
            100% { opacity: 0; transform: scale(1.4); filter: brightness(0.8) blur(4px); }
        }

        @keyframes spiritOutOrb {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0); filter: blur(0); }
            16% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); filter: brightness(3); }
            45% { opacity: 1; transform: translate(-50%, -50%) scale(1.45); filter: brightness(2); }
            100% { opacity: 0; transform: translate(-50%, -50%) scale(3.1); filter: blur(7px) brightness(0.7); }
        }

        @keyframes spiritOutRing {
            0% { opacity: 0; transform: scale(0.45); }
            20% { opacity: 1; transform: scale(0.95); }
            100% { opacity: 0; transform: scale(1.95); }
        }

        @keyframes spiritOutShard {
            0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); filter: blur(0); }
            22% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
            100% {
                opacity: 0;
                transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.12);
                filter: blur(2px);
            }
        }

		/* === STOP SIGN VFX (Re-reactive) === */
		.vfx-stop-sign {
			position: fixed;
			width: 12cqh;
			height: 12cqh;
			z-index: 99999;
			pointer-events: none;
			transform: translate(-50%, -50%);
		}
		.vfx-stop-sign-shape {
			position: relative;
			width: 100%;
			height: 100%;
			border: 1.15cqh solid #ef4444;
			border-radius: 50%;
			box-sizing: border-box;
			background: rgba(15, 23, 42, 0.82);
			box-shadow: inset 0 0 14px rgba(239, 68, 68, 0.5), 0 0 22px rgba(239, 68, 68, 0.9);
			animation: stopSignStamp 0.35s cubic-bezier(0.17, 0.67, 0.12, 1.4) forwards;
		}
		.vfx-stop-sign-shape::after {
			content: '';
			position: absolute;
			left: 50%;
			top: 50%;
			width: 82%;
			height: 1.15cqh;
			border-radius: 999px;
			background: #ef4444;
			box-shadow: 0 0 8px #fff, 0 0 18px #ef4444;
			transform: translate(-50%, -50%) rotate(-45deg);
		}
		.vfx-stop-sign-glow {
			animation: stopSignGlow 0.8s ease-in-out infinite alternate;
		}
		@keyframes stopSignStamp {
			0% { transform: scale(4) rotate(-18deg); opacity: 0; }
			60% { transform: scale(0.9) rotate(4deg); opacity: 1; }
			100% { transform: scale(1); opacity: 1; }
		}
		@keyframes stopSignGlow {
			0% { box-shadow: inset 0 0 12px rgba(239,68,68,0.45), 0 0 20px 6px rgba(239,68,68,0.65); }
			100% { box-shadow: inset 0 0 20px rgba(239,68,68,0.75), 0 0 38px 12px rgba(239,68,68,0.95); }
		}
		@keyframes stopSignFlyOut {
			0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
			100% { opacity: 0; transform: translate(-50%, -85%) scale(0.2); }
		}

		/* 13. Green Sparkle (Heal/Buff) */
        .vfx-green-sparkle {
            position: absolute;
            width: 100%; height: 100%;
            top: 0; left: 0;
            background: radial-gradient(circle, transparent 20%, rgba(57, 255, 20, 0.4) 60%, transparent 80%);
            border-radius: inherit;
            z-index: 60;
            pointer-events: none;
            animation: sparkleAnim 0.8s ease-out forwards;
        }
        .vfx-green-sparkle::after {
            content: '✨';
            position: absolute;
            top: 10%; left: 10%;
            font-size: 4cqh; color: #39ff14;
            text-shadow: 0 0 10px #39ff14;
            animation: floatUpFade 0.8s forwards ease-out;
        }
        .vfx-green-sparkle::before {
            content: '✨';
            position: absolute;
            top: 50%; right: 10%;
            font-size: var(--ui-title, 3cqh); color: #adff2f;
            text-shadow: 0 0 10px #adff2f;
            animation: floatUpFade 0.6s forwards ease-out 0.2s;
        }
        @keyframes sparkleAnim {
            0% { opacity: 0; transform: scale(0.8); }
            50% { opacity: 1; transform: scale(1.1); box-shadow: 0 0 20px #39ff14, inset 0 0 20px #39ff14; }
            100% { opacity: 0; transform: scale(1.2); }
        }

		/* 14. Red Sparkle (Buff) */
        .vfx-red-sparkle {
            position: absolute;
            width: 100%; height: 100%;
            top: 0; left: 0;
            background: radial-gradient(circle, transparent 20%, rgba(239, 68, 68, 0.4) 60%, transparent 80%);
            border-radius: inherit;
            z-index: 60;
            pointer-events: none;
            animation: sparkleAnim 0.8s ease-out forwards;
        }
        .vfx-red-sparkle::after {
            content: '✨';
            position: absolute;
            top: 10%; left: 10%;
            font-size: 4cqh; color: #ef4444;
            text-shadow: 0 0 10px #ef4444;
            animation: floatUpFade 0.8s forwards ease-out;
        }
        .vfx-red-sparkle::before {
            content: '✨';
            position: absolute;
            top: 50%; right: 10%;
            font-size: var(--ui-title, 3cqh); color: #facc15;
            text-shadow: 0 0 10px #facc15;
            animation: floatUpFade 0.6s forwards ease-out 0.2s;
        }
		
				/* Universal PWR Down: Blue Sparkle Down */
		.vfx-blue-sparkle-down {
			position: absolute;
			inset: 0;
			border-radius: inherit;
			pointer-events: none;
			z-index: 60;
			overflow: hidden;
			background: radial-gradient(circle, transparent 20%, rgba(59, 130, 246, 0.42) 60%, transparent 80%);
			animation: blueSparkleDownBurst 0.8s ease-out forwards;
		}
		.vfx-blue-sparkle-down::before,
		.vfx-blue-sparkle-down::after {
			content: '✨';
			position: absolute;
			top: 8%;
			color: #60a5fa;
			text-shadow: 0 0 10px #3b82f6, 0 0 18px #1d4ed8;
			animation: blueSparkleFall 0.8s ease-in forwards;
		}
		.vfx-blue-sparkle-down::before {
			left: 12%;
			font-size: 4cqh;
		}
		.vfx-blue-sparkle-down::after {
			right: 12%;
			font-size: var(--ui-title, 3cqh);
			animation-delay: 0.12s;
		}
		@keyframes blueSparkleDownBurst {
			0% { opacity: 0; transform: scale(1.15); }
			45% { opacity: 1; transform: scale(1); box-shadow: 0 0 20px #3b82f6, inset 0 0 20px #1d4ed8; }
			100% { opacity: 0; transform: scale(0.88); }
		}
		@keyframes blueSparkleFall {
			0% { opacity: 0; transform: translateY(-20%) scale(1.1); }
			25% { opacity: 1; }
			100% { opacity: 0; transform: translateY(180%) scale(0.7); }
		}

		/* === ATTACK BOOSTER PILLS: RED PILL GHOST SAPI VFX === */
		.vfx-pill-ghost {
			position: fixed;
			border-radius: 8px;
			background-size: cover;
			background-position: center;
			pointer-events: none;
			z-index: 9999;
			filter: brightness(1.4) saturate(1.5) drop-shadow(0 0 8px #ef4444) drop-shadow(0 0 16px #ef4444);
			animation: pillZoomIn 0.28s cubic-bezier(0.22, 1, 0.36, 1) forwards;
		}
		
		@keyframes pillZoomIn {
			0%   { opacity: 0.9; transform: translate(-50%, -50%) scale(0.6); }
			80%  { opacity: 1;   transform: translate(-50%, -50%) scale(1.05); }
			100% { opacity: 1;   transform: translate(-50%, -50%) scale(2); }
		}
		
		.vfx-pill-ghost.sapi {
			animation: pillSapi 0.18s cubic-bezier(0.55, 0, 1, 0.45) forwards;
		}
		
		@keyframes pillSapi {
			0%   { opacity: 1;   transform: translate(-50%, -50%) scale(1); filter: brightness(3) saturate(2); }
			60%  { opacity: 0.6; transform: translate(-50%, -50%) scale(0.3); }
			100% { opacity: 0;   transform: translate(-50%, -50%) scale(0); }	
		}

		/* 15. Cyan Powerball Absorb (Power Sacrifice) */
		.vfx-cyan-powerball {
            position: absolute;
            top: 50%; left: 50%;
            width: 8cqh; /* BAGO: Ang sukat ng base Powerball */
            height: 8cqh; /* BAGO: Ang sukat ng base Powerball */
            border-radius: 50%;
            background: radial-gradient(circle, #ffffff 0%, #67e8f9 25%, #06b6d4 55%, transparent 82%);
            box-shadow: 0 0 20px #06b6d4, 0 0 35px #67e8f9, inset 0 0 18px #67e8f9;
            z-index: 100;
            pointer-events: none;
            opacity: 0;
            transform: translate(-50%, -50%) scale(0);
            transition: transform 0.4s ease-out, opacity 0.4s ease-in;
        }
		
		/* === ROTATING ARROWS VFX === */
		.vfx-rotating-arrows {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 75%;
			height: 75%;
			display: flex;
			align-items: center;
			justify-content: center;
			transform: translate(-50%, -50%) scale(0.45);
			color: var(--neon-cyan);
			font-family: Arial, sans-serif;
			font-size: 8cqh;
			font-weight: 900;
			line-height: 1;
			text-shadow: 0 0 8px #ffffff, 0 0 18px var(--neon-cyan), 0 0 32px var(--neon-green), 3px 3px 0 #000;
			filter: drop-shadow(0 0 12px var(--neon-cyan));
			z-index: 120;
			pointer-events: none;
			animation: rotatingArrowsVfx 1.1s ease-out forwards;
		}

		.vfx-rotating-arrows::before {
			content: '♻';
		}

		@keyframes rotatingArrowsVfx {
			0% { opacity: 0; transform: translate(-50%, -50%) rotate(-120deg) scale(0.35); filter: brightness(1) drop-shadow(0 0 6px var(--neon-cyan)); }
			25% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1.15); filter: brightness(2.4) drop-shadow(0 0 18px #ffffff) drop-shadow(0 0 28px var(--neon-green)); }
			70% { opacity: 1; transform: translate(-50%, -50%) rotate(240deg) scale(1); filter: brightness(1.6) drop-shadow(0 0 16px var(--neon-cyan)); }
			100% { opacity: 0; transform: translate(-50%, -50%) rotate(480deg) scale(1.35); filter: brightness(1) drop-shadow(0 0 5px var(--neon-green)); }
		}
		
		/* Universal Hero Move clock VFX */
		.vfx-move-clock {
			position: absolute;
			left: 50%;
			top: 50%;
			width: 9cqh;
			height: 9cqh;
			border: 0.55cqh solid var(--clock-color);
			border-radius: 50%;
			transform: translate(-50%, -50%);
			box-shadow:
				0 0 12px #fff,
				0 0 26px var(--clock-color),
				inset 0 0 18px rgba(255,255,255,0.25);
			z-index: 120;
			pointer-events: none;
			animation: moveClockBurst 0.9s ease-out forwards;
		}

		.vfx-move-clock::before,
		.vfx-move-clock::after {
			content: '';
			position: absolute;
			left: 50%;
			top: 50%;
			width: 0.45cqh;
			border-radius: 999px;
			background: #fff;
			box-shadow:
				0 0 8px #fff,
				0 0 14px var(--clock-color);
			transform-origin: 50% 100%;
		}

		.vfx-move-clock::before {
			height: 3.2cqh;
			animation: moveClockHand 0.9s ease-out forwards;
		}

		.vfx-move-clock::after {
			height: 2.3cqh;
			animation: moveClockHand 0.9s ease-out 0.08s forwards;
		}

		.vfx-move-clock.clock-backward::before,
		.vfx-move-clock.clock-backward::after {
			animation-direction: reverse;
		}

		@keyframes moveClockBurst {
			0% { opacity: 0; scale: 0.45; }
			25% { opacity: 1; scale: 1.12; filter: brightness(2.3); }
			75% { opacity: 1; scale: 1; }
			100% { opacity: 0; scale: 1.25; }
		}

		@keyframes moveClockHand {
			from { transform: translate(-50%, -100%) rotate(0deg); }
			to { transform: translate(-50%, -100%) rotate(720deg); }
		}
		
		@keyframes fluxCoreYinYang {
			0% { opacity: 0; transform: translate(-50%, -50%) rotate(-180deg) scale(0.35); }
			30% { opacity: 1; transform: translate(-50%, -50%) rotate(0deg) scale(1.15); }
			75% { opacity: 1; transform: translate(-50%, -50%) rotate(270deg) scale(1); }
			100% { opacity: 0; transform: translate(-50%, -50%) rotate(540deg) scale(1.3); }
		}
	
		.vfx-yellow-pulse {
            position: absolute;
            inset: -8%;
            border-radius: inherit;
            pointer-events: none;
            z-index: 95;
            background:
                radial-gradient(circle, rgba(255,255,255,0.85) 0%, rgba(250,204,21,0.55) 32%, rgba(250,204,21,0.18) 62%, transparent 78%);
            box-shadow:
                0 0 14px var(--neon-gold),
                0 0 28px rgba(250, 204, 21, 0.85),
                inset 0 0 18px rgba(250, 204, 21, 0.65);
            animation: yellowPulseBurst 1s ease-out forwards;
        }

        .vfx-yellow-pulse::before {
            content: '';
            position: absolute;
            inset: 10%;
            border: 2px solid rgba(250, 204, 21, 0.95);
            border-radius: inherit;
            box-shadow: 0 0 18px rgba(250, 204, 21, 0.9);
            animation: yellowPulseRing 1s ease-out forwards;
        }

        .vfx-yellow-pulse::after {
            position: absolute;
            left: 50%;
            top: 42%;
            transform: translate(-50%, -50%);
            color: var(--neon-gold);
            font-family: 'Rajdhani', sans-serif;
            font-weight: 900;
            font-size: var(--ui-subtitle, 2.2cqh);
            text-shadow:
                0 0 8px var(--neon-gold),
                2px 2px 0 #000;
            animation: yellowPulseTextFloat 1s ease-out forwards;
        }

        @keyframes yellowPulseBurst {
            0% { opacity: 0; transform: scale(0.75); filter: brightness(1); }
            20% { opacity: 1; transform: scale(1.05); filter: brightness(2); }
            65% { opacity: 0.8; transform: scale(1.15); filter: brightness(1.5); }
            100% { opacity: 0; transform: scale(1.35); filter: brightness(1); }
        }

        @keyframes yellowPulseRing {
            0% { opacity: 0; transform: scale(0.55); }
            25% { opacity: 1; transform: scale(1); }
            100% { opacity: 0; transform: scale(1.45); }
        }

        @keyframes yellowPulseTextFloat {
            0% { opacity: 0; transform: translate(-50%, -30%) scale(0.8); }
            20% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
            100% { opacity: 0; transform: translate(-50%, -120%) scale(1.1); }
        }
	
		.vfx-gray-pulse {
			position: absolute;
			inset: -8%;
			border-radius: inherit;
			pointer-events: none;
			z-index: 95;
			background:
				radial-gradient(
					circle,
					rgba(255, 255, 255, 0.75) 0%,
					rgba(156, 163, 175, 0.55) 32%,
					rgba(107, 114, 128, 0.18) 62%,
					transparent 78%
				);
			box-shadow:
				0 0 14px #9ca3af,
				0 0 28px rgba(156, 163, 175, 0.85),
				inset 0 0 18px rgba(107, 114, 128, 0.65);
			animation: yellowPulseBurst 1s ease-out forwards;
		}

		.vfx-gray-pulse::before {
			content: '';
			position: absolute;
			inset: 10%;
			border: 2px solid rgba(156, 163, 175, 0.95);
			border-radius: inherit;
			box-shadow: 0 0 18px rgba(156, 163, 175, 0.9);
			animation: yellowPulseRing 1s ease-out forwards;
		}

		.vfx-gray-pulse::after {
			content: '-MOVE';
			position: absolute;
			left: 50%;
			top: 42%;
			transform: translate(-50%, -50%);
			color: #9ca3af;
			font-family: 'Rajdhani', sans-serif;
			font-weight: 900;
			font-size: var(--ui-subtitle, 2.2cqh);
			text-shadow:
				0 0 8px #9ca3af,
				2px 2px 0 #000;
			animation: yellowPulseTextFloat 1s ease-out forwards;
		}
	
		/* 1. Yellow Glow (Passive Tools) */
		.tool-glow-yellow { animation: breathingGlowYellow 1.5s infinite alternate !important; }
		@keyframes breathingGlowYellow {
			0% { box-shadow: 0 0 5px var(--neon-gold), inset 0 0 5px rgba(250, 204, 21, 0.5); border-color: rgba(250, 204, 	21, 0.8); }
			100% { box-shadow: 0 0 20px var(--neon-gold), inset 0 0 15px rgba(250, 204, 21, 0.8); border-color: var(--neon-gold); }
		}
	
		/* 2. Red Glow (Depleting Tools) */
		.tool-glow-red { animation: breathingGlowRed 1.5s infinite alternate !important; }
		
		@keyframes breathingGlowRed {
			0% { box-shadow: 0 0 5px var(--neon-red), inset 0 0 5px rgba(239, 68, 68, 0.5); border-color: rgba(239, 68, 68, 	0.8); }
			100% { box-shadow: 0 0 20px var(--neon-red), inset 0 0 15px rgba(239, 68, 68, 0.8); border-color: var(--neon-red); }
		}

		/* 3. Green Glow (Exchange Tools) */
		.tool-glow-green { animation: breathingGlowGreen 1.5s infinite alternate !important; }
		
		@keyframes breathingGlowGreen {
			0% { box-shadow: 0 0 5px var(--neon-green), inset 0 0 5px rgba(57, 255, 20, 0.5); border-color: rgba(57, 255, 	20, 0.8); }
			100% { box-shadow: 0 0 20px var(--neon-green), inset 0 0 15px rgba(57, 255, 20, 0.8); border-color: var(--neon-green); }
		}
	
		/* BAGO: STEADY GLOW PARA SA ALWAYS_ON (Walang breathing effect, nakasindi lang) */
		.tool-glow-yellow.steady-glow { animation: none !important; box-shadow: 0 0 15px var(--neon-gold), inset 0 0 10px 	rgba(250, 204, 21, 0.6) !important; border-color: var(--neon-gold) !important; }
		.tool-glow-red.steady-glow { animation: none !important; box-shadow: 0 0 15px var(--neon-red), inset 0 0 10px rgba(239, 68, 68, 0.6) !important; border-color: var(--neon-red) !important; }
		.tool-glow-green.steady-glow { animation: none !important; box-shadow: 0 0 15px var(--neon-green), inset 0 0 10px rgba(57, 255, 20, 0.6) !important; border-color: var(--neon-green) !important; }
	
		/* === BAGO: TRIGGER FLASH ANIMATION === */
		.tool-triggered-flash {
			animation: toolFlash 0.9s ease-out !important;
		}
		
		@keyframes toolFlash {
			0% { filter: brightness(1); transform: translate(-50%, -50%) scale(1); box-shadow: none; }
			20% { filter: brightness(2.5); transform: translate(-50%, -50%) scale(1.15); box-shadow: 0 0 30px #fff; }
			100% { filter: brightness(1); transform: translate(-50%, -50%) scale(1); box-shadow: none; }
		}
	
		/* 2. Tool Ghost Effect (Kaluluwa) */
		.vfx-tool-ghost {
			position: absolute;
			top: 0; left: 0; right: 0; bottom: 0;
			background: inherit;
			background-size: inherit;
			background-position: inherit;
			border-radius: inherit;
			z-index: 100;
			pointer-events: none;
			opacity: 0.8;
			filter: sepia(1) hue-rotate(180deg) brightness(1.5);
			animation: ghostRise 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
		}
		
		@keyframes ghostRise {
			0% { transform: translateY(0) scale(1); opacity: 0.8; filter: brightness(1.5); }
			100% { transform: translateY(-80px) scale(1.2); opacity: 0; filter: brightness(3); }
		}
		
		.vfx-free-ticket {
			position: absolute;
			inset: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			z-index: 150;
			pointer-events: none;
			font-family: "Segoe UI Symbol", "Noto Sans Symbols 2", sans-serif;
			font-size: 8cqh;
			color: var(--ticket-color);
			text-shadow: 0 0 10px var(--ticket-color), 0 0 22px var(--ticket-color);
			animation: freeTicketPop 1.8s ease-out forwards;
		}

		@keyframes freeTicketPop {
			0% { opacity: 0; transform: scale(.25) rotate(-20deg); }
			35% { opacity: 1; transform: scale(1.25) rotate(8deg); }
			100% { opacity: 0; transform: translateY(-8cqh) scale(.8); }
		}
		
		.vfx-dancing-missile {
			position: fixed;
			width: 5.8cqh;
			height: 1.55cqh;
			border-radius: 999px;
			z-index: 99999;
			pointer-events: none;
			display: flex;
			align-items: center;
			justify-content: center;
			color: #fff7ed;
			font-size: 4.5cqh;
			font-weight: 900;
			text-shadow:
				0 0 8px #ffffff,
				0 0 16px #fb923c,
				0 0 28px #ef4444,
				3px 3px 0 #000;
			background:
				linear-gradient(90deg, #e5e7eb 0%, #fef3c7 28%, #fb923c 62%, #ef4444 100%);
			box-shadow:
				0 0 10px #fff7ed,
				0 0 20px #fb923c,
				0 0 32px #ef4444;
			transform: translate(-50%, -50%) scale(0.65);
			transition:
				left 0.24s cubic-bezier(0.12, 0.8, 0.22, 1),
				top 0.24s cubic-bezier(0.12, 0.8, 0.22, 1),
				transform 0.24s cubic-bezier(0.12, 0.8, 0.22, 1),
				opacity 0.18s ease;
		}

		.vfx-dancing-missile::before {
			content: '✦';
			position: absolute;
			right: -0.75cqh;
			top: 50%;
			transform: translateY(-50%);
			color: #fff7ed;
			font-size: var(--ui-subtitle, 2cqh);
			text-shadow:
				0 0 8px #ffffff,
				0 0 14px #fb923c;
		}

		.vfx-dancing-missile::after {
			content: '';
			position: absolute;
			left: -2.2cqh;
			top: 50%;
			width: 2.4cqh;
			height: 1.2cqh;
			transform: translateY(-50%);
			border-radius: 50%;
			background:
				radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(251,146,60,0.85) 35%, rgba(239,68,68,0.65) 68%, transparent 78%);
			filter: blur(0.15cqh);
			animation: missileFlamePulse 0.16s infinite alternate;
		}

		.vfx-missile-mini-explosion {
			position: absolute;
			top: 50%;
			left: 50%;
			width: 42%;
			height: 42%;
			border-radius: 50%;
			transform: translate(-50%, -50%) scale(0.3);
			z-index: 95;
			pointer-events: none;
			background:
				radial-gradient(circle, #ffffff 0%, #fef3c7 18%, #fb923c 42%, #ef4444 66%, transparent 78%);
			box-shadow:
				0 0 12px #ffffff,
				0 0 24px #fb923c,
				0 0 42px #ef4444;
			animation: missileMiniExplosion 0.48s ease-out forwards;
		}

		@keyframes missileFlamePulse {
			0% { transform: translateY(-50%) scaleX(0.75); opacity: 0.65; }
			100% { transform: translateY(-50%) scaleX(1.25); opacity: 1; }
		}

		@keyframes missileMiniExplosion {
			0% { opacity: 0; transform: translate(-50%, -50%) scale(0.25); filter: brightness(1); }
			18% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); filter: brightness(2.3); }
			100% { opacity: 0; transform: translate(-50%, -50%) scale(2.05); filter: brightness(0.8); }
		}
		
		/* === COUNTER PUNCH IMPACT VFX (Inferno Gauntlet / Impact) === */
        .vfx-counter-punch {
            position: fixed;
            width: 7cqh;
            height: 7cqh;
            border-radius: 50%;
            z-index: 99999;
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff7ed;
            font-size: 4.5cqh;
            font-weight: 900;
            text-shadow:
                0 0 8px #ffffff,
                0 0 16px #fb923c,
                0 0 28px #ef4444,
                3px 3px 0 #000;
            background:
                radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(251,146,60,0.65) 34%, rgba(239,68,68,0.45) 62%, transparent 76%);
            box-shadow:
                0 0 16px #fb923c,
                0 0 32px #ef4444,
                0 0 54px rgba(239,68,68,0.85);
            transform: translate(-50%, -50%) scale(0.65);
            transition:
                left 0.24s cubic-bezier(0.12, 0.8, 0.22, 1),
                top 0.24s cubic-bezier(0.12, 0.8, 0.22, 1),
                transform 0.24s cubic-bezier(0.12, 0.8, 0.22, 1),
                opacity 0.18s ease;
        }

        .vfx-counter-punch::before {
            content: '✊';
        }

        .vfx-counter-impact-ring {
            position: absolute;
            top: 50%;
            left: 50%;
            width: 35%;
            height: 35%;
            border: 4px solid #ef4444;
            border-radius: 50%;
            transform: translate(-50%, -50%) scale(0.35);
            box-shadow:
                0 0 14px #ffffff,
                0 0 24px #fb923c,
                0 0 38px #ef4444,
                inset 0 0 18px rgba(239,68,68,0.55);
            z-index: 92;
            pointer-events: none;
            animation: counterImpactRing 0.42s ease-out forwards;
        }

        .vfx-counter-impact-flash {
            position: absolute;
            inset: -8%;
            border-radius: inherit;
            pointer-events: none;
            z-index: 91;
            background:
                radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(251,146,60,0.75) 24%, rgba(239,68,68,0.45) 55%, transparent 78%);
            mix-blend-mode: screen;
            animation: counterImpactFlash 0.42s ease-out forwards;
        }

        .vfx-counter-impact-crack {
            position: absolute;
            inset: 0;
            border-radius: inherit;
            pointer-events: none;
            z-index: 93;
            background:
                linear-gradient(45deg, transparent 46%, rgba(255,255,255,0.95) 48%, rgba(239,68,68,0.95) 50%, transparent 54%),
                linear-gradient(-35deg, transparent 48%, rgba(251,146,60,0.95) 50%, transparent 54%);
            filter: drop-shadow(0 0 8px #ef4444);
            opacity: 0;
            animation: counterImpactCrack 0.38s ease-out forwards;
        }
		
		.vfx-card-crack-clone {
			position: fixed;
			pointer-events: none;
			z-index: 99999;
			overflow: visible;
			transform-origin: center center;
			transform: scale(1);
			animation: cardCrackClonePop 1.2s ease-out forwards;
			filter:
				drop-shadow(0 0 10px #ffffff)
				drop-shadow(0 0 18px #ef4444);
		}

		.vfx-card-crack-piece {
			position: absolute;
			inset: 0;
			background-size: inherit;
			background-position: inherit;
			background-repeat: inherit;
			box-shadow:
				0 0 8px rgba(255,255,255,0.65),
				0 0 16px rgba(239,68,68,0.75);
		}

		.vfx-card-crack-piece-left {
			clip-path: polygon(0 0, 53% 0, 44% 24%, 56% 42%, 41% 62%, 52% 82%, 44% 104%, 50% 122%, 41% 100%, 0 100%);
			animation: cardCrackLeftBreak 0.85s ease-in 0.35s forwards;
		}

		.vfx-card-crack-piece-right {
			clip-path: polygon(53% 0, 100% 0, 100% 100%, 41% 100%, 50% 122%, 44% 104%, 52% 82%, 41% 62%, 56% 42%, 44% 24%);
			animation: cardCrackRightBreak 0.85s ease-in 0.35s forwards;
		}

		.vfx-card-crack-fixed-line {
			position: absolute;
			inset: -2%;
			z-index: 3;
			pointer-events: none;
			animation: cardCrackLineFade 0.75s ease-out 0.2s forwards;
		}

		.vfx-card-crack-fixed-line svg {
			width: 100%;
			height: 100%;
		}

		.vfx-card-crack-fixed-line path {
			fill: none;
			stroke: #ffffff;
			stroke-width: 2.2;
			stroke-linecap: round;
			stroke-linejoin: round;
			filter:
				drop-shadow(0 0 5px #ffffff)
				drop-shadow(0 0 10px #ef4444);
			stroke-dasharray: 220;
			stroke-dashoffset: 220;
			animation: cardCrackDrawLine 0.34s ease-out 0.2s forwards;
		}

		@keyframes cardCrackClonePop {
			0% { opacity: 0; transform: scale(0.9); filter: brightness(1); }
			15% { opacity: 1; transform: scale(1.25); filter: brightness(2.2) contrast(1.3); }
			42% { opacity: 1; transform: scale(1.18); filter: brightness(1.45) contrast(1.15); }
			100% { opacity: 0; transform: scale(1.05); filter: brightness(0.4) blur(2px) grayscale(100%);}
		}

		@keyframes cardCrackLeftBreak {
			0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
			38% { transform: translate(-4%, 1%) rotate(-3deg); opacity: 1; }
			100% { transform: translate(-36%, 18%) rotate(-18deg); opacity: 0; }
		}

		@keyframes cardCrackRightBreak {
			0% { transform: translate(0, 0) rotate(0deg); opacity: 1; }
			38% { transform: translate(4%, -1%) rotate(3deg); opacity: 1; }
			100% { transform: translate(36%, -18%) rotate(18deg); opacity: 0; }
		}

		@keyframes cardCrackDrawLine {
			0% { opacity: 0; stroke-dashoffset: 220; }
			25% { opacity: 1; }
			100% { opacity: 1; stroke-dashoffset: 0; }
		}

		@keyframes cardCrackLineFade {
			0% { opacity: 0; }
			18% { opacity: 1; }
			70% { opacity: 1; }
			100% { opacity: 0; }
		}

        @keyframes counterImpactRing {
            0% { opacity: 1; transform: translate(-50%, -50%) scale(0.35); }
            75% { opacity: 1; transform: translate(-50%, -50%) scale(1.7); }
            100% { opacity: 0; transform: translate(-50%, -50%) scale(2.15); }
        }

        @keyframes counterImpactFlash {
            0% { opacity: 0; transform: scale(0.8); filter: brightness(1); }
            18% { opacity: 1; transform: scale(1.05); filter: brightness(2.2); }
            100% { opacity: 0; transform: scale(1.35); filter: brightness(0.8); }
        }

        @keyframes counterImpactCrack {
            0% { opacity: 0; transform: scale(0.8) rotate(0deg); }
            24% { opacity: 1; transform: scale(1.05) rotate(0deg); }
            100% { opacity: 0; transform: scale(1.25) rotate(8deg); }
        }
		
		/* === RED MELTDOWN GHOST VFX (Weaken / PWR Down) === */
        .vfx-red-meltdown-ghost {
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background: inherit;
            background-size: inherit;
            background-position: inherit;
            z-index: 220;
            pointer-events: none;
            opacity: 0.95;
            filter:
                sepia(1)
                hue-rotate(-35deg)
                saturate(3)
                brightness(1.4)
                drop-shadow(0 0 10px var(--neon-red))
                drop-shadow(0 0 22px var(--neon-red));
            mix-blend-mode: screen;
            animation: redMeltdownGhost 0.9s ease-in forwards;
        }

        .vfx-red-meltdown-ghost::after {
            content: '';
            position: absolute;
            inset: 0;
            border-radius: inherit;
            background:
                linear-gradient(
                    to bottom,
                    transparent 0%,
                    rgba(239, 68, 68, 0.25) 28%,
                    rgba(127, 29, 29, 0.65) 62%,
                    rgba(20, 0, 0, 0.95) 100%
                );
            animation: redMeltdownDrip 0.9s ease-in forwards;
        }

        @keyframes redMeltdownGhost {
            0% { opacity: 0; transform: translateY(0) scale(1); filter: brightness(1) saturate(1); }
            18% { opacity: 1; transform: translateY(0) scale(1.03); filter: sepia(1) hue-rotate(-35deg) saturate(3.5) brightness(2.2) drop-shadow(0 0 16px var(--neon-red)); }
            60% { opacity: 0.8; transform: translateY(14px) scale(0.96); filter: sepia(1) hue-rotate(-35deg) saturate(3) brightness(1.35) blur(1px) drop-shadow(0 0 18px var(--neon-red)); }
            100% { opacity: 0; transform: translateY(55px) scale(0.72); filter: sepia(1) hue-rotate(-35deg) saturate(2) brightness(0.55) blur(5px) drop-shadow(0 0 6px var(--neon-red)); }
        }

        @keyframes redMeltdownDrip {
            0% { opacity: 0; transform: translateY(-20%); }
            25% { opacity: 1; }
            100% { opacity: 0; transform: translateY(55%); }
        }
	
		/* === TOKEN GHOST DISSOLVE EFFECT === */
		.vfx-token-ghost {
			position: absolute;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background: inherit;
			background-size: inherit;
			background-position: inherit;
			border-radius: inherit;
			z-index: 200;
			pointer-events: none;
			opacity: 0.85;
			filter: sepia(1) hue-rotate(160deg) brightness(1.8);
			animation: ghostRise 1s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
		}
	
		.token-burning {
			pointer-events: none !important;	
			filter: brightness(1.35) saturate(1.2);
		}

		/* 3. HP Sacrifice Aura (Downward Motion) */
		.vfx-hp-sacrifice {
			position: absolute;
			top: 0; left: 0; right: 0; bottom: 0;
			border-radius: inherit;
			z-index: 60;
			pointer-events: none;
			background: linear-gradient(to bottom, transparent 0%, rgba(220, 38, 38, 0.8) 50%, rgba(147, 51, 234, 0.8) 100%);
			background-size: 100% 200%;
			animation: downwardAura 1.2s ease-in forwards;
			mix-blend-mode: multiply;
		}
		
		@keyframes downwardAura {
			0% { background-position: 0 -100%; opacity: 0; }
			20% { opacity: 1; }
			80% { opacity: 1; }
			100% { background-position: 0 100%; opacity: 0; }
		}

		/* 4. White Burst / Evolution Transition */
		.vfx-evo-whiteout {
			animation: whiteoutAnim 0.5s ease-in forwards !important;
		}
		
		@keyframes whiteoutAnim {
            0% { filter: brightness(1) contrast(1); }
            100% { filter: brightness(10) contrast(0) drop-shadow(0 0 20px #fff); }
        }
        .vfx-evo-burst {
			position: absolute;
			top: 50%; left: 50%;
			width: 100%; height: 100%;
			border-radius: 50%;
			background: radial-gradient(circle, #fff 20%, transparent 70%);
			transform: translate(-50%, -50%) scale(0.1);
			z-index: 110;
			pointer-events: none;
			animation: evoBurstAnim 0.6s ease-out forwards;
		}
		
		@keyframes evoBurstAnim {
			0% { transform: translate(-50%, -50%) scale(0.1); opacity: 1; }
			50% { opacity: 1; }
			100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
		}	
	
		/* === MOVE COUNTERS UI === */
        .move-counter-box {
            position: fixed;
            right: 13.5cqw;
            transform: translateX(50%);
            background: rgba(15, 23, 42, 0.95);
            padding: 1cqh 2cqw;
            border-radius: 6px;
            border: 2px solid #6b7280;
            color: white;
            font-family: 'Rajdhani', sans-serif;
            font-size: var(--ui-subtitle, 2cqh);
            font-weight: bold;
            text-align: center;
            z-index: 9999;
            box-shadow: 0 0 10px rgba(0,0,0,0.5);
            display: none;
        }

        /* === HORIZONTAL HUD BOXES (CLUSTER - MOVES - PENALTY) === */
        
		.hud-container {
			position: fixed;
			right: 13.5cqw;
			transform: translateX(50%);
			display: none;
			flex-direction: row;
			gap: 0.8cqw;
			z-index: 9999;
		}

        .hud-container.player { bottom: 40cqh; }
        .hud-container.enemy { top: 40cqh; }

        /* Saktong Square Boxes */
        
		.hud-box {
			width: 7cqh;
			height: 7cqh;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;
			background: rgba(15, 23, 42, 0.95);
			border: 2px solid;
			border-radius: 6px;
			font-family: 'Rajdhani', sans-serif;
			color: white;
			box-shadow: 0 0 10px rgba(0,0,0,0.5);
			transition: all 0.3s ease;
		}

        /* Malaking Numero */
        .hud-val {
            font-size: 4cqh;
            font-weight: 900;
            line-height: 1;
        }

        
		/* Maliit na Text (Moves, Cluster, Penalty) */
		.hud-label {
			font-size: var(--ui-caption, 1.1cqh);
			letter-spacing: 0.1em;
			color: #e5e7eb;
			margin-top: 0.3cqh;
			line-height: 1;
		}

        /* Kulay at Glow (Green / Red) */
        .hud-container.player .hud-box { border-color: var(--neon-green); color: var(--neon-green); box-shadow: 0 0 10px var(--neon-green-glow); }
        .hud-container.enemy .hud-box { border-color: var(--neon-red); color: var(--neon-red); box-shadow: 0 0 10px var(--neon-red-glow); }
        
        /* ZERO VALUE: Walang Glow at Grayscale */
        .hud-box.grayscale-zero {
            filter: grayscale(100%) brightness(0.5);
            box-shadow: none !important;
            border-color: #4b5563 !important;
            color: #9ca3af !important;
        }
        .hud-box.grayscale-zero .hud-label { color: #6b7280; }

        /* === SKIP CARD (DUMMY) === */
        .skip-card {
            width: var(--card-width);
            height: var(--card-height);
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Rajdhani', sans-serif;
            font-weight: 900;
            font-size: calc(1.8cqmin * var(--scale)); /* Pinalaki nang kaunti ang text */
            
            /* BAGO: Solid Gray na Card (Hindi na mukhang empty slot) */
            background: #6b7280 !important; /* Mas mapusyaw na Solid Gray */
            color: #ffffff !important; /* Puting-puti na text */
            border: 2px solid #e5e7eb !important; /* Solid Light-Gray border imbes na dashed */
            box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.2) !important; /* Drop shadow para umangat */
            text-shadow: 2px 2px 4px #000, 0 0 10px #000 !important;
            
            border-radius: 8px; /* Parehas sa hugis ng totoong cards */
            cursor: not-allowed;
            transition: all 0.2s;
        }

		/* === HERO MOVE BADGE SYSTEM === */
		/* Phase 1: Ilipat ang move/readiness visual sa badge, hindi na sa hero card. */

		.hero-move-badge {
			position: absolute;
			top: 0.5cqh;
			right: 0.5cqh;
			min-width: 3.2cqh;
			height: 3.2cqh;
			padding: 0 0.5cqh;
			border-radius: 999px;
			background: rgba(0, 0, 0, 0.88);
			border: 2px solid #9ca3af;
			color: #9ca3af;
			font-family: 'Rajdhani', sans-serif;
			font-size: var(--ui-subtitle, 2cqh);
			font-weight: 900;
			display: none;
			align-items: center;
			justify-content: center;
			z-index: 80;
			pointer-events: none;
			line-height: 1;
			text-shadow: 0 0 6px #000;
			box-shadow: none;
		}
	
		.hero-move-badge.has-moves {
			display: flex;
			color: var(--neon-green);
			border-color: var(--neon-green);
			box-shadow:
				0 0 10px var(--neon-green-glow),
				0 0 18px var(--neon-green-glow),
				inset 0 0 8px rgba(57, 255, 20, 0.35);
			animation: none;
		}
	
		.hero-move-badge.has-moves.active-turn {
			animation: heroMoveBadgePulse 1.2s infinite ease-in-out;
		}

		.hero-move-badge.no-moves {
			display: flex;
			color: #9ca3af;
			border-color: #4b5563;
			box-shadow: none;
			filter: grayscale(100%) brightness(0.75);
			animation: none;
		}
	
		@keyframes heroMoveBadgePulse {
			0%, 100% { box-shadow: 0 0 10px var(--neon-green-glow), 0 0 18px var(--neon-green-glow), inset 0 0 8px rgba(57, 255, 20, 0.35); }	
			50% { box-shadow: 0 0 18px var(--neon-green), 0 0 34px var(--neon-green-glow), inset 0 0 14px rgba(57, 255, 20, 0.6); }
		}
	
		/* === CURRENT TURN BORDER INDICATOR === */
		/* Current turn + may action: white border only, normal thickness. Includes hero zones, tactic zones, and skip ghost cards. */

		.hero-zone .card-in-playmat:not(.attached-tool):not(.attached-token),
		.z-tactic .card-in-playmat:not(.attached-tool):not(.attached-token),
		.hero-zone .skip-card,	
		.z-tactic .skip-card {
			transition:
				border-color 0.25s ease,
				box-shadow 0.25s ease,
				filter 0.25s ease,
				opacity 0.25s ease;
		}

		.hero-zone .card-in-playmat.active-playable:not(.moved):not(.attached-tool):not(.attached-token):not(.target-highlight),
		.z-tactic .card-in-playmat.active-playable:not(.moved):not(.attached-tool):not(.attached-token):not(.target-highlight),
		.hero-zone .skip-card.active-playable:not(.moved):not(.target-highlight),
		.z-tactic .skip-card.active-playable:not(.moved):not(.target-highlight) {
			border: 2px solid #ffffff !important;
			/* STABLE AURA: Matapang na puting ilaw pero hindi kalat */
			box-shadow:
				0 0 8px #ffffff,
				0 0 15px rgba(255, 255, 255, 0.6),
				inset 0 0 10px rgba(255, 255, 255, 0.4) !important;
			animation: none !important;
			cursor: pointer !important;
		}
	
		.hero-zone .card-in-playmat.moved:not(.attached-tool):not(.attached-token):not(.target-highlight),
		.z-tactic .card-in-playmat.moved:not(.attached-tool):not(.attached-token):not(.target-highlight),
		.hero-zone .skip-card.moved:not(.target-highlight),
		.z-tactic .skip-card.moved:not(.target-highlight) {
			border: 2px solid #4b5563 !important;
			box-shadow: 0 6px 12px rgba(0,0,0,0.5), inset 0 1px 1px rgba(255,255,255,0.2) !important;
			filter: none !important;
			opacity: 1 !important;
		}

		.hero-zone .skip-card:not(.target-highlight):not(.moved),
		.z-tactic .skip-card:not(.target-highlight):not(.moved) {
			border: 2px solid #4b5563 !important;
			box-shadow: none !important;
			animation: none !important;
		}
	
		/* Phase 1 visual migration: moved state remains for logic, pero hindi na dinidim ang hero/tactic card. */
		.hero-zone .card-in-playmat.moved::before,
		.z-tactic .card-in-playmat.moved::before {	
			display: none !important;
		}

		/* BAGO: Ibabalik ang sigla ng pagod na Hero kapag naging Target siya! */
		.card-in-playmat.moved.target-highlight {
            background-color: #5c4033 !important; /* Ibalik sa orihinal na kulay Hero */
            color: white !important; /* Ibalik ang kulay ng text */
            text-shadow: 1px 1px 2px rgba(0,0,0,0.9) !important; /* Ibalik ang anino ng text */
        }

		/* BAGO: Pinalakas ang text shadow para mabasa kahit ano pang picture ang nasa likod */
        .card-in-modal, .card-in-playmat, .prep-card, .clean-card {
            text-shadow: 2px 2px 4px #000, 0 0 10px #000, 0 0 20px #000 !important;
        }

		/* === BAGO: TOOL REPLACEMENT MODAL CSS === */
		#tool-replace-modal {
			position: absolute !important;
			left: 2cqh !important;
			bottom: 39cqh !important;
			inset: auto !important;
			width: 50cqh !important;
			height: calc(var(--card-height) + 6.5cqh) !important;
			z-index: 5000;
			display: flex;
			background: transparent !important;
			pointer-events: none;
		}

		#tool-replace-modal .modal-content {
			width: 100%;
			height: 100%;
			padding: 1cqh;
			box-sizing: border-box;
			display: flex;
			flex-direction: column;
			align-items: center;
			background: rgba(15, 23, 42, .97);
			border: 2px solid #3b82f6;
			border-radius: 8px;
			box-shadow: 0 0 15px rgba(59, 130, 246, .65);
			position: relative;
			overflow: visible;
			pointer-events: auto;
		}
		
		#value-range-modal,
		#token-burn-modal,
		#variable-cost-modal {
			position: absolute !important;
			left: 2cqh !important;
			bottom: 39cqh !important;
			top: auto !important;
			right: auto !important;
			inset: auto !important;
			width: 50cqh !important;
			height: calc(var(--card-height) + 6.5cqh) !important;
			z-index: 6000 !important;
			display: flex !important;
			align-items: center !important;
			justify-content: center !important;
			background: transparent !important;
			pointer-events: none !important;
		}

		#value-range-modal > div,
		#token-burn-modal > div,
		#variable-cost-modal > div {
			width: 100% !important;
			height: 100% !important;
			padding: 1.5cqh 2cqh !important;
			box-sizing: border-box !important;
			pointer-events: auto !important;
		}	

		/* === COMPACT SLIDER MODAL VISUALS === */
		#value-range-modal > div {
			border-color: var(--neon-green) !important;
			box-shadow: 0 0 18px var(--neon-green-glow) !important;
		}

		#token-burn-modal > div,
		#variable-cost-modal > div {
			border-color: #a855f7 !important;
			box-shadow: 0 0 18px rgba(168, 85, 247, .65) !important;
		}

		#value-range-modal > div > div:first-child {
			color: var(--neon-green) !important;
			font-size: var(--ui-heading, 2.4cqh) !important;
			text-shadow: 0 0 8px var(--neon-green) !important;
		}

		#token-burn-modal > div > div:first-child,
		#variable-cost-modal > div > div:first-child {
			color: #c084fc !important;
			font-size: var(--ui-heading, 2.4cqh) !important;
			text-shadow: 0 0 8px #a855f7 !important;
		}

		#value-range-modal input[type="range"],
		#token-burn-modal input[type="range"],
		#variable-cost-modal input[type="range"] {
			width: 100% !important;
			height: 2.2cqh !important;
			margin: 1cqh 0 !important;
			accent-color: var(--neon-green);
		}

		#token-burn-modal input[type="range"],
		#variable-cost-modal input[type="range"] {
			accent-color: #a855f7;
			opacity: 1;
		}
		
		#token-burn-modal input[type="range"]:disabled,
		#variable-cost-modal input[type="range"]:disabled {
			filter: none;
		}

		#value-range-modal button,
		#token-burn-modal button,
		#variable-cost-modal button {
			height: 4.2cqh !important;
			padding: 0 1.5cqh !important;
			font-size: var(--ui-caption, 1.5cqh) !important;
			font-weight: 900 !important;
			box-sizing: border-box !important;
		}

		#value-range-modal > div > div:last-child,
		#token-burn-modal > div > div:last-child,
		#variable-cost-modal > div > div:last-child {
			width: 100% !important;
			display: grid !important;
			grid-template-columns: 1fr 1fr !important;
			gap: 1cqh !important;
			margin-top: .2cqh !important;
			transform: translateY(-.6cqh);		
		}

		#value-range-modal button:last-child {
			background: var(--neon-green) !important;
			color: #000 !important;
			box-shadow: 0 0 10px var(--neon-green) !important;
		}

		#token-burn-modal button:last-child,
		#variable-cost-modal button:last-child {
			background: #a855f7 !important;
			color: #fff !important;
			box-shadow: 0 0 10px #a855f7 !important;
		}
		
		/* === LARGE SLIDER TEXT AND VALUE === */
			#value-range-modal > div > div:nth-of-type(2),
			#token-burn-modal > div > div:nth-of-type(2),
			#variable-cost-modal > div > div:nth-of-type(2) {
			font-size: var(--ui-caption, 1.5cqh) !important;
			line-height: 1.15 !important;
			margin-bottom: .8cqh !important;
			font-weight: 900 !important;
		}

		#value-range-modal > div > div:nth-of-type(3),
		#token-burn-modal > div > div:nth-of-type(3),
		#variable-cost-modal > div > div:nth-of-type(3) {
			font-size: 4.5cqh !important;
			line-height: 1 !important;
			margin-bottom: .8cqh !important;
			font-weight: 900 !important;
			text-shadow: 0 0 12px var(--neon-gold) !important;
		}

		#value-range-modal button,
		#token-burn-modal button,
		#variable-cost-modal button {
			font-size: var(--ui-subtitle, 1.8cqh) !important;
			letter-spacing: .04em !important;
		}

		.tool-modal-head {
			position: relative;
			width: 100%;
			height: 3cqh;
			display: flex;
			align-items: center;
			justify-content: center;
			flex: 0 0 auto;
			margin-bottom: .4cqh;
		}
		
		.tool-page-btn {
			position: absolute;
			top: 50%;
			min-width: 3.2cqh;
			height: 2.8cqh;
			padding: 0;
			transform: translateY(-50%);
		}

		#prev-tool-btn {
			left: 0;
		}

		#next-tool-btn {
			right: 0;
		}

		.tool-modal-close {
			position: absolute;
			top: -1.6cqh;
			right: -1.6cqh;
			width: 3.2cqh;
			height: 3.2cqh;
			z-index: 10;
			display: flex;
			align-items: center;
			justify-content: center;
			padding: 0;
			border: 2px solid white;
			border-radius: 50%;
			background: var(--neon-red);
			color: white;
			font-family: 'Rajdhani', sans-serif;
			font-size: var(--ui-caption, 1.5cqh);
			font-weight: 900;
			cursor: pointer;
			box-shadow: 0 0 10px var(--neon-red);
		}

		#tool-modal-title {
			margin: 0;
			text-align: center;
			color: #60a5fa;
			font-family: 'Rajdhani', sans-serif;
			font-size: var(--ui-caption, 1.5cqh);
			font-weight: 900;
			line-height: 1;
			white-space: nowrap;
		}

		#tool-select-container {
			width: 100%;
			flex: 1;
			min-height: 0 !important;
			padding: 0 4cqh;
			box-sizing: border-box;
			margin: 0 !important;
			display: flex;
			align-items: center;
			justify-content: center !important;
			gap: 1cqh !important;
			overflow: visible;
		}

		#tool-select-container .card-in-modal {
			width: var(--card-width);
			height: var(--card-height);
			flex: 0 0 auto;
		}

		#cancel-tool-replace {
			margin-top: .5cqh !important;
			padding: .35cqh 1.2cqh !important;
			font-size: var(--ui-caption, 1cqh) !important;
		}

        /* Para hindi tabingi ang cards kapag nasa modal */
        #tool-select-container .card-in-playmat,
		#tool-select-container .card-in-modal {
    	    position: relative;
    	    transform: none !important;
    	    cursor: pointer;
    	    transition: transform 0.2s;
			filter: none !important;
		}

		#tool-select-container .card-in-playmat:hover,
		#tool-select-container .card-in-modal:hover {
    	    transform: scale(1.05) !important;
            box-shadow: 0 0 15px red;
		}

		/* === BAGO: DEPLETING BADGE & MIND CONTROL === */
        .use-badge {
            position: absolute;
            bottom: 0.5cqh;
            right: 0.5cqh;
            background: rgba(0,0,0,0.85);
            border: 1px solid var(--neon-red);
            color: var(--neon-red);
            font-size: var(--ui-caption, 1.2cqh);
            font-weight: bold;
            padding: 2px 4px;
            border-radius: 4px;
            z-index: 15;
            box-shadow: 0 0 5px var(--neon-red-glow);
            text-shadow: 0 0 5px var(--neon-red);
            pointer-events: none;
        }
		
		.use-badge[data-badge-type="duration"] {
			min-width: 1.7cqh;
			min-height: 1.7cqh;
			display: flex;
			align-items: center;
			justify-content: center;
			font-size: var(--ui-caption, 1.5cqh);
			padding: 0.2cqh 0.45cqh;
			border-width: 2px;
		}
		
		#act-zone
		.card-in-playmat.card-technique.always-on-duration-glow {
			border-color: var(--neon-gold) !important;
			box-shadow: 0 0 10px var(--neon-gold), 0 0 22px rgba(250, 204, 21, 0.8), inset 0 0 12px rgba(250, 204, 21, 0.4) !important;
		}

        .mc-menu-btn {
            background: #4c1d95 !important; /* Deep Purple */
            border-color: #c084fc !important;
            color: #e9d5ff !important;
        }

        .mc-menu-btn:hover {
            background: #c084fc !important;
            color: black !important;
            box-shadow: 0 0 10px #c084fc !important;
        }

		/* === BAGO: EVOLUTION PREVIEW CARDS === */
        .evo-large-card {
            width: calc(var(--card-width) * 1.6);
            height: calc(var(--card-height) * 1.6);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--ui-title, 3cqh);
            font-weight: 900;
            border-radius: 6px;
            color: white;
            border: 2px solid var(--neon-green);
            box-shadow: 0 4px 10px rgba(0,0,0,0.5), inset 0 0 15px rgba(57, 255, 20, 0.2);
            position: relative;
            flex-shrink: 0;
            background-color: #5c4033;
        }
		
        .evo-arrow {
            color: var(--neon-gold);
            font-size: 4cqh;
            font-weight: bold;
            text-shadow: 0 0 10px var(--neon-gold);
        }

		/* === BAGO: PREP ABILITY READY GLOW === */
        .prep-ability-glow {
            border-color: #39ff14 !important; /* Nilabas natin dito para naka-lock na */
            animation: prepAbilityBlink 2.5s infinite ease-in-out !important;
        }
		
        @keyframes prepAbilityBlink {
            0%, 100% { box-shadow: 0 0 5px rgba(57, 255, 20, 0.2), 0 0 5px rgba(57, 255, 20, 0), inset 0 0 5px rgba(57, 255, 20, 0.1); }
            50% { box-shadow: 0 0 20px rgba(57, 255, 20, 1), 0 0 35px rgba(57, 255, 20, 0.6), inset 0 0 15px rgba(57, 255, 20, 0.8); }
        }

		/* === BAGO: EVOLUTION READY GLOW === */
        .evo-ready-glow {
            animation: evoReadyBlink 1.2s infinite alternate !important;
        }
		
        @keyframes evoReadyBlink {
            0% { 
                box-shadow: 0 0 5px var(--neon-gold), inset 0 0 5px rgba(250, 204, 21, 0.5); 
                background: rgba(0,0,0,0.85); 
                color: var(--neon-gold); 
            }
            100% { 
                box-shadow: 0 0 20px var(--neon-gold), 0 0 30px var(--neon-gold), inset 0 0 15px rgba(250, 204, 21, 0.8); 
                background: var(--neon-gold); 
                color: black; 
            }
        }

		/* === BAGO: REPLACE GHOST CARD === */
        .replace-ghost-card {
            width: var(--card-width);
            height: var(--card-height);
            display: flex;
            align-items: center;
            justify-content: center;
            font-family: 'Rajdhani', sans-serif;
            font-weight: bold;
            font-size: calc(1.5cqmin * var(--scale));
            background-color: #5c4033; /* Brown (Thematic Hero Color) */
            color: var(--neon-gold); /* Yellow Text */
            border: 2px dashed var(--neon-gold);
            border-radius: 6px;
            cursor: pointer;
            text-shadow: 0 0 5px black;
        }
		
		/* === TURN LOG SYSTEM === */
		#turn-log { 
			display: none; 
			position: absolute; 
			left: 2cqh; 
			bottom: calc(39cqh + var(--card-height) + 9cqh); 
			width: 50cqh; 
			height: 30cqh; 
			z-index: 200; 
			padding: 1cqh; 
			box-sizing: border-box; 
			overflow: hidden; background: 
			rgba(15,23,42,0.95); 
			border: 2px solid var(--neon-cyan); 
			border-radius: 8px; 
			box-shadow: 0 0 15px var(--neon-cyan-glow); 
			font-family: 'Rajdhani', sans-serif; 
		}
		
		#turn-log.active { 
			display: block; 
		}
		
		.turn-log-head { 
			display: flex; 
			align-items: center; 
			justify-content: space-between; 
			gap: 1cqh; 
			padding-bottom: 0.6cqh; 
			border-bottom: 1px solid rgba(255,255,255,0.2); 
		}
		
		#turn-log-title { 
			color: var(--neon-cyan); 
			font-size: var(--ui-body, 1.7cqh); font-weight: 900; 
		}
		
		#turn-log-list { 
			height: calc(100% - 4cqh); 
			margin-top: 0.6cqh; 
			overflow-y: auto; 
			color: white; 
			font-size: var(--ui-caption, 1.35cqh); 
			line-height: 1.25; 
			box-sizing: border-box; 
		}
		
		.turn-log-entry { 
			margin-bottom: 0.25cqh; 
			padding: 0.3cqh 0.5cqh; 
			border-radius: 3px; 
			border-bottom: 1px solid rgba(255,255,255,0.08); 
			box-sizing: border-box; 
		}
		
		.turn-log-entry.turn-log-player { 
			background: rgba(187,247,208,0.88); 
			color: #052e16; 
			font-weight: 900; 
		}
		
		.turn-log-entry.turn-log-enemy { 
			background: rgba(191,219,254,0.88); 
			color: #172554; 
			font-weight: 900; 
		}
		
		.turn-log-entry.turn-log-neutral { 
			background: rgba(255,255,255,0.06); 
			color: white; 
		}
		
		.turn-log-turn { 
			cursor: pointer; 
			user-select: none; 
		}
		
		.turn-log-turn-head { 
			display: flex; 
			align-items: center; 
			justify-content: 
			space-between; 
			gap: 1cqh; 
		}
		
		.turn-log-turn-label { 
			flex: 1; 
		}
		
		.turn-log-arrow { 
			min-width: 1.5cqh; 
			text-align: center; 
			font-size: var(--ui-caption, 1.2cqh); 
		}
		
		.turn-log-children { 
			display: none; 
			margin: 0.2cqh 0 0.5cqh; 
			padding: 0; 
		}
		
		.turn-log-turn.expanded + .turn-log-children { 
			display: block; 
		}
		
		.turn-log-move { 
			cursor: pointer; 
			user-select: none; 
		}
		
		.turn-log-move-results { 
			display: none; 
			margin: 0.2cqh 0 0.5cqh; 
			padding: 0; 
		}
		
		.turn-log-move.expanded + .turn-log-move-results { 
		display: block; 
		}
		
		.turn-log-child { 
			margin-bottom: 0.2cqh; 
			padding: 0.3cqh 0.5cqh; 
			border-radius: 3px; 
			background: rgba(255,255,255,0.06); 
			color: white; 
		}
		
		.turn-log-result { 
			margin-left: 22%; 
			padding-right: 0.6cqh; 
			background: rgba(255,255,255,0.04); 
			color: #d1d5db; 
			font-size: var(--ui-caption, 1.2cqh); 
			text-align: right; 
			border-right: 2px solid #9ca3af; 
		}
		
		.turn-log-neutral-detail {
			width: 78%;
			margin-left: auto;
			padding-right: 0.6cqh;
			background: rgba(255,255,255,0.04);
			color: #d1d5db;
			font-size: var(--ui-caption, 1.2cqh);
			text-align: right;
			border-right: 2px solid #9ca3af;
		}
		
		/* === MAIN LOG MSTACK INDENTATION === */
		.turn-log-mstack-entry {
			width: calc(100% - 8%);
			margin-left: 8%;
			box-sizing: border-box;
		}

		/* Neutral MSTACK details keep the same neutral color, but use left hierarchy. */
		.turn-log-mstack-entry.turn-log-neutral-detail {
			width: calc(100% - 8%);
			margin-left: 8%;
			text-align: left;
		}

		/* Results inside an expanded MSTACK resolve sit one level deeper. */
		.turn-log-mstack-entry + .turn-log-move-results .turn-log-result {
			width: calc(100% - 16%);
			margin-left: 16%;
			box-sizing: border-box;
		}

		/* Fallback results that had no usable move/resolve parent. */
		.turn-log-fallback-result {
			width: calc(100% - 16%);
			margin-left: 16%;
			box-sizing: border-box;
		}

		#turn-log-view { 
			padding: 0.4cqh 0.8cqh; 
			border: 1px solid var(--neon-gold); 
			border-radius: 4px; 
			background: transparent; 
			color: var(--neon-gold); 
			font-family: inherit; 
			font-size: var(--ui-caption, 1.1cqh); 
			font-weight: 900; 
			cursor: pointer; 
		}
		
		#turn-log-view:hover {
		background: var(--neon-gold); 
		color: black; 
		}

		/* === MATCH MENU === */
		#match-menu-button { display:none; position:absolute; right:2cqh; top:2cqh; z-index:10042; width:5cqh; height:5cqh; padding:0; line-height:1; font-size: var(--ui-title, 3cqh); }
		.match-menu-control { background:#0f172a; border:1px solid var(--neon-gold); border-radius:6px; color:var(--neon-gold); cursor:pointer; font-family:'Rajdhani',sans-serif; font-weight:700; padding:.8cqh 2cqh; font-size: var(--ui-subtitle, 2cqh); }
		.match-menu-control:disabled { opacity:.5; cursor:default; }
		#match-menu-backdrop { display:none; position:absolute; inset:0; z-index:10040; }
		.match-menu-panel { display:none; position:absolute; right:2cqh; bottom:39cqh; width:50cqh; height:calc(var(--card-height) + 6.5cqh); padding:1cqh; background:rgba(15,23,42,.98); border:2px solid var(--neon-gold); border-radius:8px; box-shadow:0 0 15px var(--neon-gold-glow); z-index:10041; font-family:'Rajdhani',sans-serif; color:white; flex-direction:column; align-items:center; justify-content:center; gap:1.2cqh; text-align:center; }
		.match-menu-panel.active { display:flex; }
		#match-restart-modal { z-index:10043; }
		.match-menu-title { font-size: var(--ui-heading, 2.6cqh); font-weight:900; color:var(--neon-gold); }
		.match-menu-actions { display:flex; gap:1.2cqh; }
		#match-menu-message, #match-restart-message { font-size: var(--ui-subtitle, 2cqh); margin:0; }
		#match-menu-message:empty { display:none; }
		body.match-menu-open #match-menu-backdrop { display:block; }
		body.match-menu-open #hud-player, body.match-menu-open #hud-enemy, body.match-menu-open .stage-indicator { display:none !important; }
		#match-menu-button, #match-menu-backdrop, .match-menu-panel, .match-menu-panel * { pointer-events:auto !important; }
		body:has(#playmat[style*="display: flex"]):has(#preparation-screen[style*="display: none"]) #match-menu-button { display:block; }

		/* === BAGO: MSTACK MODAL SYSTEM === */
        #mstack-modal {
            display: none;
            position: absolute;
            left: 2cqh;
            bottom: 39cqh;
            width: 50cqh;
            height: calc(var(--card-height) + 6.5cqh);
            background: rgba(15, 23, 42, 0.95);
            border: 2px solid var(--neon-gold);
            border-radius: 8px;
            z-index: 1000;
            box-shadow: 0 0 15px var(--neon-gold-glow);
            padding: 1cqh;
            flex-direction: row;
            align-items: center;
            justify-content: flex-start;
            gap: 1.2cqh;
            font-family: 'Rajdhani', sans-serif;
        }

		#mstack-modal.active {
            display: flex;
        }
		
		body.effect-resolving .action-menu {
			display: none !important;
			pointer-events: none !important;
		}
		
		body.war-turn-transition .action-menu {
			display: none !important;
			pointer-events: none !important;
		}

        body.mstack-ui-lock .action-menu:not([data-mstack-universal-menu="true"])
		:not([data-mstack-tool-menu="true"]):not([data-mstack-technique-menu="true"]) {
            display: none !important;
            pointer-events: none !important;
        }

        body.mstack-ui-lock .action-menu[data-mstack-universal-menu="true"],
        body.mstack-ui-lock .action-menu[data-mstack-tool-menu="true"],
        body.mstack-ui-lock .action-menu[data-mstack-technique-menu="true"],
        body.mstack-ui-lock .action-menu[data-mstack-universal-menu="true"] *,
        body.mstack-ui-lock .action-menu[data-mstack-tool-menu="true"] *,
        body.mstack-ui-lock .action-menu[data-mstack-technique-menu="true"] * {
            display: flex !important;
            pointer-events: auto !important;
        }

        body.mstack-ui-lock .expanded-box:not(#mstack-modal):not(#token-burn-modal):not(#value-range-modal):not(#variable-cost-modal) {            pointer-events: none !important;
        }

        body.mstack-ui-lock .action-btn {
            pointer-events: none !important;
            filter: grayscale(100%) brightness(0.45);
        }

        body.mstack-ui-lock #mstack-modal,
        body.mstack-ui-lock #mstack-modal *,
        body.mstack-ui-lock #token-burn-modal,
        body.mstack-ui-lock #token-burn-modal *,
        body.mstack-ui-lock #value-range-modal,
        body.mstack-ui-lock #value-range-modal *,
        body.mstack-ui-lock #variable-cost-modal,
        body.mstack-ui-lock #variable-cost-modal * {
            pointer-events: auto !important;
        }

        .mstack-left {
            width: 13cqh;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .mstack-right {
            width: calc(100% - 12cqh);
            height: 80%;
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 1cqh;
            padding: 0 1cqh;
            min-width: 0;
        }

        .mstack-title {
            color: white;
            font-size: var(--ui-caption, 1.5cqh);
            text-align: center;
            text-shadow: 0 0 5px black;
            margin-bottom: 0.5cqh;
        }

        /* Ghost Card for Origin */
        .mstack-origin-card {
            width: var(--card-width);
            height: var(--card-height);
            border: 1px dashed white;
            border-radius: 4px;
            background-color: transparent;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: var(--ui-subtitle, 2cqh);
            color: white;
            flex-shrink: 0; /* BAGO: Pipigilan ang card na lumiit */
        }

		.mstack-origin-visual-card {
            position: relative !important;
            z-index: 10;
        }

		/* === MSTACK ORIGIN UNIVERSAL VFX === */
		.mstack-origin-card.mstack-origin-vfx-start-glow {
			border-color: #ffffff !important;
			box-shadow:
				0 0 10px #ffffff,
				0 0 24px rgba(255,255,255,0.9),
				0 0 44px rgba(255,255,255,0.55),
				inset 0 0 18px rgba(255,255,255,0.65) !important;
			animation: mstackOriginStartGlow 0.65s ease-out forwards;
		}

		.mstack-origin-card.mstack-origin-vfx-start-glow::after {
			content: '';
			position: absolute;
			inset: -4px;
			border-radius: inherit;
			border: 2px solid rgba(255,255,255,0.9);
			pointer-events: none;
			animation: mstackOriginGlowRing 0.65s ease-out forwards;
		}

		@keyframes mstackOriginStartGlow {
			0% { filter: brightness(1); transform: scale(1); }
			35% { filter: brightness(2.3); transform: scale(1.04); }
			100% { filter: brightness(1.15); transform: scale(1); }
		}
	
		@keyframes mstackOriginGlowRing {
			0% { opacity: 0; transform: scale(0.88); }
			35% { opacity: 1; transform: scale(1.04); }
			100% { opacity: 0; transform: scale(1.22); }
		}

		.mstack-origin-card.mstack-origin-vfx-dissolve {
			border-color: rgba(255,255,255,0.85) !important;
			box-shadow:
				0 0 16px #ffffff,
				0 0 35px rgba(255,255,255,0.75),
				inset 0 0 24px rgba(255,255,255,0.5) !important;
			animation: mstackOriginDissolveBox 0.62s ease-in forwards;
		}

		.mstack-origin-card.mstack-origin-vfx-dissolve .mstack-origin-visual-card {
			animation: mstackOriginDissolveCard 0.62s ease-in forwards !important;
		}

		.mstack-origin-card.mstack-origin-vfx-dissolve::before {
			content: '';
			position: absolute;
			inset: -8%;
			border-radius: inherit;
			background:
				radial-gradient(circle, rgba(255,255,255,0.95) 0%, rgba(255,255,255,0.45) 28%, transparent 68%);
			pointer-events: none;
			z-index: 40;
			animation: mstackOriginDissolveMist 0.62s ease-in forwards;
		}

		@keyframes mstackOriginDissolveBox {
			0% { opacity: 1; filter: brightness(1.2) blur(0); transform: scale(1); }
			55% { opacity: 0.85; filter: brightness(2.8) blur(1px); transform: scale(1.05); }
			100% { opacity: 0; filter: brightness(4) blur(6px); transform: scale(0.72); }
		}

		@keyframes mstackOriginDissolveCard {
			0% { opacity: 1; filter: brightness(1.2) saturate(1); transform: scale(1); }
			55% { opacity: 0.75; filter: brightness(3) saturate(0.25) blur(1px); transform: scale(1.08); }
			100% { opacity: 0; filter: brightness(5) saturate(0) blur(7px); transform: scale(0.35); }
		}		

		@keyframes mstackOriginDissolveMist {
			0% { opacity: 0; transform: scale(0.8); }
			35% { opacity: 1; transform: scale(1.05); }
			100% { opacity: 0; transform: scale(1.65); }
		}

        .mstack-visual-stack-card {
            position: absolute !important;
            width: 100% !important;
            height: 100% !important;
            left: var(--mstack-stack-offset-x, 0.7cqh) !important;
            top: var(--mstack-stack-offset-y, 0.25cqh) !important;
            z-index: var(--mstack-stack-z, 20) !important;
            opacity: 0.88;
            pointer-events: auto;
            cursor: pointer;
            box-shadow:
                0 0 10px rgba(250, 204, 21, 0.55),
                0 8px 18px rgba(0,0,0,0.75) !important;
            filter: saturate(0.9) brightness(0.9);
            transition:
                filter 0.16s ease,
                box-shadow 0.16s ease,
                border-color 0.16s ease,
                transform 0.16s ease;
        }
		
		/* PATCH: Resolved events and effects stay visible in grayscale. */
		.mstack-origin-visual-card.mstack-visual-resolved,
		.mstack-visual-stack-card.mstack-visual-resolved {
			filter:
				grayscale(100%)
				brightness(0.62) !important;
			opacity: 0.82 !important;
			box-shadow:
				0 0 8px rgba(156, 163, 175, 0.55),
				0 8px 18px rgba(0, 0, 0, 0.75) !important;
			border-color:
				var(--gray-zone) !important;
		}

		.mstack-visual-stack-card.mstack-resolving-now {
            opacity: 1 !important;
            filter: brightness(1.45) saturate(1.35) !important;
            border-color: #ffffff !important;
            box-shadow:
                0 0 14px #ffffff,
                0 0 30px rgba(255,255,255,0.95),
                0 0 48px var(--neon-gold),
                0 10px 24px rgba(0,0,0,0.9) !important;
            animation: mstackResolvingPulse 0.75s ease-in-out infinite alternate;
        }

		/* PATCH: Visible dissolve for each resolved MSTACK responder card. */
		.mstack-visual-stack-card.mstack-resolve-dissolve {
			pointer-events: none !important;
			z-index: 99999 !important;
			border-color: #ffffff !important;
			animation:
				mstackResolvedCardDissolve
				1s
				ease-in-out
				forwards !important;
		}

		@keyframes mstackResolvedCardDissolve {
			0% { opacity: 1; transform: scale(1.04); filter: brightness(1.8) saturate(1.35) blur(0); box-shadow: 0 0 14px #ffffff, 0 0 30px rgba(255,255,255,0.95), 0 0 48px var(--neon-gold); }
			25% { opacity: 1; transform: scale(1.08); filter: brightness(3) saturate(0.8) blur(1px); }
			70% { opacity: 0.55; transform: scale(0.82); filter: brightness(4) saturate(0.2) blur(4px); }
			100% { opacity: 0; transform: scale(0.25); filter: brightness(5) saturate(0) blur(9px); box-shadow: none; }
		}		

        @keyframes mstackResolvingPulse {
            0% { filter: brightness(1.25) saturate(1.15); transform: scale(1); }
            100% { filter: brightness(1.8) saturate(1.45); transform: scale(1.035); }
        }

        .mstack-visual-stack-card.mstack-visual-negated {
            filter: grayscale(100%) brightness(0.45);
            opacity: 0.7;
        }

        .mstack-visual-stack-card.mstack-visual-negated::after {
            content: 'X';
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--neon-red);
            font-size: 7cqh;
            font-weight: 900;
            text-shadow:
                0 0 12px var(--neon-red),
                3px 3px 0 #000;
            z-index: 50;
            pointer-events: none;
        }

        /* Universal negated state — battlefield at ACT ZONE cards */
        .card-negated {
            filter: grayscale(100%) brightness(0.45) !important;
            opacity: 0.7 !important;
            transition: filter 0.3s ease, opacity 0.3s ease;
        }

        .card-negated::after {
            content: 'X';
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--neon-red);
            font-size: 4cqh;
            font-weight: 900;
            text-shadow:
                0 0 12px var(--neon-red),
                3px 3px 0 #000;
            z-index: 50;
            pointer-events: none;
        }

		/* === BAGO: SYMMETRICAL MSTACK CONTROLS === */
        .mstack-player-controls, .mstack-opponent-controls {
            width: 100%;
			padding-bottom: 0.1cqh;
            min-height: 3.2cqh;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1cqh;
            box-sizing: border-box;
            text-align: center;
        }

        .mstack-opponent-controls {
            border-bottom: 1px dashed rgba(255,255,255,0.1);
            font-size: var(--ui-caption, 1cqh);
            line-height: 1.05;
            color: #e5e7eb;
        }

        .mstack-player-controls {
            border-top: 1px dashed rgba(255,255,255,0.1);
            padding-top: 0.45cqh;
        }

        /* MSTACK Buttons */
        .mstack-btn {
            flex: 0 0 auto;
            min-width: 12cqh;
            height: 4cqh;
            padding: 0.2cqh 0.2cqh;
            font-family: 'Rajdhani', sans-serif;
            font-weight: bold;
            font-size: var(--ui-caption, 1.5cqh);
            border-radius: 6px;
            cursor: pointer;
            text-align: center;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            line-height: 1;
            box-sizing: border-box;
        }

        .mstack-btn-trigger {
            background-color: transparent;
            color: var(--neon-gold);
            border: 2px solid var(--neon-gold);
            text-shadow: 0 0 5px var(--neon-gold-glow);
        }
        .mstack-btn-trigger:hover {
            background-color: var(--neon-gold);
            color: black;
        }

		.mstack-btn-mixed {
			background: linear-gradient(90deg, #ef4444 50%, #facc15 50%);
			border: 2px solid #facc15;
			color: #fff;
			text-shadow: 0 1px 2px #000;
		}

        /* BAGO: Red Button para sa Reactive MSTACK */
        .mstack-btn-react {
            background-color: transparent;
            color: var(--neon-red);
            border: 2px solid var(--neon-red);
            text-shadow: 0 0 5px var(--neon-red-glow);
        }
        .mstack-btn-react:hover {
            background-color: var(--neon-red);
            color: white;
        }

        .mstack-btn-ignore {
            background-color: transparent;
            color: #9ca3af;
            border: 2px solid #9ca3af;
        }
        .mstack-btn-ignore:hover {
            background-color: #9ca3af;
            color: black;
        }

		/* Universal Three-Laser Beam */
		.vfx-red-beam {
			position: fixed;
			z-index: 9999;
			pointer-events: none;
			transform-origin: left center;
			border-radius: 999px;
			background: linear-gradient(90deg, transparent, #ef4444 8%, #fff 48%, #ef4444 82%, transparent);
			box-shadow: 0 0 8px #fff, 0 0 18px #ef4444, 0 0 34px #dc2626;
			animation: redLaserBurst 560ms ease-out var(--laser-delay, 0ms) both;
		}
		.vfx-red-beam::after {
			content: '';
			position: absolute;
			inset: 30% 3%;
			border-radius: inherit;
			background: #fff;
			box-shadow: 0 0 10px #fff;
		}
		@keyframes redLaserBurst {
			0% { opacity: 0; clip-path: inset(0 100% 0 0); transform: translateY(-50%) rotate(var(--laser-angle)) scaleY(.2); }
			24% { opacity: 1; clip-path: inset(0); transform: translateY(-50%) rotate(var(--laser-angle)) scaleY(1.35); }
			68% { opacity: 1; clip-path: inset(0); transform: translateY(-50%) rotate(var(--laser-angle)) scaleY(1); }
			100% { opacity: 0; clip-path: inset(0 0 0 100%); transform: translateY(-50%) rotate(var(--laser-angle)) scaleY(.1); }
		}

		/* BAGO: Mini Coin Flip para sa In-Game Abilities */
        .vfx-mini-coin-container {
            position: absolute;
            top: -6cqh; /* Nakapatong sa ibabaw ng card */
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            z-index: 150;
            pointer-events: none;
        }
        .vfx-mini-coin {
            position: relative;
            width: 6cqh;
            height: 6cqh;
            border-radius: 50%;
            background: radial-gradient(circle, #facc15, #b45309);
            border: 2px solid #fef08a;
            box-shadow: 0 0 15px #facc15, 0 0 30px #facc15;
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: var(--ui-heading, 2.5cqh);
            font-weight: bold;
            color: black;
			transform-style: preserve-3d;
        }
		
		.vfx-mini-coin-face,
		.vfx-mini-coin::after {
			position: absolute;
			inset: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			border-radius: inherit;
			backface-visibility: hidden;
			-webkit-backface-visibility: hidden;
		}
		.vfx-mini-coin::after {
			content: 'T';
			background: radial-gradient(circle, #67e8f9, #0891b2 55%, #083344);
			color: #ecfeff;
			transform: rotateY(180deg);
		}
		
        .vfx-mini-coin-status {
            margin-top: 0.5cqh;
            font-size: var(--ui-caption, 1.2cqh);
            font-weight: bold;
            color: var(--neon-gold);
            text-shadow: 0 0 5px black, 1px 1px 2px black;
            background: rgba(0,0,0,0.8);
            padding: 2px 6px;
            border-radius: 4px;
            white-space: nowrap;
        }
        .flip-fast { animation: flipCoinFast 0.1s infinite linear; }
        @keyframes flipCoinFast { 0% { transform: scaleY(1); } 50% { transform: scaleY(0); } 100% { transform: scaleY(1); } }

		}
	
		/* BAGO: Technique Card Drop Animations */
		@keyframes popInNormal {
			0% { transform: scale(0.5); opacity: 0.5; }
			50% { transform: scale(1.15); opacity: 1; }
			100% { transform: scale(1); }
		}

		@keyframes popInOpponent {
			0% { transform: scale(0.5) rotate(180deg); opacity: 0.5; }
			50% { transform: scale(1.15) rotate(180deg); opacity: 1; }
			100% { transform: scale(1) rotate(180deg); }
		}
	
		.anim-pop-normal {
			animation: popInNormal 0.4s ease-out;
		}
	
		.anim-pop-opponent {
			animation: popInOpponent 0.4s ease-out;
		}
		
		/* === MOMENT REENACTMENT TRANSFORMATION VFX === */
		.reenact-transforming {
			pointer-events: none !important;
			animation: reenactCardTransformation 0.9s cubic-bezier( 0.22, 1, 0.36, 1 ) forwards !important;
			z-index: 99999 !important;
		}

		.reenact-transforming::after {
			content: '';
			position: absolute;
			inset: -10%;
			border-radius: inherit;
			pointer-events: none;
			z-index: 150;
			background: radial-gradient( circle, rgba( 255, 255, 255, 0.95 )
				0%, rgba( 250, 204, 21, 0.72 )
				28%, rgba( 120, 6, 6, 0.5 )
				58%, transparent
				78%);
			mix-blend-mode: screen;
			animation: reenactTransformationFlash 0.9s ease-out forwards;
		}

		@keyframes reenactCardTransformation {
			0% { opacity: 1; transform: scale(1) rotate(0deg); filter: brightness(1) saturate(1); }
			28% { opacity: 0.25; transform: scale(0.82) rotate(-8deg); filter: brightness(4) saturate(0) blur(3px); }
			52% { opacity: 0.15; transform: scale(0.68) rotate(8deg); filter: brightness(5) saturate(0) blur(5px); }
			72% { opacity: 1; transform: scale(1.14) rotate(0deg); filter: brightness(2.4) saturate(1.6) blur(0); }
			100% { opacity: 1; transform: scale(1) rotate(0deg); filter: brightness(1) saturate(1); }
		}

		@keyframes reenactTransformationFlash {
			0% { opacity: 0; transform: scale(0.5);}
			32% { opacity: 1; transform: scale(1); }
			70% { opacity: 0.8 transform: scale(1.3); }
			100% { opacity: 0; transform: scale(1.65); }
		}
		
		/* === DIGITAL SCAN SPAWN VFX === */
		.card-dummy.vfx-digital-scan-spawn {
			animation: digitalScanSpawnCard 0.85s ease-out forwards;
			overflow: hidden;
		}

		.card-dummy.vfx-digital-scan-spawn::before {
			content: '';
			position: absolute;
			left: -20%;
			top: -30%;
			width: 140%;
			height: 35%;
			background: linear-gradient(
				to bottom,
				transparent 0%,
				color-mix( in srgb, var(--dummy-vfx-color, var(--neon-cyan)) 20%, transparent ) 20%,
				rgba(255, 255, 255, 0.9) 50%,
				color-mix( in srgb, var(--dummy-vfx-color, var(--neon-cyan)) 35%, transparent ) 80%,
				transparent 100%
			);
			box-shadow:
				0 0 18px var(--dummy-vfx-color, var(--neon-cyan)),
				0 0 36px var(--dummy-vfx-color, var(--neon-cyan));
			z-index: 100;
			pointer-events: none;
			animation: digitalScanLine 0.85s ease-out forwards;
		}

		.card-dummy.vfx-digital-scan-spawn::after {
			content: 'COPY';
			position: absolute;
			inset: 0;
			display: flex;
			align-items: center;
			justify-content: center;
			color: var( --dummy-vfx-color, var(--neon-cyan) );
			font-size: var(--ui-heading, 2.4cqh);
			font-weight: 900;
			letter-spacing: 0.12em;
			text-shadow: 0 0 8px var( --dummy-vfx-color, var(--neon-cyan) ), 
				0 0 18px var( --dummy-vfx-color, var(--neon-cyan) ), 2px 2px 0 #000;
			z-index: 101;
			pointer-events: none;
			animation: digitalScanText 0.85s ease-out forwards;
		}

		@keyframes digitalScanSpawnCard {
			0% { opacity: 0; transform: scale(0.72); filter: brightness(2.8) saturate(0); }
			35% { opacity: 1; transform: scale(1.08); filter: brightness(2.2) saturate(1.8); }
			100% { opacity: 1; transform: scale(1); filter: brightness(1) saturate(1); }
		}

		@keyframes digitalScanLine {
			0% { transform: translateY(-120%); opacity: 0; }
			20% { opacity: 1; }
			100% { transform: translateY(420%); opacity: 0; }
		}

		@keyframes digitalScanText {
			0% { opacity: 0; transform: scale(0.8); }
			25% { opacity: 1; transform: scale(1); }
			100% { opacity: 0; transform: scale(1.25); }
		}

		body.result-ending #playmat,
		body.result-lock #playmat {
			pointer-events: none;

			transition:
				filter .7s ease,
				transform .7s ease;

			filter:
				brightness(.2)
				saturate(.45)
				blur(1px);

			transform:
				scale(.985);
		}

		body.result-ending #hud-player,
		body.result-ending #hud-enemy,
		body.result-ending .stage-indicator,
		body.result-lock #hud-player,
		body.result-lock #hud-enemy,
		body.result-lock .stage-indicator {
			pointer-events: none;

			transition:
				filter .7s ease,
				opacity .7s ease,
				transform .7s ease;

			filter:
				brightness(.18)
				saturate(.35)
				blur(.5px);

			opacity: .35;

			transform:
				scale(.97);
		}

		#final-result-modal {
			position: fixed;
			inset: 0;
			z-index: 20000;

			display: flex;
			align-items: center;
			justify-content: center;

			visibility: hidden;
			opacity: 0;
			background:
				rgba(0, 0, 0, 0);
			transition:
				opacity .28s ease,
				background .45s ease,
				visibility 0s linear .45s;

			color: #fff;
			font-family:
				Rajdhani,
				sans-serif;
		}

		#final-result-modal.active {
			visibility: visible;
			opacity: 1;
			background:
				rgba(0, 0, 0, .86);
			transition-delay: 0s;
		}

		.result-panel {
			width: min(92cqw, 1100px);
			max-height: 92cqh;
			overflow: auto;
			padding: 2.5cqh 2cqw;
			border: 2px solid var(--neon-gold);
			border-radius: 12px;
			background: #090d14;
			box-shadow:
				0 0 35px
				rgba(250, 204, 21, .45);
		}
		
		#final-result-modal
		.result-panel {
			opacity: 0;
			transform:
				scale(.72)
				translateY(4cqh);
			filter:
				blur(5px);
		}
		
		#final-result-modal.active
		.result-panel {
			animation:
				resultPanelImpact
				.48s
				cubic-bezier( .18, .89, .32, 1.28 )
				forwards;
		}

		@keyframes resultPanelImpact {
			0% { opacity: 0; transform: scale(.72) translateY(4cqh); filter: blur(5px); }
			70% { opacity: 1; transform: scale(1.025) translateY(0); filter: blur(0); }
			100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
		}

		.result-head {
			text-align: center;
			margin-bottom: 2cqh;
		}

		.result-outcome {
			font-size: 4cqh;
			font-weight: 900;
			color: var(--neon-gold);
		}

		.result-rank {
			font-size: 7cqh;
			font-weight: 900;
			line-height: 1;
			text-shadow:
				0 0 18px
				currentColor;
		}

		.result-meta,
		.result-honors,
		.result-columns {
			display: grid;
			gap: 1cqh 1.5cqw;
		}

		.result-meta {
			grid-template-columns:
				repeat(3, 1fr);

			text-align: center;
			margin: 1.5cqh 0;
		}

		.result-honors {
			grid-template-columns:
				1fr 1fr;

			margin: 2cqh 0;
		}

		.result-columns {
			grid-template-columns:
				1fr 1fr;
		}

		.result-card {
			padding: 1.3cqh 1.2cqw;
			border: 1px solid #334155;
			border-radius: 8px;
			background: #111827;
		}

		.result-card h3 {
			margin: 0 0 1cqh;
			color: var(--neon-cyan);
			font-size: var(--ui-heading, 2.4cqh);
		}

		.result-row {
			display: flex;
			justify-content: space-between;
			gap: 2cqw;
			padding: .45cqh 0;
			border-bottom:
				1px solid #1f2937;
			font-size: var(--ui-body, 1.65cqh);
		}

		.result-row:last-child {
			border-bottom: 0;
		}
		
		.result-side-panel {
			padding: 1.8cqh 1.4cqw;
			border: 2px solid #475569;
			border-radius: 10px;
			background: rgba(15, 23, 42, .96);
			color: #94a3b8;
			box-shadow: 0 0 18px rgba(15, 23, 42, .6);
			transition: opacity .25s ease, filter .25s ease, border-color .25s ease, box-shadow .25s ease;
		}

		/* Winner panel */
		.result-side-panel.winner {
			border-color: #fff;
			color: #fff;
			box-shadow: 0 0 24px rgba(255, 255, 255, .3);
		}

		/* Loser panel */
		.result-side-panel.loser {
			border-color: #64748b;
			color: #94a3b8;
			filter: grayscale(1);
			opacity: .68;
			box-shadow: 0 0 12px rgba(100, 116, 139, .2);
		}

		.result-side-title {
			font-size: var(--ui-title, 3cqh);
			font-weight: 900;
			text-align: center;
			letter-spacing: .08em;
			margin-bottom: .3cqh;
		}

		.result-side-rank {
			font-size: var(--ui-subtitle, 2.2cqh);
			font-weight: 900;
			text-align: center;
			margin-bottom: 1.3cqh;
		}

		.result-side-panel.winner
		.result-side-rank {
			color: #fff;
			text-shadow: 0 0 12px rgba(255, 255, 255, .7);
		}

		.result-side-panel.loser
		.result-side-rank {
			color: #94a3b8;
		}

		.result-side-honors {
			display: grid;
			grid-template-columns: 1fr 1fr;
			gap: .8cqw;
			margin: 1.2cqh 0;
		}

		.result-honor-box {
			min-height: 7cqh;
			padding: 1cqh .8cqw;
			border: 1px solid currentColor;
			border-radius: 7px;
			background: rgba(0, 0, 0, .22);
			text-align: center;
			font-size: var(--ui-caption, 1.45cqh);
		}

		.result-honor-box strong {
			display: block;
			margin-bottom: .4cqh;
			font-size: var(--ui-body, 1.7cqh);
			letter-spacing: .05em;
		}

		.result-side-panel.winner
		.result-row strong {
			color: #fff;
		}

		.result-side-panel.loser
		.result-row strong {
			color: #94a3b8;
		}
		
		.result-carousel-shell {
			position: relative;
			width: 100%;
			margin-top: 1.2cqh;
		}

		.result-carousel-box {
			width: 100%;
			height: 25cqh;
			overflow: hidden;
			padding: 1cqh 2cqw;
			border: 1px solid currentColor;
			border-radius: 8px;
			background: rgba(0, 0, 0, .2);
			box-sizing: border-box;
		}

		.result-carousel-btn {
			position: absolute;
			top: 50%;
			z-index: 20;
			width: 1.6cqw;
			height: 8cqh;
			padding: 0;
			transform: translateY(-50%);
			border: 0;
			outline: 0;
			background: rgba(0, 0, 0, .18);
			color: rgba(255, 255, 255, .55);
			font-size: var(--ui-subtitle, 1.8cqh);
			font-weight: 900;
			line-height: 1;
			cursor: pointer;
			transition: color .18s ease, background .18s ease, opacity .18s ease;
			opacity: .6;
		}
		
		.result-carousel-btn:first-child {
			left: .15cqw;
			border-radius: 0 5px 5px 0;
		}

		.result-carousel-btn:last-child {
			right: .15cqw;
			border-radius: 5px 0 0 5px;
		}

		.result-carousel-btn:hover {
			color: #fff;
			background: rgba(255, 255, 255, .1);
			opacity: 1;
		}

		.result-carousel-title {
			text-align: center;
			font-size: var(--ui-body, 1.6cqh);
			font-weight: 900;
			margin-bottom: .7cqh;
		}

		.result-hero-roster {
			display: grid;
			grid-template-columns: repeat(5, minmax(0, 1fr));
			align-items: start;
			gap: .28cqw;
			width: 100%;
			height: 21cqh;
			padding: 0 .15cqw;
			overflow: hidden;
			box-sizing: border-box;
		}

		.result-hero-lineage {
			position: relative;

			width: 100%;
			min-width: 0;
			height: 20cqh;

			overflow: hidden;
			box-sizing: border-box;
		}
		
		.result-hero-form {
			position: absolute;
			left: 50%;
			width: min( 88%, 3cqw );
			aspect-ratio: 5 / 7;
			height: auto;
			transform: translateX(-50%);
			border: 1px solid #facc15;
			border-radius: 4px;
			background-size: cover;
			background-position: center;
			background-repeat: no-repeat;
			background-color: #111827;
			box-shadow: 0 0 7px rgba(250, 204, 21, .4);
			box-sizing: border-box;
		}

		/* Defeated lineage */
		.result-hero-lineage.defeated
		.result-hero-form {
			border-color: #64748b;
			filter: grayscale(1) brightness(.55);
			box-shadow: none;
		}

		.result-hero-form-name {
			position: absolute;
			left: 0;
			right: 0;
			bottom: 0;
			padding:.12cqh .06cqw;
			background: rgba(0, 0, 0, .8);
			color: #fff;
			font-size: var(--ui-caption, .55cqh);
			line-height: 1;
			text-align: center;
			overflow: hidden;
			text-overflow: ellipsis;
			white-space: nowrap;
		}

		.result-carousel-stats {
			height: 21cqh;
			overflow-y: auto;
			padding-right: .3cqw;
		}
		
		.result-controls {
			display: grid;
			grid-template-columns: repeat(3, 10cqw);
			justify-content: center;
			gap: .5cqw;
			margin-top: 2cqh;
		}

		.result-control-btn {
			min-height: 5.5cqh;
			padding: 1cqh 1cqw;
			border: 1px solid var(--neon-cyan);
			border-radius: 6px;
			background: rgba(15, 23, 42, .95);
			color: var(--neon-cyan);
			font-family: Rajdhani, sans-serif;
			font-size: var(--ui-subtitle, 1.8cqh);
			font-weight: 900;
			cursor: pointer;
			transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
		}

		.result-control-btn:hover {
			transform: translateY(-2px);
			background: rgba(8, 145, 178, .2);
			box-shadow: 0 0 14px rgba(6, 182, 212, .45);
		}

		.result-control-btn.primary {
			border-color: var(--neon-gold);
			color: var(--neon-gold);
			box-shadow: 0 0 12px rgba(250, 204, 21, .25);
		}

		.result-control-btn.danger {
			border-color: var(--neon-red);
			color: var(--neon-red);
		}

		.result-control-btn.placeholder {
			opacity: .5;
			cursor: default;
		}

		.result-control-btn.placeholder:hover {
			transform: none;
			box-shadow: none;
			background: rgba(15, 23, 42, .95);
		}
		
		/* === FIXED GAME VIEWPORT: PHASE 2 === */
		.modal-overlay:not(#tool-replace-modal),
		#turn-selection-overlay,
		#final-result-modal {
			position: absolute !important;
			inset: 0 !important;
			width: 100% !important;
			height: 100% !important;
			box-sizing: border-box;
		}
		
		.expanded-box, 
		.action-btn, 
		.turn-box, 
		.hud-container, 
		.move-counter-box, 
		.preview-container, 
		#mstack-modal, 
		#evo-preview-modal, 
		#trigger-prompt-modal { 
			position: absolute !important;
		}
			
		/* === CARD IMAGE PRELOADER === */
	#card-preloader { 
		position: absolute; 
		inset: 0; z-index: 30000; 
		display: flex; flex-direction: 
		column; align-items: center; 
		justify-content: center; 
		gap: 1.5cqh; background: #020617; 
		color: var(--neon-gold);
		font-family: 'Rajdhani', sans-serif; 
		font-weight: 900; 
	}
	
	#preload-title { 
		font-size: 4cqmin;	
		text-shadow: 0 0 15px var(--neon-gold);
	}
	
	#preload-bar { 
		width: 35cqw; 
		height: 1.5cqh; 
		overflow: hidden; 
		border: 2px solid var(--neon-gold); 
		border-radius: 999px; 
		background: #111827; 
		box-shadow: 0 0 15px var(--neon-gold-glow); 
	}
	
	#preload-fill { 
		width: 0%;
		height: 100%; 
		background: var(--neon-gold); 
		transition: width 0.15s ease; 
	}
	
	#preload-status { 
		font-size: var(--ui-subtitle, 1.8cqmin); 
		color: white; 
	}
	
	/* === FULL GAME LOG MODAL === */
	#full-game-log-modal { 
		display: none; 
		position: absolute; 
		inset: 0; 
		z-index: 30000; 
		align-items: center; 
		justify-content: center; 
		background: rgba(0,0,0,0.86); 
		backdrop-filter: blur(6px); 
	}
	
	#full-game-log-modal.active { 
		display: flex; 
	}
	
	.full-game-log-panel { 
		width: 70cqw; 
		height: 82cqh; 
		display: flex; 
		flex-direction: 
		column; padding: 
		2cqh 2cqw; 
		box-sizing: border-box; 
		overflow: hidden; 
		background: #090d14; 
		border: 2px solid var(--neon-cyan); 
		border-radius: 12px; 
		box-shadow: 0 0 30px var(--neon-cyan-glow); 
		font-family: 'Rajdhani', sans-serif; 
	}
	
	.full-game-log-head { 
		display: flex; 
		align-items: center; 
		justify-content: 
		space-between; 
		padding-bottom: 1cqh; 
		border-bottom: 1px solid rgba(255,255,255,0.2); 
	}
	
	.full-game-log-title { 
		color: var(--neon-cyan); 
		font-size: var(--ui-title, 3cqh); 
		font-weight: 900; 
	}
	
	.full-game-log-close { 
		padding: 0.6cqh 1.2cqh; 
		border: 1px solid var(--neon-red); 
		border-radius: 5px; 
		background: transparent; 
		color: var(--neon-red); 
		font-family: inherit; 
		font-size: var(--ui-caption, 1.5cqh); 
		font-weight: 900; 
		cursor: pointer; 
	}.
	
	.full-game-log-close:hover { 
		background: var(--neon-red); 
		color: white; 
	}
	
	#full-game-log-content { 
		flex: 1; 
		margin-top: 1cqh; 
		padding-right: 0.5cqw; 
		overflow-y: auto; 
	}
	
	.full-log-round {
		margin: 1cqh 0;
		padding: 0.8cqh 1cqh;
		color: var(--neon-gold);
		font-size: var(--ui-subtitle, 2.2cqh);
		font-weight: 900;
		text-align: center;
		border-bottom: 2px solid var(--neon-gold);
	}
	
	.full-log-stage {
		margin: 0.8cqh 0 0.4cqh;
		padding: 0.5cqh 0.8cqh;
		color: white;
		font-size: var(--ui-body, 1.7cqh);
		font-weight: 900;
		text-align: center;
		background: #3b2118;
		border-left: 4px solid #92400e;
		border-right: 4px solid #92400e

	}
		
	.full-log-entry { 
		margin: 0.25cqh 0; 
		padding: 0.45cqh 0.7cqh; 
		border-radius: 4px; 
		color: white; 
		font-size: var(--ui-caption, 1.4cqh); 
		box-sizing: border-box; 
	}
	
	.full-log-entry-line {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 1cqh;
		width: 100%;
	}

	.full-log-entry-text {
		flex: 1;
		min-width: 0;
	}

	.full-log-move-indicator {
		flex-shrink: 0;
		margin-left: auto;
		font-weight: 900;
		white-space: nowrap;
		letter-spacing: 0.04em;
	}
	
	.full-log-entry.turn-log-player { 
		background: rgba(187,247,208,0.88); 
		color: #052e16; 
		font-weight: 900; 
	}
	
	.full-log-entry.turn-log-enemy { 
		background: rgba(191,219,254,0.88); 
		color: #172554; 
		font-weight: 900; 
	}
	
	.full-log-entry.turn-log-neutral {
		width: 78%;
		margin-left: auto;
		padding-right: 0.8cqh;
		background: rgba(255,255,255,0.04);
		color: #d1d5db;
		text-align: right;
		border-right: 2px solid #9ca3af;
	}
	
	/* === FULL GAME LOG MSTACK INDENTATION === */
	.full-log-mstack-entry {
		width: calc(100% - 8%);
		margin-left: 8%;
		box-sizing: border-box;
	}

	/* Results belonging to an MSTACK resolve sit one level deeper. */
	.full-log-mstack-result {
		width: calc(100% - 16%);
		margin-left: 16%;
		box-sizing: border-box;
	}
	
	
		
        /* Tutorial guidance stays beside the board and scales with the game container. */
        #tutorial-guide[hidden], #tutorial-lessons[hidden] { display: none !important; }
        #tutorial-guide { position: absolute; left: 2cqh; bottom: 2cqh; width: 47cqh; max-width: 28cqw; box-sizing: border-box; z-index: 9000; padding: 1.5cqh; border: 1px solid #6b7280; border-radius: 1.5cqh; background: rgba(15,23,42,.97); color: #d1d5db; font-size: var(--ui-subtitle, 1.8cqh); line-height: 1.35; }
        .tutorial-guide-head { display: flex; justify-content: space-between; align-items: center; gap: 1cqh; color: #9ca3af; font-size: var(--ui-caption, 1.3cqh); }
        #tutorial-context { font-size: var(--ui-caption, 1.3cqh); color: #9ca3af; margin: .8cqh 0; }
        #tutorial-title { font-size: var(--ui-subtitle, 2.2cqh); font-weight: 700; color: #e5e7eb; margin: .8cqh 0; }
        #tutorial-instruction, #tutorial-explanation { margin: .8cqh 0; }
        #tutorial-explanation { color: #9ca3af; border-top: 1px solid #374151; padding-top: .8cqh; }
        #tutorial-status { color: #9ca3af; font-size: var(--ui-caption, 1.3cqh); margin: .8cqh 0; }
        .tutorial-actions { display: flex; flex-wrap: wrap; gap: .6cqh; margin-top: 1cqh; }
        .tutorial-button { padding: .5cqh .8cqh; background: #1f2937; border: 1px solid #6b7280; border-radius: .6cqh; color: #d1d5db; font: inherit; font-size: var(--ui-caption, 1.3cqh); cursor: pointer; }
        .tutorial-button:hover, .tutorial-button:focus-visible { background: #374151; outline: 1px solid #d1d5db; }
        #tutorial-guide.collapsed .tutorial-guide-body { display: none; }
        .tutorial-highlight { outline: none !important; }
        #tutorial-lessons { position: absolute; inset: 0; z-index: 11000; display: flex; align-items: center; justify-content: center; background: rgba(2,6,23,.82); }
        .tutorial-lesson-panel { width: 80cqh; max-width: 90cqw; max-height: 85cqh; overflow: auto; box-sizing: border-box; padding: 3cqh; border: 1px solid #6b7280; border-radius: 2cqh; background: #0f172a; color: #d1d5db; font-size: var(--ui-subtitle, 2cqh); line-height: 1.5; }
        #tutorial-lesson-select { width: 100%; margin: 1cqh 0; padding: 1cqh; background: #1f2937; color: #d1d5db; border: 1px solid #6b7280; border-radius: .6cqh; font: inherit; }
        .tutorial-lesson-label { color: #9ca3af; font-size: var(--ui-body, 1.6cqh); margin-top: 2cqh; }
        body.tutorial-running #turn-log { max-height: 22cqh; }
        body.tutorial-running #card-preview-container { position: absolute; bottom: calc(var(--tutorial-guide-height, 32cqh) + 3cqh); z-index: 9500; }
        body.tutorial-running.tutorial-reading-log #tutorial-guide { z-index: 31000; }
        body.tutorial-running.tutorial-reading-log #full-game-log-modal { justify-content: flex-end; padding-right: 2cqw; box-sizing: border-box; }


  html.sukdulan-intro-open body > :not(#sukdulan-starting-screen):not(script):not(style) { visibility: hidden !important; }
  #sukdulan-starting-screen { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #050916; color: #edf6ff; overflow: hidden; }
  #sukdulan-starting-screen::backdrop { background: #050916; }
  #sukdulan-starting-screen.sukdulan-revealing::backdrop { background: transparent; }
  #sukdulan-starting-frame { display: block; width: 100%; height: 100%; border: 0; background: #050916; }
  #sukdulan-back-to-lobby { position: absolute; top: 3cqh; left: 1cqw; padding: .8cqh 1cqw; border: 1px solid #7096ad77; border-radius: 5px; background: #101d30; color: #9db6cc; font: 600 var(--ui-caption, 1.2cqh) 'Segoe UI', sans-serif; letter-spacing: 1px; cursor: pointer; }
  #sukdulan-back-to-lobby[hidden] { display: none; }
  #sukdulan-back-to-lobby:hover { color: #d6f4ff; border-color: #8ce4ff; }
  #sukdulan-back-to-lobby:focus-visible { outline: 2px solid #8ce4ff; outline-offset: 3px; }
  #sukdulan-online-pause { position: fixed; inset: 0; z-index: 200000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: #060e20df; backdrop-filter: blur(8px); color: #c6eafa; font: var(--ui-body, 14px) 'Segoe UI', sans-serif; }
  #sukdulan-online-pause[hidden] { display: none; }
  #sukdulan-online-pause button { padding: 12px 20px; border: 1px solid #90daf266; border-radius: 6px; background: #18314a; color: #b7eaff; cursor: pointer; }


  #sukdulan-preparation-toolbar { position:absolute; top:2.2cqh; left:1cqw; display:flex; align-items:flex-end; gap:.7cqw; max-width:31cqw; z-index:110; }
  #sukdulan-preparation-toolbar[hidden] { display:none; }
  #sukdulan-preparation-toolbar #sukdulan-back-to-lobby { position:static; flex-shrink:0; min-height:3.7cqh; }
  .constructed-deck-field { display:flex; flex-direction:column; gap:.25cqh; min-width:0; color:#a6c9da; font:600 var(--ui-caption, .85cqh) 'Segoe UI',sans-serif; letter-spacing:.06cqw; }
  #constructed-deck-select { width:15cqw; min-width:10cqw; height:3.7cqh; padding:0 .6cqw; border:1px solid #7096ad77; border-radius:5px; background:#101d30; color:#d6f4ff; font:600 var(--ui-caption, 1.2cqh) 'Segoe UI',sans-serif; text-overflow:ellipsis; }
  #constructed-deck-select option { background:#101d30; color:#d6f4ff; }
  #constructed-deck-refresh { flex-shrink:0; height:3.7cqh; width:2.5cqw; padding:0; border:1px solid #7096ad77; border-radius:5px; background:#101d30; color:#b7eaff; font:bold var(--ui-subtitle, 2cqh) 'Segoe UI',sans-serif; cursor:pointer; }
  #constructed-deck-select:disabled, #constructed-deck-refresh:disabled { opacity:.55; cursor:not-allowed; }
  #constructed-deck-select:focus-visible, #constructed-deck-refresh:focus-visible { outline:2px solid #8ce4ff; outline-offset:2px; }
  #constructed-deck-status { position:absolute; top:100%; left:0; padding-top:.35cqh; width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#b7eaff; font:var(--ui-caption, 1cqh) 'Segoe UI',sans-serif; }

/* Center the Deck Construction panels within the portal scene. */
#preparation-screen {
  align-items: center;
  justify-content: center;
  gap: 1.2cqh;
  padding: 2.6cqh 3cqw;
  background: transparent;
  isolation: isolate;
}
/* Fill the viewport without changing the game board or card proportions. */
#preparation-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: #07101f;
  background-image: linear-gradient(110deg, #04101ee8, #071629cf 48%, #10152ce3), url('lobby/assets/portal-background.png');
  background-position: center, center 58%;
  background-size: cover;
  background-repeat: no-repeat;
}
#preparation-screen .prep-header {
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
  color: #ccefff;
  font: 600 var(--ui-title, 3cqh)/1.4 'Bahnschrift', 'Segoe UI', sans-serif;
  letter-spacing: .32cqh;
  text-shadow: 0 2px 16px #78caff40;
}
#preparation-screen .prep-layout {
  flex: 0 1 84cqh;
  width: min(100%, 196cqh);
  min-width: 0;
  gap: 1.6cqw;
  align-items: stretch;
  justify-content: center;
}
#preparation-screen .prep-panel,
#preparation-screen .prep-panel.active,
#preparation-screen .db-panel {
  min-width: 0;
  background: linear-gradient(145deg, #142d42ed, #091426f5);
  box-shadow: 0 12px 36px #0005, inset 0 1px #a0dcf510;
  backdrop-filter: blur(14px);
}
#preparation-screen #panel-player.active { box-shadow: 0 0 18px #39ff1425, inset 0 1px #9bff8a18; }
#preparation-screen #panel-enemy.active { box-shadow: 0 0 18px #ef444425, inset 0 1px #ff989818; }
#preparation-screen .db-panel { border-color: #80bfdb70; }
#preparation-screen .panel-title { color: #bde9f8; font-size: var(--ui-subtitle, 2.15cqh); letter-spacing: .15cqh; }
#preparation-screen .prep-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 1.6cqw;
  flex: 0 0 auto;
  width: min(100%, 196cqh);
  min-height: 3.8cqh;
  padding: 0;
}
#preparation-screen .prep-actions > :nth-child(1) { grid-column: 1; grid-row: 1; }
#preparation-screen .prep-actions > :nth-child(2) { grid-column: 2; grid-row: 1; }
#preparation-screen .prep-actions > :nth-child(3) { grid-column: 3; grid-row: 1; }
#preparation-screen #player-deck-buttons[hidden],
#preparation-screen #random-player-btn[hidden],
#preparation-screen #clear-player-btn[hidden] { display: none; }

@property --tutorial-cue-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
#tutorial-visual-cues { position: fixed; inset: 0; z-index: 2000000; overflow: visible; pointer-events: none !important; user-select: none; }
#tutorial-visual-cues[hidden], #tutorial-visual-cues [hidden] { display: none !important; }
#tutorial-visual-cues * { pointer-events: none !important; box-sizing: border-box; }
.tutorial-cue-border {
  position: absolute;
  padding: 3px;
  background: conic-gradient(from var(--tutorial-cue-angle), #79dfff70, #8defffaa 60deg, #fff 105deg, #7befff 135deg, #79dfff40 200deg, #79dfff70);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  filter: drop-shadow(0 0 5px #66dfff99);
  animation: tutorial-border-orbit 2.8s linear infinite;
}
.tutorial-cue-border.primary { padding: 4px; background: conic-gradient(from var(--tutorial-cue-angle), #ffcf5977, #ffe490bb 60deg, #fff 110deg, #fff1a2 140deg, #ffcf5955 210deg, #ffcf5977); filter: drop-shadow(0 0 7px #ffd86ba6); }
.tutorial-cue-pointer { position: absolute; width: 42px; height: 54px; transform: translate(-7px,-4px); }
.tutorial-cue-cursor { position: relative; width: 42px; height: 54px; animation: tutorial-pointer-click 1.8s ease-in-out infinite; transform-origin: 7px 4px; }
.tutorial-cue-cursor svg { display: block; width: 42px; height: 54px; filter: drop-shadow(0 2px 4px #000b) drop-shadow(0 0 5px #ffe3a888); }
.tutorial-cue-click-ring { position: absolute; left: -5px; top: -8px; width: 24px; height: 24px; border: 2px solid #ffe99f; border-radius: 50%; box-shadow: 0 0 10px #ffdc6699; animation: tutorial-click-ripple 1.8s ease-out infinite; }
.tutorial-cue-label { position: absolute; left: 27px; top: 39px; padding: 5px 8px; border: 1px solid #f3db8a80; border-radius: 5px; background: #091522f5; color: #fff0b5; font: 700 var(--ui-caption, 10px)/1.2 'Segoe UI', sans-serif; letter-spacing: .7px; white-space: nowrap; box-shadow: 0 3px 14px #0008; }
.tutorial-cue-label.above { top: -29px; }
.tutorial-cue-label.align-left { left: auto; right: 35px; }
.tutorial-cue-pointer[data-action="right"] .tutorial-cue-label { color: #b8efff; border-color: #8fddff99; }
.tutorial-cue-pointer[data-action="drag"] .tutorial-cue-cursor { animation: tutorial-pointer-drag 2.6s ease-in-out infinite; }
.tutorial-cue-pointer[data-action="drag"] .tutorial-cue-click-ring { animation-duration: 2.6s; }
@keyframes tutorial-border-orbit { to { --tutorial-cue-angle: 360deg; } }
@keyframes tutorial-pointer-click { 0%,65%,100% { transform: translate(10px,10px); } 20%,45% { transform: translate(0,0); } 30% { transform: translate(0,0) scale(.9); } }
@keyframes tutorial-click-ripple { 0%,18% { opacity: 0; transform: scale(.35); } 28% { opacity: 1; transform: scale(.6); } 65%,100% { opacity: 0; transform: scale(1.8); } }
@keyframes tutorial-pointer-drag { 0%,15% { opacity: 1; transform: translate(0,0); } 23% { transform: translate(0,0) scale(.9); } 65%,82% { opacity: 1; transform: translate(var(--tutorial-drag-x),var(--tutorial-drag-y)); } 94%,100% { opacity: 0; transform: translate(var(--tutorial-drag-x),var(--tutorial-drag-y)); } }
@media (prefers-reduced-motion: reduce) {
  .tutorial-cue-border,.tutorial-cue-cursor,.tutorial-cue-pointer[data-action="drag"] .tutorial-cue-cursor { animation: none; }
  .tutorial-cue-click-ring { display: none; }
}
/* Back resumes the current match; Exit Match uses the existing lobby return. */
.match-menu-panel { width: min(42cqh,90cqw); height: auto; min-height: 18cqh; padding: 2cqh; }
.match-menu-actions { flex-flow: column nowrap; width: 100%; align-items: stretch; gap: 1cqh; }
.match-menu-actions > .match-menu-control { flex: 0 0 auto; width: 100%; min-width: 0; padding: .9cqh 1cqh; font-size: var(--ui-body, 1.7cqh); white-space: nowrap; }
#match-menu-exit { order: 10; }

/* All game modes share the same Deck Construction layout. */
#preparation-screen .prep-header {
  min-height: 6cqh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
#preparation-screen #sukdulan-preparation-toolbar {
  top: 2.6cqh;
  left: max(3cqw, calc((100cqw - 196cqh) / 2));
}
#preparation-screen .prep-panel > .panel-title {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 4.5cqh;
  margin: 0 0 1cqh;
  padding: 0 0 .6cqh;
  flex-shrink: 0;
  border-bottom: 0;
}
#preparation-screen #panel-enemy > .enemy-panel-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: .7cqh;
}
#preparation-screen .enemy-panel-title-row > span:not(.enemy-mode-label) {
  grid-column: 2;
  grid-row: 1;
  white-space: nowrap;
}
#preparation-screen .enemy-panel-title-row .enemy-strategy-select,
#preparation-screen .enemy-panel-title-row .enemy-mode-label {
  position: static;
  top: auto;
  transform: none;
  min-width: 0;
  max-width: 100%;
  height: 3.5cqh;
  padding: 0 .6cqh;
  font-size: var(--ui-caption, 1.15cqh);
  letter-spacing: .05cqh;
}
#preparation-screen .enemy-panel-title-row .enemy-strategy-select {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
}
#preparation-screen .enemy-panel-title-row .enemy-mode-label {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  width: 10.5cqh;
}
#preparation-screen #panel-player .prep-deck-cards,
#preparation-screen #panel-enemy .prep-deck-cards {
  justify-content: flex-start;
  padding-top: .8cqh;
}
#preparation-screen .prep-slot,
#preparation-screen .prep-card {
  box-sizing: border-box;
  flex-shrink: 0;
}
#preparation-screen .slots-container {
  gap: .8cqh;
}
#preparation-screen #player-heroes,
#preparation-screen #enemy-heroes {
  margin-bottom: 1.2cqh;
}
#preparation-screen .db-cards-scroll {
  display: block;
  padding: .8cqh 0 0;
  overflow-x: hidden;
}
#preparation-screen .db-cards-scroll > .slots-container {
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  align-content: start;
}
#preparation-screen .prep-deck-footer {
  min-height: 2.2cqh;
  padding-top: .2cqh;
}

.player-name-link { cursor:pointer; text-decoration:underline; text-decoration-color:transparent; text-underline-offset:3px; }
.player-name-link:hover { color:#c6f2ff; text-decoration-color:currentColor; }
.player-name-link:focus-visible { outline:2px solid #93d6ec; outline-offset:3px; border-radius:3px; }
.player-actions-dialog { box-sizing:border-box; width:min(360px,calc(100vw - 32px)); max-height:calc(100dvh - 32px); overflow:auto; padding:22px; margin:auto; border:1px solid #7eb8d17a; border-radius:14px; background:linear-gradient(145deg,#193348,#0b172b); color:#dbf0fa; box-shadow:0 20px 80px #0008; font:var(--ui-body, 14px)/1.5 'Segoe UI',sans-serif; user-select:text; }
.player-actions-dialog::backdrop { background:#01091599; backdrop-filter:blur(5px); }
.player-actions-heading { display:flex; align-items:center; gap:12px; }
.player-actions-heading h3 { flex:1; min-width:0; margin:0; overflow-wrap:anywhere; font-size: var(--ui-heading, 20px); }
.player-actions-close { flex-shrink:0; width:32px; height:32px; border:1px solid #7dabc255; border-radius:6px; color:#a9c6d7; background:transparent; cursor:pointer; font-size: var(--ui-heading, 21px); }
.player-actions-id { color:#9bc6dc; margin:8px 0; overflow-wrap:anywhere; font-size: var(--ui-caption, 11px); letter-spacing:.5px; }
.player-actions-status { min-height:22px; margin:12px 0; color:#a5bfd1; font-size: var(--ui-caption, 12px); }
.player-actions-buttons { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.player-actions-buttons button { min-height:40px; border:1px solid #8ad8ea66; border-radius:6px; background:#36809e29; color:#c8f2ff; font:600 var(--ui-caption, 11px) 'Segoe UI',sans-serif; letter-spacing:.7px; cursor:pointer; }
.player-actions-buttons button:disabled { opacity:.5; cursor:default; }
.player-profile-overlay { background:transparent !important; }
:root:has(>body.player-profile-overlay) { background:transparent; color-scheme:normal; }
.player-profile-overlay > .scene,.player-profile-overlay > .intro,.player-profile-overlay > #lobby,.player-profile-overlay > #loading-screen { visibility:hidden; pointer-events:none; }
#sukdulan-starting-screen.sukdulan-player-overlay,#sukdulan-starting-screen.sukdulan-player-overlay iframe { background:transparent; }
#sukdulan-starting-screen.sukdulan-player-overlay::backdrop { background:#01091599; }
.bond-example { display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:12px 0; }
.bond-example div { padding:14px; border:1px solid #709cb440; border-radius:7px; background:#08172780; }
.bond-example dt { color:#9bb7cb; font-size: var(--ui-caption, 11px); }
.bond-example dd { margin:6px 0 0; color:#d3eef8; font-size: var(--ui-body, 13px); }
.encountered-kind { display:block; margin-top:4px; color:#829db6; font-size: var(--ui-caption, 10px); }
#encountered-players li > span { flex:1; min-width:0; }
.connection-player-name { padding:0; border:0; background:transparent; color:inherit; text-align:left; font:inherit; }
.match-player-names { flex-shrink:0; padding-top:.6cqh; border-top:1px solid #9bc5da30; color:#a8c6d9; text-align:center; font:600 var(--ui-caption, 1.2cqh)/1.5 'Segoe UI',sans-serif; overflow-wrap:anywhere; }
.match-player-names[hidden] { display:none; }
#turn-log.active:has(.match-player-names:not([hidden])) { display:flex; flex-direction:column; }
#turn-log:has(.match-player-names:not([hidden])) .turn-log-head { flex-shrink:0; }
#turn-log:has(.match-player-names:not([hidden])) #turn-log-list { flex:1; min-height:0; height:auto; }

/* Narration controls use the existing tutorial panel and never cover the board. */
.tutorial-voice-controls{display:flex;align-items:center;flex-wrap:wrap;gap:.6cqh;margin-top:.9cqh;padding-top:.8cqh;border-top:1px solid #47556966}
.tutorial-voice-controls .tutorial-button[aria-pressed="false"]{color:#9ca3af}
.tutorial-voice-controls .tutorial-button:disabled{opacity:.4;cursor:default}
.tutorial-voice-status{flex-basis:100%;font-size: var(--ui-caption, 1.25cqh);line-height:1.4;color:#9ca3af;margin:0}
.tutorial-voice-status[hidden]{display:none}

.battle-music-controls{margin-top:1.5cqh;padding-top:1.4cqh;border-top:1px solid #31516b;display:flex;align-items:center;gap:1cqh;flex-wrap:wrap;color:#b1d2e4;font-size:1.5cqh}
.battle-music-controls label{font-weight:700;letter-spacing:.08em}
.battle-music-controls input{flex:1;min-width:8cqh;accent-color:#85d4f5}
.battle-music-controls button{padding:.6cqh 1cqh;border:1px solid #477b94;border-radius:.5cqh;background:#0a1b2b;color:#c7e6f4;font:inherit;cursor:pointer}
.battle-music-controls p{flex-basis:100%;margin:0;color:#91a8bb;font-size:1.25cqh}.battle-music-controls [hidden]{display:none}

.match-result-audio-retry{position:fixed;right:2cqh;bottom:2cqh;z-index:10000000;background:#0c2035;color:#c4eaff;border:1px solid #65bbdf;border-radius:.6cqh;padding:1cqh 1.5cqh;font:inherit;font-size: var(--ui-caption, 1.5cqh);font-weight:700;cursor:pointer}.match-result-audio-retry[hidden]{display:none}

/* Extend the arena backdrop beyond the fixed-ratio board. */
html {
  background-color: #030712;
  background-image: radial-gradient(ellipse at center, rgba(6,182,212,.10), transparent 70%), linear-gradient(rgba(6,182,212,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(6,182,212,.05) 1px, transparent 1px);
  background-size: auto, 40px 40px, 40px 40px;
  background-position: center;
}
body { background-color: transparent; }
.playmat { background-color: transparent; background-image: none; }

/* Deck Construction uses the game's single proportional canvas at every viewport size. */
#preparation-screen {
  position: absolute;
  inset: 0;
  transform: none;
  width: 100%;
  height: 100%;
  padding: 2cqh 4cqw;
  gap: 1cqh;
  --prep-control-height: 4.1cqh;
  --prep-control-font: 600 var(--ui-caption, 1.3cqh)/1.35 'Segoe UI', Inter, sans-serif;
}
#preparation-screen .prep-header {
  min-height: 6.3cqh;
  font-size: var(--ui-title, 3cqh);
  line-height: 1.4;
}
#preparation-screen .prep-layout,
#preparation-screen .prep-actions {
  width: min(100%, 190cqh);
  gap: 1.5cqw;
}
#preparation-screen .prep-layout { flex: 1 1 0; }
#preparation-screen .prep-panel {
  flex: 1 1 0;
  padding: 1.5cqh;
  border-radius: 1.3cqh;
}
#preparation-screen .prep-panel > .panel-title {
  box-sizing: border-box;
  min-height: 4.7cqh;
  margin: 0 0 .6cqh;
  padding: 0 0 .3cqh;
}
#preparation-screen button:not(.prep-slot, .prep-card),
#preparation-screen select,
#preparation-screen .enemy-mode-label {
  box-sizing: border-box;
  height: var(--prep-control-height);
  min-height: var(--prep-control-height);
  min-width: 0;
  max-width: 100%;
  padding: .7cqh 1.2cqh;
  border-radius: .75cqh;
  font: var(--prep-control-font);
  letter-spacing: .035cqh;
  white-space: nowrap;
  text-align: center;
}
#preparation-screen .prep-actions { min-height: var(--prep-control-height); }
#preparation-screen .prep-actions .btn-group { gap: .8cqh; }
#preparation-screen .prep-actions .btn-group > button { flex: 1 1 0; width: auto; }
#preparation-screen .prep-actions .start-btn { width: 28cqh; }
#preparation-screen .db-tabs { gap: .8cqh; margin-bottom: 1cqh; }
#preparation-screen .db-tab { flex: 1 1 0; }
#preparation-screen .enemy-panel-title-row .enemy-strategy-select,
#preparation-screen .enemy-panel-title-row .enemy-mode-label { padding-inline: .6cqh; font-size: var(--ui-caption, 1.15cqh); }
#preparation-screen .enemy-panel-title-row .enemy-mode-label { width: 10.5cqh; }
#preparation-screen #panel-player .prep-deck-cards,
#preparation-screen #panel-enemy .prep-deck-cards {
  box-sizing: border-box;
  justify-content: flex-start;
  padding: .6cqh 0 0;
  overflow: hidden;
}
#preparation-screen .prep-deck-footer { min-height: 4.4cqh; }
#preparation-screen #player-heroes,
#preparation-screen #enemy-heroes { margin-bottom: 1.1cqh; }
#preparation-screen .prep-deck-status { font-size: var(--ui-caption, 1.1cqh); }
#preparation-screen #sukdulan-preparation-toolbar {
  top: 2cqh;
  left: max(4cqw, calc((100cqw - 190cqh) / 2));
  gap: .7cqh;
  max-width: 32cqw;
}
#preparation-screen .constructed-deck-field { gap: .25cqh; font-size: var(--ui-caption, .95cqh); letter-spacing: .05cqh; }
#preparation-screen #constructed-deck-select { width: 26cqh; text-align: left; }
#preparation-screen #constructed-deck-refresh {
  flex: 0 0 var(--prep-control-height);
  width: var(--prep-control-height);
  padding: 0;
  font-size: var(--ui-subtitle, 2cqh);
}
#preparation-screen #constructed-deck-status { font-size: var(--ui-caption, 1cqh); padding-top: .35cqh; }
#preparation-screen button:focus-visible,
#preparation-screen select:focus-visible { outline: .2cqh solid #9be5ff; outline-offset: .3cqh; }
/* The scene fills the viewport while the controls stay on the fitted game canvas. */
html:has(#preparation-screen:not([style*="display: none"]):not([style*="display:none"])) {
  background-color: #07101f;
  background-image: linear-gradient(110deg, #04101ee8, #071629cf 48%, #10152ce3), url('lobby/assets/portal-background.png');
  background-position: center, center 58%;
  background-size: cover;
  background-repeat: no-repeat;
}
#preparation-screen::before { background: none; }

/* Strategy shares the bottom action row with Start Battle. */
#preparation-screen .prep-enemy-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  min-width: 0;
}
#preparation-screen .prep-enemy-actions > * { grid-column: 1; grid-row: 1; }
#preparation-screen .prep-enemy-actions .enemy-strategy-select {
  position: static;
  inset: auto;
  transform: none;
  width: 28cqh;
  max-width: 100%;
}
#preparation-screen:has(#panel-enemy:not([data-enemy-mode="ai"])) .prep-enemy-actions .enemy-strategy-select { display: none; }

/* Keep slot groups horizontally centered with a common first-row baseline. */
#preparation-screen .prep-deck-cards > .slots-container { flex: 0 0 auto; }
#preparation-screen .db-cards-scroll {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  padding: .6cqh 0 0;
}
#preparation-screen .db-cards-scroll > .slots-container {
  flex: 0 0 auto;
  margin: 0 auto;
}

/* A small increase uses spare canvas height while retaining the card proportions. */
#preparation-screen .prep-slot,
#preparation-screen .prep-card {
  width: 7.725cqh;
  height: 10.815cqh;
}

/* Equal-height headings preserve the common first slot row. */
#preparation-screen .db-panel > .db-panel-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1cqh;
}
#preparation-screen .db-panel-title > span { flex: 0 0 auto; white-space: nowrap; }
#preparation-screen .db-tabs-footer .db-tabs { flex: 0 0 auto; min-width: 0; width: 100%; margin: 0; }

/* Mode controls use the button type style; panel headings retain their original font. */
#preparation-screen .enemy-panel-title-row .enemy-mode-label {
  font: var(--prep-control-font);
  letter-spacing: .035cqh;
}

/* Keep deck status readable and anchored to the bottom of each deck panel. */
#preparation-screen .prep-deck-footer {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin-top: auto;
}
#preparation-screen .prep-deck-status {
  margin: .4cqh 0 0;
  font: var(--ui-caption, 1.25cqh)/1.4 'Segoe UI', sans-serif;
}
/* Every bottom action has the same dimensions, including the AI strategy selector. */
#preparation-screen .prep-actions .btn-group > button {
  flex: 0 0 28cqh;
  width: 28cqh;
}
#preparation-screen .prep-enemy-actions .enemy-strategy-select {
  background: #101d30;
  color: #9db6cc;
  border: 1px solid #7096ad77;
  box-shadow: none;
  font: var(--prep-control-font);
}
#preparation-screen .prep-enemy-actions .enemy-strategy-select:hover:not(:disabled),
#preparation-screen .prep-enemy-actions .enemy-strategy-select:focus {
  color: #d6f4ff;
  border-color: #8ce4ff;
  background: #18314a;
  box-shadow: none;
}
/* Tutorial keeps its guided decks and Modes control without construction choices. */
#preparation-screen:has(#panel-enemy[data-enemy-mode="tutorial"]) .constructed-deck-field,
#preparation-screen:has(#panel-enemy[data-enemy-mode="tutorial"]) #constructed-deck-refresh,
#preparation-screen:has(#panel-enemy[data-enemy-mode="tutorial"]) #constructed-deck-status { display: none; }
#preparation-screen:has(#panel-enemy[data-enemy-mode="tutorial"]) .db-panel { visibility: hidden; }

/* Card-type controls sit at the bottom of the available-card panel. */
#preparation-screen .db-tabs-footer .db-tabs { align-items: center; }
/* Tutorial's only start action occupies the empty center of the window. */
#preparation-screen:has(#panel-enemy[data-enemy-mode="tutorial"]) .prep-start-actions {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  grid-area: auto;
  width: 28cqh;
}

/* Tutorial victory debrief, following the opening scene's portal composition. */
#tutorial-victory-ending{box-sizing:border-box;width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;padding:0;border:0;border-radius:0;background:#020813;color:#edf7ff;overflow:hidden;opacity:0;transition:opacity .45s ease;font-family:Rajdhani,"Segoe UI",sans-serif}
#tutorial-victory-ending[open]{display:grid;place-items:center}#tutorial-victory-ending.is-visible{opacity:1}#tutorial-victory-ending::backdrop{background:#020813}
#tutorial-victory-ending .tutorial-ending-stage{position:relative;width:min(100vw,calc(100dvh * 16 / 9));aspect-ratio:16/9;max-height:100dvh}
#tutorial-victory-ending .tutorial-ending-art{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
#tutorial-victory-ending .tutorial-ending-panel{box-sizing:border-box;position:absolute;left:3.5%;top:25%;width:33%;padding:clamp(16px,2vw,34px);border:1px solid #34d9acb3;border-radius:3px 16px 3px 16px;background:linear-gradient(145deg,#03121cf0,#03121ce6);box-shadow:0 12px 50px #0005;backdrop-filter:blur(4px)}
#tutorial-victory-ending header{padding-bottom:clamp(10px,1.2vw,22px);border-bottom:1px solid #76c6cf66}
#tutorial-victory-ending h2{margin:0;color:#5af4bd;font-size:clamp(17px,1.65vw,29px);font-weight:650;letter-spacing:clamp(2px,.35vw,6px)}
#tutorial-victory-ending header p{margin:5px 0 0;color:#9daabb;font-size:clamp(10px,1.1vw,19px);letter-spacing:.5px}
#tutorial-victory-ending #tutorial-ending-dialogue{margin:clamp(14px,1.6vw,28px) 0;min-height:clamp(150px,13vw,230px);font-size:clamp(16px,1.65vw,29px);line-height:1.45;white-space:pre-line;color:#f0f5fb}
#tutorial-victory-ending nav{display:flex;align-items:center;justify-content:space-between;gap:10px}
#tutorial-victory-ending button{box-sizing:border-box;display:inline-block;flex:none;width:auto;height:auto;min-width:0;min-height:0;margin:0;padding:8px 10px;background:#03101d70;border:1px solid #7ab8b844;border-radius:4px;color:#d6e6ee;font-family:inherit;font-size: var(--ui-body, clamp(10px,.7vw,13px));font-weight:600;letter-spacing:.6px;line-height:1.3;cursor:pointer;transform:none;text-transform:none}
#tutorial-victory-ending button:focus-visible{outline:2px solid #77f3cb;outline-offset:3px}#tutorial-victory-ending button:disabled{opacity:.35;cursor:default}
#tutorial-victory-ending #tutorial-ending-next{border-color:#45e0ab88;color:#77f3cb}
#tutorial-victory-ending #tutorial-ending-progress{font-size: var(--ui-caption, clamp(10px,.7vw,12px));color:#8ba8b9;font-variant-numeric:tabular-nums;white-space:nowrap}
#tutorial-victory-ending #tutorial-ending-skip{position:absolute;right:3%;bottom:3%;color:#b1c1ce}
@media(max-width:1000px) and (orientation:landscape){#tutorial-victory-ending .tutorial-ending-panel{top:12%;left:3%;width:39%;padding:16px}#tutorial-victory-ending #tutorial-ending-dialogue{font-size:clamp(13px,1.8vw,19px);min-height:145px;margin:13px 0}#tutorial-victory-ending header{padding-bottom:10px}#tutorial-victory-ending h2{font-size:17px}#tutorial-victory-ending header p{font-size:11px}}
@media(max-width:760px) and (orientation:portrait){#tutorial-victory-ending .tutorial-ending-stage{width:100vw;height:100dvh;aspect-ratio:auto}#tutorial-victory-ending .tutorial-ending-art{object-fit:cover;object-position:69% center}#tutorial-victory-ending .tutorial-ending-panel{left:5%;top:auto;bottom:9%;width:90%;padding:20px}#tutorial-victory-ending #tutorial-ending-dialogue{font-size: var(--ui-heading, 19px);min-height:160px;margin:17px 0}#tutorial-victory-ending h2{font-size:21px}#tutorial-victory-ending header p{font-size:13px}#tutorial-victory-ending button{font-size:11px}#tutorial-victory-ending #tutorial-ending-skip{right:5%;bottom:2.5%}}
@media(prefers-reduced-motion:reduce){#tutorial-victory-ending{transition:none}}

#tutorial-victory-ending .tutorial-ending-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}
#tutorial-victory-ending #tutorial-ending-voice-toggle{font-size: var(--ui-caption, clamp(9px,.6vw,11px));padding:6px 8px;color:#b4d4dd}
#tutorial-victory-ending #tutorial-ending-status{font-size: var(--ui-caption, 12px);color:#a5c1cc;margin:12px 0 0}
#tutorial-victory-ending #tutorial-ending-status:empty{display:none}

#playmat .skip-draw-lock svg{display:block;width:4cqmin;height:4cqmin;overflow:visible}

/* Shared match-clock and surrender styles. */
#match-move-clock{position:fixed;right:13.5cqw;top:65cqh;transform:translateX(50%);width:16cqw;box-sizing:border-box;padding:.8cqh 1cqw 1.1cqh;border:1px solid #6ccdd979;border-radius:6px;background:#081521ec;color:#c1e8ef;z-index:9998;display:flex;align-items:center;justify-content:space-between;gap:8px;font:700 var(--ui-caption, 1.45cqh) Rajdhani, sans-serif;letter-spacing:.08em;overflow:hidden}
#match-move-clock[hidden]{display:none}#match-move-clock strong{font-size: var(--ui-heading, 2.3cqh);font-variant-numeric:tabular-nums;letter-spacing:.07em}
#match-move-clock i{position:absolute;bottom:0;left:0;right:0;height:3px;background:#71dae8;transform:scaleX(var(--remaining,1));transform-origin:left}
#match-move-clock[data-urgent="true"]{border-color:#ff6c69;color:#ffb3af}#match-move-clock[data-urgent="true"] i{background:#ff6c69}
#match-menu-surrender,#match-surrender-dialog [data-confirm]{color:#ffb8b3;border-color:#e96863;background:#361d28}
#match-surrender-dialog{width:min(380px,calc(100vw - 32px));box-sizing:border-box;border:1px solid #e9686380;border-radius:12px;padding:26px;background:#0d1e30;color:#d6edf6;font:var(--ui-subtitle, 15px) Rajdhani, sans-serif;box-shadow:0 16px 70px #000b;z-index:220000}
#match-surrender-dialog::backdrop{background:#000b;backdrop-filter:blur(4px)}#match-surrender-dialog h2{font-size: var(--ui-title, 24px);letter-spacing:.1em;margin:0 0 12px}#match-surrender-dialog p{color:#acc6d6;margin:0 0 22px}
#match-surrender-dialog button{padding:12px;border:1px solid #6db9d47a;border-radius:5px;background:#163247;color:#d6edf6;font:700 var(--ui-body, 14px) Rajdhani, sans-serif;cursor:pointer}
#match-forfeit-note{color:#b9d9e4;text-align:center;font-size: var(--ui-body, 14px);margin:0 0 12px}.move-timeout-running .active-playable{pointer-events:none!important}

/* V6.1: one turn-indicator panel contains its label and decision clock. */
#match-turn-status { position:absolute;right:var(--battle-hud-right);top:50cqh;transform:translate(50%,-50%);display:flex;align-items:center;justify-content:center;max-width:26cqw;z-index:9999;pointer-events:none; }
#match-turn-status .turn-box { position:static!important;inset:auto!important;transform:none!important;min-width:0;padding:1.2cqh 1cqw;font-size: var(--ui-subtitle, 2.2cqh);align-items:center;justify-content:center;gap:.7cqw;flex-wrap:wrap; }
#match-turn-status .turn-indicator-label { white-space:nowrap; }
#match-turn-status .turn-box[data-ai-thinking]::after { display:none; }
#match-turn-status .turn-box[data-ai-thinking] .turn-indicator-label::after { content:' · THINKING…';font-size: var(--ui-caption, 1.2cqh);letter-spacing:.04em;opacity:.8;animation:ai-think-pulse 1.2s ease-in-out infinite; }
#match-turn-status #match-move-clock { position:static;inset:auto;transform:none;flex:0 0 auto;width:auto;height:auto;min-width:2ch;padding:0 0 0 .7cqw;border:0;border-left:1px solid currentColor;border-radius:0;background:transparent;box-shadow:none;color:inherit;display:flex;align-items:center;justify-content:center;gap:0;letter-spacing:0;overflow:visible; }
#match-turn-status #match-move-clock[hidden] { display:none; }
#match-move-clock > span,#match-move-clock > i { display:none; }
#match-turn-status #match-move-clock strong { font:700 var(--ui-heading, 2.7cqh)/1 Rajdhani,sans-serif;font-variant-numeric:tabular-nums;letter-spacing:0;display:block; }
#match-turn-status #match-move-clock[data-urgent="true"] { color:#ffb3af; }
#match-move-clock strong.clock-pulse { animation:move-clock-count .65s ease-out; }
#match-move-clock[data-paused="true"] strong { animation:none; }
@keyframes move-clock-count { 0% { transform:scale(1.3);text-shadow:0 0 12px #ff6c69; } 100% { transform:scale(1);text-shadow:none; } }
@media (prefers-reduced-motion:reduce) { #match-move-clock strong.clock-pulse { animation:none; } }
/* Four matching HUD boxes; Heroes Left follows Penalty with an extra gap. */
.battle-hud-row { display:flex;align-items:center;justify-content:center;gap:1.3cqw;z-index:9999;pointer-events:none; }
.battle-hud-row[hidden] { display:none; }

.battle-hud-row .hud-container { position:static!important;inset:auto!important;transform:none!important;align-items:center;z-index:auto; }
.battle-hud-row .hud-box { flex:0 0 auto; }
.heroes-left-counter[hidden] { display:none; }
.heroes-left-counter .hud-label { white-space:nowrap; }
.battle-hud-row.player .heroes-left-counter { border-color:var(--neon-green);color:var(--neon-green);box-shadow:0 0 10px var(--neon-green-glow); }
.battle-hud-row.enemy .heroes-left-counter { border-color:var(--neon-red);color:var(--neon-red);box-shadow:0 0 10px var(--neon-red-glow); }
body.match-menu-open .battle-hud-row { visibility:hidden; }

.concealed-spawning { position:relative!important; }
.concealed-spawn-group {
    position:absolute;inset:0;display:flex;align-items:center;justify-content:center;
    gap:1.2cqw;z-index:1005;pointer-events:none;
}
.concealed-spawn-card {
    position:relative!important;left:auto!important;top:auto!important;right:auto!important;
    margin:0!important;transform:none!important;flex:0 0 auto;
    width:var(--card-width)!important;height:var(--card-height)!important;
    pointer-events:none!important;border:1px solid #91dfe2!important;box-sizing:border-box;
    box-shadow:0 0 12px #43c7cf66;
}

/* Concealed choices use the shared card back and never expose a preview or stat badge. */
.concealed-face-down { background-image:var(--concealed-card-back)!important;background-size:100% 100%!important;background-position:center!important;background-color:#081923!important;color:transparent!important; }
.concealed-face-down > * { visibility:hidden!important; }
/* Blind choices have identical artwork, layers and motion for both players. */
.concealed-face-down::before, .concealed-face-down::after { display:none!important; }
#act-zone .concealed-choice-group > .concealed-choice-card.concealed-face-down {
    animation:none!important;transition:none!important;filter:none!important;
    opacity:1!important;outline:none!important;box-shadow:none!important;
    border:1px solid #8fc5c7!important;transform:none!important;
    color:transparent!important;font-size:0!important;text-shadow:none!important;
}
#act-zone .concealed-choice-group > .concealed-choice-card.concealed-face-down.target-highlight {
    border-color:var(--neon-cyan)!important;box-shadow:0 0 14px var(--neon-cyan)!important;
}
.concealed-active { position:relative!important; }
.concealed-choice-group { position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:1.2cqw;z-index:1005; }
.concealed-choice-card { position:relative!important;left:auto!important;top:auto!important;right:auto!important;margin:0!important;transform:none!important;flex:0 0 auto;width:var(--card-width)!important;height:var(--card-height)!important;border:1px solid #8fc5c7!important;box-sizing:border-box;pointer-events:auto!important; }
.concealed-choice-card.target-highlight { border-color:var(--neon-cyan)!important;box-shadow:0 0 14px var(--neon-cyan)!important; }
.concealed-choice-label { position:absolute;left:50%;top:3%;transform:translateX(-50%);z-index:1006;color:#c4f2f3;font:bold var(--ui-body, 1.6cqh) Rajdhani,sans-serif;letter-spacing:.1em;pointer-events:none; }
.concealed-origin > * { visibility:hidden!important; }
.hero-zone > .attached-decoy { width:var(--card-width);height:var(--card-height);right:auto!important;border:2px solid var(--neon-cyan);border-radius:8px;box-sizing:content-box;background-size:cover;background-position:center;cursor:pointer; }
@media (prefers-reduced-motion:reduce) { .concealed-choice-card { animation:none!important;transition:none!important; } }

.concealed-choice-group { perspective:1000px; }
.concealed-choice-card.concealed-selected {
    transition:transform .18s ease;
    outline:2px solid #facc15;
    box-shadow:0 0 22px rgba(250,204,21,.7);
}
.concealed-choice-locked .concealed-choice-card { pointer-events:none!important; }
.concealed-choice-label[data-outcome="dummy"] { color:#facc15; }
.concealed-choice-label[data-outcome="hero"] { color:#fda4af; }
.concealed-strike-target {
    position:absolute!important;top:50%!important;left:50%!important;
    width:var(--card-width)!important;height:var(--card-height)!important;
    margin:0!important;transform:translate(-50%,-50%)!important;z-index:1005!important;
    pointer-events:none!important;border:2px solid #facc15;
}
.concealed-strike-label {
    top:-24%!important;width:max-content;max-width:70cqw;
    font-size: var(--ui-caption, 1.2cqh) !important;text-align:center;
}


.vfx-claw-rake {
    position:absolute;left:2%;top:1%;width:96%;height:98%;
    overflow:visible;pointer-events:none;z-index:10000;
    transform:scale(var(--claw-scale,1));transform-origin:50% 50%;
    filter:drop-shadow(0 0 var(--claw-glow,3px) #2b041ecc);
}
.vfx-claw-rake .claw-cut {
    clip-path:inset(0 0 100% 0);opacity:0;
    animation:claw-carve .72s cubic-bezier(.2,.75,.35,1) both;
}
.vfx-claw-rake .claw-wound {
    fill:var(--claw-core,#160817);stroke:var(--claw-edge,#d04766);
    stroke-width:1.8;stroke-linejoin:round;
}
.vfx-claw-rake .claw-rim {
    fill:none;stroke:#f8c9bc;stroke-width:.85;stroke-linecap:round;opacity:.85;
}
.vfx-claw-rake.claw-impact .claw-wound { animation:claw-impact .24s ease-out both; }
@keyframes claw-carve {
    0% {clip-path:inset(0 0 100% 0);opacity:.25;}
    48% {clip-path:inset(0 0 0 0);opacity:1;}
    82% {clip-path:inset(0 0 0 0);opacity:1;}
    100% {clip-path:inset(0 0 0 0);opacity:0;}
}
@keyframes claw-impact {
    0% {filter:brightness(1.75);}
    100% {filter:brightness(1);}
}

.vfx-shadow-mist {
    position:fixed;z-index:99990;pointer-events:none;
    opacity:0;filter:brightness(var(--mist-darkness));
    animation:nyx-mist-travel .72s ease-in both;
}
.vfx-shadow-mist i {
    position:absolute;width:65%;height:65%;border-radius:50%;
    background:radial-gradient(ellipse,#000 12%,#06010a 35%,rgba(40,9,55,.85) 55%,transparent 75%);
    filter:blur(5px);animation:nyx-mist-swirl .5s ease-in-out var(--puff-delay) infinite alternate;
}
.vfx-shadow-mist-impact {
    position:absolute;inset:-20%;z-index:10010;pointer-events:none;border-radius:50%;
    background:radial-gradient(ellipse,#000 10%,rgba(8,1,15,.95) 32%,rgba(45,12,63,.75) 50%,transparent 72%);
    filter:brightness(var(--mist-darkness));
    animation:nyx-mist-engulf .6s ease-out both;
}
@keyframes nyx-mist-travel {
    0% { transform:translate(-50%,-50%) scale(.3);opacity:0; }
    20% { opacity:var(--mist-opacity); }
    100% { transform:translate(calc(-50% + var(--mist-x)),calc(-50% + var(--mist-y))) scale(1.1);opacity:var(--mist-opacity); }
}
@keyframes nyx-mist-swirl {
    from { transform:translate(-12%,-8%) rotate(-15deg) scale(.8); }
    to { transform:translate(12%,8%) rotate(25deg) scale(1.15); }
}
@keyframes nyx-mist-engulf {
    0% { opacity:var(--mist-opacity);transform:scale(.6); }
    40% { opacity:var(--mist-opacity);transform:scale(var(--mist-scale)); }
    100% { opacity:0;transform:scale(1.6); }
}

/* Keep the shared indicator centered between both HUD rows. */
.hud-container.enemy { top:39cqh; }
.hud-container.player { bottom:39cqh; }

/* Keep battle readouts behind the full-screen turn-selection and coin-toss flow. */
body:has(#turn-selection-overlay[style*="display: flex"]) .heroes-left-counter,
body:has(#turn-selection-overlay[style*="display:flex"]) .heroes-left-counter,
body:has(#turn-selection-overlay[style*="display: flex"]) #match-turn-status,
body:has(#turn-selection-overlay[style*="display:flex"]) #match-turn-status { visibility:hidden; }

body:has(#turn-selection-overlay[style*="display: flex"]) .battle-hud-row,
body:has(#turn-selection-overlay[style*="display:flex"]) .battle-hud-row { visibility:hidden; }

/* Midpoint between the battlefield's outer right edge and the stage column's left edge. */
body { --battle-hud-right: calc(26cqw - var(--board-width) / 4 + 2.25cqh + 1px); }

/* Stage actions and side readouts share one centered column and never overlap. */
.battle-side-status {
    position:absolute;
    right:var(--battle-hud-right);
    transform:translateX(50%);
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:1.2cqh;
    width:max-content;
    max-width:26cqw;
    z-index:9999;
    pointer-events:none;
}
.battle-side-status.enemy { bottom:54cqh; flex-direction:column-reverse; }
.battle-side-status.player { top:54cqh; }
.battle-side-status > .battle-hud-row { position:static; inset:auto; transform:none; }
.battle-side-status > .action-btn {
    position:static!important;
    inset:auto;
    transform:none;
    box-sizing:border-box;
    min-height:4.8cqh;
    min-width:16cqh;
    max-width:100%;
    margin:0;
    padding:.8cqh 1.4cqw;
    line-height:1.2;
    white-space:nowrap;
    pointer-events:auto;
    transition:background-color .2s,box-shadow .2s;
}
.battle-side-status > .action-btn:hover { transform:none; filter:brightness(1.08); }
body.match-menu-open .battle-side-status,
body:has(#turn-selection-overlay[style*="display: flex"]) .battle-side-status,
body:has(#turn-selection-overlay[style*="display:flex"]) .battle-side-status { visibility:hidden; }

/* Learning controls live in the existing menu; deck panels retain their layout. */
body.ai-memory-available #match-menu-button { display:block; }
#ai-learning-controls[hidden] { display:none!important; }
#ai-learning-controls { width:100%; border-top:1px solid #6db9d440; padding-top:1cqh; }
#ai-learning-status { color:#b9d9e6; font-size: var(--ui-caption, 1.5cqh); margin:0 0 1cqh; }

#preparation-screen .prep-card[hidden], body #ai-learning-controls { display:none!important; }
/* The game menu is available on the battlefield, never in Deck Construction. */
body:has(#preparation-screen:not([style*="display: none"]):not([style*="display:none"])) :is(#match-menu-button, #match-menu-modal, #match-menu-backdrop, #match-restart-modal) { display:none!important; }
.full-log-stage-group > summary { cursor:pointer;user-select:none; }
.full-log-stage-group[open] > summary { color:var(--neon-gold); }

.vfx-lick { position:fixed;left:0;top:0;width:1920px;height:920px;overflow:visible;pointer-events:none;z-index:100000; }
.vfx-lick-tongue { stroke-linecap:round;stroke-linejoin:round; }
.vfx-lick-trail-far { fill:#c14b69;opacity:.05; }
.vfx-lick-trail { fill:#ce617c;opacity:.11; }
.vfx-lick-edge { fill:#3b0b21;stroke:#76233d;stroke-width:.65; }
.vfx-lick-body { stroke:none; }
.vfx-lick-shine { fill:#ffe0d7;stroke:none;opacity:.4; }
.vfx-lick-impact { opacity:0;pointer-events:none; }
.vfx-lick-impact .lick-crack { fill:none;stroke:#ffb4be;stroke-width:calc(1.8px * var(--lick-impact));stroke-linecap:round;transform:scale(var(--lick-hit-scale,1)); }
.vfx-lick-impact .lick-hit { fill:#fff0dd;stroke:#df496e;stroke-width:.8;transform:scale(var(--lick-hit-scale,1)); }



.vfx-power-impact { position:fixed;z-index:100000;pointer-events:none;border-radius:50%;transform:translate(-50%,-50%);background:radial-gradient(circle at 35% 30%,#343040 0%,#0c0812 32%,#000 62%,#17101f 72%,transparent 74%);border:2px solid #c6b8db;box-shadow:0 0 12px #f2ebff,0 0 36px #9b72cbb0,inset 0 0 22px #000;transition:left var(--power-travel) cubic-bezier(.45,0,.9,.5),top var(--power-travel) cubic-bezier(.45,0,.9,.5); }
.vfx-power-halo { position:absolute;inset:-23%;border-radius:50%;border:5px solid #000;border-top-color:#d3c1eb;border-bottom-color:#6f548e;box-shadow:0 0 14px #d4c1ef80,inset 0 0 12px #000;animation:power-halo-spin .45s linear infinite;transform:rotateX(55deg); }
.vfx-power-halo:nth-child(2) { inset:-12%;border-width:3px;animation-direction:reverse;opacity:.8; }
.vfx-power-impact-hit { position:fixed;z-index:100000;pointer-events:none;transform:translate(-50%,-50%); }
.vfx-power-shock { position:absolute;inset:0;border:8px solid #000;border-radius:50%;box-shadow:0 0 4px 2px #ebdefa,0 0 24px 7px #88669f99,inset 0 0 22px #000;animation:power-impact-shock .62s ease-out both; }
.vfx-power-shock.echo { inset:15%;border-width:12px;animation-delay:70ms;animation-duration:.5s; }
.vfx-power-burst { position:absolute;inset:18%;border-radius:50%;background:radial-gradient(circle,#000 0%,#000e 26%,#302339aa 45%,transparent 65%);animation:power-impact-burst .54s ease-out both; }
@keyframes power-halo-spin { to { transform:rotateX(55deg) rotate(360deg); } }
@keyframes power-impact-shock { 0% {transform:scale(.08);opacity:1;} 40% {opacity:.95;} 100% {transform:scale(1);opacity:0;} }
@keyframes power-impact-burst { 0% {transform:scale(.12);opacity:1;} 30% {transform:scale(.85);opacity:1;} 100% {transform:scale(1.1);opacity:0;} }
.attached-token[data-card-artwork-state="unavailable"]::after { content:attr(data-token-type) ' TOKEN';position:absolute;inset:15% 5%;display:grid;place-items:center;text-align:center;font-size: var(--ui-caption, 1.4cqh);font-weight:700;color:#c6dce8;letter-spacing:.08em; }

.vfx-blood-squirt { position:absolute;inset:0;pointer-events:none;z-index:45;overflow:visible; }
.vfx-blood-squirt::before { content:'';position:absolute;inset:20% 3%;border-radius:50%;background:radial-gradient(ellipse,#970012aa,transparent 68%);animation:blood-splash-flash .55s ease-out both; }
.vfx-blood-squirt i { position:absolute;left:50%;top:46%;width:8px;height:15px;background:linear-gradient(#ff3750,#6f000b);border-radius:70% 25% 65% 35%;box-shadow:0 0 3px #ff4b58;opacity:0;animation:blood-squirt-drop .48s cubic-bezier(.12,.55,.4,1) var(--blood-delay) both; }
@keyframes blood-squirt-drop { 0%{opacity:0;transform:translate(-50%,-50%) scale(.2);} 15%{opacity:1;} 70%{opacity:1;} 100%{opacity:0;transform:translate(calc(-50% + var(--blood-x)),calc(-50% + var(--blood-y))) rotate(65deg) scale(.65);} }
@keyframes blood-splash-flash { 0%{opacity:0;transform:scale(.2);} 25%{opacity:1;} 100%{opacity:0;transform:scale(1.4);} }
.vfx-red-saturate { position:absolute;inset:0;border-radius:inherit;z-index:45;pointer-events:none;background:#bd001a;mix-blend-mode:color;box-shadow:inset 0 0 22px #770012,0 0 12px #ff1439;animation:red-saturate .62s ease-in-out both; }
.vfx-red-saturate::after { content:'';position:absolute;inset:0;border-radius:inherit;background:linear-gradient(135deg,#ff184555,#67000a77);mix-blend-mode:multiply; }
@keyframes red-saturate { 0%{opacity:0;} 30%,78%{opacity:1;} 100%{opacity:0;} }

.vfx-bite {
    position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
    pointer-events:none;overflow:visible;z-index:10000;
    filter:drop-shadow(0 0 var(--bite-glow,5px) #a5225999);
}
.vfx-bite .bite-gum { fill:none;stroke:#240c28;stroke-width:6;stroke-linecap:round; }
.vfx-bite .bite-fang { fill:#f1e4cc;stroke:#3c182b;stroke-width:1.5;stroke-linejoin:round; }
.vfx-bite .bite-jaw { opacity:0;transform-box:view-box;transform-origin:60px 75px; }
.vfx-bite .bite-jaw-top { animation:zark-bite-top .56s cubic-bezier(.2,.8,.3,1) both; }
.vfx-bite .bite-jaw-bottom { animation:zark-bite-bottom .56s cubic-bezier(.2,.8,.3,1) both; }
.vfx-bite .bite-marks { animation:zark-bite-marks .84s ease-out both; }
.vfx-bite .bite-puncture { fill:#150616;stroke:#e05276;stroke-width:1.7; }
.vfx-bite .bite-imprint { fill:none;stroke:#e05276;stroke-width:2;stroke-linecap:round; }
@keyframes zark-bite-top {
    0% {opacity:0;transform:translateY(-24px) scale(.92);}
    24% {opacity:1;transform:translateY(-18px) scale(1);}
    58%,74% {opacity:1;transform:translateY(4px) scale(1);}
    100% {opacity:0;transform:translateY(4px) scale(.96);}
}
@keyframes zark-bite-bottom {
    0% {opacity:0;transform:translateY(24px) scale(.92);}
    24% {opacity:1;transform:translateY(18px) scale(1);}
    58%,74% {opacity:1;transform:translateY(-4px) scale(1);}
    100% {opacity:0;transform:translateY(-4px) scale(.96);}
}
@keyframes zark-bite-marks {
    0%,35% {opacity:0;}
    40% {opacity:1;filter:brightness(2.1);}
    52%,78% {opacity:1;filter:brightness(1);}
    100% {opacity:0;filter:brightness(.7);}
}


/* Game log export actions wrap within the existing log header. */
#full-game-log-modal .full-game-log-head{flex-wrap:wrap;gap:12px}
.full-game-log-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-left:auto}
#full-game-log-modal .full-game-log-actions button{white-space:nowrap}
#full-game-log-download-status{font:var(--ui-caption, 12px) 'Segoe UI',sans-serif;color:#b9d9e4;margin:8px 0;overflow-wrap:anywhere}
#full-game-log-download-status:empty{display:none}
#full-game-log-download:disabled{opacity:.45;cursor:default}

/* Match results use the full desktop viewport and a readable two-column details grid. */
@media (min-width: 1000px) and (min-height: 600px) {
  body { --font-size-base: max(var(--ui-caption),calc(1.2cqmin * var(--scale))); --font-size-title: max(var(--ui-body),calc(1.5cqmin * var(--scale))); }
  #final-result-modal { position: fixed !important; inset: 0 !important; width: 100vw !important; height: 100dvh !important; padding: 16px; }
  #final-result-modal .result-panel {
    width: min(1320px,100%); height: min(640px,calc(100dvh - 32px)); max-height: none;
    display: flex; flex-direction: column; gap: 12px; padding: 16px;
    box-sizing: border-box; overflow: visible;
  }
  .result-head { display: grid; grid-template-columns: repeat(2,max-content); justify-content: center; column-gap: 24px; row-gap: 4px; margin: 0; font-size: var(--ui-body); line-height: 1.3; }
  .result-rank { grid-column: 1 / -1; font-size: var(--ui-display); line-height: 1; text-shadow: 0 0 12px currentColor; }
  .result-columns { flex: 1; min-height: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
  .result-side-panel { min-height: 0; display: flex; flex-direction: column; padding: 12px; }
  .result-side-panel.loser { opacity: 1; filter: none; color: #c3d0df; }
  .result-side-title { font-size: var(--ui-heading); line-height: 1.2; margin-bottom: 2px; }
  .result-side-rank { font-size: var(--ui-subtitle); line-height: 1.2; margin-bottom: 0; }
  .result-side-panel.loser .result-side-rank, .result-side-panel.loser .result-row strong { color: #d4deea; }
  .result-side-honors { gap: 10px; margin: 10px 0; flex: none; }
  .result-honor-box { min-height: 0; padding: 8px; font-size: var(--ui-body); line-height: 1.3; }
  .result-honor-box strong { font-size: var(--ui-caption); margin-bottom: 3px; }
  .result-carousel-shell { flex: 1; min-height: 0; margin: 0; display: flex; }
  .result-carousel-box { flex: 1; height: auto; min-height: 0; display: flex; flex-direction: column; padding: 10px 30px; overflow: visible; }
  .result-carousel-title { flex: none; font-size: var(--ui-caption); line-height: 1.3; margin-bottom: 8px; }
  .result-carousel-stats { flex: 1; height: auto; min-height: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); grid-auto-flow: row; align-content: center; gap: 0 14px; padding: 0; overflow: visible; }
  .result-row { min-width: 0; align-items: baseline; gap: 8px; padding: 7px 0; font-size: var(--ui-body); line-height: 1.3; }
  .result-row span { color: #bfd0e2; }
  .result-row strong { flex: none; font-variant-numeric: tabular-nums; }
  .result-carousel-btn { width: 26px; height: 48px; font-size: var(--ui-subtitle); opacity: 1; color: #dbe9f5; }
  .result-hero-roster { flex: 1; height: auto; min-height: 0; gap: 8px; padding: 0; }
  .result-hero-lineage { height: 100%; }
  .result-hero-form { width: min(94%,88px); }
  .result-hero-form-name { font-size: var(--ui-caption); line-height: 1.2; padding: 3px; }
  .result-controls { flex: none; grid-template-columns: repeat(3,minmax(0,180px)); gap: 10px; margin: 0; }
  .result-control-btn { min-height: 40px; padding: 8px 12px; font-size: var(--ui-body); line-height: 1.3; }
}
@media (min-width: 1000px) and (min-height: 600px) and (max-height: 700px) {
  #final-result-modal .result-panel { padding: 12px; gap: 10px; }
  .result-side-panel { padding: 10px; }
  .result-side-honors { margin: 8px 0; }
  .result-honor-box { padding: 6px; }
  .result-row { padding: 5px 0; }
}

/* Portrait deck setup only. Leaving preparation restores the current battlefield. */
.prep-view-switch { position:absolute; top:2cqh; right:2cqw; z-index:120; }
#phone-prep-panels, #phone-deck-target { display:none; }
html.sukdulan-phone-construction { --ui-caption:12px; --ui-body:14px; --ui-subtitle:16px; --ui-heading:20px; --ui-title:24px; --control-height:38px; --control-font:600 14px/1.2 'Segoe UI',sans-serif; }
html.sukdulan-phone-construction body { width:min(100vw,430px,58dvh); height:100dvh; min-height:0; max-height:100dvh; margin:auto; container-type:size; }
html.sukdulan-phone-construction #preparation-screen { --prep-control-height:40px; --prep-control-font:600 13px/1.25 'Segoe UI',sans-serif; padding:122px 10px calc(10px + env(safe-area-inset-bottom,0px)); gap:7px; justify-content:flex-start; }
html.sukdulan-phone-construction #preparation-screen .prep-view-switch { top:8px; right:10px; }
html.sukdulan-phone-construction #preparation-screen .prep-view-switch > button { min-height:34px; }
html.sukdulan-phone-construction #preparation-screen #sukdulan-preparation-toolbar { box-sizing:border-box; top:52px; left:10px; right:10px; max-width:none; width:auto; gap:6px; align-items:flex-end; }
html.sukdulan-phone-construction #preparation-screen #sukdulan-back-to-lobby { min-height:36px; padding:7px 9px; font-size:12px; }
html.sukdulan-phone-construction #preparation-screen .constructed-deck-field { flex:1; gap:3px; font-size:12px; letter-spacing:0; }
html.sukdulan-phone-construction #preparation-screen #constructed-deck-select { width:100%; min-width:0; height:36px; font-size:13px; padding:4px; }
html.sukdulan-phone-construction #preparation-screen #constructed-deck-refresh { height:36px; min-width:36px; font-size:18px; padding:4px; }
html.sukdulan-phone-construction #preparation-screen #constructed-deck-status { position:absolute; top:100%; left:0; right:0; font-size:12px; }
html.sukdulan-phone-construction #preparation-screen .prep-header { min-height:24px; height:24px; padding:0; font-size:20px; line-height:1.2; letter-spacing:1px; }
html.sukdulan-phone-construction #preparation-screen #phone-prep-panels { display:flex; flex:none; gap:6px; width:100%; }
html.sukdulan-phone-construction #preparation-screen #phone-prep-panels button { flex:1; min-width:0; min-height:40px; padding:7px 4px; border:1px solid #77b4cc70; border-radius:6px; background:#10283b; color:#a9cede; font:600 13px/1.2 'Segoe UI',sans-serif; }
html.sukdulan-phone-construction #preparation-screen #phone-prep-panels button[aria-pressed="true"] { border-color:#8ee2ff; background:#28516b; color:#e0f8ff; }
html.sukdulan-phone-construction #preparation-screen .prep-layout { box-sizing:border-box; display:flex; flex:1; width:100%; min-height:0; gap:0; container-type:size; }
html.sukdulan-phone-construction #preparation-screen .prep-panel { --phone-card-width:min(calc((100cqw - 40px)/6),calc((100cqh - 126px)/8.4)); box-sizing:border-box; display:flex; flex:1; width:100%; min-height:0; padding:8px; border-radius:10px; }
html.sukdulan-phone-construction #preparation-screen[data-phone-panel="player"] .prep-layout > :not(#panel-player),
html.sukdulan-phone-construction #preparation-screen[data-phone-panel="cards"] .prep-layout > :not(.db-panel),
html.sukdulan-phone-construction #preparation-screen[data-phone-panel="enemy"] .prep-layout > :not(#panel-enemy) { display:none; }
html.sukdulan-phone-construction #preparation-screen .prep-panel > .panel-title { min-height:28px; height:28px; margin:0 0 6px; padding:0; gap:6px; font-size:14px; }
html.sukdulan-phone-construction #preparation-screen .prep-deck-cards { box-sizing:border-box; flex:1; min-height:0; padding:0; gap:5px; overflow:hidden; }
html.sukdulan-phone-construction #preparation-screen .prep-deck-cards .slots-container { display:grid; flex:none; gap:4px; margin:0 auto; width:max-content; max-width:100%; grid-template-columns:repeat(5,var(--phone-card-width)); }
html.sukdulan-phone-construction #preparation-screen .prep-deck-cards .tactics-grid { grid-template-columns:repeat(6,var(--phone-card-width)); }
html.sukdulan-phone-construction #preparation-screen .prep-deck-cards :is(.prep-card,.prep-slot) { width:var(--phone-card-width); height:calc(var(--phone-card-width)*1.4); min-width:0; min-height:0; font-size:14px; }
html.sukdulan-phone-construction #preparation-screen .prep-deck-footer { flex:none; min-height:0; padding-top:5px; }
html.sukdulan-phone-construction #preparation-screen .prep-deck-status { min-height:16px; max-height:34px; margin:0; font:12px/1.3 'Segoe UI',sans-serif; white-space:normal; overflow:hidden; text-overflow:clip; }
html.sukdulan-phone-construction #preparation-screen #phone-deck-target { display:block; flex:none; width:100%; min-height:36px; margin:0 0 8px; padding:6px; border:1px solid #89d3e94f; border-radius:5px; background:#153348; color:#c2e8f6; font:600 13px/1.2 'Segoe UI',sans-serif; }
html.sukdulan-phone-construction #preparation-screen #phone-deck-target:disabled { opacity:1; cursor:default; }
html.sukdulan-phone-construction #preparation-screen .db-cards-scroll { display:block; flex:1; min-height:0; overflow-x:hidden; overflow-y:auto; padding:0 3px 0 0; }
html.sukdulan-phone-construction #preparation-screen .db-cards-scroll .slots-container { width:100%; max-width:100%; grid-template-columns:repeat(4,minmax(0,1fr)); gap:7px; margin:0; }
html.sukdulan-phone-construction #preparation-screen .db-cards-scroll .prep-card { width:100%; height:auto; aspect-ratio:5/7; }
html.sukdulan-phone-construction #preparation-screen .db-tabs { gap:5px; }
html.sukdulan-phone-construction #preparation-screen .db-tabs .db-tab { min-height:40px; font-size:13px; }
html.sukdulan-phone-construction #preparation-screen #panel-enemy :is(.enemy-mode-select,.enemy-mode-label) { width:auto; height:28px; min-height:28px; padding:3px 6px; font-size:12px; }
html.sukdulan-phone-construction #preparation-screen .prep-actions { box-sizing:border-box; display:flex; flex-direction:column; flex:none; width:100%; gap:6px; min-height:0; }
html.sukdulan-phone-construction #preparation-screen .prep-actions .btn-group { gap:6px; }
html.sukdulan-phone-construction #preparation-screen .prep-actions .btn-group > button { flex:1; width:auto; min-width:0; min-height:38px; height:38px; padding:7px 5px; font-size:13px; }
html.sukdulan-phone-construction #preparation-screen .prep-actions .prep-start-actions { position:static; order:3; transform:none; width:100%; }
html.sukdulan-phone-construction #preparation-screen .prep-actions .start-btn { width:100%; min-height:42px; height:42px; font-size:13px; }
html.sukdulan-phone-construction #preparation-screen .prep-enemy-actions { display:flex; flex-direction:column; gap:6px; width:100%; }
html.sukdulan-phone-construction #preparation-screen #enemy-strategy-select { width:100%; height:38px; min-height:38px; padding:6px; font-size:13px; }
html.sukdulan-phone-construction #preparation-screen[data-phone-panel="player"] .prep-enemy-actions,
html.sukdulan-phone-construction #preparation-screen[data-phone-panel="enemy"] #player-deck-buttons,
html.sukdulan-phone-construction #preparation-screen[data-phone-panel="cards"][data-phone-target="player"] .prep-enemy-actions,
html.sukdulan-phone-construction #preparation-screen[data-phone-panel="cards"][data-phone-target="enemy"] #player-deck-buttons { display:none; }

html.sukdulan-phone-construction #preparation-screen #phone-prep-panels button { padding:7px 5px !important; }
