:root {
    --bg: #0b0d10;
    --panel: #141920;
    --panel-2: #10151b;
    --gold: #d9b76e;
    --gold-2: #b0893e;
    --bronze: #7d5a2c;
    --red: #7a1f1f;
    --accent: #2a3a4a;
    --text: #efe6d1;
    --muted: #9a8f7b;
    --green: #2f9b5f;
    --warning: #b94a2f;
    --glow: rgba(217, 183, 110, 0.35);
    --button-image: url("../img/button.png");
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: "Inter", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: radial-gradient(circle at top, rgba(217, 183, 110, 0.08), transparent 45%),
        radial-gradient(circle at 20% 20%, rgba(28, 37, 48, 0.9), transparent 55%),
        radial-gradient(circle at 80% 0%, rgba(40, 27, 16, 0.7), transparent 60%),
        var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    padding: 30px clamp(16px, 3vw, 48px) 40px;
}

img {
    max-width: 100%;
    display: block;
}

button,
input,
select,
textarea {
    font: inherit;
}

.app {
    width: min(1500px, 96vw);
    display: grid;
    grid-template-columns: 300px 1fr;
    background: rgba(8, 10, 14, 0.9);
    border: 1px solid rgba(217, 183, 110, 0.15);
    border-radius: 24px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65);
    overflow: hidden;
    position: relative;
}

.sidebar {
    background: linear-gradient(180deg, rgba(12, 16, 24, 0.95), rgba(7, 9, 13, 0.96));
    border-right: 1px solid rgba(217, 183, 110, 0.12);
    padding: 28px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-height: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand .crest {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: url("../img/icon.png") center/cover no-repeat;
    box-shadow: 0 0 20px var(--glow);
    display: grid;
    place-items: center;
    color: transparent;
    font-size: 0;
    overflow: hidden;
}

.brand-title {
    font-size: 18px;
    color: var(--gold);
}

.brand-subtitle {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 2px;
    font-family: "IM Fell English", serif;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-toggle {
    display: none;
    border: 1px solid rgba(217, 183, 110, 0.4);
    background: rgba(12, 16, 24, 0.95);
    color: var(--gold);
    border-radius: 12px;
    padding: 8px 10px;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.45);
}

.mobile-toggle span {
    width: 18px;
    height: 2px;
    background: var(--gold);
    border-radius: 999px;
    display: block;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 11, 0.75);
    backdrop-filter: blur(4px);
    z-index: 70;
}

body.nav-locked {
    overflow: hidden;
}

.nav-btn {
    background: transparent;
    border: 1px solid rgba(217, 183, 110, 0.2);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 10px;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-btn.active,
.nav-btn:hover {
    border-color: rgba(217, 183, 110, 0.55);
    background: rgba(217, 183, 110, 0.08);
    box-shadow: 0 0 12px rgba(217, 183, 110, 0.25);
}

.nav-btn img {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 0 6px rgba(217, 183, 110, 0.4));
}

.nav-glyph {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    border: 1px solid rgba(217, 183, 110, 0.35);
    display: grid;
    place-items: center;
    font-weight: 700;
    color: var(--gold);
    background: rgba(217, 183, 110, 0.08);
    font-family: "Cinzel", serif;
}
.nav-toggle {
    justify-content: space-between;
}

.nav-toggle .bars {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    margin-right: 10px;
}

.nav-toggle .bars span {
    width: 22px;
    height: 2px;
    .site-credit {
        position: fixed;
        bottom: 24px;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px 28px;
        border-radius: 999px;
        border: 1px solid rgba(217, 183, 110, 0.35);
        background: rgba(8, 10, 14, 0.9);
        color: var(--gold);
        font-size: 11px;
        letter-spacing: 2px;
        text-transform: uppercase;
        font-family: "IM Fell English", serif;
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
        backdrop-filter: blur(8px);
        z-index: 60;
        pointer-events: none;
    }
    border: 1px solid rgba(217, 183, 110, 0.2);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
}

.report-form {
    margin-top: 18px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.reporter-grid,
.evidence-grid {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.report-form textarea {
    grid-column: 1 / -1;
    resize: vertical;
    min-height: 110px;
}

.report-form select,
.report-form textarea,
.report-form input {
    background: rgba(7, 9, 14, 0.8);
    border: 1px solid rgba(217, 183, 110, 0.25);
    color: var(--text);
    padding: 10px 12px;
    border-radius: 12px;
    font-family: inherit;
}

.report-form button {
    grid-column: 1 / -1;
    justify-self: flex-start;
}

.report-tip {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
}

.report-list {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-item {
    position: relative;
    border: 1px solid rgba(217, 183, 110, 0.25);
    border-radius: 14px;
    padding: 14px 16px;
    background: rgba(12, 15, 21, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.report-item::before {
    content: "";
    position: absolute;
    inset: 6px;
    border-radius: 12px;
    border: 1px dashed rgba(217, 183, 110, 0.2);
    pointer-events: none;
}

.report-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    position: relative;
}

.report-head strong {
    font-size: 16px;
    color: var(--gold);
}

.report-reason {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(185, 74, 47, 0.15);
    color: #ffb5a1;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.report-item p {
    position: relative;
    margin: 12px 0 8px;
    color: var(--text);
    line-height: 1.5;
}

.report-item small {
    position: relative;
    color: var(--muted);
    font-size: 12px;
}

.report-meta-line {
    font-size: 13px;
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 6px 0;
}

.report-meta-line strong {
    color: var(--gold);
}

.report-verdict {
    color: #ffd9a0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.report-evidence {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin: 12px 0 6px;
}

.report-proof {
    position: relative;
    border: 1px solid rgba(217, 183, 110, 0.2);
    border-radius: 12px;
    overflow: hidden;
    display: block;
    min-height: 90px;
    background: rgba(10, 13, 19, 0.8);
}

.report-proof img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.report-proof.broken img {
    display: none;
}

.report-proof.broken::after {
    content: "Ảnh không hợp lệ";
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 12px;
    color: var(--muted);
    background: rgba(8, 10, 14, 0.9);
}

.report-empty {
    padding: 18px;
    border-radius: 16px;
    border: 1px dashed rgba(217, 183, 110, 0.35);
    background: rgba(12, 17, 24, 0.9);
    color: var(--muted);
    text-align: center;
}

.event-countdown.expired {
    color: #ffb5a1;
    background: rgba(185, 74, 47, 0.18);
}

.event-meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 14px;
    color: var(--text);
}

.event-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
}

.event-side {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.event-reward {
    border: 1px dashed rgba(217, 183, 110, 0.3);
    border-radius: 10px;
    padding: 10px;
    font-size: 14px;
}

.event-reward img {
    width: 100%;
    max-height: 140px;
    object-fit: cover;
    border-radius: 8px;
    margin-top: 8px;
}

.event-demo {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(217, 183, 110, 0.3);
    object-fit: cover;
    max-height: 160px;
}

.event-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.event-actions button {
    border-radius: 999px;
    padding: 6px 12px;
}

.drawer {
    position: fixed;
    inset: 0;
    background: rgba(5, 7, 11, 0.8);
    display: none;
    align-items: center;
    justify-content: flex-end;
    z-index: 50;
}

.drawer:not(.hidden) {
    display: flex;
}

.drawer-card {
    width: min(340px, 90vw);
    background: rgba(15, 20, 30, 0.95);
    border: 1px solid rgba(217, 183, 110, 0.2);
    border-radius: 16px 0 0 16px;
    padding: 24px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
}

.drawer-close {
    align-self: flex-end;
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 26px;
    cursor: pointer;
}

.drawer-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}


.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-radius: 12px;
    background: rgba(122, 31, 31, 0.2);
    border: 1px solid rgba(217, 183, 110, 0.2);
    font-size: 12px;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.btn-danger {
    border: 1px solid rgba(185, 74, 47, 0.6);
    color: #ffb5a1;
    background: rgba(185, 74, 47, 0.15);
    padding: 8px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-danger:hover {
    background: rgba(185, 74, 47, 0.3);
    color: #ffd5c9;
}

.badge-line strong {
    color: var(--gold);
}

.content {
    padding: 32px clamp(24px, 4vw, 60px) 48px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: relative;
    background: radial-gradient(circle at top right, rgba(217, 183, 110, 0.1), transparent 45%),
        rgba(9, 12, 18, 0.8);
    backdrop-filter: blur(6px);
}

.login-fab {
    position: fixed;
    left: 24px;
    bottom: 24px;
    z-index: 45;
    border: 1px solid rgba(217, 183, 110, 0.5);
    background: rgba(12, 15, 21, 0.95);
    color: var(--gold);
    padding: 12px 22px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 40px rgba(0, 0, 0, 0.55);
}

.login-popover {
    position: fixed;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: flex-start;
    background: rgba(4, 5, 7, 0.6);
    z-index: 50;
}

.login-popover:not(.hidden) {
    display: flex;
}

.popover-card {
    width: min(360px, calc(100% - 32px));
    margin: 0 0 32px 24px;
    background: rgba(14, 17, 23, 0.95);
    border: 1px solid rgba(217, 183, 110, 0.3);
    border-radius: 18px;
    padding: 20px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.popover-close {
    align-self: flex-end;
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 24px;
    cursor: pointer;
}

.login-panel {
    display: grid;
    gap: 10px;
}

.login-panel input {
    background: rgba(5, 6, 9, 0.9);
    border: 1px solid rgba(217, 183, 110, 0.4);
    border-radius: 10px;
    padding: 10px 12px;
    color: var(--text);
}

.login-panel .btn-gold {
    width: 100%;
    min-width: auto;
}

.login-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.login-meta small {
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--muted);
}

.login-meta span {
    color: var(--gold);
    font-weight: 600;
}

.user-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(8, 10, 14, 0.85);
    border: 1px solid rgba(217, 183, 110, 0.25);
    border-radius: 12px;
    padding: 12px 14px;
    gap: 12px;
}

.hero-banner {
    display: grid;
    grid-template-columns: 1fr minmax(220px, 320px);
    gap: 24px;
    padding: 24px 28px;
    border: 1px solid rgba(217, 183, 110, 0.2);
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(19, 24, 34, 0.95), rgba(10, 12, 17, 0.9));
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    position: relative;
    overflow: hidden;
}

.hero-banner::after {
    content: "";
    position: absolute;
    inset: -40% auto auto -30%;
    width: 420px;
    height: 420px;
    background: radial-gradient(circle, rgba(217, 183, 110, 0.25), transparent 65%);
    opacity: 0.6;
    pointer-events: none;
}

.hero-banner__text {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 1;
}

.hero-eyebrow {
    margin: 0;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--muted);
    font-size: 13px;
}

.hero-banner__text h1 {
    margin: 0;
    font-size: clamp(26px, 3vw, 36px);
    color: var(--gold);
    font-family: "Cinzel", serif;
}

.hero-copy {
    margin: 0;
    color: var(--text);
    line-height: 1.6;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.hero-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-chip {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(217, 183, 110, 0.35);
    font-size: 12px;
    color: var(--muted);
    background: rgba(217, 183, 110, 0.08);
}

.hero-banner__card {
    position: relative;
    z-index: 1;
    border-radius: 18px;
    border: 1px solid rgba(217, 183, 110, 0.25);
    background: rgba(9, 11, 15, 0.9);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-card-title {
    font-size: 14px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
}

.hero-banner__card p {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.hero-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 14px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.topbar h1 {
    margin: 0;
    color: var(--gold);
    font-size: 28px;
}

.meta {
    color: var(--muted);
    margin: 6px 0 0;
}

.meta-author {
    font-family: "IM Fell English", serif;
    letter-spacing: 1px;
    margin-top: 4px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.clan-select {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(10, 12, 16, 0.6);
    border: 1px solid rgba(217, 183, 110, 0.2);
    padding: 8px 10px;
    border-radius: 10px;
}

.clan-select label {
    font-size: 12px;
    color: var(--muted);
}

.clan-select select {
    background: transparent;
    border: 1px solid rgba(217, 183, 110, 0.2);
    color: var(--text);
    padding: 6px 8px;
    border-radius: 8px;
}

.user-name {
    font-weight: 600;
    color: var(--gold);
}

.user-role {
    font-size: 12px;
    color: var(--muted);
}

.hidden {
    display: none;
}


.btn-gold {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 26px;
    min-width: 140px;
    border: none;
    border-radius: 999px;
    font-weight: 700;
    color: #fff7d4;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.35)), var(--button-image);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.55);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-gold:hover {
    transform: translateY(-1px) scale(1.01);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.6);
    filter: brightness(1.06);
}

.btn-gold:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.5);
    filter: brightness(0.95);
}

.btn-gold:disabled,
.btn-ghost:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: saturate(0.7);
}

.btn-ghost {
    background: transparent;
    border: 1px solid rgba(217, 183, 110, 0.4);
    color: var(--gold);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.site-credit {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 28px;
    border-radius: 999px;
    border: 1px solid rgba(217, 183, 110, 0.35);
    background: rgba(8, 10, 14, 0.9);
    color: var(--gold);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-family: "IM Fell English", serif;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    z-index: 60;
    pointer-events: none;
}

.social-dock {
    position: fixed;
    right: 20px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 40;
}

.chat-widget {
    position: fixed;
    right: 90px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    z-index: 75;
}

.chat-start {
    border: 1px solid rgba(217, 183, 110, 0.5);
    background: rgba(10, 12, 16, 0.85);
    color: var(--gold);
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-start:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.6);
}

.chat-launcher {
    min-width: 210px;
    border: 1px solid rgba(217, 183, 110, 0.7);
    background: rgba(5, 6, 8, 0.8);
    color: var(--gold);
    padding: 10px 16px;
    border-radius: 999px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    text-align: left;
}

.chat-launcher small {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 1px;
}

.chat-panel {
    width: 320px;
    background: rgba(11, 13, 16, 0.95);
    border: 1px solid rgba(217, 183, 110, 0.4);
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(217, 183, 110, 0.2);
}

.chat-presence {
    font-size: 11px;
    color: var(--muted);
}

.chat-close {
    background: transparent;
    border: none;
    color: var(--gold);
    font-size: 22px;
    cursor: pointer;
}

.chat-log {
    max-height: 280px;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-bubble {
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
}

.chat-bubble.ai {
    background: rgba(217, 183, 110, 0.15);
    align-self: flex-start;
    border: 1px solid rgba(217, 183, 110, 0.3);
}

.chat-bubble.user {
    background: rgba(47, 155, 95, 0.25);
    border: 1px solid rgba(47, 155, 95, 0.4);
    align-self: flex-end;
}

.chat-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 16px 12px;
}

.chat-chip {
    border: 1px solid rgba(217, 183, 110, 0.3);
    background: transparent;
    color: var(--gold);
    border-radius: 999px;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
}

.chat-form {
    display: flex;
    gap: 8px;
    padding: 12px 16px 16px;
}

.chat-form input {
    flex: 1;
    background: rgba(10, 12, 16, 0.7);
    border: 1px solid rgba(217, 183, 110, 0.3);
    border-radius: 10px;
    padding: 8px 10px;
    color: var(--text);
}

.chat-form button {
    background: linear-gradient(135deg, #d9b76e, #9b6d2c);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    color: #1b1304;
    font-weight: 600;
    cursor: pointer;
}

.social-btn {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    color: #fff;
}

.social-btn svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.social-btn--fb {
    background: radial-gradient(circle, #3b5998, #1c2a4f);
}

.social-btn--mes {
    background: radial-gradient(circle, #0099ff, #0057b7);
}

.social-btn--dis {
    background: radial-gradient(circle, #5865f2, #2b3088);
}

.social-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.card {
    background: var(--panel);
    border: 1px solid rgba(217, 183, 110, 0.2);
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stat-title {
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: var(--gold);
    margin-top: 6px;
}

.overview-badge {
    margin-top: 14px;
    padding: 8px 10px;
    background: rgba(217, 183, 110, 0.12);
    border-radius: 10px;
    color: var(--gold);
    display: inline-block;
}

.event-list {
    margin: 0;
    padding-left: 18px;
    color: var(--text);
}

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.event-card {
    background: linear-gradient(180deg, rgba(20, 24, 33, 0.92), rgba(12, 15, 21, 0.95));
    border: 1px solid rgba(217, 183, 110, 0.2);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 10px 30px rgba(0, 0, 0, 0.35);
}

.event-card h3 {
    margin: 0;
    font-size: 20px;
    color: var(--gold);
}

.event-card p {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
}

.event-datetime {
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--muted);
    text-transform: uppercase;
}

.event-countdown {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(217, 183, 110, 0.12);
    color: var(--gold);
    font-weight: 600;
    font-size: 13px;
}

.layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 18px;
}

.branch-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 520px;
    overflow-y: auto;
}

.branch-item {
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(180deg, rgba(14, 17, 24, 0.95), rgba(8, 10, 14, 0.92));
    border: 1px solid rgba(217, 183, 110, 0.18);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.branch-item.active,
.branch-item:hover {
    border-color: rgba(217, 183, 110, 0.6);
    box-shadow: 0 0 20px rgba(217, 183, 110, 0.2);
}

.branch-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.branch-title {
    margin: 0;
    font-size: 16px;
    color: var(--gold);
}

.branch-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}

.branch-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.branch-meta strong {
    color: #fff;
}

.branch-uid {
    font-family: "Courier New", monospace;
    letter-spacing: 0.4px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(47, 155, 95, 0.2);
    color: #7ee0a6;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.branch-count {
    align-self: flex-start;
}

.members-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.panel-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--gold);
}

.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.controls input,
.controls select {
    background: transparent;
    border: 1px solid rgba(217, 183, 110, 0.2);
    color: var(--text);
    padding: 8px 10px;
    border-radius: 8px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.table th,
.table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(217, 183, 110, 0.15);
}

.table th {
    text-align: left;
    font-size: 12px;
    color: var(--muted);
    text-transform: uppercase;
}

.rank {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rank img {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: rgba(217, 183, 110, 0.1);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
}

.status.online {
    background: rgba(47, 155, 95, 0.2);
    color: #7ee0a6;
}

.status.offline {
    background: rgba(185, 74, 47, 0.2);
    color: #ffb5a1;
}

.actions button {
    background: transparent;
    border: 1px solid rgba(217, 183, 110, 0.3);
    color: var(--gold);
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    margin-right: 6px;
}

.json-box {
    background: #0c1016;
    border: 1px solid rgba(217, 183, 110, 0.25);
    border-radius: 12px;
    padding: 12px;
    font-family: "Courier New", monospace;
    font-size: 12px;
    color: #d6c6aa;
    max-height: 320px;
    overflow-y: auto;
    white-space: pre-wrap;
}

.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(5, 6, 8, 0.7);
    z-index: 10;
}

.modal.active {
    display: flex;
}

.modal-card {
    background: var(--panel);
    border: 1px solid rgba(217, 183, 110, 0.3);
    border-radius: 14px;
    padding: 18px;
    width: 360px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-card h3 {
    margin-top: 0;
    color: var(--gold);
    font-family: "Cinzel", serif;
}

.modal-card label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 10px 0 4px;
}

.modal-card input,
.modal-card select,
.modal-card textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(217, 183, 110, 0.2);
    background: transparent;
    color: var(--text);
}

.modal-card textarea {
    resize: vertical;
    min-height: 70px;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.btn-cancel {
    background: #3a2e1f;
    color: var(--text);
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.btn-save {
    background: linear-gradient(135deg, #d9b76e, #9b6d2c);
    color: #1b1304;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
}

.rich-text p {
    margin: 0 0 10px;
    line-height: 1.6;
    color: var(--text);
}

.highlight-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.highlight-list li {
    padding: 10px 12px;
    border: 1px solid rgba(217, 183, 110, 0.2);
    border-radius: 10px;
    background: rgba(10, 12, 16, 0.5);
}

.quick-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hero-card {
    display: grid;
    grid-template-columns: minmax(220px, 320px) 1fr;
    gap: 18px;
    align-items: stretch;
}

.hero-media {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    min-height: 260px;
    border: 1px solid rgba(217, 183, 110, 0.25);
}

.hero-media::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--hero-image, url("../img/thum.jpg"));
    background-size: cover;
    background-position: center;
    filter: blur(16px);
    transform: scale(1.1);
    opacity: 0.85;
}

.hero-media img {
    position: absolute;
    inset: 30px;
    width: calc(100% - 60px);
    height: calc(100% - 60px);
    object-fit: cover;
    border-radius: 14px;
    border: 1px solid rgba(217, 183, 110, 0.4);
    filter: blur(3px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4);
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.hero-content .panel-header {
    justify-content: space-between;
}

.blur-image {
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.hero-card.loaded .blur-image {
    filter: blur(1.5px);
    opacity: 0.95;
}

.view {
    display: none;
    flex-direction: column;
    gap: 18px;
}

.view.active {
    display: flex;
}

.muted {
    color: var(--muted);
}

@media (max-width: 1200px) {
    .app {
        grid-template-columns: 260px 1fr;
    }
}

@media (max-width: 1024px) {
    body {
        padding: 0;
        align-items: stretch;
    }
    .app {
        width: 100%;
        grid-template-columns: 1fr;
        border-radius: 0;
    }
    .sidebar {
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(280px, 78vw);
        max-width: 320px;
        border-right: 1px solid rgba(217, 183, 110, 0.2);
        border-bottom: none;
        transform: translateX(-110%);
        transition: transform 0.28s ease;
        z-index: 80;
        box-shadow: 0 25px 55px rgba(0, 0, 0, 0.55);
    }
    #appRoot.sidebar-open .sidebar {
        transform: translateX(0);
    }
    .content {
        padding: 24px clamp(16px, 4vw, 32px) 72px;
    }
    .hero-banner {
        grid-template-columns: 1fr;
    }
    .layout {
        grid-template-columns: 1fr;
    }
    .mobile-toggle {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .content {
        padding: 20px 16px 72px;
    }
    .topbar {
        flex-direction: column;
        align-items: flex-start;
    }
    .clan-select {
        width: 100%;
    }
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    .social-dock {
        flex-direction: row;
        right: 12px;
        bottom: 12px;
    }
    .chat-widget {
        right: 16px;
        left: 16px;
        bottom: 100px;
        align-items: stretch;
    }
    .chat-panel {
        width: 100%;
        max-width: none;
    }
    .chat-start,
    .chat-launcher {
        width: 100%;
    }
    .chat-log {
        max-height: 45vh;
    }
    .layout {
        grid-template-columns: 1fr;
    }
    .hero-card {
        grid-template-columns: 1fr;
    }
    .hero-banner {
        padding: 20px;
    }
    .site-credit {
        position: static;
        transform: none;
        margin: 32px auto 0;
        width: calc(100% - 32px);
    }
}


/* ===== RESPONSIVE + SOPHIA CHAT FIX ===== */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; width: 100vw; min-height: 100vh; border-radius: 0; }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 80;
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
}

.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 70;
}
.mobile-nav-backdrop.hidden { display: none; }

.chat-panel {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-panel.hidden { display: none; }

@media (max-width: 768px) {
  .chat-card {
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    border-radius: 0;
  }
}

body.chat-open { overflow: hidden; }


/* ===== HAMBURGER MENU ===== */
.mobile-menu-btn {
  position: fixed;
  top: 16px;
  left: 16px;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: #111;
  border: 1px solid rgba(255,255,255,.08);
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  z-index: 90;
}
.mobile-menu-btn span {
  display: block;
  height: 2px;
  background: #d9b76e;
  border-radius: 2px;
}
@media (max-width: 1024px) {
  .mobile-menu-btn { display: flex; }
}

/* ===== SOPHIA ROBOT ICON ===== */
#chatLauncher[data-icon="robot"]::before {
  content: "🤖";
  font-size: 22px;
}

/* ensure close button clickable */
.chat-header button {
  cursor: pointer;
  z-index: 2;
}
