* { 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: 10px;
}
.container {
    background: rgba(255,255,255,0.95);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    max-width: 1000px;
    width: 100%;
    max-height: 95vh;
    overflow-y: auto;
}
.header {
    text-align: center;
    margin-bottom: 20px;
}
.header h1 {
    color: #333;
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}
.header p {
    color: #666;
    font-size: clamp(0.8rem, 2vw, 1rem);
}
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    align-items: end;
}
.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
select, button, input {
    padding: 10px 16px;
    border: none;
    border-radius: 25px;
    font-size: clamp(12px, 2vw, 14px);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 160px;
}
select, input[type="range"] {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e9ecef;
}
select:focus, input:focus {
    outline: none;
    border-color: #667eea;
    transform: translateY(-2px);
}
button {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.board-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    overflow: auto;
}
.board {
    display: grid;
    gap: 1px;
    padding: 15px;
    background: #333;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 90vw;
}
.cell {
    width: clamp(30px, 8vw, 50px);
    height: clamp(30px, 8vw, 50px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(20px, 6vw, 30px);
    font-weight: bold;
    transition: all 0.3s ease;
    border-radius: 6px;
    cursor: pointer;
}
.cell.white { background: #f0d9b5; }
.cell.black { background: #b58863; }
.cell.queen { color: #8b4513; text-shadow: 2px 2px 4px rgba(0,0,0,0.3); }
.cell.conflict { background: #ff6b6b !important; animation: pulse 1s infinite; }
.cell.exploring { background: #4ecdc4 !important; }
.cell.valid { background: #95e1d3 !important; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.status {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(45deg, #f8f9fa, #e9ecef);
    border-radius: 15px;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}
.status-title {
    font-size: clamp(1rem, 3vw, 1.2rem);
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}
.status-info {
    color: #666;
    font-size: clamp(0.75rem, 2vw, 14px);
}
.export-area {
    text-align: center;
    margin-top: 15px;
}
.solution-display {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 15px;
    margin: 15px 0;
    text-align: center;
    font-weight: bold;
}
.speed-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}
.speed-slider {
    width: 120px;
}
label {
    font-size: clamp(10px, 2vw, 12px);
    color: #666;
    font-weight: 600;
    text-align: center;
}
.alternative-prompt {
    background: linear-gradient(45deg, #fff3cd, #ffeaa7);
    border: 2px solid #ffd93d;
    border-radius: 15px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}
.alternative-prompt h3 {
    color: #856404;
    margin-bottom: 8px;
    font-size: clamp(1rem, 3vw, 1.1rem);
}
.alternative-prompt p {
    color: #856404;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    margin-bottom: 10px;
}
.alternative-prompt button {
    background: linear-gradient(45deg, #f39c12, #e67e22);
    padding: 8px 16px;
    font-size: clamp(0.75rem, 2vw, 0.85rem);
}
.audio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}
.audio-toggle {
    background: #28a745;
    padding: 8px 12px;
    font-size: clamp(10px, 2vw, 12px);
}

@media (max-width: 768px) {
    .container { padding: 15px; margin: 5px; }
    .controls { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .board { padding: 10px; }
    .cell { border-radius: 4px; }
}

@media (max-width: 480px) {
    .controls { grid-template-columns: 1fr; }
    .header h1 { font-size: 1.5rem; }
    .status { padding: 10px; }
}
