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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

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

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

.game-info {
    margin-bottom: 20px;
    text-align: center;
}

.turn-indicator {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.status-message {
    font-size: 1.1em;
    color: #d63031;
    min-height: 30px;
    font-weight: 600;
}

.chess-board {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    grid-template-rows: repeat(8, 1fr);
    width: 100%;
    aspect-ratio: 1;
    border: 4px solid #8b4513;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin: 0 auto;
}

.square {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5em;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    user-select: none;
}

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

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

.square:hover {
    filter: brightness(0.9);
}

.square.selected {
    background-color: #7fc97f !important;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.square.valid-move {
    background-color: #90ee90 !important;
}

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

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

.piece {
    font-size: 1em;
    filter: drop-shadow(2px 2px 3px rgba(0, 0, 0, 0.3));
}

.gingerbread-piece {
    width: 80%;
    height: 80%;
    object-fit: contain;
    pointer-events: none;
    animation: wiggle 0.5s ease-in-out;
}

@keyframes wiggle {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-5deg); }
    75% { transform: rotate(5deg); }
}

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

button {
    padding: 12px 30px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

#resetButton {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

#undoButton {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.instructions {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #8b4513;
}

.instructions h3 {
    color: #8b4513;
    margin-bottom: 10px;
}

.instructions ul {
    list-style-position: inside;
    color: #555;
    line-height: 1.8;
}

.instructions li {
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    .square {
        font-size: 1.8em;
    }
    
    button {
        padding: 10px 20px;
        font-size: 1em;
    }
}

