﻿        :root {
            --primary: #6c5ce7;
            --secondary: #a29bfe;
            --accent: #fd79a8;
            --bg-gradient: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
            --glass-bg: rgba(255, 255, 255, 0.95);
            --glass-border: rgba(255, 255, 255, 0.2);
            --text-dark: #2d3436;
            --text-light: #636e72;
        }

        * {
            box-sizing: border-box;
            font-family: 'Poppins', sans-serif;
        }

        body {
            background: var(--bg-gradient);
            min-height: 100vh;
            display: flex;
            justify-content: center;
            align-items: center;
            margin: 0;
            overflow-x: hidden;
            -webkit-tap-highlight-color: transparent;
            user-select: none;
        }

        /* Lobby Card Styles - Modern Glassmorphism */
        .container {
            background: rgba(255, 255, 255, 0.85);
            backdrop-filter: blur(15px);
            -webkit-backdrop-filter: blur(15px);
            border-radius: 20px;
            box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
            padding: 25px;
            /* More compact */
            width: 90%;
            max-width: 400px;
            /* Reduced width */
            text-align: center;
            border: 1px solid rgba(255, 255, 255, 0.3);
            animation: fadeIn 0.5s ease;
        }

        .game-title {
            background: linear-gradient(to right, #6c5ce7, #fd79a8, #6c5ce7);
            background-size: 200% auto;
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            font-size: 2.2rem;
            /* Slightly smaller for better fit */
            font-weight: 800;
            margin-bottom: 5px;
            /* Reduced space */
            letter-spacing: -1px;
            animation: titleShine 4s linear infinite;
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        @keyframes titleShine {
            to {
                background-position: 200% center;
            }
        }

        .game-version {
            font-size: 10px;
            font-weight: 700;
            color: rgba(108, 92, 231, 0.5);
            background: rgba(108, 92, 231, 0.05);
            padding: 2px 8px;
            border-radius: 4px;
            letter-spacing: 1px;
            text-transform: uppercase;
            width: fit-content;
            margin-top: 5px;
            -webkit-text-fill-color: #6c5ce7;
            /* Reset transparency from parent */
        }

        .input-group input {
            width: 100%;
            padding: 12px 16px;
            /* Slimmer */
            border: 1.5px solid #dfe6e9;
            border-radius: 12px;
            font-size: 14px;
            /* Shrunk */
            font-weight: 500;
            transition: all 0.3s ease;
            outline: none;
            background: rgba(247, 249, 252, 0.6);
            margin-bottom: 15px;
        }

        .input-group input:focus {
            border-color: var(--primary);
            box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.1);
            background: white;
        }

        .btn-main {
            background: linear-gradient(to bottom right, #6c5ce7, #a29bfe);
            color: white;
            padding: 12px 24px;
            /* Slimmer */
            border: none;
            border-radius: 12px;
            font-size: 15px;
            font-weight: 600;
            /* Thinner */
            cursor: pointer;
            width: 100%;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            box-shadow: 0 6px 15px rgba(108, 92, 231, 0.2);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }

        .btn-main:hover {
            transform: translateY(-3px);
            box-shadow: 0 12px 25px rgba(108, 92, 231, 0.3);
        }

        .mode-btn {
            background: rgba(255, 255, 255, 0.8);
            border: 1.5px solid #f0f0f0;
            border-radius: 15px;
            padding: 12px 15px;
            /* Compact */
            text-align: left;
            cursor: pointer;
            transition: all 0.3s ease;
            display: flex;
            align-items: center;
            gap: 12px;
            margin-bottom: 10px;
        }

        .mode-btn:hover {
            border-color: var(--primary);
            transform: translateY(-2px);
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
        }

        .mode-btn .icon {
            font-size: 22px;
            /* Smaller */
            background: #f0f3ff;
            width: 45px;
            /* Scaled down */
            height: 45px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .mode-btn .text h3 {
            margin: 0;
            font-size: 14px;
            /* Compact name */
            font-weight: 600;
            color: var(--text-dark);
        }

        .mode-btn .text small {
            color: var(--text-light);
            font-size: 11px;
        }

        /* Game Area Layout */
        #game-area {
            display: none;
            flex-direction: column;
            align-items: center;
            width: 100%;
            min-height: 100vh;
            padding: 20px 10px;
            background: var(--bg-gradient);
            position: absolute;
            /* Changed back to absolute for better scroll handling */
            top: 0;
            left: 0;
            z-index: 100;
            overflow-x: hidden;
            overflow-y: auto;
            /* Allow scroll if content is long */
        }

        .game-header {
            width: 100%;
            max-width: 600px;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 8px;
            margin-bottom: 8px;
            padding: 0 5px;
        }

        .room-tag {
            background: rgba(255, 255, 255, 0.9);
            padding: 3px 8px;
            /* Reduced from 5px 10px */
            border-radius: 12px;
            font-weight: 700;
            font-size: 10px;
            /* Reduced from 11px */
            color: var(--primary);
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
            white-space: nowrap;
        }

        .sound-btn {
            background: white;
            border: none;
            padding: 4px 8px;
            /* Reduced from 6px 10px */
            border-radius: 8px;
            cursor: pointer;
            font-size: 12px;
            /* Reduced from 14px */
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
        }

        .player-box {
            background: white;
            padding: 4px 8px;
            /* Reduced from 6px 10px */
            border-radius: 10px;
            /* Slights smaller radius */
            display: flex;
            align-items: center;
            gap: 4px;
            /* Reduced from 6px */
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            border: 2px solid transparent;
            transition: all 0.3s;
            flex: 1;
            min-width: 0;
        }

        .player-box.active {
            border-color: var(--accent);
            box-shadow: 0 4px 12px rgba(253, 121, 168, 0.2);
        }

        .player-avatar {
            font-size: 16px;
            /* Reduced from 18px */
            width: 24px;
            /* Reduced from 28px */
            height: 24px;
            /* Reduced from 28px */
            background: #f8f9fa;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }

        .player-info {
            text-align: left;
            min-width: 0;
            overflow: hidden;
        }

        .player-name {
            font-weight: 700;
            font-size: 10px;
            /* Reduced from 11px */
            margin: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .player-pos {
            font-size: 8px;
            /* Reduced from 9px */
            color: var(--text-light);
            margin: 0;
        }

        .board {
            display: grid;
            grid-template-columns: repeat(10, 10%);
            /* Explicit percentage for Firefox stability */
            grid-template-rows: repeat(10, 10%);
            width: min(100%, 520px);
            /* Expanded board */
            max-width: 520px;
            height: auto;
            aspect-ratio: 1/1;
            background: #fff;
            border: 6px solid #2d3436;
            /* High contrast border */
            border-radius: 16px;
            box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
            position: relative;
            margin: 15px auto;
            overflow: visible;
        }

        .cell {
            border: 1px solid rgba(45, 52, 54, 0.15);
            margin: -0.5px;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            background: #fff;
            overflow: visible;
            aspect-ratio: 1/1;
            transition: all 0.2s ease;
            z-index: 1;
            will-change: transform, box-shadow;
        }

        .cell-number {
            position: absolute;
            top: 4px;
            right: 4px;
            font-size: 9px;
            font-weight: 800;
            color: rgba(45, 52, 54, 0.4);
            pointer-events: none;
            z-index: 2;
        }

        .cell .icon {
            font-size: 30px;
            /* Slightly smaller than before (38px) but larger than original */
            z-index: 3;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
        }

        .gift-emoji {
            font-size: 24px;
            /* Proportionally adjusted gift size */
            z-index: 3;
            animation: giftBounce 2s infinite ease-in-out;
        }

        @keyframes giftBounce {

            0%,
            100% {
                transform: translateY(0) scale(1);
                filter: drop-shadow(0 0 0px gold);
            }

            50% {
                transform: translateY(-5px) scale(1.1);
                filter: drop-shadow(0 0 10px gold);
            }
        }

        .gift-burst {
            position: absolute;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 50;
        }

        .burst-particle {
            position: absolute;
            width: 8px;
            height: 8px;
            background: #ffeaa7;
            border-radius: 50%;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            animation: burstOut 0.6s ease-out forwards;
        }

        @keyframes burstOut {
            to {
                transform: translate(var(--tx), var(--ty)) scale(0);
                opacity: 0;
            }
        }


        /* Nature Variations - Softer Gradients */
        .cell.grass {
            background: linear-gradient(135deg, #f1f8e9, #dcedc8) !important;
        }

        .cell.dirt {
            background: linear-gradient(135deg, #fefae0, #f8f1e1) !important;
        }

        .cell.sand {
            background: linear-gradient(135deg, #fffcf2, #fff3e0) !important;
        }

        .cell.water {
            background: linear-gradient(135deg, #e3f2fd, #bbdefb) !important;
        }

        .cell.path {
            background: linear-gradient(135deg, #fafafa, #f5f5f5) !important;
        }

        .cell.start {
            background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%) !important;
            color: white !important;
            font-size: 10px;
            font-weight: 800;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
        }

        .start-label {
            display: flex;
            flex-direction: column;
            align-items: center;
            line-height: 1.2;
        }

        .start-icon {
            font-size: 24px;
            margin-top: 2px;
        }



        @keyframes trophyPulse {

            0%,
            100% {
                transform: scale(1);
                filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
            }

            50% {
                transform: scale(1.15);
                filter: drop-shadow(0 8px 16px rgba(184, 134, 11, 0.4));
            }
        }

        .cell:hover {
            z-index: 100 !important;
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            transform: scale(1.1) translateY(-5px);
            filter: brightness(1.1);
        }

        .cell.active-highlight {
            z-index: 100 !important;
            box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
            border-radius: 8px;
            border: 2px solid #2ecc71;
            background: white;
            transform: none !important;
        }

        /* GLOBAL OVERRIDE: Absolutely no zoom/transform for snakes and ladders under any condition */
        .cell.snake,
        .cell.ladder {
            transform: none !important;
            transition: none !important;
        }


        .cell:nth-child(even) {
            background: linear-gradient(to bottom right, #f1f3f5, #e9ecef);
        }

        .cell.snake {
            background: #fff0f0;
            /* Slightly more vivid pink */
            color: #ff5252;
        }

        .cell.ladder {
            background: #f0fff4;
            /* Light green */
            color: #2ecc71;
        }

        .cell.finish {
            background: radial-gradient(circle at center, #2c3e50, #1a252f);
            color: white;
            border: 2px solid #f1c40f;
            box-shadow: inset 0 0 15px rgba(241, 196, 15, 0.2);
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .trophy-icon {
            font-size: clamp(14px, 4vw, 20px) !important;
            /* Smaller than pieces */
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 5;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        /* Trophy Animation for Finish */
        .trophy-celebration {
            position: absolute;
            z-index: 20;
            font-size: clamp(20px, 6vw, 32px);
            animation: trophyLift 3s ease-out forwards;
        }

        @keyframes trophyLift {
            0% {
                transform: translate(-30%, -30%) rotate(-5deg);
            }

            20% {
                transform: translate(-30%, -30%) rotate(5deg);
            }

            40% {
                transform: translate(-30%, -60%) rotate(-5deg) scale(1.1);
            }

            60% {
                transform: translate(-30%, -80%) rotate(5deg) scale(1.2);
            }

            100% {
                transform: translate(-30%, -100%) rotate(0deg) scale(1.3);
            }
        }

        /* Celebration Popup Styles */
        /* Celebration Popup - Compact & Premium */
        #celebration-popup {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.8);
            backdrop-filter: blur(5px);
            z-index: 11000;
            display: none;
            justify-content: center;
            align-items: center;
        }

        .celebration-card {
            background: white;
            padding: 30px;
            border-radius: 30px;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
            text-align: center;
            width: 90%;
            max-width: 320px;
            animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
            overflow: visible;
        }

        .celebration-title {
            font-size: 24px;
            font-weight: 800;
            color: #2d3436;
            margin: 0 0 20px 0;
            text-transform: uppercase;
        }

        .celebration-visual {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0;
            margin-bottom: 10px;
        }

        .celebration-emoji {
            font-size: 60px;
            filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
            animation: bounce 1s infinite alternate;
        }

        .moving-trophy {
            font-size: 60px;
            animation: trophyWobble 0.8s ease-in-out infinite;
            filter: drop-shadow(0 4px 8px rgba(255, 215, 0, 0.4));
            margin-left: -25px;
            /* Significant overlap */
        }

        @keyframes trophyWobble {

            0%,
            100% {
                transform: rotate(-12deg) scale(1);
            }

            50% {
                transform: rotate(12deg) scale(1.1);
            }
        }

        @keyframes popIn {
            0% {
                transform: scale(0);
                opacity: 0;
            }

            80% {
                transform: scale(1.1);
                opacity: 1;
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        @keyframes fadeOut {
            from {
                opacity: 1;
            }

            to {
                opacity: 0;
            }
        }

        @keyframes confettiFall {
            0% {
                transform: translateY(0) rotate(0deg);
                opacity: 1;
            }

            100% {
                transform: translateY(100vh) rotate(720deg);
                opacity: 0;
            }
        }

        /* CONSOLIDATED PLAYER PIECE */
        .player-piece {
            width: min(45px, 9vw);
            height: min(45px, 9vw);
            position: absolute;
            z-index: 1500;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: clamp(28px, 2rem, 8vw);
            transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
            filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
            pointer-events: none;
            will-change: transform, left, top;
            line-height: 1;
        }

        .player-piece.player1 {
            transform: translate(-50%, -50%);
        }

        .player-piece.player2 {
            transform: translate(-50%, -50%);
        }

        /* PROGRESS TRACKER BOX */
        .progress-tracker {
            display: block;
            visibility: visible;
            width: min(600px, 95vw);
            max-width: 95%;
            background: rgba(255, 255, 255, 0.95);
            /* White background */
            backdrop-filter: blur(10px);
            border: 2px solid rgba(108, 92, 231, 0.3);
            border-radius: 12px;
            /* Smoother radius */
            padding: 6px 15px;
            /* Reduced height from 12px 20px */
            margin: 5px auto;
            /* Reduced from 10px */
            box-shadow: 0 8px 15px rgba(0, 0, 0, 0.08);
            /* Lighter shadow */
            animation: fadeIn 0.5s ease;
        }

        .progress-message {
            font-size: 13px;
            /* Reduced from 15px */
            font-weight: 700;
            color: #6c5ce7;
            /* Purple - better contrast on white */
            text-align: center;
            line-height: 1.3;
            min-height: 16px;
            /* Reduced from 20px */
        }

        @keyframes messageSlide {
            0% {
                opacity: 0;
                transform: translateY(-10px);
            }

            100% {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .progress-message.new-message {
            animation: messageSlide 0.3s ease;
        }

        /* Control Panel Box */
        .control-panel {
            background: rgba(255, 255, 255, 0.9);
            backdrop-filter: blur(5px);
            border-radius: 12px;
            padding: 8px 12px;
            width: 98%;
            max-width: 450px;
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            /* Tiny gap to bring together */
            border: 1px solid rgba(255, 255, 255, 0.3);
            margin-bottom: 2px;
            animation: fadeIn 0.5s ease;
        }

        .controls-section {
            margin-top: 8px;
            /* Reduced from 15px */
            width: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .exit-btn {
            background: linear-gradient(135deg, #ff7675, #d63031);
            color: #fff;
            border: none;
            padding: 8px 16px;
            /* Reduced padding */
            border-radius: 10px;
            font-size: 12px;
            /* Reduced from 14px */
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            box-shadow: 0 4px 10px rgba(255, 118, 117, 0.2);
        }

        .exit-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(255, 118, 117, 0.4);
        }

        .exit-btn:active {
            transform: translateY(0);
        }

        /* ITEM ACTIVATION EFFECTS */
        @keyframes item-burst {
            0% {
                transform: translate(-50%, -50%) scale(0);
                opacity: 1;
            }

            100% {
                transform: translate(-50%, -50%) scale(3);
                opacity: 0;
            }
        }

        .item-activation-effect {
            position: absolute;
            width: 100px;
            height: 100px;
            border-radius: 50%;
            pointer-events: none;
            z-index: 5000;
            background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
            animation: item-burst 0.6s ease-out forwards;
        }

        .teleport-vortex {
            background: radial-gradient(circle, #a29bfe 0%, #6c5ce7 50%, transparent 80%);
            width: 150px;
            height: 150px;
            animation: item-burst 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
        }

        /* Persistent glow for active items on piece */
        .piece-glow-active {
            box-shadow: 0 0 20px var(--accent), 0 0 40px rgba(108, 92, 231, 0.5) !important;
        }



        .active-item-float {
            position: absolute;
            top: -20px;
            left: 50%;
            transform: translateX(-50%);
            font-size: 18px;
            z-index: 2200;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        }

        /* Premium Item Bag Overhaul */
        .item-bag-label {
            font-size: 9px;
            /* Reduced from 10px */
            font-weight: 800;
            color: var(--primary);
            margin-top: 6px;
            /* Reduced from 10px */
            text-transform: uppercase;
            letter-spacing: 0.5px;
            background: white;
            padding: 2px 8px;
            /* Reduced from 3px 10px */
            border-radius: 8px;
            border: 1px solid rgba(0, 0, 0, 0.05);
        }

        .item-bag {
            display: flex;
            gap: 6px;
            /* Reduced from 8px */
            justify-content: center;
            width: fit-content;
            margin: 3px auto 0;
            /* Reduced from 5px */
            padding: 4px 8px;
            /* Reduced from 5px 10px */
            /* Thinner bag UI */
            background: #ffffff !important;
            backdrop-filter: blur(10px);
            border-radius: 12px;
            border: 1px solid rgba(0, 0, 0, 0.1);
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
        }

        .item-slot {
            display: flex;
            flex-direction: column;
            align-items: center;
            background: white;
            border: 2px solid #f0f0f0;
            border-radius: 10px;
            padding: 4px 6px;
            /* Smaller slots */
            min-width: 50px;
            position: relative;
            cursor: pointer;
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .item-slot:hover {
            transform: translateY(-5px);
            box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
            border-color: var(--primary);
        }

        .item-slot.active {
            border-color: #6c5ce7;
            background: #f0edff;
            box-shadow: 0 0 12px rgba(108, 92, 231, 0.3);
        }

        .item-slot.antidote {
            border-bottom: 4px solid #00b894;
        }

        .item-slot.autodice {
            border-bottom: 4px solid #6c5ce7;
        }

        .item-slot.snake {
            border-bottom: 4px solid #d63031;
        }

        .item-slot.snake.can-sabotage {
            border-color: #00b894;
            background: #e6fffa;
        }



        .item-slot .icon {
            font-size: 18px;
            /* Smaller icon */
            margin-bottom: 2px;
        }

        .item-slot .label {
            font-size: 8px;
            /* Smaller font */
            font-weight: 800;
            color: var(--text-dark);
        }

        .snake-info,
        .ladder-info {
            display: none !important;
            /* Hide labels as requested */
        }

        .item-slot .count {
            position: absolute;
            top: -8px;
            right: -8px;
            background: #ff7675;
            color: white;
            font-size: 11px;
            font-weight: 800;
            padding: 3px 8px;
            border-radius: 12px;
            box-shadow: 0 4px 8px rgba(255, 118, 117, 0.3);
            border: 2px solid white;
        }

        /* Gift Box on Board */
        .cell.gift {
            background: #fff9db !important;
            position: relative;
        }

        .cell.trap-cell {
            position: relative;
        }

        .trap-icon {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
            width: 100%;
            cursor: pointer;
            filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
            animation: trapPulse 3s ease-in-out infinite;
        }

        @keyframes trapPulse {
            0% {
                transform: scale(0.95);
                opacity: 0.8;
            }

            50% {
                transform: scale(1.05);
                opacity: 1;
            }

            100% {
                transform: scale(0.95);
                opacity: 0.8;
            }
        }

        /* Spider Trapped State - Persistent web visual */
        .player-piece.spider-trapped {
            animation: trapStruggle 0.5s ease-in-out infinite;
        }

        .player-piece.spider-trapped::before {
            content: "🕸️";
            position: absolute;
            font-size: 60px;
            opacity: 0.6;
            z-index: -1;
            transform: translate(0, -10px);
        }

        @keyframes trapStruggle {

            0%,
            100% {
                transform: translate(-50%, -50%) rotate(-3deg);
            }

            50% {
                transform: translate(-50%, -50%) rotate(3deg);
            }
        }

        /* Scorpion Poisoned State - Dark aura */
        .player-piece.scorpion-poisoned {
            filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 4px rgba(128, 0, 128, 0.6));
            animation: poisonPulse 1s ease-in-out infinite;
        }

        @keyframes poisonPulse {

            0%,
            100% {
                filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.8)) drop-shadow(0 0 4px rgba(128, 0, 128, 0.6));
            }

            50% {
                filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.9)) drop-shadow(0 0 8px rgba(128, 0, 128, 0.8));
            }
        }

        /* Antidote Glow Effect - When cured */
        .player-piece.antidote-glow {
            animation: antidoteGlow 0.5s ease-out 10;
        }

        @keyframes antidoteGlow {
            0% {
                filter: drop-shadow(0 0 5px rgba(0, 255, 128, 0.5));
            }

            50% {
                filter: drop-shadow(0 0 20px rgba(0, 255, 128, 1)) drop-shadow(0 0 30px rgba(255, 255, 255, 0.8));
            }

            100% {
                filter: drop-shadow(0 0 5px rgba(0, 255, 128, 0.5));
            }
        }

        /* Universal Modal & Alert Styles (Hidden by Default) */
        .modal,
        #premium-alert {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.85);
            z-index: 10000;
            display: none;
            align-items: center;
            justify-content: center;
            backdrop-filter: blur(12px);
        }

        @keyframes rotatePop {
            from {
                transform: scale(0) rotate(-45deg);
            }

            to {
                transform: scale(1) rotate(0);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        /* PREMIUM GAME OVER UI */
        .game-over-content {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.5s ease;
            overflow-y: auto;
            /* Prevent clipping */
            padding: 20px;
        }

        .result-card {
            background: rgba(255, 255, 255, 0.98);
            padding: 25px 15px;
            border-radius: 24px;
            text-align: center;
            max-width: 300px;
            /* Slimmer to fit small screens */
            width: 90%;
            max-height: 90vh;
            /* Responsive height */
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
            border: 2px solid rgba(255, 255, 255, 0.8);
            position: relative;
            z-index: 10;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            margin: auto;
            /* Center in scroll container */
        }

        .result-icon {
            font-size: 60px;
            margin-bottom: 15px;
        }

        .result-card h1 {
            font-size: 1.8rem;
            background: linear-gradient(to right, #6c5ce7, #00b894);
            background-clip: text;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            margin: 0;
            font-weight: 900;
            text-transform: uppercase;
        }

        .result-card p {
            color: #636e72;
            font-size: 0.95rem;
            margin: 5px 0 20px 0;
            font-weight: 600;
        }

        .result-stats {
            display: flex;
            gap: 15px;
            margin-bottom: 20px;
        }

        .stat {
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .stat .label {
            font-size: 0.7rem;
            text-transform: uppercase;
            color: var(--text-light);
            font-weight: 700;
        }

        .stat .value {
            font-size: 1.2rem;
        }

        .prime-btn {
            background: linear-gradient(135deg, #6c5ce7, #a29bfe);
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 12px;
            font-size: 1rem;
            font-weight: 800;
            cursor: pointer;
            box-shadow: 0 8px 15px rgba(108, 92, 231, 0.3);
            transition: all 0.3s;
            text-transform: uppercase;
        }

        .prime-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 12px 20px rgba(108, 92, 231, 0.4);
        }

        /* Redesigned Discovery Popup (Banner Style) */
        #discovery-modal {
            background: transparent;
            backdrop-filter: none;
            pointer-events: none;
            /* Let clicks pass through */
        }

        #discovery-modal.active {
            display: flex;
        }

        .discovery-content {
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(25px);
            border-radius: 12px;
            padding: 6px 14px;
            text-align: center;
            width: auto;
            min-width: 140px;
            max-width: 80%;
            border: 1px solid rgba(255, 255, 255, 0.8);
            box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
            animation: slideDownIn 0.5s cubic-bezier(0.23, 1, 0.32, 1);
            position: relative;
            top: -160px;
            /* Even higher to clear player heads */
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }

        .discovery-header {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin-bottom: 0;
            width: 100%;
        }

        .discovery-icon {
            font-size: 18px;
            margin-bottom: 0;
            animation: bounce 2s infinite;
        }

        .discovery-content h2 {
            font-size: 14px;
            /* Increased from 9px */
            font-weight: 900;
            color: var(--text-light);
            letter-spacing: 0.8px;
            margin: 0;
            text-transform: uppercase;
        }

        .discovery-message {
            font-size: 18px;
            /* Increased from 14px */
            font-weight: 800;
            color: var(--primary);
            margin-top: 0;
            width: 100%;
        }

        @keyframes slideDownIn {
            from {
                transform: translateY(-50px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        /* SUIT MECHANIC OVERLAY */
        .suit-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100vw;
            height: 100vh;
            background: rgba(0, 0, 0, 0.4);
            backdrop-filter: blur(10px);
            z-index: 5000;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 1;
        }

        .suit-container {
            background: rgba(255, 255, 255, 0.95);
            padding: 30px;
            border-radius: 20px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
            min-width: 320px;
            animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .suit-header {
            font-size: 24px;
            font-weight: 900;
            color: var(--primary);
            margin-bottom: 25px;
            text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
        }

        .suit-players {
            display: flex;
            align-items: center;
            justify-content: space-around;
            margin-bottom: 25px;
        }

        .suit-player {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 10px;
        }

        .suit-emoji {
            font-size: 40px;
        }

        .suit-choice-box {
            width: 80px;
            height: 80px;
            background: #f0f0f0;
            border: 3px solid #ddd;
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 40px;
            transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        }

        .suit-choice-box.revealed {
            background: white;
            border-color: var(--primary);
            transform: scale(1.1);
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .suit-versus {
            font-size: 20px;
            font-weight: 900;
            color: #888;
        }

        .suit-winner-announcement {
            font-size: 18px;
            font-weight: 800;
            color: var(--secondary);
            padding: 10px;
            border-radius: 10px;
            opacity: 0;
            transform: scale(0.8);
            transition: all 0.4s ease;
        }

        .suit-winner-announcement.active {
            opacity: 1;
            transform: scale(1);
            background: rgba(46, 204, 113, 0.1);
        }

        @keyframes popIn {
            from {
                transform: scale(0.5);
                opacity: 0;
            }

            to {
                transform: scale(1);
                opacity: 1;
            }
        }

        @keyframes wobble {

            0%,
            100% {
                transform: rotate(0deg);
            }

            25% {
                transform: rotate(-10deg);
            }

            75% {
                transform: rotate(10deg);
            }
        }

        @keyframes bounce {

            0%,
            100% {
                transform: translate(-50%, -50%) scale(1);
            }

            50% {
                transform: translate(-50%, -60%) scale(1.1);
            }
        }

        .dice-controls {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 15px;
            width: 100%;
        }

        .roll-btn {
            background: var(--primary);
            color: white;
            border: none;
            padding: 5px 12px;
            /* Super slim height */
            border-radius: 8px;
            font-size: 11px;
            /* Smaller */
            font-weight: 800;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(108, 92, 231, 0.2);
            transition: all 0.3s;
        }

        .roll-btn:disabled {
            background: #e9ecef;
            box-shadow: none;
            cursor: not-allowed;
            color: #adb5bd;
        }

        .roll-btn:not(:disabled):hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(108, 92, 231, 0.4);
        }

        /* DUPLICATE REMOVED */

        .piece-shadow {
            position: absolute;
            left: 50%;
            top: 50%;
            width: 70%;
            height: 20%;
            background: rgba(0, 0, 0, 0.1);
            border-radius: 50%;
            transform: translate(-50%, 150%);
            z-index: 9;
            pointer-events: none;
            filter: blur(2px);
        }

        /* 3D DICE Styles - More Realistic */
        .dice-wrapper {
            perspective: 400px;
            /* Increased for realistic depth at small scale */
            transform: scale(0.9);
            /* Slightly bigger than 0.7 to optimize visibility */
        }

        .dice-3d {
            width: 35px;
            height: 35px;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
            will-change: transform;
        }

        @keyframes diceSpin {
            0% {
                transform: rotateX(0deg) rotateY(0deg) rotateZ(0deg);
            }

            100% {
                transform: rotateX(360deg) rotateY(720deg) rotateZ(1080deg);
            }
        }

        .dice-face {
            position: absolute;
            width: 100%;
            height: 100%;
            background: linear-gradient(145deg, #ffffff, #f0f0f0);
            border: 1px solid #ddd;
            border-radius: 6px;
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            grid-template-rows: repeat(3, 1fr);
            padding: 6px;
            box-sizing: border-box;
            box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.9), 0 2px 4px rgba(0, 0, 0, 0.1);
        }

        .dot {
            width: 6px;
            height: 6px;
            background: radial-gradient(circle at 35% 35%, #444, #111);
            border-radius: 50%;
            align-self: center;
            justify-self: center;
            box-shadow: inset 0 -1px 1px rgba(255, 255, 255, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
        }

        /* Dot positions for each face */
        .face-1 .dot:nth-child(1) {
            grid-area: 2 / 2;
        }

        .face-2 .dot:nth-child(1) {
            grid-area: 1 / 3;
        }

        .face-2 .dot:nth-child(2) {
            grid-area: 3 / 1;
        }

        .face-3 .dot:nth-child(1) {
            grid-area: 1 / 3;
        }

        .face-3 .dot:nth-child(2) {
            grid-area: 2 / 2;
        }

        .face-3 .dot:nth-child(3) {
            grid-area: 3 / 1;
        }

        .face-4 .dot:nth-child(1) {
            grid-area: 1 / 1;
        }

        .face-4 .dot:nth-child(2) {
            grid-area: 1 / 3;
        }

        .face-4 .dot:nth-child(3) {
            grid-area: 3 / 1;
        }

        .face-4 .dot:nth-child(4) {
            grid-area: 3 / 3;
        }

        .face-5 .dot:nth-child(1) {
            grid-area: 1 / 1;
        }

        .face-5 .dot:nth-child(2) {
            grid-area: 1 / 3;
        }

        .face-5 .dot:nth-child(3) {
            grid-area: 2 / 2;
        }

        .face-5 .dot:nth-child(4) {
            grid-area: 3 / 1;
        }

        .face-5 .dot:nth-child(5) {
            grid-area: 3 / 3;
        }

        .face-6 .dot:nth-child(1) {
            grid-area: 1 / 1;
        }

        .face-6 .dot:nth-child(2) {
            grid-area: 1 / 3;
        }

        .face-6 .dot:nth-child(3) {
            grid-area: 2 / 1;
        }

        .face-6 .dot:nth-child(4) {
            grid-area: 2 / 3;
        }

        .face-6 .dot:nth-child(5) {
            grid-area: 3 / 1;
        }

        .face-6 .dot:nth-child(6) {
            grid-area: 3 / 3;
        }

        .face-1 {
            transform: translateZ(17.5px);
        }

        .face-6 {
            transform: rotateY(180deg) translateZ(17.5px);
        }

        .face-2 {
            transform: rotateY(-90deg) translateZ(17.5px);
        }

        .face-5 {
            transform: rotateY(90deg) translateZ(17.5px);
        }

        .face-3 {
            transform: rotateX(90deg) translateZ(17.5px);
        }

        .face-4 {
            transform: rotateX(-90deg) translateZ(17.5px);
        }

        /* Speech bubble and effect animations */
        @keyframes blink {
            0% {
                opacity: 1;
                transform: translate(-50%, 0) scale(1);
            }

            100% {
                opacity: 0.5;
                transform: translate(-50%, 0) scale(1.2);
            }
        }

        @keyframes winner-bounce {

            0%,
            100% {
                transform: translate(-50%, -50%);
            }

            50% {
                transform: translate(-50%, -100%);
            }
        }

        .player-piece.winner-bounce {
            animation: winner-bounce 0.6s ease-in-out infinite;
        }

        @keyframes popIn {
            0% {
                transform: translateX(-50%) scale(0);
                opacity: 0;
            }

            70% {
                transform: translateX(-50%) scale(1.2);
            }

            100% {
                transform: translateX(-50%) scale(1);
                opacity: 1;
            }
        }

        @keyframes modal-shake {

            0%,
            100% {
                transform: translateX(-50%);
            }

            25% {
                transform: translateX(calc(-50% - 2px));
            }

            75% {
                transform: translateX(calc(-50% + 2px));
            }
        }

        @keyframes pulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }
        }

        /* Toast Notifications */
        .toast-container {
            position: fixed;
            top: 20px;
            right: 20px;
            z-index: 9999;
            display: flex;
            flex-direction: column;
            gap: 10px;
        }

        .toast {
            background: white;
            padding: 15px 25px;
            border-radius: 15px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            border-left: 5px solid var(--primary);
            display: flex;
            align-items: center;
            gap: 12px;
            animation: slideIn 0.4s ease forwards;
        }

        .toast.error {
            border-left-color: #ff7675;
        }

        .toast.success {
            border-left-color: #00b894;
        }

        @keyframes slideIn {
            from {
                transform: translateX(120%);
            }

            to {
                transform: translateX(0);
            }
        }

        @keyframes fadeIn {
            from {
                opacity: 0;
                transform: translateY(10px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* Premium Alert Styles */
        #premium-alert {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(8px);
            z-index: 20000;
            display: none;
            justify-content: center;
            align-items: center;
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        #premium-alert.active {
            opacity: 1;
        }

        .alert-card {
            background: white;
            padding: 30px;
            border-radius: 20px;
            max-width: 400px;
            width: 90%;
            text-align: center;
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
            transform: translateY(20px);
            transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        #premium-alert.active .alert-card {
            transform: translateY(0);
        }

        .alert-icon {
            font-size: 50px;
            margin-bottom: 20px;
        }

        .alert-message {
            font-size: 18px;
            font-weight: 700;
            color: #2d3436;
            margin-bottom: 30px;
            line-height: 1.5;
        }

        .alert-btn {
            background: linear-gradient(135deg, #6c5ce7, #a29bfe);
            color: white;
            border: none;
            padding: 12px 30px;
            border-radius: 12px;
            font-size: 16px;
            font-weight: 700;
            cursor: pointer;
            box-shadow: 0 4px 15px rgba(108, 92, 231, 0.4);
            transition: all 0.2s;
        }

        .alert-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(108, 92, 231, 0.6);
        }

        /* Cinematic Animations */
        @keyframes board-vibrate {

            0%,
            100% {
                transform: translate(0, 0);
            }

            20%,
            60% {
                transform: translate(-2px, 0);
            }

            40%,
            80% {
                transform: translate(2px, 0);
            }
        }

        .board.shake-active {
            animation: board-vibrate 0.4s ease-in-out both;
        }

        @keyframes giftShake {

            0%,
            100% {
                transform: rotate(0);
            }

            25% {
                transform: rotate(-10deg) scale(1.1);
            }

            75% {
                transform: rotate(10deg) scale(1.1);
            }
        }

        @keyframes popReveal {
            0% {
                transform: scale(0);
                opacity: 0;
            }

            70% {
                transform: scale(1.2);
            }

            100% {
                transform: scale(1);
                opacity: 1;
            }
        }

        .dramatic-reveal .discovery-content {
            animation: popReveal 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
        }

        .dramatic-reveal .discovery-icon {
            animation: giftShake 0.2s 3 linear;
        }

        @keyframes sparkle {
            0% {
                box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
                transform: translate(-50%, -50%) scale(1);
            }

            50% {
                box-shadow: 0 0 30px 10px rgba(255, 215, 0, 0.8);
                transform: translate(-50%, -50%) scale(1.3);
            }

            100% {
                box-shadow: 0 0 0 0 rgba(255, 215, 0, 0);
                transform: translate(-50%, -50%) scale(1);
            }
        }

        .sparkle-active {
            animation: sparkle 0.6s ease-out;
        }


        .discovery-modal-inner {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            padding-bottom: 200px;
            /* Shift content UP to clear emoji area */
        }

        .discovery-content {
            background: rgba(255, 255, 255, 0.98);
            padding: 8px 10px;
            border-radius: 12px;
            text-align: center;
            max-width: 140px;
            min-height: 100px;
            width: auto;
            position: relative;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            display: flex;
            flex-direction: column;
            justify-content: center;
            align-items: center;
            gap: 2px;
            border: 1px solid rgba(255, 255, 255, 0.5);
            top: -100px;
            /* Float above the player */
        }

        .discovery-icon {
            font-size: 30px;
            margin: 2px 0 5px 0;
            filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
            animation: float 3s ease-in-out infinite;
        }

        .discovery-content h2 {
            font-size: 7px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin: 0;
            color: var(--text-light);
            font-weight: 700;
        }

        .discovery-content p,
        .discovery-message {
            font-size: 9px;
            margin: 0;
            color: var(--primary);
            font-weight: 800;
            line-height: 1.1;
        }


        /* Mobile Optimization (Compact & Leak-Proof) */
        @media (max-width: 480px) {
            body {
                padding: 10px;
                align-items: flex-start;
                /* Prevents top cut-off on small screens */
                padding-top: 40px;
                /* Safe area */
            }

            .container {
                padding: 20px 15px;
                width: 100%;
                max-width: 100%;
                border-radius: 20px;
                margin-bottom: 20px;
            }

            h1 {
                font-size: 1.8rem;
                /* Smaller title */
                margin-bottom: 20px;
            }

            .mode-btn {
                padding: 12px 15px;
                gap: 12px;
                border-radius: 14px;
            }

            .mode-btn .icon {
                width: 42px;
                height: 42px;
                font-size: 22px;
                min-width: 42px;
                /* Prevent shrink */
            }

            .mode-btn .text h3 {
                font-size: 14px;
                white-space: normal;
                /* Allow wrap */
            }

            .mode-btn .text small {
                display: block;
                line-height: 1.2;
                white-space: normal;
                /* Allow wrap */
            }

            .input-group input {
                padding: 12px 15px;
                margin-bottom: 15px;
            }
        }

        /* DRAMATIC LOADER STYLES */
        .dramatic-loader {
            position: fixed;
            inset: 0;
            background: radial-gradient(circle at 50% 50%, #6c5ce7 0%, #2d3436 100%);
            background-size: 200% 200%;
            z-index: 20000;
            display: flex;
            justify-content: center;
            align-items: center;
            backdrop-filter: blur(30px);
            animation: bgShift 10s ease-in-out infinite alternate, fadeIn 0.5s ease;
        }

        @keyframes bgShift {
            0% {
                background-position: 0% 50%;
            }

            100% {
                background-position: 100% 50%;
            }
        }

        .loader-content {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        /* Pulsing Logo (Not spinning) */
        .loader-logo {
            position: relative;
            z-index: 10;
            margin-bottom: 30px;
            filter: drop-shadow(0 0 20px rgba(108, 92, 231, 0.4));
            animation: logoFloat 3s ease-in-out infinite alternate;
            font-size: 120px;
            /* Increased from default to make sword big */
            display: flex;
            align-items: center;
            justify-content: center;
        }

        @keyframes logoFloat {
            from {
                transform: translateY(0);
            }

            to {
                transform: translateY(-15px);
            }
        }

        /* Dual Counter-Rotating Rings */
        .loading-ring {
            width: 80px;
            height: 80px;
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .loading-ring::before,
        .loading-ring::after {
            content: "";
            position: absolute;
            inset: 0;
            border-radius: 50%;
            border: 4px solid transparent;
        }

        .loading-ring::before {
            border-top-color: #fd79a8;
            border-bottom-color: #fd79a8;
            animation: spinRing 1.5s linear infinite;
        }

        .loading-ring::after {
            inset: 10px;
            border-left-color: #fff;
            border-right-color: #fff;
            animation: spinRingReverse 1s linear infinite;
            opacity: 0.6;
        }

        .ring-logo {
            width: 40px;
            height: auto;
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            z-index: 5;
            filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.3));
        }

        h1 {
            color: var(--primary);
            font-size: 32px;
            font-weight: 900;
            margin-bottom: 10px;
            text-align: center;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        .game-subtitle {
            text-align: center;
            color: var(--text-light);
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 20px;
        }

        .emoji-section,
        .difficulty-section {
            margin: 20px 0;
        }

        .section-label {
            display: block;
            font-size: 14px;
            font-weight: 700;
            color: var(--primary);
            margin-bottom: 10px;
            text-align: center;
        }

        .emoji-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 8px;
            margin-bottom: 20px;
            padding: 5px;
        }

        .emoji-option {
            font-size: 32px;
            aspect-ratio: 1;
            padding: 8px;
            border: 2px solid rgba(255, 255, 255, 0.5);
            border-radius: 16px;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            background: rgba(255, 255, 255, 0.3);
            backdrop-filter: blur(5px);
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        }

        .emoji-option:hover {
            transform: scale(1.15) translateY(-5px);
            background: white;
            box-shadow: 0 10px 20px rgba(108, 92, 231, 0.15);
            border-color: var(--primary);
        }

        .emoji-option.selected {
            border-color: var(--primary);
            background: white;
            box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.2), 0 8px 25px rgba(108, 92, 231, 0.4);
            transform: scale(1.1);
            animation: selectedGlow 2s infinite alternate;
        }

        @keyframes selectedGlow {
            from {
                box-shadow: 0 0 5px var(--primary), 0 8px 25px rgba(108, 92, 231, 0.4);
            }

            to {
                box-shadow: 0 0 15px var(--accent), 0 8px 25px rgba(108, 92, 231, 0.6);
            }
        }

        .difficulty-group {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        .difficulty-option {
            flex: 1;
            cursor: pointer;
        }

        .difficulty-option input[type="radio"] {
            display: none;
        }

        .difficulty-label {
            display: block;
            padding: 12px 20px;
            border: 2px solid #ddd;
            border-radius: 12px;
            font-size: 14px;
            font-weight: 700;
            text-align: center;
            transition: all 0.3s;
            background: rgba(255, 255, 255, 0.5);
        }

        .difficulty-option input[type="radio"]:checked+.difficulty-label {
            border-color: var(--accent);
            background: rgba(253, 121, 168, 0.2);
            color: var(--accent);
            box-shadow: 0 4px 12px rgba(253, 121, 168, 0.3);
        }

        .difficulty-label:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
        }

        /* SUIT OVERLAY (Confirmation Modal) */
        .suit-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            backdrop-filter: blur(5px);
            z-index: 20000;
            display: flex;
            justify-content: center;
            align-items: center;
            animation: fadeIn 0.3s ease;
        }

        .suit-container {
            background: white;
            padding: 30px;
            border-radius: 20px;
            width: 90%;
            max-width: 400px;
            text-align: center;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
            animation: scaleIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        .suit-header {
            font-size: 24px;
            color: var(--text-dark);
            margin-bottom: 10px;
            font-weight: 800;
        }

        .loader-text {
            color: white;
            font-size: 1.4rem;
            font-weight: 800;
            letter-spacing: 2px;
            text-align: center;
            margin-top: 25px;
            animation: loaderNeon 1.5s ease-in-out infinite alternate;
            text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        }

        @keyframes loaderNeon {
            from {
                opacity: 0.6;
                filter: blur(0.5px);
                text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
            }

            to {
                opacity: 1;
                filter: blur(0);
                text-shadow: 0 0 20px rgba(255, 255, 255, 0.8), 0 0 30px var(--accent);
            }
        }

        @keyframes spinRing {
            0% {
                transform: rotate(0deg);
                border-width: 4px;
            }

            50% {
                border-width: 2px;
            }

            100% {
                transform: rotate(360deg);
                border-width: 4px;
            }
        }

        @keyframes spinRingReverse {
            0% {
                transform: rotate(360deg);
            }

            100% {
                transform: rotate(0deg);
            }
        }

        @keyframes fadeOutLoader {
            to {
                opacity: 0;
                visibility: hidden;
            }
        }

        .toast-container {
            position: fixed;
            top: 70px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 12100;
            display: flex;
            flex-direction: column;
            gap: 10px;
            pointer-events: none;
            width: 90%;
            max-width: 400px;
        }

        .toast {
            background: rgba(0, 0, 0, 0.9);
            color: white;
            padding: 12px 20px;
            border-radius: 12px;
            font-size: 16px;
            /* Increased from 13px */
            font-weight: 800;
            text-align: center;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
            text-shadow: 0 1px 2px rgba(0, 0, 0, 1);
            animation: toastIn 0.3s ease-out;
        }

        @keyframes toastIn {
            from {
                transform: translateY(-20px);
                opacity: 0;
            }

            to {
                transform: translateY(0);
                opacity: 1;
            }
        }

        .discovery-modal-inner {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
            padding-bottom: 250px;
        }

        /* NATURE INFO BOX */
        /* BALLOON TOOLTIP (Nature Info) */
        .nature-info-box.balloon-tooltip {
            position: absolute;
            transform: scale(0.8) !important;
            /* Scale to 80% */
            transform-origin: center bottom;
            background: white;
            padding: 10px 12px;
            border-radius: 12px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
            width: 220px;
            max-width: 90vw;
            z-index: 15000;
            border: none;
            animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            pointer-events: none;
        }

        .tooltip-content h3 {
            font-size: 14px;
            margin: 0 0 6px 0;
            color: var(--primary);
            text-align: left;
            text-transform: none !important;
            /* Force Sentence Case */
        }

        .tooltip-content p {
            font-size: 12px;
            color: #555;
            margin: 0;
            line-height: 1.3;
            text-align: left;
            font-weight: 500;
            text-transform: none !important;
            /* Ensure sentence case */
        }

        /* Tooltip Arrow */
        .tooltip-arrow {
            position: absolute;
            bottom: -8px;
            left: 50%;
            transform: translateX(-50%);
            width: 0;
            height: 0;
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 8px solid white;
            filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.1));
        }

        /* Bottom Position Variant */
        .nature-info-box.position-bottom .tooltip-arrow {
            bottom: auto;
            top: -8px;
            border-top: none;
            border-bottom: 8px solid white;
            filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.1));
        }

        /* Override old styles */
        .nature-btn {
            display: none;
        }

        /* PREVIEW SVG */
        .path-preview-svg {
            position: absolute;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            pointer-events: none;
            z-index: 1400;
            opacity: 0.6;
            filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.5));
        }

        /* DRAMATIC EFFECTS */
        @keyframes subtle-board-shake {

            0%,
            100% {
                transform: translate(0, 0);
            }

            25% {
                transform: translate(-2px, 0);
            }

            75% {
                transform: translate(2px, 0);
            }
        }

        .shake-effect {
            animation: subtle-board-shake 0.4s ease-in-out both;
        }

        .board-zoom {
            transform: scale(1.1);
            transition: transform 1s ease-in-out;
        }

        /* SPIDER trapped effect */
        .spider-trapped {
            animation: move-stuck 0.3s ease-in-out infinite alternate !important;
            filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.9));
            z-index: 2100 !important;
        }

        .spider-trapped::after {
            content: '🕸️';
            position: absolute;
            font-size: 45px;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            opacity: 0.8;
            pointer-events: none;
            z-index: 2200;
            text-shadow: 0 0 10px white;
        }

        /* SCORPION stung effect */
        .scorpion-poisoned {
            animation: pulse-red 0.5s ease-in-out infinite !important;
            filter: drop-shadow(0 0 15px rgba(255, 0, 0, 1)) !important;
            z-index: 2100 !important;
        }

        @keyframes move-stuck {

            0%,
            100% {
                transform: translate(-50%, -50%);
            }

            25% {
                transform: translate(-52%, -50%);
            }

            75% {
                transform: translate(-48%, -50%);
            }
        }

        @keyframes pulse-red {

            0%,
            100% {
                filter: drop-shadow(0 0 5px rgba(255, 0, 0, 0.5));
                transform: translate(-50%, -50%);
            }

            50% {
                filter: drop-shadow(0 0 15px rgba(255, 0, 0, 0.8));
                transform: translate(-50%, -50%);
                background-color: rgba(255, 0, 0, 0.05);
            }
        }

        /* CUSTOMIZER UI - REFINED */
        .customizer-container {
            max-width: 480px !important;
            padding: 30px !important;
        }

        .custom-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 25px;
            overflow-x: auto;
            padding-bottom: 5px;
        }

        .tab-btn {
            flex: 1;
            padding: 10px 5px;
            border: none;
            background: #f1f2f6;
            color: #747d8c;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 800;
            cursor: pointer;
            transition: all 0.3s;
            white-space: nowrap;
        }

        .tab-btn.active {
            background: var(--primary);
            color: white;
            box-shadow: 0 6px 15px rgba(108, 92, 231, 0.3);
            transform: translateY(-2px);
        }

        .customizer-focused-row {
            background: #f8f9fa;
            border: 2px solid #eee;
            border-radius: 20px;
            padding: 25px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 15px;
            margin-bottom: 25px;
        }

        .row-label {
            font-weight: 800;
            color: var(--primary);
            font-size: 16px;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .input-action-group {
            display: flex;
            align-items: center;
            gap: 20px;
        }

        .input-action-group input[type="number"] {
            width: 80px;
            height: 50px;
            border: 2px solid var(--primary);
            border-radius: 12px;
            text-align: center;
            font-size: 24px;
            font-weight: 800;
            color: var(--text-dark);
            background: white;
            outline: none;
        }

        /* Hide browser-default number spinners globally for standard look */
        input::-webkit-outer-spin-button,
        input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }

        input[type=number] {
            -moz-appearance: textfield;
            appearance: textfield;
        }

        .circle-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            border: none;
            color: white;
            font-size: 24px;
            font-weight: 800;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        }

        .circle-btn.minus {
            background: #ff7675;
        }

        .circle-btn.plus {
            background: #00b894;
        }

        .circle-btn:hover {
            transform: scale(1.1);
            filter: brightness(1.1);
        }

        .emoji-selector-mini {
            margin-top: 15px;
            text-align: left;
        }

        .emoji-selector-mini label {
            font-size: 12px;
            font-weight: 700;
            color: #777;
            margin-bottom: 8px;
            display: block;
        }

        .mini-emoji-grid {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
            justify-content: center;
            padding: 10px;
            background: #f0f2f5;
            border-radius: 12px;
        }

        .mini-emoji-item {
            font-size: 24px;
            cursor: pointer;
            padding: 8px;
            border-radius: 10px;
            transition: all 0.2s;
            background: white;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
        }

        .mini-emoji-item.selected {
            background: var(--accent);
            transform: scale(1.2);
            box-shadow: 0 5px 15px rgba(253, 121, 168, 0.4);
        }

        /* --- COMPREHENSIVE FUTURISTIC DASHBOARD REDESIGN (REFINED PROPORTIONS) --- */
        .dashboard-layout {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 10px;
            width: 100%;
            padding: 2px 0;
        }

        .side-actions {
            display: flex;
            flex-direction: column;
            gap: 8px;
            justify-content: center;
        }

        .mini-circle-btn {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 1.5px solid #eee;
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            cursor: pointer;
            transition: all 0.3s;
            box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
        }

        .mini-circle-btn:hover {
            transform: scale(1.15) rotate(10deg);
            box-shadow: 0 5px 12px rgba(0, 0, 0, 0.2);
            border-color: var(--primary);
        }

        .mini-circle-btn.reset {
            color: #00b894;
            border-color: #00b89422;
        }

        .mini-circle-btn.exit {
            color: #d63031;
            border-color: #d6303122;
        }

        .bag-section {
            flex: 0 1 auto;
            background: rgba(255, 255, 255, 0.4);
            border-radius: 12px;
            border: 1px solid rgba(108, 92, 231, 0.1) !important;
            padding: 6px 8px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        /* Decorative Corners */
        .bag-section::before {
            content: '';
            position: absolute;
            top: -2px;
            left: -2px;
            width: 15px;
            height: 15px;
            border-top: 3px solid #a29bfe;
            border-left: 3px solid #a29bfe;
            border-radius: 20px 0 0 0;
            pointer-events: none;
        }

        .bag-section::after {
            content: '';
            position: absolute;
            bottom: -2px;
            right: -2px;
            width: 15px;
            height: 15px;
            border-bottom: 3px solid #a29bfe;
            border-right: 3px solid #a29bfe;
            border-radius: 0 0 20px 0;
            pointer-events: none;
        }

        .item-bag-label {
            font-size: 9px !important;
            font-weight: 900 !important;
            color: var(--primary) !important;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            margin-bottom: 8px !important;
            text-align: center;
            text-shadow: none;
        }

        .item-bag {
            display: grid !important;
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 6px !important;
            background: transparent !important;
            padding: 2px !important;
            width: 100%;
        }

        .item-slot {
            aspect-ratio: 1;
            background: white;
            border: 1.5px solid #eee;
            border-radius: 8px;
            /* Slightly smaller radius */
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            cursor: pointer;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
            width: 34px !important;
            height: 34px !important;
            margin: 0 auto;
        }

        /* Restored and Improved Slot Activation Button */
        .slot-use-btn {
            position: absolute;
            bottom: -6px;
            left: 50%;
            transform: translateX(-50%);
            background: linear-gradient(to right, #6c5ce7, #a29bfe);
            color: white;
            border: none;
            font-size: 7px;
            font-weight: 900;
            padding: 2px 6px;
            border-radius: 4px;
            cursor: pointer;
            z-index: 30;
            white-space: nowrap;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
            display: none;
            letter-spacing: 0.5px;
            animation: tagPulse 2s infinite;
        }

        @keyframes tagPulse {

            0%,
            100% {
                transform: translateX(-50%) scale(1);
                filter: brightness(1);
            }

            50% {
                transform: translateX(-50%) scale(1.05);
                filter: brightness(1.2);
            }
        }

        .item-slot.has-item .slot-use-btn {
            display: block;
        }

        .item-slot:hover {
            background: rgba(255, 255, 255, 0.08);
            transform: translateY(-2px) scale(1.05);
            border-color: rgba(255, 255, 255, 0.3);
            z-index: 10;
        }

        .item-slot.has-item {
            border-color: var(--accent);
            background: radial-gradient(circle at center, rgba(108, 92, 231, 0.2), transparent);
            filter: drop-shadow(0 0 5px rgba(253, 121, 168, 0.3));
        }

        .item-slot.active {
            border-color: var(--accent);
            animation: slotGlow 1.5s infinite alternate;
        }

        .item-slot .icon {
            font-size: 14px !important;
            filter: drop-shadow(0 0 3px rgba(255, 255, 255, 0.4));
        }

        /* Overlaid Count Badge */
        .item-slot .count {
            position: absolute;
            top: -4px;
            right: -4px;
            background: linear-gradient(135deg, #ff7675, #d63031) !important;
            color: white;
            font-size: 8px !important;
            font-weight: 900;
            width: 14px !important;
            height: 14px !important;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid white !important;
            box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4) !important;
            z-index: 20;
        }

        /* 🎲 THE MAGNIFICENT DICE STAGE */
        .dice-controls {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 2px;
            gap: 5px;
        }

        .dice-stage-container {
            position: relative;
            width: 120px;
            height: 120px;
            display: flex;
            align-items: center;
            justify-content: center;
            perspective: 700px;
            margin-bottom: 5px;
            /* Space from narrowed button */
        }


        /* Custom Dice Ring Image */
        .dice-ring-img {
            position: absolute;
            width: 130px;
            /* Enlarged to not be tight */
            height: 130px;
            pointer-events: none;
            z-index: 10;
            object-fit: contain;
            animation: stageRotate 1.5s linear infinite;
        }

        @keyframes stageRotate {
            from {
                transform: rotate(0deg);
            }

            to {
                transform: rotate(360deg);
            }
        }

        .roll-btn {
            width: auto;
            min-width: 160px;
            max-width: 80%;
            margin-top: -15px;
            /* Pull button up further */
            background: linear-gradient(135deg, #2ecc71, #27ae60);
            color: white;
            font-size: 14px !important;
            font-weight: 900 !important;
            padding: 8px 25px !important;
            /* Narrower height, wider breath */
            border-radius: 30px !important;
            border: none !important;
            text-transform: uppercase;
            letter-spacing: 1.5px;
            box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
            transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
            position: relative;
            overflow: hidden;
            cursor: pointer;
            z-index: 100;
        }

        .roll-btn:not(:disabled):hover {
            transform: translateY(-3px) scale(1.04);
            box-shadow: 0 10px 25px rgba(46, 204, 113, 0.6);
        }

        .roll-btn::after {
            content: '';
            position: absolute;
            top: -50%;
            left: -150%;
            width: 100%;
            height: 200%;
            background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
            transform: skewX(-30deg);
            animation: lightSweep 4s infinite;
        }

        @keyframes slotGlow {
            from {
                box-shadow: 0 0 5px var(--accent), inset 0 0 5px var(--accent);
            }

            to {
                box-shadow: 0 0 20px var(--accent), inset 0 0 10px var(--accent);
            }
        }

        @keyframes lightSweep {
            0% {
                left: -150%;
            }

            20% {
                left: 150%;
            }

            100% {
                left: 150%;
            }
        }

        /* 🛠️ FUTURISTIC CUSTOMIZER (REFINED) */
        .customizer-section {
            display: none;
            flex: 1;
            max-width: 200px;
            background: rgba(255, 255, 255, 0.95) !important;
            border: 2px solid rgba(253, 121, 168, 0.3) !important;
            border-radius: 12px;
            padding: 6px !important;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
            position: relative;
            z-index: 100;
        }

        .customizer-mini-header {
            font-size: 9px;
            font-weight: 900;
            color: var(--primary);
            text-align: center;
            margin-bottom: 6px;
            letter-spacing: 1px;
        }

        .custom-grid-rows {
            display: grid !important;
            grid-template-columns: 1fr 1fr !important;
            gap: 5px !important;
        }

        .custom-input-card {
            background: white !important;
            border: 1.5px solid #eee !important;
            border-radius: 10px !important;
            padding: 3px 5px !important;
            display: flex !important;
            flex-direction: column !important;
            align-items: center !important;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
        }

        .mini-label {
            font-size: 8px !important;
            color: #777 !important;
            margin-bottom: 3px !important;
            font-weight: 800;
        }

        .input-stepper {
            display: flex;
            align-items: center;
            background: #fff;
            border: 1.2px solid #ff7675;
            border-radius: 6px;
            overflow: hidden;
            height: 20px;
            width: 56px;
        }

        .input-stepper button {
            background: #ff7675 !important;
            color: white !important;
            border: none !important;
            width: 18px !important;
            height: 100% !important;
            font-size: 11px !important;
            font-weight: 900 !important;
            cursor: pointer;
            padding: 0 !important;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            border-radius: 0 !important;
        }

        .input-stepper button:active {
            background: #d63031 !important;
        }

        .input-stepper input {
            flex: 1;
            width: 100%;
            height: 100%;
            border: none;
            text-align: center;
            font-size: 10px !important;
            font-weight: 800;
            color: #2d3436;
            background: white;
            padding: 0;
            outline: none;
        }

        /* Piece Styles */
        .player-piece {
            position: absolute;
            left: 50%;
            top: 50%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            pointer-events: none;
            z-index: 1000;
        }

        .player-piece.hopping {
            animation: pieceHop 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        }

        @keyframes pieceHop {
            0% {
                transform: translate(-50%, -50%) scale(1);
            }

            45% {
                transform: translate(-50%, -65%) scale(1.08);
            }

            100% {
                transform: translate(-50%, -50%) scale(1);
            }
        }

        @keyframes safe-shake {

            0%,
            100% {
                transform: translate(-50%, -50%);
            }

            25% {
                transform: translate(-51%, -50%);
            }

            75% {
                transform: translate(-49%, -50%);
            }
        }

        /* ACTIVE ITEM FLOAT ENHANCEMENT */
        .active-item-float {
            position: absolute;
            font-size: 18px !important;
            top: -30px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 5000 !important;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(0, 0, 0, 0.85);
            color: white;
            padding: 2px 8px;
            border-radius: 20px;
            border: 2px solid rgba(255, 255, 255, 0.4);
            white-space: nowrap;
            pointer-events: none;
            backdrop-filter: blur(2px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        }

        .active-item-float span {
            font-size: 12px;
            font-weight: 900;
            margin-left: 3px;
        }

        .shield-status {
            border-color: #55efc4;
            box-shadow: 0 0 10px rgba(85, 239, 196, 0.4);
        }

        .auto-status {
            border-color: #fab1a0;
            box-shadow: 0 0 10px rgba(250, 177, 160, 0.4);
        }

        .double-status {
            border-color: #74b9ff;
            box-shadow: 0 0 10px rgba(116, 185, 255, 0.4);
        }



        .piece-glow-active {
            filter: drop-shadow(0 0 8px rgba(253, 121, 168, 0.6));
        }

        /* HELICOPTER RESCUE ANIMATION */
        .rescue-helicopter {
            position: absolute;
            font-size: 50px;
            z-index: 2500;
            pointer-events: none;
            transition: all 1.2s cubic-bezier(0.45, 0.05, 0.55, 0.95);
            display: flex;
            align-items: center;
            justify-content: center;
            filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.4));
        }

        .heli-rotor {
            position: absolute;
            top: -10px;
            font-size: 40px;
            animation: heli-spin 0.2s linear infinite;
            color: #2d3436;
        }

        @keyframes heli-spin {
            from {
                transform: rotateY(0deg);
            }

            to {
                transform: rotateY(360deg);
            }
        }

        .rescue-rope {
            position: absolute;
            width: 4px;
            background: repeating-linear-gradient(0deg,
                    #636e72,
                    #636e72 5px,
                    #b2bec3 5px,
                    #b2bec3 10px);
            z-index: 2400;
            transform-origin: top center;
            box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
            border-radius: 2px;
        }

        /* Flight Path Keyframes */
        @keyframes heli-fly-in {
            from {
                transform: translate(-200%, -200%) rotate(-15deg);
                opacity: 0;
            }

            to {
                transform: translate(0, 0) rotate(0deg);
                opacity: 1;
            }
        }

        @keyframes heli-fly-out {
            from {
                transform: translate(0, 0) rotate(0deg);
                opacity: 1;
            }

            to {
                transform: translate(300%, -300%) rotate(25deg);
                opacity: 0;
            }
        }

        /* RESCUE HELPER STYLES */
        .rescue-helper-animated {
            position: absolute;
            z-index: 2500;
            pointer-events: none;
            font-size: 40px;
            display: flex;
            flex-direction: column;
            align-items: center;
            transition: all 1800ms cubic-bezier(0.45, 0.05, 0.55, 0.95);
            filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.3));
        }

        .rescue-bubble {
            position: absolute;
            bottom: 50px;
            background: white;
            color: var(--primary);
            padding: 6px 12px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 800;
            white-space: nowrap;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
            border: 2px solid var(--accent);
            animation: bubblePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
            transform-origin: bottom center;
        }

        .rescue-bubble::after {
            content: '';
            position: absolute;
            top: 100%;
            left: 50%;
            transform: translateX(-50%);
            border-left: 8px solid transparent;
            border-right: 8px solid transparent;
            border-top: 8px solid white;
        }

        @keyframes bubblePop {
            0% {
                transform: scale(0) translateY(10px);
                opacity: 0;
            }

            100% {
                transform: scale(1) translateY(0);
                opacity: 1;
            }
        }

        .rescue-medic-float {
            animation: medicFloat 1.5s ease-in-out infinite;
        }

        @keyframes medicFloat {

            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-8px);
            }
        }

        /* MAGNET ITEM STYLES */
        .item-slot.magnet {
            background: linear-gradient(135deg, #6c5ce7, #a29bfe);
        }

        .item-slot.magnet.active {
            box-shadow: 0 0 20px rgba(108, 92, 231, 0.6);
        }

        .magnet-vortex-effect {
            position: absolute;
            width: 100px;
            height: 100px;
            border: 3px dashed #6c5ce7;
            border-radius: 50%;
            animation: magnetRotation 1s linear infinite;
            pointer-events: none;
            z-index: 1000;
        }

        @keyframes magnetRotation {
            from {
                transform: translate(-50%, -50%) rotate(0deg) scale(1);
                opacity: 0.8;
            }

            to {
                transform: translate(-50%, -50%) rotate(360deg) scale(0.2);
                opacity: 0;
            }
        }