:root {
    --hover: var(--main);
    --lights-red: #f04747;
    --lights-green: #43b581;
    --lights-blue: #00a9ff;
}

/* Toggle mode. */
label[switch] {
    position: absolute;
    display: inline-block;
    right: 0;
    margin: 3px 20px;
    width: 40px;
    height: 24px;
    z-index: 5;
}

label[switch] input {
    opacity: 0;
    width: 0;
    height: 0;
}

span[slider] {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--lvlup);
    -webkit-transition: 0.4s;
    transition: 0.4s;
    border-radius: 5px;
}

span[slider]:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 5px;
    bottom: 4px;
    background-color: white;
    -webkit-transition: 0.4s;
    transition: 0.4s;
    border-radius: 5px;
}

input:checked + span[slider] {
    background-color: var(--primary);
}

input:checked + span[slider]:before {
    transform: translateX(14px);
}

/* Page style. */
html,
body {
    margin: 0;
    background: linear-gradient(135deg, var(--background) 80%, var(--hover) 100%) !important;
    height: 100%;
    width: 100%;
    color: var(--color);
}

/* Main styles. */
main {
    padding: 50px;
}

div[avatar] {
    background: url(../images/profile.png) no-repeat;
    width: 150px;
    height: 150px;
    background-position: center;
    background-size: cover;
    border-radius: 50%;
}

div[name] {
    font-weight: bold;
    font-size: 50px;
    margin: auto 25px;
}

div[name]:before {
    content: "@";
}

div[name]:after {
    content: "#0001";
}

div[name]:before,
div[name]:after {
    color: var(--hover);
    opacity: 0;
    transition-duration: 0.4s;
}

body[before] div[name]:before,
body[after] div[name]:after {
    opacity: 0.5;
}

div[header] {
    display: flex;
}

/* Desktop Navigation Layout */
nav.main-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px 20px;
    background: var(--lvlup);
    position: relative;
}

.nav-links {
    display: flex;
    gap: 15px;
    margin-right: 20px;
}

.nav-links a {
    color: var(--color);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: 0.3s;
    font-weight: bold;
    background: transparent;
}

.nav-links a:hover {
    background: var(--hover);
    color: #121212;
}

.mobile-checkbox, .hamburger-icon {
    display: none;
}

/* Links styles (Social Grid). */
div[links] {
    height: calc(100vh - 400px);
    display: flex;
    justify-content: center;
    align-items: center;
}

div[links] div {
    transition-duration: 0.4s;
    padding: 12px 12px 8px 12px;
    background: var(--hover);
    border-radius: 10px;
    margin: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
}

div[links] img {
    filter: drop-shadow(2px 2px 0 black);
    width: 50px;
}

div[links] div:hover {
    transform: scale(1.1);
    filter: brightness(1.3);
}

/* Footer styles. */
footer {
    position: absolute;
    bottom: 0;
    transition-duration: 0.4s;
    opacity: 0;
}

div[icon] {
    margin: 0 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 150px;
    height: 150px;
    background: linear-gradient(to right, var(--hover) 20%, transparent 80%);
    border-radius: 10px;
}

div[icon] img {
    background-size: contain;
    width: 100px;
    position: absolute;
    opacity: 0;
    animation: 1s reveal forwards ease;
}

@keyframes reveal {
    100% {
        opacity: 1;
        margin-left: 60px;
    }
}

div[site] {
    font-weight: bold;
    font-size: 50px;
    margin: 0 0 35px 25px;
    color: var(--hover);
}

/* Tooltip styles. */
[tooltip]:before {
    content: attr(tooltip);
    position: absolute;
    margin-top: -125px;
    white-space: nowrap;
    font-weight: bold;
    padding: 10px;
    background: #c0c0c0;
    color: #121212;
    border-radius: 10px;
    opacity: 0;
    transition-duration: 0.4s;
}

[tooltip]:hover:before {
    pointer-events: auto;
    opacity: 1;
}

/* Time styles. */
div[time] {
    position: absolute;
    right: 0;
    margin: -35px 15px;
    font-size: 20px;
    text-align: end;
    transition-duration: 0.4s;
    opacity: 0;
    z-index: 100;
}

div[local]:before {
    content: "You have wasted ";
}

div[local]:after {
    content: " on this site";
}

div[global]:before {
    content: "The current time is: ";
}

/* Lights & Animations */
[lights] {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 10px;
}

[lights]:before {
    content: "";
    width: 2px;
    height: 10px;
    background: #515151;
    position: absolute;
    margin-top: -38px;
}

[lights] > div {
    width: 12px;
    height: 28px;
    border-radius: 50%;
    margin: 0 10px;
}

[lights] > div:nth-child(3n + 1) { animation: show-red 2s infinite ease-in-out; }
[lights] > div:nth-child(3n + 2) { animation: show-blue 2s infinite ease-in-out; }
[lights] > div:nth-child(3n + 3) { animation: show-green 2s infinite ease-in-out; }

@keyframes show-red {
    33.4%, 100% { background: rgba(240, 71, 71, 0.2); }
    0%, 33.3% { background: var(--lights-red); }
}

@keyframes show-blue {
    0%, 33.2%, 66.7%, 100% { background: rgba(71, 240, 240, 0.2); }
    33.3%, 66.6% { background: var(--lights-blue); }
}

@keyframes show-green {
    0%, 66.5% { background: rgba(71, 240, 71, 0.2); }
    66.6%, 99.9% { background: var(--lights-green); }
}

[lights] > div:before {
    content: "";
    width: 14px;
    height: 12px;
    border-radius: 5px 5px 3px 3px !important;
    display: block;
    border-radius: 50%;
    background: #515151;
    top: -12px;
    margin-left: -1px;
}

[lights] > div:nth-child(3n + 1):before { animation: glow-red 2s infinite ease-in-out; }
[lights] > div:nth-child(3n + 2):before { animation: glow-blue 2s infinite ease-in-out; }
[lights] > div:nth-child(3n + 3):before { animation: glow-green 2s infinite ease-in-out; }

[lights].active > div {
    background: var(--hover);
    animation: none;
}

[lights].active > div:before {
    filter: drop-shadow(0 18px 10px var(--hover));
    animation: none;
}

@keyframes glow-blue {
    0%, 33.2%, 66.7%, 100% { filter: none; }
    33.3%, 66.6% { filter: drop-shadow(0 18px 10px var(--lights-blue)); }
}

@keyframes glow-green {
    0%, 66.5% { filter: none; }
    66.6%, 99.9% { filter: drop-shadow(0 18px 10px var(--lights-green)); }
}

@keyframes glow-red {
    33.4%, 100% { filter: none; }
    0%, 33.3% { filter: drop-shadow(0 18px 10px var(--lights-red)); }
}

[lights]:after {
    content: "";
    width: 100%;
    height: 50px;
    background: none;
    position: absolute;
    margin-top: 8px;
}

[lights].off > div {
    background: var(--lvlup) !important;
}

[lights].off > div:before {
    filter: none !important;
}

[lights] > div:after {
    content: "";
    position: absolute;
    width: 30px;
    height: 9px;
    border-radius: 0 0 50% 50% !important;
    display: block;
    border-radius: 50%;
    background: none;
    outline: 2px solid #515151;
    margin: -10px 0 0 7px;
    z-index: 2;
}

[lights] > div:last-child:after {
    display: none;
}

/* Banner */
#banner {
    background: var(--lvlup);
    padding: 10px;
    text-align: center;
}

#banner p {
    margin: 0;
}

#banner #full {
    height: 0;
    overflow: hidden;
    transition-duration: 200ms;
    position: fixed;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    z-index: 1000;
    margin: 10px -20px;
    width: calc(100vw - 30px);
}

#banner img {
    display: block;
}

#banner #full > div:first-child {
    display: flex;
    justify-content: center;
    align-items: center;
}

[copyright] {
    margin-top: -15px;
    text-align: center;
}

/* Content styles. */
div[mount] {
    margin-top: 40px;
    height: calc(100vh - 400px);
    display: flex;
    justify-content: center;
    align-items: center;
}

div[upload] {
    margin-top: 40px;
    display: flex;          
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

div[viewable] {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--color);
    text-align: center;
    font-weight: bold;
}

div[viewable]:before {
    margin-top: -105px;
    color: #f04747;
    font-weight: bold;
    border-radius: 5px;
}

div[viewable]:hover {
    background: var(--lvlup);
}

input[upload] {
    margin-left: 10px;
    border-radius: 5px;
    border: none;
    color: var(--background);
    background: var(--color);
    text-align: center;
    font-weight: bold;
    cursor: pointer;
}

div[note] {
    text-align: center;
    font-size: 17px;
    background: var(--lvlup);
    padding: 10px;
    margin: 10px;
    border-radius: 5px;
    line-height: 30px;
}

div[content] h1 {
    text-align: center;
    width: 100%;
}

code {
    color: #f04747;
}

body[success] code {
    color: #43b581;
}

body[halted] code {
    color: #faa61a;
}

div[status] {
    margin-top: 0;
    display: flex;
    justify-content: center;
    cursor: pointer;
}

div[status] a {
    padding: 12px;
    margin: 5px;
    border-radius: 5px;
    background: var(--lvlup);
    border: 1px solid var(--lvlup);
    color: var(--color);
    text-decoration: none;
    transition-duration: 0.4s;
}

div[status] a:hover {
    background: transparent;
    border: 1px solid var(--lvlup);
}

div[url] {
    display: block;
}

div[url] button {
    display: block;
    margin: 20px auto;
    border: none;
    padding: 12px;
    border-radius: 5px;
    border: 1px solid var(--lvlup);
    background: var(--lvlup);
    color: var(--color);
    transition-duration: 0.4s;
}

div[url] button:hover {
    background: transparent;
    border: 1px solid var(--lvlup);
}

div[url] code {
    font-size: 20px;
}

body[success] div[url] button:active {
    background: #43b581;
}

body[halted] div[note], body[failed] div[note] {
    width: 50%;
    margin: 20px auto;
    font-weight: 600;
}

/* Contact form. */
div[contact] form {
    width: 350px;
    margin: auto;
}

div[contact] form input,
div[contact] select,
div[contact] textarea {
    width: 100%;
    padding: 7px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: none;
    background: var(--lvlup);
    color: var(--color);
    font-size: 18px;
    outline: none;
}

div[contact] textarea {
    margin-bottom: 8px;
}

div[contact] select {
    width: 365px;
}

div[contact] option {
    background: var(--main);
}

div[contact] div[capcha] {
    display: flex;
    width: 365px;
}

div[contact] div[capcha] img {
    height: 45px;
    border-radius: 5px 0 0 5px;
}

div[contact] div[capcha] input {
    border-radius: 0 5px 5px 0;
    height: 31px;
}

.contact-form-input {
    width: 50%;
    height: 50px;
    border-radius: 5px;
    border: 1px solid var(--lvlup);
    background: var(--main);
    color: var(--color);
    font-size: 20px;
    display: inline-block;
    padding: 10px;
    margin-bottom: 10px;
}

.contact-form-submit {
    width: 10%;
    height: 50px;
    border-radius: 5px;
    border: 1px solid var(--lvlup);
    background: var(--lvlup);
    color: var(--color);
    font-size: 20px;
    padding: 10px;
    margin-bottom: 10px;
}

.contact-form-submit:hover {
    width: 10%;
    height: 50px;
    border-radius: 5px;
    border: 1px solid green;
    background: var(--hover);
    font-size: 20px;
    padding: 10px;
    color: black;
    margin-bottom: 10px;
}

.captcha {
    width: 50%;
    height: 50px;
    border-radius: 5px;
    border: 1px solid var(--lvlup);
    background: var(--main);
    color: var(--color);
    font-size: 20px;
    padding: 10px;
    display: inline-block;
    margin-bottom: 10px;
}

div[ip] {
    font-weight: bold;
    font-size: 25px;
    margin: auto 25px;
    text-align: center;
    color: orangered;
}

/* ========================================= */
/* MOBILE OVERRIDES (Max Width 1000px)       */
/* ========================================= */
@media (max-width: 1000px) {
    /* ----- YOUR ORIGINAL PAGE & MAIN STYLES ----- */
    body {
        background: var(--background) !important;
    }

    main {
        padding: 25px;
        padding-top: 130px; /* Extra space so the top bar doesn't overlap your big avatar */
    }

    div[name]:before,
    div[name]:after {
        display: none;
    }

    div[name] {
        text-align: center;
        font-size: 600%;
    }

    div[avatar] {
        width: 500px;
        height: 500px;
        margin: auto;
    }

    div[header] {
        display: block;
    }

    /* ----- NEW FUNCTIONAL HAMBURGER MENU ----- */
    nav.main-nav {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100px; /* Made taller to fit your large toggle switch */
        background: var(--background);
        z-index: 1000;
        padding: 0 40px;
        box-sizing: border-box;
        border-bottom: 2px solid var(--lvlup);
    }

    .hamburger-icon {
        display: block;
        font-size: 60px; /* Scaled up to match your large profile text */
        cursor: pointer;
        font-weight: bold;
        color: var(--color);
    }

    .mobile-checkbox {
        display: none;
    }

    .nav-links {
        display: none; 
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        position: fixed;
        top: 100px; 
        left: 0;
        width: 100vw;
        height: calc(100vh - 100px);
        background: rgba(15, 15, 15, 0.95);
        backdrop-filter: blur(5px);
        padding-top: 40px;
        z-index: 999;
    }

    .nav-links a {
        background: var(--lvlup);
        width: 80vw;
        text-align: center;
        margin: 10px 0;
        padding: 40px;
        border-radius: 15px;
        font-size: 50px;
        color: var(--color);
        text-decoration: none;
        box-shadow: 0px 4px 10px rgba(0,0,0,0.5);
    }

    .mobile-checkbox:checked ~ .nav-links {
        display: flex;
    }

    /* ----- YOUR ORIGINAL TOGGLE SIZES ----- */
    label[switch] {
        position: relative;
        margin: 0;
        width: 100px;
        height: 60px;
        top: auto;
        right: auto;
    }

    span[slider]:before {
        height: 40px;
        width: 40px;
        left: 15px;
        bottom: 10px;
    }

    input:checked + span[slider] {
        background-color: var(--main);
    }
    
    input:checked + span[slider]:before {
        transform: translateX(30px);
    }

    /* ----- YOUR ORIGINAL GRID & LINK STYLES ----- */
    footer { display: none; }
    div[time] { display: none; }
    [tooltip]:before { display: none !important; }

    div[links] {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-gap: 5px;
        margin-top: 10px;
        height: auto;
    }

    div[links] div {
        width: 90%;
        height: 85%;
        margin: auto;
    }

    div[links] img {
        width: 250%;
        margin-left: -70%;
    }

    #banner #full {
        display: block !important;
        overflow: scroll !important;
    }

    /* Contact Form Mobile Adjustments */
    div[contact] form {
        width: 90vw !important;
    }

    div[contact] form input,
    div[contact] select,
    div[contact] textarea {
        margin-left: -10px;
        padding: 10px !important;
        margin-bottom: 25px !important;
        border-radius: 10px !important;
        font-size: 48px !important;
    }

    div[contact] select {
        width: calc(100% + 20px) !important;
    }

    div[contact] div[capcha] {
        width: calc(100% + 10px) !important;
    }

    div[contact] div[capcha] img {
        height: 145px !important;
        width: auto;
    }

    div[contact] div[capcha] input {
        height: 125px !important;
        margin-left: 0px;
        border-radius: 0 10px 10px 0 !important;
    }

    .contact-form-submit {
        width: 20vw !important;
        padding: 17px !important;
        border-radius: 10px !important;
        font-size: 47px !important;
    }
}