:root {
    --bg-start: #07111f;
    --bg-end: #12304a;
    --surface: rgba(10, 23, 38, 0.82);
    --surface-soft: rgba(255, 255, 255, 0.08);
    --surface-border: rgba(255, 255, 255, 0.12);
    --text-main: #f6fbff;
    --text-soft: #b8cbdd;
    --accent: #56f0a9;
    --accent-dark: #129b67;
    --body-gradient:
        radial-gradient(circle at top right, rgba(86, 240, 169, 0.15), transparent 30%),
        radial-gradient(circle at bottom left, rgba(49, 123, 255, 0.18), transparent 35%),
        linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

body[data-theme="ocean-breeze"] {
    --bg-start: #081825;
    --bg-end: #1a5f7a;
    --surface: rgba(7, 29, 42, 0.82);
    --surface-soft: rgba(126, 214, 223, 0.09);
    --surface-border: rgba(167, 228, 255, 0.18);
    --text-main: #eefcff;
    --text-soft: #b0d4df;
    --accent: #7fe7dc;
    --accent-dark: #26a0a8;
}

body[data-theme="sunset-arena"] {
    --bg-start: #2a1120;
    --bg-end: #8b3f2f;
    --surface: rgba(45, 18, 29, 0.82);
    --surface-soft: rgba(255, 195, 160, 0.09);
    --surface-border: rgba(255, 210, 175, 0.16);
    --text-main: #fff6f0;
    --text-soft: #f2c8b2;
    --accent: #ffb15c;
    --accent-dark: #eb6f3f;
}

body[data-theme="midnight-gold"] {
    --bg-start: #161616;
    --bg-end: #3d2c11;
    --surface: rgba(22, 19, 14, 0.84);
    --surface-soft: rgba(255, 215, 132, 0.08);
    --surface-border: rgba(255, 220, 150, 0.15);
    --text-main: #fff9eb;
    --text-soft: #dccca8;
    --accent: #ffd166;
    --accent-dark: #c89d24;
}

* { box-sizing: border-box; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", sans-serif;
    color: var(--text-main);
    background: var(--body-gradient);
}
.site-background-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}
.site-background-media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    opacity: 0;
    filter: saturate(1.05) brightness(0.7);
    transform-origin: center center;
}
.site-background-image {
    animation: backgroundImageFloat 18s ease-in-out infinite alternate;
}
.site-background-video {
    transform: scale(1.06);
}
.site-background-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(20px);
    opacity: 0.22;
    mix-blend-mode: screen;
}
.site-background-orb-a {
    width: 34vw;
    height: 34vw;
    min-width: 240px;
    min-height: 240px;
    left: -6vw;
    top: 8vh;
    background: radial-gradient(circle, rgba(86, 240, 169, 0.72), rgba(86, 240, 169, 0));
    animation: backgroundOrbA 14s ease-in-out infinite alternate;
}
.site-background-orb-b {
    width: 42vw;
    height: 42vw;
    min-width: 280px;
    min-height: 280px;
    right: -10vw;
    bottom: -8vh;
    background: radial-gradient(circle, rgba(49, 123, 255, 0.62), rgba(49, 123, 255, 0));
    animation: backgroundOrbB 18s ease-in-out infinite alternate;
}
.site-background-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: linear-gradient(180deg, rgba(0,0,0,0.7), transparent 88%);
    opacity: 0.16;
    animation: backgroundGridDrift 28s linear infinite;
}
body[data-background-type="image"] .site-background-image,
body[data-background-type="video"] .site-background-video {
    opacity: 0.28;
}
.site-background-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(7, 17, 31, 0.22), rgba(7, 17, 31, 0.38)),
        radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 48%);
}
body[data-background-type="image"] .site-background-stage::after,
body[data-background-type="video"] .site-background-stage::after {
    background:
        linear-gradient(180deg, rgba(7, 17, 31, 0.24), rgba(7, 17, 31, 0.42)),
        radial-gradient(circle at center, rgba(255,255,255,0.1), transparent 46%);
}
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 15% 18%, rgba(255,255,255,0.06), transparent 20%),
        radial-gradient(circle at 85% 10%, rgba(86, 240, 169, 0.08), transparent 24%),
        linear-gradient(180deg, rgba(255,255,255,0.02), transparent 35%);
    z-index: 0;
}
@keyframes backgroundImageFloat {
    0% { transform: scale(1.06) translate3d(-1.2%, -0.8%, 0) rotate(-0.8deg); }
    50% { transform: scale(1.1) translate3d(1.2%, 0.8%, 0) rotate(0.8deg); }
    100% { transform: scale(1.12) translate3d(0.2%, -0.3%, 0) rotate(-0.4deg); }
}
@keyframes backgroundOrbA {
    0% { transform: translate3d(0, 0, 0) scale(0.92); }
    100% { transform: translate3d(8vw, 8vh, 0) scale(1.15); }
}
@keyframes backgroundOrbB {
    0% { transform: translate3d(0, 0, 0) scale(0.9); }
    100% { transform: translate3d(-7vw, -9vh, 0) scale(1.12); }
}
@keyframes backgroundGridDrift {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-72px, 72px, 0); }
}
body.ui-density-compact .content-area { padding: 22px; }
body.ui-density-compact .page-card { padding: 20px; border-radius: 22px; }
body.ui-density-compact .panel,
body.ui-density-compact .stat-card,
body.ui-density-compact .feature-card { padding: 16px; border-radius: 20px; }
body.ui-density-compact .hero-grid,
body.ui-density-compact .stats-grid,
body.ui-density-compact .grid-2,
body.ui-density-compact .grid-3 { gap: 14px; }
body.ui-density-compact .table > :not(caption) > * > * { padding: 0.55rem 0.55rem; }
body.ui-density-compact .form-control,
body.ui-density-compact .form-select { padding: 0.54rem 0.72rem; }
body.ui-density-comfortable .content-area { padding: 34px; }
body.ui-density-comfortable .page-card { padding: 32px; }
body.ui-density-comfortable .panel,
body.ui-density-comfortable .stat-card,
body.ui-density-comfortable .feature-card { padding: 24px; }
body.ui-density-comfortable .hero-grid,
body.ui-density-comfortable .stats-grid,
body.ui-density-comfortable .grid-2,
body.ui-density-comfortable .grid-3 { gap: 22px; }
body.ui-density-comfortable .table > :not(caption) > * > * { padding: 0.82rem 0.78rem; }
body.ui-density-comfortable .form-control,
body.ui-density-comfortable .form-select { padding: 0.72rem 0.9rem; }
a { text-decoration: none; }
.app-shell { display: grid; grid-template-columns: 290px 1fr; min-height: 100vh; }
.app-shell,
.content-area,
.page-card,
.panel,
.table-responsive {
    min-width: 0;
}
.mobile-nav-toggle,
.mobile-nav-close {
    display: none;
    border: 1px solid var(--surface-border);
    background: rgba(8, 24, 39, 0.85);
    color: var(--text-main);
    border-radius: 14px;
    padding: 10px 14px;
}
.sidebar {
    padding: 32px 24px;
    background: rgba(4, 12, 22, 0.78);
    border-right: 1px solid var(--surface-border);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 16px;
    backdrop-filter: blur(20px);
    z-index: 20;
    position: relative;
}
.sidebar-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.brand-mark {
    width: 58px; height: 58px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), #8affd0);
    color: #042314; border-radius: 18px; font-weight: 800; font-size: 1.2rem; margin-bottom: 18px;
}
.brand-logo-image {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 18px;
    display: block;
    margin-bottom: 18px;
    border: 1px solid rgba(255,255,255,0.16);
}
.brand-title { font-size: 1.3rem; font-weight: 800; margin: 0; line-height: 1.15; }
.brand-subtitle { color: var(--text-soft); margin-top: 10px; margin-bottom: 0; line-height: 1.6; }
.app-nav-link { border-radius: 16px; color: var(--text-soft); padding: 12px 14px; border: 1px solid transparent; }
.app-nav-link:hover, .app-nav-link.active { color: var(--text-main); background: var(--surface-soft); border-color: var(--surface-border); }
.sidebar .nav { margin-top: 20px !important; }
.sidebar-footer { margin-top: 4px; padding-top: 8px; }
.user-badge {
    background: var(--surface-soft); border: 1px solid var(--surface-border);
    border-radius: 20px; padding: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.user-badge-main {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    flex: 1;
}
.user-profile-link {
    color: inherit;
    text-decoration: none;
    border-radius: 16px;
    transition: background 0.16s ease, transform 0.16s ease;
}
.user-profile-link:hover {
    background: rgba(255,255,255,0.04);
    transform: translateY(-1px);
}
.user-badge-text {
    min-width: 0;
}
.user-badge-name {
    display: block;
    font-size: 1.05rem;
    line-height: 1.2;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-logout-btn {
    min-width: 84px;
    padding: 0.55rem 0.9rem;
    border-radius: 14px;
    font-weight: 700;
    flex-shrink: 0;
}
.avatar-thumb {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.18);
}
.avatar-fallback {
    display: grid;
    place-items: center;
    background: rgba(86, 240, 169, 0.16);
    color: #b9ffd8;
    font-weight: 800;
}
.profile-photo-lg {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
}
.table-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.16);
    display: block;
}
.table-profile-link {
    color: inherit;
    text-decoration: none;
}
.table-profile-name {
    font-weight: 700;
}
.table-profile-link:hover .table-user-avatar,
.table-profile-name:hover {
    opacity: 0.9;
}
.chat-layout { display: grid; grid-template-columns: 320px 1fr; gap: 18px; }
.chat-room-list { display: grid; gap: 12px; }
.chat-room-card {
    display: block; padding: 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05); color: var(--text-main);
}
.chat-room-card.active, .chat-room-card:hover {
    background: rgba(86, 240, 169, 0.12); border-color: rgba(86, 240, 169, 0.24);
}
.chat-box { min-height: 480px; display: grid; grid-template-rows: auto 1fr auto; gap: 14px; }
.chat-feed { max-height: 480px; overflow: auto; display: grid; gap: 12px; padding-right: 8px; }
.chat-bubble {
    max-width: 76%; padding: 14px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
}
.chat-bubble.self {
    margin-left: auto; background: rgba(86, 240, 169, 0.16); border-color: rgba(86, 240, 169, 0.22);
}
.chat-meta { font-size: 0.78rem; color: var(--text-soft); margin-bottom: 6px; }
.chat-alert-dot { width: 12px; height: 12px; border-radius: 999px; background: #ffd54a; box-shadow: 0 0 0 rgba(255, 213, 74, 0.7); }
.chat-alert-dot.blink { animation: lampBlink 0.9s infinite; }
.chat-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
@keyframes lampBlink {
    0% { opacity: 1; box-shadow: 0 0 8px rgba(255, 213, 74, 0.9); }
    50% { opacity: 0.25; box-shadow: 0 0 18px rgba(255, 213, 74, 0.3); }
    100% { opacity: 1; box-shadow: 0 0 8px rgba(255, 213, 74, 0.9); }
}
.content-area { padding: 28px; position: relative; z-index: 1; }
.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 12px 24px 24px;
    color: var(--text-soft);
    position: relative;
    z-index: 1;
}
.table-action-cell {
    white-space: nowrap;
    width: 1%;
}
.join-tournament-btn {
    min-width: 78px;
}
.page-hero-image-wrap {
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    background: rgba(7, 17, 31, 0.72);
    width: 100%;
    aspect-ratio: 16 / 5;
}
.page-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}
.admin-header-preview {
    width: 100%;
    max-width: 420px;
    height: 180px;
    border-radius: 20px;
    object-fit: cover;
    border: 1px solid var(--surface-border);
}
.admin-brand-preview {
    width: 84px;
    height: 84px;
    object-fit: cover;
    border-radius: 22px;
    border: 1px solid var(--surface-border);
    background: rgba(255,255,255,0.05);
}
.page-card {
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: 28px; padding: 28px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); backdrop-filter: blur(18px);
    min-width: 0;
    position: relative;
    overflow: hidden;
}
.page-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 140px;
    background: linear-gradient(180deg, rgba(255,255,255,0.04), transparent);
    pointer-events: none;
}
.page-topbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding: 16px 18px;
    border-radius: 22px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
    backdrop-filter: blur(16px);
}
.page-topbar-meta {
    min-width: 0;
    flex: 1 1 320px;
    align-self: flex-start;
}
.page-topbar-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex: 0 1 auto;
    align-self: flex-start;
}
.eyebrow {
    display: inline-flex; padding: 6px 12px; border-radius: 999px; background: rgba(86, 240, 169, 0.12);
    color: #9bffd2; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 10px;
}
.page-title { font-size: clamp(1.8rem, 4vw, 2.6rem); font-weight: 800; }
.header-feed-ticker {
    margin-top: 8px;
    width: 100%;
    overflow: hidden;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.04);
    position: relative;
    padding-inline: 12px;
    min-height: 38px;
    min-width: 0;
}
.header-feed-marquee {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    min-width: max-content;
    animation: tournamentTicker 32s linear infinite;
}
.header-feed-track {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    white-space: nowrap;
    padding: 8px 0;
    flex-shrink: 0;
}
.header-feed-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text-soft);
    font-size: 0.8rem;
    font-weight: 600;
    line-height: 1.25;
}
.header-feed-item::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(86, 240, 169, 0.45);
    flex-shrink: 0;
}
.status-pill { background: rgba(255,255,255,0.06); padding: 10px 14px; border-radius: 999px; border: 1px solid var(--surface-border); }
.theme-picker {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-main);
}
.theme-picker .form-select {
    min-width: 160px;
    padding-top: 6px;
    padding-bottom: 6px;
}
.hero-grid, .stats-grid, .grid-2, .grid-3 { display: grid; gap: 18px; }
.hero-grid { grid-template-columns: 1.8fr 1fr; margin-bottom: 24px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .stat-card, .feature-card {
    background: rgba(255,255,255,0.06); border: 1px solid var(--surface-border); border-radius: 24px; padding: 20px;
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.panel::before, .stat-card::before, .feature-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent 35%);
    pointer-events: none;
}
.stat-card,
.feature-card {
    text-align: center;
}
.stat-card .stat-label,
.feature-card .stat-label,
.stat-card .stat-value,
.feature-card .stat-value {
    text-align: center;
}
.panel:hover, .stat-card:hover, .feature-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255,255,255,0.18);
    box-shadow: 0 18px 30px rgba(0,0,0,0.18);
}
.clickable-stat-card {
    display: block;
    color: inherit;
    text-decoration: none;
    cursor: pointer;
}
.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}
.rating-star {
    color: rgba(255,255,255,0.2);
    font-size: 0.95rem;
    line-height: 1;
}
.rating-star.filled {
    color: #ffd166;
    text-shadow: 0 0 10px rgba(255, 209, 102, 0.18);
}
.hero-card {
    min-height: 280px; display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(135deg, rgba(86,240,169,0.14), rgba(18,155,103,0.08)), rgba(255,255,255,0.06);
}
.hero-card h3 { font-size: 2rem; font-weight: 800; max-width: 12ch; }
.hero-card p, .panel p, .feature-card p { color: var(--text-soft); line-height: 1.7; }
.stat-label { color: var(--text-soft); font-size: 0.86rem; }
.stat-value { font-size: 2rem; font-weight: 800; }
.table { --bs-table-bg: transparent; --bs-table-color: var(--text-main); --bs-table-border-color: rgba(255,255,255,0.12); }
.table-responsive {
    border-radius: 18px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(255,255,255,0.06);
}
.table thead th {
    position: sticky;
    top: 0;
    background: rgba(10, 23, 38, 0.92);
    z-index: 1;
    backdrop-filter: blur(12px);
}
.table tbody tr {
    transition: background 0.16s ease;
}
.table tbody tr:hover {
    background: rgba(255,255,255,0.04);
}
.form-control, .form-select, .form-control:focus, .form-select:focus {
    background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.12); color: var(--text-main); box-shadow: none;
}
.form-text { color: var(--text-soft) !important; }
.form-control::placeholder { color: rgba(255,255,255,0.45); }
.btn-primary { background: linear-gradient(135deg, var(--accent-dark), var(--accent)); border: none; color: #042314; font-weight: 700; }
.btn-outline-light { border-color: rgba(255,255,255,0.2); }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
    width: min(1080px, 100%); display: grid; grid-template-columns: 1.1fr 0.9fr;
    border-radius: 30px; overflow: hidden; background: rgba(4, 12, 22, 0.8);
    border: 1px solid var(--surface-border); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}
.auth-showcase, .auth-form { padding: 36px; }
.auth-brand { margin-bottom: 12px; }
.auth-brand-logo {
    width: 58px;
    height: 58px;
    object-fit: cover;
    border-radius: 18px;
    border: 1px solid rgba(255,255,255,0.16);
}
.auth-showcase {
    background: radial-gradient(circle at top left, rgba(86, 240, 169, 0.25), transparent 30%),
    linear-gradient(150deg, rgba(8, 27, 41, 0.92), rgba(8, 18, 32, 0.72));
}
.auth-showcase ul { padding-left: 18px; color: var(--text-soft); line-height: 1.8; }
.auth-form { background: rgba(255, 255, 255, 0.03); }
.auth-title { font-size: 2.1rem; font-weight: 800; }
.auth-footer {
    width: min(1080px, 100%);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 8px 0;
    color: var(--text-soft);
}
.mini-kpi { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 999px; background: rgba(255,255,255,0.08); margin-top: 12px; }
.floating-chat-button {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 45;
    border: none;
    border-radius: 999px;
    padding: 14px 20px;
    font-weight: 800;
    color: #042314;
    background: linear-gradient(135deg, var(--accent-dark), var(--accent));
    box-shadow: 0 20px 40px rgba(0,0,0,0.28);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.floating-chat-button.has-alert {
    box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.14), 0 20px 40px rgba(0,0,0,0.28);
}
.floating-chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ff4d4f;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1;
}
.floating-chat-panel {
    position: fixed;
    right: 20px;
    bottom: 84px;
    width: min(430px, calc(100vw - 24px));
    height: min(680px, calc(100vh - 110px));
    display: none;
    flex-direction: column;
    z-index: 44;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--surface-border);
    background: rgba(6, 18, 28, 0.92);
    box-shadow: 0 28px 60px rgba(0,0,0,0.32);
    backdrop-filter: blur(18px);
}
.floating-chat-panel.open { display: flex; }
.floating-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-border);
    background: rgba(255,255,255,0.05);
}
.floating-chat-notifications {
    display: grid;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    background: rgba(255, 77, 79, 0.06);
    max-height: 168px;
    overflow: auto;
}
.floating-chat-notification-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
}
.floating-chat-notification-text {
    color: var(--text-main);
    font-size: 0.82rem;
    line-height: 1.35;
}
.floating-chat-notification-time {
    color: var(--text-soft);
    font-size: 0.72rem;
    margin-top: 2px;
}
.account-alert-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #ff4d4f;
    box-shadow: 0 0 0 rgba(255, 77, 79, 0.8);
    flex-shrink: 0;
    margin-top: 4px;
}
.blink-red {
    animation: redBlink 0.9s infinite;
}
@keyframes redBlink {
    0% { opacity: 1; box-shadow: 0 0 8px rgba(255, 77, 79, 0.95); }
    50% { opacity: 0.25; box-shadow: 0 0 18px rgba(255, 77, 79, 0.35); }
    100% { opacity: 1; box-shadow: 0 0 8px rgba(255, 77, 79, 0.95); }
}
.floating-chat-frame {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
}
.chat-embed-body {
    padding: 10px;
    min-height: 100vh;
}
.chat-embed-sidebar,
.chat-embed-panel {
    min-height: 0;
}
.social-feed {
    display: grid;
    gap: 16px;
    max-height: none;
    overflow: visible;
    padding-right: 0;
}
.social-post-card {
    border-radius: 22px;
    border: 1px solid var(--surface-border);
    background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.035));
    padding: 18px;
    text-align: left;
    box-shadow: 0 18px 34px rgba(0,0,0,0.16);
}
.social-post-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.social-avatar {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.16);
    flex-shrink: 0;
}
.social-emotion {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(86, 240, 169, 0.14);
    color: #a6ffd4;
    font-weight: 700;
    font-size: 0.82rem;
}
.social-post-text {
    margin: 0 0 14px;
    color: var(--text-main);
    line-height: 1.7;
    font-size: 0.98rem;
}
.social-media-wrap {
    margin-bottom: 12px;
}
.social-media-image,
.social-media-video {
    width: 100%;
    max-height: min(520px, 70vh);
    border-radius: 18px;
    object-fit: cover;
    display: block;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
}
.social-comments {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.social-comment-card {
    border-radius: 16px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.045);
    padding: 12px;
}
.social-comment-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}
.social-comment-avatar {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.social-comment-emotion {
    display: inline-flex;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(86, 240, 169, 0.12);
    color: #a6ffd4;
    font-size: 0.76rem;
    font-weight: 700;
}
.social-comment-text {
    color: var(--text-main);
    line-height: 1.6;
}
.social-comment-image,
.social-comment-video {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
}
.social-comment-form {
    border-top: 1px solid rgba(255,255,255,0.08);
    padding-top: 12px;
}
.social-comment-composer {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.social-comment-user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.12);
    flex-shrink: 0;
}
.social-comment-composer-body {
    flex: 1;
    min-width: 0;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 10px 12px;
}
.social-comment-input {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    min-height: 52px;
    resize: vertical;
}
.social-comment-input:focus {
    box-shadow: none !important;
}
.social-comment-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 10px;
}
.social-comment-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}
.social-comment-select {
    min-width: 118px;
    border-radius: 999px;
}
.social-comment-upload {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.05);
    color: var(--text-main);
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
}
.social-comment-upload input {
    display: none;
}
.social-comment-submit {
    border-radius: 999px;
    padding-inline: 1rem;
}
@keyframes tournamentTicker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}
@media (max-width: 992px) {
    body[data-background-type="image"] .site-background-image,
    body[data-background-type="video"] .site-background-video {
        opacity: 0.22;
    }
    .app-shell, .hero-grid, .stats-grid, .grid-2, .grid-3, .auth-card, .chat-layout { grid-template-columns: 1fr; }
    .mobile-nav-toggle {
        display: inline-flex;
        position: fixed;
        right: 12px;
        top: 12px;
        z-index: 40;
    }
    .mobile-nav-close { display: inline-flex; }
    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(320px, 86vw);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        padding-bottom: 14px;
    }
    body.nav-open .sidebar { transform: translateX(0); }
    .content-area { padding: 62px 10px 14px; }
    .page-card { padding: 14px; border-radius: 18px; }
    .page-topbar { padding: 12px 14px; border-radius: 18px; }
    .page-title { font-size: 1.4rem; }
    .header-feed-ticker { min-height: 34px; padding-inline: 10px; }
    .header-feed-marquee { gap: 14px; }
    .header-feed-track { padding: 7px 0; gap: 14px; }
    .header-feed-item { font-size: 0.76rem; }
    .brand-title { font-size: 1.15rem; }
    .brand-subtitle { font-size: 0.86rem; line-height: 1.45; }
    .page-hero-image-wrap { aspect-ratio: 16 / 5.4; }
    .chat-bubble { max-width: 92%; }
    .status-pill { width: 100%; }
    .user-badge { flex-direction: column; align-items: stretch; }
    .table { font-size: 0.86rem; }
    .floating-chat-panel {
        right: 12px;
        left: 12px;
        width: auto;
        bottom: 78px;
        height: min(72vh, 620px);
    }
    .floating-chat-button {
        right: 12px;
        bottom: 12px;
    }
    .hero-grid, .stats-grid, .grid-2, .grid-3 { gap: 12px; }
    .panel, .stat-card, .feature-card { padding: 14px; border-radius: 18px; }
    .hero-card { min-height: auto; }
    .hero-card h3 { font-size: 1.45rem; max-width: none; line-height: 1.25; }
    .hero-card p, .panel p, .feature-card p { font-size: 0.9rem; line-height: 1.55; }
    .stat-label { font-size: 0.78rem; }
    .stat-value { font-size: 1.45rem; }
    .btn { padding: 0.62rem 0.85rem; font-size: 0.92rem; }
    .form-control, .form-select { font-size: 0.92rem; padding: 0.58rem 0.72rem; }
    .form-label, .form-text { font-size: 0.84rem; }
    .table > :not(caption) > * > * { padding: 0.5rem 0.45rem; }
    .eyebrow { font-size: 0.68rem; padding: 4px 9px; margin-bottom: 8px; }
    .social-media-image,
    .social-media-video { max-height: 320px; }
    .social-comment-image,
    .social-comment-video { max-height: 180px; }
    .social-comment-toolbar { flex-direction: column; align-items: stretch; }
    .social-comment-submit { width: 100%; }
}

@media (max-width: 640px) {
    .site-background-orb-a {
        width: 56vw;
        height: 56vw;
        left: -14vw;
        top: 10vh;
    }
    .site-background-orb-b {
        width: 68vw;
        height: 68vw;
        right: -18vw;
        bottom: -10vh;
    }
    .content-area { padding-inline: 8px; }
    .page-card { padding: 12px; }
    .app-footer { padding: 8px 10px 14px; font-size: 0.82rem; }
    .auth-footer { font-size: 0.82rem; padding-inline: 2px; }
    .panel, .stat-card, .feature-card { padding: 12px; border-radius: 16px; }
    .brand-mark { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 12px; }
    .brand-logo-image { width: 44px; height: 44px; border-radius: 12px; margin-bottom: 12px; }
    .avatar-thumb { width: 40px; height: 40px; }
    .profile-photo-lg { width: 86px; height: 86px; border-radius: 18px; }
    .btn-primary, .btn-outline-light, .btn-light { width: 100%; }
    .table .btn,
    .user-badge .btn,
    .floating-chat-header .btn,
    .mobile-nav-toggle,
    .mobile-nav-close { width: auto; }
    .d-flex.flex-wrap.gap-2 > .btn { width: 100%; }
    .hero-card h3 { font-size: 1.25rem; }
    .hero-card p, .panel p, .feature-card p { font-size: 0.84rem; line-height: 1.5; }
    .page-title { font-size: 1.2rem; }
    .header-feed-ticker { margin-top: 8px; min-height: 32px; padding: 8px 10px; border-radius: 16px; }
    .header-feed-track {
        gap: 8px;
        padding: 0;
        white-space: normal;
        flex-wrap: wrap;
    }
    .header-feed-marquee {
        display: flex;
        width: 100%;
        min-width: 0;
        gap: 0;
        animation: none;
    }
    .header-feed-track-duplicate { display: none; }
    .header-feed-item { font-size: 0.72rem; }
    .header-feed-item::before { width: 6px; height: 6px; }
    .stat-label { font-size: 0.74rem; }
    .stat-value { font-size: 1.22rem; }
    .mobile-nav-toggle,
    .mobile-nav-close { padding: 7px 10px; border-radius: 10px; font-size: 0.84rem; }
    .sidebar { width: min(265px, 82vw); padding: 18px 14px; }
    .app-nav-link { padding: 9px 10px; font-size: 0.86rem; border-radius: 12px; }
    .user-badge { padding: 10px; border-radius: 14px; gap: 10px; }
    .user-badge-main { gap: 10px; }
    .user-badge-name { font-size: 0.96rem; white-space: normal; }
    .user-logout-btn { min-width: 76px; padding: 0.5rem 0.75rem; }
    .table { font-size: 0.76rem; }
    .table > :not(caption) > * > * { padding: 0.42rem 0.34rem; }
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .form-control, .form-select { font-size: 0.86rem; padding: 0.54rem 0.66rem; }
    .form-label, .form-text { font-size: 0.78rem; }
    .btn { padding: 0.58rem 0.76rem; font-size: 0.86rem; }
    .page-hero-image-wrap { border-radius: 18px; }
    .page-hero-image-wrap { aspect-ratio: 16 / 6; }
    .floating-chat-button { padding: 10px 13px; font-size: 0.86rem; }
    .floating-chat-header { padding: 10px 12px; }
    .floating-chat-notifications { padding: 8px 10px; max-height: 140px; }
    .floating-chat-notification-item { padding: 7px 9px; }
    .floating-chat-notification-text { font-size: 0.76rem; }
    .floating-chat-notification-time { font-size: 0.68rem; }
    .floating-chat-panel {
        right: 10px;
        left: 10px;
        bottom: 68px;
        height: min(64vh, 520px);
        border-radius: 16px;
    }
    .theme-picker {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        border-radius: 14px;
    }
    .theme-picker .form-select { min-width: 100%; }
    .page-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px;
    }
    .page-topbar-meta {
        flex: 0 0 auto;
    }
    .page-topbar-tools {
        width: 100%;
        justify-content: stretch;
        flex: 0 0 auto;
    }
    .status-pill,
    .theme-picker {
        width: 100%;
    }
    .table-responsive {
        overflow-x: auto;
        margin-inline: -2px;
    }
    .table td,
    .table th {
        white-space: nowrap;
    }
    .table td:first-child,
    .table th:first-child {
        white-space: normal;
        min-width: 110px;
    }
    .mini-kpi { padding: 6px 10px; font-size: 0.78rem; }
    .social-post-card { padding: 12px; border-radius: 16px; }
    .social-post-head { flex-direction: column; align-items: flex-start; }
    .social-avatar { width: 44px; height: 44px; border-radius: 14px; }
    .social-comment-avatar { width: 28px; height: 28px; border-radius: 9px; }
    .social-media-image,
    .social-media-video { max-height: 240px; border-radius: 14px; }
    .social-comment-card { padding: 10px; border-radius: 14px; }
    .social-comment-head { flex-direction: column; align-items: flex-start; }
    .social-comment-composer-body { border-radius: 16px; padding: 9px 10px; }
    .social-comment-user-avatar { width: 34px; height: 34px; }
}

@media (max-width: 420px) {
    body[data-background-type="image"] .site-background-image,
    body[data-background-type="video"] .site-background-video {
        opacity: 0.18;
    }
    .content-area { padding: 60px 6px 12px; }
    .page-card { padding: 10px; border-radius: 16px; }
    .panel, .stat-card, .feature-card { padding: 10px; border-radius: 14px; }
    .page-title { font-size: 1.08rem; }
    .header-feed-ticker { min-height: 30px; padding-inline: 8px; }
    .header-feed-ticker { padding: 7px 8px; }
    .header-feed-track { gap: 7px; padding: 0; }
    .header-feed-item { font-size: 0.66rem; }
    .header-feed-item::before { width: 5px; height: 5px; }
    .hero-card h3 { font-size: 1.08rem; }
    .hero-card p, .panel p, .feature-card p { font-size: 0.78rem; }
    .stat-value { font-size: 1.08rem; }
    .table { font-size: 0.7rem; }
    .table > :not(caption) > * > * { padding: 0.38rem 0.28rem; }
    .brand-title { font-size: 1rem; }
    .brand-subtitle { font-size: 0.76rem; line-height: 1.35; }
    .status-pill { padding: 7px 8px; font-size: 0.76rem; border-radius: 12px; }
    .eyebrow { font-size: 0.62rem; padding: 4px 8px; }
    .sidebar { width: min(248px, 80vw); padding: 16px 12px; }
    .app-nav-link { font-size: 0.82rem; padding: 8px 9px; }
    .btn { font-size: 0.82rem; }
    .form-control, .form-select { font-size: 0.82rem; }
    .content-area { padding-left: 4px; padding-right: 4px; }
    .page-card { padding: 8px; border-radius: 14px; }
    .page-topbar { padding: 10px; border-radius: 14px; }
    .page-topbar-meta,
    .page-topbar-tools { flex: 0 0 auto; }
    .page-hero-image-wrap { border-radius: 14px; }
    .page-hero-image-wrap { aspect-ratio: 16 / 6.6; }
    .table td:first-child,
    .table th:first-child { min-width: 96px; }
    .user-badge { align-items: flex-start; }
    .user-logout-btn { min-width: 70px; padding: 0.46rem 0.68rem; border-radius: 12px; }
    .floating-chat-button {
        right: 10px;
        bottom: 10px;
        padding: 9px 12px;
        font-size: 0.8rem;
    }
    .floating-chat-badge { min-width: 18px; height: 18px; font-size: 0.66rem; }
    .floating-chat-panel { left: 8px; right: 8px; bottom: 60px; }
    .social-post-text { font-size: 0.82rem; }
}
