:root {
    --bg: #121212;
    --panel: #1e1e1e;
    --square-light: #ebecd0;
    --square-dark: #779556;
    --highlight: rgba(255, 255, 0, 0.4);
    --selected: rgba(255, 255, 0, 0.6);
    --accent: #4a90e2;
    --text: #ffffff;
}

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg);
    color: var(--text);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    width: 95%;
    max-width: 1000px;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

header h1 {
    margin: 0;
    color: var(--accent);
    font-size: 2rem;
}

main {
    display: grid;
    grid-template-columns: auto 300px;
    gap: 30px;
    justify-content: center;
}

#board-container {
    user-select: none;
}

.board {
    display: grid;
    grid-template-columns: repeat(8, 60px);
    grid-template-rows: repeat(8, 60px);
    border: 5px solid #333;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.square {
    width: 60px;
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    cursor: pointer;
}

.square.light { background-color: var(--square-light); }
.square.dark { background-color: var(--square-dark); }

.square.selected {
    box-shadow: inset 0 0 0 4px var(--selected);
}

.square.last-move {
    background-color: rgba(246, 246, 130, 0.8) !important;
}

.square.valid-move::after {
    content: '';
    width: 20px;
    height: 20px;
    background: rgba(0,0,0,0.1);
    border-radius: 50%;
}

.piece {
    width: 50px;
    height: 50px;
    z-index: 10;
}

.side-panel {
    background: var(--panel);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.status-box h3 {
    margin-top: 0;
    font-size: 1.2rem;
    color: var(--accent);
}

.history {
    height: 150px;
    background: #111;
    border-radius: 4px;
    padding: 10px;
    font-family: monospace;
    overflow-y: auto;
    font-size: 0.9rem;
}

.settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

label {
    font-size: 0.8rem;
    text-transform: uppercase;
    opacity: 0.7;
}

select {
    padding: 10px;
    background: #333;
    color: white;
    border: 1px solid #444;
    border-radius: 4px;
}

.actions {
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 4px;
    background: #444;
    color: white;
    font-weight: bold;
    cursor: pointer;
}

button.primary {
    background: var(--accent);
}

button:hover {
    filter: brightness(1.2);
}

@media (max-width: 850px) {
    main {
        grid-template-columns: 1fr;
    }
    .board {
        grid-template-columns: repeat(8, 11vw);
        grid-template-rows: repeat(8, 11vw);
        margin: 0 auto;
    }
    .square {
        width: 11vw;
        height: 11vw;
    }
    .piece {
        width: 9vw;
        height: 9vw;
    }
}
