/* Google Font (Optional) */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&display=swap');

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: #fff;
    text-align: center;
    min-height: 100vh;
    overflow-x: hidden;
    animation: pulse-bg 15s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    padding: 15px 30px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    flex-wrap: wrap;
    backdrop-filter: blur(10px);
}

header p {
    font-size: 1.6rem;
    font-weight: bold;
    color: #61dafb;
    margin: 0;
    text-shadow: 0 0 8px #61dafb, 1px 1px 3px #000;
}

nav {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

nav a {
    color: #ccc;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0%;
    height: 2px;
    background: #61dafb;
    left: 0;
    bottom: -4px;
    transition: 0.4s ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover {
    color: #ffffff;
    text-shadow: 0 0 5px #61dafb;
}

h1 {
    font-size: 3rem;
    color: #ffffff;
    margin: 30px 0 10px;
    text-shadow: 2px 2px 6px #000, 0 0 10px rgba(255,255,255,0.3);
    animation: glowText 3s ease-in-out infinite alternate;
}

@keyframes glowText {
    from {
        text-shadow: 0 0 10px #61dafb, 2px 2px 6px #000;
    }
    to {
        text-shadow: 0 0 20px #ffffff, 2px 2px 6px #000;
    }
}

#game {
    display: grid;
    grid-template-columns: repeat(3, 110px);
    gap: 15px;
    justify-content: center;
    margin: 30px auto;
}

.box {
    width: 110px;
    height: 110px;
    font-size: 3rem;
    font-weight: bold;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 2px solid #61dafb;
    border-radius: 12px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 10px rgba(97, 218, 251, 0.4);
    transition: all 0.25s ease-in-out;
}

.box:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 6px 18px rgba(0,0,0,0.6), 0 0 15px #61dafb;
}

#reset, #new-btn {
    padding: 12px 28px;
    margin: 20px 10px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(to right, #ff416c, #ff4b2b);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4), 0 0 12px #ff416c;
}

#reset:hover, #new-btn:hover {
    background: linear-gradient(to right, #ff4b2b, #ff416c);
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.5), 0 0 15px #ff4b2b;
}

#msg {
    font-size: 2rem;
    font-weight: bold;
    color: #fff;
    margin-bottom: 20px;
    text-shadow: 1px 1px 4px #000, 0 0 10px #61dafb;
}

.msg-container {
    height: 90vmin;
    padding: 30px;
    margin: 30px auto;
    border-radius: 16px;
    width: fit-content;
    display: flex;
    flex-direction: column;
    align-items: center;
    backdrop-filter: blur(5px);
}

.hide {
    display: none;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }

    nav {
        justify-content: center;
        width: 100%;
        margin-top: 10px;
    }

    #game {
        grid-template-columns: repeat(3, 80px);
        gap: 10px;
    }

    .box {
        width: 80px;
        height: 80px;
        font-size: 2rem;
    }

    h1 {
        font-size: 2.2rem;
    }

    #msg {
        font-size: 1.5rem;
    }
}
