/* style.css - Advanced Tic Tac Toe */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&display=swap');

* {
    box-sizing: border-box;
}

body {
    background: #000;
    color: #fff;
    font-family: 'Orbitron', monospace;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(0, 100, 255, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 50, 50, 0.1) 0%, transparent 50%);
    pointer-events: none;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.container {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 255, 255, 0.1);
    padding: 2rem 2.5rem;
    border-radius: 24px;
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.8),
        0 0 50px rgba(0, 100, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    min-width: 450px;
    max-width: 510px;
    position: relative;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
h1 {
    text-align: center;
    margin-bottom: 1rem;
    letter-spacing: 3px;
    font-weight: 900;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(0, 100, 255, 0.8),
        0 0 20px rgba(0, 100, 255, 0.6),
        0 0 30px rgba(0, 100, 255, 0.4);
    animation: titleGlow 2s ease-in-out infinite alternate;
}

@keyframes titleGlow {
    from {
        text-shadow: 
            0 0 10px rgba(0, 100, 255, 0.8),
            0 0 20px rgba(0, 100, 255, 0.6),
            0 0 30px rgba(0, 100, 255, 0.4);
    }
    to {
        text-shadow: 
            0 0 15px rgba(255, 50, 50, 0.8),
            0 0 25px rgba(255, 50, 50, 0.6),
            0 0 35px rgba(255, 50, 50, 0.4);
    }
}

.scoreboard {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.scoreboard > div {
    color: #fff;
    text-shadow: 0 0 10px rgba(0, 100, 255, 0.5);
}
.mode-select {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.mode-select button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.mode-select button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.mode-select button:hover::before {
    left: 100%;
}

.mode-select button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.mode-select button.active {
    background: linear-gradient(135deg, #0066ff, #0044cc);
    color: #fff;
    box-shadow: 
        0 8px 25px rgba(0, 100, 255, 0.4),
        0 0 20px rgba(0, 100, 255, 0.6);
    transform: translateY(-1px);
}

.difficulty-select {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: visible;
    width: 100%;
    box-sizing: border-box;
}

.difficulty-select span {
    color: #fff;
    font-weight: 600;
    margin-right: 0.8rem;
    text-shadow: 0 0 10px rgba(0, 100, 255, 0.5);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.difficulty-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    min-width: 75px;
    box-sizing: border-box;
    flex-shrink: 0;
    text-align: center;
}

.difficulty-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.difficulty-btn:hover::before {
    left: 100%;
}

.difficulty-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3);
}

.difficulty-btn.active {
    background: linear-gradient(135deg, #ff3333, #cc1111);
    color: #fff;
    box-shadow: 
        0 4px 15px rgba(255, 50, 50, 0.4),
        0 0 12px rgba(255, 50, 50, 0.6);
    transform: translateY(-1px);
}

.difficulty-buttons-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: center;
}
.board {
    display: grid;
    grid-template-columns: repeat(3, 90px);
    grid-template-rows: repeat(3, 90px);
    gap: 12px;
    justify-content: center;
    margin-bottom: 1rem;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.cell {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    font-weight: 900;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.6),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.cell::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle, rgba(0, 100, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.cell:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.8),
        0 0 20px rgba(0, 100, 255, 0.3);
    border-color: rgba(0, 100, 255, 0.5);
}

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

.cell.winner {
    background: rgba(0, 0, 0, 0.9);
    border-color: #0066ff;
    box-shadow: 
        0 8px 25px rgba(0, 100, 255, 0.6),
        0 0 30px rgba(0, 100, 255, 0.8);
    animation: winnerPulse 1s ease-in-out infinite alternate;
}

@keyframes winnerPulse {
    from {
        box-shadow: 
            0 8px 25px rgba(0, 100, 255, 0.6),
            0 0 30px rgba(0, 100, 255, 0.8);
    }
    to {
        box-shadow: 
            0 12px 35px rgba(0, 100, 255, 0.8),
            0 0 40px rgba(0, 100, 255, 1);
    }
}
.controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    gap: 1rem;
}

.controls button {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Orbitron', monospace;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex: 1;
    position: relative;
    overflow: hidden;
}

.controls button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.controls button:hover::before {
    left: 100%;
}

.controls button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background: linear-gradient(135deg, #0066ff, #0044cc);
}

.sound-toggle {
    font-size: 1.2rem !important;
    padding: 0.7rem 1rem !important;
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sound-toggle:hover {
    background: linear-gradient(135deg, #ff9500, #cc7700) !important;
}

.message {
    text-align: center;
    font-size: 1.2rem;
    font-weight: 700;
    min-height: 1.5em;
    margin-top: 0.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    text-shadow: 0 0 10px rgba(0, 100, 255, 0.5);
    animation: messageGlow 2s ease-in-out infinite alternate;
}

@keyframes messageGlow {
    from {
        box-shadow: 0 0 10px rgba(0, 100, 255, 0.3);
    }
    to {
        box-shadow: 0 0 20px rgba(255, 50, 50, 0.4);
    }
}
@media (max-width: 500px) {
    .container {
        padding: 1.5rem 1rem;
        min-width: unset;
        max-width: 95vw;
        margin: 1rem;
    }
    
    .board {
        grid-template-columns: repeat(3, 70px);
        grid-template-rows: repeat(3, 70px);
        gap: 8px;
        padding: 0.8rem;
    }
    
    .cell {
        font-size: 2.2rem;
    }
    
    h1 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
    
    .mode-select button,
    .controls button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .difficulty-select {
        padding: 1rem;
        gap: 0.4rem;
        flex-direction: column;
        align-items: center;
    }
    
    .difficulty-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.8rem;
        min-width: 65px;
        margin: 0.1rem;
    }
    
    .difficulty-select span {
        width: 100%;
        text-align: center;
        margin-bottom: 0.5rem;
        margin-right: 0;
        font-size: 0.9rem;
    }
    
    .difficulty-buttons-row {
        display: flex;
        gap: 0.5rem;
        justify-content: center;
        width: 100%;
    }
    
    .scoreboard {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
    
    .message {
        font-size: 1rem;
        padding: 0.8rem;
    }
}

@keyframes cellAppear {
    from {
        transform: scale(0) rotate(180deg);
        opacity: 0;
    }
    to {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

/* Additional hover effects for X and O */
.cell:empty:hover::after {
    content: '';
    position: absolute;
    width: 60%;
    height: 60%;
    border: 3px solid rgba(255, 107, 107, 0.4);
    border-radius: 50%;
    animation: cellPreview 0.3s ease-out;
}

@keyframes cellPreview {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}
