:root {
    --neon-blue: #00d4ff;
    --neon-pink: #ff007f;
    --bg-color: #05050a;
}

* {
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    
   
    background-image: linear-gradient(rgba(5, 5, 10, 0.75), rgba(5, 5, 10, 0.75)), url('neon.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    /* ------------------------------------------------ */

    color: white;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    overflow: hidden;
    touch-action: manipulation; 
}

#music-controls {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 15px;
    border: 1px solid var(--neon-blue);
    border-radius: 20px;
    box-shadow: 0 0 10px var(--neon-blue);
    z-index: 1000;
}

#music-controls button {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s;
    padding: 0;
    margin: 0;
}

#music-controls button:hover {
    transform: scale(1.2);
}

#volume-slider {
    width: 60px;
    cursor: pointer;
    accent-color: var(--neon-blue);
    background: transparent;
}

#volume-slider::-webkit-slider-runnable-track {
    background: rgba(0, 212, 255, 0.2);
    height: 4px;
    border-radius: 2px;
}

#track-name {
    font-size: 0.9rem;
    color: var(--neon-blue);
    font-weight: bold;
    white-space: nowrap;
}

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.card {
    text-align: center;
    padding: 2.5rem;
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 20px var(--neon-blue), inset 0 0 10px var(--neon-blue);
    border-radius: 20px;
    

    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

h1 span {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 20px;
}

.player-config {
    display: flex;
    gap: 10px;
    justify-content: space-between;
}

.player-config input, .player-config select {
    padding: 12px;
    background: #111;
    border: 1px solid var(--neon-blue);
    color: white;
    border-radius: 8px;
    width: 100%;
}

.scoreboard {
    display: flex;
    justify-content: space-around;
    align-items: center;
    
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    
    padding: 15px 20px;
    border-radius: 15px;
    border: 1px solid var(--neon-blue);
    box-shadow: 0 0 15px var(--neon-blue), inset 0 0 10px rgba(0, 212, 255, 0.2);
    margin-bottom: 20px;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.score-num {
    font-size: 2.5rem;
    font-weight: bold;
}

#p1-name-display, #score-x { color: var(--neon-blue); text-shadow: 0 0 10px var(--neon-blue); }
#p2-name-display, #score-o { color: var(--neon-pink); text-shadow: 0 0 10px var(--neon-pink); }

h2#status-text {
    text-align: center;
}

.board {
    display: grid;
    grid-template-columns: repeat(3, 100px);
    grid-template-rows: repeat(3, 100px);
    gap: 12px;
    justify-content: center;
    margin: 0 auto;
}

.cell {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    
    border: 1px solid rgba(0, 212, 255, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 2.5rem;
    cursor: pointer;
    transition: 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.cell:active {
    transform: scale(0.95);
}

.cell.win {
    animation: flash 0.5s infinite alternate;
    background: rgba(0, 212, 255, 0.2);
}

@keyframes flash {
    from { opacity: 1; }
    to { opacity: 0.5; }
}

button {
    padding: 10px 20px;
    background: transparent;
    color: var(--neon-blue);
    border: 2px solid var(--neon-blue);
    cursor: pointer;
    font-weight: bold;
    border-radius: 8px;
    transition: 0.3s;
    width: 100%;
    backdrop-filter: blur(5px);
}

button:hover {
    background: var(--neon-blue);
    color: black;
    box-shadow: 0 0 20px var(--neon-blue);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.hidden { display: none !important; }

.particle {
    position: fixed;
    width: 8px;
    height: 8px;
    background: var(--neon-blue);
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.1s;
    z-index: 9999;
}

@media (max-width: 600px) {
    #music-controls {
        top: 10px;
        right: 50%;
        transform: translateX(50%);
        width: 90%;
        justify-content: center;
    }
    
    .board {
        grid-template-columns: repeat(3, 80px);
        grid-template-rows: repeat(3, 80px);
        gap: 8px;
    }

    .cell {
        font-size: 2rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .player-config {
        flex-direction: column;
    }
}

.credits {
    position: fixed;
    bottom: 10px;
    left: 0; 
    width: 100%;
    text-align: center;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.6);
    z-index: 1000;
    pointer-events: none;
}

.credits span {
    color: var(--neon-blue);
    font-weight: bold;
    text-shadow: 0 0 5px var(--neon-blue);
}