/**
 * Quantum Brain Strategy v1.7.1 - Main Stylesheet
 * Extracted from inline styles for better maintainability
 */

/* === GLOBAL STYLES === */
body {
    margin: 0;
    padding: 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    overflow: hidden;
}

h1 {
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    text-align: center;
    font-size: clamp(1.2rem, 3vw, 2rem);
}

/* === GAME LAYOUT === */
.game-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: calc(100vh - 140px);
    max-width: 100vw;
    position: relative;
}

#gameCanvas {
    border: 2px solid #fff;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    cursor: pointer;
    background: #f0f8ff;
    margin: 0 auto;
    display: block;
}

/* === UI PANEL === */
.ui-panel {
    background: rgba(255,255,255,0.1);
    padding: 15px;
    border-radius: 8px;
    backdrop-filter: blur(10px);
    width: 250px;
    max-height: 100%;
    overflow-y: auto;
    flex-shrink: 0;
}

.status-item {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}

.status-label {
    font-weight: bold;
    margin-bottom: 4px;
    font-size: 0.9rem;
}

/* === BUTTONS === */
button {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    width: 100%;
    margin-top: 8px;
    transition: background 0.3s;
}

button:hover {
    background: #45a049;
}

button:disabled {
    background: #666;
    cursor: not-allowed;
}

.toggle-button {
    background: #FF9800;
    margin-top: 4px;
}

.toggle-button:hover {
    background: #F57C00;
}

.toggle-button.hidden {
    background: #757575;
}

.toggle-button.hidden:hover {
    background: #616161;
}

/* === TURN INDICATORS === */
.player-turn, .ai-turn {
    padding: 8px 12px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid currentColor;
    text-align: center;
    font-weight: bold;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.player-turn:hover, .ai-turn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* === INSTRUCTIONS === */
.instructions {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 10px;
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    background: rgba(255,255,255,0.1);
    padding: 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    z-index: 100;
}

/* === WIN OVERLAY === */
.win-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.win-message {
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 25px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    max-width: 350px;
    border: 2px solid #4CAF50;
}

.win-message.ai-win {
    background: rgba(255, 107, 107, 0.9);
    border: 2px solid #ff6b6b;
}

.win-title {
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: bold;
}

.win-subtitle {
    font-size: 1em;
    margin-bottom: 20px;
    opacity: 0.95;
}

.win-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid white;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.win-button:hover {
    background: rgba(255,255,255,0.3);
}

/* === LEGEND === */
.legend {
    margin-top: 10px;
    font-size: 12px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 8px;
    border: 1px solid #333;
}

/* === DIFFICULTY INFO === */
.difficulty-info {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 11px;
    text-align: center;
}

.difficulty-easy { 
    border-color: rgba(76, 175, 80, 0.5); 
    background: rgba(76, 175, 80, 0.1); 
}

.difficulty-medium { 
    border-color: rgba(255, 193, 7, 0.5); 
    background: rgba(255, 193, 7, 0.1); 
}

.difficulty-hard { 
    border-color: rgba(255, 87, 34, 0.5); 
    background: rgba(255, 87, 34, 0.1); 
}

.difficulty-quantum { 
    border-color: rgba(156, 39, 176, 0.5); 
    background: rgba(156, 39, 176, 0.1); 
}

/* === FORM ELEMENTS === */
select {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 6px;
    border-radius: 4px;
    width: 100%;
    font-size: 12px;
}

select option {
    background: #2a5298;
    color: white;
}

/* === SPECIAL EVENT OVERLAY === */
.special-event-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.special-event-message {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    max-width: 400px;
    border: 3px solid #fff;
    animation: specialPulse 0.6s ease-in-out;
}

.special-event-message.advantage {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    border-color: #2e7d32;
}

.special-event-message.disadvantage {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    border-color: #c62828;
}

@keyframes specialPulse {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

.special-event-title {
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.special-event-text {
    font-size: 1.2em;
    margin-bottom: 20px;
    line-height: 1.4;
}

.special-event-button {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 12px 25px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: all 0.3s;
}

.special-event-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* === SPECIAL HEXAGON STATS === */
.special-hexagon-stats {
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 11px;
    text-align: center;
}

.special-hexagon-toggle {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.3);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 11px;
    text-align: center;
}

.educational-info {
    background: rgba(0, 123, 255, 0.1);
    border: 1px solid rgba(0, 123, 255, 0.3);
    padding: 8px;
    border-radius: 4px;
    margin-top: 8px;
    font-size: 11px;
    text-align: center;
}

/* === RESPONSIVE DESIGN === */
@media (max-width: 768px) {
    .game-container {
        flex-direction: column;
        align-items: center;
        height: calc(100vh - 60px);
    }
    
    .ui-panel {
        width: 100%;
        max-width: 400px;
        order: 2;
        max-height: 200px;
        padding: 10px;
    }
    
    #gameCanvas {
        order: 1;
        margin-bottom: 10px;
    }
    
    .instructions {
        display: none;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }
    
    h1 {
        font-size: 1.2rem;
        margin: 5px 0;
    }
    
    .ui-panel {
        padding: 8px;
    }
}
