 /* Custom Fonts */
        @import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;700&family=Lato:wght@400;700&display=swap');

        :root {
            --bg-main: #1a1a1a;
            --panel-bg: #262421;
            --accent-gold: #d4af37;
            --text-primary: #f0f0f0;
            --text-secondary: #aaaaaa;
            --board-border: #4d3319;
        }

        body {
            background-color: var(--bg-main);
            background-image: radial-gradient(circle at center, #2b2b2b 0%, #1a1a1a 100%);
            color: var(--text-primary);
            font-family: 'Lato', sans-serif;
            overflow-x: hidden;
            min-height: 100vh;
        }

        h1, h2, h3 { font-family: 'Cinzel', serif; }

        /* Modern Classic Panel */
        .classic-panel {
            background: var(--panel-bg);
            border-radius: 8px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.7);
            border: 1px solid #3d3a36;
        }

        .gold-text { color: var(--accent-gold); text-shadow: 0 2px 4px rgba(0,0,0,0.5); }
        
        .btn-primary {
            background: linear-gradient(145deg, #81b64c, #6a9e3d);
            color: white; font-weight: bold;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
            border: 1px solid #578a2e; transition: all 0.2s;
        }
        .btn-primary:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.3); }
        
        .btn-gold {
            background: linear-gradient(145deg, #d4af37, #b5922b);
            color: #262421;
            box-shadow: 0 4px 10px rgba(212, 175, 55, 0.2);
            transition: all 0.2s;
        }
        .btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }

        .btn-danger {
            background: linear-gradient(145deg, #c53030, #9b2c2c);
            color: white; border: 1px solid #742a2a;
        }
        .btn-danger:hover { background: #e53e3e; }

        /* Chess Board */
        .chess-board {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            grid-template-rows: repeat(8, 1fr);
            width: 100%; max-width: 600px; aspect-ratio: 1/1;
            margin: 0 auto;
            border: 12px solid var(--board-border);
            border-radius: 4px;
            position: relative;
            box-shadow: 0 20px 50px rgba(0,0,0,0.6);
            background: #332211;
        }

        .square { display: flex; justify-content: center; align-items: center; position: relative; cursor: pointer; }
        .square.light { background-image: linear-gradient(45deg, #e8d0aa 0%, #dcc298 100%); }
        .square.dark { background-image: linear-gradient(45deg, #966f4c 0%, #855e3c 100%); }
        
        .square.selected { background: rgba(255, 255, 50, 0.5) !important; box-shadow: inset 0 0 15px rgba(255, 215, 0, 0.6); }
        .square.last-move { background: rgba(255, 255, 0, 0.3) !important; }
        .square.check { background: radial-gradient(circle, rgba(255, 69, 58, 0.6) 0%, transparent 70%); }
        
        .square.valid-move::after {
            content: ''; width: 20px; height: 20px; background: rgba(0, 0, 0, 0.3);
            border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
        }
        .square.valid-capture::after {
            content: ''; width: 100%; height: 100%; position: absolute;
            border: 6px solid rgba(200, 50, 50, 0.5); border-radius: 50%; width: 80%; height: 80%;
        }

        .piece-img {
            width: 90%; height: 90%; z-index: 2;
            filter: drop-shadow(2px 4px 3px rgba(0,0,0,0.6));
            transition: transform 0.15s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }
        .piece-img:hover { transform: translateY(-4px) scale(1.05); }

        .modal-overlay { background: rgba(0,0,0,0.85); backdrop-filter: blur(4px); }
        
        /* Modern Modal Style */
        .modern-modal {
            background: linear-gradient(to bottom, #2b2b2b, #1a1a1a);
            border: 2px solid var(--accent-gold);
            box-shadow: 0 0 30px rgba(212, 175, 55, 0.15);
            animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
        }

        @keyframes modalPop {
            0% { opacity: 0; transform: scale(0.9); }
            100% { opacity: 1; transform: scale(1); }
        }

        ::-webkit-scrollbar { width: 6px; }
        ::-webkit-scrollbar-track { background: #1a1a1a; }
        ::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

        .board-flipped .square { transform: rotate(180deg); }
        .board-flipped { transform: rotate(180deg); }

        /* Loader */
        .loader {
            border: 4px solid rgba(255, 255, 255, 0.1);
            border-left-color: var(--accent-gold);
            border-radius: 50%;
            width: 40px;
            height: 40px;
            animation: spin 1s linear infinite;
        }
        
        /* Small Button Loader */
        .btn-loader {
            display: inline-block;
            width: 20px;
            height: 20px;
            border: 3px solid rgba(255,255,255,0.3);
            border-left-color: #fff;
            border-radius: 50%;
            vertical-align: middle;
            margin-right: 8px;
            animation: spin 1s linear infinite;
        }

        @keyframes spin { to { transform: rotate(360deg); } }