/* ==========================================================================
   CYBER GLITCH: CORE BREACH PROTOCOL - CANDY SAGA DESIGN SYSTEM
   High-Res Candy Spritesheets, Level Progression, Ice & Lock Obstacles
   ========================================================================== */

:root {
    --bg-dark: #05070c;
    --bg-card: rgba(8, 12, 20, 0.94);
    --bg-card-hover: rgba(14, 20, 32, 0.96);
    --border-glow: rgba(217, 119, 6, 0.35);
    --border-subtle: rgba(255, 255, 255, 0.05);

    /* Dark Obsidian & Antique Gold Palette */
    --neon-cyan: #38bdf8;
    --neon-cyan-glow: rgba(56, 189, 248, 0.35);
    
    --neon-pink: #f43f5e;
    --neon-pink-glow: rgba(244, 63, 94, 0.35);
    
    --neon-purple: #9333ea;
    --neon-purple-glow: rgba(147, 51, 234, 0.35);
    
    --neon-green: #10b981;
    --neon-green-glow: rgba(16, 185, 129, 0.35);
    
    --neon-gold: #f59e0b;
    --neon-gold-glow: rgba(245, 158, 11, 0.45);
    
    --neon-red: #ef4444;
    --neon-red-glow: rgba(239, 68, 68, 0.45);

    --neon-blue: #38bdf8;
    --neon-blue-glow: rgba(56, 189, 248, 0.35);

    /* Text Colors */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;

    /* Fonts */
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
    --font-comic: 'Bangers', cursive, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

/* Font Preloader: Tersembunyi tanpa mengganggu tata letak visual */
.font-preloader {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    z-index: -999;
}

body.cyber-theme {
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(18, 25, 40, 0.7) 0%, transparent 70%),
        url("assets/ui/bg_dark_obsidian.jpg");
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-main);
    font-family: var(--font-heading);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* CUSTOM TACTICAL RELIC CURSORS */
body.zap-active, body.zap-active * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cdefs%3E%3Cfilter id='glow'%3E%3CfeDropShadow dx='0' dy='0' stdDeviation='1.5' flood-color='%2300f0ff'/%3E%3C/filter%3E%3C/defs%3E%3Ccircle cx='18' cy='18' r='14' fill='none' stroke='%2300f0ff' stroke-width='1.5' stroke-dasharray='3 2' opacity='0.85'/%3E%3Cpath d='M8 28 L20 16' stroke='%23f59e0b' stroke-width='3.5' stroke-linecap='round' filter='url(%23glow)'/%3E%3Cpolygon points='16,12 24,4 28,8 20,16' fill='%2300f0ff' stroke='%23fff' stroke-width='1.5' filter='url(%23glow)'/%3E%3Cpolygon points='22,6 26,2 30,6 26,10' fill='%23f59e0b'/%3E%3Ccircle cx='18' cy='18' r='2.5' fill='%23ef4444' stroke='%23fff' stroke-width='0.8'/%3E%3C/svg%3E") 18 18, crosshair !important;
}

body.emp-active, body.emp-active * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='36' viewBox='0 0 36 36'%3E%3Cdefs%3E%3Cfilter id='glow-emp'%3E%3CfeDropShadow dx='0' dy='0' stdDeviation='1.5' flood-color='%23a855f7'/%3E%3C/filter%3E%3C/defs%3E%3Ccircle cx='18' cy='18' r='15' fill='none' stroke='%23c084fc' stroke-width='1.5' stroke-dasharray='4 2'/%3E%3Ccircle cx='18' cy='18' r='9' fill='rgba(168,85,247,0.25)' stroke='%23f43f5e' stroke-width='1.2'/%3E%3Cpath d='M18 3 L20 14 L31 16 L20 18 L18 29 L16 18 L5 16 L16 14 Z' fill='%23e879f9' stroke='%23fff' stroke-width='1' filter='url(%23glow-emp)'/%3E%3Ccircle cx='18' cy='18' r='3' fill='%23fff'/%3E%3C/svg%3E") 18 18, crosshair !important;
}

/* Ambient Background */
.cyber-grid-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: 
        radial-gradient(rgba(245, 158, 11, 0.02) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px);
    background-size: 36px 36px;
    pointer-events: none;
    z-index: 0;
}

.cyber-scanline {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.35) 50%);
    background-size: 100% 4px;
    pointer-events: none;
    z-index: 1;
    opacity: 0.35;
}

.ambient-glow {
    position: fixed;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.cyan-glow {
    top: -120px;
    left: -120px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.12) 0%, transparent 70%);
}
.purple-glow {
    bottom: -120px;
    right: -120px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.12) 0%, transparent 70%);
}

.app-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1280px;
    padding: 16px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ==========================================================================
   HEADER HUD
   ========================================================================== */
.cyber-hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 18px;
    padding: 12px 20px;
    backdrop-filter: blur(14px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.hud-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--neon-cyan);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.brand-title {
    font-size: 1.35rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff 30%, var(--neon-cyan) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: flex;
    align-items: center;
    gap: 8px;
}
.brand-title .sub-title {
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--neon-pink);
    -webkit-text-fill-color: var(--neon-pink);
    border: 1px solid var(--neon-pink);
    padding: 2px 6px;
    border-radius: 6px;
    box-shadow: 0 0 8px var(--neon-pink-glow);
}

.hud-center-info {
    display: flex;
    align-items: center;
    gap: 12px;
}
.hud-level-indicator {
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid var(--neon-cyan);
    padding: 6px 14px;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 800;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 0 10px var(--neon-cyan-glow);
}

.hud-credits {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    padding: 6px 14px;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--neon-gold);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.2);
}

.hud-player-profile {
    background: rgba(147, 51, 234, 0.12);
    border: 1px solid rgba(147, 51, 234, 0.45);
    padding: 6px 14px;
    border-radius: 100px;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    font-weight: 800;
    color: #e9d5ff;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0 10px rgba(147, 51, 234, 0.25);
}
.hud-player-profile:hover {
    background: rgba(147, 51, 234, 0.25);
    border-color: var(--neon-purple);
    transform: translateY(-1px);
    box-shadow: 0 0 16px rgba(147, 51, 234, 0.45);
}
.hud-player-profile .edit-icon {
    font-size: 0.72rem;
    color: var(--text-muted);
    transition: color 0.2s;
}
.hud-player-profile:hover .edit-icon {
    color: #fff;
}
.hud-credits small {
    font-size: 0.65rem;
    opacity: 0.8;
}

.hud-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}
.hud-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.hud-btn:hover {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 12px var(--neon-cyan-glow);
    transform: translateY(-2px);
}
.hud-btn-levels {
    background: rgba(0, 240, 255, 0.15);
    border-color: rgba(0, 240, 255, 0.4);
    color: #a5f3fc;
}
.hud-btn-levels:hover {
    background: var(--neon-cyan);
    color: var(--bg-dark);
}
.hud-btn-story {
    background: rgba(168, 85, 247, 0.15);
    border-color: rgba(168, 85, 247, 0.4);
    color: #e9d5ff;
}
.hud-btn-story:hover {
    background: var(--neon-purple);
    color: #fff;
}
.hud-btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    border-color: var(--neon-red);
    color: #fff;
}

/* ==========================================================================
   BATTLEFIELD LAYOUT (CANDY CRUSH BALANCED GRID + SIDEBAR)
   ========================================================================== */
.battlefield-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

/* LEFT COLUMN: GRID CARD */
.grid-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 22px;
    padding: 18px;
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.grid-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}
.level-objective-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.level-target-label {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
}
.level-target-text {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
}

.moves-container {
    display: flex;
    align-items: baseline;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    padding: 4px 14px;
    border-radius: 12px;
    border: 1.5px solid rgba(245, 158, 11, 0.35);
}
.moves-lbl {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 800;
}
.moves-val {
    font-family: var(--font-mono);
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--neon-gold);
    text-shadow: 0 0 10px var(--neon-gold-glow);
}

/* Objective Progress Row */
.objective-progress-row {
    width: 100%;
    display: flex;
    gap: 10px;
    justify-content: center;
}
.obj-pill {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 4px 12px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
}
.obj-pill.goal-complete {
    border-color: var(--neon-green);
    background: rgba(16, 185, 129, 0.15);
}

.grid-board-wrapper {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
}

.btn-skip-sugar-crush {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(6, 182, 212, 0.95));
    border: 2px solid #00f0ff;
    border-radius: 30px;
    color: #0d131f;
    font-family: var(--font-heading);
    font-size: 0.92rem;
    font-weight: 900;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.6), 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: skipBtnPulse 1.2s infinite alternate;
}
.btn-skip-sugar-crush:hover {
    transform: translateX(-50%) scale(1.06);
    background: linear-gradient(135deg, #00f0ff, #10b981);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.9), 0 6px 20px rgba(0, 0, 0, 0.6);
}
@keyframes skipBtnPulse {
    0% { transform: translateX(-50%) scale(1); box-shadow: 0 0 15px rgba(0, 240, 255, 0.5); }
    100% { transform: translateX(-50%) scale(1.04); box-shadow: 0 0 28px rgba(0, 240, 255, 0.85); }
}

/* 8x8 GRID (62px cells + 6px gap = ~538px) */
.cyber-grid {
    display: grid;
    grid-template-columns: repeat(8, 62px);
    grid-template-rows: repeat(8, 62px);
    gap: 6px;
    background: rgba(7, 12, 22, 0.94);
    padding: 10px;
    border-radius: 16px;
    border: 1px solid rgba(0, 240, 255, 0.28);
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85);
    position: relative;
    user-select: none;
}

/* GRID CELLS & CANDY CRUSH STYLE NODES */
.grid-node {
    width: 62px;
    height: 62px;
    border-radius: 12px;
    background-color: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.07);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
    position: relative;
    overflow: visible;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    -webkit-user-drag: none;
}

.grid-node:active, .grid-node.pointer-dragging {
    cursor: grabbing;
}

.grid-node:hover {
    border-color: rgba(0, 240, 255, 0.45);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
    z-index: 5;
}

.grid-node.selected-node {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 18px var(--neon-cyan), inset 0 0 10px var(--neon-cyan-glow);
    z-index: 10;
    animation: selectedPulse 0.75s infinite alternate;
}
@keyframes selectedPulse {
    0% { box-shadow: 0 0 10px var(--neon-cyan); }
    100% { box-shadow: 0 0 24px var(--neon-cyan); }
}

.grid-node.hint-node {
    z-index: 20 !important;
    border: 1.5px solid rgba(250, 204, 21, 0.6) !important;
    animation: hintYellowFade 1s ease-in-out infinite alternate !important;
}

.grid-node.hint-node .sprite-node {
    /* Animasi grow halus hanya pada batu rune / permen tanpa rotasi */
    animation: hintRuneGrow 1s ease-in-out infinite alternate !important;
}

/* Fading halus pada background kekuningan dan border petunjuk agar jelas & noticeable */
@keyframes hintYellowFade {
    0% {
        background: rgba(245, 158, 11, 0.12) !important;
        border-color: rgba(245, 158, 11, 0.45);
        box-shadow: 0 0 6px rgba(245, 158, 11, 0.25), inset 0 0 8px rgba(254, 240, 138, 0.15);
    }
    100% {
        background: rgba(250, 204, 21, 0.35) !important;
        border-color: rgba(254, 240, 138, 0.9);
        box-shadow: 0 0 14px rgba(245, 158, 11, 0.55), inset 0 0 14px rgba(254, 240, 138, 0.35);
    }
}

/* Grow lembut dan glow tipis pada rune dengan transparansi pudar yang rapi */
@keyframes hintRuneGrow {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.25));
    }
    100% {
        transform: scale(1.14);
        filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.65));
    }
}

/* ==========================================================================
   SPRITESHEET HIGH-RES CANDY ASSETS & OVERLAYS
   ========================================================================== */
.sprite-node {
    width: 50px;
    height: 50px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    user-select: none;
    -webkit-user-select: none;
    -webkit-user-drag: none;
    position: relative;
    will-change: transform;
}

.sprite-data_bit {
    background-image: url('assets/sprites/gem_diamond.png');
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.45));
}
.sprite-trojan {
    background-image: url('assets/sprites/gem_heart.png');
    filter: drop-shadow(0 0 6px rgba(255, 0, 127, 0.45));
}
.sprite-coolant {
    background-image: url('assets/sprites/gem_square.png');
    filter: drop-shadow(0 0 6px rgba(16, 185, 129, 0.45));
}
.sprite-crypto_key {
    background-image: url('assets/sprites/gem_star.png');
    filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.45));
}
.sprite-firewall {
    background-image: url('assets/sprites/gem_sphere.png');
    filter: drop-shadow(0 0 6px rgba(168, 85, 247, 0.45));
}
.sprite-special_laser {
    background-image: url('assets/sprites/gem_laser.png');
    filter: drop-shadow(0 0 10px rgba(255, 0, 127, 0.8));
    animation: laserGlowPulse 1.2s infinite alternate;
}
@keyframes laserGlowPulse {
    0% { filter: drop-shadow(0 0 8px rgba(255, 0, 127, 0.6)); }
    100% { filter: drop-shadow(0 0 16px rgba(0, 240, 255, 0.9)); }
}

.sprite-special_emp {
    background-image: url('assets/sprites/gem_emp.png');
    filter: drop-shadow(0 0 12px rgba(245, 158, 11, 0.85));
    animation: empPulseGlow 1.2s ease-in-out infinite alternate;
    position: relative;
}
.sprite-special_emp::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 50%;
    border: 1.5px dashed var(--neon-gold);
    animation: empRotateRing 6s linear infinite;
    pointer-events: none;
}
@keyframes empPulseGlow {
    0% { filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.7)) brightness(1); }
    100% { filter: drop-shadow(0 0 22px rgba(255, 215, 0, 1)) brightness(1.25); }
}
@keyframes empRotateRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ICE / FROSTED OVERLAY */
.ice-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/sprites/layer_ice.png');
    background-size: cover;
    background-position: center;
    pointer-events: none;
    z-index: 12;
    opacity: 0.95;
    border-radius: 10px;
    box-shadow: inset 0 0 10px rgba(56, 189, 248, 0.5);
    transition: all 0.2s ease;
}
/* Permen di dalam es dibuat redup / beku sehingga jelas tidak aktif warnanya */
.grid-node:has(.ice-overlay) .sprite-node {
    filter: grayscale(0.85) brightness(0.65) blur(0.5px);
    opacity: 0.65;
}
.ice-shattered {
    animation: iceBreakAnim 0.35s ease-out forwards;
}
@keyframes iceBreakAnim {
    0% { transform: scale(1); opacity: 1; filter: brightness(1.5); }
    50% { transform: scale(1.15); opacity: 0.6; filter: brightness(2.5); }
    100% { transform: scale(1.3); opacity: 0; }
}

/* LOCK / CHAIN OVERLAY */
.lock-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/sprites/layer_lock.png');
    background-size: 78%;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    z-index: 14;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.9));
    transition: all 0.25s ease;
}
.lock-broken {
    animation: lockBreakAnim 0.35s ease-out forwards;
}
@keyframes lockBreakAnim {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25) rotate(18deg); opacity: 0.6; }
    100% { transform: scale(1.5) rotate(40deg); opacity: 0; }
}

/* Empty Node Slot */
.grid-node.node-empty {
    background: rgba(255, 255, 255, 0.01) !important;
    border-color: rgba(255, 255, 255, 0.02) !important;
    box-shadow: none !important;
}

/* Match pop and Landing Bounce */
.grid-node.node-clearing {
    animation: nodeMatchPop 0.22s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
}
@keyframes nodeMatchPop {
    0% { transform: scale(1); filter: brightness(1.4); }
    40% { transform: scale(1.25); filter: brightness(2.5); }
    100% { transform: scale(0) rotate(15deg); opacity: 0; }
}

.grid-node.landing-bounce {
    animation: landingSquash 0.26s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes landingSquash {
    0% { transform: scale(1.12, 0.88); }
    50% { transform: scale(0.96, 1.04); }
    100% { transform: scale(1, 1); }
}

/* Footer Controls & Cyber Zap Ability */
.grid-footer-bar {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.grid-controls-tip {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.grid-controls-tip b {
    color: var(--neon-cyan);
}

/* ==========================================================================
   TACTICAL ABILITIES & BOOSTERS DOCK (ABOVE ARIA)
   ========================================================================== */
.abilities-card {
    background: rgba(10, 16, 28, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 18px;
    padding: 14px 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.abilities-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}
.abilities-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.1);
    border: 1px solid rgba(0, 240, 255, 0.25);
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.abilities-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    margin: 0;
}
.abilities-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}
.tactical-ability-btn {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    text-align: left;
    width: 100%;
}
.tactical-ability-btn:hover:not(:disabled) {
    background: rgba(0, 240, 255, 0.08);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0, 240, 255, 0.2);
}
.tactical-ability-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(0.7);
}
.tactical-ability-btn.active {
    background: rgba(0, 240, 255, 0.2) !important;
    border: 2px solid var(--neon-cyan) !important;
    box-shadow: 0 0 20px var(--neon-cyan), inset 0 0 10px rgba(0, 240, 255, 0.35) !important;
    animation: abilityPulse 0.9s infinite alternate;
}
#btnEmpBomb.active {
    background: rgba(168, 85, 247, 0.28) !important;
    border: 2px solid var(--neon-purple) !important;
    box-shadow: 0 0 22px var(--neon-purple), inset 0 0 10px rgba(168, 85, 247, 0.35) !important;
    animation: empAbilityPulse 0.85s infinite alternate;
}
@keyframes abilityPulse {
    0% { box-shadow: 0 0 8px var(--neon-cyan); }
    100% { box-shadow: 0 0 22px var(--neon-cyan); }
}
@keyframes empAbilityPulse {
    0% { box-shadow: 0 0 8px var(--neon-purple); }
    100% { box-shadow: 0 0 24px var(--neon-purple); }
}

body.emp-active .grid-card {
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.4), inset 0 0 10px rgba(168, 85, 247, 0.2);
    border-color: var(--neon-purple);
}
body.emp-active .grid-node {
    cursor: crosshair !important;
}
body.emp-active .grid-node:hover {
    transform: scale(1.08);
    filter: drop-shadow(0 0 10px var(--neon-purple));
    z-index: 10;
}
.ability-btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    flex-shrink: 0;
}
.cyan-box {
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
}
.gold-box {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--neon-gold);
    color: var(--neon-gold);
}
.purple-box {
    background: rgba(168, 85, 247, 0.15);
    border: 1px solid var(--neon-purple);
    color: var(--neon-purple);
}
.green-box {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--neon-green);
    color: var(--neon-green);
}
.ability-btn-info {
    flex: 1;
    min-width: 0;
}
.ability-btn-name {
    font-size: 0.88rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.2;
}
.ability-btn-desc {
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ability-badge {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 900;
    padding: 3px 8px;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--neon-cyan);
    flex-shrink: 0;
}

/* Grid FX Layer */
.grid-fx-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 20;
    overflow: hidden;
}
.laser-beam-h, .laser-beam-v {
    position: absolute;
    background: linear-gradient(90deg, transparent, #fff, var(--neon-pink), #fff, transparent);
    box-shadow: 0 0 16px var(--neon-pink-glow), 0 0 30px var(--neon-pink);
    animation: laserFlash 0.3s ease-out forwards;
}
.laser-beam-h { height: 6px; width: 100%; left: 0; }
.laser-beam-v { width: 6px; height: 100%; top: 0; background: linear-gradient(180deg, transparent, #fff, var(--neon-pink), #fff, transparent); }
@keyframes laserFlash {
    0% { opacity: 0; transform: scaleY(0.3); }
    50% { opacity: 1; transform: scaleY(1.8); }
    100% { opacity: 0; transform: scaleY(0.2); }
}

.emp-shockwave {
    position: absolute;
    border-radius: 50%;
    border: 3px solid var(--neon-purple);
    box-shadow: 0 0 20px var(--neon-purple-glow), inset 0 0 20px var(--neon-purple-glow);
    animation: shockwaveExpand 0.45s ease-out forwards;
    transform: translate(-50%, -50%);
}
@keyframes shockwaveExpand {
    0% { width: 10px; height: 10px; opacity: 1; }
    100% { width: 500px; height: 500px; opacity: 0; border-width: 1px; }
}

/* ==========================================================================
   RIGHT SIDEBAR: BOSS + STATS + COMPANION
   ========================================================================== */
.sidebar-layout {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.cyber-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    padding: 18px;
    backdrop-filter: blur(14px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    transition: border-color 0.25s ease;
}

/* Boss Card */
.boss-card {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08) 0%, rgba(13, 20, 36, 0.88) 100%);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.boss-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
}
.boss-avatar-wrapper {
    position: relative;
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.boss-hologram {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}
.holo-core {
    position: absolute;
    width: 44px;
    height: 44px;
    background: radial-gradient(circle, rgba(239, 68, 68, 0.4) 0%, transparent 70%);
    border-radius: 50%;
}
.outer-ring {
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1.5px dashed var(--neon-red);
}
.toaster-svg {
    position: absolute;
    width: 40px;
    height: 40px;
    filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.7));
    z-index: 2;
}
.boss-identity {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.boss-tag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.boss-tag {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 6px;
}
.danger-tag {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--neon-red);
    color: var(--neon-red);
}
.boss-title-text {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}
.boss-attack-timer {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(0, 0, 0, 0.4);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid rgba(239, 68, 68, 0.25);
}
.timer-lbl { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-muted); }
.timer-val { font-family: var(--font-mono); font-size: 0.88rem; font-weight: 800; color: var(--neon-red); }

.boss-bars-stack { display: flex; flex-direction: column; gap: 8px; }
.cyber-bar-container { display: flex; flex-direction: column; gap: 3px; }
.cyber-bar-track {
    width: 100%;
    height: 10px;
    background: rgba(0, 0, 0, 0.45);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.cyber-bar-fill { height: 100%; border-radius: 6px; transition: width 0.35s ease; }
.boss-hp-fill { background: linear-gradient(90deg, #ff007f, var(--neon-red)); box-shadow: 0 0 10px var(--neon-red-glow); }
.cyber-bar-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); font-weight: 600; }

/* Stats Card */
.card-title-row {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}
.stat-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.stat-label { font-family: var(--font-mono); font-size: 0.65rem; color: var(--text-dim); font-weight: 700; }
.stat-number { font-family: var(--font-mono); font-size: 1.15rem; font-weight: 800; color: var(--text-main); }
.score-number { color: var(--neon-cyan); text-shadow: 0 0 10px var(--neon-cyan-glow); }
.multi-number { color: var(--neon-purple); text-shadow: 0 0 10px var(--neon-purple-glow); }

.combo-meter-wrapper { display: flex; flex-direction: column; gap: 5px; }
.combo-track { width: 100%; height: 8px; background: rgba(0, 0, 0, 0.4); border-radius: 6px; overflow: hidden; }
.combo-fill { height: 100%; background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple), var(--neon-pink)); transition: width 0.3s ease; }
.combo-text { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); font-weight: 700; text-align: right; }

/* Realtime Level Objective Tracker Card */
.objective-card {
    border-color: rgba(0, 240, 255, 0.25);
    background: linear-gradient(135deg, rgba(13, 20, 36, 0.95), rgba(8, 14, 28, 0.9));
}
.obj-level-header {
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.side-level-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 2px;
}
.side-level-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.obj-track-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.25);
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.obj-track-item:last-child {
    margin-bottom: 0;
}
.obj-track-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
}
.obj-track-label {
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
}
.obj-track-val {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}
.obj-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}
.obj-bar-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.35s ease;
}
.score-bar-fill {
    background: linear-gradient(90deg, var(--neon-cyan), #38bdf8);
    box-shadow: 0 0 10px var(--neon-cyan-glow);
}
.ice-bar-fill {
    background: linear-gradient(90deg, #38bdf8, #60a5fa);
    box-shadow: 0 0 10px rgba(56, 189, 248, 0.5);
}
.lock-bar-fill {
    background: linear-gradient(90deg, var(--neon-gold), #f59e0b);
    box-shadow: 0 0 10px var(--neon-gold-glow);
}

/* A.R.I.A Companion with Limited Hints */
.drone-card {
    border-color: rgba(0, 240, 255, 0.3);
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.08) 0%, rgba(13, 20, 36, 0.9) 100%);
}
.drone-header { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.drone-avatar { width: 56px; height: 56px; flex-shrink: 0; filter: drop-shadow(0 0 10px var(--neon-cyan-glow)); }
.drone-svg { width: 100%; height: 100%; }
.drone-id { display: flex; flex-direction: column; gap: 2px; }
.drone-badge { font-family: var(--font-mono); font-size: 0.65rem; color: var(--neon-cyan); font-weight: 700; }
.drone-name { font-size: 1.2rem; font-weight: 900; color: #fff; }
.drone-sub { font-size: 0.72rem; color: var(--text-muted); }

.drone-comic-bubble {
    background: rgba(8, 14, 28, 0.94);
    border: 2px solid var(--neon-cyan);
    border-radius: 16px;
    padding: 12px 14px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
}
.bubble-speaker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    border-bottom: 1px solid rgba(0, 240, 255, 0.15);
    padding-bottom: 3px;
}
.bubble-tag { font-family: var(--font-mono); font-size: 0.68rem; font-weight: 800; color: var(--neon-cyan); }
.bubble-text { font-size: 0.95rem; font-weight: 600; line-height: 1.45; color: #ffffff; }

.drone-actions { display: flex; }
.drone-btn {
    width: 100%;
    background: rgba(0, 240, 255, 0.12);
    border: 1.5px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 10px 14px;
    border-radius: 12px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.88rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.drone-btn:hover:not(:disabled) {
    background: var(--neon-cyan);
    color: var(--bg-dark);
    box-shadow: 0 0 20px var(--neon-cyan-glow);
    transform: translateY(-2px);
}
.drone-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    border-color: var(--border-subtle);
    color: var(--text-muted);
}

/* ==========================================================================
   MODAL WINDOWS & LEVEL SELECT
   ========================================================================== */
.cyber-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: rgba(5, 8, 16, 0.88);
    backdrop-filter: blur(14px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    overflow: hidden;
}
.cyber-modal-overlay.active { opacity: 1; pointer-events: auto; }

.cyber-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-glow);
    border-radius: 22px;
    padding: 18px 24px;
    max-width: 680px;
    width: 95%;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
    transform: scale(0.94);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-height: 96vh;
    overflow: hidden !important;
    overflow-y: hidden !important;
    overflow-x: hidden !important;
    scrollbar-width: none !important;
}
.cyber-modal::-webkit-scrollbar,
.cyber-modal *::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.cyber-modal,
.cyber-modal * {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
}
.cyber-modal-overlay.active .cyber-modal { transform: scale(1); }

.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 8px;
}
.modal-title { display: flex; align-items: center; gap: 12px; }
.modal-icon { font-size: 1.8rem; }
.cyan-text { color: var(--neon-cyan); }
.gold-text { color: var(--neon-gold); }
.purple-text { color: var(--neon-purple); }
.blue-text { color: var(--neon-blue); }
.btn-close-modal { background: transparent; border: none; color: var(--text-muted); font-size: 1.4rem; cursor: pointer; }
.btn-close-modal:hover { color: #fff; }

/* LEVEL SELECTION MODAL */
.level-select-modal {
    max-width: 860px !important;
    width: 95% !important;
    padding: 16px 22px !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
}
.levels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 8px;
}
@media (max-width: 720px) {
    .levels-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 480px) {
    .levels-grid {
        grid-template-columns: 1fr;
    }
}
.level-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1.5px solid var(--border-subtle);
    border-radius: 14px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: all 0.25s ease;
    position: relative;
}
.level-card.unlocked {
    border-color: rgba(0, 240, 255, 0.4);
    cursor: pointer;
}
.level-card.unlocked:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px var(--neon-cyan-glow);
    transform: translateY(-2px);
}
.level-card.locked {
    opacity: 0.45;
    filter: grayscale(0.8);
    cursor: not-allowed;
}
.level-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.level-num-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--neon-cyan);
}
.level-stars-mini {
    display: flex;
    gap: 3px;
    color: var(--neon-gold);
    font-size: 0.8rem;
}
.level-card h4 { font-size: 0.92rem; font-weight: 800; color: #fff; margin: 0; }
.level-card p { font-size: 0.74rem; color: var(--text-muted); line-height: 1.25; flex: 1; margin: 0; }
.level-reward-tag {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--neon-gold);
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 2px 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    width: fit-content;
}
.btn-play-level {
    width: 100%;
    background: linear-gradient(135deg, var(--neon-cyan), #0099ff);
    border: none;
    color: var(--bg-dark);
    padding: 6px 10px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-play-level:hover {
    box-shadow: 0 0 14px var(--neon-cyan);
}

/* SPECIAL ENDLESS MODE CARD (Disatukan ke grid, aksen warna merah/ungu khusus) */
.level-card.endless-card {
    border-radius: 16px;
    padding: 16px;
    position: relative;
    overflow: hidden;
}
.level-card.endless-card.unlocked {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16) 0%, rgba(168, 85, 247, 0.14) 50%, rgba(15, 23, 42, 0.9) 100%);
    border: 1.5px solid var(--neon-red);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
    cursor: pointer;
}
.level-card.endless-card.unlocked:hover {
    border-color: #ff007f;
    box-shadow: 0 0 24px rgba(255, 0, 127, 0.45);
    transform: translateY(-3px);
}
.level-card.endless-card.locked {
    border: 1.5px dashed rgba(239, 68, 68, 0.35);
    background: rgba(15, 23, 42, 0.55);
    opacity: 0.55;
    filter: none;
    cursor: not-allowed;
}
.endless-badge {
    background: linear-gradient(90deg, var(--neon-red), var(--neon-purple));
    color: #fff !important;
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}
.endless-progress-tag {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--neon-gold);
}
.endless-stats-tag {
    background: rgba(239, 68, 68, 0.12) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
    color: #fca5a5 !important;
}
.btn-play-endless {
    background: linear-gradient(135deg, var(--neon-red), #ff007f) !important;
    color: #fff !important;
    font-weight: 800 !important;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}
.btn-play-endless:hover {
    box-shadow: 0 0 20px var(--neon-red) !important;
}

/* Freeze Pulse VFX */
.grid-node.freeze-flash {
    animation: freezePulse 0.4s ease-out;
}
@keyframes freezePulse {
    0% { transform: scale(1); filter: brightness(2) drop-shadow(0 0 16px #38bdf8); }
    50% { transform: scale(1.15); filter: brightness(3) drop-shadow(0 0 24px #38bdf8); }
    100% { transform: scale(1); filter: none; }
}

.endless-trophy-banner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 6px;
    filter: drop-shadow(0 0 16px var(--neon-gold-glow));
    animation: trophyGlow 1.2s infinite alternate;
}
@keyframes trophyGlow {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

/* PRE-MATCH BOOSTER MODAL */
.pre-match-modal {
    max-width: 580px !important;
    width: 95% !important;
    padding: 14px 20px !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
}
.pre-match-target-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 4px 0 8px 0;
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    align-items: center;
    justify-content: center;
}
.target-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    transition: transform 0.2s ease;
}
.target-chip:hover {
    transform: translateY(-1px) scale(1.03);
}
.target-chip i {
    font-size: 0.9rem;
}
.target-chip.score-chip {
    background: rgba(245, 158, 11, 0.18);
    border: 1.5px solid var(--neon-gold);
    color: var(--neon-gold);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}
.target-chip.moves-chip {
    background: rgba(0, 240, 255, 0.18);
    border: 1.5px solid var(--neon-cyan);
    color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
}
.target-chip.ice-chip {
    background: rgba(56, 189, 248, 0.18);
    border: 1.5px solid #38bdf8;
    color: #38bdf8;
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}
.target-chip.lock-chip {
    background: rgba(234, 179, 8, 0.18);
    border: 1.5px solid #eab308;
    color: #eab308;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.25);
}
.target-chip.boss-chip {
    background: rgba(239, 68, 68, 0.18);
    border: 1.5px solid #ef4444;
    color: #ef4444;
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.35);
}

.special-spawn-glow {
    animation: specialSpawnPulse 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
@keyframes specialSpawnPulse {
    0% { transform: scale(0.5); filter: brightness(2.5) drop-shadow(0 0 16px #f59e0b); }
    50% { transform: scale(1.25); filter: brightness(3) drop-shadow(0 0 25px #00f0ff); }
    100% { transform: scale(1); filter: brightness(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.4)); }
}

.boosters-selection-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 10px 0;
}
.booster-select-card {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.booster-icon-box {
    width: 38px; height: 38px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.cyan-box { background: rgba(0, 240, 255, 0.15); color: var(--neon-cyan); border: 1px solid var(--neon-cyan); }
.purple-box { background: rgba(168, 85, 247, 0.15); color: var(--neon-purple); border: 1px solid var(--neon-purple); }
.green-box { background: rgba(16, 185, 129, 0.15); color: var(--neon-green); border: 1px solid var(--neon-green); }
.gold-box { background: rgba(245, 158, 11, 0.15); color: var(--neon-gold); border: 1px solid var(--neon-gold); }
.booster-info { flex: 1; }
.booster-info h4 { font-size: 0.92rem; font-weight: 800; color: #fff; margin-bottom: 2px; }
.booster-info p { font-size: 0.75rem; color: var(--text-muted); line-height: 1.25; }
.btn-toggle-booster {
    background: rgba(245, 158, 11, 0.15);
    border: 1.5px solid var(--neon-gold);
    color: var(--neon-gold);
    padding: 6px 14px;
    border-radius: 8px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.btn-toggle-booster:hover {
    background: var(--neon-gold);
    color: var(--bg-dark);
}
.btn-toggle-booster.equipped {
    background: var(--neon-green);
    border-color: var(--neon-green);
    color: var(--bg-dark);
}
.pre-match-actions { display: flex; gap: 12px; margin-top: 14px; }

/* STORY PROLOGUE MODAL */
.story-modal {
    max-width: 820px;
    padding: 24px;
    background: rgba(10, 16, 30, 0.96);
    border-color: rgba(168, 85, 247, 0.45);
    box-shadow: 0 16px 60px rgba(0, 0, 0, 0.85);
}
.story-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.story-title { font-size: 1.4rem; font-weight: 900; color: #fff; }
.comic-stage { display: flex; flex-direction: column; gap: 14px; }
.comic-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    border: 2px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    background: #000;
}
.comic-panel-img { width: 100%; height: 100%; object-fit: cover; }
.comic-panel-badge {
    position: absolute;
    top: 12px; right: 12px;
    background: rgba(0, 0, 0, 0.75);
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    padding: 4px 10px;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 800;
}
.comic-caption-box {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex; flex-direction: column; gap: 6px;
}
.caption-header { display: flex; justify-content: space-between; align-items: center; }
.caption-title { font-size: 1.15rem; font-weight: 800; color: var(--neon-gold); }
.caption-text { font-size: 0.95rem; line-height: 1.6; color: var(--text-main); }

.comic-footer {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 12px;
}
.comic-indicators { display: flex; gap: 8px; }
.comic-indicators .dot {
    width: 10px; height: 10px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.2); cursor: pointer; transition: all 0.2s ease;
}
.comic-indicators .dot.active {
    background: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); transform: scale(1.3);
}
.comic-buttons { display: flex; gap: 10px; }
.comic-btn {
    padding: 8px 18px; border-radius: 10px; font-family: var(--font-heading);
    font-weight: 800; font-size: 0.88rem; cursor: pointer; display: inline-flex;
    align-items: center; gap: 6px; transition: all 0.2s ease;
}
.btn-prev { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-subtle); color: var(--text-main); }
.btn-prev:disabled { opacity: 0.35; cursor: not-allowed; }
.btn-next { background: linear-gradient(135deg, var(--neon-cyan), #0099ff); border: none; color: var(--bg-dark); }
.btn-start-game { background: linear-gradient(135deg, var(--neon-green), #059669); border: none; color: var(--bg-dark); }
.btn-skip-story {
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border-subtle); color: var(--text-muted);
    padding: 6px 14px; border-radius: 10px; cursor: pointer;
}

/* ==========================================================================
   CLEAN CANDY CRUSH RESULT MODAL (⭐ ⭐ ⭐ & FIXED +1,000 CR)
   ========================================================================== */
.result-modal {
    text-align: center;
    max-width: 620px !important;
    width: 95% !important;
    padding: 20px 24px !important;
    overflow: hidden !important; /* Mencegah scrollbar muncul pada modal hasil */
    overflow-y: hidden !important;
    max-height: 96vh !important;
    scrollbar-width: none !important;
}
.result-modal::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}
.stars-rating-container {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin-bottom: 8px;
}
.star-icon {
    font-size: 2.7rem;
    color: rgba(255, 255, 255, 0.15);
    transition: all 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.star-icon.earned {
    color: var(--neon-gold);
    text-shadow: 0 0 25px var(--neon-gold-glow);
    animation: starPop 0.5s ease-out;
}
@keyframes starPop {
    0% { transform: scale(0.4) rotate(-30deg); }
    70% { transform: scale(1.3) rotate(10deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.result-title-large {
    font-size: 1.85rem;
    font-weight: 900;
    margin-bottom: 4px;
    background: linear-gradient(135deg, #fff 0%, var(--neon-gold) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.result-sub {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 14px;
}

.clean-stats-card {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 10px 12px !important;
    margin-bottom: 18px !important;
    align-items: stretch !important;
    box-sizing: border-box !important;
    width: 100% !important;
}
.clean-stats-card.two-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}
.clean-stat-box { 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    justify-content: center;
    gap: 4px; 
    padding: 8px 6px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-width: 0 !important;
    box-sizing: border-box !important;
}
.clean-stat-box .lbl {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--text-dim);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.clean-stat-box .val {
    font-family: var(--font-mono);
    font-size: 1.18rem;
    font-weight: 900;
    white-space: nowrap;
}
.highlight-box {
    background: rgba(245, 158, 11, 0.12) !important;
    border: 1px solid rgba(245, 158, 11, 0.35) !important;
}
.cyan-highlight {
    background: rgba(0, 240, 255, 0.1) !important;
    border: 1px solid rgba(0, 240, 255, 0.3) !important;
}

.result-actions { display: flex; gap: 12px; }
.mode-btn {
    flex: 1; padding: 12px 16px; border-radius: 14px; font-family: var(--font-heading);
    font-weight: 800; font-size: 0.95rem; cursor: pointer; border: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    transition: all 0.2s ease;
}
.mode-primary {
    background: linear-gradient(135deg, var(--neon-cyan), #0099ff);
    color: var(--bg-dark);
    box-shadow: 0 4px 20px var(--neon-cyan-glow);
}
.mode-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 25px var(--neon-cyan); }
.mode-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glow);
    color: var(--text-main);
}
.mode-secondary:hover { background: rgba(0, 240, 255, 0.15); transform: translateY(-2px); }

/* Board Glitch Shake Animation */
@keyframes boardGlitchShake {
    0% { transform: translate(0, 0); filter: hue-rotate(0deg); }
    20% { transform: translate(-5px, 3px); filter: hue-rotate(45deg); }
    40% { transform: translate(5px, -3px); filter: hue-rotate(90deg); }
    60% { transform: translate(-3px, -2px); filter: hue-rotate(180deg); }
    80% { transform: translate(3px, 2px); filter: hue-rotate(270deg); }
    100% { transform: translate(0, 0); filter: hue-rotate(0deg); }
}
.board-glitch-shake {
    animation: boardGlitchShake 0.35s ease-out;
}

/* EMP Shockwave Ring Animation */
.emp-shockwave-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.1);
    width: 480px;
    height: 480px;
    border-radius: 50%;
    border: 3.5px solid var(--neon-purple);
    box-shadow: 0 0 35px var(--neon-purple), inset 0 0 35px var(--neon-purple);
    pointer-events: none;
    z-index: 25;
    animation: empShockwaveExpand 0.6s cubic-bezier(0.1, 0.9, 0.2, 1) forwards;
}
@keyframes empShockwaveExpand {
    0% { transform: translate(-50%, -50%) scale(0.1); opacity: 1; }
    80% { transform: translate(-50%, -50%) scale(1.05); opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1.25); opacity: 0; }
}

/* ==========================================================================
   ANNOUNCER & FLOATING FX
   ========================================================================== */
.combat-announcer {
    position: fixed; top: 38%; left: 50%;
    transform: translate(-50%, -50%) scale(0.6);
    pointer-events: none; z-index: 999;
    font-family: var(--font-comic); font-size: clamp(2.8rem, 5.5vw, 4.4rem);
    letter-spacing: 2px; text-transform: uppercase; text-align: center;
    opacity: 0; white-space: nowrap;
    -webkit-text-stroke: 2.5px rgba(0, 0, 0, 0.95);
    paint-order: stroke fill;
}
.combat-announcer.active {
    animation: announcerPunch 1.25s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
@keyframes announcerPunch {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5) rotate(-3deg); }
    15% { opacity: 1; transform: translate(-50%, -50%) scale(1.15) rotate(1deg); }
    30% { transform: translate(-50%, -50%) scale(1.0) rotate(0deg); }
    80% { opacity: 1; transform: translate(-50%, -50%) scale(1.0); }
    100% { opacity: 0; transform: translate(-50%, -65%) scale(1.06); }
}
.announcer-blue {
    color: #38bdf8;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.95), 0 0 25px rgba(56, 189, 248, 0.85);
}
.announcer-purple {
    color: #c084fc;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.95), 0 0 25px rgba(192, 132, 252, 0.85);
}
.announcer-gold {
    color: #fbbf24;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.95), 0 0 25px rgba(251, 191, 36, 0.85);
}
.announcer-red {
    color: #f87171;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.95), 0 0 25px rgba(248, 113, 113, 0.9);
}

.fx-overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 99; }
.floating-dmg {
    position: absolute; font-family: var(--font-heading); font-weight: 900; font-size: 1.25rem;
    color: var(--neon-pink); text-shadow: 0 0 12px var(--neon-pink);
    animation: floatUp 0.85s ease-out forwards;
}
@keyframes floatUp {
    0% { transform: translateY(0) scale(0.8); opacity: 1; }
    40% { transform: translateY(-28px) scale(1.22); opacity: 1; }
    100% { transform: translateY(-55px) scale(1); opacity: 0; }
}

@media (max-width: 980px) {
    .battlefield-layout { grid-template-columns: 1fr; justify-items: center; }
    .grid-card, .sidebar-layout { width: 100%; max-width: 580px; }
    .hud-actions .btn-text { display: none; }
}

/* ==========================================================================
   SURVIVAL TELEMETRY CARD (MINIMALIST STATS)
   ========================================================================== */
.survival-telemetry-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 41, 59, 0.75) 100%);
    border: 1px solid rgba(56, 189, 248, 0.35);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), inset 0 0 15px rgba(56, 189, 248, 0.08);
}
.survival-stats-minimal {
    display: flex;
    flex-direction: row;
    gap: 10px;
    margin-top: 10px;
    align-items: stretch;
}
.survival-stat-box {
    background: rgba(10, 15, 29, 0.88);
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.6);
    transition: all 0.25s ease;
    min-width: 0;
}
.survival-score-box {
    flex: 2; /* Mengambil 2/3 bagian tempat */
}
.survival-time-box {
    flex: 1; /* Mengambil 1/3 bagian tempat */
    text-align: center;
    align-items: center;
}
.survival-time-box .survival-stat-label {
    justify-content: center;
}
.survival-stat-box:hover {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.2), inset 0 0 14px rgba(0, 0, 0, 0.6);
}
.survival-stat-label {
    font-family: var(--font-heading);
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.survival-stat-val {
    font-family: var(--font-mono);
    font-size: 1.45rem;
    font-weight: 900;
    letter-spacing: 0.03em;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.survival-time-box .survival-stat-val {
    font-size: 1.45rem;
}

/* ==========================================================================
   MATCH START CYBER COUNTDOWN OVERLAY
   ========================================================================== */
.match-countdown-overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(5, 8, 16, 0.82);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 60;
    pointer-events: all;
    opacity: 0;
    transition: opacity 0.22s ease;
}
.match-countdown-overlay.active {
    opacity: 1;
}
.countdown-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 12px;
    user-select: none;
}
.countdown-badge {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.15em;
    color: var(--neon-cyan);
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid var(--neon-cyan);
    padding: 5px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}
.countdown-digit {
    font-family: var(--font-heading);
    font-size: clamp(4.5rem, 11vw, 6.8rem);
    font-weight: 900;
    line-height: 1;
    color: #ffffff;
    text-shadow: 0 0 35px var(--neon-cyan), 0 0 70px var(--neon-cyan);
    transform: scale(0.6);
    opacity: 0;
}
.countdown-digit.animate-pulse {
    animation: countdownPulse 0.65s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}
.countdown-digit.start-text {
    font-size: clamp(3rem, 8vw, 4.5rem);
    color: var(--neon-gold);
    text-shadow: 0 0 40px var(--neon-gold), 0 0 80px var(--neon-gold);
}
@keyframes countdownPulse {
    0% { transform: scale(0.35); opacity: 0; filter: blur(12px); }
    25% { transform: scale(1.22); opacity: 1; filter: blur(0px); }
    55% { transform: scale(1.0); opacity: 1; }
    85% { transform: scale(1.0); opacity: 1; }
    100% { transform: scale(1.12); opacity: 0.85; }
}
.countdown-subtitle {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.06em;
    min-height: 1.2em;
}

/* ==========================================================================
   TACTICAL DOCK QUICK-BUY STYLES
   ========================================================================== */
.tactical-ability-btn.can-quick-buy {
    opacity: 0.95;
    border-style: dashed;
    border-color: rgba(245, 158, 11, 0.6);
}
.tactical-ability-btn.can-quick-buy:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: var(--neon-gold);
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
}
.tactical-ability-btn.can-quick-buy .ability-badge {
    background: rgba(245, 158, 11, 0.25);
    border-color: var(--neon-gold);
    color: var(--neon-gold);
    font-size: 0.72rem;
}

/* ==========================================================================
   MODAL 5: EMERGENCY DEADLOCK PROTOCOL
   ========================================================================== */
.deadlock-modal {
    max-width: 540px !important;
    width: 95% !important;
    padding: 18px 24px !important;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96) 0%, rgba(30, 41, 59, 0.92) 100%);
    border: 1px solid rgba(239, 68, 68, 0.4);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(239, 68, 68, 0.2);
    text-align: center;
    overflow: hidden !important;
    overflow-y: hidden !important;
}
.deadlock-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 6px 16px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.deadlock-title {
    font-family: var(--font-heading);
    font-size: 1.85rem;
    font-weight: 900;
    color: #f87171;
    margin-bottom: 10px;
    letter-spacing: 0.04em;
    text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}
.deadlock-sub {
    font-size: 0.92rem;
    color: var(--text-muted);
    margin-bottom: 22px;
    line-height: 1.5;
}
.deadlock-actions-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}
.deadlock-action-card {
    background: rgba(10, 15, 29, 0.88);
    border: 1px solid var(--border-glow);
    border-radius: 14px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: all 0.22s ease;
    cursor: pointer;
    text-align: left;
}
.deadlock-action-card:hover {
    transform: translateY(-2px);
    border-color: var(--neon-cyan);
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.25);
    background: rgba(15, 23, 42, 0.95);
}
.deadlock-action-card.buy-card {
    border-color: rgba(245, 158, 11, 0.4);
}
.deadlock-action-card.buy-card:hover {
    border-color: var(--neon-gold);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.25);
}
.deadlock-card-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.deadlock-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}
.deadlock-card-info h4 {
    font-family: var(--font-heading);
    font-size: 0.98rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 3px;
}
.deadlock-card-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.deadlock-card-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}
.deadlock-footer {
    display: flex;
    justify-content: center;
}
.btn-deadlock-surrender {
    width: 100%;
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.35);
}
.btn-deadlock-surrender:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

/* ==========================================================================
   THE ANCIENT MONSTER HUNTER - FULL IMAGE-BASED DARK OBSIDIAN UI
   Charcoal Black Textures, Image Sprites, & Full-Screen Comic Theater
   ========================================================================== */

/* Dark Obsidian Card Panels with Image-Textured Borders */
.cyber-card, .level-card, .cyber-modal, .cyber-hud-header {
    position: relative;
    border: 2px solid #2d3748 !important;
    outline: 1px solid rgba(217, 119, 6, 0.45);
    background-color: #070a12 !important;
    background-image: 
        linear-gradient(165deg, rgba(11, 16, 26, 0.94) 0%, rgba(5, 7, 13, 0.98) 100%),
        url("assets/ui/frame_stone_dark.jpg") !important;
    background-size: cover;
    background-position: center;
    box-shadow: 
        0 14px 40px rgba(0, 0, 0, 0.85),
        inset 0 1px 1px rgba(255, 255, 255, 0.1),
        inset 0 0 25px rgba(0, 0, 0, 0.9) !important;
}

/* Ornate Dark Bronze Corner Rivets for Game Cards */
.cyber-card::before, .cyber-modal::before, .grid-card::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px;
    width: 16px; height: 16px;
    border-top: 3px solid #d97706;
    border-left: 3px solid #d97706;
    border-top-left-radius: 10px;
    pointer-events: none;
    z-index: 5;
    filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.6));
}
.cyber-card::after, .cyber-modal::after, .grid-card::after {
    content: '';
    position: absolute;
    bottom: -2px; right: -2px;
    width: 16px; height: 16px;
    border-bottom: 3px solid #d97706;
    border-right: 3px solid #d97706;
    border-bottom-right-radius: 10px;
    pointer-events: none;
    z-index: 5;
    filter: drop-shadow(0 0 4px rgba(217, 119, 6, 0.6));
}

/* Header HUD Banner */
.cyber-hud-header {
    border-radius: 18px !important;
    background: linear-gradient(90deg, rgba(10, 14, 22, 0.98) 0%, rgba(18, 25, 40, 0.96) 50%, rgba(10, 14, 22, 0.98) 100%) !important;
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.75), inset 0 1px 1px rgba(217, 119, 6, 0.4) !important;
}
.brand-title {
    font-size: 1.55rem !important;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 10px rgba(217, 119, 6, 0.4);
}
.brand-title .sub-title {
    color: #f59e0b !important;
    font-size: 0.82rem;
    letter-spacing: 2.5px;
}

/* Match-3 Altar Grid Board with Image Frame */
.grid-card {
    border-radius: 24px !important;
    border: 3px solid #1f293d !important;
    outline: 1.5px solid rgba(217, 119, 6, 0.5);
    background-color: #060910 !important;
    background-image: 
        linear-gradient(180deg, rgba(6, 9, 16, 0.92) 0%, rgba(3, 5, 10, 0.96) 100%),
        url("assets/ui/board_frame_altar.jpg") !important;
    background-size: cover;
    background-position: center;
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.9),
        inset 0 0 35px rgba(0, 0, 0, 0.95),
        0 0 20px rgba(217, 119, 6, 0.15) !important;
    position: relative;
}
.cyber-grid {
    border: 2px solid rgba(217, 119, 6, 0.3) !important;
    border-radius: 18px !important;
    background: radial-gradient(circle at 50% 50%, #0a0f1b 0%, #030408 100%) !important;
    box-shadow: inset 0 0 35px rgba(0, 0, 0, 0.98), 0 0 15px rgba(217, 119, 6, 0.1) !important;
}
.grid-node {
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, 0.06) !important;
    background: rgba(255, 255, 255, 0.025) !important;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08), 0 2px 6px rgba(0, 0, 0, 0.5) !important;
}
.grid-node:hover {
    background: rgba(217, 119, 6, 0.12) !important;
    border-color: rgba(217, 119, 6, 0.45) !important;
    transform: scale(1.04);
}

/* Boss Card: Aethelgard Sang Apex Titan */
.boss-card {
    border: 2px solid rgba(239, 68, 68, 0.55) !important;
    outline: 1px solid rgba(249, 115, 22, 0.35);
    background: linear-gradient(135deg, rgba(45, 8, 8, 0.6) 0%, rgba(9, 13, 22, 0.95) 100%) !important;
    box-shadow: 0 12px 32px rgba(239, 68, 68, 0.2), inset 0 0 25px rgba(239, 68, 68, 0.12) !important;
}
.boss-card::before { border-color: #ef4444 !important; }
.boss-card::after { border-color: #f97316 !important; }
.titan-boss-svg {
    width: 52px;
    height: 52px;
    filter: drop-shadow(0 0 12px rgba(249, 115, 22, 0.85));
    animation: titanBreathe 2.4s ease-in-out infinite alternate;
}
@keyframes titanBreathe {
    0% { transform: scale(0.96); filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.7)); }
    100% { transform: scale(1.05); filter: drop-shadow(0 0 18px rgba(239, 68, 68, 0.95)); }
}

/* Companion Card: Lumen Roh Burung Hantu Kristal */
.drone-card {
    border: 2px solid rgba(56, 189, 248, 0.45) !important;
    outline: 1px solid rgba(16, 185, 129, 0.25);
    background: linear-gradient(135deg, rgba(6, 45, 35, 0.4) 0%, rgba(9, 13, 22, 0.96) 100%) !important;
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.15), inset 0 0 20px rgba(56, 189, 248, 0.08) !important;
}
.drone-card::before { border-color: #38bdf8 !important; }
.drone-card::after { border-color: #34d399 !important; }
.owl-avatar {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}
.owl-svg {
    width: 54px;
    height: 54px;
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.75));
    animation: owlFloat 3s ease-in-out infinite alternate;
}
@keyframes owlFloat {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-4px) scale(1.03); }
}
.drone-comic-bubble {
    background: rgba(8, 12, 20, 0.94) !important;
    border: 1.5px solid rgba(217, 119, 6, 0.35) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.08) !important;
}
.bubble-speaker-header .bubble-tag {
    color: #f59e0b !important;
    font-weight: 800;
}
.bubble-text {
    font-size: 0.88rem !important;
    color: #f1f5f9 !important;
    line-height: 1.5 !important;
    font-style: italic;
}

/* Tactical Relics & Abilities Dock */
.abilities-card {
    border: 2px solid rgba(147, 51, 234, 0.4) !important;
}
.tactical-ability-btn {
    border: 1.5px solid rgba(255, 255, 255, 0.08) !important;
    background: linear-gradient(135deg, rgba(20, 26, 40, 0.85) 0%, rgba(5, 8, 14, 0.95) 100%) !important;
    border-radius: 14px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
}
.tactical-ability-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.01) !important;
    border-color: #f59e0b !important;
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.3) !important;
}
.tactical-ability-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.99) !important;
}

/* ==========================================================================
   IMAGE-TEXTURED 3D GAME BUTTONS
   ========================================================================== */
.mode-btn, .btn-play-level, .comic-btn, .theater-btn-skip {
    border-radius: 12px !important;
    font-family: var(--font-heading) !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    transition: all 0.2s cubic-bezier(0.18, 0.89, 0.32, 1.28) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.2) !important;
}

/* Explicit Hidden Class */
.hidden,
[hidden],
#btnStoryStartGame.hidden,
#btnStoryNext.hidden,
#btnStoryPrev.hidden {
    display: none !important;
}

/* Primary Action Buttons: High-Fidelity Golden Gradient (No JPG Texture) */
.mode-primary, .btn-start-game, .btn-play-level.unlocked, .btn-play-endless {
    background: linear-gradient(180deg, #f59e0b 0%, #d97706 45%, #b45309 80%, #78350f 100%) !important;
    border: 1.5px solid #fbbf24 !important;
    color: #ffffff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
    box-shadow: 0 5px 18px rgba(245, 158, 11, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
}
.mode-primary:hover:not(:disabled), .btn-start-game:hover:not(:disabled), .btn-play-level.unlocked:hover {
    transform: translateY(-2px) scale(1.02);
    background: linear-gradient(180deg, #fbbf24 0%, #f59e0b 45%, #d97706 80%, #92400e 100%) !important;
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.5) !important;
    filter: brightness(1.08);
}

/* Secondary Action Buttons: Clean Dark Obsidian Slate (No JPG Texture) */
.mode-secondary, .btn-prev, .theater-btn-skip, .btn-next {
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 60%, #090d16 100%) !important;
    border: 1.5px solid #334155 !important;
    color: #f1f5f9 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.9);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.12) !important;
}
.mode-secondary:hover:not(:disabled), .btn-prev:hover:not(:disabled), .theater-btn-skip:hover, .btn-next:hover {
    transform: translateY(-2px);
    background: linear-gradient(180deg, #334155 0%, #1e293b 60%, #0f172a 100%) !important;
    border-color: #00f0ff !important;
    color: #ffffff !important;
    box-shadow: 0 6px 20px rgba(0, 240, 255, 0.35) !important;
    filter: brightness(1.1);
}

.mode-btn:active:not(:disabled), .btn-play-level:active:not(:disabled), .comic-btn:active:not(:disabled) {
    transform: translateY(1px) scale(0.98) !important;
}

/* ==========================================================================
   BORDERED FULL-SCREEN COMIC THEATER LAYOUT
   ========================================================================== */
.fullscreen-theater-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(2, 3, 6, 0.97) !important;
    backdrop-filter: blur(25px) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 9999 !important;
    padding: 16px !important;
    margin: 0 !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.fullscreen-theater-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.theater-screen-frame {
    width: 95vw;
    height: 94vh;
    max-width: 1360px;
    background: #060910;
    border: 3.5px solid #1e293b;
    outline: 2px solid rgba(217, 119, 6, 0.65);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    box-shadow: 
        0 0 60px rgba(0, 0, 0, 0.98),
        inset 0 0 40px rgba(0, 0, 0, 0.95),
        0 0 30px rgba(217, 119, 6, 0.25);
}

.theater-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 22px;
    background: linear-gradient(180deg, rgba(12, 17, 28, 0.98) 0%, rgba(6, 9, 16, 0.95) 100%);
    border-bottom: 2px solid rgba(217, 119, 6, 0.3);
    z-index: 10;
}
.theater-brand {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.theater-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    color: #f59e0b;
    letter-spacing: 1.5px;
    text-transform: uppercase;
}
.theater-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #f8fafc;
    letter-spacing: 0.5px;
}
.theater-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}
.theater-btn-skip {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* The Central ~90% Artwork Stage */
.theater-stage {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #020306;
    padding: 12px 16px;
}
.theater-art-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    overflow: hidden;
    border: 2px solid rgba(217, 119, 6, 0.4);
    box-shadow: 
        inset 0 0 30px rgba(0, 0, 0, 0.85),
        0 8px 30px rgba(0, 0, 0, 0.9);
}
.theater-art-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    transition: transform 0.4s ease;
}
.theater-chapter-badge {
    display: none !important; /* Dihapus sesuai permintaan agar tampilan gambar bersih */
}

/* Floating Narrative Caption at Bottom of Artwork */
.theater-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(4, 6, 12, 0.90) 25%, rgba(2, 3, 8, 0.98) 100%);
    padding: 24px 32px 18px 32px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(217, 119, 6, 0.35);
    z-index: 5;
    cursor: pointer;
    user-select: none;
}
.theater-caption-header,
.theater-caption-title {
    display: none !important; /* Sembunyikan judul di cutscene sesuai request */
}
.theater-caption-text {
    font-size: 1.08rem;
    line-height: 1.7;
    color: #f1f5f9;
    font-family: var(--font-heading);
    letter-spacing: 0.3px;
    min-height: 4.8em;
}

.speaker-lumen {
    color: #00f0ff;
    font-weight: 800;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.75), 0 0 20px rgba(16, 185, 129, 0.4);
    letter-spacing: 0.8px;
    margin-right: 8px;
    display: inline-block;
}

.typing-cursor {
    display: inline-block;
    width: 3px;
    height: 1.15em;
    background-color: var(--neon-cyan);
    margin-left: 4px;
    vertical-align: text-bottom;
    animation: blinkCursor 0.7s infinite;
}

@keyframes blinkCursor {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.theater-btn-pulse {
    animation: pulseStartGlow 1.4s infinite ease-in-out;
}

@keyframes pulseStartGlow {
    0% {
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 25px rgba(245, 158, 11, 0.95), 0 0 40px rgba(245, 158, 11, 0.4);
        transform: scale(1.04);
    }
    100% {
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.5);
        transform: scale(1);
    }
}

.theater-audio-unlock {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(10, 16, 30, 0.94);
    border: 2px solid var(--neon-cyan);
    color: #fff;
    padding: 10px 24px;
    border-radius: 30px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.5);
    z-index: 25;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: bounceAudioPrompt 1.4s infinite ease-in-out;
}

@keyframes bounceAudioPrompt {
    0%, 100% {
        transform: translateX(-50%) scale(1);
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
        box-shadow: 0 0 35px rgba(0, 240, 255, 0.85);
    }
}

/* Theater Bottom Controller */
.theater-bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 24px;
    background: linear-gradient(0deg, rgba(12, 17, 28, 0.98) 0%, rgba(6, 9, 16, 0.95) 100%);
    border-top: 2px solid rgba(217, 119, 6, 0.35);
    z-index: 10;
}
.theater-bottom-left, .theater-bottom-right {
    min-width: 140px;
    display: flex;
    align-items: center;
}
.theater-bottom-left {
    justify-content: flex-start;
}
.theater-bottom-right {
    justify-content: flex-end;
}
.comic-indicators {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex: 1;
}
.comic-indicators .dot {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: all 0.22s ease;
}
.comic-indicators .dot.active {
    background: #f59e0b;
    border-color: #fef08a;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.85);
    transform: scale(1.35);
}
.theater-nav-buttons {
    display: flex;
    gap: 12px;
}
.comic-btn {
    padding: 10px 22px;
    font-size: 0.94rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Exit Button in Level Select Modal */
.btn-exit-to-menu {
    background: rgba(239, 68, 68, 0.15);
    border: 1.5px solid rgba(239, 68, 68, 0.45);
    color: #fca5a5;
    padding: 8px 16px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.22s ease;
}
.btn-exit-to-menu:hover {
    background: rgba(239, 68, 68, 0.35);
    border-color: #ef4444;
    color: #ffffff;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.5);
    transform: translateY(-1px);
}
.btn-exit-to-menu:active {
    transform: scale(0.97);
}
.theater-nav-buttons .comic-btn {
    padding: 9px 20px;
    font-size: 0.92rem;
}

/* ==========================================================================
   PERFORMANCE & HARDWARE ACCELERATION OPTIMIZATIONS
   Auto GPU Detection & Low-Quality / Battery Saver Mode
   ========================================================================== */

/* GPU Compositing Promote */
.cyber-grid, .grid-node, .candy-sprite-wrapper {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
}

/* Low Quality / Performance Mode (.low-quality) */
body.low-quality * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body.low-quality .ambient-glow,
body.low-quality .cyber-scanline {
    display: none !important;
}

body.low-quality .cyber-card,
body.low-quality .grid-card,
body.low-quality .cyber-modal,
body.low-quality .cyber-hud-header {
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.7) !important;
}

body.low-quality .titan-boss-svg,
body.low-quality .owl-svg {
    animation: none !important;
    filter: none !important;
}

body.low-quality .cyber-modal-overlay {
    background: rgba(4, 6, 12, 0.96) !important;
}

body.low-quality .theater-screen-frame {
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.9) !important;
}

#btnQualityToggle.perf-active {
    background: rgba(16, 185, 129, 0.25) !important;
    border-color: #10b981 !important;
    color: #10b981 !important;
}

/* ==========================================================================
   MAIN MENU TITLE SCREEN STYLES
   ========================================================================== */
.main-menu-overlay {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10001 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden !important;
}

.main-menu-overlay.active {
    opacity: 1 !important;
    pointer-events: auto !important;
}

.main-menu-bg-art {
    position: absolute;
    inset: -20px;
    background: url('assets/story/chapter_survival.webp') center center / cover no-repeat;
    filter: saturate(1.15) brightness(0.65);
    transform: scale(1.02);
    animation: slowMenuZoom 35s infinite alternate ease-in-out;
}

@keyframes slowMenuZoom {
    0% { transform: scale(1.02) translateY(0); }
    100% { transform: scale(1.08) translateY(-10px); }
}

.main-menu-vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(3, 7, 18, 0.45) 0%, rgba(2, 4, 10, 0.88) 58%, rgba(1, 2, 6, 0.98) 100%);
    pointer-events: none;
}

.main-menu-content {
    position: relative;
    z-index: 2;
    max-width: 680px;
    width: 92%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    animation: menuFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes menuFadeUp {
    0% { opacity: 0; transform: translateY(20px) scale(0.96); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.main-menu-crest {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    border: 3px solid #f59e0b;
    box-shadow: 0 0 28px rgba(245, 158, 11, 0.65), 0 0 50px rgba(0, 240, 255, 0.3);
    overflow: hidden;
    margin: 0 auto 10px auto;
    background: #020617;
    transition: transform 0.3s ease;
}

.main-menu-crest:hover {
    transform: scale(1.08) rotate(4deg);
}

.main-menu-crest .crest-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.main-menu-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.9);
    border: 1.5px solid rgba(0, 240, 255, 0.5);
    color: var(--neon-cyan);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 2px;
    padding: 5px 16px;
    border-radius: 20px;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
    margin-bottom: 6px;
}

.main-menu-title {
    font-size: 3.1rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    line-height: 1.1;
    color: #ffffff;
    background: linear-gradient(180deg, #ffffff 0%, #fef08a 45%, #f59e0b 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.95)) drop-shadow(0 0 25px rgba(245, 158, 11, 0.5));
    margin-bottom: 4px;
}

.main-menu-subtitle {
    display: block;
    font-size: 1.15rem;
    letter-spacing: 5px;
    font-weight: 800;
    color: var(--neon-cyan);
    -webkit-text-fill-color: var(--neon-cyan);
    text-shadow: 0 0 16px rgba(0, 240, 255, 0.7);
    margin-top: 6px;
}

.main-menu-tagline {
    font-size: 0.98rem;
    line-height: 1.6;
    color: #cbd5e1;
    max-width: 560px;
    margin: 6px auto 0 auto;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.85);
}

.main-menu-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 440px;
    margin: 16px auto 0 auto;
    gap: 15px;
}

.menu-action-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    font-family: var(--font-heading);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.btn-play-primary {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28) 0%, rgba(217, 119, 6, 0.55) 50%, rgba(180, 83, 9, 0.4) 100%);
    border: 2px solid #f59e0b;
    border-radius: 20px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    box-shadow: 0 0 28px rgba(245, 158, 11, 0.5), inset 0 0 18px rgba(254, 240, 138, 0.25);
    animation: heroBtnPulse 2.2s infinite ease-in-out;
}

@keyframes heroBtnPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(245, 158, 11, 0.4), inset 0 0 15px rgba(254, 240, 138, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 35px rgba(245, 158, 11, 0.85), inset 0 0 25px rgba(254, 240, 138, 0.4);
        transform: scale(1.02);
    }
}

.btn-play-primary:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.4) 0%, rgba(217, 119, 6, 0.7) 100%);
    border-color: #fef08a;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 0 45px rgba(245, 158, 11, 0.95);
}

.btn-play-primary:active {
    transform: scale(0.98);
}

.btn-play-primary .play-icon {
    font-size: 1.8rem;
    color: #fef08a;
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
}

.btn-play-texts {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.btn-play-texts .play-main-text {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.btn-play-texts .play-sub-text {
    font-size: 0.78rem;
    color: #fef08a;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.menu-secondary-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-secondary {
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px solid rgba(255, 255, 255, 0.15);
    color: #e2e8f0;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(30, 41, 59, 0.95);
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}

.btn-prologue-highlight {
    background: rgba(0, 240, 255, 0.12) !important;
    border-color: rgba(0, 240, 255, 0.4) !important;
}

.btn-prologue-highlight:hover {
    background: rgba(0, 240, 255, 0.25) !important;
    border-color: var(--neon-cyan) !important;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.5) !important;
}

.main-menu-footer {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.82rem;
    color: #94a3b8;
    margin-top: 8px;
}

.main-menu-footer .menu-footer-stat {
    font-family: var(--font-mono);
    color: #e2e8f0;
    font-weight: 800;
}

.main-menu-footer .menu-footer-tip {
    font-size: 0.78rem;
    color: #cbd5e1;
}

.main-menu-footer .menu-footer-version {
    font-size: 0.72rem;
    color: #64748b;
    letter-spacing: 1px;
}

.hud-btn-home {
    background: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #fef08a;
}
.hud-btn-home:hover {
    background: #f59e0b;
    color: #020617;
}

/* Low Quality Mode for Main Menu */
body.low-quality .main-menu-bg-art {
    animation: none !important;
}
body.low-quality .btn-play-primary {
    animation: none !important;
}




/* ==========================================================================
   COMPACT BOARD HEADER & PAUSE MENU STYLES
   ========================================================================== */
.compact-board-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 15, 29, 0.75);
    border: 1px solid rgba(0, 240, 255, 0.25);
    border-radius: 14px;
    padding: 10px 18px;
    margin-bottom: 8px;
    box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.05);
}

.board-header-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.board-header-stat .stat-icon {
    font-size: 1.35rem;
    filter: drop-shadow(0 0 8px currentColor);
}

.board-header-stat .stat-meta {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.board-header-stat .stat-label {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    color: #94a3b8;
    letter-spacing: 1.5px;
}

.board-header-stat .stat-value {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}

.board-header-stat.score-stat .stat-value {
    color: #fef08a;
    text-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.board-header-stat.time-stat .stat-value,
.board-header-stat.moves-stat .stat-value {
    color: #e0f2fe;
    text-shadow: 0 0 12px rgba(0, 240, 255, 0.5);
}

.hud-btn-pause {
    background: rgba(0, 240, 255, 0.12);
    border-color: rgba(0, 240, 255, 0.5);
    color: var(--neon-cyan);
}

.hud-btn-pause:hover {
    background: var(--neon-cyan);
    color: #020617;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.6);
}

.pause-modal {
    max-width: 440px !important;
    width: 92% !important;
    padding: 16px 20px !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
}

.pause-stats-banner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: rgba(5, 10, 20, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 8px;
    margin-bottom: 14px;
    text-align: center;
}

.pause-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.pause-stat-item .lbl {
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: var(--font-mono);
    font-weight: 700;
}

.pause-stat-item .val {
    font-size: 1.05rem;
    font-weight: 900;
    font-family: var(--font-mono);
}

.pause-actions-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.btn-pause-action {
    width: 100%;
    padding: 12px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-danger-action {
    border-color: rgba(239, 68, 68, 0.5) !important;
    color: #fca5a5 !important;
}

.btn-danger-action:hover {
    background: rgba(239, 68, 68, 0.25) !important;
    border-color: #ef4444 !important;
    color: #ffffff !important;
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.4) !important;
}


/* ==========================================================================
   STORY ARCHIVE (ARSIP KISAH) MODAL & CARD STYLES
   ========================================================================== */
.level-select-head-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-head-action {
    background: rgba(0, 240, 255, 0.12);
    border: 1.5px solid rgba(0, 240, 255, 0.45);
    color: var(--neon-cyan);
    padding: 8px 16px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.22s ease;
}

.btn-head-action:hover {
    background: rgba(0, 240, 255, 0.3);
    border-color: var(--neon-cyan);
    color: #ffffff;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
    transform: translateY(-1px);
}

.btn-head-action:active {
    transform: scale(0.97);
}

.btn-menu-archive {
    justify-content: center !important;
    padding: 13px 18px !important;
    border-radius: 16px !important;
    font-size: 0.92rem !important;
}

.story-archive-modal {
    max-width: 860px !important;
    width: 95% !important;
    max-height: 96vh !important;
    padding: 14px 20px !important;
    overflow: hidden !important;
    overflow-y: hidden !important;
}

.story-archive-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 8px !important;
    margin-top: 8px !important;
    max-height: none !important;
    overflow: hidden !important;
    padding-right: 0 !important;
}

.archive-card {
    background: rgba(15, 23, 42, 0.75);
    border: 1.5px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
}

.archive-card.unlocked {
    cursor: pointer;
    border-color: rgba(0, 240, 255, 0.35);
}

.archive-card.unlocked:hover {
    transform: translateY(-2px) scale(1.01);
    border-color: var(--neon-gold);
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.3), 0 0 12px rgba(0, 240, 255, 0.2);
}

.archive-card.locked {
    opacity: 0.55;
    filter: grayscale(0.85);
    cursor: not-allowed;
}

.archive-thumb-wrap {
    width: 100%;
    height: 72px;
    position: relative;
    overflow: hidden;
    background: #020617;
}

.archive-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.archive-card.unlocked:hover .archive-thumb-img {
    transform: scale(1.08);
}

.archive-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(245, 158, 11, 0.6);
    color: #fef08a;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 5px;
    backdrop-filter: blur(4px);
    z-index: 2;
}

.archive-lock-overlay {
    position: absolute;
    inset: 0;
    background: rgba(4, 6, 12, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #cbd5e1;
    z-index: 1;
}

.archive-card-body {
    padding: 6px 8px 8px 8px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 3px;
}

.archive-card-title {
    font-family: var(--font-heading);
    font-size: 0.82rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.archive-card-desc {
    font-size: 0.68rem;
    color: #94a3b8;
    line-height: 1.2;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.archive-status-tag {
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 0.65rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 5px;
    width: fit-content;
}

.archive-card.unlocked .archive-status-tag {
    background: rgba(0, 240, 255, 0.15);
    color: var(--neon-cyan);
    border: 1px solid rgba(0, 240, 255, 0.35);
}

.archive-card.locked .archive-status-tag {
    background: rgba(255, 255, 255, 0.06);
    color: #94a3b8;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   MAIN MENU SURVIVAL BUTTON & CREDITS MODAL STYLES
   ========================================================================== */
.btn-survival-direct {
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.25) 0%, rgba(239, 68, 68, 0.45) 50%, rgba(99, 102, 241, 0.35) 100%);
    border: 2px solid #c084fc;
    border-radius: 20px;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 18px;
    box-shadow: 0 0 24px rgba(168, 85, 247, 0.4), inset 0 0 16px rgba(239, 68, 68, 0.2);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    max-width: 440px;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}
.btn-survival-direct:hover:not(.locked-survival) {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 38px rgba(168, 85, 247, 0.75), inset 0 0 20px rgba(239, 68, 68, 0.35);
    border-color: #f43f5e;
}
.btn-survival-direct.locked-survival {
    opacity: 0.6;
    filter: grayscale(0.65);
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.8) 100%);
    border: 1.5px dashed rgba(255, 255, 255, 0.25);
    box-shadow: none;
    cursor: pointer;
}
.btn-survival-direct .survival-icon {
    font-size: 1.8rem;
    color: #f43f5e;
    filter: drop-shadow(0 0 10px rgba(244, 63, 94, 0.8));
    width: 32px;
    text-align: center;
    flex-shrink: 0;
}
.btn-survival-direct.locked-survival .survival-icon {
    color: #94a3b8;
    filter: none;
}

.main-menu-sub-row {
    display: flex !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 480px !important;
    justify-content: center !important;
}
.main-menu-sub-row .menu-action-btn {
    flex: 1 1 0 !important;
    min-width: 120px !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 11px 10px !important;
    font-size: 0.84rem !important;
    white-space: nowrap !important;
    justify-content: center !important;
    border-radius: 14px !important;
}

/* Floating Survival Locked Alert */
.survival-locked-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    z-index: 10006 !important;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.95), rgba(185, 28, 28, 0.95));
    border: 2px solid #fecaca;
    border-radius: 14px;
    padding: 12px 24px;
    color: #fff;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), 0 0 25px rgba(239, 68, 68, 0.7);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.survival-locked-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* CREDITS MODAL */
#modalCredits {
    z-index: 10005 !important;
}
.credits-modal {
    max-width: 760px !important;
    width: 95% !important;
    max-height: 94vh !important;
    padding: 18px 22px !important;
    overflow: hidden !important;
}
.credits-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 14px 0;
}
.credit-card {
    background: rgba(15, 23, 42, 0.65);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 14px;
    padding: 14px 18px;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.4);
}
.credit-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 8px;
}
.credit-card-header h3 {
    font-size: 0.9rem;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: #fff;
}
.credit-card-content {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.credit-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    gap: 12px;
}
.credit-role {
    color: #94a3b8;
    font-weight: 700;
    flex-shrink: 0;
}
.credit-val {
    color: #f1f5f9;
    font-weight: 600;
    text-align: right;
    font-family: var(--font-mono);
}

/* ==========================================================================
   MODAL REGISTRASI PEMBURU & LEADERBOARD SURVIVAL
   ========================================================================== */
#modalPlayerRegister, #modalLeaderboard {
    z-index: 10005 !important;
}

/* ONBOARDING MODAL */
.register-modal {
    max-width: 520px !important;
    width: 92% !important;
    padding: 22px 26px !important;
}
.register-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin: 14px 0;
}
.register-intro-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(56, 189, 248, 0.25);
    border-radius: 12px;
    padding: 12px 16px;
}
.register-intro-card p {
    font-size: 0.84rem;
    color: #cbd5e1;
    line-height: 1.45;
}
.intro-scroll-icon {
    font-size: 1.25rem;
    margin-top: 2px;
}
.register-form-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.register-form-box label {
    font-size: 0.8rem;
    font-weight: 800;
    font-family: var(--font-mono);
    color: #cbd5e1;
    display: flex;
    align-items: center;
    gap: 6px;
}
.input-with-button {
    display: flex;
    gap: 8px;
}
.input-with-button input {
    flex: 1;
    background: rgba(5, 10, 20, 0.85);
    border: 1.5px solid rgba(56, 189, 248, 0.4);
    border-radius: 10px;
    padding: 11px 16px;
    font-size: 0.95rem;
    font-family: var(--font-mono);
    color: #fff;
    font-weight: 700;
    outline: none;
    transition: all 0.2s ease;
}
.input-with-button input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.4);
}
.btn-dice-random {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 119, 6, 0.4));
    border: 1.5px solid var(--neon-gold);
    color: var(--neon-gold);
    border-radius: 10px;
    padding: 0 16px;
    font-size: 0.85rem;
    font-weight: 800;
    font-family: var(--font-heading);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}
.btn-dice-random:hover {
    background: var(--neon-gold);
    color: #0d131f;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.6);
    transform: scale(1.03);
}
.input-hint {
    font-size: 0.72rem;
    color: #94a3b8;
    font-family: var(--font-mono);
}

/* LEADERBOARD MODAL */
.leaderboard-modal {
    max-width: 820px !important;
    width: 95% !important;
    max-height: 94vh !important;
    padding: 18px 24px !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}
.lb-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}
.leaderboard-status-badge {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 100px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
}
.leaderboard-status-badge.online {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--neon-green);
    color: #6ee7b7;
}
.leaderboard-status-badge.offline {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--neon-gold);
    color: #fde047;
}
.leaderboard-tabs-bar {
    display: flex;
    gap: 10px;
    margin: 10px 0 8px 0;
}
.lb-tab-btn {
    flex: 1;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #94a3b8;
    padding: 10px 14px;
    border-radius: 10px;
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
}
.lb-tab-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
}
.lb-tab-btn.active {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(147, 51, 234, 0.25));
    border-color: var(--neon-cyan);
    color: #fff;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.3);
}
.leaderboard-banner {
    background: rgba(8, 15, 30, 0.6);
    border-left: 3px solid var(--neon-cyan);
    padding: 7px 12px;
    border-radius: 6px;
    font-size: 0.76rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.leaderboard-table-container {
    flex: 1;
    min-height: 220px;
    max-height: 48vh;
    overflow-y: auto !important;
    scrollbar-width: thin !important;
    scrollbar-color: rgba(56, 189, 248, 0.6) rgba(15, 23, 42, 0.7) !important;
    -ms-overflow-style: auto !important;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(5, 9, 18, 0.7);
}
.leaderboard-table-container::-webkit-scrollbar {
    display: block !important;
    width: 6px !important;
}
.leaderboard-table-container::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7) !important;
    border-radius: 4px;
}
.leaderboard-table-container::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-cyan), #0284c7) !important;
    border-radius: 4px;
    box-shadow: 0 0 6px rgba(56, 189, 248, 0.4);
}
.leaderboard-table-container::-webkit-scrollbar-thumb:hover {
    background: var(--neon-gold) !important;
}
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}
.leaderboard-table th {
    position: sticky;
    top: 0;
    background: #0b1329 !important;
    color: #94a3b8;
    font-weight: 800;
    text-align: left;
    padding: 10px 12px;
    border-bottom: 2px solid rgba(56, 189, 248, 0.4);
    z-index: 10;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.6);
}
.leaderboard-table td {
    padding: 8px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: #e2e8f0;
}
.leaderboard-table tr:hover td {
    background: rgba(56, 189, 248, 0.08);
}
.leaderboard-table tr.my-row td {
    background: rgba(245, 158, 11, 0.12);
    border-top: 1px solid rgba(245, 158, 11, 0.4);
    border-bottom: 1px solid rgba(245, 158, 11, 0.4);
    font-weight: 800;
}
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 0.72rem;
}
.rank-badge.rank-1 {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1e1b4b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
}
.rank-badge.rank-2 {
    background: linear-gradient(135deg, #94a3b8, #cbd5e1);
    color: #0f172a;
    box-shadow: 0 0 8px rgba(148, 163, 184, 0.6);
}
.rank-badge.rank-3 {
    background: linear-gradient(135deg, #b45309, #d97706);
    color: #fff;
    box-shadow: 0 0 8px rgba(180, 83, 9, 0.6);
}
.rank-badge.rank-normal {
    color: #94a3b8;
}
.lb-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    gap: 16px;
    width: 100%;
}
.lb-my-record {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: #cbd5e1;
    white-space: nowrap;
    flex: 0 1 auto;
}
.btn-lb-refresh {
    width: auto !important;
    min-width: 0 !important;
    max-width: fit-content !important;
    padding: 8px 20px !important;
    font-size: 0.8rem !important;
    white-space: nowrap !important;
    flex: 0 0 auto !important;
    margin-left: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    border-radius: 8px !important;
    cursor: pointer !important;
}
.btn-survival-lb-action {
    border-color: rgba(245, 158, 11, 0.4) !important;
}
.btn-survival-lb-action:hover {
    border-color: var(--neon-gold) !important;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.5) !important;
}

/* ==========================================================================
   DESKTOP PC FULL-HEIGHT LAYOUT (ZERO SCROLLING)
   ========================================================================== */
@media (min-width: 981px) {
    html, body.cyber-theme {
        height: 100vh !important;
        max-height: 100vh !important;
        overflow: hidden !important; /* Mencegah window scrollbar pada PC */
    }

    .app-container {
        height: 100vh !important;
        max-height: 100vh !important;
        padding: 10px 24px 12px 24px !important;
        gap: 12px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
    }

    .cyber-hud-header {
        padding: 8px 20px !important;
        flex-shrink: 0 !important;
        min-height: 48px !important;
    }

    .battlefield-layout {
        flex: 1 !important;
        min-height: 0 !important;
        gap: 20px !important;
        align-items: stretch !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
    }

    .grid-card {
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 6px !important;
        padding: 8px 12px !important;
        flex-shrink: 0 !important;
    }

    .compact-board-header {
        width: 100% !important;
        margin-bottom: 0 !important;
        padding: 6px 12px !important;
        flex-shrink: 0 !important;
    }

    .grid-board-wrapper {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        flex: 1 !important;
        min-height: 0 !important;
        width: 100% !important;
        position: relative !important;
    }

    /* Ukuran Grid Rune memenuhi layout secara proporsional dan maksimal (Square Aspect Ratio) */
    .cyber-grid {
        width: min(100%, calc(100vh - 165px)) !important;
        height: min(100%, calc(100vh - 165px)) !important;
        max-width: 100% !important;
        max-height: 100% !important;
        aspect-ratio: 1 / 1 !important;
        grid-template-columns: repeat(8, 1fr) !important;
        grid-template-rows: repeat(8, 1fr) !important;
        gap: clamp(4px, 0.6vh, 7px) !important;
        padding: clamp(6px, 1vh, 10px) !important;
        box-sizing: border-box !important;
    }

    .grid-node {
        width: 100% !important;
        height: 100% !important;
        aspect-ratio: 1 / 1 !important;
        min-width: 0 !important;
        min-height: 0 !important;
    }

    .sprite-node {
        width: 86% !important;
        height: 86% !important;
    }

    .grid-footer-bar {
        width: 100% !important;
        margin-top: 0 !important;
        padding: 4px 10px !important;
        flex-shrink: 0 !important;
    }

    .sidebar-layout {
        flex: 1 !important;
        min-height: 0 !important;
        gap: 14px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow-y: auto !important;
        scrollbar-width: none !important;
    }
    .sidebar-layout::-webkit-scrollbar {
        display: none !important;
    }

    .cyber-card {
        padding: 14px 18px !important;
    }
}
