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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

#header h1 {
    font-size: 1.8rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

#status {
    display: flex;
    gap: 20px;
    font-size: 1.1rem;
}

#game-status {
    color: #4ade80;
    font-weight: bold;
}

#ai-status {
    color: #fbbf24;
}

#game-container {
    display: flex;
    flex: 1;
    position: relative;
}

#canvas-container {
    flex: 1;
    position: relative;
    overflow: hidden;
}

#canvas-container canvas {
    display: block;
}

#controls {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    backdrop-filter: blur(10px);
    z-index: 100;
}

#controls button,
#controls select {
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    background: #4a90d9;
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

#controls button:hover,
#controls select:hover {
    background: #357abd;
    transform: translateY(-2px);
}

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

#info-panel {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border-radius: 10px;
    max-width: 300px;
    max-height: 200px;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    z-index: 100;
}

#info-panel h3 {
    margin-bottom: 10px;
    color: #4ade80;
}

#fen {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    margin-bottom: 10px;
}

#move-history {
    font-size: 0.85rem;
    line-height: 1.4;
}

/* Responsive design */
@media (max-width: 768px) {
    #header {
        flex-direction: column;
        gap: 10px;
    }
    
    #controls {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    #info-panel {
        bottom: auto;
        top: 50%;
        left: 20px;
        transform: translateY(-50%);
        max-width: 250px;
    }
}

/* Loading overlay */
#loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #4a90d9;
    border-top: 5px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
