/* 3DUX Thematic UI Core Configuration */
:root {
    --bg-dark: #0a0612;
    --nether-purple: #3a0066;
    --nether-portal: #50008c;
    --hunter-crimson: #730014;
    --stone-text: #bdaea3;
    --vampire-white: #f5f0eb;
    --end-portal-space: radial-gradient(circle at center, #110022 0%, #030008 100%);
    --gold: #ffcc00;
    --purple: #42047c;
    --violet: #8a2be2;
    --hunter-red: #ff002b;
    --human-green: #00ff41;
    --bg: #0a0a0c;
    --card-bg: #2e2002;
    --font: 'Consolas', 'Courier New', monospace;
    --transition-smooth: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* =====================================================================
   GLOBAL TYPOGRAPHY & LAYOUT
   ===================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

body {
    background: url('/assets/ancienthardware_4k.png') no-repeat top center fixed;
    background-size: cover;
    color: var(--stone-text);
    font-family: 'Cinzel', 'Georgia', serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 100vh;
    padding-top: 30px;
    cursor: default;
    user-select: none;
}

input, textarea {
    cursor: text;
    user-select: auto;
}

h1, h2, h3 {
    color: var(--vampire-white);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 0;
}

h1 { 
    font-family: 'MedievalSharp', cursive; 
    font-size: clamp(2.5rem, 9vw, 9rem);
    color: var(--gold);
    font-weight: bold;
    text-shadow: 0 0 40px rgba(255,204,0,0.6), 2px 3px 4px rgba(0,0,0,0.5);
    margin: 0;
    letter-spacing: 2px;
    white-space: nowrap;
    z-index: 1;
    position: relative;
    text-transform: uppercase;
}

/* =====================================================================
   UNIVERSAL COMPONENTS
   ===================================================================== */
.status-bar {
    width: 100vw;
    background: linear-gradient(90deg, #1a1a1a, #2a2a2a);
    border-bottom: 1px solid #333;
    padding: 6px 0;
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 72px;
    font-family: var(--font);
    font-size: clamp(0.65rem, 0.88vw, 0.8rem);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    text-transform: uppercase;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.8);
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #444;
    transition: background 0.3s ease;
}

.indicator.online {
    background: #00ff41;
    box-shadow: 0 0 10px #00ff41;
}

header {
    background: var(--end-portal-space);
    border-bottom: 3px double var(--nether-portal);
    padding: 0;
    text-align: center;
    box-shadow: 0 4px 25px rgba(80, 0, 140, 0.4);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: top;
}

.sitewide-banner {
    display: block;
    max-width: 100%;
    width: 780px; 
    height: 50%; 
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.3)); 
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.sitewide-banner:hover {
    transform: scale(1.01);
}

.header-tagline {
    color: var(--nether-portal);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
    font-style: italic;
    letter-spacing: 2px;
    margin-top: 20px;
    margin-bottom: 0;
}

/* =====================================================================
   NAVIGATION
   ===================================================================== */
.hero {
    position: relative;
    z-index: 25; 
}

.hero-nav {
    position: absolute !important;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    margin-top: 0;
}

.global-nav {
    display: flex !important;
    flex-direction: row !important; 
    justify-content: center;
    align-items: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.8);
    flex-wrap: nowrap;
    gap: 72px;
    padding: 10px 24px;
    z-index: 100;
    backdrop-filter: blur(10px);
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
}

.global-nav a {
    display: inline-block !important;
    flex: 0 0 auto !important; 
    font-family: 'Cinzel', serif;
    text-decoration: none;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-weight: bold;
    letter-spacing: 1.3px;
    border: 2px solid transparent;
    border-radius: 3px;
    transition: all 0.25s ease;
    white-space: nowrap !important; 
}

.global-nav a.nav-home { color: #00ff41 !important; }
.global-nav a.nav-home:hover {
    border-color: #00ff41 !important;
    background: rgba(0, 255, 65, 0.15) !important;
    box-shadow: inset 0 0 10px rgba(0, 255, 65, 0.25) !important;
}

/* Map specific header logic */
.map-top-bar {
    position: relative;
    display: flex;
    justify-content: center; 
    padding: 15px 0;
}

.nav-emblem {
    height: 40px; /* Scales the logo down to match the button height */
    width: auto;
    object-fit: contain;
    margin-right: 15px; /* Creates a visual buffer before the first button */
    display: block; 
    z-index: 101;
}

/* Invisibility Cloak (State-based auto-hiding) */
body.page-hub .global-nav a.nav-home,
body.page-apply .global-nav a[href="/applications/"],
body.page-creations .global-nav a[href="/creations/"],
body.page-map .global-nav a[href="/map/view/"] {
    display: none !important;
}

/* =====================================================================
   THEMES & CARDS
   ===================================================================== */
.theme-hub {
    background: rgba(15, 10, 18, 0.95);
    border-top: 1px solid var(--nether-portal);
    border-bottom: 1px solid #d4af37;
}
.theme-hub a { color: var(--vampire-white); }
.theme-hub a:hover {
    color: #d4af37;
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.12);
    box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.25);
}

.theme-hunter {
    background: rgba(18, 5, 8, 0.95);
    border-top: 1px solid #ff002b;
    border-bottom: 1px solid var(--hunter-crimson);
}
.theme-hunter a { color: #e8d5d5; }
.theme-hunter a:hover {
    color: #ff002b;
    border-color: #ff002b;
    background: rgba(255, 0, 43, 0.12);
    box-shadow: inset 0 0 10px rgba(255, 0, 43, 0.25);
}

.theme-vampire {
    background: rgba(12, 6, 22, 0.95);
    border-top: 1px solid #8a2be2;
    border-bottom: 1px solid var(--nether-purple);
}
.theme-vampire a { color: #e6d5f5; }
.theme-vampire a:hover {
    color: #8a2be2;
    border-color: #8a2be2;
    background: rgba(138, 43, 226, 0.12);
    box-shadow: inset 0 0 10px rgba(138, 43, 226, 0.25);
}

.card {
    background: rgba(18, 12, 28, 0.75);
    border: 1px solid rgba(80, 0, 140, 0.4);
    border-radius: 4px;
    padding: 25px;
    position: relative;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.6);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover {
    border-color: var(--nether-portal);
    box-shadow: 0 0 25px rgba(80, 0, 140, 0.4);
    transform: translateY(-3px);
}

.card.hunter { border-left: 4px solid var(--hunter-crimson); }
.card.vampire { border-left: 4px solid var(--nether-portal); }

.container {
    max-width: 1100px;
    margin: 150px auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.btn {
    display: inline-block;
    background: linear-gradient(135deg, var(--nether-purple) 0%, #1e0033 100%);
    color: var(--vampire-white);
    text-decoration: none;
    padding: 10px 25px;
    border: 1px solid var(--nether-portal);
    border-radius: 2px;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn:hover {
    background: var(--nether-portal);
    box-shadow: 0 0 15px var(--nether-portal);
}

/* =====================================================================
   PAGE SPECIFIC: HUB
   ===================================================================== */
body.page-hub {
    margin: 0;
    -webkit-font-smoothing: antialiased;
    background-color: var(--bg);
    color: #e0e0e0;
    font-family: var(--font);
}

body.page-hub .hero {
    width: 100vw;
    height: 36vh;
    background: linear-gradient(rgba(10,10,12,0.7), rgba(10,10,12,1)), url('/assets/standing_hero_4k.png');
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    border-bottom: 5px solid var(--gold);
    padding: 0;
}

body.page-hub .presents-tag {
    color: oklch(46.537% 0.2455 302.211);
    font-size: clamp(1.8rem, 2.0vw, 2.2rem);
    letter-spacing: 10px;
    font-weight: bolder;
    margin: 0 0 30px;
    font-family: 'Pirata One', cursive;
    text-shadow: 1px 1px 15px rgba(138,43,226,0.8);
    z-index: 1;
}

body.page-hub h1 {
    margin: auto 0 16px;
    padding-bottom: 5px;
}

body.page-hub .roster-container {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    gap: 25px;
    margin: 40px auto 60px auto;
    position: relative;
    z-index: 10;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 20px 50px;
    width: 100%;
    max-width: 1200px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

body.page-hub .roster-container::-webkit-scrollbar {
    display: none;
}

body.page-hub .skin-card {
    background: var(--card-bg);
    flex: 0 0 auto;
    width: 16vh;
    min-width: 135px;
    max-width: 180px;
    box-shadow: 1px 1px 0px #333, 4px 4px 18px rgba(0,0,0,0.9);
    border: 2px solid #555;
    padding: 12px;
    position: relative;
    overflow: hidden;
    clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.page-hub .skin-card.faction-hunter { border-color: var(--hunter-red); }
body.page-hub .skin-card.faction-hunter:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px var(--hunter-red);
    background: #3d151b;
}

body.page-hub .skin-card.faction-vampire { border-color: var(--violet); }
body.page-hub .skin-card.faction-vampire:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px var(--violet);
    background: #241138;
}

body.page-hub .skin-card.faction-human { border-color: var(--human-green); }
body.page-hub .skin-card.faction-human:hover {
    transform: translateY(-10px);
    box-shadow: 0 0 25px var(--human-green);
    background: #11381b;
}

body.page-hub .skin-card img {
    width: 100%;
    height: auto;
    max-height: 190px;
    object-fit: contain;
    filter: drop-shadow(0 5px 12px rgba(0,0,0,0.8));
    display: block;
}

body.page-hub .skin-card::after {
    content: "";
    position: absolute;
    top: 0;
    left: -120%;
    width: 20px;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.4), transparent);
    box-shadow: 0 0 25px rgba(255,255,255,0.8);
    animation: horizontal-scan 8s linear infinite;
    z-index: 5;
    pointer-events: none;
}

@keyframes horizontal-scan {
    0% { left: -120%; }
    18% { left: 120%; }
    100% { left: 120%; }
}

body.page-hub .nameplate {
    margin-top: 12px;
    padding: 4px 6px;
    background: linear-gradient(135deg, #bf953f, #fcf6ba, #b38728);
    color: #1a1a1a;
    font-family: var(--font);
    font-weight: 900;
    text-transform: uppercase;
    border: 2px solid #000;
    width: 100%;
    text-align: center;
    position: relative;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    animation: glitch-sync 8s linear infinite;
}

@keyframes glitch-sync {
    0%, 6%, 12%, 100% { transform: none; filter: none; }
    8% { transform: skewX(-10deg); filter: hue-rotate(45deg); }
    10% { transform: translateX(2px); }
}

body.page-hub .description-block {
    max-width: 950px;
    align-self: center;
    margin: 80px auto;
    background: rgba(22, 22, 26, 0.98);
    border: 1px solid #333;
    padding: 60px;
    clip-path: polygon(30px 0, 100% 0, 100% calc(100% - 30px), calc(100% - 30px) 100%, 0 100%, 0 30px);
}

body.page-hub .description-block h2 {
    color: var(--gold);
    font-family: var(--font);
    border-bottom: 2px solid var(--gold);
    padding-bottom: 10px;
}

body.page-hub .description-block h3 {
    color: var(--purple);
    font-family: var(--font);
    margin-top: 40px;
    border-left: 4px solid var(--purple);
    padding-left: 20px;
}

body.page-hub .description-block li {
    margin-bottom: 15px;
    list-style: none;
    position: relative;
    padding-left: 30px;
}

body.page-hub .description-block li::before {
    content: "»";
    position: absolute;
    left: 0;
    color: var(--gold);
    font-weight: 900;
}

body.page-hub .terminal {
    max-width: 800px;
    margin: 40px auto;
    background: #0c0c0e;
    border: 1px solid #333;
    border-top: 25px solid #1a1a1c;
    padding: 30px;
    color: #00ff41;
    font-family: var(--font);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

body.page-hub #activity-ticker {
    height: 1.1em;
    color: #4000a5de;
    margin: 15px 0;
    opacity: 1;
    transition: opacity 0.5s;
    font-weight: bold;
}

body.page-hub .terminal a {
    color: var(--gold);
    text-decoration: none;
    font-weight: bold;
}

body.page-hub .terminal a:hover {
    text-decoration: underline;
}

body.page-hub .warning-box {
    max-width: 80%;
    margin: 30px auto;
    padding: 24px;
    border-left: 7px solid #b36200;
    background-color: #382804;
    font-family: var(--font);
    color: #D69400;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    font-size: 0.85rem;
}

body.page-hub .warning-note {
    font-size: 0.9em;
    margin-bottom: 0;
    font-style: italic;
    color: #666;
}

body.page-hub .fullscreen-spin {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    object-fit: contain !important;
    transform: rotate(720deg) scale(1) !important;
    transition: all 3s ease-in-out !important;
    z-index: 9999 !important;
    background: rgba(0,0,0,0.9);
}

body.page-hub .bounce-back {
    animation: bounce-back 4s ease-out !important;
}

@keyframes bounce-back {
    0% { transform: scale(1.1) rotate(360deg) !important; }
    50% { transform: scale(0.75) rotate(360deg) !important; }
    100% { transform: scale(0.1) rotate(0deg) !important; }
}

/* =====================================================================
   PAGE SPECIFIC: CREATIONS OVERRIDE
   ===================================================================== */
body.creations-page, .creations-container {
    background-image: url('/files/api/raw/webserver/assets/standing_hero_4k.png?inline=true') !important;
    background-size: cover !important;
    background-position: center center !important;
    background-attachment: fixed !important;
    background-repeat: no-repeat !important;
    background-color: #050507 !important;
}

.creations-content, .gallery-wrapper {
    background: transparent !important;
}

/* =====================================================================
   PAGE SPECIFIC: APPLY DESKTOP STRUCTURE
   ===================================================================== */
body.page-apply main {
    background: url('/files/api/raw/webserver/assets/banner_4k.png?center=true') no-repeat center center;
    background-size: cover !important;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.page-apply .hero {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    min-height: 280px;  
    padding-top: 50px; 
    padding-bottom: 90px; 
    margin-bottom: 30px; 
}


/* =====================================================================
   MOBILE MEDIA QUERY (MAX-WIDTH 900PX)
   ===================================================================== */
@media (max-width: 900px) {
    .global-nav {
        gap: 36px;
        padding: 10px 18px;
    }
}

/* =====================================================================
   MOBILE MEDIA QUERY (MAX-WIDTH 768PX)
   ===================================================================== */
@media (max-width: 768px) {
    
    .status-bar {
        flex-wrap: nowrap !important;
        gap: 12px !important;
        padding: 10px !important;
        height: auto !important;
        justify-content: center !important;
    }

    .status-item {
        white-space: normal !important;
        text-align: center;
    }

    /* Fold specific hero elements */
    body.page-hub .hero,
    body.page-apply .hero,
    body.page-creations .hero {
        height: auto !important;
        min-height: 45vh !important;
        padding-top: 90px !important; 
        padding-bottom: 140px !important; 
        justify-content: center !important;
    }

    body.page-hub .presents-tag {
        font-size: 1.2rem !important;
        letter-spacing: 4px !important;
        margin-bottom: 10px !important;
    }

    h1 {
        white-space: normal !important;
        font-size: clamp(2rem, 10vw, 2.8rem) !important;
        line-height: 1.2 !important;
        padding: 0 10px;
        text-align: center;
        margin-bottom: 10px !important;
    }

    body.page-hub .roster-container {
        width: 100% !important;
        max-width: 100vw !important;
        padding: 15px 10px !important;
        gap: 12px !important;
        justify-content: flex-start !important; 
    }

    body.page-hub .skin-card {
        min-width: 95px !important;
        width: 26vw !important;
        max-width: 110px !important;
        padding: 8px !important;
        clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px) !important;
    }

    body.page-hub .skin-card img {
        max-height: 110px !important;
    }

    body.page-hub .nameplate {
        font-size: 0.55rem !important;
        padding: 4px 2px !important;
        margin-top: 8px !important;
        letter-spacing: 0px !important;
        border-width: 1px !important;
    }

    body.page-hub .description-block, .terminal, .warning-box, .app-container, .hunter-form {
        width: 92vw !important;
        max-width: 100% !important;
        margin: 30px auto !important;
        padding: 30px 20px !important;
        clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px) !important;
    }

    global-nav {
        flex-wrap: nowrap !important; 
        gap: 8px !important; /* Compresses the space between buttons */
        padding: 10px 5px !important;
        justify-content: center !important;
        overflow-x: auto; /* Allows smooth horizontal swiping on tiny screens */
        scrollbar-width: none; /* Hides the scrollbar in Firefox */
    }
    
    .global-nav::-webkit-scrollbar {
        display: none; 
    }
    
    .global-nav a {
        font-size: clamp(0.55rem, 2vw, 0.75rem) !important; /* Dynamically shrinks text */
        padding: 6px 8px !important; /* Trims the button bulk */
        white-space: nowrap !important; /* Forbids button text from breaking into two lines */
    }
}


/* =====================================================================
   MOBILE MEDIA QUERY (MAX-WIDTH 640PX)
   ===================================================================== */
@media (max-width: 640px) {
    .global-nav {
        gap: 18px;
        padding: 10px 14px;
        justify-content: center !important;
    }

    .global-nav a {
        font-size: 0.75rem !important;
        padding: 8px 12px !important;
        white-space: normal !important;
        text-align: center;
    }
}