/* =========================================================
   Theme Variables
========================================================= */
body.theme-kush {
    --bg-image: url("/static/gw2/images/bg-kush.webp");
    --bg-base: #0b1210;
    --overlay: rgba(4, 10, 8, 0.45);
    --glow-1: rgba(34, 197, 94, 0.10);
    --glow-2: rgba(34, 197, 94, 0.08);
    --glow-3: rgba(16, 185, 129, 0.08);
    --glow-4: rgba(22, 163, 74, 0.06);
    --accent: #22c55e;
    --accent-light: #86efac;
    --accent-lighter: #bbf7d0;
    --accent-lightest: #dcfce7;
    --accent-ultra: #ecfdf5;
    --accent-dim: rgba(34, 197, 94, 0.25);
    --accent-glow: rgba(34, 197, 94, 0.7);
    --accent-glow-strong: rgba(34, 197, 94, 0.9);
    --border: #1f7a45;
    --border-dim: #29443a;
    --box-bg: #111a17;
    --box-bg-dark: #0f1714;
    --box-bg-darker: #0b1210;
    --nav-bg-from: #0b1512;
    --nav-bg-mid: #0f2a20;
    --nav-bg-peak: #124733;
    --text-primary: #e5f3ec;
    --text-secondary: #cbd5d1;
    --text-muted: #9fb7ac;
    --text-heading: #ecfdf5;
    --btn-from: #1a8f47;
    --btn-to: #15803d;
    --btn-hover-from: #22a252;
    --btn-hover-to: #169246;
    --smoke-opacity: 0.16;
    --is-light: 0;
}

body.theme-void {
    --bg-image: url("/static/gw2/images/bg-void.webp");
    --bg-base: #0d0a1a;
    --overlay: rgba(4, 2, 12, 0.55);
    --glow-1: rgba(124, 58, 237, 0.12);
    --glow-2: rgba(109, 40, 217, 0.10);
    --glow-3: rgba(139, 92, 246, 0.08);
    --glow-4: rgba(109, 40, 217, 0.06);
    --accent: #7c3aed;
    --accent-light: #a78bfa;
    --accent-lighter: #c4b5fd;
    --accent-lightest: #ddd6fe;
    --accent-ultra: #f5f3ff;
    --accent-dim: rgba(124, 58, 237, 0.25);
    --accent-glow: rgba(124, 58, 237, 0.7);
    --accent-glow-strong: rgba(124, 58, 237, 0.9);
    --border: #5b21b6;
    --border-dim: #2e1065;
    --box-bg: #110d1f;
    --box-bg-dark: #0d0a1a;
    --box-bg-darker: #080612;
    --nav-bg-from: #0a0814;
    --nav-bg-mid: #150d2e;
    --nav-bg-peak: #1e1042;
    --text-primary: #ede9fe;
    --text-secondary: #c4b5fd;
    --text-muted: #a78bfa;
    --text-heading: #f5f3ff;
    --btn-from: #6d28d9;
    --btn-to: #5b21b6;
    --btn-hover-from: #7c3aed;
    --btn-hover-to: #6d28d9;
    --smoke-opacity: 0.12;
    --is-light: 0;
}

body.theme-ember {
    --bg-image: url("/static/gw2/images/bg-ember.webp");
    --bg-base: #1a0a08;
    --overlay: rgba(12, 4, 2, 0.55);
    --glow-1: rgba(220, 38, 38, 0.12);
    --glow-2: rgba(194, 65, 12, 0.10);
    --glow-3: rgba(234, 88, 12, 0.08);
    --glow-4: rgba(220, 38, 38, 0.06);
    --accent: #ea580c;
    --accent-light: #fb923c;
    --accent-lighter: #fdba74;
    --accent-lightest: #fed7aa;
    --accent-ultra: #fff7ed;
    --accent-dim: rgba(234, 88, 12, 0.25);
    --accent-glow: rgba(234, 88, 12, 0.7);
    --accent-glow-strong: rgba(234, 88, 12, 0.9);
    --border: #c2410c;
    --border-dim: #431407;
    --box-bg: #1a1008;
    --box-bg-dark: #150c06;
    --box-bg-darker: #0f0804;
    --nav-bg-from: #120800;
    --nav-bg-mid: #2a1200;
    --nav-bg-peak: #3d1a00;
    --text-primary: #fff7ed;
    --text-secondary: #fed7aa;
    --text-muted: #fdba74;
    --text-heading: #fff7ed;
    --btn-from: #c2410c;
    --btn-to: #9a3412;
    --btn-hover-from: #ea580c;
    --btn-hover-to: #c2410c;
    --smoke-opacity: 0.14;
    --is-light: 0;
}

body.theme-ocean {
    --bg-image: url("/static/gw2/images/bg-ocean.webp");
    --bg-base: #080f1a;
    --overlay: rgba(2, 6, 14, 0.55);
    --glow-1: rgba(14, 116, 144, 0.12);
    --glow-2: rgba(3, 105, 161, 0.10);
    --glow-3: rgba(2, 132, 199, 0.08);
    --glow-4: rgba(14, 116, 144, 0.06);
    --accent: #0ea5e9;
    --accent-light: #38bdf8;
    --accent-lighter: #7dd3fc;
    --accent-lightest: #bae6fd;
    --accent-ultra: #f0f9ff;
    --accent-dim: rgba(14, 165, 233, 0.25);
    --accent-glow: rgba(14, 165, 233, 0.7);
    --accent-glow-strong: rgba(14, 165, 233, 0.9);
    --border: #0369a1;
    --border-dim: #082f49;
    --box-bg: #081828;
    --box-bg-dark: #061220;
    --box-bg-darker: #040c18;
    --nav-bg-from: #040c18;
    --nav-bg-mid: #082040;
    --nav-bg-peak: #0c3060;
    --text-primary: #e0f2fe;
    --text-secondary: #bae6fd;
    --text-muted: #7dd3fc;
    --text-heading: #f0f9ff;
    --btn-from: #0369a1;
    --btn-to: #075985;
    --btn-hover-from: #0ea5e9;
    --btn-hover-to: #0369a1;
    --smoke-opacity: 0.10;
    --is-light: 0;
}

body.theme-dawn {
    --bg-image: url("/static/gw2/images/bg-dawn.webp");
    --bg-base: #1a1408;
    --overlay: rgba(8, 6, 2, 0.35);
    --glow-1: rgba(251, 191, 36, 0.10);
    --glow-2: rgba(245, 158, 11, 0.08);
    --glow-3: rgba(217, 119, 6, 0.06);
    --glow-4: rgba(251, 191, 36, 0.05);
    --accent: #d97706;
    --accent-light: #fbbf24;
    --accent-lighter: #fde68a;
    --accent-lightest: #fef3c7;
    --accent-ultra: #fffbeb;
    --accent-dim: rgba(217, 119, 6, 0.25);
    --accent-glow: rgba(217, 119, 6, 0.7);
    --accent-glow-strong: rgba(217, 119, 6, 0.9);
    --border: #b45309;
    --border-dim: #451a03;
    --box-bg: #1c160a;
    --box-bg-dark: #161008;
    --box-bg-darker: #100c04;
    --nav-bg-from: #100c04;
    --nav-bg-mid: #241808;
    --nav-bg-peak: #342208;
    --text-primary: #fef3c7;
    --text-secondary: #fde68a;
    --text-muted: #fbbf24;
    --text-heading: #fffbeb;
    --btn-from: #b45309;
    --btn-to: #92400e;
    --btn-hover-from: #d97706;
    --btn-hover-to: #b45309;
    --smoke-opacity: 0.08;
    --is-light: 0;
}
/* =========================================================
   Base / Layout
========================================================= */

html {
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 20px;
    background:
        var(--bg-image) no-repeat center center fixed,
        var(--bg-base);
    background-size: cover;
    color: var(--text-primary);
    box-sizing: border-box;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(var(--overlay), var(--overlay)),
        radial-gradient(circle at 15% 25%, var(--glow-1), transparent 45%),
        radial-gradient(circle at 85% 20%, var(--glow-2), transparent 50%),
        radial-gradient(circle at 60% 75%, var(--glow-3), transparent 50%),
        radial-gradient(circle at 40% 55%, var(--glow-4), transparent 60%);
    filter: blur(28px);
    opacity: 0.9;
    z-index: -1;
    pointer-events: none;
}

#smoke-layer {
    position: fixed;
    inset: 0;
    background: url("/static/gw2/images/kush-smoke.png") repeat;
    opacity: var(--smoke-opacity);
    pointer-events: none;
    z-index: 0;
    animation: smoke-drift 45s ease-in-out infinite;
}

@keyframes smoke-drift {
    0% { transform: translate3d(0, 0, 0) scale(1.02); }
    50% { transform: translate3d(-30px, -18px, 0) scale(1.05); }
    100% { transform: translate3d(0, 0, 0) scale(1.02); }
}

body > *:not(#smoke-layer):not(.nav-sidebar-wrap) {
    position: relative;
    z-index: 1;
}

.nav-sidebar-wrap {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: none;
}

*,
*::before,
*::after {
    box-sizing: inherit;
}

.page-container {
    max-width: 1200px;
    margin: 0 auto;
}

.page-shell {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    margin: 0 0 0.5rem;
}

.page-subtitle {
    opacity: 0.9;
    max-width: 800px;
}


/* =========================================================
   Typography
========================================================= */

h1, h2, h3 {
    margin-top: 0;
    color: var(--text-heading);
    letter-spacing: 0.3px;
}

h1 {
    font-size: 32px;
    margin-bottom: 10px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

h2 {
    font-size: 22px;
    margin-bottom: 12px;
}

h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

p {
    color: var(--text-secondary);
    line-height: 1.55;
}


/* =========================================================
   Shared UI Blocks
========================================================= */

.section-header {
    position: relative;
    background: linear-gradient(
        90deg,
        var(--nav-bg-from) 0%,
        var(--nav-bg-mid) 25%,
        var(--nav-bg-peak) 50%,
        var(--nav-bg-mid) 75%,
        var(--nav-bg-from) 100%
    );
    color: var(--text-heading);
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 20px;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
    border: 1px solid var(--border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.6),
        0 4px 10px rgba(0, 0, 0, 0.4);
}

.box {
    background: var(--box-bg);
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    max-width: 1100px;
    border: 1px solid var(--border-dim);
}

@media (max-width: 700px) {
    .box {
        padding: 14px;
    }
}

.empty-state {
    padding: 2rem;
    border: 1px solid rgba(190, 160, 90, 0.18);
    border-radius: 16px;
    background: rgba(20, 20, 24, 0.72);
}


/* =========================================================
   Navigation
========================================================= */

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 24px;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--border);
    background: linear-gradient(
        90deg,
        var(--nav-bg-from),
        var(--nav-bg-mid),
        var(--nav-bg-peak),
        var(--nav-bg-mid),
        var(--nav-bg-from)
    );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        inset 0 -1px 0 rgba(0, 0, 0, 0.6),
        0 6px 14px rgba(0, 0, 0, 0.45);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-left,
.nav-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.nav a {
    display: inline-flex;
    align-items: center;
    color: var(--accent-light);
    text-decoration: none;
    padding: 6px 8px;
    font-size: 1.30rem;
    line-height: 1;
    background: none;
    border: none;
    transition:
        color 0.15s ease,
        transform 0.1s ease,
        filter 0.2s ease;
    filter: drop-shadow(0 0 3px var(--accent-dim));
}

.nav a:hover {
    color: var(--accent-lightest);
    transform: translateY(-1px);
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.nav a.active {
    color: #ffffff;
    filter: drop-shadow(0 0 10px var(--accent-glow-strong));
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    background: none !important;
    border: none !important;
    padding: 0 !important;
}

.nav-logo img {
    height: 36px;
    width: auto;
    display: block;
    background: none;
    border: none;
    padding: 0;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.nav-logo:hover img {
    filter: drop-shadow(0 0 10px var(--accent-glow-strong));
    transform: scale(1.05);
}

.nav-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-icon-img {
    height: 22px;
    width: 22px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 4px var(--accent-dim));
}

.profile-name {
    display: inline-block;
    opacity: 0.9;
}


/* =========================================================
   Full Width Banner
========================================================= */

.site-banner {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-bottom: 18px;
    padding: 18px 0;
    background: linear-gradient(
        90deg,
        rgba(0,0,0,0.6),
        rgba(0,0,0,0.4),
        rgba(0,0,0,0.6)
    );
    border-bottom: 1px solid var(--border-dim);
}

.site-banner-inner {
    width: 100%;
    max-width: 1100px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    padding: 0 16px;
}

.site-banner-logo {
    height: clamp(48px, 6vw, 72px);
    width: auto;
    filter: drop-shadow(0 0 12px var(--accent-glow));
}

.site-banner-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.site-banner-title {
    font-size: clamp(1.5rem, 2.8vw, 2.2rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-heading);
    line-height: 1;
    text-shadow:
        0 0 6px var(--accent-dim),
        0 0 14px var(--accent-dim),
        0 1px 0 rgba(255, 255, 255, 0.08);
}

.site-banner-tagline {
    font-size: clamp(0.72rem, 1.15vw, 0.95rem);
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent-lighter);
    opacity: 0.82;
    line-height: 1.2;
}

.site-banner-home-link {
    display: inline-block;
    text-decoration: none;
    color: inherit;
}


/* =========================================================
   Buttons / Controls
========================================================= */

button,
.landing-login-btn,
.portal-button,
.filter-btn,
.leaflet-view-btn {
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 0 var(--accent-dim),
        0 3px 8px rgba(0, 0, 0, 0.35);
    transition:
        background 0.15s ease,
        transform 0.1s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

button {
    background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
    border: 1px solid var(--border);
    padding: 10px 16px;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.2px;
}

button:hover {
    background: linear-gradient(180deg, var(--btn-hover-from), var(--btn-hover-to));
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 14px var(--accent-dim),
        0 5px 12px rgba(0, 0, 0, 0.4);
    filter: brightness(1.03);
}

button:active {
    transform: translateY(0);
}

.btn-danger {
    background: linear-gradient(180deg, #c62828, #b91c1c);
    color: white;
    border: 1px solid #991b1b;
}

.btn-danger:hover {
    background: linear-gradient(180deg, #dc2626, #c21f1f);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 14px rgba(220, 38, 38, 0.22),
        0 5px 12px rgba(0, 0, 0, 0.4);
    filter: brightness(1.03);
}

.filter-btn,
.leaflet-view-btn,
.portal-button,
.landing-login-btn {
    background: var(--box-bg-dark);
    color: var(--accent-lighter);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
}

.filter-btn:hover,
.leaflet-view-btn:hover,
.portal-button:hover,
.landing-login-btn:hover {
    background: var(--box-bg);
    transform: translateY(-1px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 0 14px var(--accent-dim),
        0 4px 10px rgba(0, 0, 0, 0.35);
    filter: brightness(1.03);
}

.filter-btn.active {
    background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
    color: white;
    border-color: var(--border);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 0 12px var(--accent-dim),
        0 3px 8px rgba(0, 0, 0, 0.35);
}

.copy-build-url-btn {
    padding: 6px 10px;
    font-size: 13px;
    border-radius: 6px;
}

.portal-button--secondary {
    background: rgba(255, 255, 255, 0.06);
}


/* =========================================================
   Forms
========================================================= */

.build-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-row label {
    font-weight: 600;
}

.form-row input,
.form-row select,
.form-row textarea {
    padding: 6px;
    border-radius: 6px;
    border: 1px solid var(--border-dim);
    background: var(--box-bg-darker);
    color: var(--text-primary);
}


/* =========================================================
   Landing Page
========================================================= */

.landing-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 70vh;
    gap: 18px;
}

.landing-logo {
    width: 260px;
    max-width: 70%;
    filter: drop-shadow(0 0 18px var(--accent-glow));
}

.landing-title {
    font-size: 34px;
    margin: 0;
    letter-spacing: 1px;
}

.landing-subtitle {
    opacity: 0.85;
    margin-bottom: 10px;
}

.landing-login-btn {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--btn-from), var(--btn-to));
    border: 1px solid var(--border);
    color: white;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 4px 10px rgba(0, 0, 0, 0.4);
}

.landing-login-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.06),
        0 6px 14px rgba(0, 0, 0, 0.5);
}


/* =========================================================
   Home Page
========================================================= */

.home-builds-compact {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.home-build-profession-card {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    padding: 0;
    overflow: hidden;
}

.home-build-profession-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    padding: 12px 14px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.home-build-profession-header::-webkit-details-marker {
    display: none;
}

.home-build-profession-header::after {
    content: "▸";
    margin-left: auto;
    color: var(--accent-lighter);
    transition: transform 0.2s ease;
    font-size: 1rem;
}

.home-build-profession-card[open] .home-build-profession-header::after {
    transform: rotate(90deg);
}

.home-build-profession-card[open] .home-build-profession-header {
    border-bottom: 1px solid var(--border-dim);
}

.home-build-profession-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.home-build-profession-icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    display: block;
}

.home-build-profession-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-heading);
}

.home-build-rows {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px 14px;
}

.home-build-row {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 10px;
    align-items: start;
}

.home-build-row-label {
    font-weight: 700;
    color: var(--accent-lighter);
    padding-top: 4px;
}

.home-build-row-content {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.home-build-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-heading);
    text-decoration: none;
}

.home-build-link:hover {
    color: #ffffff;
    filter: drop-shadow(0 0 6px var(--accent-dim));
}

.home-build-elite-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}

.home-build-empty {
    opacity: 0.65;
}


/* =========================================================
   Rules Page
========================================================= */

.rules-page-wrap {
    position: relative;
    z-index: 0;
}

.rules-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 28px 20px 44px;
}

.rules-image-shell {
    position: relative;
    width: min(100%, 620px);
    animation: rules-float 7s ease-in-out infinite;
    transition: transform 0.35s ease;
}

.rules-image-shell::before {
    content: "";
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    background:
        radial-gradient(circle at center,
            rgba(220, 255, 180, 0.45) 0%,
            rgba(140, 255, 120, 0.32) 18%,
            rgba(80, 220, 120, 0.22) 35%,
            rgba(34, 197, 94, 0.16) 55%,
            rgba(34, 197, 94, 0.00) 78%
        );
    filter: blur(42px);
    opacity: 1;
    pointer-events: none;
    z-index: 0;
    animation: rules-aura-strong 5.5s ease-in-out infinite alternate;
}

.rules-image-shell::after {
    content: "";
    position: absolute;
    inset: -10px;
    border-radius: 18px;
    border: 1px solid rgba(180, 255, 170, 0.18);
    box-shadow:
        0 0 18px rgba(160, 255, 150, 0.18),
        0 0 42px rgba(90, 220, 120, 0.12);
    opacity: 0.7;
    pointer-events: none;
    z-index: 1;
}

.rules-image {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: auto;
    opacity: 0.9;
    filter: saturate(0.97) brightness(0.97) contrast(1.03);
    box-shadow:
        0 0 24px rgba(34, 197, 94, 0.16),
        0 0 64px rgba(34, 197, 94, 0.12);
    -webkit-mask-image: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 1) 68%,
        rgba(0, 0, 0, 0.92) 78%,
        rgba(0, 0, 0, 0.45) 88%,
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: radial-gradient(
        circle at center,
        rgba(0, 0, 0, 1) 68%,
        rgba(0, 0, 0, 0.92) 78%,
        rgba(0, 0, 0, 0.45) 88%,
        rgba(0, 0, 0, 0) 100%
    );
    transition:
        transform 0.35s ease,
        filter 0.35s ease,
        opacity 0.35s ease,
        box-shadow 0.35s ease;
}

.rules-image-shell:hover {
    transform: translateY(-3px) scale(1.01);
}

.rules-image-shell:hover .rules-image {
    opacity: 0.96;
    filter: saturate(1.05) brightness(1.03) contrast(1.06);
    box-shadow:
        0 0 40px rgba(140, 255, 140, 0.35),
        0 0 120px rgba(140, 255, 140, 0.22);
}

@keyframes rules-float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
    100% { transform: translateY(0px); }
}

@keyframes rules-aura-strong {
    from {
        opacity: 0.85;
        transform: scale(0.96);
        filter: blur(36px);
    }
    to {
        opacity: 1;
        transform: scale(1.08);
        filter: blur(48px);
    }
}

@media (max-width: 768px) {
    .rules-page { padding: 18px 10px 28px; }
    .rules-image-shell { width: 100%; animation-duration: 8s; }
    .rules-image-shell::before { inset: -14px; filter: blur(18px); }
    .rules-image-shell::after { inset: -6px; border-radius: 12px; }
    .rules-image {
        opacity: 0.94;
        -webkit-mask-image: radial-gradient(
            circle at center,
            rgba(0, 0, 0, 1) 74%,
            rgba(0, 0, 0, 0.94) 84%,
            rgba(0, 0, 0, 0.50) 92%,
            rgba(0, 0, 0, 0) 100%
        );
        mask-image: radial-gradient(
            circle at center,
            rgba(0, 0, 0, 1) 74%,
            rgba(0, 0, 0, 0.94) 84%,
            rgba(0, 0, 0, 0.50) 92%,
            rgba(0, 0, 0, 0) 100%
        );
    }
}

@media (prefers-reduced-motion: reduce) {
    .rules-image-shell,
    .rules-image-shell::before { animation: none; }
    .rules-image,
    .rules-image-shell { transition: none; }
}


/* =========================================================
   Official Builds / Build Cards
========================================================= */

.build-type-filters {
    display: flex;
    gap: 10px;
    margin: 16px 0;
    flex-wrap: wrap;
}

.build-card-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

@media (max-width: 900px) {
    .build-card-grid { grid-template-columns: 1fr; }
}

.build-card {
    background: var(--box-bg-dark);
    border: 1px solid var(--border-dim);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.build-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.build-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: var(--text-heading);
}

.build-card-meta {
    margin: 4px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
}

.build-card-section strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.build-card-section p {
    margin: 0;
    color: var(--text-heading);
    word-break: break-word;
}

.build-card-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: auto;
}

.build-card-title {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.build-card-title-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.build-title-row,
.build-title-row--top {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.build-title-row--top {
    align-items: flex-start;
}

.build-title-row--top .elite-spec-icon { margin-top: 2px; }
.build-title-row--top .build-name-link,
.build-title-row--top h3 { line-height: 1.25; margin: 0; }

.build-name-link {
    color: var(--accent-lighter);
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
}

.build-name-link:hover {
    color: var(--accent-lightest);
    text-decoration: underline;
}

.build-details {
    margin-top: 10px;
}

.build-details summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--accent-lighter);
    margin-bottom: 8px;
}

.build-details[open] summary {
    color: var(--accent-lightest);
}

.build-details .build-card-section { margin-top: 10px; }

.build-code {
    display: block;
    background: var(--box-bg-darker);
    border: 1px solid var(--border-dim);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--accent-lighter);
    font-family: Consolas, Monaco, monospace;
    font-size: 13px;
    word-break: break-all;
}

.build-notes {
    line-height: 1.5;
    white-space: pre-wrap;
}

.no-builds-message {
    margin: 0 0 16px 0;
    padding: 12px 14px;
    background: var(--box-bg-dark);
    border: 1px solid var(--border-dim);
    border-radius: 10px;
    color: var(--text-secondary);
}

.build-status {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.build-status.active {
    background: rgba(16, 185, 129, 0.18);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.35);
}

.build-status.inactive {
    background: rgba(239, 68, 68, 0.18);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.assign-build-form { margin-top: 14px; }

.assign-build-form label {
    display: block;
    margin-bottom: 6px;
    color: var(--text-secondary);
    font-size: 14px;
}

.assign-build-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.assign-build-row select {
    min-width: 220px;
    background: var(--box-bg-dark);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 9px 12px;
}


/* =========================================================
   Profession / Spec Icons
========================================================= */

.profession-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.elite-spec-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.profession-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
}

.profession-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.profession-btn img {
    border-radius: 10px;
    padding: 6px;
    background: var(--box-bg-dark);
    border: 1px solid var(--border);
    transition: transform 0.15s ease, box-shadow 0.15s ease, outline 0.15s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.profession-btn img:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.4);
}

.profession-btn.active img {
    outline: 2px solid var(--border);
    box-shadow: none;
}


/* =========================================================
   Tables / Roster
========================================================= */

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    text-align: left;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-dim);
    vertical-align: top;
}

td img { vertical-align: middle; }

.roster-table {
    width: 100%;
    table-layout: auto;
}

.roster-table th,
.roster-table td {
    padding: 6px 10px;
    white-space: nowrap;
    width: 1%;
}

.roster-table th:last-child,
.roster-table td:last-child {
    white-space: normal;
    width: auto;
}


/* =========================================================
   Tooltips / Character Grid
========================================================= */

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-content {
    display: none;
    position: fixed;
    background: var(--box-bg-dark);
    color: var(--text-heading);
    padding: 10px 12px;
    border: 1px solid var(--border-dim);
    border-radius: 6px;
    white-space: nowrap;
    font-size: 13px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    z-index: 9999;
}

.tooltip:hover .tooltip-content { display: block; }

.tooltip-content strong {
    display: block;
    margin-bottom: 4px;
}

.tooltip-content .warning { color: #facc15; }

.character-icon-grid {
    display: grid;
    grid-template-columns: repeat(10, 32px);
    gap: 10px;
    align-items: start;
}

@media (max-width: 1200px) { .character-icon-grid { grid-template-columns: repeat(8, 32px); } }
@media (max-width: 900px) { .character-icon-grid { grid-template-columns: repeat(6, 32px); } }
@media (max-width: 700px) { .character-icon-grid { grid-template-columns: repeat(4, 32px); } }
@media (max-width: 500px) { .character-icon-grid { grid-template-columns: repeat(3, 32px); } }


/* =========================================================
   Leaflets
========================================================= */

.leaflet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.leaflet-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(20, 20, 24, 0.88);
    border: 1px solid var(--border-dim);
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.leaflet-card:hover {
    transform: translateY(-2px);
    border-color: var(--border);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.leaflet-card__body { padding: 1rem 1rem 1.1rem; }

.leaflet-card__meta,
.leaflet-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.leaflet-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    background: var(--accent-dim);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
}

.leaflet-date {
    font-size: 0.92rem;
    opacity: 0.8;
}

.leaflet-card__title {
    margin: 0 0 0.65rem;
    font-size: 1.2rem;
}

.leaflet-card__summary {
    margin: 0 0 1rem;
    line-height: 1.5;
    opacity: 0.9;
}

.leaflet-card__link {
    font-weight: 600;
    opacity: 0.95;
}

.back-link {
    display: inline-block;
    margin-bottom: 0.75rem;
    text-decoration: none;
}

.leaflet-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.leaflet-viewer-shell {
    border: 1px solid var(--border-dim);
    border-radius: 18px;
    overflow: hidden;
    background: rgba(10, 10, 12, 0.82);
    min-height: 75vh;
}

.leaflet-viewer {
    width: 100%;
    height: 80vh;
    border: 0;
    display: block;
}

.leaflet-pages {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.leaflet-page-shell { position: relative; }

.leaflet-floating-sidebar {
    position: fixed;
    left: 24px;
    top: 220px;
    width: 240px;
    z-index: 50;
}

.leaflet-reader-wrap { width: 100%; }
.leaflet-archive-actions { margin: 0 0 14px; }

@media (max-width: 1450px) {
    .leaflet-floating-sidebar {
        position: static;
        width: auto;
        margin-bottom: 20px;
    }
}

.leaflet-archive-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.leaflet-archive-item {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--box-bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    transition: background 0.15s ease, transform 0.1s ease, box-shadow 0.15s ease;
}

.leaflet-archive-item:hover {
    background: var(--box-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
}

.leaflet-archive-label {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.leaflet-archive-date {
    font-size: 13px;
    color: var(--text-muted);
}

.leaflet-view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.leaflet-view-btn.hidden { display: none; }
.leaflet-latest-shell { padding: 10px 0 0; }
.leaflet-page-view { text-align: center; }

.leaflet-page-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

#leaflet-page-counter {
    font-weight: 600;
    color: var(--text-primary);
}

.leaflet-page-frame-shell {
    display: flex;
    justify-content: center;
    padding-top: 10px;
}

.leaflet-page-frame {
    position: relative;
    width: min(100%, 900px);
    padding: 20px 20px 16px;
    background: none;
    border: none;
    box-shadow: none;
}

.leaflet-page-frame::before {
    content: "";
    position: absolute;
    inset: -40px;
    background:
        radial-gradient(circle at center,
            rgba(180, 255, 140, 0.28) 0%,
            rgba(60, 220, 120, 0.20) 30%,
            rgba(34, 197, 94, 0.12) 55%,
            rgba(34, 197, 94, 0.00) 80%);
    filter: blur(36px);
    z-index: 0;
    pointer-events: none;
}

.leaflet-page-frame::after {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: 16px;
    box-shadow:
        0 0 20px rgba(120, 255, 140, 0.18),
        0 0 60px rgba(80, 220, 120, 0.12);
    z-index: 1;
    pointer-events: none;
}

.leaflet-single-page-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 0;
}

.leaflet-page-image {
    max-width: 700px !important;
    width: 100% !important;
    display: block !important;
    border-radius: 8px !important;
    transform: none !important;
    box-shadow: none !important;
}

.leaflet-page-image:hover {
    transform: none !important;
    box-shadow: none !important;
}

.leaflet-page-image--framed {
    position: relative;
    z-index: 2;
    max-width: min(100%, 780px) !important;
    max-height: calc(100vh - 240px);
    width: auto !important;
    height: auto !important;
    object-fit: contain;
    border-radius: 6px !important;
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.45),
        0 0 25px rgba(80, 220, 120, 0.10) !important;
    background: transparent;
}

@media (max-width: 900px) {
    .leaflet-page-frame { width: 100%; padding: 8px 8px 6px; }
    .leaflet-page-frame::before { inset: -20px; filter: blur(24px); }
    .leaflet-page-frame::after { inset: -4px; border-radius: 10px; }
    .leaflet-page-image--framed { max-width: 100% !important; max-height: calc(100vh - 220px); }
}

@media (max-width: 768px) {
    .leaflet-page-shell { display: block; }
    .leaflet-page-controls { gap: 10px; }
    .leaflet-page-image { max-width: 100% !important; }
    .leaflet-page-image--framed { max-height: calc(100vh - 210px); }
}


/* =========================================================
   Guild Badges
========================================================= */

.guild-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.5px;
    cursor: default;
}

.guild-badge--kush {
    background: linear-gradient(180deg, #1a8f47, #15803d);
    color: #ffffff;
    border: 1px solid #1f7a45;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.guild-badge--towl {
    background: linear-gradient(180deg, #9f1239, #881337);
    color: #ffffff;
    border: 1px solid #be123c;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.guild-badge--wvw {
    box-shadow:
        0 0 8px rgba(250, 204, 21, 0.8),
        0 0 16px rgba(250, 204, 21, 0.4),
        0 2px 6px rgba(0, 0, 0, 0.4);
    border-color: #facc15;
}

.guild-badge--unknown {
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
    border: 1px solid #374151;
    font-size: 10px;
    width: auto;
    padding: 0 6px;
}

/* =========================================================
   Mobile Sidebar Navigation
========================================================= */

.nav-hamburger {
    display: none;
}

.nav-sidebar-wrap {
    display: none;
}

.nav-sidebar {
    display: none;
}

@media (max-width: 768px) {
    .nav {
        display: none;
    }

    .nav-hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        padding: 0;
        background: var(--box-bg);
        border: 1px solid var(--border);
        border-radius: 6px;
        cursor: pointer;
        box-shadow: none;
        position: relative;
        left: auto;
        top: auto;
        z-index: 3000;
        flex-shrink: 0;
    }

    .nav-hamburger:hover {
        background: var(--box-bg-dark);
        transform: none;
        box-shadow: none;
        filter: none;
    }

    .nav-hamburger span {
        display: block;
        width: 18px;
        height: 2px;
        background: var(--accent-light);
        border-radius: 2px;
        transition: transform 0.2s ease, opacity 0.2s ease;
    }

    .nav-hamburger.is-open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .nav-hamburger.is-open span:nth-child(2) {
        opacity: 0;
    }

    .nav-hamburger.is-open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .nav-sidebar-wrap {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 2000;
        pointer-events: none;
        visibility: hidden;
    }

    .nav-sidebar-wrap.is-open {
        pointer-events: all;
        visibility: visible;
    }

    .nav-overlay {
        position: absolute;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.25s ease;
    }

    .nav-sidebar-wrap.is-open .nav-overlay {
        opacity: 1;
    }

    .nav-sidebar {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100%;
        background: linear-gradient(
            180deg,
            var(--nav-bg-from),
            var(--nav-bg-mid),
            var(--nav-bg-peak)
        );
        border-right: 1px solid var(--border);
        padding: 70px 0 20px;
        overflow-y: auto;
        transition: left 0.25s ease;
        z-index: 2500;
    }

    .nav-sidebar-wrap.is-open .nav-sidebar {
        left: 0;
    }

    .nav-sidebar a {
        display: block;
        padding: 14px 20px;
        color: var(--accent-light);
        text-decoration: none;
        font-size: 1.1rem;
        border-bottom: 1px solid var(--border-dim);
        transition: background 0.15s ease, color 0.15s ease;
    }

    .nav-sidebar a:hover {
        background: rgba(255, 255, 255, 0.05);
        color: var(--accent-lightest);
    }

    .nav-sidebar a.active {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.06);
    }

    .nav-sidebar .nav-profile {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .nav-sidebar-logout {
        margin-top: auto;
        border-top: 1px solid var(--border-dim);
        padding-top: 8px;
    }

    .site-banner {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 14px;
        justify-content: flex-start;
        position: relative;
    }

    .site-banner-home-link {
        flex: 1;
        display: flex;
        justify-content: center;
    }

    .site-banner-logo {
        height: clamp(32px, 5vw, 48px);
    }

    .site-banner-title {
        font-size: 1.2rem;
    }

    .site-banner-tagline {
        display: none;
    }
}

/* =========================================================
   Background Themes — variables only, all handled above
========================================================= */

/* Theme variables are defined at the top of this file.
   No additional overrides needed here. */