/* Shared Web Toolarium footer */
        .site-footer {
            flex: 0 0 auto;
            color: #82908a;
            background: #18211f;
            font-size: 11px;
            line-height: 1.5;
            touch-action: auto;
            user-select: text;
            -webkit-user-select: text;
        }
        .footer-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            width: min(1120px, calc(100% - 40px));
            min-height: 64px;
            margin: 0 auto;
            padding: 14px 0;
        }
        .footer-copy,
        .footer-links {
            display: flex;
            align-items: center;
            gap: 20px;
        }
        .footer-links a {
            color: #c1cdc6;
            text-decoration: underline;
            text-underline-offset: 3px;
        }
        .footer-links a:hover,
        .footer-links a:focus-visible {
            color: #fff;
        }
        @media (max-width: 760px) {
            .footer-inner {
                align-items: flex-start;
                flex-direction: column;
                gap: 10px;
                width: min(100% - 28px, 600px);
            }
            .footer-copy,
            .footer-links {
                flex-wrap: wrap;
                gap: 6px 14px;
            }
        }

        /* Prevent selection and default touch actions for game stability */
        body {
            user-select: none;
            -webkit-user-select: none;
            touch-action: manipulation;
            overscroll-behavior: none; /* Prevents pull-to-refresh and bounce on mobile */
            overflow-x: hidden;
            overflow-y: auto;
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
        }

        .puzzle-board {
            box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8);
            isolation: isolate;
        }

        /* Puzzle Piece Styling */
        .piece-canvas {
            position: absolute;
            cursor: grab;
            touch-action: none; /* Crucial for custom pointer events */
            filter: drop-shadow(2px 4px 6px rgba(0,0,0,0.6));
            transition: filter 0.15s ease, transform 0.05s linear;
            will-change: transform, left, top;
            z-index: 20;
        }

        .piece-canvas:hover:not(.is-placed) {
            filter: drop-shadow(3px 6px 10px rgba(56, 189, 248, 0.4));
        }

        .piece-canvas:active, .piece-canvas.is-dragging {
            cursor: grabbing;
            filter: drop-shadow(4px 12px 16px rgba(0,0,0,0.8));
            z-index: 9999 !important;
            transform: scale(1.02);
        }

        .piece-canvas.is-placed {
            cursor: default;
            filter: drop-shadow(0px 1px 2px rgba(0,0,0,0.3));
            z-index: 5 !important;
            transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
        }

        /* Modal Animation */
        .modal-enter {
            animation: modalIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
        }

        @keyframes modalIn {
            from { opacity: 0; transform: scale(0.9) translateY(20px); }
            to { opacity: 1; transform: scale(1) translateY(0); }
        }

        /* Custom Scrollbar */
        ::-webkit-scrollbar {
            width: 8px;
            height: 8px;
        }
        ::-webkit-scrollbar-track {
            background: rgba(15, 23, 42, 0.4);
            border-radius: 4px;
        }
        ::-webkit-scrollbar-thumb {
            background: #334155;
            border-radius: 4px;
            border: 2px solid transparent;
            background-clip: padding-box;
        }
        ::-webkit-scrollbar-thumb:hover {
            background: #475569;
            border: 2px solid transparent;
            background-clip: padding-box;
        }

        /* Hide scrollbar for compact mobile rows */
        .scrollbar-hide::-webkit-scrollbar {
            display: none;
        }
        .scrollbar-hide {
            -ms-overflow-style: none;
            scrollbar-width: none;
        }
