/* Game Board - 6x6 Grid, Cells, Players, and Trails */

/* 6x6 Grid Layout */
.board {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-width: 800px; /* allow board to be as wide as move history at most */
    margin: 0 auto;
}

.board-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
}

.cell {
    aspect-ratio: 1;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    min-width: 60px;
    min-height: 60px;
}

.cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.cell:hover::before {
    opacity: 1;
}

.cell:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.cell:active {
    transform: scale(0.98);
}

/* Player positions */
.player-marker {
    font-size: 2.5rem;
    font-weight: 900;
    z-index: 2;
    position: relative;
}

.player-marker.player1 {
    color: #8B5CF6; /* Purple for Player X */
}

.player-marker.player2 {
    color: #F59E0B; /* Orange for Player O */
}

.player-marker.player1-glow {
    color: #8B5CF6; /* Purple for Player X */
    text-shadow: 
        0 0 10px #8B5CF6,
        0 0 20px #8B5CF6,
        0 0 30px #8B5CF6,
        0 0 40px #8B5CF6;
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.8));
    animation: player-glow 2s ease-in-out infinite;
}

.player-marker.player2-glow {
    color: #F59E0B; /* Orange for Player O */
    text-shadow: 
        0 0 10px #F59E0B,
        0 0 20px #F59E0B,
        0 0 30px #F59E0B,
        0 0 40px #F59E0B;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
    animation: player-glow-o 2s ease-in-out infinite;
}

/* Trails */
.trail {
    background: rgba(255, 0, 0, 0.3) !important;
    border-color: rgba(255, 0, 0, 0.5) !important;
}

.trail-marker {
    position: relative;
}

.decay-counter {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Decay opacity classes */
.decay-13 { opacity: 1.0; }
.decay-12 { opacity: 0.92; }
.decay-11 { opacity: 0.85; }
.decay-10 { opacity: 0.77; }
.decay-9 { opacity: 0.69; }
.decay-8 { opacity: 0.62; }
.decay-7 { opacity: 0.54; }
.decay-6 { opacity: 0.46; }
.decay-5 { opacity: 0.38; }
.decay-4 { opacity: 0.31; }
.decay-3 { opacity: 0.23; }
.decay-2 { opacity: 0.15; }
.decay-1 { opacity: 0.08; }

/* Phase indicator */
.phase-indicator { display:none; }

.phase-indicator.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2), rgba(118, 75, 162, 0.2));
    border-color: rgba(102, 126, 234, 0.3);
    color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.2);
}

/* Player indicator */
.player-indicator {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0.65rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 0.5rem;
    gap: 1rem;
}

.player-symbol {
    font-size: 2.5rem;
    font-weight: 900;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 60px;
    text-align: center;
    transition: all 0.3s ease;
}

.player-symbol.x {
    color: #8B5CF6;
    border-color: rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.2);
}

.player-symbol.o {
    color: #F59E0B;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.2);
}

/* Timer container */
.timer-container {
    display: flex;
    gap: 2rem;
}

.timer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.timer-label {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.timer-value {
    font-size: 1.8rem;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    min-width: 80px;
    text-align: center;
    transition: all 0.3s ease;
}

.timer-value.normal {
    color: #10B981;
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.1);
}

.timer-value.warning {
    color: #F59E0B;
    border-color: rgba(245, 158, 11, 0.3);
    background: rgba(245, 158, 11, 0.1);
    animation: pulse-warning 1s ease-in-out infinite;
}

.timer-value.critical {
    color: #EF4444;
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.1);
    animation: pulse-critical 0.5s ease-in-out infinite;
}

/* Timer info */
.timer-info {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: #d0d0d0;
}

/* Responsive design for narrow screens */
@media (max-width: 768px) {
    .board {
        max-width: 800px; /* match move history */
        width: 100%;
        gap: 0.25rem;
    }
    
    .board-row {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.2rem;
    }
    
    .cell {
        min-width: 50px;
        min-height: 50px;
        font-size: 1.5rem;
    }
    
    .player-indicator {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        gap: 0.5rem;
    }
    
    .player-symbol {
        font-size: 1.8rem;
        padding: 0.25rem 0.5rem;
        min-width: 40px;
    }
    
    .timer-container {
        gap: 1rem;
    }
    
    .timer-section {
        gap: 0.25rem;
    }
    
    .timer-label {
        font-size: 0.9rem;
    }
    
    .timer-value {
        font-size: 1.4rem;
        padding: 0.25rem 0.5rem;
        min-width: 60px;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .board { max-width: 800px; width: 100%; }
    .board-row {
        grid-template-columns: repeat(6, 1fr);
        gap: 0.15rem;
    }
    
    .cell {
        min-width: 40px;
        min-height: 40px;
        font-size: 1.2rem;
    }
    
    .player-indicator {
        padding: 0.4rem;
        gap: 0.4rem;
    }
    
    .player-symbol {
        font-size: 1.5rem;
        padding: 0.2rem 0.4rem;
        min-width: 35px;
    }
    
    .timer-container {
        gap: 0.8rem;
    }
    
    .timer-label {
        font-size: 0.8rem;
    }
    
    .timer-value {
        font-size: 1.2rem;
        padding: 0.2rem 0.4rem;
        min-width: 50px;
    }
}

/* Animations */
@keyframes player-glow {
    0%, 100% { text-shadow: 0 0 10px #8B5CF6, 0 0 20px #8B5CF6, 0 0 30px #8B5CF6, 0 0 40px #8B5CF6; }
    50% { text-shadow: 0 0 15px #8B5CF6, 0 0 25px #8B5CF6, 0 0 35px #8B5CF6, 0 0 45px #8B5CF6; }
}

@keyframes player-glow-o {
    0%, 100% { text-shadow: 0 0 10px #F59E0B, 0 0 20px #F59E0B, 0 0 30px #F59E0B, 0 0 40px #F59E0B; }
    50% { text-shadow: 0 0 15px #F59E0B, 0 0 25px #F59E0B, 0 0 35px #F59E0B, 0 0 45px #F59E0B; }
}

@keyframes pulse-warning {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

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