@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap');

* {
    margin: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    user-select: none;
    color: white;
}
main {
    background: transparent;
    background-color: rgba(0, 0, 0, 0.4);
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
}
.background-clip{
    position: absolute;
    right: 0;
    bottom: 0;
    z-index: -1; 
}
@media (min-aspect-ratio: 16/9) {
    .background-clip{
        width: 100%;
        height: auto;
    }
}
@media (max-aspect-ratio: 16/9) {
    .background-clip{
        width: auto;
        height: 100%;
    }
}

@media (max-width: 768px) {
    main {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 16px;
        min-height: 100vh;
        text-align: center;
    }
}

@media (max-width: 768px) {
    .background-clip {
        left: 50%;
        transform: translateX(-50%);
    }
}

#header {
    display: flex;
    width: 235px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}
#header .player {
    background: #17122A;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 12px;
    border: solid 4px #17122A;
    opacity: 0.5;
    transition: 0.3s;
}
#header .player:hover {
    border: solid 4px #2A2343;
}
#header .player-active {
    opacity: 1;
    border: solid 4px #2A2343;
}
#header #xPlayerDisplay {
    color: #1892EA;
}
#header #oPlayerDisplay {
    color: #A737FF;
}

#board {
    display: grid;
    grid-template-columns: repeat(3, 70px);
    grid-template-rows: repeat(3, 70px);
    gap: 12px;
}
#board .cell {
    background: #17122A;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s background;
}
#board .cell:hover {
    background: #2A2343;
}

#restartBtn {
    position: relative;
    margin-top: 30px;
    width: 235px;
    padding: 8px 0;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    overflow: hidden;
    opacity: 0;
    transform: translateY(50px);
    pointer-events: none;
    transition: 0.3s background;
}

/* Slide in */
#restartBtn.show {
    animation: slideInUp 0.6s ease-out forwards;
    pointer-events: auto;
}

/* Slide out */
#restartBtn.hide {
    animation: slideOutDown 0.4s ease-in forwards;
    pointer-events: none;
}

/* Keyframes */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(50px);
    }
}

/* Hover effects */
#restartBtn:hover {
    background: #2A2343;
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
    filter: brightness(1.1);
}

/* Shine effect */
#restartBtn::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.2) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}
#restartBtn:hover::before,
#restartBtn:focus::before,
#restartBtn:active::before {
    transform: translateX(100%);
}
