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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #667eea;
    background-image: radial-gradient(circle, rgba(255, 255, 255, 0.2) 2px, transparent 2px);
    background-size: 30px 30px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 650px;
}

h1 {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.game-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
}

.turn-indicator {
    font-size: 1.2em;
    font-weight: bold;
    color: #555;
}

#current-turn {
    color: #667eea;
    text-transform: uppercase;
}

.view-selector select,
.game-mode-selector select,
.theme-selector select {
    padding: 8px 12px;
    border: 2px solid #667eea;
    border-radius: 5px;
    font-size: 1em;
    cursor: pointer;
    background: white;
}

.view-selector label,
.game-mode-selector label,
.theme-selector label {
    font-weight: 600;
    color: #555;
}

#chess-board {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 1;
    margin: 0 auto;
    border: 3px solid #333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    background: #000;
}

.cell {
    cursor: pointer;
    transition: fill 0.2s ease;
}

.cell.light {
    background-color: #f0d9b5;
}

.cell.dark {
    background-color: #b58863;
}

.cell.selected {
    background-color: #baca44 !important;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
}

.cell.valid-move {
    background-color: #7fc97f !important;
}

.cell.valid-move::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
}

.cell.capture-move::after {
    content: '';
    position: absolute;
    width: 90%;
    height: 90%;
    border: 4px solid rgba(255, 0, 0, 0.5);
    border-radius: 50%;
    background-color: transparent;
}

.cell:hover {
    filter: brightness(1.1);
}

.piece-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.piece {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    position: absolute;
}

.controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

button {
    padding: 12px 24px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    text-transform: uppercase;
}

#reset-btn {
    background-color: #e74c3c;
    color: white;
}

#reset-btn:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

#undo-btn {
    background-color: #3498db;
    color: white;
}

#undo-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.status {
    margin-top: 20px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 8px;
    text-align: center;
}

#status-message {
    font-size: 1.1em;
    color: #555;
    font-weight: 500;
}

/* Responsive design - Mobile */
@media (max-width: 768px) {
    body {
        padding: 10px;
        background-size: 20px 20px;
    }

    .container {
        padding: 15px;
        max-width: 100%;
    }

    h1 {
        font-size: 1.8em;
        margin-bottom: 15px;
    }

    .game-info {
        flex-direction: column;
        gap: 10px;
        padding: 10px;
    }

    .view-selector,
    .game-mode-selector,
    .theme-selector {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }

    .view-selector label,
    .game-mode-selector label,
    .theme-selector label {
        font-size: 1em;
        margin-right: 10px;
    }

    .view-selector select,
    .game-mode-selector select,
    .theme-selector select {
        flex: 1;
        max-width: 200px;
    }

    .turn-indicator {
        font-size: 1.1em;
        text-align: center;
        width: 100%;
    }

    #chess-board {
        max-width: 100%;
        border-width: 2px;
    }

    .controls {
        flex-direction: column;
        gap: 8px;
        margin-top: 15px;
    }

    button {
        width: 100%;
        padding: 12px;
        font-size: 0.95em;
    }

    .status {
        margin-top: 15px;
        padding: 12px;
    }

    #status-message {
        font-size: 1em;
    }
}

/* Responsive design - Tablet */
@media (min-width: 769px) and (max-width: 1024px) {
    .container {
        max-width: 700px;
    }

    h1 {
        font-size: 2.2em;
    }

    .game-info {
        flex-wrap: wrap;
        gap: 15px;
    }

    #chess-board {
        max-width: 600px;
    }
}

/* Responsive design - Desktop */
@media (min-width: 1025px) {
    .container {
        max-width: 800px;
        padding: 40px;
    }

    h1 {
        font-size: 3em;
        margin-bottom: 25px;
    }

    .game-info {
        padding: 20px;
        margin-bottom: 25px;
    }

    .view-selector,
    .game-mode-selector,
    .theme-selector {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    #chess-board {
        max-width: 640px;
    }

    .controls {
        margin-top: 25px;
        gap: 15px;
    }

    button {
        padding: 14px 28px;
        font-size: 1.05em;
    }

    .status {
        margin-top: 25px;
        padding: 20px;
    }

    #status-message {
        font-size: 1.15em;
    }
}
