:root {
    --ice-cold: #a0d2eb;      /* light icy blue */
    --freeze-purple: #e5eaf5; /* pale lavender */
    --medium-purple: #d0bdf4; /* soft medium purple */
    --purple-pain: #8458b3;   /* vintage deep purple */
    --heavy-purple: #6a3f8f;  /* darker rich purple */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    outline: none;
    border: none;
    text-decoration: none;
    
    transition: .2s linear;
}


html {
    font-size: 62.5%;
    scroll-behavior: smooth;
    scroll-padding-top: 6rem;
    overflow-x: hidden;
}

body{
    background: linear-gradient(135deg, #d9b3ff, #f3d1ff);

}
section{
    padding: 2rem 9%;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--purple-pain);
    padding: 2rem 9%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 .5rem 1rem rgba(0,0,0,0.1);
}



header .logo {
    font-size: 3rem;
    color: var(--ice-cold);
    font-weight: bolder;
}

header .logo span {
    color: rgb(255, 255, 0);
}

header .navbar a {
    font-size: 2rem;
    padding: 0 1.5rem;
    color: var(--freeze-purple);
}

header .navbar a:hover {
    color: var(--heavy-purple);
    text-decoration: underline;
}

header #toggler {
    display: none;
}

header .fa-bars {
    font-size: 3rem;
    color: var(--heavy-purple);
    border-radius: .5rem;
    padding: .5rem 1.5rem;
    cursor: pointer;
    border: .1rem solid rgba(0,0,0,0.3);
    display: none;
}

.main-container{
    margin-top: 120px;
    margin-bottom: 60px;
}

.mg-description {
    background: linear-gradient(135deg, #6a0dad, #b065ff);
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 16px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    margin: 20px auto;
    max-width: 80%;
    line-height: 1.6;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    
}

.mg-description h1 {
    font-size: 2rem;
    margin-bottom: 0.8rem;
}

.mg-description p {
    font-size: 1.2rem;
    max-width: 650px;
    margin: 0 auto;
}

.mg-description:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mg-description {
        padding: 1.4rem;
    }
    .mg-description h1 {
        font-size: 1.7rem;
    }
    .mg-description p {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .mg-description {
        padding: 1rem;
    }
    .mg-description h1 {
        font-size: 1.5rem;
    }
    .mg-description p {
        font-size: 1rem;
    }
}


.home{
    display: flex;
    align-items: center;
    min-height: 100vh;
}

/* Tablet view */
@media (max-width: 991px) {
    html {
        font-size: 55%;
    }
    header {
        padding: 2rem;
    }
}

/* Mobile view */
@media (max-width: 768px) {
    header .fa-bars {
        display: block;
    }

    header .navbar {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--freeze-purple);
        border-top: .1rem solid rgba(0,0,0,0.1);
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.3s ease;
    }

    #toggler:checked ~ .navbar {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
    }

    header .navbar a {
        margin: 1.5rem;
        padding: 1.5rem;
        background: var(--ice-cold);
        border: 0.1rem solid rgba(0,0,0,0.1);
        display: block;
    }
}

.site-footer {
    
    width: 100%;
    bottom: 0; 
    right: 0;
    left: 0;   
    background-color: #5e3a78; /* deep retro purple */
    color: #eee;               /* light text for contrast */
    text-align: center;
    padding: 15px 10px;
    font-size: 0.9rem;          /* base size */
    margin-top: 30px;           /* space before footer */
    line-height: 1.5;
    position: fixed;
}

.site-footer a {
    color: #d6b3e0;             /* light lavender link */
    text-decoration: none;
}

.site-footer a:hover {
    color: #ffffff;             /* white hover for contrast */
    text-decoration: underline;
}

#math-game {
    
    max-width: 420px;
    margin: auto;
    padding: 20px;
    border-radius: 16px;
    text-align: center;
    font-family: 'Segoe UI', sans-serif;

    /* Breathing Ocean Gradient */
    background: linear-gradient(var(--angle),
    rgba(5, 15, 25, 0.9),
    rgba(0, 60, 90, 0.85),
    rgba(0, 120, 100, 0.85)
    );

    background-size: 300% 300%;
    animation: breathingGradient 10s ease-in-out infinite, rotateGradient 30s ease-in-out infinite;

    /* Glassmorphism */
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    color: #fff;
}

/* Allow animating angle */
@property --angle {
    syntax: "<angle>";
    initial-value: 135deg;
    inherits: false;
}

/* Gradient position breathing */
@keyframes breathingGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Gradient angle rotation */
@keyframes rotateGradient {
    0% { --angle: 135deg; }
    50% { --angle: 315deg; }
    100% { --angle: 135deg; }
}


/* Headings */
#math-game h2 {
    color: #fff;
    margin-bottom: 12px;
    font-weight: 500;
    letter-spacing: 1px;
}

/* Dropdown */
#math-game select {
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    outline: none;
}
#math-game select option {
    background: #111;
    color: #fff;
}

/* Stats text */
#math-game p {
    margin: 6px 0;
    color: rgba(255, 255, 255, 0.85);
}

/* Question */
#math-game #question {
    font-size: 26px;
    font-weight: bold;
    margin: 18px 0;
    color: #00ffd0; /* Neon cyan */
    text-shadow: 0 0 8px rgba(0, 255, 208, 0.8);
}

/* Input field */
#math-game input[type="number"] {
    padding: 10px;
    width: 85%;
    font-size: 16px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    text-align: center;
    transition: box-shadow 0.2s ease;
}
#math-game input[type="number"]:focus {
    box-shadow: 0 0 10px rgba(0, 255, 208, 0.6);
}

/* Buttons */
#math-game button {
    margin-top: 12px; /* Added space above button */
    padding: 10px 20px;
    font-size: 16px;
    cursor: pointer;
    background: linear-gradient(135deg, #00ffd0, #007d6e);
    border: none;
    border-radius: 8px;
    color: #000;
    font-weight: bold;
    transition: transform 0.1s ease, box-shadow 0.3s ease;
}

#math-game button:hover {
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(0, 255, 208, 0.8);
}

/* Responsive */
@media (max-width: 500px) {
    #math-game {
        max-width: 95%;
        padding: 15px;
    }
    #math-game #question {
        font-size: 22px;
    }
    #math-game button {
        width: 100%;
        margin-top: 8px;
    }
    #math-game input[type="number"] {
        width: 100%;
    }
}

/* Feedback Colors */
#math-game.correct {
    background: linear-gradient(135deg, rgba(0, 30, 30, 0.9), rgba(0, 50, 50, 0.8));
    background-size: 200% 200%;
    animation: gradientMove 1.5s ease;
}
#math-game.wrong {
    background: linear-gradient(135deg, rgba(30, 0, 0, 0.9), rgba(50, 0, 0, 0.8));
    background-size: 200% 200%;
    animation: gradientMove 1.5s ease;
}



/*related tool link section*/
.related-tools {
    margin: 30px auto;
    padding: 15px;
    background: #f5f3ff; /* light lavender */
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    max-width: 900px; /* keeps it centered in large screens */
    text-align: center; /* center text content */
}

.related-tools h3 {
    margin-bottom: 15px;
    font-size: 1.5em;
    color: #4a148c; /* deep purple */
    border-bottom: 2px solid #ffd54f; /* yellow-gold */
    padding-bottom: 8px;
    display: inline-block; /* so underline doesn't stretch full width */
}

.related-tools ul {
    list-style: none;
    margin: 0 auto;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    justify-items: center; /* center each grid item */
}

.related-tools li {
    background: #fffbea; /* light gold */
    padding: 10px 12px;
    border-radius: 6px;
    transition: 0.2s ease;
    border: 1px solid #ffe082; /* pale yellow */
    width: 100%;
    max-width: 220px; /* prevents extra wide items */
}

.related-tools li:hover {
    background: #ffecb3; /* richer gold hover */
    border-color: #ffd54f; /* deep gold */
}

.related-tools a {
    text-decoration: none;
    color: #4a148c; /* deep purple */
    font-weight: bold;
    display: block;
    word-break: break-word;
}

.related-tools a:hover {
    color: #d5006d; /* pink-purple hover */
    text-decoration: underline;
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 768px) {
    .related-tools ul {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 8px;
    }
    .related-tools h3 {
        font-size: 1.3em;
    }
}

@media (max-width: 480px) {
    .related-tools {
        padding: 10px;
    }
    .related-tools ul {
        grid-template-columns: 1fr; /* stack items */
    }
    .related-tools li {
        padding: 8px;
        max-width: 100%;
    }
}
