:root {
    --rose: #766be1;
    --rose-light: #9f88ff;
    --accent: #cd45ff;
    --panel: #171922;
    --line: rgba(255, 255, 255, 0.18);
    --bg-radial-one: rgba(118, 107, 225, 0.25);
    --bg-radial-two: rgba(205, 69, 255, 0.2);
    --bg-grad-start: #0c0d11;
    --bg-grad-mid: #10131b;
    --bg-grad-end: #0c0e14;
    --header-grad-start: #000000;
    --header-grad-end: #111216;
    --header-border: rgba(255, 255, 255, 0.1);
    --header-link: #f0f0f0;
    --header-link-hover-bg: rgba(255, 255, 255, 0.09);
    --header-link-hover: #ffffff;
    --brand-sub-color: rgba(255, 255, 255, 0.7);
    --chip-border: rgba(255, 255, 255, 0.15);
    --chip-bg: rgba(255, 255, 255, 0.04);
    --chip-color: rgba(255, 255, 255, 0.8);
    --hero-overlay-top: rgba(0, 0, 0, 0.15);
    --hero-overlay-bottom: rgba(0, 0, 0, 0.7);
    --hero-text: #ffffff;
    --hero-copy-color: rgba(255, 255, 255, 0.93);
    --hero-kicker-border: rgba(255, 255, 255, 0.35);
    --emblem-border: rgba(255, 255, 255, 0.28);
    --ghost-border: rgba(255, 255, 255, 0.18);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.82);
}

body.light-mode {
    --panel: #ffffff;
    --line: rgba(0, 0, 0, 0.18);
    --bg-radial-one: rgba(118, 107, 225, 0.26);
    --bg-radial-two: rgba(205, 69, 255, 0.22);
    --bg-grad-start: #f3f1ff;
    --bg-grad-mid: #e8e5ff;
    --bg-grad-end: #f5f2ff;
    --header-grad-start: #f7f5ff;
    --header-grad-end: #e7e3ff;
    --header-border: rgba(0, 0, 0, 0.1);
    --header-link: #1f1f2b;
    --header-link-hover-bg: rgba(118, 107, 225, 0.15);
    --header-link-hover: #0f1030;
    --brand-sub-color: rgba(0, 0, 0, 0.64);
    --chip-border: rgba(0, 0, 0, 0.14);
    --chip-bg: rgba(0, 0, 0, 0.03);
    --chip-color: rgba(0, 0, 0, 0.74);
    --hero-overlay-top: rgba(0, 0, 0, 0.18);
    --hero-overlay-bottom: rgba(0, 0, 0, 0.62);
    --hero-text: #ffffff;
    --hero-copy-color: rgba(255, 255, 255, 0.93);
    --hero-kicker-border: rgba(255, 255, 255, 0.45);
    --emblem-border: rgba(0, 0, 0, 0.2);
    --ghost-border: rgba(0, 0, 0, 0.22);
    --text-primary: #12131b;
    --text-secondary: rgba(18, 19, 27, 0.82);
}

body {
    margin: 0;
    font-family: "Fira Sans", "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 10% -5%, var(--bg-radial-one), transparent 40%),
        radial-gradient(circle at 100% 10%, var(--bg-radial-two), transparent 30%),
        linear-gradient(180deg, var(--bg-grad-start) 0%, var(--bg-grad-mid) 40%, var(--bg-grad-end) 100%);
    padding-top: 126px;
    color: var(--text-primary);
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 950;
    background: linear-gradient(180deg, var(--header-grad-start), var(--header-grad-end));
    border-bottom: 1px solid var(--header-border);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.38);
}

.header-inner {
    max-width: 1260px;
    margin: 0 auto;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 8px;
    font-size: 1.15rem;
    line-height: 1;
}

.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
}

.header-nav a {
    text-decoration: none;
    font-size: 0.88rem;
    color: var(--header-link);
    padding: 8px 10px;
    border-radius: 8px;
    transition: background-color 0.18s ease, color 0.18s ease;
}

.header-nav a:hover {
    background-color: var(--header-link-hover-bg);
    color: var(--header-link-hover);
}

.brand-logo {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.15), 0 6px 18px rgba(118, 107, 225, 0.4);
    flex: 0 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
}

.site-theme-toggle {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1000;
    min-height: auto;
    width: auto;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(5px);
}

.page-shell {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    gap: 28px;
    padding-bottom: 28px;
}

.hero-cover {
    position: relative;
    border-radius: 13px;
    overflow: hidden;
    border: 1px solid var(--line);
    min-height: 450px;
    box-shadow: 0 26px 60px rgba(0, 0, 0, 0.4);
}

.hero-cover img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, var(--hero-overlay-top), var(--hero-overlay-bottom));
}

.hero-content {
    position: relative;
    z-index: 2;
    color: var(--hero-text);
    min-height: 450px;
    display: grid;
    align-content: end;
    padding: clamp(20px, 4vw, 46px);
    gap: 14px;
}

.hero-kicker {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 7px 11px;
    border: 1px solid var(--hero-kicker-border);
    border-radius: 999px;
    font-size: 0.73rem;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 700;
}

.hero-title,
.section-title,
.tools-panel h3,
.hall-card h3 {
    font-family: "Cinzel", serif;
}

.hero-title {
    margin: 0;
    font-size: clamp(2rem, 6vw, 4rem);
    line-height: 1.04;
}

.hero-copy,
.about-copy,
.event-content p,
.guild-card p,
.tools-panel p,
.footer-note {
    color: var(--text-secondary);
}

.hero-copy {
    margin: 0;
    max-width: 62ch;
    font-size: clamp(0.98rem, 2vw, 1.08rem);
    line-height: 1.75;
}

.section-title {
    font-size: clamp(1.25rem, 3vw, 1.8rem);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.section-title::after {
    content: "";
    height: 1px;
    flex: 1;
    background: var(--line);
}

.section-title.centered {
    justify-content: center;
    text-align: center;
}

.section-title.centered::before,
.section-title.centered::after {
    content: "";
    height: 1px;
    flex: 1;
    max-width: 280px;
}

.section-title.centered::before {
    background: linear-gradient(to right, transparent, var(--line));
}

.section-title.centered::after {
    background: linear-gradient(to left, transparent, var(--line));
}

.about-panel,
.guild-card,
.tools-panel,
.event-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
}

.about-panel {
    padding: 18px;
}

.about-copy {
    margin: 0;
    line-height: 1.8;
}

.guild-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.guild-card {
    padding: 14px 12px;
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 8px;
}

.guild-emblem {
    width: min(104px, 70%);
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 1px solid var(--emblem-border);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.guild-emblem.midnight { filter: saturate(1) brightness(1); }
.guild-emblem.spring { filter: hue-rotate(210deg) saturate(2.05) contrast(1.12) brightness(1.02); }
.guild-emblem.summer { filter: hue-rotate(90deg) saturate(2.15) contrast(1.16) brightness(0.98); }
.guild-emblem.winter { filter: hue-rotate(323deg) saturate(5) contrast(1.08) brightness(1.16); }
.guild-emblem.autumn { filter: hue-rotate(150deg) saturate(4) contrast(.79) brightness(1.56); }

.halls-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.hall-card {
    position: relative;
    overflow: hidden;
    min-height: 220px;
}

.hall-card img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hall-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.6));
}

.hall-card h3 {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
}

.events-list {
    display: grid;
    gap: 12px;
}

.event-item {
    display: grid;
    grid-template-columns: 240px 1fr;
    overflow: hidden;
}

.event-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-content {
    padding: 14px;
}

.event-content h3 {
    margin: 0 0 7px;
    font-size: 1.08rem;
}

.event-content p {
    margin: 0;
    line-height: 1.6;
}

.utility-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr 1fr;
}

.tools-panel {
    padding: 16px;
    display: grid;
    gap: 10px;
}

.tools-panel h3 {
    margin: 0;
    font-size: 1.1rem;
}

.tools-panel p {
    margin: 0;
    line-height: 1.6;
}

.tools-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ghost-link {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 9px;
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--ghost-border);
    color: var(--text-primary);
    text-decoration: none;
}

.ghost-link:hover {
    border-color: var(--accent);
}

.footer-note {
    text-align: center;
    font-size: 0.88rem;
    margin: 0;
    line-height: 1.7;
}

@media screen and (max-width: 759px) {
    body {
        padding-top: 174px;
    }

    .header-inner {
        padding: 8px 12px;
        padding-right: 68px;
        gap: 8px;
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .brand {
        padding: 0;
        order: 1;
    }

    .brand-logo {
        width: 40px;
        height: 40px;
    }

    .menu-toggle {
        display: inline-flex;
        order: 0;
        margin-right: 0;
    }

    .header-nav {
        display: none;
        order: 3;
        flex: 0 0 100%;
        justify-content: flex-start;
        padding-top: 4px;
    }

    .site-header.menu-open .header-nav {
        display: flex;
    }

    .hero-cover,
    .hero-content {
        min-height: 390px;
    }

    .guild-grid {
        grid-template-columns: 1fr 1fr;
    }

    .halls-grid {
        grid-template-columns: 1fr;
    }

    .event-item {
        grid-template-columns: 1fr;
    }

    .event-item img {
        height: 180px;
    }

    .utility-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.2rem;
    }

    .section-title::after {
        max-width: 80px;
    }
}

@media screen and (max-width: 420px) {
    .guild-grid {
        grid-template-columns: 1fr;
    }
}

body.rg-crafting-page {
    background:
        radial-gradient(circle at 10% -5%, var(--bg-radial-one), transparent 40%),
        radial-gradient(circle at 100% 10%, var(--bg-radial-two), transparent 30%),
        linear-gradient(180deg, var(--bg-grad-start) 0%, var(--bg-grad-mid) 40%, var(--bg-grad-end) 100%) !important;
    background-color: transparent !important;
}

body.rg-crafting-page #screenshotContainer,
body.rg-crafting-page .table-wrapper,
body.rg-crafting-page .cost-box,
body.rg-crafting-page .cost-box-content,
body.rg-crafting-page tbody tr,
body.rg-crafting-page td {
    background-color: color-mix(in srgb, var(--panel) 92%, transparent) !important;
}

body.rg-crafting-page .cost-box,
body.rg-crafting-page .table-wrapper {
    border: 1px solid var(--line) !important;
}
