/* CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #020502 url('bg.png') no-repeat center top fixed;
    background-size: cover;
    color: #fff;
    font-family: 'Inter', sans-serif;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.3) 100%);
    z-index: -4;
    pointer-events: none;
}

/* Background Texture: Deep Obsidian Black Stone */
.obsidian-texture {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(circle at 50% 50%, rgba(10, 10, 10, 0.2) 0%, #000000 100%),
        repeating-linear-gradient(45deg, #0a0a0a 25%, transparent 25%, transparent 75%, #0a0a0a 75%, #0a0a0a),
        repeating-linear-gradient(45deg, #0a0a0a 25%, #050505 25%, #050505 75%, #0a0a0a 75%, #0a0a0a);
    background-size: 100% 100%, 2px 2px, 2px 2px;
    opacity: 0.05;
    z-index: -3;
    mix-blend-mode: screen;
}

/* Real-Time Atmospheric Soul-Mist / Fog */
.fog-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: -2;
    pointer-events: none;
}

.fog {
    position: absolute;
    bottom: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(130, 160, 140, 0.08) 0%, rgba(0, 0, 0, 0) 60%);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.7;
    animation: drift 20s infinite ease-in-out alternate;
}

.fog-1 {
    left: -10%;
    animation-duration: 25s;
    animation-delay: 0s;
}

.fog-2 {
    right: -10%;
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(100, 120, 110, 0.12) 0%, rgba(0, 0, 0, 0) 70%);
    animation-duration: 30s;
    animation-delay: -5s;
}

.fog-3 {
    left: 40%;
    transform: translateX(-50%);
    width: 900px;
    height: 500px;
    background: radial-gradient(circle, rgba(120, 140, 130, 0.06) 0%, rgba(0, 0, 0, 0) 80%);
    animation-duration: 35s;
    animation-delay: -10s;
}

@keyframes drift {
    0% {
        transform: translateY(0) scale(1) translateX(0);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-300px) scale(1.2) translateX(50px);
        opacity: 0.8;
    }

    100% {
        transform: translateY(-600px) scale(1.5) translateX(-50px);
        opacity: 0;
    }
}

/* Main Layout: Linktree Container */
.linktree-container {
    width: 100%;
    max-width: 500px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
    position: relative;
}

/* Header & Logo */
.header {
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
}

.logo-wrapper {
    position: relative;
    width: calc(100% - 20px);
    /* Adjust to match buttons width excluding their wrapper padding */
    max-width: 480px;
    /* Slightly less than 500px to account for button frame thickness */
    height: auto;
    aspect-ratio: 1 / 1;
    margin: 0 auto 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cinematic Moody Lighting - Radial Green Glow */
.radial-glow {
    position: absolute;
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(57, 255, 20, 0.4) 0%, rgba(57, 255, 20, 0) 70%);
    filter: blur(40px);
    z-index: -1;
    animation: pulseGlow 4s infinite alternate;
}

@keyframes pulseGlow {
    0% {
        opacity: 0.5;
        transform: scale(0.9);
    }

    100% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 15px rgba(0, 0, 0, 0.9));
    z-index: 1;
}

/* Sub-header */
.sub-header {
    font-family: 'Forum', serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #39FF14;
    letter-spacing: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    text-shadow: 0 0 8px rgba(57, 255, 20, 0.4);
    opacity: 0.8;
}

.neon-dot {
    width: 4px;
    height: 4px;
    background-color: #39FF14;
    border-radius: 50%;
    box-shadow: 0 0 8px #39FF14;
    animation: pulsateDot 1.5s infinite alternate;
}

@keyframes pulsateDot {
    0% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* Body / Buttons Section */
.links-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 35px;
}

/* Category Blocks & Headers */
.category-block {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-header {
    font-family: 'Ruslan Display', serif;
    font-size: 0.95rem;
    font-weight: 400;
    color: #39FF14;
    text-align: left;
    letter-spacing: 3px;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 5px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Button Wrapper for Gothic Framings */
.button-wrapper {
    position: relative;
    width: 100%;
    padding: 10px;
    background: transparent;
    border-radius: 0;
    transition: transform 0.2s ease;
}

.button-wrapper:hover {
    transform: translateY(-2px);
}

/* Gothic Frame - The Ornamental RPG UI Style */
.gothic-frame {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 3;
    border: 1px solid rgba(57, 255, 20, 0.8);
    /* Outer thin border */
}

/* Precise Corner Ornaments (Dots and Brackets) */
.gothic-frame::before {
    /* 4 dots precisely at the outer corners */
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background:
        radial-gradient(circle, #39FF14 2px, transparent 2px) 0 0,
        radial-gradient(circle, #39FF14 2px, transparent 2px) 100% 0,
        radial-gradient(circle, #39FF14 2px, transparent 2px) 0 100%,
        radial-gradient(circle, #39FF14 2px, transparent 2px) 100% 100%;
    background-size: 6px 6px;
    background-repeat: no-repeat;
    z-index: 4;
}

.gothic-frame::after {
    /* Inner L-brackets with fixed offsets for perfect symmetry */
    content: '';
    position: absolute;
    top: 7px;
    left: 7px;
    right: 7px;
    bottom: 7px;
    background:
        /* Top Left */
        linear-gradient(to right, #39FF14 12px, transparent 12px) 0 0 / 100% 1px,
        linear-gradient(to bottom, #39FF14 12px, transparent 12px) 0 0 / 1px 100%,
        /* Top Right */
        linear-gradient(to left, #39FF14 12px, transparent 12px) 100% 0 / 100% 1px,
        linear-gradient(to bottom, #39FF14 12px, transparent 12px) 100% 0 / 1px 100%,
        /* Bottom Left */
        linear-gradient(to right, #39FF14 12px, transparent 12px) 0 100% / 100% 1px,
        linear-gradient(to top, #39FF14 12px, transparent 12px) 0 100% / 1px 100%,
        /* Bottom Right */
        linear-gradient(to left, #39FF14 12px, transparent 12px) 100% 100% / 100% 1px,
        linear-gradient(to top, #39FF14 12px, transparent 12px) 100% 100% / 1px 100%;
    background-repeat: no-repeat;
    opacity: 0.9;
    z-index: 4;
}

/* Inner Decorative Frame (The Subtle Thin Line) */
.gothic-frame-inner {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border: 1px solid rgba(57, 255, 20, 0.2);
    pointer-events: none;
    z-index: 2;
}

/* Heavy Obsidian-Rock Slabs / Buttons */
.slab-button {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 25px 25px;
    /* Increased vertical padding for stacked content */
    text-decoration: none;

    /* RPG UI Typography: Serif, All Caps, Spaced */
    color: #39FF14;
    font-family: 'Kelly Slab', serif;
    font-weight: 700;
    font-size: 1.1rem;
    /* Balanced readability and alchemy style */
    letter-spacing: 2px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(57, 255, 20, 0.5);
    overflow: hidden;

    /* Dark Deep Blue/Black Background with Glass Effect */
    background: linear-gradient(180deg, rgba(10, 25, 15, 0.95) 0%, rgba(0, 5, 0, 1) 100%);
    backdrop-filter: blur(10px);

    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    border: none;
}

/* Button Hover State */
.slab-button:hover {
    background: linear-gradient(180deg, rgba(20, 45, 30, 1) 0%, rgba(5, 15, 5, 1) 100%);
    color: #fff;
    text-shadow: 0 0 15px #39FF14;
    box-shadow: inset 0 0 20px rgba(57, 255, 20, 0.2);
}

.button-wrapper:hover .gothic-frame {
    box-shadow: 0 0 15px rgba(57, 255, 20, 0.3);
}

.button-text {
    z-index: 2;
    position: relative;
    display: flex;
    flex-direction: column;
    /* Stack vertically */
    align-items: center;
    justify-content: center;
    width: 100%;
    gap: 12px;
    /* Space between icon and text */
}

.button-text i {
    position: relative;
    /* Remove absolute positioning */
    left: 0;
    /* Reset left position */
    font-size: 1.4rem;
    /* Slightly larger icon */
    color: #39FF14;
    filter: drop-shadow(0 0 5px rgba(57, 255, 20, 0.6));
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* Button Hover State */
.slab-button:hover .button-text i {
    opacity: 1;
    filter: drop-shadow(0 0 8px #39FF14);
}

/* Diagonal Metallic Glint Animation */
.glint {
    position: absolute;
    top: -50%;
    left: -100%;
    width: 50%;
    height: 200%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0) 100%);
    transform: rotate(45deg);
    z-index: 1;
    pointer-events: none;
    transition: all 0s ease;
}

.slab-button:hover .glint {
    animation: glintSweep 0.6s ease-out forwards;
}

@keyframes glintSweep {
    0% {
        left: -100%;
    }

    100% {
        left: 200%;
    }
}

/* Mobile Responsive Adjustments */
@media (max-width: 480px) {
    .brand-title {
        font-size: 2.2rem;
    }

    .sub-header {
        font-size: 0.75rem;
        letter-spacing: 2px;
    }

    .logo-wrapper {
        width: 100%;
        height: auto;
    }

    .slab-button {
        padding: 18px;
        font-size: 1rem;
    }
}

/* --- Dynamic Canvas FX --- */
#fx-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

.label-element {
    font-size: 0.6rem;
    background: #39FF14;
    color: #000;
    padding: 1px 4px;
    border-radius: 2px;
    margin-left: 5px;
    display: inline-block;
    vertical-align: middle;
    text-shadow: none;
    font-family: 'Kelly Slab', serif;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1;
}