* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Cinzel', serif;
            background: linear-gradient(135deg, #2c1810 0%, #1a0f08 50%, #0f0804 100%);
            color: #d4af37;
            min-height: 100vh;
            overflow-x: hidden;
        }

        .container {
            display: flex;
            max-width: 1400px;
            margin: 0 auto;
            padding: 20px;
            gap: 30px;
            min-height: 100vh;
        }

        .game-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 20px;
        }

        .title {
            font-family: 'Playfair Display', serif;
            font-size: 3rem;
            font-weight: 700;
            text-align: center;
            color: #d4af37;
            text-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
            margin-bottom: 20px;
        }

        .turn-indicator {
            background: linear-gradient(135deg, #3d2914 0%, #2c1810 100%);
            border: 2px solid #d4af37;
            border-radius: 15px;
            padding: 15px 30px;
            text-align: center;
            font-size: 1.2rem;
            font-weight: 600;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        }

        .chessboard {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            grid-template-rows: repeat(8, 1fr);
            width: 560px;
            height: 560px;
            border: 4px solid #d4af37;
            border-radius: 8px;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
            background: #8b4513;
        }

        .square {
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2.5rem;
            cursor: pointer;
            transition: all 0.3s ease;
            position: relative;
        }

        .square.light {
            background: #f5f5dc;
            border: 1px solid #e0e0b8;
        }

        .square.dark {
            background: #8b4513;
            border: 1px solid #654321;
        }

        .square:hover {
            transform: scale(1.02);
            box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.4);
        }

        .square.selected {
            background: radial-gradient(circle, #ffd700 0%, #daa520 100%) !important;
            box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
            animation: pulse 1.5s ease-in-out infinite alternate;
            border: 3px solid #ffd700 !important;
        }

        .square.valid-move {
            background: radial-gradient(circle, #98fb98 0%, #90ee90 100%) !important;
            box-shadow: 0 0 15px rgba(152, 251, 152, 0.7);
            border: 2px solid #90ee90 !important;
        }

        .square.in-check {
            background: radial-gradient(circle, #ff4500 0%, #dc143c 100%) !important;
            box-shadow: 0 0 25px rgba(255, 69, 0, 0.9);
            animation: flash 1s ease-in-out infinite alternate;
            border: 3px solid #ff4500 !important;
        }

        @keyframes pulse {
            0% { 
                box-shadow: 0 0 20px rgba(255, 215, 0, 0.9);
                transform: scale(1.02);
            }
            100% { 
                box-shadow: 0 0 35px rgba(255, 215, 0, 1), 0 0 50px rgba(255, 215, 0, 0.6);
                transform: scale(1.05);
            }
        }

        @keyframes flash {
            0% { 
                box-shadow: 0 0 25px rgba(255, 69, 0, 0.9);
                transform: scale(1.02);
            }
            100% { 
                box-shadow: 0 0 40px rgba(255, 69, 0, 1), 0 0 55px rgba(255, 69, 0, 0.7);
                transform: scale(1.05);
            }
        }

        .piece {
            -webkit-user-select: none;
            user-select: none;
            transition: all 0.3s ease;
            font-weight: bold;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
            filter: drop-shadow(1px 1px 2px rgba(0, 0, 0, 0.3));
        }

        .piece.white {
            color: #ffffff;
            text-shadow: 
                2px 2px 0px #000000,
                -1px -1px 0px #000000,
                1px -1px 0px #000000,
                -1px 1px 0px #000000,
                0px 0px 8px rgba(255, 255, 255, 0.8);
        }

        .piece.black {
            color: #1a1a1a;
            text-shadow: 
                2px 2px 0px #ffffff,
                -1px -1px 0px #ffffff,
                1px -1px 0px #ffffff,
                -1px 1px 0px #ffffff,
                0px 0px 6px rgba(0, 0, 0, 0.9);
        }

        .piece:hover {
            transform: scale(1.15);
            filter: drop-shadow(2px 2px 4px rgba(0, 0, 0, 0.6));
        }

        .piece.white:hover {
            text-shadow: 
                3px 3px 0px #000000,
                -2px -2px 0px #000000,
                2px -2px 0px #000000,
                -2px 2px 0px #000000,
                0px 0px 12px rgba(255, 255, 255, 1);
        }

        .piece.black:hover {
            text-shadow: 
                3px 3px 0px #ffffff,
                -2px -2px 0px #ffffff,
                2px -2px 0px #ffffff,
                -2px 2px 0px #ffffff,
                0px 0px 10px rgba(0, 0, 0, 1);
        }

        .sidebar {
            width: 350px;
            display: flex;
            flex-direction: column;
            gap: 20px;
        }

        .scoreboard {
            background: linear-gradient(135deg, #3d2914 0%, #2c1810 100%);
            border: 2px solid #d4af37;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        }

        .scoreboard h3 {
            font-family: 'Playfair Display', serif;
            font-size: 1.5rem;
            text-align: center;
            margin-bottom: 20px;
            color: #d4af37;
        }

        .captures {
            margin-bottom: 20px;
        }

        .captures h4 {
            font-size: 1.1rem;
            margin-bottom: 10px;
            color: #e6c967;
        }

        .captured-pieces {
            display: flex;
            flex-wrap: wrap;
            gap: 5px;
            min-height: 40px;
            padding: 10px;
            background: rgba(0, 0, 0, 0.3);
            border-radius: 8px;
            border: 1px solid rgba(212, 175, 55, 0.3);
        }

        .captured-piece {
            font-size: 1.5rem;
            opacity: 0.8;
        }

        .controls {
            background: linear-gradient(135deg, #3d2914 0%, #2c1810 100%);
            border: 2px solid #d4af37;
            border-radius: 15px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
        }

        .controls h3 {
            font-family: 'Playfair Display', serif;
            font-size: 1.5rem;
            text-align: center;
            margin-bottom: 20px;
            color: #d4af37;
        }

        .btn {
            width: 100%;
            padding: 12px 20px;
            margin-bottom: 10px;
            background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
            color: #2c1810;
            border: none;
            border-radius: 8px;
            font-family: 'Cinzel', serif;
            font-size: 1rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s ease;
            text-transform: uppercase;
            letter-spacing: 1px;
        }

        .btn:hover {
            background: linear-gradient(135deg, #e6c967 0%, #d4af37 100%);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(212, 175, 55, 0.4);
        }

        .btn:active {
            transform: translateY(0);
        }

        .btn:disabled {
            background: #666;
            color: #999;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }

        /* Modal Styles */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.8);
            -webkit-backdrop-filter: blur(5px);
            backdrop-filter: blur(5px);
        }

        .modal-content {
            background: linear-gradient(135deg, #3d2914 0%, #2c1810 100%);
            margin: 10% auto;
            padding: 30px;
            border: 3px solid #d4af37;
            border-radius: 20px;
            width: 90%;
            max-width: 500px;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
        }

        .modal h2 {
            font-family: 'Playfair Display', serif;
            font-size: 2rem;
            margin-bottom: 20px;
            color: #d4af37;
        }

        .modal input {
            width: 100%;
            padding: 12px;
            margin: 10px 0;
            border: 2px solid #d4af37;
            border-radius: 8px;
            background: rgba(244, 244, 244, 0.1);
            color: #d4af37;
            font-family: 'Cinzel', serif;
            font-size: 1rem;
        }

        .modal input::placeholder {
            color: rgba(212, 175, 55, 0.6);
        }

        .promotion-options {
            display: flex;
            justify-content: space-around;
            margin: 20px 0;
        }

        .promotion-btn {
            background: linear-gradient(135deg, #d4af37 0%, #b8941f 100%);
            border: none;
            border-radius: 50%;
            width: 60px;
            height: 60px;
            font-size: 2rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .promotion-btn:hover {
            transform: scale(1.1);
            box-shadow: 0 4px 15px rgba(212, 175, 55, 0.5);
        }

        .game-status {
            text-align: center;
            font-size: 1.2rem;
            font-weight: 600;
            margin: 10px 0;
        }

        .status-check {
            color: #ff6b6b;
        }

        .status-checkmate {
            color: #ff4757;
            font-size: 1.5rem;
        }

        .status-stalemate {
            color: #ffa502;
            font-size: 1.5rem;
        }

        /* Responsive Design */
        @media (max-width: 1200px) {
            .container {
                flex-direction: column;
                align-items: center;
            }

            .sidebar {
                width: 100%;
                max-width: 560px;
            }
        }

        @media (max-width: 768px) {
            .title {
                font-size: 2rem;
            }

            .chessboard {
                width: 90vw;
                height: 90vw;
                max-width: 400px;
                max-height: 400px;
            }

            .square {
                font-size: 1.8rem;
            }

            .container {
                padding: 10px;
            }
        }