body {
    font-family: 'Space Grotesk', sans-serif;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    color: #1b1c1a;
    background-color: #f6f1e9;
    background-image:
        linear-gradient(120deg, rgba(191, 174, 139, 0.15), rgba(246, 241, 233, 0.9)),
        repeating-linear-gradient(135deg, rgba(47, 51, 43, 0.06), rgba(47, 51, 43, 0.06) 1px, transparent 1px, transparent 8px);
    min-height: 100vh;
}

h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
    color: #1c2a21;
}

.game-container {
    display: grid;
    grid-template-columns: minmax(260px, 300px) minmax(520px, 1fr) minmax(320px, 360px);
    gap: 20px;
    align-items: start;
}

.controls-panel,
.board-container,
.log-panel {
    background: rgba(255, 255, 255, 0.82);
    border-radius: 16px;
    border: 1px solid rgba(28, 42, 33, 0.12);
    box-shadow: 0 12px 30px rgba(22, 30, 23, 0.12);
    backdrop-filter: blur(6px);
}

.controls-panel {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.board-container {
    padding: 18px;
}

.log-panel {
    padding: 18px;
}

.game-controls button {
    width: 100%;
    padding: 12px 14px;
    margin: 6px 0;
    background: #1c2a21;
    color: #f6f1e9;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.2s;
    box-shadow: 0 8px 16px rgba(28, 42, 33, 0.25);
    font-weight: 600;
}

.game-controls button:hover {
    background: #24362a;
    transform: translateY(-1px);
}

.game-controls button:disabled {
    background: #c6c1b7;
    color: #6f6a61;
    cursor: not-allowed;
    box-shadow: none;
}

.settings-section {
    padding: 12px;
    background: rgba(246, 241, 233, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(28, 42, 33, 0.12);
}

.settings-section h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.2rem;
    margin: 0 0 10px 0;
    color: #1c2a21;
}

.input-group {
    margin: 10px 0;
}

.input-group label {
    display: block;
    margin-bottom: 5px;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid rgba(28, 42, 33, 0.2);
    border-radius: 10px;
    background: #fffdf9;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-size: 0.95rem;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: #b07d4a;
    box-shadow: 0 0 0 2px rgba(176, 125, 74, 0.25);
}

.input-group button {
    width: calc(50% - 6px);
    padding: 8px;
    margin: 6px 0;
    background: #b07d4a;
    color: #fff8f0;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
    font-weight: 600;
}

.input-group button:hover {
    background: #9a6a3c;
    transform: translateY(-1px);
}

.input-group button:disabled {
    background: #d0c5b8;
    color: #8a8277;
    cursor: not-allowed;
}

.input-group button + button {
    margin-left: 10px;
}

.status-bar {
    margin-top: 12px;
    padding: 12px;
    background: rgba(28, 42, 33, 0.08);
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    color: #1c2a21;
}

.reasoning-log {
    height: 600px;
    overflow-y: auto;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(28, 42, 33, 0.12);
    border-radius: 12px;
    margin-top: 10px;
}

.move-entry {
    margin: 12px 0;
    padding: 12px;
    background: #fffdf7;
    border-radius: 12px;
    box-shadow: 0 6px 14px rgba(28, 42, 33, 0.12);
    border: 1px solid rgba(28, 42, 33, 0.08);
}

.move-entry.white {
    border-left: 6px solid #1c2a21;
}

.move-entry.black {
    border-left: 6px solid #7a4b30;
}

.move-entry.error {
    border-left: 6px solid #b23b3b;
}

.move-entry.debug {
    border-left: 6px solid #c49a3d;
    font-family: 'Space Mono', monospace;
    font-size: 0.9em;
}

.auto-play-controls,
.debug-panel {
    margin-top: 10px;
    padding: 10px;
    background: rgba(246, 241, 233, 0.9);
    border-radius: 10px;
    border: 1px solid rgba(28, 42, 33, 0.1);
}

.toggle-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.toggle-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.toggle-option input {
    display: none;
}

.toggle-option span {
    font-size: 0.9rem;
}

.toggle-option input:checked + span {
    font-weight: 600;
}

.toggle-option:has(input:checked) {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.2);
    background: #e7f1ff;
}

.model-settings,
.api-settings {
    transition: all 0.3s ease;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .game-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .controls-panel {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 15px;
    }
}
