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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    min-height: 100vh;
    color: #e0e0e0;
    padding: 10px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 15px 0;
}

header h1 {
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 5px;
}

.subtitle {
    color: #888;
    font-size: 0.9rem;
}

.content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.board-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#board {
    width: min(90vw, 400px);
    max-width: 400px;
    margin: 0 auto;
}

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

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: #2d3748;
    color: #e0e0e0;
}

.btn-secondary:hover {
    background: #4a5568;
}

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

.panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    backdrop-filter: blur(10px);
}

.panel h2 {
    font-size: 1.1rem;
    color: #667eea;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
}

.eval-box, .commentary-box, .info-box {
    font-size: 0.95rem;
    line-height: 1.6;
}

.placeholder {
    color: #666;
    font-style: italic;
}

#gameStatus {
    color: #ffc107;
    font-weight: bold;
    margin-top: 5px;
}

/* Highlight styles */
.highlight-selected {
    box-shadow: inset 0 0 0 4px rgba(255, 255, 0, 0.7) !important;
    background: rgba(255, 255, 0, 0.3) !important;
}

.highlight-move {
    position: relative;
}

.highlight-move::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 30%;
    border-radius: 50%;
    background: rgba(0, 255, 0, 0.5);
    pointer-events: none;
}

/* Desktop layout */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .content {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .board-section {
        flex: 0 0 auto;
    }
    
    #board {
        width: 400px;
    }
    
    .analysis-section {
        flex: 1;
        min-width: 300px;
    }
}

/* Touch feedback */
@media (hover: none) {
    .square-55d63 {
        -webkit-tap-highlight-color: transparent;
    }
    
    .square-55d63:active {
        opacity: 0.8;
    }
}
