:root {
    --bg: #0d0d0d;
    --surface: #191919;
    --purple: #6c55d6;
    --lime: #e3ef19;
    --green: #abce2c;
    --text: #f8f8f8;
    --soft: #d8d8d8;
}

* {
    box-sizing: border-box;
}

html {
    background-color: var(--bg);
    color-scheme: dark;
    min-height: 100%;
    min-height: 100dvh;
}

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    color: var(--text);
    font-family: 'Montserrat', sans-serif;
    position: relative;
    isolation: isolate;
    overflow-x: hidden;
}

body::before {
    content: "";
    position: fixed;
    top: calc(0px - env(safe-area-inset-top, 0px));
    right: calc(0px - env(safe-area-inset-right, 0px));
    bottom: calc(0px - env(safe-area-inset-bottom, 0px));
    left: calc(0px - env(safe-area-inset-left, 0px));
    background-image:
            linear-gradient(rgba(13, 13, 13, 0.72), rgba(13, 13, 13, 0.72)),
            url("https://magictwin.net/MagictwinsWorld/files/img/sonar/background.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(10px) brightness(1);
    transform: scale(1.04);
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: "";
    position: fixed;
    top: calc(0px - env(safe-area-inset-top, 0px));
    right: calc(0px - env(safe-area-inset-right, 0px));
    bottom: calc(0px - env(safe-area-inset-bottom, 0px));
    left: calc(0px - env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, rgba(13, 13, 13, 0.6) 0%, rgba(25, 25, 25, 0.78) 100%);
    z-index: 1;
    pointer-events: none;
}

body > * {
    position: relative;
    z-index: 2;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 980px);
    padding: 40px 20px 30px;
}

.profile-container {
    display: flex;
    align-items: center;
    gap: 56px;
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 390px);
}

.profile img {
    width: min(100%, 330px);
    height: auto;
    margin-bottom: 14px;
    object-fit: contain;
    filter: drop-shadow(0 0 22px rgba(108, 85, 214, 0.35));
}

.profile .tagline {
    margin: 0 0 12px;
    color: var(--lime);
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.92rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid rgba(227, 239, 25, 0.55);
    border-radius: 999px;
    padding: 6px 12px;
}

.profile .description {
    margin: 0;
    color: var(--soft);
    line-height: 1.5;
    text-align: center;
    font-size: 0.93rem;
    max-width: 34ch;
    text-wrap: pretty;
}

.profile .description br {
    display: block;
    content: "";
    margin: 0.3em 0;
}

.links {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: min(100%, 340px);
}

.links ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
    width: 100%;
}

.links li {
    margin-bottom: 10px;
}

.links a {
    text-decoration: none;
    color: var(--text);
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    border-radius: 10px;
    padding: 10px 12px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    transition: transform 0.14s ease, color 0.14s ease, text-shadow 0.14s ease, filter 0.14s ease;
}

.links a i {
    margin-right: 12px;
    width: 24px;
    text-align: center;
    font-size: 1rem;
}

.links a:hover {
    transform: translateX(2px);
    text-shadow: 0 0 14px rgba(248, 248, 248, 0.25);
}

.discord { color: #5865f2; }
.vrchat { color: var(--green); }
.timeline { color: #f59e0b; }
.bluesky { color: #1185fe; }
.patreon { color: #ff424d; }
.twitch { color: #9146ff; }
.youtube { color: #ff0000; }

.discord:hover { color: #7b86ff; text-shadow: 0 0 14px rgba(88, 101, 242, 0.52); }
.vrchat:hover { color: #c4ee56; text-shadow: 0 0 14px rgba(171, 206, 44, 0.52); }
.timeline:hover {
    color: #ffb347 !important;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.85), 0 0 24px rgba(255, 140, 0, 0.7);
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.65));
}
.bluesky:hover { color: #4ea7ff; text-shadow: 0 0 14px rgba(17, 133, 254, 0.52); }
.patreon:hover { color: #ff7a55; text-shadow: 0 0 14px rgba(255, 122, 85, 0.52); }
.twitch:hover { color: #ae78ff; text-shadow: 0 0 14px rgba(145, 70, 255, 0.52); }
.youtube:hover { color: #ff4d4d; text-shadow: 0 0 14px rgba(255, 0, 0, 0.52); }

.discord:focus-visible, .discord:active { color: #7b86ff; text-shadow: 0 0 14px rgba(88, 101, 242, 0.52); }
.vrchat:focus-visible, .vrchat:active { color: #c4ee56; text-shadow: 0 0 14px rgba(171, 206, 44, 0.52); }
.timeline:focus-visible,
.timeline:active {
    color: #ffb347 !important;
    text-shadow: 0 0 10px rgba(255, 140, 0, 0.85), 0 0 24px rgba(255, 140, 0, 0.7);
    filter: drop-shadow(0 0 8px rgba(255, 140, 0, 0.65));
}
.bluesky:focus-visible, .bluesky:active { color: #4ea7ff; text-shadow: 0 0 14px rgba(17, 133, 254, 0.52); }
.patreon:focus-visible, .patreon:active { color: #ff7a55; text-shadow: 0 0 14px rgba(255, 122, 85, 0.52); }
.twitch:focus-visible, .twitch:active { color: #ae78ff; text-shadow: 0 0 14px rgba(145, 70, 255, 0.52); }
.youtube:focus-visible, .youtube:active { color: #ff4d4d; text-shadow: 0 0 14px rgba(255, 0, 0, 0.52); }

.smol {
    font-size: 0.75rem;
    color: rgba(248, 248, 248, 0.55);
    text-align: center;
    width: 100%;
    max-width: 720px;
    margin-top: 8px;
}

.credit-block {
    position: fixed;
    left: 12px;
    bottom: 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}

.credit {
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: rgba(248, 248, 248, 0.35);
    text-decoration: none;
    transition: color 0.14s ease;
    line-height: 1.1;
}

.credit:hover {
    color: rgba(248, 248, 248, 0.6);
}

.last-edit {
    position: fixed;
    right: 12px;
    bottom: 10px;
    font-family: 'Rajdhani', sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: rgba(248, 248, 248, 0.35);
    line-height: 1.1;
    text-align: right;
}

@media only screen and (max-width: 760px) {
    .container {
        padding-top: 28px;
    }

    .profile-container {
        flex-direction: column;
        gap: 24px;
    }

    .links {
        width: min(100%, 430px);
        align-items: center;
    }

    .links ul {
        width: min(100%, 340px);
        margin: 0 auto;
    }

    .links a {
        justify-content: center;
    }
}

/* ==========================================================================
   Unified Error Page Components
   ========================================================================== */
.error-container {
    flex-direction: column !important;
    text-align: center;
    gap: 15px;
}

.error-code {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 700;
    color: #00d4ff;
    text-shadow: 0 0 20px rgba(0, 212, 255, 0.6), 0 0 40px rgba(108, 85, 214, 0.4);
    margin: 0;
    letter-spacing: 4px;
    line-height: 1;
}

.error-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--lime);
    margin-top: 10px;
    margin-bottom: 20px;
}

.error-desc {
    max-width: 480px;
    color: var(--soft);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-top: 0;
    margin-bottom: 30px;
    margin-left: auto;
    margin-right: auto;
}

.action-links {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Rajdhani', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.04em;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #00d4ff, #6c55d6);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.5);
    color: #ffffff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    color: var(--text);
}

