/* ====================================================
   DCL Dual Modern Themes: Cyber Tactical HUD & Midnight Apex
   ==================================================== */

:root,
:root[data-theme="dark"],
:root[data-theme="light"] {
    color-scheme: dark;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ----------------------------------------------------
   THEME 1: Cyber Tactical HUD (Neon Tactical)
   ---------------------------------------------------- */
:root[data-theme-palette="cyber-hud"] {

    --bg-primary: #04060a;
    --bg-secondary: #080c14;
    --bg-card: rgba(14, 20, 32, 0.85);
    --bg-card-hover: rgba(22, 32, 48, 0.92);
    --bg-header: rgba(4, 6, 10, 0.92);
    --bg-input: rgba(14, 20, 32, 0.92);
    --bg-tertiary: #121826;
    --bg-hover: rgba(204, 255, 0, 0.06);

    --accent-primary: #ccff00;
    --accent-secondary: #00f0ff;
    --accent-primary-rgb: 204, 255, 0;
    --accent-secondary-rgb: 0, 240, 255;
    --accent-glow: rgba(204, 255, 0, 0.38);
    --accent-glow-strong: rgba(204, 255, 0, 0.65);
    --accent-soft: rgba(204, 255, 0, 0.1);
    --accent-soft-strong: rgba(204, 255, 0, 0.18);
    --accent-border-soft: rgba(204, 255, 0, 0.25);
    --accent-border-strong: rgba(204, 255, 0, 0.48);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-tertiary: #475569;

    --cyan: #00f0ff;
    --green: #ccff00;
    --green-bg: rgba(204, 255, 0, 0.14);
    --red: #ff0055;
    --red-bg: rgba(255, 0, 85, 0.15);
    --blue: #00f0ff;
    --blue-bg: rgba(0, 240, 255, 0.14);
    --yellow: #ccff00;
    --yellow-bg: rgba(204, 255, 0, 0.14);
    --purple: #8b5cf6;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.14);

    --theme-page-gradient: radial-gradient(circle at 12% 5%, rgba(204, 255, 0, 0.06), transparent 28%),
                           radial-gradient(circle at 88% 12%, rgba(0, 240, 255, 0.06), transparent 30%),
                           radial-gradient(circle at 50% 90%, rgba(204, 255, 0, 0.04), transparent 45%),
                           #04060a;
    --theme-surface-fill: rgba(14, 20, 32, 0.85);
    --theme-surface-border: rgba(255, 255, 255, 0.08);
    --theme-surface-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.06);

    --theme-home-cup-bg: linear-gradient(135deg, rgba(204, 255, 0, 0.14), rgba(0, 240, 255, 0.08));
    --theme-home-cup-border: rgba(204, 255, 0, 0.32);
    --theme-home-badges-bg: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(59, 130, 246, 0.08));
    --theme-home-badges-border: rgba(0, 240, 255, 0.30);
    --theme-home-info-bg: linear-gradient(135deg, rgba(204, 255, 0, 0.12), rgba(0, 240, 255, 0.08));
    --theme-home-info-border: rgba(204, 255, 0, 0.25);

    --theme-chip-bg: rgba(255, 255, 255, 0.06);
    --theme-chip-border: rgba(255, 255, 255, 0.12);
    --theme-chip-active-bg: linear-gradient(135deg, #ccff00, #00f0ff);
    --theme-chip-active-shadow: 0 8px 20px rgba(204, 255, 0, 0.35);

    --theme-topbar-fill: rgba(4, 6, 10, 0.90);
    --theme-topbar-border: rgba(255, 255, 255, 0.08);
    --theme-topbar-blur: 20px;

    --theme-surface-text-primary: var(--text-primary);
    --theme-surface-text-secondary: var(--text-secondary);
    --theme-surface-text-muted: var(--text-muted);
    --theme-surface-accent: var(--accent-primary);
    --theme-surface-subtle-bg: var(--bg-secondary);
    --theme-surface-subtle-bg-alt: rgba(255, 255, 255, 0.04);
    --theme-surface-subtle-border: var(--border-subtle);

    --theme-active-gradient-end: var(--accent-secondary);
    --theme-active-shadow: rgba(0, 240, 255, 0.35);
    --theme-focus-ring: rgba(204, 255, 0, 0.9);
    --theme-focus-halo: rgba(204, 255, 0, 0.22);
}

/* ----------------------------------------------------
   THEME 2 (Default): Midnight Apex (Premium Dark & Gold)
   ---------------------------------------------------- */
:root,


:root[data-theme-palette="midnight-apex"],
:root:not([data-theme-palette="cyber-hud"]) {

    --bg-primary: #090d16;
    --bg-secondary: #0d1322;
    --bg-card: rgba(17, 24, 39, 0.82);
    --bg-card-hover: rgba(26, 36, 56, 0.92);
    --bg-header: rgba(9, 13, 22, 0.90);
    --bg-input: rgba(13, 19, 34, 0.90);
    --bg-tertiary: #161e31;
    --bg-hover: rgba(245, 158, 11, 0.06);

    --accent-primary: #f59e0b;
    --accent-secondary: #f97316;
    --accent-primary-rgb: 245, 158, 11;
    --accent-secondary-rgb: 249, 115, 22;
    --accent-glow: rgba(245, 158, 11, 0.35);
    --accent-glow-strong: rgba(245, 158, 11, 0.55);
    --accent-soft: rgba(245, 158, 11, 0.1);
    --accent-soft-strong: rgba(245, 158, 11, 0.18);
    --accent-border-soft: rgba(245, 158, 11, 0.22);
    --accent-border-strong: rgba(245, 158, 11, 0.45);

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-tertiary: #7888a2;

    --cyan: #06b6d4;
    --green: #10b981;
    --green-bg: rgba(16, 185, 129, 0.14);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.14);
    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.14);
    --yellow: #f59e0b;
    --yellow-bg: rgba(245, 158, 11, 0.14);

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.14);

    --theme-page-gradient: radial-gradient(circle at 12% 4%, rgba(245, 158, 11, 0.08), transparent 28%),
                           radial-gradient(circle at 88% 12%, rgba(6, 182, 212, 0.07), transparent 30%),
                           radial-gradient(circle at 50% 92%, rgba(16, 185, 129, 0.05), transparent 40%),
                           #090d16;
    --theme-surface-fill: rgba(17, 24, 39, 0.82);
    --theme-surface-border: rgba(255, 255, 255, 0.09);
    --theme-surface-shadow: 0 16px 36px -4px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);

    --theme-home-cup-bg: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(249, 115, 22, 0.09));
    --theme-home-cup-border: rgba(245, 158, 11, 0.32);
    --theme-home-badges-bg: linear-gradient(135deg, rgba(6, 182, 212, 0.16), rgba(59, 130, 246, 0.09));
    --theme-home-badges-border: rgba(6, 182, 212, 0.30);
    --theme-home-info-bg: linear-gradient(135deg, rgba(16, 185, 129, 0.16), rgba(6, 182, 212, 0.09));
    --theme-home-info-border: rgba(16, 185, 129, 0.28);

    --theme-chip-bg: rgba(255, 255, 255, 0.06);
    --theme-chip-border: rgba(255, 255, 255, 0.12);
    --theme-chip-active-bg: linear-gradient(135deg, #f59e0b, #f97316);
    --theme-chip-active-shadow: 0 8px 20px rgba(245, 158, 11, 0.38);

    --theme-topbar-fill: rgba(9, 13, 22, 0.88);
    --theme-topbar-border: rgba(255, 255, 255, 0.08);
    --theme-topbar-blur: 20px;

    --theme-surface-text-primary: var(--text-primary);
    --theme-surface-text-secondary: var(--text-secondary);
    --theme-surface-text-muted: var(--text-muted);
    --theme-surface-accent: var(--accent-primary);
    --theme-surface-subtle-bg: var(--bg-secondary);
    --theme-surface-subtle-bg-alt: rgba(255, 255, 255, 0.04);
    --theme-surface-subtle-border: var(--border-subtle);

    --theme-active-gradient-end: var(--accent-secondary);
    --theme-active-shadow: rgba(249, 115, 22, 0.38);
    --theme-focus-ring: rgba(245, 158, 11, 0.95);
    --theme-focus-halo: rgba(245, 158, 11, 0.22);
}

#home-theme-wrap {
    display: inline-flex !important;
    position: relative;
}

#home-theme-popover {
    background: rgba(10, 15, 26, 0.95) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid var(--border-light) !important;
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7) !important;
    border-radius: 16px !important;
    width: 290px !important;
    padding: 16px !important;
}

.home-theme-popover-section:first-of-type,
.theme-mode-group {
    display: none !important;
}

.home-theme-palette-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

.theme-palette-card {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 10px 14px !important;
    border-radius: 12px !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
}

.theme-palette-card:hover {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: var(--accent-primary) !important;
    transform: translateY(-1px) !important;
}

.theme-palette-card.active {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 16px var(--accent-glow) !important;
}

.theme-palette-swatches {
    display: flex !important;
    gap: 4px !important;
}

.theme-palette-swatch {
    width: 14px !important;
    height: 14px !important;
    border-radius: 50% !important;
    background: var(--swatch) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.theme-palette-copy strong {
    font-size: 13px !important;
    color: var(--text-primary) !important;
    display: block !important;
}

.theme-palette-copy small {
    font-size: 11px !important;
    color: var(--text-secondary) !important;
    display: block !important;
}

.glass-card {
    background: var(--theme-surface-fill) !important;
    backdrop-filter: blur(18px) !important;
    -webkit-backdrop-filter: blur(18px) !important;
    border: 1px solid var(--theme-surface-border) !important;
    box-shadow: var(--theme-surface-shadow) !important;
}

.tab-nav {
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    background: var(--bg-header) !important;
    border-bottom: 1px solid var(--border-subtle) !important;
}

.tab-btn.active {
    color: var(--accent-primary) !important;
    text-shadow: 0 0 12px var(--accent-glow) !important;
}

.home-theme-btn {
    border: 1px solid var(--border-light) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: var(--accent-primary) !important;
    border-radius: 10px !important;
    padding: 7px !important;
    transition: all 0.2s ease !important;
}

.home-theme-btn:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 12px var(--accent-glow) !important;
}

html.theme-transition *,
html.theme-transition *::before,
html.theme-transition *::after {
    transition: background-color 0.32s ease, color 0.26s ease, border-color 0.28s ease, box-shadow 0.32s ease, fill 0.26s ease, stroke 0.26s ease !important;
}

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: clamp(13px, 3.6vw, 16px);
    -webkit-tap-highlight-color: transparent;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    background-image: var(--theme-page-gradient);
    background-attachment: fixed;
    color: var(--theme-surface-text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-user-select: none;
    user-select: none;
}

html.ui-overlay-open,
body.ui-overlay-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.ui-overlay-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
}

input,
textarea,
[contenteditable] {
    -webkit-user-select: text;
    user-select: text;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 0%, var(--theme-bg-orb-1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, var(--theme-bg-orb-2) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, var(--theme-bg-orb-3) 0%, transparent 50%);
    opacity: var(--theme-page-orb-opacity);
    pointer-events: none;
    z-index: 0;
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background: var(--theme-page-overlay);
    opacity: min(var(--theme-page-overlay-opacity), var(--theme-page-overlay-max-opacity));
    mix-blend-mode: normal;
    pointer-events: none;
    z-index: 0;
}

:root[data-theme="light"] body::before {
    background:
        radial-gradient(ellipse at 18% 0%, var(--theme-bg-light-orb-1) 0%, transparent 48%),
        radial-gradient(ellipse at 86% 8%, var(--theme-bg-light-orb-2) 0%, transparent 46%),
        radial-gradient(ellipse at 40% 100%, var(--theme-bg-light-orb-3) 0%, transparent 50%);
}

:root[data-theme="light"] .glass-card {
    backdrop-filter: blur(min(var(--theme-surface-blur), var(--theme-surface-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(var(--theme-surface-blur), var(--theme-surface-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    box-shadow: var(--theme-surface-shadow);
}

:root[data-theme="light"] .header-btn:hover,
:root[data-theme="light"] .header-btn:active {
    background: rgba(31, 56, 108, 0.08);
}

:root[data-theme="light"] .sync-indicator {
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 22px rgba(25, 45, 85, 0.14);
}

/* ============================================
   Splash Screen
   ============================================ */
.splash-screen {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.splash-content {
    text-align: center;
    padding: 0 32px;
}

.splash-logo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--theme-splash-ring);
    box-shadow: 0 0 30px var(--theme-splash-shadow), 0 0 60px var(--theme-splash-shadow-alt);

    margin-bottom: 16px;
}

@keyframes splashBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-8px) scale(1.03);
    }
}

.splash-title {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 12px;
}

.splash-quote {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-tertiary);
    font-style: italic;
    font-weight: 500;
    max-width: 280px;
    margin: 0 auto 24px;
    min-height: 42px;
    animation: fadeInQuote 0.8s ease forwards;
}

:root[data-theme="light"] .splash-quote {
    font-weight: 700;
}

@keyframes fadeInQuote {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.splash-loader {
    width: 160px;
    height: 3px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
    margin: 0 auto;
}

.splash-loader::after {
    content: '';
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-primary));
    border-radius: 4px;
    transform-origin: left;
    animation: splashLoad 5s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

@keyframes splashLoad {
    0% {
        transform: scaleX(0);
    }

    100% {
        transform: scaleX(1);
    }
}

/* ============================================
   App Container
   ============================================ */
.app {
    position: relative;
    z-index: 1;
    width: min(100vw, 480px);
    max-width: 480px;
    margin: 0 auto;
    min-height: 100vh;
    min-height: 100dvh;
}

.app.hidden {
    display: none;
}

/* ============================================
   Header
   ============================================ */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-header);
    border-bottom: 1px solid var(--border-subtle);
    padding-top: var(--safe-top);
    will-change: transform;
}

.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    gap: 12px;
}

.header-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.header-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.05);
}

.header-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

#btn-refresh.spinning svg {
    animation: spin 0.8s linear;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 2px;
}

.header-actions {
    display: flex;
    gap: 4px;
}

/* ============================================
   Tab Navigation
   ============================================ */
.tab-nav {
    position: sticky;
    top: 65px;
    z-index: 99;
    background: var(--bg-header);
    padding: 0 16px;
    border-bottom: 1px solid var(--border-subtle);
    will-change: transform;
}

.tab-nav-inner {
    display: flex;
    justify-content: space-around;
    position: relative;
}

.tab-btn {
    flex: 1;
    padding: 14px 8px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    position: relative;
}

.tab-btn.active {
    color: var(--accent-primary);
}

.tab-btn:active {
    transform: scale(0.9);
}

.tab-indicator {
    position: absolute;
    bottom: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 3px 3px 0 0;
    transition: all var(--transition-slow);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* ============================================
   Content Area
   ============================================ */
.content {
    padding: 16px;
    padding-bottom: calc(32px + var(--safe-bottom));
}

.content.hidden {
    display: none;
}

.tab-content {
    animation: fadeSlideIn 0.35s ease;
}

.league-tab-toolbar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
    padding: 0 2px;
}

.league-shot-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.22);
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 255, 165, 0), 0.12), rgba(var(--accent-primary-rgb, 255, 165, 0), 0.05));
    color: var(--accent-primary);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
    transition: transform var(--transition-fast), border-color var(--transition-normal), background var(--transition-normal), box-shadow var(--transition-normal), opacity var(--transition-fast);
}

.league-shot-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: currentColor;
}

.league-shot-btn:hover {
    border-color: rgba(var(--accent-primary-rgb, 255, 165, 0), 0.42);
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 255, 165, 0), 0.18), rgba(var(--accent-primary-rgb, 255, 165, 0), 0.08));
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.league-shot-btn:active {
    transform: scale(0.96);
}

.league-shot-btn-pill {
    min-width: 134px;
    height: 38px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.league-shot-btn-pill span {
    line-height: 1;
}

.league-shot-btn.is-loading {
    pointer-events: none;
    color: transparent;
}

.league-shot-btn.is-loading svg,
.league-shot-btn.is-loading span {
    opacity: 0;
}

.league-shot-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.22);
    border-top-color: var(--accent-primary);
    animation: profileShotSpin 0.8s linear infinite;
}

.league-shot-capture,
.league-shot-capture * {
    animation: none !important;
    transition: none !important;
    animation-delay: 0s !important;
    animation-duration: 0s !important;
}

.league-shot-capture * {
    opacity: 1 !important;
    transform: none !important;
}

.screenshot-theme-dark {
    color-scheme: dark !important;
}

.screenshot-theme-light {
    color-scheme: light !important;
}

.league-shot-sheet {
    padding: 20px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background-color: var(--screenshot-canvas-bg);
    background: linear-gradient(180deg, var(--screenshot-sheet-top), var(--screenshot-sheet-bottom));
    border: 1px solid var(--screenshot-sheet-border);
    box-shadow: 0 18px 48px var(--screenshot-sheet-shadow);
}

.league-shot-sheet::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: var(--screenshot-orb-opacity);
    background:
        radial-gradient(circle at 14% -2%, var(--screenshot-orb-1), transparent 42%),
        radial-gradient(circle at 88% 8%, var(--screenshot-orb-2), transparent 38%),
        radial-gradient(circle at 46% 104%, var(--screenshot-orb-3), transparent 44%),
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12), transparent 30%),
        radial-gradient(circle at bottom left, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.1), transparent 34%);
}

.screenshot-theme-light .league-shot-sheet::before {
    background:
        radial-gradient(circle at 14% -2%, var(--screenshot-orb-1), transparent 46%),
        radial-gradient(circle at 88% 8%, var(--screenshot-orb-2), transparent 42%),
        radial-gradient(circle at 46% 104%, var(--screenshot-orb-3), transparent 48%);
}

.league-shot-sheet > * {
    position: relative;
    z-index: 1;
}

.league-shot-sheet-head {
    margin-bottom: 16px;
}

.league-shot-sheet-brand {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--screenshot-brand-color);
    margin-bottom: 8px;
}

.league-shot-sheet-title {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.league-shot-sheet-meta {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.league-shot-sheet-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.league-shot-sheet-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--screenshot-badge-bg);
    border: 1px solid var(--screenshot-badge-border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
}

.league-shot-sheet-body {
    display: block;
}

.league-shot-pane {
    width: 100%;
}

.league-shot-capture .standings-table,
.league-shot-capture .glass-card,
.league-shot-capture .league-shot-pane,
.league-shot-capture .season-standings-table,
.league-shot-capture .season-scores-content,
.league-shot-capture .history-absent-block,
.league-shot-capture .season-babak-group,
.league-shot-capture .cup-shot-pane {
    overflow: visible !important;
    background: var(--screenshot-surface-fill) !important;
    border: 1px solid var(--screenshot-surface-border) !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

.league-shot-capture .standings-table::before,
.league-shot-capture .standings-table::after,
.league-shot-capture .glass-card::before,
.league-shot-capture .glass-card::after,
.league-shot-capture .league-shot-pane::before,
.league-shot-capture .league-shot-pane::after,
.league-shot-capture .season-standings-table::before,
.league-shot-capture .season-standings-table::after,
.league-shot-capture .season-scores-content::before,
.league-shot-capture .season-scores-content::after,
.league-shot-capture .history-absent-block::before,
.league-shot-capture .history-absent-block::after,
.league-shot-capture .season-babak-group::before,
.league-shot-capture .season-babak-group::after,
.league-shot-capture .cup-shot-pane::before,
.league-shot-capture .cup-shot-pane::after {
    content: none !important;
    display: none !important;
    background: none !important;
}

.league-shot-capture .table-header,
.league-shot-capture .table-row {
    padding-left: calc(clamp(8px, 2.5vw, 14px) + 6px);
    background: var(--screenshot-row-fill) !important;
    backdrop-filter: none !important;
}

.league-shot-capture .table-header,
.league-shot-capture .season-babak-title,
.league-shot-capture .history-absent-toggle {
    background: var(--screenshot-row-fill-strong) !important;
}

.league-shot-capture .season-match-item,
.league-shot-capture .history-absent-empty,
.league-shot-capture .history-absent-list {
    background: var(--screenshot-row-fill) !important;
}

.league-shot-capture .league-shot-sheet-badge {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
        var(--screenshot-badge-bg) !important;
}

.screenshot-theme-light .league-shot-capture .league-shot-sheet-badge {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 250, 255, 0.56)),
        var(--screenshot-badge-bg) !important;
}

.league-shot-capture .team-cell {
    gap: 6px;
    padding-left: 5px;
    overflow: visible !important;
}

.league-shot-capture .team-shield,
.league-shot-capture .team-shield svg {
    overflow: visible !important;
}

.league-shot-capture .team-name {
    padding-left: 1px;
}

.history-shot-sheet {
    max-width: none;
}

.history-shot-sheet-body {
    display: block;
}

.history-shot-card {
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: none;
    overflow: visible;
}

.history-shot-card .season-standings-table,
.history-shot-card .season-scores-content,
.history-shot-card .history-absent-block {
    overflow: visible !important;
}

.history-shot-card .season-standings-table table {
    min-width: 780px;
    table-layout: auto;
    font-size: 13px;
}

.history-shot-card .season-standings-table th,
.history-shot-card .season-standings-table td {
    padding: 8px 10px;
}

.history-shot-card .season-standings-table th:nth-child(2),
.history-shot-card .season-standings-table td:nth-child(2) {
    width: auto;
    min-width: 150px;
}

.history-shot-card details {
    overflow: visible;
}

.tab-content.hidden {
    display: none;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   Glass Card
   ============================================ */
.glass-card {
    background: var(--theme-surface-fill);
    border: 1px solid var(--theme-surface-border);
    border-radius: var(--theme-surface-radius);
    box-shadow: var(--theme-surface-shadow);
    backdrop-filter: blur(min(var(--theme-surface-blur), var(--theme-surface-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(var(--theme-surface-blur), var(--theme-surface-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    overflow: hidden;
    color: var(--theme-surface-text-primary);
}

/* ============================================
   Info Tab
   ============================================ */
.info-card {
    padding: 20px;
    margin-bottom: 16px;
}

.info-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.info-icon {
    font-size: 28px;
}

.info-season {
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 2px;
}

.section-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-glow);
    width: 100%;
    justify-content: center;
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-primary:hover {
    box-shadow: 0 0 30px var(--accent-glow-strong);
}

/* ============================================
   Players Tab
   ============================================ */
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    color: var(--text-muted);
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-muted);
}

.players-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.roster-lock-banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.12), rgba(245, 158, 11, 0.08));
    border: 1px solid rgba(234, 179, 8, 0.25);
    border-radius: var(--radius-md);
    animation: fadeSlideIn 0.3s ease;
}

.roster-lock-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 1px;
}

.roster-lock-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 13px;
    line-height: 1.4;
}

.roster-lock-text strong {
    color: var(--text-primary);
    font-size: 13.5px;
}

.roster-lock-text span {
    color: var(--text-secondary);
    font-size: 12px;
}

.player-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    animation: fadeSlideIn 0.3s ease;
    animation-fill-mode: both;
}

.player-card:active {
    transform: scale(0.98);
    background: var(--bg-card-hover);
}

.player-avatar {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    color: #fff;
    flex-shrink: 0;
    position: relative;
}

.player-avatar::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    opacity: 0.3;
    z-index: -1;
}

.player-info {
    flex: 1;
    min-width: 0;
}

.player-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   Klasemen Tab
   ============================================ */

.standings-table {
    margin-bottom: 16px;
}

.table-header {
    display: flex;
    align-items: center;
    padding: 10px clamp(8px, 2.5vw, 14px);
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--border-subtle);
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.col-rank {
    width: clamp(26px, 8vw, 36px);
    text-align: center;
    flex-shrink: 0;
}

.col-name {
    flex: 1;
    min-width: 0;
    padding-left: 4px;
}

.col-stat {
    width: clamp(18px, 5.5vw, 24px);
    text-align: center;
    flex-shrink: 0;
}

.col-gd {
    width: clamp(24px, 7vw, 32px);
}

.col-pts {
    width: clamp(28px, 8vw, 36px);
    color: var(--accent-primary);
}

.table-row {
    display: flex;
    align-items: center;
    padding: 8px clamp(8px, 2.5vw, 14px);
    border-bottom: 1px solid var(--border-subtle);
    transition: background var(--transition-fast);
    animation: fadeSlideIn 0.3s ease;
    animation-fill-mode: both;
    position: relative;
}

.table-row:last-child {
    border-bottom: none;
}

.table-row:active {
    background: rgba(255, 255, 255, 0.03);
}

.rank-badge {
    width: clamp(20px, 5.5vw, 24px);
    height: clamp(20px, 5.5vw, 24px);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: clamp(9px, 2.8vw, 11px);
    margin: 0 auto;
}

.rank-default {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
    padding-left: 2px;
    overflow: hidden;
}

.team-shield {
    width: clamp(18px, 5vw, 22px);
    height: clamp(18px, 5vw, 22px);
    flex-shrink: 0;
}

.team-shield svg {
    width: 100%;
    height: 100%;
}

.team-name {
    font-weight: 500;
    font-size: clamp(11px, 3.2vw, 13px);
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
}

@media (max-width: 360px) {
    .table-row {
        padding: 6px 6px;
    }

    .table-header {
        padding: 8px 6px;
        font-size: 10px;
    }

    .team-name {
        font-size: 10.5px;
    }

    .stat-cell {
        width: 16px;
        font-size: 9.5px;
    }

    .stat-cell.gd-cell {
        width: 22px;
        font-size: 9px;
    }

    .stat-cell.pts-cell {
        width: 24px;
        font-size: 10.5px;
    }

    .col-rank {
        width: 24px;
    }

    .col-stat {
        width: 16px;
    }

    .col-gd {
        width: 22px;
    }

    .col-pts {
        width: 24px;
    }

    .rank-badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    .team-shield {
        width: 16px;
        height: 16px;
    }

    .team-cell {
        gap: 3px;
    }
}

.stat-cell {
    width: clamp(18px, 5.5vw, 24px);
    text-align: center;
    font-size: clamp(10px, 2.8vw, 11px);
    color: var(--text-secondary);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.stat-cell.gd-cell {
    width: clamp(24px, 7vw, 32px);
    font-size: clamp(9px, 2.5vw, 10px);
}

.stat-cell.pts-cell {
    width: clamp(28px, 8vw, 36px);
    font-weight: 700;
    color: var(--text-primary);
    font-size: clamp(11px, 3vw, 13px);
}

.stat-cell.dif-positive {
    color: var(--green);
}

.stat-cell.dif-negative {
    color: var(--red);
}

/* ============================================
   Winner Section
   ============================================ */

@keyframes floatWinner {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

/* ============================================
   Jadwal Tab
   ============================================ */

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

.match-card {
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    animation: fadeSlideIn 0.3s ease;
    animation-fill-mode: both;
}

.match-date {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.match-team {
    flex: 1;
    text-align: center;
}

.match-team-name {
    font-weight: 500;
    font-size: 13px;
    margin-top: 6px;
}

.match-team-shield {
    width: 36px;
    height: 36px;
    margin: 0 auto;
}

.jadwal-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.jadwal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.match-score {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.match-score-num {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 24px;
    min-width: 28px;
    text-align: center;
}

.match-score-sep {
    color: var(--text-muted);
    font-size: 18px;
}

.match-status {
    font-size: 11px;
    margin-top: 8px;
    text-align: center;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
}

.match-status.played {
    background: var(--green-bg);
    color: var(--green);
}

.match-status.upcoming {
    background: var(--blue-bg);
    color: var(--blue);
}

/* ============================================
   Statistik Tab
   ============================================ */
.stat-card {
    padding: 20px;
    margin-bottom: 16px;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    animation: fadeSlideIn 0.3s ease;
    animation-fill-mode: both;
}

.stat-rank {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.stat-rank.gold {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #000;
}

.stat-item-name {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stat-item-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--accent-primary);
    flex-shrink: 0;
}

/* ============================================
   Cup / Tournament Bracket
   ============================================ */

.cup-setup {
    padding: 24px;
    text-align: center;
}

.cup-setup-title {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.cup-setup-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 20px;
}

.cup-participants-input {
    width: 100%;
    min-height: 120px;
    padding: 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    resize: vertical;
    line-height: 1.8;
    transition: border-color var(--transition-fast);
}

.cup-participants-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.cup-participants-input::placeholder {
    color: var(--text-muted);
}

.cup-btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 0 24px var(--accent-glow);
    flex: 1;
}

.cup-btn-generate:active {
    transform: scale(0.96);
}

.cup-setup-buttons {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.cup-btn-manual {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    flex: 1;
}

.cup-btn-manual:active {
    transform: scale(0.96);
    background: var(--bg-tertiary);
}

.manual-list {
    margin: 16px 0 12px;
}

.manual-pair-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-primary);
    padding: 8px 0 4px;
    margin-top: 4px;
}

.manual-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 4px;
    transition: background 0.15s;
}

.manual-item.bye {
    opacity: 0.4;
    font-style: italic;
}

.manual-num {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.manual-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.manual-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.manual-move-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.manual-move-btn:active {
    background: var(--accent-primary);
    color: #000;
    transform: scale(0.9);
}

.manual-pair-divider {
    height: 6px;
}

.cup-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    margin-bottom: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}

.cup-header-main {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.cup-header-bar h3 {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.cup-header-meta {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.cup-header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.cup-shot-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    gap: 0;
}

.cup-btn-reset {
    padding: 6px 14px;
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.cup-btn-reset.cup-btn-icon {
    width: 40px;
    min-width: 40px;
    height: 40px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cup-btn-reset:active {
    transform: scale(0.95);
    background: rgba(239, 68, 68, 0.2);
}

.cup-btn-reset:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.bracket-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 20px;
    margin: 0 -16px;
    padding-left: 16px;
    padding-right: 16px;
}

.bracket {
    display: flex;
    align-items: stretch;
    min-width: fit-content;
    gap: 0;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    min-width: 135px;
}

.bracket-round-title {
    text-align: center;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent-primary);
    margin-bottom: 12px;
    padding: 5px 8px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: 4px;
}

.bracket-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    flex: 1;
    gap: 0;
}

.bracket-game {
    margin: 4px 0;
    border-radius: 6px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.bracket-game:hover {
    border-color: var(--accent-primary);
    transform: scale(1.03);
    z-index: 2;
    box-shadow: 0 0 12px var(--accent-glow);
}

.bracket-game.completed {
    border-color: rgba(34, 197, 94, 0.25);
}

.bracket-game.bye-game {
    opacity: 0.4;
    pointer-events: none;
}

.bracket-team {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    font-size: 11px;
    gap: 6px;
    min-height: 26px;
}

.bracket-team+.bracket-team {
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bracket-team .b-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-muted);
    font-size: 11px;
}

.bracket-team.has-name .b-name {
    color: var(--text-secondary);
}

.bracket-team.winner .b-name {
    color: var(--text-primary);
    font-weight: 600;
}

.bracket-team .b-score {
    font-weight: 700;
    min-width: 16px;
    text-align: center;
    font-size: 12px;
    font-family: var(--font-display);
    color: var(--text-muted);
}

.bracket-team.winner .b-score {
    color: var(--accent-primary);
}

.bracket-team.winner {
    background: rgba(245, 158, 11, 0.08);
}

.bracket-conn {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    flex-shrink: 0;
    align-self: stretch;
}

.bracket-conn-pair {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bracket-conn-pair::before {
    content: '';
    position: absolute;
    top: 25%;
    bottom: 25%;
    left: 0;
    width: 14px;
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-left: none;
    border-radius: 0 6px 6px 0;
}

.bracket-conn-pair::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 14px;
    right: 0;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.08);
}

.champion-celebration {
    margin-top: 20px;
    padding: 28px 20px;
    text-align: center;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(234, 88, 12, 0.08));
    border: 1px solid rgba(245, 158, 11, 0.25);
    animation: championFadeIn 0.6s ease;
}

@keyframes championFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.champion-trophy-big {
    font-size: 56px;
    animation: trophyBounce 4s ease-in-out infinite;
    filter: drop-shadow(0 0 16px rgba(245, 158, 11, 0.5));
}

@keyframes trophyBounce {

    0%,
    100% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-4px) scale(1.03);
    }
}

.champion-title {
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--accent-primary);
    margin-top: 8px;
    text-transform: uppercase;
}

.champion-name-big {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 8px 0;
}

.cup-shot-sheet {
    width: max-content;
    min-width: 820px;
}

.cup-shot-sheet-body {
    display: block;
}

.cup-shot-pane {
    width: max-content;
    max-width: none;
    min-width: 0;
}

.cup-shot-pane .cup-header-bar,
.cup-shot-pane [data-html2canvas-ignore] {
    display: none !important;
}

.cup-shot-pane .bracket-scroll {
    overflow: visible !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-overflow-scrolling: auto !important;
}

.cup-shot-pane .bracket {
    width: max-content !important;
    min-width: max-content !important;
}

.cup-shot-pane .champion-celebration {
    margin-top: 18px;
}

.champion-congrats {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    line-height: 1.5;
    margin: 8px 16px 16px;
}

.champion-final-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
}

.champion-badge {
    display: inline-block;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 1px;
}

.champion-vs-runnerup {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    padding: 6px 0;
}

.runnerup-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 12px;
    border-radius: 12px;
}

.cup-history-section {
    margin-top: 20px;
}

.cup-history-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.cup-history-card {
    margin-bottom: 12px;
    padding: 16px;
}

@supports (content-visibility: auto) {
    .cup-history-card {
        content-visibility: auto;
        contain-intrinsic-size: auto 420px;
    }
}

.cup-history-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.cup-history-trophy {
    font-size: 28px;
}

.cup-history-name {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    color: var(--theme-surface-accent);
}

.cup-history-date {
    font-size: 11px;
    color: var(--theme-surface-text-secondary);
    margin-top: 2px;
}

.cup-history-results {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.cup-history-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--theme-surface-subtle-bg);
    border: 1px solid var(--theme-surface-subtle-border);
    border-radius: var(--radius-sm);
}

.cup-history-result.champion {
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.08)),
        var(--theme-surface-subtle-bg-alt);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
}

.cup-history-label {
    font-size: 12px;
    color: var(--theme-surface-text-secondary);
}

.cup-history-value {
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-surface-text-primary);
}

.cup-history-stats {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.cup-history-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cup-history-stat-num {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--theme-surface-accent);
}

.cup-history-stat-label {
    font-size: 10px;
    color: var(--theme-surface-text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cup-score-modal {
    padding: 24px;
    text-align: center;
}

.cup-score-vs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.cup-score-team {
    flex: 1;
    text-align: center;
}

.cup-score-team-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cup-score-input {
    width: 64px;
    height: 64px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--accent-primary);
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    outline: none;
    transition: border-color var(--transition-fast);
    margin: 0 auto;
    display: block;
}

.cup-score-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.cup-score-vs-label {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-muted);
    padding-top: 28px;
}

.cup-score-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.cup-score-actions .btn-primary,
.cup-score-actions .btn-secondary {
    flex: 1;
}

.cup-penalty-btn.active {
    background: var(--accent-primary) !important;
    color: #fff !important;
    border-color: var(--accent-primary) !important;
    transform: scale(1.05);
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ============================================
   Cup Play Order (Urutan Main)
   ============================================ */
.cup-play-order {
    margin-top: 24px;
    padding: 20px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
}

.cup-play-order-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 4px;
}

.cup-play-order-subtitle {
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 16px;
}

.cup-po-round {
    margin-bottom: 16px;
}

.cup-po-round:last-child {
    margin-bottom: 0;
}

.cup-po-round-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    padding: 6px 12px;
    background: rgba(245, 158, 11, 0.08);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    text-align: center;
}

.cup-po-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.cup-po-item:hover {
    border-color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.04);
}

.cup-po-item:active {
    transform: scale(0.98);
}

.cup-po-played {
    opacity: 0.5;
}

.cup-po-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-primary);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.cup-po-players {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.cup-po-player {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.cup-po-player span {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cup-po-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.cup-po-shield {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.cup-po-shield svg {
    width: 100%;
    height: 100%;
}

.cup-po-vs {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    flex-shrink: 0;
}

.cup-po-leg {
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.cup-po-leg2 {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.cup-po-check {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ============================================
   Settings Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}

.modal-overlay.hidden {
    display: none;
}

body:has(.modal-overlay:not(.hidden)),
body:has(.action-sheet-overlay:not(.hidden)) {
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
    border-radius: var(--radius-xl);
    animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalPopIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 0;
}

.modal-header h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border-radius: var(--radius-full);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.modal-close:active {
    transform: scale(0.9);
}

.profile-modal-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.profile-modal-shot-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.26);
    background: rgba(var(--accent-primary-rgb, 255, 165, 0), 0.1);
    color: var(--accent-primary);
    border-radius: var(--radius-full);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.profile-modal-shot-btn svg {
    width: 18px;
    height: 18px;
    display: block;
    fill: currentColor;
}

.profile-modal-shot-btn.is-loading {
    pointer-events: none;
    color: transparent;
}

.profile-modal-shot-btn.is-loading svg {
    opacity: 0;
}

.profile-modal-shot-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.22);
    border-top-color: var(--accent-primary);
    animation: profileShotSpin 0.8s linear infinite;
}

.profile-modal-shot-btn:active {
    transform: scale(0.92);
    opacity: 0.92;
}

@keyframes profileShotSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.modal-body {
    padding: 20px;
}

#edit-modal.match-score-modal {
    background: rgba(7, 12, 20, 0.78);
    backdrop-filter: blur(10px) saturate(112%);
    -webkit-backdrop-filter: blur(10px) saturate(112%);
}

#edit-modal.match-score-modal .modal {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.16), transparent 34%),
        radial-gradient(circle at bottom left, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.12), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.03)),
        var(--theme-surface-fill);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    box-shadow: var(--theme-surface-shadow), 0 24px 48px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px) saturate(110%);
    -webkit-backdrop-filter: blur(12px) saturate(110%);
}

#edit-modal.match-score-modal .modal::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--bg-secondary);
    opacity: 0.84;
    pointer-events: none;
    z-index: 0;
}

#edit-modal.match-score-modal .modal>* {
    position: relative;
    z-index: 1;
}

#edit-modal.match-score-modal .modal-header h3,
#edit-modal.match-score-modal .modal-close,
#edit-modal.match-score-modal .modal-body {
    color: var(--theme-surface-text-primary);
}

.setting-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-secondary);
}

.setting-input {
    width: 100%;
    padding: 12px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.setting-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.setting-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 6px;
    line-height: 1.5;
}

.setting-hint b {
    color: var(--accent-primary);
    font-weight: 600;
}

.btn-save {
    margin-top: 8px;
}

/* ============================================
   Toast
   ============================================ */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    padding: 12px 24px;
    border-radius: var(--radius-lg);
    font-size: 13px;
    font-weight: 500;
    z-index: 99999;
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: var(--shadow-lg);
}

.toast.hidden {
    display: none;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.heads-up-notif {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    left: 50%;
    width: min(440px, calc(100vw - 24px));
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 22px;
    border: 1px solid var(--accent-border-soft);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), transparent 38%),
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.08), transparent 46%),
        linear-gradient(135deg, var(--bg-card-hover), var(--bg-secondary));
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    color: var(--text-primary);
    transform: translateX(-50%) translateY(-18px) scale(0.98);
    opacity: 0;
    pointer-events: none;
    z-index: 11000;
    transition: opacity 0.2s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.heads-up-notif.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0) scale(1);
}

.heads-up-notif.hidden {
    display: none;
}

.heads-up-notif-avatar {
    width: 48px;
    height: 48px;
    border-radius: 16px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    overflow: hidden;
    padding: 3px;
    box-shadow: inset 0 0 0 1px var(--accent-border-soft);
}

.heads-up-notif-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 12px;
    background: var(--bg-secondary);
}

.heads-up-notif-avatar-img.hidden {
    display: none;
}

.heads-up-notif-icon {
    font-size: 22px;
    line-height: 1;
}

.heads-up-notif-main {
    min-width: 0;
    flex: 1;
}

.heads-up-notif-title {
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.heads-up-notif-text {
    margin-top: 4px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.heads-up-notif-close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--accent-border-soft);
    border-radius: 999px;
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    color: var(--text-primary);
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.heads-up-notif-close:hover {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22), var(--theme-inline-surface-strong));
    transform: scale(1.04);
}

/* ============================================
   Sync Indicator
   ============================================ */
.sync-indicator {
    display: none !important;
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 12px);
    right: 12px;
    z-index: 1600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: rgba(12, 12, 24, 0.82);
    backdrop-filter: blur(8px);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: var(--text-primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transition: all 0.2s ease;
}

.sync-indicator.hidden {
    display: none;
}

.sync-indicator-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.7);
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.empty-text {
    font-size: 14px;
    line-height: 1.6;
}

.empty-text a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

/* ============================================
   Loading Skeleton
   ============================================ */
.skeleton {
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.04) 25%,
            rgba(255, 255, 255, 0.08) 50%,
            rgba(255, 255, 255, 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ============================================
   Pull to Refresh indicator
   ============================================ */

/* ============================================
   Shield Colors for Teams
   ============================================ */
.shield-orange {
    --shield-color: #f97316;
    --shield-secondary: #ea580c;
}

.shield-blue {
    --shield-color: #3b82f6;
    --shield-secondary: #2563eb;
}

.shield-red {
    --shield-color: #ef4444;
    --shield-secondary: #dc2626;
}

.shield-purple {
    --shield-color: #a855f7;
    --shield-secondary: #9333ea;
}

.shield-green {
    --shield-color: #22c55e;
    --shield-secondary: #16a34a;
}

.shield-cyan {
    --shield-color: #06b6d4;
    --shield-secondary: #0891b2;
}

.shield-pink {
    --shield-color: #ec4899;
    --shield-secondary: #db2777;
}

.shield-yellow {
    --shield-color: #eab308;
    --shield-secondary: #ca8a04;
}

.shield-teal {
    --shield-color: #14b8a6;
    --shield-secondary: #0d9488;
}

.shield-indigo {
    --shield-color: #6366f1;
    --shield-secondary: #4f46e5;
}

/* ============================================
   Media Queries
   ============================================ */
@media (min-width: 480px) {
    .app {
        border-left: 1px solid var(--border-subtle);
        border-right: 1px solid var(--border-subtle);
    }
}

@media (orientation: landscape) and (pointer: coarse) and (max-height: 620px) {
    .app {
        width: 100vw;
        max-width: none;
        margin: 0;
        border-left: none !important;
        border-right: none !important;
    }

    .content,
    .player-profile-list,
    .friendly-page {
        padding-left: clamp(16px, 3vw, 24px);
        padding-right: clamp(16px, 3vw, 24px);
    }

    .modal,
    .agenda-editor-modal,
    .poll-creator-sheet,
    .announce-create-modal-content,
    .disappear-modal-content {
        max-width: min(720px, calc(100vw - 20px));
        max-height: calc(100dvh - 20px);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Add Button
   ============================================ */
.btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 14px;
    background: rgba(245, 158, 11, 0.08);
    border: 1.5px dashed rgba(245, 158, 11, 0.35);
    border-radius: var(--radius-md);
    color: var(--accent-primary);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-add:active {
    transform: scale(0.97);
    background: rgba(245, 158, 11, 0.15);
}

.btn-add:hover {
    border-color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.12);
}

/* ============================================
   Row Action Buttons (Edit / Delete)
   ============================================ */
.row-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    margin-left: 4px;
}

.table-row .row-actions {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    margin-left: 0;
}

.row-action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    padding: 0;
}

.row-action-btn:active {
    transform: scale(0.85);
}

.row-action-btn.delete-btn {
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.06);
}

.row-action-btn.delete-btn:active {
    background: rgba(239, 68, 68, 0.2);
}

.btn-secondary {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-secondary:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--red), #dc2626);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: 0 0 16px rgba(239, 68, 68, 0.25);
}

.btn-danger:active {
    transform: scale(0.97);
}

.add-player-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    padding: 0 2px;
}

.add-player-suggestions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.add-player-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    min-height: 52px;
    max-height: 52px;
    overflow: hidden;
}

.add-player-suggestion:hover {
    background: var(--bg-hover);
    border-color: var(--accent-primary);
}

.add-player-suggestion:active {
    transform: scale(0.98);
}

.add-player-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    max-width: 36px;
    max-height: 36px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    font-weight: 700;
    font-size: 14px;
    overflow: hidden;
    flex-shrink: 0;
}

.add-player-avatar img {
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.add-player-info {
    flex: 1;
    min-width: 0;
}

.add-player-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-player-uname {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.add-player-action {
    font-size: 20px;
    color: var(--accent-primary);
    font-weight: 700;
    flex-shrink: 0;
    width: 28px;
    text-align: center;
}

.add-player-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0;
}

.add-player-divider::before,
.add-player-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}

.add-player-divider span {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-field-group {
    margin-bottom: 14px;
}

.edit-field-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.edit-field-input {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.edit-field-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.edit-actions .btn-primary,
.edit-actions .btn-secondary {
    flex: 1;
}

.player-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ============================================
   View System
   ============================================ */
.view.hidden {
    display: none !important;
}

/* ============================================
   Auth View
   ============================================ */
.view-auth {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 50;
}

.view-auth.hidden {
    display: none;
}

.auth-card {
    width: 100%;
    max-width: 380px;
    padding: 36px 28px;
    text-align: center;
}

.auth-logo {
    margin-bottom: 8px;
    text-align: center;
}

.auth-logo-img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(245, 158, 11, 0.35);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.2), 0 0 60px rgba(168, 85, 247, 0.1);
}

.auth-title {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.auth-subtitle {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 24px;
}

.auth-field {
    margin-bottom: 14px;
}

.auth-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-light);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 15px;
    outline: none;
    transition: all var(--transition-fast);
}

.auth-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.auth-input::placeholder {
    color: var(--text-muted);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    margin-top: 4px;
    transition: all var(--transition-fast);
    box-shadow: 0 0 20px var(--accent-glow);
}

.auth-btn:active {
    transform: scale(0.97);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn-register {
    background: linear-gradient(135deg, #22c55e, #10b981);
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
}

.auth-toggle {
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-secondary);
}

.auth-toggle a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-error {
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: var(--red-bg);
    color: var(--red);
    font-size: 13px;
    font-weight: 500;
}

.auth-error.hidden {
    display: none;
}

/* ============================================
   Home View
   ============================================ */
.home-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: calc(env(safe-area-inset-top, 36px) + 20px) calc(env(safe-area-inset-right, 0px) + 20px) 12px 20px;
}

.home-header-profile {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    max-width: calc(100% - 220px);
    padding-right: 10px;
}

.home-header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
}

.home-greeting {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-username {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--accent-primary), #ff6b35);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-whatsapp-btn,
.home-tour-btn,
.home-theme-btn,
.home-notif-btn,
.home-logout-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.home-whatsapp-btn,
.home-tour-btn,
.home-theme-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.home-notif-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    position: relative;
}

.home-logout-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
}

.home-notif-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 18px;
    text-align: center;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.35);
}

.home-notif-badge.hidden {
    display: none;
}

.home-theme-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.home-theme-menu-wrap {
    position: relative;
    display: flex;
}

.home-theme-btn.is-open {
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    border-color: var(--theme-inline-border-strong);
    color: var(--text-primary);
    box-shadow: 0 10px 22px var(--accent-glow);
}

.home-theme-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(420px, calc(100vw - 28px));
    max-height: min(78vh, 620px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px;
    border-radius: 22px;
    border: 1px solid var(--theme-inline-border-strong);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), transparent 34%),
        linear-gradient(180deg, var(--bg-card), var(--bg-primary));
    box-shadow: 0 24px 56px rgba(0, 0, 0, 0.34), 0 14px 28px var(--theme-active-shadow);
    backdrop-filter: blur(min(var(--theme-popover-blur-cap), var(--theme-surface-blur))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(var(--theme-popover-blur-cap), var(--theme-surface-blur))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    contain: paint;
    z-index: 60;
}

.home-theme-popover.hidden {
    display: none;
}

.home-theme-popover-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.home-theme-popover-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.home-theme-popover-copy strong {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.2;
}

.home-theme-popover-copy span {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.45;
}

.home-theme-popover-close {
    width: 30px;
    height: 30px;
    flex: 0 0 auto;
    border-radius: 999px;
    border: 1px solid var(--theme-inline-border);
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    color: var(--text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.home-theme-popover-close:hover {
    border-color: var(--theme-inline-border-strong);
    filter: brightness(1.05);
}

.home-theme-popover-close:active {
    transform: scale(0.96);
}

.home-theme-popover-section+.home-theme-popover-section {
    margin-top: 14px;
}

.home-theme-popover-label {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.home-theme-mode-group {
    margin-top: 0;
}

.home-theme-mode-btn {
    min-height: 40px;
    padding: 10px 8px;
}

.home-theme-palette-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 0;
}

.home-theme-palette-card {
    padding: 10px 12px;
    gap: 8px;
}

.home-theme-palette-card .theme-palette-swatches {
    gap: 6px;
}

.home-theme-palette-card .theme-palette-swatch {
    width: 14px;
    height: 14px;
}

.home-theme-palette-card .theme-palette-copy {
    gap: 3px;
}

.home-theme-palette-card .theme-palette-copy strong {
    font-size: 12px;
}

.home-theme-palette-card .theme-palette-copy small {
    font-size: 10px;
    line-height: 1.35;
}

.home-whatsapp-btn:hover,
.home-tour-btn:hover,
.home-theme-btn:hover,
.home-notif-btn:hover,
.home-logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.home-whatsapp-btn:active,
.home-tour-btn:active,
.home-theme-btn:active,
.home-notif-btn:active,
.home-logout-btn:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 640px) {
    .home-theme-popover {
        position: fixed;
        top: 82px;
        right: 14px;
        left: 14px;
        width: auto;
        max-height: calc(100vh - 112px);
    }

    .home-theme-palette-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

.feature-tour-open {
    overflow: hidden;
}

.feature-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 16000;
    pointer-events: auto;
    --tour-focus-x: 50%;
    --tour-focus-y: 35%;
    --tour-focus-r: 120px;
    --tour-scrim-inner: rgba(255, 255, 255, 0.14);
    --tour-scrim-mid: rgba(255, 255, 255, 0.08);
    --tour-scrim-ring: rgba(12, 18, 34, 0.16);
    --tour-scrim-outer: rgba(7, 12, 24, 0.34);
    --tour-scrim-edge: rgba(7, 12, 24, 0.46);
    --tour-target-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
    --tour-tooltip-bg: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
    --tour-tooltip-border: var(--accent-border-soft);
    --tour-tooltip-shadow: 0 22px 60px rgba(0, 0, 0, 0.38), 0 12px 30px var(--theme-active-shadow);
    --tour-tooltip-text: var(--text-primary);
    --tour-kicker-bg: var(--theme-inline-surface-strong);
    --tour-kicker-text: var(--theme-tour-kicker-text);
    --tour-progress-text: var(--text-secondary);
    --tour-progress-track: var(--accent-soft);
    --tour-body-text: var(--text-secondary);
    --tour-skip-text: var(--text-secondary);
    --tour-prev-bg: var(--accent-soft);
    --tour-prev-text: var(--text-primary);
    --tour-next-text: var(--theme-tour-next-text);
    --tour-next-shadow: 0 10px 25px var(--theme-active-shadow);
}

:root[data-theme="light"] .feature-tour-overlay {
    --tour-scrim-inner: rgba(255, 255, 255, 0.64);
    --tour-scrim-mid: rgba(255, 255, 255, 0.42);
    --tour-scrim-ring: rgba(233, 239, 249, 0.56);
    --tour-scrim-outer: rgba(208, 218, 236, 0.44);
    --tour-scrim-edge: rgba(184, 198, 221, 0.52);
    --tour-target-shadow: 0 16px 30px rgba(39, 64, 105, 0.16);
    --tour-tooltip-bg: linear-gradient(180deg, var(--bg-secondary), var(--bg-primary));
    --tour-tooltip-border: var(--accent-border-soft);
    --tour-tooltip-shadow: 0 20px 48px rgba(39, 64, 105, 0.18), 0 12px 24px var(--theme-active-shadow);
    --tour-tooltip-text: var(--text-primary);
    --tour-kicker-bg: var(--theme-inline-surface-strong);
    --tour-kicker-text: var(--theme-tour-kicker-text);
    --tour-progress-text: var(--text-secondary);
    --tour-progress-track: var(--accent-soft);
    --tour-body-text: var(--text-secondary);
    --tour-skip-text: var(--text-secondary);
    --tour-prev-bg: var(--accent-soft);
    --tour-prev-text: var(--text-primary);
    --tour-next-text: var(--theme-tour-next-text);
    --tour-next-shadow: 0 12px 24px var(--theme-active-shadow);
}

.feature-tour-overlay.hidden {
    display: none;
}

.feature-tour-scrim {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at var(--tour-focus-x) var(--tour-focus-y),
            var(--tour-scrim-inner) 0,
            var(--tour-scrim-mid) calc(var(--tour-focus-r) * 0.72),
            var(--tour-scrim-ring) calc(var(--tour-focus-r) + 10px),
            var(--tour-scrim-outer) calc(var(--tour-focus-r) + 120px),
            var(--tour-scrim-edge) 100%);
}

.feature-tour-target {
    position: relative !important;
    z-index: 16002 !important;
    border-radius: inherit;
    box-shadow: 0 0 0 3px var(--theme-focus-ring), 0 0 0 12px var(--theme-focus-halo), var(--tour-target-shadow);
}

.feature-tour-tooltip {
    position: fixed;
    z-index: 16003;
    width: min(340px, calc(100vw - 32px));
    border-radius: 24px;
    padding: 18px 18px 16px;
    background: var(--tour-tooltip-bg);
    border: 1px solid var(--tour-tooltip-border);
    box-shadow: var(--tour-tooltip-shadow);
    color: var(--tour-tooltip-text);
}

.feature-tour-tooltip.centered {
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%);
}

.feature-tour-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--tour-kicker-bg);
    color: var(--tour-kicker-text);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.feature-tour-kicker::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 10px currentColor;
}

.feature-tour-progress {
    margin-top: 14px;
}

.feature-tour-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--tour-progress-text);
}

.feature-tour-progress-bar {
    position: relative;
    overflow: hidden;
    height: 8px;
    border-radius: 999px;
    background: var(--tour-progress-track);
}

.feature-tour-progress-fill {
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-primary), var(--theme-active-gradient-end));
    transition: width 0.22s ease;
}

.feature-tour-title {
    margin: 14px 0 8px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.feature-tour-body {
    margin: 0;
    color: var(--tour-body-text);
    font-size: 14px;
    line-height: 1.6;
}

.feature-tour-actions {
    margin-top: 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.feature-tour-actions.single-step {
    justify-content: flex-end;
}

.feature-tour-skip,
.feature-tour-prev,
.feature-tour-next {
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 700;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.feature-tour-skip:active,
.feature-tour-prev:active,
.feature-tour-next:active {
    transform: scale(0.97);
}

.feature-tour-skip {
    padding: 10px 14px;
    background: transparent;
    color: var(--tour-skip-text);
}

.feature-tour-nav {
    display: flex;
    gap: 10px;
}

.feature-tour-prev,
.feature-tour-next {
    min-width: 112px;
    padding: 11px 16px;
}

.feature-tour-prev {
    background: var(--tour-prev-bg);
    color: var(--tour-prev-text);
}

.feature-tour-prev[disabled] {
    opacity: 0.45;
    cursor: default;
}

.feature-tour-next {
    background: linear-gradient(135deg, var(--accent-primary), var(--theme-active-gradient-end));
    color: var(--tour-next-text);
    box-shadow: var(--tour-next-shadow);
}

@media (max-width: 520px) {
    .home-header {
        gap: 14px;
    }

    .home-header-profile {
        max-width: calc(100% - 222px);
        padding-right: 14px;
    }

    .home-header-controls {
        gap: 7px;
    }

    .home-bio {
        max-width: 150px;
    }

    .feature-tour-tooltip {
        width: calc(100vw - 24px);
        border-radius: 22px;
        padding: 16px 16px 14px;
    }

    .feature-tour-actions {
        flex-wrap: wrap;
    }

    .feature-tour-nav {
        width: 100%;
    }

    .feature-tour-prev,
    .feature-tour-next {
        flex: 1;
    }
}

.notif-center-overlay {
    position: fixed;
    inset: 0;
    z-index: 980;
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.08), transparent 28%),
        rgba(3, 10, 24, 0.48);
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: calc(env(safe-area-inset-top, 8px) + 74px) 12px 16px;
}

.notif-center-overlay.hidden {
    display: none;
}

.notif-center-panel {
    width: min(420px, calc(100vw - 24px));
    max-height: calc(100vh - 100px - env(safe-area-inset-bottom, 0px));
    border-radius: 18px;
    border: 1px solid var(--accent-border-soft);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), transparent 36%),
        linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.08), transparent 32%),
        linear-gradient(180deg, var(--bg-card-hover), var(--bg-secondary));
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(18px);
}

.notif-center-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 12px 10px;
    border-bottom: 1px solid var(--accent-border-soft);
}

.notif-center-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.notif-center-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.notif-center-mark-all,
.notif-center-delete-read {
    border: 1px solid var(--accent-border-soft);
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.notif-center-delete-read {
    color: #fecaca;
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(127, 29, 29, 0.18));
}

.notif-center-mark-all:hover:not(:disabled),
.notif-center-delete-read:hover:not(:disabled),
.notif-center-close:hover {
    transform: translateY(-1px);
}

.notif-center-mark-all:hover:not(:disabled) {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.2), var(--theme-inline-surface-strong));
    color: var(--text-primary);
}

.notif-center-delete-read:hover:not(:disabled) {
    filter: brightness(1.04);
}

.notif-center-close:hover {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), var(--theme-inline-surface-strong));
}

.notif-center-mark-all:disabled,
.notif-center-delete-read:disabled {
    opacity: 0.5;
    cursor: default;
}

.notif-center-close {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--accent-border-soft);
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.notif-center-list {
    overflow-y: auto;
    max-height: inherit;
    padding: 8px;
}

.notif-center-empty {
    padding: 26px 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.notif-center-item {
    width: 100%;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.08);
    background: linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.04), rgba(255, 255, 255, 0.02));
    border-radius: 14px;
    padding: 10px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

@supports (content-visibility: auto) {
    .notif-center-item {
        content-visibility: auto;
        contain-intrinsic-size: auto 88px;
    }
}

.notif-center-item:hover {
    border-color: var(--accent-border-soft);
    background: linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.09), var(--theme-inline-surface));
    transform: translateY(-1px);
}

.notif-center-item+.notif-center-item {
    margin-top: 8px;
}

.notif-center-item.unread {
    border-color: var(--accent-border-strong);
    background: linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.16), var(--theme-inline-surface-strong));
}

.notif-center-item-icon {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    font-size: 16px;
}

.notif-center-item-main {
    min-width: 0;
    flex: 1;
}

.notif-center-item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    gap: 8px;
    flex: 0 0 auto;
}

.notif-center-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.notif-center-item-body {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

.notif-center-item-time {
    margin-top: 5px;
    font-size: 11px;
    color: var(--text-muted);
}

.notif-center-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    margin-top: 6px;
    flex: 0 0 auto;
}

.notif-center-item-delete {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    border: 1px solid rgba(239, 68, 68, 0.26);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(127, 29, 29, 0.18));
    color: #fecaca;
    font-size: 13px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.notif-center-item-delete:hover {
    filter: brightness(1.08);
}

.home-cards {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px 20px;
}

.home-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 22px 20px;
    border-radius: var(--theme-home-card-radius);
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        border-color 0.24s ease,
        box-shadow 0.28s ease,
        background 0.28s ease,
        opacity 0.22s ease,
        filter 0.22s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--theme-home-card-border);
    box-shadow: var(--theme-home-card-shadow);
    backdrop-filter: blur(min(calc(var(--theme-surface-blur) * 0.42), var(--theme-home-card-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(calc(var(--theme-surface-blur) * 0.42), var(--theme-home-card-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    isolation: isolate;
    --home-alert-color-1: rgba(255, 255, 255, 0.92);
    --home-alert-color-2: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.92);
    --home-alert-color-3: rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.9);
    --home-alert-shadow: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24);
}

.home-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s;
    background: var(--theme-home-card-overlay);
    z-index: 0;
}

.home-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--theme-home-card-sheen);
    opacity: 0.8;
    pointer-events: none;
    z-index: 0;
}

.home-card > * {
    position: relative;
    z-index: 1;
}

.home-card-alert-ring {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    z-index: 2;
    transition: opacity 0.28s ease, transform 0.28s ease, filter 0.28s ease;
    transform: scale(0.992);
    filter: saturate(0.96);
}

.home-card-alert-ring::before,
.home-card-alert-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.home-card-alert-ring::before {
    padding: 1.65px;
    background:
        conic-gradient(from 0deg,
            transparent 0deg,
            rgba(255, 255, 255, 0.15) 26deg,
            var(--home-alert-color-1) 58deg,
            var(--home-alert-color-2) 118deg,
            rgba(255, 255, 255, 0.94) 176deg,
            var(--home-alert-color-3) 236deg,
            rgba(255, 255, 255, 0.16) 300deg,
            transparent 360deg);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
}

.home-card-alert-ring::after {
    inset: -2px;
    border-radius: calc(var(--theme-home-card-radius) + 2px);
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 0 14px var(--home-alert-shadow);
    opacity: 0.24;
    animation: homeCardAlertPulse 3.2s ease-in-out infinite;
}

.home-card.has-unseen-update .home-card-alert-ring {
    opacity: 1;
    transform: scale(1);
    filter: saturate(1.06);
}

.home-card.has-unseen-update {
    box-shadow:
        var(--theme-home-card-shadow),
        0 0 0 1px rgba(255, 255, 255, 0.08),
        0 10px 26px var(--home-alert-shadow);
}

.home-card:hover::before {
    opacity: 1;
}

.home-card:active {
    transform: scale(0.98);
}

html.native-app.native-home-active body::before {
    opacity: 0.22;
}

html.native-app.native-home-active body::after {
    opacity: 0.06;
    background: none;
}

html.native-app .home-theme-popover {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.native-app.native-home-active .home-whatsapp-btn,
html.native-app.native-home-active .home-tour-btn,
html.native-app.native-home-active .home-theme-btn,
html.native-app.native-home-active .home-notif-btn,
html.native-app.native-home-active .home-logout-btn {
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

html.native-app.native-home-active .home-cards {
    contain: layout paint;
}

html.native-app.native-home-active .home-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
    contain: layout paint;
}

html.native-app.native-home-active .home-card::before,
html.native-app.native-home-active .home-card::after {
    display: none;
}

html.native-app.native-home-active .home-card-emoji {
    filter: none;
}

html.native-app.native-home-active .home-card-alert-ring::before {
    display: block;
    padding: 1.45px;
    opacity: 0.98;
    animation: homeCardNativeAlertSpin 5.5s linear infinite;
}

html.native-app.native-home-active .home-card-alert-ring::after {
    inset: -1px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 0 8px var(--home-alert-shadow);
    opacity: 0.22;
    animation: homeCardAlertPulse 3.4s ease-in-out infinite;
}

html.native-app.native-home-active .home-card-alert-ring {
    transform: none;
    filter: none;
}

html.native-app.native-home-active .home-card.has-unseen-update {
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.16),
        0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18),
        0 0 18px var(--home-alert-shadow);
}

@supports (content-visibility: auto) {
    html.native-app.native-home-active .home-card {
        content-visibility: auto;
        contain-intrinsic-size: auto 108px;
    }
}

.card-liga {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(6, 182, 212, 0.12));
    border-color: rgba(59, 130, 246, 0.2);
    --home-alert-color-1: rgba(219, 234, 254, 0.98);
    --home-alert-color-2: rgba(96, 165, 250, 0.96);
    --home-alert-color-3: rgba(34, 211, 238, 0.9);
    --home-alert-shadow: rgba(59, 130, 246, 0.2);
}

.card-cup {
    background: var(--theme-home-cup-bg);
    border-color: var(--theme-home-cup-border);
    --home-alert-color-1: rgba(255, 247, 237, 0.98);
    --home-alert-color-2: rgba(251, 191, 36, 0.96);
    --home-alert-color-3: rgba(249, 115, 22, 0.92);
    --home-alert-shadow: rgba(249, 115, 22, 0.22);
}

.card-chat {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(20, 184, 166, 0.12));
    border-color: rgba(34, 197, 94, 0.2);
    --home-alert-color-1: rgba(236, 253, 245, 0.98);
    --home-alert-color-2: rgba(74, 222, 128, 0.96);
    --home-alert-color-3: rgba(45, 212, 191, 0.88);
    --home-alert-shadow: rgba(34, 197, 94, 0.22);
}

.card-info {
    background: var(--theme-home-info-bg);
    border-color: var(--theme-home-info-border);
    --home-alert-color-1: rgba(255, 241, 242, 0.98);
    --home-alert-color-2: rgba(244, 114, 182, 0.94);
    --home-alert-color-3: rgba(251, 146, 60, 0.9);
    --home-alert-shadow: rgba(244, 114, 182, 0.2);
}

.card-friendly {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(14, 165, 233, 0.12));
    border-color: rgba(16, 185, 129, 0.26);
    --home-alert-color-1: rgba(236, 253, 245, 0.98);
    --home-alert-color-2: rgba(52, 211, 153, 0.95);
    --home-alert-color-3: rgba(56, 189, 248, 0.88);
    --home-alert-shadow: rgba(16, 185, 129, 0.22);
}

.card-football {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.12));
    border-color: rgba(139, 92, 246, 0.26);
    --home-alert-color-1: rgba(245, 243, 255, 0.98);
    --home-alert-color-2: rgba(192, 132, 252, 0.95);
    --home-alert-color-3: rgba(139, 92, 246, 0.88);
    --home-alert-shadow: rgba(139, 92, 246, 0.22);
}

.card-efhub {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.12));
    border-color: rgba(34, 197, 94, 0.26);
    --home-alert-color-1: rgba(240, 253, 244, 0.98);
    --home-alert-color-2: rgba(74, 222, 128, 0.95);
    --home-alert-color-3: rgba(34, 197, 94, 0.88);
    --home-alert-shadow: rgba(34, 197, 94, 0.22);
}

.card-agenda {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.18), rgba(168, 85, 247, 0.12));
    border-color: rgba(139, 92, 246, 0.2);
    --home-alert-color-1: rgba(245, 243, 255, 0.98);
    --home-alert-color-2: rgba(192, 132, 252, 0.95);
    --home-alert-color-3: rgba(96, 165, 250, 0.86);
    --home-alert-shadow: rgba(168, 85, 247, 0.22);
}

.card-quotes {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(244, 114, 182, 0.12));
    border-color: rgba(236, 72, 153, 0.2);
    --home-alert-color-1: rgba(253, 242, 248, 0.98);
    --home-alert-color-2: rgba(244, 114, 182, 0.95);
    --home-alert-color-3: rgba(192, 132, 252, 0.88);
    --home-alert-shadow: rgba(236, 72, 153, 0.22);
}

.card-stories {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.18), rgba(34, 211, 238, 0.12));
    border-color: rgba(6, 182, 212, 0.2);
    --home-alert-color-1: rgba(236, 254, 255, 0.98);
    --home-alert-color-2: rgba(34, 211, 238, 0.94);
    --home-alert-color-3: rgba(56, 189, 248, 0.88);
    --home-alert-shadow: rgba(6, 182, 212, 0.22);
}

.card-gallery {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(14, 165, 233, 0.14));
    border-color: rgba(37, 99, 235, 0.24);
}

.card-profile {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.18), rgba(129, 140, 248, 0.12));
    border-color: rgba(99, 102, 241, 0.2);
}

.card-history {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.18), rgba(203, 213, 225, 0.10));
    border-color: rgba(148, 163, 184, 0.2);
}

@keyframes homeCardAlertPulse {
    0%,
    100% {
        opacity: 0.18;
    }

    50% {
        opacity: 0.34;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-card-alert-ring::before,
    .home-card-alert-ring::after {
        animation: none !important;
    }

    .home-card.has-unseen-update {
        box-shadow:
            var(--theme-home-card-shadow),
            0 0 0 1px rgba(255, 255, 255, 0.08),
            0 6px 18px var(--home-alert-shadow);
    }
}

/* ==================== FRIENDLY MATCH VIEW ==================== */
.friendly-page {
    padding: 12px 16px 22px;
}

.friendly-platform-tabs {
    margin-bottom: 12px;
}

.friendly-form {
    padding: 14px;
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
}

.friendly-form-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.friendly-form-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.friendly-form-col {
    flex: 1;
    min-width: 0;
}

.friendly-form-col.score-col {
    flex: 0 0 88px;
}

.friendly-label {
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.35px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.friendly-player-trigger {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-primary);
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.friendly-player-trigger:hover {
    border-color: rgba(245, 158, 11, 0.55);
}

.friendly-player-trigger:active {
    transform: scale(0.985);
}

.friendly-player-trigger.is-empty {
    opacity: 0.95;
}

.friendly-player-avatar {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.friendly-player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.friendly-player-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.friendly-player-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friendly-player-uname {
    margin-top: 1px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friendly-player-action {
    width: 24px;
    text-align: center;
    font-size: 18px;
    font-weight: 800;
    line-height: 1;
    color: var(--accent-primary);
    flex-shrink: 0;
}

.friendly-select,
.friendly-score-input {
    width: 100%;
    height: 42px;
}

.friendly-score-input {
    text-align: center;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.friendly-vs {
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--accent-primary);
    margin: 8px 0;
    letter-spacing: 0.4px;
}

.friendly-save-btn {
    width: 100%;
    margin-top: 12px;
}

.friendly-picker-modal {
    max-width: 540px;
}

.friendly-picker-body {
    padding: 0 14px 14px;
}

.friendly-picker-section-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.45px;
    margin: 2px 2px 8px;
}

.friendly-picker-list {
    max-height: 330px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.friendly-picker-item {
    width: 100%;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    text-align: left;
    font: inherit;
}

.friendly-picker-item .add-player-avatar {
    background: transparent;
}

.friendly-picker-item .add-player-avatar>span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.friendly-picker-item.is-selected {
    border-color: rgba(245, 158, 11, 0.75);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.28);
}

.friendly-picker-item.is-selected .add-player-action {
    color: #10b981;
}

.friendly-picker-item.is-disabled {
    opacity: 0.46;
    cursor: not-allowed;
    border-style: dashed;
}

.friendly-picker-item.is-disabled .add-player-action {
    color: var(--text-muted);
}

.friendly-picker-item:focus-visible {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

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

.friendly-h2h-panel {
    margin: 0 0 12px;
}

.friendly-h2h-card {
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    contain: layout paint style;
}

.friendly-h2h-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.friendly-h2h-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
}

.friendly-h2h-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.friendly-h2h-record {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.friendly-h2h-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friendly-h2h-name.right {
    text-align: right;
}

.friendly-h2h-num {
    font-size: 22px;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-primary);
    min-width: 22px;
    text-align: center;
    line-height: 1;
}

.friendly-h2h-draw {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.friendly-h2h-bar {
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    display: grid;
    grid-template-columns: var(--a, 0fr) var(--d, 0fr) var(--b, 0fr);
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    margin-bottom: 10px;
}

.friendly-h2h-bar>span:nth-child(1) {
    background: linear-gradient(90deg, #10b981, #34d399);
}

.friendly-h2h-bar>span:nth-child(2) {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

.friendly-h2h-bar>span:nth-child(3) {
    background: linear-gradient(90deg, #f97316, #fb7185);
}

.friendly-h2h-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 10px;
}

.friendly-h2h-stat {
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    padding: 8px 6px;
    text-align: center;
}

.friendly-h2h-stat-val {
    font-size: 15px;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
}

.friendly-h2h-stat-label {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.25px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.friendly-h2h-insights {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.friendly-h2h-insight {
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    padding: 5px 9px;
}

.friendly-h2h-recent-toggle {
    list-style: none;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.friendly-h2h-recent-toggle::-webkit-details-marker {
    display: none;
}

.friendly-h2h-recent-toggle::after {
    content: 'Lihat';
    float: right;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
}

details[open]>.friendly-h2h-recent-toggle::after {
    content: 'Tutup';
}

.friendly-h2h-recent-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.friendly-h2h-recent-item {
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    padding: 7px 8px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.friendly-h2h-recent-meta {
    min-width: 0;
}

.friendly-h2h-recent-line {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friendly-h2h-recent-sub {
    margin-top: 1px;
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
}

.friendly-h2h-recent-score {
    font-size: 13px;
    font-family: var(--font-display);
    font-weight: 800;
    color: var(--text-primary);
    white-space: nowrap;
}

.friendly-card {
    padding: 12px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    contain: layout paint style;
}

@supports (content-visibility: auto) {
    .friendly-h2h-card {
        content-visibility: auto;
        contain-intrinsic-size: auto 220px;
    }

    .friendly-card {
        content-visibility: auto;
        contain-intrinsic-size: auto 124px;
    }
}

.friendly-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.friendly-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-secondary);
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}

.friendly-card-time {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.friendly-scoreline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
}

.friendly-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friendly-name.right {
    text-align: right;
}

.friendly-name.winner {
    color: #22c55e;
}

.friendly-score {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 21px;
    color: var(--text-primary);
    min-width: 18px;
    text-align: center;
    line-height: 1;
}

.friendly-sep {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-muted);
}

.friendly-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 8px;
}

.friendly-result-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.friendly-empty {
    padding: 14px;
    border: 1px dashed var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-align: center;
    font-size: 12px;
    background: var(--bg-secondary);
}

/* --- Form Guide --- */
.friendly-form-guide {
    margin: 10px 0 6px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
}

.friendly-form-guide-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .3px;
}

.friendly-form-row-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

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

.friendly-form-player-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friendly-form-badges {
    display: flex;
    gap: 3px;
    flex-wrap: wrap;
}

.friendly-form-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 5px;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
}

.friendly-form-badge.W {
    background: #22c55e;
}

.friendly-form-badge.D {
    background: #a3a3a3;
}

.friendly-form-badge.L {
    background: #ef4444;
}

/* --- H2H Records --- */
.friendly-h2h-records {
    margin: 8px 0 4px;
    padding: 8px 10px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
}

.friendly-h2h-records-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-bottom: 4px;
}

.friendly-h2h-record-item {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.6;
}

.friendly-record-icon {
    margin-right: 2px;
}

/* --- All-Time Stats --- */
.friendly-alltime-section {
    margin-top: 6px;
}

.friendly-alltime-wrap {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.friendly-alltime-player {
    padding: 10px;
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
}

.friendly-alltime-name {
    font-size: 13px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.friendly-alltime-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.friendly-alltime-cell {
    text-align: center;
    padding: 4px 0;
}

.friendly-alltime-val {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.friendly-alltime-lbl {
    font-size: 9px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: 1px;
}

.friendly-alltime-highlight {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(34, 197, 94, .08);
    border: 1px solid rgba(34, 197, 94, .15);
}

/* --- Match Card Actions --- */
.friendly-card-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Rematch Button --- */
.friendly-rematch-area {
    margin-top: 8px;
    text-align: center;
}

.friendly-rematch-area.hidden {
    display: none;
}

.friendly-rematch-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 20px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, color .15s;
    width: 100%;
    justify-content: center;
}

.friendly-rematch-btn:hover,
.friendly-rematch-btn:active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

/* ==================== AGENDA VIEW ==================== */
.agenda-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 16px;
    overflow-x: auto;
}

.agenda-tab {
    flex-shrink: 0;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.agenda-tab.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.4), rgba(168, 85, 247, 0.3));
    border-color: rgba(139, 92, 246, 0.5);
    color: #fff;
}

.agenda-input {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px 12px;
    color: #e0e0e0;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border 0.2s;
}

.agenda-input:focus {
    border-color: rgba(139, 92, 246, 0.5);
}

.agenda-textarea {
    resize: vertical;
    min-height: 40px;
    max-height: 100px;
}

.agenda-select {
    flex: 1;
    appearance: auto;
}

.agenda-add-btn {
    padding: 10px 18px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.agenda-add-btn:active {
    transform: scale(0.96);
}

.agenda-list {
    padding: 8px 16px 80px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: all 0.2s;
    position: relative;
}

.agenda-item.done {
    opacity: 0.5;
}

.agenda-item.done .agenda-item-title {
    text-decoration: line-through;
}

.agenda-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid rgba(139, 92, 246, 0.5);
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: all 0.2s;
    background: transparent;
}

.agenda-checkbox.checked {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-color: #a855f7;
}

.agenda-checkbox.checked::after {
    content: '✓';
    color: white;
    font-size: 13px;
    font-weight: bold;
}

.agenda-item-body {
    flex: 1;
    min-width: 0;
}

.agenda-item-title {
    font-weight: 600;
    font-size: 15px;
    color: #e8e8e8;
    margin-bottom: 3px;
}

.agenda-item-desc {
    font-size: 13px;
    color: #999;
    margin-bottom: 4px;
}

.agenda-item-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.agenda-item-date,
.agenda-item-time {
    font-size: 12px;
    color: #8b5cf6;
    font-weight: 500;
}

.agenda-item-category {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
}

.agenda-item-author {
    font-size: 11px;
    color: #666;
}

.agenda-item-actions {
    display: flex;
    gap: 4px;
    position: absolute;
    top: 8px;
    right: 8px;
}

.agenda-item-actions button {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 6px;
    width: 28px;
    height: 28px;
    color: #999;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.agenda-item-actions button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.agenda-empty {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    font-size: 14px;
}

.agenda-overdue {
    border-left: 3px solid #ef4444 !important;
}

.agenda-comment-section {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.agenda-comment-toggle {
    background: rgba(139, 92, 246, 0.08);
    border: 1px solid rgba(139, 92, 246, 0.15);
    color: #c4b5fd;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 10px;
    transition: all 0.15s;
    font-family: inherit;
}

.agenda-comment-toggle:active {
    background: rgba(139, 92, 246, 0.2);
    transform: scale(0.96);
}

.agenda-top-action {
    font-size: 20px !important;
    line-height: 1;
}

.agenda-tab.active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.32), rgba(34, 197, 94, 0.22));
    border-color: rgba(34, 197, 94, 0.42);
}

.agenda-input {
    border-radius: 12px;
    padding: 12px 14px;
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
    transition: border 0.2s, box-shadow 0.2s, background 0.2s;
}

.agenda-input:focus {
    border-color: rgba(34, 197, 94, 0.45);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.agenda-textarea {
    min-height: 72px;
    max-height: 140px;
}

.agenda-add-btn {
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981, #22c55e);
    font-weight: 700;
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.22);
}

.agenda-list {
    padding-bottom: 96px;
    gap: 10px;
}

.agenda-item {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.025));
    border-radius: 18px;
    padding: 14px 14px 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
}

@supports (content-visibility: auto) {
    .agenda-item {
        content-visibility: auto;
        contain-intrinsic-size: auto 184px;
    }
}

.agenda-item.done {
    opacity: 0.58;
}

.agenda-checkbox {
    border-color: rgba(34, 197, 94, 0.45);
}

.agenda-checkbox.checked {
    background: linear-gradient(135deg, #10b981, #22c55e);
    border-color: #22c55e;
}

.agenda-checkbox.checked::after {
    content: '✓';
}

.agenda-item-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding-right: 60px;
}

.agenda-item-title {
    color: var(--text-primary);
}

.agenda-item-desc {
    color: var(--text-secondary);
    margin-bottom: 6px;
    line-height: 1.55;
}

.agenda-item-meta {
    gap: 8px;
}

.agenda-item-date,
.agenda-item-time {
    color: #6ee7b7;
    font-weight: 600;
}

.agenda-item-category {
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
}

.agenda-item-author {
    color: var(--text-muted);
}

.agenda-status-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.agenda-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 5px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.25px;
    white-space: nowrap;
}

.agenda-status-pill.live {
    background: rgba(34, 197, 94, 0.14);
    border: 1px solid rgba(34, 197, 94, 0.24);
    color: #86efac;
}

.agenda-status-pill.overdue {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.24);
    color: #fca5a5;
}

.agenda-item-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.agenda-quick-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.agenda-quick-chip:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.agenda-item-actions {
    top: 10px;
    right: 10px;
}

.agenda-item-actions button {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    color: var(--text-muted);
}

.agenda-item-actions button:hover {
    color: var(--text-primary);
}

.agenda-empty {
    color: var(--text-muted);
}

.agenda-comment-section {
    padding-top: 10px;
}

.agenda-comment-toggle {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.14);
    color: #86efac;
    border-radius: 999px;
}

.agenda-comment-toggle:active {
    background: rgba(34, 197, 94, 0.18);
}

.agenda-editor-modal-card {
    max-width: 430px;
    max-height: min(88vh, 760px);
    border-radius: 24px;
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.16), transparent 38%),
        linear-gradient(180deg, rgba(24, 24, 30, 0.98), rgba(18, 18, 24, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.agenda-editor-body {
    padding-top: 14px;
}

.agenda-editor-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.agenda-editor-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agenda-editor-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.2px;
}

.agenda-editor-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.agenda-inline-link {
    border: none;
    background: transparent;
    color: #86efac;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 0;
}

.agenda-inline-link:active {
    transform: scale(0.98);
}

.agenda-editor-datetime-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 118px;
    gap: 10px;
}

.agenda-editor-datetime-grid.hidden {
    display: none;
}

.agenda-editor-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.agenda-editor-actions > * {
    flex: 1;
}

.agenda-editor-cancel {
    min-height: 44px;
}

.agenda-editor-submit {
    justify-content: center;
}

.agenda-editor-submit:disabled {
    opacity: 0.65;
    cursor: wait;
    box-shadow: none;
}

@media (max-width: 420px) {
    .agenda-editor-datetime-grid {
        grid-template-columns: 1fr;
    }

    .agenda-editor-actions {
        flex-direction: column;
    }
}

/* ==================== QUOTES VIEW ==================== */
.quotes-add-form {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.quotes-list {
    padding: 8px 16px 80px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quotes-user-group {
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.quotes-user-header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
}

.quotes-user-header:active {
    background: rgba(255, 255, 255, 0.05);
}

.quotes-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.quotes-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.quotes-user-name {
    flex: 1;
    font-weight: 600;
    font-size: 15px;
    color: #e0e0e0;
}

.quotes-user-count {
    font-size: 12px;
    color: #888;
    padding: 2px 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 10px;
}

.quotes-user-arrow {
    font-size: 14px;
    color: #666;
    transition: transform 0.2s;
}

.quotes-user-group.open .quotes-user-arrow {
    transform: rotate(180deg);
}

.quotes-user-items {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quotes-user-group.open .quotes-user-items {
    display: block;
}

.quote-item {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
}

.quote-item:last-child {
    border-bottom: none;
}

.quote-text {
    font-size: 15px;
    color: #d0d0d0;
    line-height: 1.5;
    font-style: italic;
    margin-bottom: 6px;
}

.quote-text::before {
    content: '"';
    font-size: 24px;
    color: rgba(236, 72, 153, 0.4);
    font-weight: bold;
    margin-right: 2px;
}

.quote-text::after {
    content: '"';
    font-size: 24px;
    color: rgba(236, 72, 153, 0.4);
    font-weight: bold;
    margin-left: 2px;
}

.quote-meta {
    font-size: 12px;
    color: #666;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.quote-reaction-wrap {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.quote-reactions-summary {
    margin-top: 0;
    margin-bottom: 0;
}

.quote-reaction-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.quote-reaction-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #f5f7fb;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.quote-reaction-btn.active {
    background: rgba(236, 72, 153, 0.14);
    border-color: rgba(236, 72, 153, 0.34);
}

.quote-reaction-btn:active {
    transform: scale(0.92);
}

.quote-actions {
    display: flex;
    gap: 4px;
}

.quote-actions button {
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 6px;
    width: 26px;
    height: 26px;
    color: #999;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}

.quote-actions button:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.quote-dm-btn {
    background: rgba(139, 92, 246, 0.15);
    border: none;
    border-radius: 12px;
    padding: 2px 10px;
    font-size: 11px;
    color: #a78bfa;
    cursor: pointer;
    transition: all 0.2s;
}

.quote-dm-btn:active {
    background: rgba(139, 92, 246, 0.3);
}

.quote-comment-toggle {
    font-size: 12px;
    color: #888;
    padding: 6px 0 2px;
    cursor: pointer;
    user-select: none;
    transition: color 0.2s;
}

.quote-comment-toggle:active {
    color: #aaa;
}

.quote-comment-arrow {
    font-size: 10px;
    margin-left: 4px;
}

.quote-comments-section {
    display: none;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 6px;
    padding-top: 6px;
}

.quote-comments-section.open {
    display: block;
    animation: fadeSlideIn 0.2s ease;
}

.quote-comment-input-row {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.quote-comment-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 7px 12px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.quote-comment-input:focus {
    border-color: rgba(139, 92, 246, 0.5);
}

.quote-comment-send {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border: none;
    border-radius: 50%;
    width: 34px;
    height: 34px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.quote-comment-send:active {
    transform: scale(0.9);
}

.qc-comment {
    display: flex;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.qc-comment:last-child {
    border-bottom: none;
}

.qc-avatar {
    flex-shrink: 0;
    margin-top: 2px;
}

.qc-body {
    flex: 1;
    min-width: 0;
}

.qc-header {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
}

.qc-name {
    font-size: 12px;
    font-weight: 700;
    color: #a78bfa;
    cursor: pointer;
}

.qc-name:active {
    opacity: 0.7;
}

.qc-time {
    font-size: 10px;
    color: #666;
}

.qc-text {
    font-size: 13px;
    color: #ccc;
    line-height: 1.4;
    word-break: break-word;
}

.qc-actions {
    display: flex;
    gap: 4px;
    margin-top: 2px;
}

.qc-action-btn {
    background: none;
    border: none;
    padding: 2px 4px;
    font-size: 11px;
    color: #888;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.qc-action-btn:active {
    background: rgba(255, 255, 255, 0.08);
}

.chat-location-map {
    width: 240px;
    height: 150px;
    border-radius: 10px;
    cursor: pointer;
    z-index: 0;
}

.chat-location-label {
    font-size: 12px;
    color: #aaa;
    margin-top: 4px;
    font-weight: 500;
}

.msg-location {
    margin-bottom: 4px;
}

.live-location-banner {
    background: linear-gradient(135deg, #c62828, #e53935);
    padding: 10px 16px;
    border-radius: 0;
}

.live-location-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.live-loc-pulse {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ff5252;
    animation: livePulse 1.5s infinite;
    flex-shrink: 0;
}

@keyframes livePulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 0 0 rgba(255, 82, 82, 0.7);
    }

    50% {
        opacity: 0.6;
        box-shadow: 0 0 0 8px rgba(255, 82, 82, 0);
    }
}

.live-loc-stop-btn {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 5px 14px;
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.live-loc-stop-btn:active {
    background: rgba(255, 255, 255, 0.35);
}

/* ==================== ANNOUNCEMENT CHANNEL ==================== */
.announce-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding:
        calc(env(safe-area-inset-top, 44px) + 14px)
        calc(env(safe-area-inset-right, 0px) + 16px)
        14px
        calc(env(safe-area-inset-left, 0px) + 16px);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.08), transparent);
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
    flex-shrink: 0;
}

.announce-header-main {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.announce-back-btn {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.announce-back-btn:active {
    transform: scale(0.95);
}

.announce-header-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.announce-create-btn {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    border: none;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
    transition: transform 0.15s, box-shadow 0.15s;
}

.announce-create-btn:active {
    transform: scale(0.95);
    box-shadow: 0 1px 4px rgba(245, 158, 11, 0.2);
}

.announce-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px 80px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.announce-card {
    background: #1a1f2e;
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 16px;
    padding: 16px;
    position: relative;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.announce-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.announce-card-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

.announce-card-meta {
    flex: 1;
    min-width: 0;
}

.announce-card-author {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
}

.announce-card-time {
    font-size: 11px;
    color: #888;
    margin-top: 1px;
}

.announce-expiry-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.14);
    border: 1px solid rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.announce-card-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    line-height: 1.3;
}

.announce-card-body {
    font-size: 14px;
    color: #b0b8c8;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.announce-card-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.announce-action-btn {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 10px;
    transition: all 0.15s;
}

.announce-action-btn:active {
    background: rgba(245, 158, 11, 0.2);
    transform: scale(0.96);
}

.announce-comments {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    display: none;
}

.announce-comments.open {
    display: block;
}

.announce-comment {
    display: flex;
    gap: 8px;
    padding: 8px 0;
}

.announce-comment-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.announce-comment-body {
    flex: 1;
    min-width: 0;
}

.announce-comment-name {
    font-size: 12px;
    font-weight: 700;
    color: #fbbf24;
}

.announce-comment-text {
    font-size: 13px;
    color: #c8cdd8;
    line-height: 1.4;
    margin-top: 2px;
}

.announce-comment-time {
    font-size: 10px;
    color: #666;
    margin-top: 2px;
    display: block;
}

.announce-comment-input-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.announce-comment-input {
    flex: 1;
    background: #141824;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 8px 14px;
    color: #e0e0e0;
    font-size: 13px;
    outline: none;
    font-family: inherit;
}

.announce-comment-input:focus {
    border-color: rgba(245, 158, 11, 0.5);
}

.announce-comment-send {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    border-radius: 999px;
    min-width: 72px;
    height: 36px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
    padding: 0 14px;
}

.announce-comment-send:active {
    transform: scale(0.9);
}

.announce-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.16);
    color: #888;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 999px;
    transition: all 0.15s;
}

.announce-delete-btn:active {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.2);
}

.announce-create-modal-content {
    max-width: 400px;
}

.announce-create-title {
    margin: 0 0 4px;
    font-size: 17px;
    color: #fff;
    font-family: var(--font-display);
    font-weight: 700;
}

.announce-create-subtitle {
    margin: 0 0 14px;
    font-size: 13px;
    color: #8b93a5;
}

.announce-create-input,
.announce-create-textarea {
    width: 100%;
    background: #141824;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px 14px;
    color: #e0e0e0;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.announce-create-input {
    margin-bottom: 10px;
}

.announce-create-select {
    appearance: none;
    cursor: pointer;
    transition: background 0.18s ease, transform 0.18s ease;
}

.announce-create-textarea {
    resize: vertical;
}

.announce-create-hint {
    margin-top: 2px;
    color: #8b93a5;
    font-size: 12px;
    line-height: 1.45;
}

.announce-create-input:focus,
.announce-create-textarea:focus {
    border-color: rgba(245, 158, 11, 0.45);
}

.announce-create-input::placeholder,
.announce-create-textarea::placeholder {
    color: #8b93a5;
}

.announce-create-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.announce-create-cancel,
.announce-create-submit {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease;
}

.announce-create-cancel {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #141824;
    color: #a8afbf;
}

.announce-create-submit {
    border: none;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 10px rgba(245, 158, 11, 0.3);
}

.announce-create-cancel:active,
.announce-create-submit:active {
    transform: scale(0.98);
}

/* ---- Modal Content (used by announcement & disappearing messages) ---- */
.modal-content {
    background: var(--theme-surface-fill);
    border: 1px solid var(--theme-surface-border);
    border-radius: var(--theme-surface-radius);
    padding: 24px;
    width: 90%;
    box-shadow: var(--theme-surface-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(var(--theme-surface-blur)) saturate(var(--theme-surface-saturation));
    -webkit-backdrop-filter: blur(var(--theme-surface-blur)) saturate(var(--theme-surface-saturation));
    animation: modalPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==================== DISAPPEARING MESSAGES ==================== */
.dm-disappear-indicator {
    font-size: 10px;
    color: #f59e0b;
    display: flex;
    align-items: center;
    gap: 3px;
}

.dm-disappear-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 6px;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.dm-disappear-active .dm-call-btn#btn-dm-disappear {
    color: #f59e0b;
}

.disappear-modal-content {
    max-width: 340px;
}

.disappear-title {
    margin: 0 0 4px;
    font-size: 1.12rem;
    color: #fff;
    font-weight: 800;
}

.disappear-subtitle {
    margin: 0 0 18px;
    font-size: 0.84rem;
    color: #96a2bb;
    line-height: 1.45;
}

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

.disappear-opt {
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #141824;
    color: #c7d1e3;
    font-size: 0.94rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    transition: all 0.18s ease;
}

.disappear-opt.active {
    border-color: rgba(245, 158, 11, 0.55);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.12));
    color: #ffc766;
    box-shadow: 0 8px 20px rgba(245, 158, 11, 0.16);
}

.disappear-opt:hover {
    border-color: rgba(245, 158, 11, 0.32);
}

.disappear-opt:active {
    transform: scale(0.97);
}

.home-card-emoji {
    width: 52px;
    min-width: 52px;
    height: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    line-height: 1;
    flex-shrink: 0;
    overflow: visible;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.3));
}

.home-card-body {
    flex: 1;
    min-width: 0;
}

.home-card-title {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.home-card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.home-card-arrow {
    font-size: 24px;
    color: var(--text-muted);
    font-weight: 300;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.home-card:hover .home-card-arrow {
    transform: translateX(4px);
    color: var(--text-secondary);
}

.home-footer {
    text-align: center;
    padding: 32px 20px;
    color: var(--text-muted);
    font-size: 12px;
}

.app-version-label {
    font-size: 10px !important;
    color: var(--text-tertiary) !important;
    opacity: 0.35;
    margin-top: 8px;
    font-weight: 400 !important;
    letter-spacing: 0.5px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.home-ai-launcher {
    position: fixed;
    right: calc(env(safe-area-inset-right, 0px) + 18px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + 18px);
    z-index: 72;
    pointer-events: none;
}

.home-ai-fab {
    pointer-events: auto;
    min-width: 138px;
    min-height: 58px;
    padding: 10px 14px 10px 10px;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.26);
    border-radius: 999px;
    background:
        radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.26), transparent 34%),
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.12)),
        var(--theme-surface-fill);
    color: var(--theme-surface-text-primary);
    box-shadow: var(--theme-surface-shadow), 0 14px 30px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(min(12px, var(--theme-surface-blur))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(12px, var(--theme-surface-blur))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.home-ai-fab.has-unseen-update {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.44);
    box-shadow:
        var(--theme-surface-shadow),
        0 18px 36px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24),
        0 0 0 1px rgba(255, 255, 255, 0.08);
}

.home-ai-fab.has-unseen-update::after {
    content: attr(data-unread-count);
    position: absolute;
    top: -8px;
    right: -6px;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(135deg, #ff5f6d, #ffc371);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0.01em;
    box-shadow:
        0 10px 20px rgba(255, 95, 109, 0.28),
        0 0 0 2px rgba(10, 17, 31, 0.82);
    animation: homeAiUnreadPulse 2.2s ease-in-out infinite;
}

.home-ai-fab:hover {
    transform: translateY(-1px);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.38);
    box-shadow: var(--theme-surface-shadow), 0 18px 36px rgba(0, 0, 0, 0.26);
}

.home-ai-fab.is-open {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.42);
    box-shadow: var(--theme-surface-shadow), 0 20px 38px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
}

.home-ai-fab:active {
    transform: scale(0.98);
}

.home-ai-fab-orb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex: 0 0 auto;
    background:
        radial-gradient(circle at 34% 34%, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.16) 30%, transparent 32%),
        linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.18) inset,
        0 10px 22px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.26);
    position: relative;
}

.home-ai-fab-orb::after {
    content: '✦';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.98);
    font-size: 16px;
    font-weight: 900;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.24);
}

.home-ai-fab.has-unseen-update .home-ai-fab-orb {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.22) inset,
        0 10px 22px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28),
        0 0 22px rgba(var(--accent-secondary-rgb, 59, 130, 246), 0.2);
}

@keyframes homeAiUnreadPulse {
    0%, 100% {
        transform: scale(1);
        filter: saturate(1);
    }
    50% {
        transform: scale(1.08);
        filter: saturate(1.08);
    }
}

.home-ai-fab-copy {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-width: 0;
}

.home-ai-fab-copy strong {
    color: var(--theme-surface-text-primary);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.1;
}

.home-ai-fab-copy small {
    color: var(--theme-surface-text-secondary);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-ai-overlay {
    position: fixed;
    inset: 0;
    z-index: 142;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding:
        calc(env(safe-area-inset-top, 0px) + 18px)
        calc(env(safe-area-inset-right, 0px) + 18px)
        calc(env(safe-area-inset-bottom, 0px) + 18px)
        calc(env(safe-area-inset-left, 0px) + 18px);
    background: rgba(4, 7, 14, 0.42);
    animation: fadeIn 0.2s ease;
}

.home-ai-overlay.hidden {
    display: none;
}

.home-ai-panel {
    width: min(420px, 100%);
    max-height: min(76vh, 680px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 16px;
    border-radius: 28px;
    border: 1px solid var(--theme-inline-border-strong);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), transparent 34%),
        radial-gradient(circle at bottom left, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.12), transparent 42%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03)),
        var(--theme-surface-fill);
    color: var(--theme-surface-text-primary);
    box-shadow: var(--theme-surface-shadow), 0 28px 62px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(min(14px, var(--theme-surface-blur))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(14px, var(--theme-surface-blur))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    overflow: hidden;
    position: relative;
}

.home-ai-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.home-ai-panel-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.home-ai-panel-copy strong {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--theme-surface-text-primary);
}

.home-ai-panel-copy span {
    color: var(--theme-surface-text-secondary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
}

.home-ai-panel-close {
    width: 34px;
    height: 34px;
    border: 1px solid var(--theme-inline-border);
    border-radius: 999px;
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-secondary);
    cursor: pointer;
    flex: 0 0 auto;
    transition: transform 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.home-ai-panel-close:hover {
    border-color: var(--theme-inline-border-strong);
    filter: brightness(1.05);
}

.home-ai-panel-close:active {
    transform: scale(0.95);
}

.home-ai-messages {
    flex: 1 1 auto;
    min-height: 180px;
    max-height: min(42vh, 360px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-right: 2px;
}

.home-ai-empty {
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.home-ai-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 88%;
}

.home-ai-message.assistant {
    align-self: flex-start;
}

.home-ai-message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.home-ai-bubble {
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-primary);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-word;
}

.home-ai-message.assistant .home-ai-bubble {
    -webkit-touch-callout: default;
}

.home-ai-message.user .home-ai-bubble {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22);
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.16), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.12));
}

.home-ai-meta {
    color: var(--theme-surface-text-tertiary);
    font-size: 11px;
    font-weight: 700;
    padding: 0 4px;
}

.home-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex-shrink: 0;
}

.home-ai-suggestion {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.home-ai-sug-icon {
    flex-shrink: 0;
    opacity: 0.7;
}

.home-ai-suggestion:hover {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.3);
    color: var(--theme-surface-text-primary);
}

.home-ai-suggestion:hover .home-ai-sug-icon {
    opacity: 1;
}

.home-ai-suggestion:active {
    transform: scale(0.98);
}

.home-ai-composer {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 4px;
    flex-shrink: 0;
}

.home-ai-pending-images {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.home-ai-pending-images::-webkit-scrollbar {
    display: none;
}

.home-ai-pending-images.hidden {
    display: none;
}

.home-ai-pending-image {
    position: relative;
    width: 58px;
    min-width: 58px;
    border-radius: 14px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    padding: 4px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.home-ai-pending-image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.08);
}

.home-ai-pending-image-meta {
    margin-top: 3px;
    color: var(--theme-surface-text-secondary);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.home-ai-pending-image-remove {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
    border-radius: 999px;
    background: rgba(18, 24, 38, 0.86);
    color: #fff;
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.22);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.home-ai-pending-image-remove:active {
    transform: scale(0.95);
}

.home-ai-pending-pdf {
    position: relative;
    min-width: 58px;
    max-width: 90px;
    border-radius: 14px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.12);
}

.home-ai-pending-pdf-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-primary);
}

.home-ai-pending-pdf-name {
    font-size: 9px;
    font-weight: 700;
    color: var(--theme-surface-text-secondary);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    line-height: 1.2;
}

.home-ai-pending-pdf-meta {
    font-size: 8px;
    font-weight: 600;
    color: var(--theme-surface-text-tertiary);
}

.home-ai-pending-pdf .home-ai-pending-image-remove {
    top: -5px;
    right: -5px;
}

.home-ai-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.home-ai-attach-wrap {
    position: relative;
    flex-shrink: 0;
}

.home-ai-plus-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-secondary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.home-ai-plus-btn:hover {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.34);
    color: var(--accent-primary);
}

.home-ai-plus-btn:active {
    transform: scale(0.94);
}

.home-ai-plus-btn.is-open {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.32);
    color: var(--accent-primary);
    transform: rotate(45deg);
}

.home-ai-attach-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 140px;
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--theme-inline-border-strong);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
        var(--theme-surface-fill);
    box-shadow: var(--theme-surface-shadow), 0 16px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 6;
    animation: homeAiMenuIn 0.18s ease;
}

.home-ai-attach-menu.hidden {
    display: none;
}

@keyframes homeAiMenuIn {
    from {
        opacity: 0;
        transform: translateY(6px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.home-ai-attach-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--theme-surface-text-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    white-space: nowrap;
}

.home-ai-attach-option svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.home-ai-attach-option:hover {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.1);
}

.home-ai-attach-option:active {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
}

.home-ai-composer textarea {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    max-height: 100px;
    resize: none;
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-primary);
    font: inherit;
    font-size: 13px;
    line-height: 1.45;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.home-ai-composer textarea::placeholder {
    color: var(--theme-surface-text-tertiary);
}

.home-ai-composer textarea:focus {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.34);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
}

.home-ai-composer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-ai-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

.home-ai-clear-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
}

.home-ai-quick-wrap {
    position: relative;
}

.home-ai-quick-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-secondary);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.home-ai-quick-btn svg {
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.18s ease;
}

.home-ai-quick-btn:hover {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.3);
    color: var(--theme-surface-text-primary);
}

.home-ai-quick-btn:hover svg {
    opacity: 1;
}

.home-ai-quick-btn.is-open {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.32);
    color: var(--accent-primary);
}

.home-ai-quick-btn.is-open svg {
    opacity: 1;
}

.home-ai-quick-btn:active {
    transform: scale(0.94);
}

.home-ai-quick-btn:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
    filter: grayscale(0.08);
}

.home-ai-quick-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    min-width: 280px;
    padding: 10px;
    border-radius: 16px;
    border: 1px solid var(--theme-inline-border-strong);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
        var(--theme-surface-fill);
    box-shadow: var(--theme-surface-shadow), 0 16px 36px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(12px) saturate(1.3);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    z-index: 6;
    animation: homeAiMenuIn 0.18s ease;
}

.home-ai-quick-menu.hidden {
    display: none;
}

.home-ai-quick-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    padding: 12px 6px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--theme-surface-text-primary);
    font-size: 11px;
    line-height: 1.25;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.14s ease, color 0.14s ease;
    white-space: normal;
}

.home-ai-quick-option svg {
    flex-shrink: 0;
    opacity: 0.7;
    width: 20px;
    height: 20px;
}

.home-ai-quick-option:hover {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.1);
}

.home-ai-quick-option:active {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
}

.home-ai-quick-option:disabled {
    opacity: 0.5;
    cursor: default;
}

.home-ai-send-btn {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    box-shadow: 0 8px 18px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    padding: 0;
}

.home-ai-send-btn:disabled,
.home-ai-clear-btn:disabled,
.home-ai-suggestion:disabled {
    opacity: 0.5;
    cursor: default;
    transform: none;
    filter: grayscale(0.08);
}

.home-ai-send-btn:active,
.home-ai-clear-btn:active {
    transform: scale(0.94);
}

.home-ai-confirm-overlay {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(4, 7, 14, 0.58);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.home-ai-confirm-overlay.hidden {
    display: none !important;
}

.home-ai-confirm-card {
    width: min(100%, 340px);
    padding: 18px;
    border-radius: 24px;
    border: 1px solid var(--theme-inline-border-strong);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
        var(--theme-surface-fill);
    box-shadow: var(--theme-surface-shadow), 0 22px 44px rgba(0, 0, 0, 0.26);
    color: var(--theme-surface-text-primary);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.home-ai-confirm-icon {
    font-size: 34px;
    line-height: 1;
}

.home-ai-confirm-title {
    color: var(--theme-surface-text-primary);
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
}

.home-ai-confirm-text {
    color: var(--theme-surface-text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.home-ai-confirm-actions {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.home-ai-confirm-btn {
    flex: 1;
    min-height: 44px;
    border-radius: 16px;
    border: 1px solid var(--theme-inline-border);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, border-color 0.18s ease;
}

.home-ai-confirm-btn.cancel {
    background: var(--theme-inline-surface);
    color: var(--theme-surface-text-secondary);
}

.home-ai-confirm-btn.danger {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
}

.home-ai-confirm-btn:active {
    transform: scale(0.98);
}

.home-ai-bubble-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.home-ai-bubble-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.home-ai-bubble-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.1);
    color: var(--theme-surface-text-secondary);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.home-ai-bubble-badge.search {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.26);
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.12)),
        color-mix(in srgb, var(--bg-card) 86%, rgba(255, 255, 255, 0.08) 14%);
    color: var(--theme-surface-text-primary);
}

.home-ai-bubble-badge.search.is-live {
    box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.16), 0 10px 24px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    animation: homeAiSearchPulse 1.8s ease-in-out infinite;
}

.home-ai-bubble-attachment-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.09);
    color: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.home-ai-bubble-text:empty {
    display: none;
}

.home-ai-bubble-text,
.home-ai-bubble-text * {
    -webkit-user-select: text;
    user-select: text;
}

.home-ai-message.assistant .home-ai-bubble-text {
    cursor: text;
}

@keyframes homeAiSearchPulse {
    0%, 100% {
        transform: translateY(0);
        box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14), 0 8px 18px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
    }
    50% {
        transform: translateY(-1px);
        box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22), 0 14px 28px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    }
}

.home-ai-typing {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.home-ai-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.28;
    animation: homeAiTyping 1.1s ease-in-out infinite;
}

.home-ai-typing span:nth-child(2) {
    animation-delay: 0.16s;
}

.home-ai-typing span:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes homeAiTyping {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.28;
    }

    40% {
        transform: translateY(-4px);
        opacity: 0.84;
    }
}

html.native-app.native-home-active .home-ai-fab,
html.native-app.native-home-active .home-ai-panel {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

html.native-app .home-ai-overlay {
    background: rgba(4, 7, 14, 0.56);
}

html.native-app .home-ai-panel {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22), transparent 36%),
        radial-gradient(circle at bottom left, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.16), transparent 44%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
        color-mix(in srgb, var(--bg-card) 82%, rgba(12, 18, 28, 0.96) 18%);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
}

html.native-app .home-ai-bubble,
html.native-app .home-ai-empty,
html.native-app .home-ai-suggestion,
html.native-app .home-ai-pending-image,
html.native-app .home-ai-pending-pdf,
html.native-app .home-ai-composer textarea,
html.native-app .home-ai-clear-btn,
html.native-app .home-ai-quick-btn,
html.native-app .home-ai-plus-btn {
    background: color-mix(in srgb, var(--bg-card) 84%, rgba(12, 18, 28, 0.94) 16%);
}

html.native-app .home-ai-message.user .home-ai-bubble {
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.18)),
        color-mix(in srgb, var(--bg-card) 82%, rgba(12, 18, 28, 0.9) 18%);
}

@media (max-width: 640px) {
    .home-ai-launcher {
        right: calc(env(safe-area-inset-right, 0px) + 14px);
        left: auto;
        bottom: calc(env(safe-area-inset-bottom, 0px) + 14px);
    }

    .home-ai-fab {
        min-width: 0;
        padding-right: 12px;
    }

    .home-ai-overlay {
        padding:
            calc(env(safe-area-inset-top, 0px) + 10px)
            calc(env(safe-area-inset-right, 0px) + 10px)
            calc(env(safe-area-inset-bottom, 0px) + 10px)
            calc(env(safe-area-inset-left, 0px) + 10px);
        align-items: flex-end;
        justify-content: stretch;
    }

    .home-ai-panel {
        width: 100%;
        height: calc(100dvh - (env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + 20px));
        min-height: min(84vh, 760px);
        max-height: calc(100dvh - (env(safe-area-inset-top, 0px) + env(safe-area-inset-bottom, 0px) + 20px));
        border-radius: 28px;
        gap: 12px;
    }

    .home-ai-messages {
        min-height: 0;
        max-height: none;
    }

    .home-ai-composer {
        margin-top: auto;
    }

    .home-ai-composer textarea {
        max-height: 80px;
    }

    .home-ai-pending-image {
        width: 52px;
        min-width: 52px;
    }

    .home-ai-message {
        max-width: 94%;
    }
}

/* ============================================
   Chat View
   ============================================ */
#view-chat {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
}

#view-chat.hidden {
    display: none !important;
}

.chat-tab-bar {
    display: flex;
    gap: 0;
    padding:
        calc(env(safe-area-inset-top, 44px) + 10px)
        calc(env(safe-area-inset-right, 0px) + 16px)
        10px
        calc(env(safe-area-inset-left, 0px) + 16px);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
    flex-shrink: 0;
    align-items: center;
}

.chat-tab-back {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 8px 4px 0;
    line-height: 1;
    transition: color 0.2s;
    flex-shrink: 0;
}

.chat-tab-back:active {
    color: var(--accent-primary);
    transform: scale(0.9);
}

.chat-tab {
    flex: 1;
    padding: 8px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.chat-tab.active {
    color: var(--accent-primary);
}

.chat-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.chat-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}

.chat-panel.hidden {
    display: none;
}

.dm-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.dm-list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.dm-list-item:active {
    background: rgba(255, 255, 255, 0.06);
}

.dm-list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
}

.dm-list-info {
    flex: 1;
    min-width: 0;
}

.dm-list-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.dm-list-last {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.dm-list-time {
    font-size: 10px;
    color: var(--text-muted);
    flex-shrink: 0;
    align-self: flex-start;
    margin-top: 2px;
}

.dm-list-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 16px;
    opacity: 0.5;
}

.dm-conv-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding:
        calc(env(safe-area-inset-top, 44px) + 10px)
        calc(env(safe-area-inset-right, 0px) + 16px)
        10px
        calc(env(safe-area-inset-left, 0px) + 16px);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.dm-back-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.dm-conv-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
}

.dm-conv-name-wrap {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.dm-conv-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

/* ---- Online Presence Indicators ---- */
.online-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #555;
    border: 2px solid var(--bg-primary, #0f0f1a);
    opacity: 0;
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.online-dot.is-online {
    opacity: 1;
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
    animation: onlinePulse 2s ease-in-out infinite;
}

@keyframes onlinePulse {

    0%,
    100% {
        box-shadow: 0 0 4px rgba(34, 197, 94, 0.4);
    }

    50% {
        box-shadow: 0 0 10px rgba(34, 197, 94, 0.7);
    }
}

.dm-conv-status {
    font-size: 11px;
    color: var(--text-muted, #888);
    margin-top: 1px;
    transition: color 0.3s ease;
    line-height: 1.2;
}

.dm-conv-status.is-online {
    color: #22c55e;
    font-weight: 600;
}

.dm-list-status {
    font-size: 10px;
    color: var(--text-muted, #888);
    font-weight: 500;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.dm-list-status.is-online {
    color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    font-weight: 600;
}

.dm-list-last.is-online {
    color: #22c55e !important;
    font-weight: 600;
}

.dm-conv-avatar .online-dot {
    width: 10px;
    height: 10px;
    bottom: 0;
    right: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-bubble-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    max-width: 82%;
    animation: fadeSlideIn 0.2s ease;
    position: relative;
    margin-bottom: 2px;
}

.chat-bubble-wrapper.mine {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-bubble-wrapper.other {
    align-self: flex-start;
}

.chat-bubble-wrapper.first-in-group {
    margin-top: 10px;
}

.chat-bubble-wrapper.mentioned-for-me .chat-bubble {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.38);
    box-shadow:
        0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14),
        0 14px 28px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
}

.chat-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    flex-shrink: 0;
    margin-bottom: 2px;
    overflow: hidden;
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-bubble-wrapper.other .chat-avatar {
    margin-right: 8px;
}

.chat-bubble-wrapper.mine .chat-avatar {
    display: none;
}

.chat-avatar.hidden-avatar {
    visibility: hidden;
}

.chat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-sender {
    font-size: 11px;
    font-weight: 700;
    margin-bottom: 2px;
    padding-left: 4px;
    cursor: pointer;
}

.chat-sender:active {
    opacity: 0.6;
}

.mine .chat-sender {
    display: none;
}

.chat-bubble {
    padding: 8px 12px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    position: relative;
}

.mine .chat-bubble {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.22), rgba(16, 185, 129, 0.18));
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-bottom-right-radius: 6px;
    color: var(--text-primary);
}

.other .chat-bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-bottom-left-radius: 6px;
    color: var(--text-primary);
}

.chat-msg-text {
    display: inline;
}

.chat-mention-bubble-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    padding: 5px 9px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
    color: var(--accent-primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-deleted-placeholder {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 20px;
    color: var(--text-secondary);
    font-size: 13px;
    font-style: italic;
    opacity: 0.9;
}

.chat-deleted-placeholder::before {
    content: '🗑️';
    font-style: normal;
    opacity: 0.9;
}

.chat-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--text-muted);
    float: right;
    margin-top: 4px;
    margin-left: 10px;
    line-height: 1;
}

.chat-time .check {
    font-size: 11px;
    margin-left: 2px;
    letter-spacing: -3px;
}

.chat-time .check.blue-ticks {
    color: #53bdeb;
}

.dm-pinned-bar {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-primary);
    padding: 0;
    flex-shrink: 0;
}

.dm-pinned-bar-inner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.15s;
}

.dm-pinned-bar-inner:active {
    background: var(--bg-hover);
}

.dm-pinned-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.dm-pinned-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    overflow: hidden;
}

.dm-pinned-sender {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    line-height: 1.2;
    white-space: nowrap;
    flex-shrink: 0;
}

.dm-pinned-count {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary);
}

.dm-pinned-preview {
    display: block;
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.dm-pinned-counter {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
    padding: 2px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

.dm-pinned-expand {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}

.dm-pinned-list {
    border-top: 1px solid var(--border-subtle);
    max-height: 200px;
    overflow-y: auto;
}

.dm-pinned-item {
    display: flex;
    flex-direction: column;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
}

.dm-pinned-item:hover {
    background: var(--bg-hover);
}

.dm-pinned-item.active {
    border-left-color: var(--accent-primary);
    background: rgba(245, 158, 11, 0.06);
}

.dm-pinned-item-user {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
}

.dm-pinned-item-text {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-pin-indicator {
    font-size: 10px;
    color: var(--accent-primary);
    margin-bottom: 2px;
    font-weight: 600;
}

.dm-edited-label {
    font-size: 9px;
    color: var(--text-muted);
    font-style: italic;
    margin-right: 4px;
}

.dm-edit-textarea {
    width: calc(100% - 32px);
    margin: 0 16px 12px;
    padding: 10px 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
}

.dm-edit-textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.highlight-msg {
    animation: highlightPulse 2s ease;
}

@keyframes highlightPulse {

    0%,
    100% {
        background: transparent;
    }

    20%,
    50% {
        background: rgba(var(--accent-primary-rgb, 59, 130, 246), 0.15);
        border-radius: 12px;
    }
}

.dm-read-info-popup {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    padding: 8px 0;
    min-width: 220px;
    max-width: 280px;
    opacity: 0;
    transform: translateY(8px) scale(0.95);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.dm-read-info-popup.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.dm-read-info-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
}

.dm-read-info-row+.dm-read-info-row {
    border-top: 1px solid var(--border-subtle);
}

.dm-read-info-row.pending {
    opacity: 0.5;
}

.dm-read-info-icon {
    font-size: 14px;
    letter-spacing: -3px;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

.dm-read-info-icon.blue {
    color: #53bdeb;
}

.dm-read-info-detail {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dm-read-info-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dm-read-info-time {
    font-size: 10px;
    color: var(--text-muted);
}

.chat-time .check[onclick] {
    cursor: pointer;
    padding: 2px 4px;
    margin: -2px -4px;
    border-radius: 4px;
    transition: background 0.15s;
}

.chat-time .check[onclick]:hover {
    background: rgba(255, 255, 255, 0.1);
}

.account-photo-section {
    text-align: center;
    padding: 10px 0 20px;
}

.account-bio-input {
    resize: none;
    font-family: var(--font-primary);
    line-height: 1.5;
}

.account-bio-counter {
    text-align: right;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

.card-account {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.1));
    border-color: rgba(59, 130, 246, 0.2);
}

.home-bio {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    font-style: italic;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-date-divider {
    text-align: center;
    padding: 8px 0;
}

.chat-date-divider span {
    font-size: 10px;
    color: var(--text-muted);
    background: var(--bg-secondary);
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-weight: 500;
}

.chat-system-msg {
    display: flex;
    justify-content: center;
    padding: 6px 16px;
}

.chat-system-bubble {
    font-size: 11px;
    color: var(--text-tertiary);
    background: rgba(var(--accent-primary-rgb, 255, 165, 0), 0.08);
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.15);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    text-align: center;
    max-width: 85%;
    font-weight: 500;
}

.chat-input-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-header);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    padding-bottom: calc(14px + max(var(--safe-bottom), 8px));
}

.chat-input-area {
    position: relative;
    flex-shrink: 0;
}

.chat-upload-dock {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px 0;
    background: var(--bg-header);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.chat-upload-dock.hidden {
    display: none;
}

.chat-upload-dock:not(.hidden)+.chat-input-bar {
    border-top: none;
    padding-top: 8px;
}

.chat-mention-picker {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(100% - 6px);
    z-index: 30;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.96), rgba(16, 25, 43, 0.96));
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    max-height: min(240px, 42vh);
    overflow-y: auto;
}

.chat-mention-picker.hidden {
    display: none !important;
}

.media-caption-mention-picker {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    margin-top: 8px;
    max-height: 220px;
}

.chat-mention-item {
    width: 100%;
    border: 1px solid transparent;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.chat-mention-item:hover,
.chat-mention-item.active {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.35);
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
    transform: translateY(-1px);
}

.chat-mention-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.chat-mention-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-mention-avatar.ai {
    color: #fff;
    background: radial-gradient(circle at 35% 30%, #dbeafe 0%, #93c5fd 28%, #6366f1 72%, #312e81 100%);
}

.chat-mention-avatar.everyone {
    color: #fff7d6;
    background: radial-gradient(circle at 35% 30%, #fff7d6 0%, #fbbf24 26%, #f97316 74%, #7c2d12 100%);
}

.chat-mention-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-mention-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.chat-mention-meta {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-mention-badge {
    flex: 0 0 auto;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24);
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 700;
}

.chat-mention-draft {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 4px 2px;
}

.chat-mention-draft.hidden {
    display: none !important;
}

.chat-mention-chip {
    appearance: none;
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    padding: 9px 12px 9px 12px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    position: relative;
    text-align: left;
    font: inherit;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, filter 0.18s ease;
}

.chat-mention-chip:hover {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.3);
    filter: brightness(1.03);
}

.chat-mention-chip:active {
    transform: scale(0.985);
}

.chat-mention-chip.ai {
    border-color: rgba(143, 195, 255, 0.28);
    background: rgba(96, 165, 250, 0.12);
}

.chat-mention-chip.everyone {
    border-color: rgba(251, 191, 36, 0.3);
    background: rgba(245, 158, 11, 0.12);
}

.chat-mention-chip-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-mention-chip-label {
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.2;
}

.chat-mention-chip-meta {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
}

.chat-mention-chip-remove {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 900;
    line-height: 1;
    margin-top: 1px;
}

.chat-upload-card {
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.chat-upload-card.completed {
    border-color: rgba(34, 197, 94, 0.28);
    background: rgba(34, 197, 94, 0.08);
}

.chat-upload-card.error {
    border-color: rgba(239, 68, 68, 0.28);
    background: rgba(239, 68, 68, 0.08);
}

.chat-upload-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-upload-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-upload-batch {
    flex-shrink: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    background: rgba(var(--accent-primary-rgb, 255, 165, 0), 0.12);
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.18);
    padding: 2px 8px;
    border-radius: 999px;
}

.chat-upload-subtitle {
    font-size: 11px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.chat-upload-status {
    font-weight: 700;
}

.chat-upload-detail {
    font-size: 11px;
    color: var(--text-muted, rgba(255, 255, 255, 0.72));
    line-height: 1.35;
}

.chat-upload-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.chat-upload-fill {
    height: 100%;
    width: 0%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--accent-primary), #ef4444);
    transition: width 0.25s ease;
}

.chat-upload-card.completed .chat-upload-fill {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.chat-upload-card.error .chat-upload-fill {
    background: linear-gradient(90deg, #ef4444, #dc2626);
}

.chat-upload-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 11px;
    color: var(--text-muted);
}

.chat-input {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.chat-input:focus {
    border-color: var(--accent-primary);
}

.chat-input::placeholder {
    color: var(--text-muted);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border: none;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--transition-fast);
    box-shadow: 0 0 12px var(--accent-glow);
}

.chat-send-btn:active {
    transform: scale(0.9);
}

.chat-plus-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.25s ease;
}

.chat-plus-btn:hover {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.12);
}

.chat-plus-btn:active {
    transform: scale(0.88);
}

.chat-plus-btn.open {
    transform: rotate(45deg);
    color: var(--accent-primary);
}

.chat-attach-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}

.chat-attach-btn:hover {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.05);
}

.chat-attach-btn:active {
    transform: scale(0.9);
}

/* ===== Chat Attach Menu (WhatsApp-style +) ===== */
.chat-attach-menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.chat-attach-menu-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.chat-attach-menu-sheet {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 18px 18px 0 0;
    padding: 20px 16px;
    padding-bottom: calc(20px + max(var(--safe-bottom), 8px));
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    justify-content: center;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.3);
}

.chat-attach-menu-overlay.show .chat-attach-menu-sheet {
    transform: translateY(0);
}

.chat-attach-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    width: 80px;
    padding: 10px 4px;
    border-radius: 14px;
    transition: background 0.2s;
}

.chat-attach-menu-item:active {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(0.95);
}

.chat-attach-menu-item span {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}

.chat-attach-menu-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

.chat-attach-menu-item:active .chat-attach-menu-icon {
    transform: scale(0.9);
}

/* ===== Media Caption Modal ===== */
.media-caption-modal {
    position: fixed;
    inset: 0;
    z-index: 960;
    background: rgba(3, 8, 20, 0.64);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.media-caption-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.media-caption-sheet {
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.12));
    border-bottom: none;
    padding: 14px 14px calc(14px + max(var(--safe-bottom), 8px));
    transform: translateY(100%);
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.35);
}

.media-caption-modal.show .media-caption-sheet {
    transform: translateY(0);
}

.media-caption-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.media-caption-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: var(--text-primary);
}

.media-caption-close {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.15));
    background: var(--bg-secondary, rgba(255, 255, 255, 0.08));
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.media-caption-preview {
    position: relative;
    background: rgba(0, 0, 0, 0.24);
    border-radius: 14px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
    min-height: 180px;
    max-height: 260px;
    margin-bottom: 10px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-caption-thumb {
    width: 100%;
    height: 100%;
    max-height: 260px;
    object-fit: contain;
    display: block;
}

.media-caption-video-wrap {
    position: relative;
    width: 100%;
    height: 100%;
}

.media-caption-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.7);
    color: #fff;
    font-size: 22px;
    pointer-events: none;
}

.media-caption-file {
    width: 100%;
    min-height: 180px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.media-caption-file-icon {
    font-size: 28px;
    flex: 0 0 auto;
}

.media-caption-file-meta {
    min-width: 0;
    flex: 1;
}

.media-caption-file-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    word-break: break-word;
}

.media-caption-file-sub {
    margin-top: 3px;
    font-size: 12px;
    color: var(--text-muted);
}

.media-caption-count {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.media-caption-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 2px 2px 8px;
    margin-bottom: 8px;
    scrollbar-width: thin;
}

.media-caption-item {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.14));
    background: var(--bg-secondary, rgba(255, 255, 255, 0.08));
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.media-caption-item.active {
    outline: 2px solid var(--accent-primary, #f59e0b);
    outline-offset: 1px;
}

.media-caption-item img,
.media-caption-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.media-caption-item-icon {
    font-size: 26px;
}

.media-caption-item-badge {
    position: absolute;
    inset: auto 4px 4px auto;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #fff;
    background: rgba(15, 23, 42, 0.78);
    pointer-events: none;
}

.media-caption-item-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 999px;
    border: none;
    background: rgba(220, 38, 38, 0.9);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
}

.media-caption-add-tile {
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    border-radius: 12px;
    border: 1px dashed var(--border-subtle, rgba(255, 255, 255, 0.24));
    background: rgba(15, 23, 42, 0.22);
    color: var(--text-primary);
    font-size: 28px;
    line-height: 1;
    font-weight: 500;
    cursor: pointer;
}

.media-caption-input {
    width: 100%;
    min-height: 82px;
    resize: vertical;
    border-radius: 12px;
    border: 1px solid var(--border-subtle, rgba(255, 255, 255, 0.16));
    background: var(--bg-secondary, rgba(255, 255, 255, 0.06));
    color: var(--text-primary);
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.4;
    outline: none;
}

.media-caption-input:focus {
    border-color: var(--accent-primary, #f59e0b);
}

.media-caption-input::placeholder {
    color: var(--text-muted);
}

.media-caption-actions {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.media-caption-btn {
    flex: 1;
    height: 42px;
    border-radius: 12px;
    border: 1px solid transparent;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.media-caption-btn.cancel {
    background: var(--bg-secondary, rgba(255, 255, 255, 0.08));
    border-color: var(--border-subtle, rgba(255, 255, 255, 0.14));
    color: var(--text-secondary);
}

.media-caption-btn.send {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
}

.media-caption-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: saturate(0.7);
}

.chat-voice-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: color 0.2s, background 0.2s;
}

.chat-voice-btn:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.chat-voice-btn:active {
    transform: scale(0.9);
}

.chat-voice-btn.recording {
    color: #fff;
    background: #ef4444;
    animation: voicePulse 1s ease-in-out infinite;
}

@keyframes voicePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
    }
}

/* ========================================
   Chat Search Bar
   ======================================== */
.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: var(--card-bg, #1e1e2e);
    border-top: 1px solid var(--border-color, rgba(255, 255, 255, 0.08));
    z-index: 20;
}

.chat-search-bar.hidden {
    display: none;
}

.chat-search-input {
    flex: 1;
    background: var(--bg-secondary, rgba(255, 255, 255, 0.06));
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.1));
    border-radius: 20px;
    padding: 8px 14px;
    font-size: 14px;
    color: var(--text-primary, #fff);
    outline: none;
    transition: border-color 0.2s;
}

.chat-search-input:focus {
    border-color: var(--accent-primary, #f59e0b);
}

.chat-search-input::placeholder {
    color: var(--text-muted, rgba(255, 255, 255, 0.4));
}

.chat-search-count {
    font-size: 12px;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    white-space: nowrap;
    min-width: 38px;
    text-align: center;
}

.chat-search-nav-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.chat-search-nav-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--accent-primary, #f59e0b);
}

.chat-search-nav-btn:active {
    transform: scale(0.9);
}

.chat-search-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--text-muted, rgba(255, 255, 255, 0.5));
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.chat-search-close-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ef4444;
}

.chat-search-highlight {
    background: rgba(245, 158, 11, 0.35);
    border-radius: 2px;
    padding: 0 1px;
}

.chat-search-highlight.active {
    background: rgba(245, 158, 11, 0.7);
    color: #000;
    font-weight: 600;
}

.chat-message.search-highlight {
    background: rgba(245, 158, 11, 0.15);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3);
}

.chat-message.search-current {
    background: rgba(245, 158, 11, 0.3);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.6);
}

.chat-scroll-fab {
    position: absolute;
    bottom: 80px;
    right: 50%;
    transform: translateX(50%);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--card-bg, #1e1e2e);
    color: var(--text-secondary, rgba(255, 255, 255, 0.8));
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
    transition: opacity 0.3s, transform 0.3s;
    opacity: 0.9;
}

.chat-scroll-fab.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateX(50%) scale(0.8);
}

.chat-scroll-fab:hover {
    background: var(--accent-primary, #f59e0b);
    color: #000;
}

.chat-scroll-fab:active {
    transform: translateX(50%) scale(0.9);
}

.voice-recording-overlay {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.95);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    border-radius: 20px 20px 0 0;
    animation: slideUpSheet 0.3s ease;
}

.voice-recording-timer {
    font-size: 28px;
    font-weight: 700;
    color: #ef4444;
    font-variant-numeric: tabular-nums;
}

.voice-recording-waveform {
    display: flex;
    align-items: center;
    gap: 2px;
    height: 40px;
    width: 100%;
    max-width: 300px;
    justify-content: center;
}

.voice-recording-waveform div {
    width: 3px;
    background: #ef4444;
    border-radius: 2px;
    transition: height 0.05s;
}

.voice-recording-actions {
    display: flex;
    gap: 24px;
    align-items: center;
}

.voice-recording-cancel {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-recording-send {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px var(--accent-glow);
}

.chat-media-audio {
    max-width: 280px;
    margin-bottom: 4px;
}

.chat-media-preview {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    align-items: center;
    overflow-x: auto;
}

.chat-media-preview-item {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-media-preview-item img,
.chat-media-preview-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-media-preview-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.chat-media {
    max-width: 240px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 4px;
    cursor: pointer;
}

.chat-media img {
    width: 100%;
    display: block;
    border-radius: 8px;
}

.chat-media video {
    width: 100%;
    display: block;
    border-radius: 8px;
    max-height: 300px;
}

.chat-media.chat-media-video-thumb {
    position: relative;
    cursor: pointer;
    overflow: hidden;
}

.chat-media.chat-media-video-thumb img {
    width: 100%;
    display: block;
    border-radius: 10px;
}

.chat-video-fallback {
    width: 220px;
    height: 150px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
        #0f172a;
}

.chat-video-play-badge {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.62);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.chat-video-play-triangle {
    width: 0;
    height: 0;
    margin-left: 4px;
    border-left: 18px solid #fff;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
}

.chat-media-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 200px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.chat-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    border-left: 3px solid var(--accent-primary);
    flex-shrink: 0;
}

.chat-reply-bar.hidden {
    display: none;
}

/* Typing indicator (ala WhatsApp) */
.chat-typing-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
    font-size: 12.5px;
    font-style: italic;
    color: var(--accent-primary);
}

.chat-typing-bar.hidden {
    display: none;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: 2px;
}

.typing-dots i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent-primary);
    display: inline-block;
    animation: typingBounce 1.2s infinite ease-in-out;
}

.typing-dots i:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-dots i:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-3px);
        opacity: 1;
    }
}


.chat-reply-preview {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chat-reply-name {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
}

.chat-reply-text {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-reply-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.chat-reply-inline {
    padding: 6px 10px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid var(--accent-primary);
    border-radius: 4px;
    cursor: pointer;
}

.chat-reply-inline-name {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-primary);
    display: block;
}

.chat-reply-inline-text {
    font-size: 12px;
    color: var(--text-tertiary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 200px;
}

.chat-sender {
    cursor: pointer;
}

.other .chat-sender:active {
    opacity: 0.6;
}

.chat-bubble-wrapper {
    transition: transform 0.15s ease;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.chat-bubble-wrapper.swiping {
    transition: none;
}

.chat-swipe-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.chat-bubble-wrapper.mine .chat-swipe-icon {
    right: calc(100% + 8px);
}

.chat-bubble-wrapper.other .chat-swipe-icon {
    left: calc(100% + 8px);
}

.chat-swipe-icon.visible {
    opacity: 1;
}

.chat-bubble-wrapper.pressing .chat-bubble {
    transform: scale(0.97);
    transition: transform 0.15s ease;
}

/* ============================================
   Action Sheet (WhatsApp-style)
   ============================================ */
.action-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 900;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.action-sheet-overlay.hidden {
    display: none;
}

.action-sheet {
    background: var(--bg-card);
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 480px;
    padding: 8px 0 calc(8px + var(--safe-bottom));
    animation: slideUpSheet 0.3s ease;
}

@keyframes slideUpSheet {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.action-sheet-header {
    padding: 14px 20px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 4px;
}

.action-sheet-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
}

.action-sheet-btn:active {
    background: rgba(255, 255, 255, 0.05);
}

.action-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.action-danger {
    color: #ef4444;
}

.action-cancel {
    justify-content: center;
    color: var(--text-muted);
    font-weight: 600;
    border-top: 1px solid var(--border-subtle);
    margin-top: 4px;
}

/* ============================================
   User Profile Modal
   ============================================ */
#user-profile-modal {
    align-items: center;
}

.user-profile-modal {
    max-width: 360px;
    width: 90%;
    border-radius: var(--radius-xl) !important;
    max-height: min(86vh, 720px);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.user-profile-modal.profile-shot-source {
    overflow: hidden;
}

.user-profile-modal.profile-shot-capture {
    max-height: none !important;
    height: auto !important;
    overflow: visible !important;
    overscroll-behavior: auto !important;
}

.profile-shot-clone-host {
    position: fixed;
    left: -20000px;
    top: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0;
}

.profile-avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 12px;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: #000;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-photo-btn {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-primary);
    border: 2px solid var(--bg-card);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: transform var(--transition-fast);
}

.profile-photo-btn:active {
    transform: scale(0.9);
}

.profile-photo-btn svg {
    width: 14px;
    height: 14px;
}

.profile-header {
    text-align: center;
    padding: 20px 0 16px;
}

.profile-bio {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 6px;
    font-style: italic;
    line-height: 1.4;
}

.profile-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
}

.profile-username {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 16px 0;
}

.profile-stat {
    text-align: center;
    padding: 12px 8px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.profile-stat-value {
    font-size: 20px;
    font-weight: 800;
    color: var(--text-primary);
}

.profile-stat-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.profile-stat-value.win {
    color: var(--status-win);
}

.profile-stat-value.draw {
    color: var(--accent-primary);
}

.profile-stat-value.loss {
    color: var(--status-lose);
}

.profile-extra-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
}

.profile-extra-stat {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    min-width: 0;
}

.profile-extra-label {
    color: var(--text-secondary);
    font-weight: 700;
    letter-spacing: 0.1px;
    min-width: 0;
    line-height: 1.35;
}

.profile-extra-value {
    color: var(--text-primary);
    font-weight: 800;
    text-align: right;
    white-space: nowrap;
}

.registered-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #000;
    font-size: 10px;
    font-weight: 900;
    vertical-align: middle;
    margin-left: 4px;
}

.player-username {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.player-card.registered {
    cursor: pointer;
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.15);
}

.player-card.registered:active {
    transform: scale(0.98);
}

.profile-trophies {
    text-align: center;
    padding: 8px 0 4px;
    font-size: 18px;
    letter-spacing: 2px;
}

.profile-trophies span {
    display: block;
    font-size: 12px;
    color: var(--accent-primary);
    font-weight: 700;
    letter-spacing: 0;
    margin-top: 2px;
}

.profile-badge-showcase {
    margin: 12px 0 16px;
    padding: 12px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.09), rgba(var(--accent-secondary-rgb, 96, 165, 250), 0.08)),
        var(--bg-secondary);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.profile-badge-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.profile-badge-title {
    margin: 0 0 2px !important;
    padding-bottom: 0 !important;
    border-bottom: 0 !important;
    color: var(--text-primary);
}

.profile-badge-sub {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
}

.profile-badge-score {
    min-width: 64px;
    padding: 7px 9px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    text-align: right;
}

.profile-badge-score strong,
.profile-badge-score span {
    display: block;
}

.profile-badge-score strong {
    font-size: 18px;
    line-height: 1;
    color: var(--accent-primary);
}

.profile-badge-score span {
    margin-top: 2px;
    font-size: 10px;
    font-weight: 800;
    color: var(--text-secondary);
}

.profile-favorite-badge-panel {
    display: grid;
    gap: 10px;
    margin: 0 0 10px;
    padding: 10px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.2);
    border-radius: 16px;
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), transparent 36%),
        rgba(var(--surface-card-rgb, 255, 255, 255), 0.42);
}

.profile-favorite-badge-panel.has-favorite {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.34);
    box-shadow: 0 10px 22px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
}

.profile-favorite-badge-preview {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
}

.profile-favorite-badge-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24);
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22), rgba(var(--accent-secondary-rgb, 96, 165, 250), 0.14));
    font-size: 18px;
}

.profile-favorite-badge-preview strong,
.profile-favorite-badge-preview p {
    display: block;
}

.profile-favorite-badge-preview strong {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 900;
}

.profile-favorite-badge-preview p {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.35;
}

.profile-favorite-badge-select-wrap {
    display: grid;
    gap: 6px;
}

.profile-favorite-badge-select-wrap span {
    color: var(--text-tertiary);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-favorite-badge-select {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
    border-radius: 13px;
    background: rgba(var(--surface-card-rgb, 255, 255, 255), 0.72);
    color: var(--text-primary);
    font-weight: 800;
    padding: 0 12px;
}

:root[data-theme="dark"] .profile-favorite-badge-panel {
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.16), transparent 36%),
        rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .profile-favorite-badge-select {
    background: rgba(15, 23, 42, 0.82);
    color: var(--text-primary);
}

.profile-badge-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    max-height: 148px;
    overflow-y: auto;
    padding-right: 2px;
    -webkit-overflow-scrolling: touch;
}

.user-profile-modal .profile-badge-grid .lb-badge-chip,
.pp-details .profile-badge-grid .lb-badge-chip {
    max-width: 100%;
    color: var(--text-primary);
    background: rgba(var(--surface-card-rgb, 255, 255, 255), 0.58);
}

:root[data-theme="dark"] .user-profile-modal .profile-badge-grid .lb-badge-chip,
:root[data-theme="dark"] .pp-details .profile-badge-grid .lb-badge-chip {
    background: rgba(255, 255, 255, 0.07);
}

.lb-badge-chip.is-favorite {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.72) !important;
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22), rgba(var(--accent-secondary-rgb, 96, 165, 250), 0.12)) !important;
    box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), 0 8px 18px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
}

.lb-badge-chip.is-favorite-pick {
    cursor: pointer;
    position: relative;
}

.lb-badge-chip.is-favorite-pick::after {
    content: 'Pilih';
    margin-left: 2px;
    padding: 2px 6px;
    border-radius: 999px;
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    color: var(--accent-primary);
    font-size: 9px;
    font-weight: 900;
}

.lb-badge-chip.is-favorite-pick.compact::after {
    content: none;
}

.lb-badge-chip.is-favorite-pick.compact.is-favorite::after {
    content: '★';
    margin-left: 2px;
    padding: 1px 5px;
    border-radius: 999px;
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24);
    color: var(--accent-primary);
    font-size: 10px;
    font-weight: 900;
}

.lb-badge-chip.is-favorite-pick.is-favorite::after {
    content: 'Favorit';
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24);
}

.lb-badge-chip.is-favorite-pick:active {
    transform: scale(0.97);
}

.profile-winrate {
    margin: 12px 0 4px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.profile-winrate-header {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.profile-winrate-pct {
    font-weight: 700;
    color: var(--accent-primary);
}

.profile-winrate-bar {
    height: 8px;
    background: var(--bg-primary);
    border-radius: 4px;
    overflow: hidden;
}

.profile-winrate-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary, #ff6b35));
    border-radius: 4px;
    transition: width 0.6s ease;
}

.profile-section-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-secondary);
    margin: 16px 0 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

.profile-current-season {
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    padding: 12px;
}

.profile-current-season.profile-current-season-split {
    margin-top: 8px;
}

.profile-platform-block + .profile-platform-block {
    margin-top: 10px;
}

.profile-cs-rank {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.profile-cs-rank strong {
    color: var(--accent-primary);
    font-size: 18px;
}

.profile-cs-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
    font-size: 12px;
    color: var(--text-tertiary);
    padding: 4px 0;
    flex-wrap: wrap;
}

.profile-cs-row span {
    flex: 1 1 72px;
    text-align: center;
    min-width: 0;
}

.profile-season-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.profile-season-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
    font-size: 12px;
    gap: 10px;
    overflow: hidden;
}

.profile-season-item.champion {
    border-color: rgba(255, 215, 0, 0.3);
    background: rgba(255, 215, 0, 0.05);
}

.profile-season-name {
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: wrap;
    width: 100%;
    min-width: 0;
    line-height: 1.35;
}

.profile-season-item.champion .profile-season-name {
    color: gold;
}

.profile-season-platform {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.2;
    white-space: nowrap;
}

.profile-season-detail {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    color: var(--text-tertiary);
    font-size: 11px;
    min-width: 0;
    width: 100%;
}

.profile-season-detail span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 34px;
    padding: 6px 10px;
    border-radius: 10px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
    line-height: 1.25;
}

:root[data-theme="light"] .profile-season-detail span {
    background: rgba(39, 64, 105, 0.05);
    border-color: rgba(39, 64, 105, 0.1);
    color: #4b5f7d;
}

button.profile-season-item {
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    cursor: pointer;
    appearance: none;
}

.profile-season-item.profile-season-trigger {
    position: relative;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    animation: clickableBadgeGlow 3.2s ease-in-out infinite;
}

.profile-season-item.profile-season-trigger::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    opacity: 0;
    pointer-events: none;
    animation: clickableBadgeBorderPulse 3.2s ease-in-out infinite;
}

.profile-season-item.profile-season-trigger:hover {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.36);
    box-shadow: 0 14px 24px rgba(15, 23, 42, 0.12);
    filter: saturate(1.04);
}

.profile-season-item.profile-season-trigger:active {
    transform: scale(0.988);
}

.profile-season-open-hint {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
}

.profile-season-open-hint::after {
    content: '↗';
    font-size: 12px;
    line-height: 1;
}

.profile-season-item.champion .profile-season-open-hint {
    color: var(--accent-primary);
}

.profile-actions {
    padding: 16px 0 4px;
}

.profile-actions {
    display: grid;
    gap: 10px;
}

.profile-detail-btn {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.28);
    background: rgba(var(--accent-primary-rgb, 255, 165, 0), 0.08);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.profile-detail-btn:active {
    transform: scale(0.97);
    opacity: 0.92;
}

.profile-dm-btn {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: var(--bg-primary);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

@media (max-width: 420px) {
    .user-profile-modal {
        width: min(94vw, 360px);
        padding: 20px 16px;
    }

    .profile-stats {
        gap: 8px;
    }

    .profile-stat {
        padding: 10px 6px;
    }

    .profile-stat-value {
        font-size: 18px;
    }

    .profile-extra-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .profile-extra-stat {
        padding: 9px 10px;
        gap: 6px;
    }

    .profile-extra-label {
        font-size: 11px;
        line-height: 1.25;
    }

    .profile-extra-value {
        font-size: 13px;
    }

    .profile-season-detail {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 7px;
    }

    .profile-season-detail span {
        justify-content: center;
        text-align: center;
        min-height: 34px;
        padding: 6px 8px;
    }

    .profile-season-detail span:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }
}

.profile-dm-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.chat-mention {
    color: var(--accent-primary);
    font-weight: 600;
    cursor: pointer;
}

.chat-mention.chat-mention-ai {
    color: #8fc3ff;
}

.chat-mention.chat-mention-everyone {
    color: #fbbf24;
}

.chat-msg-text strong,
.home-ai-bubble-text strong,
.chat-reply-inline-text strong {
    font-weight: 800;
    color: inherit;
}

/* ============================================
   League Settings
   ============================================ */
.setting-row {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.setting-row:last-of-type {
    border-bottom: none;
}

.setting-label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.setting-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 15px;
    font-family: var(--font-primary);
    text-align: left;
    transition: border-color var(--transition-fast);
    box-sizing: border-box;
}

.setting-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.setting-password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.chat-tab-bar.hidden {
    display: none !important;
}

.setting-password-field .setting-input {
    padding-right: 92px;
}

.setting-password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.setting-password-toggle:hover {
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.setting-password-toggle:active {
    transform: translateY(-50%) scale(0.97);
}

.theme-mode-group {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 2px;
}

.theme-mode-btn {
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 10px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.theme-mode-icon {
    width: 16px;
    height: 16px;
}

.theme-mode-btn:hover {
    border-color: var(--accent-primary);
    color: var(--text-primary);
}

.theme-mode-btn:active {
    transform: scale(0.97);
}

.theme-mode-btn.active {
    color: #fff;
    border-color: var(--theme-inline-border-strong);
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    box-shadow: 0 8px 18px var(--accent-glow);
}

.theme-palette-row {
    align-items: stretch;
}

.theme-palette-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 4px;
}

.theme-palette-card {
    border: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border-radius: 14px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.theme-palette-card:hover {
    transform: translateY(-1px);
    border-color: var(--theme-inline-border-strong);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.theme-palette-card:active {
    transform: scale(0.98);
}

.theme-palette-card.active {
    border-color: var(--theme-inline-border-strong);
    background: linear-gradient(180deg, var(--theme-inline-surface-strong), rgba(255, 255, 255, 0.04));
    box-shadow: 0 12px 24px var(--accent-glow);
}

.theme-palette-swatches {
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-palette-swatch {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--swatch, var(--accent-primary));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.theme-palette-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.theme-palette-copy strong {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
}

.theme-palette-copy small {
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.45;
}

.setting-counter {
    display: flex;
    align-items: center;
    gap: 0;
}

.setting-row:has(.setting-counter) {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}

.counter-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    -webkit-tap-highlight-color: transparent;
}

.counter-btn:first-child {
    border-radius: 10px 0 0 10px;
}

.counter-btn:last-child {
    border-radius: 0 10px 10px 0;
}

.counter-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.counter-btn:active {
    transform: scale(0.92);
    background: var(--accent-soft-strong);
}

.counter-value {
    min-width: 42px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    background: var(--bg-input);
    border-top: 1.5px solid var(--border-subtle);
    border-bottom: 1.5px solid var(--border-subtle);
    font-family: var(--font-mono, monospace);
}

.setting-select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-input);
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23f59e0b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color var(--transition-fast);
}

.setting-select:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.setting-select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.setting-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-subtle), transparent);
    margin: 4px 0;
}

.setting-save-btn {
    width: 100%;
    padding: 14px;
    margin-top: 16px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-size: 15px;
    font-weight: 700;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px var(--accent-glow);
}

.setting-save-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--accent-glow-strong);
}

.setting-save-btn:active {
    transform: scale(0.97);
}

.delete-account-separator {
    margin: 24px 0 16px;
    border-top: 1px solid rgba(239, 68, 68, 0.15);
}

.setting-delete-account-btn {
    width: 100%;
    padding: 14px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.setting-delete-account-btn:active {
    transform: scale(0.97);
    background: rgba(239, 68, 68, 0.15);
}

.card-history {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(217, 119, 6, 0.1));
    border-color: rgba(234, 179, 8, 0.2);
}

/* ============================================
   Season History View
   ============================================ */
.history-tab-bar {
    display: flex;
    gap: 0;
    padding: 0 16px 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

.history-tab {
    flex: 1;
    padding: 10px 0;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.history-tab.active {
    color: var(--accent-primary);
}

.history-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 20%;
    right: 20%;
    height: 2px;
    background: var(--accent-primary);
    border-radius: 2px;
}

.history-sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
}

.history-sort-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
}

.history-sort-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--theme-inline-surface), rgba(255, 255, 255, 0.02));
    border: 1px solid var(--theme-inline-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.history-sort-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-sort-btn.active {
    color: #fff;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary, #d97706));
    box-shadow: 0 6px 16px var(--theme-active-shadow);
}

.history-sort-btn:active {
    transform: scale(0.97);
}

.cup-history-card {
    position: relative;
}

.history-card-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.history-icon-btn {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 1px solid var(--theme-inline-border);
    background: linear-gradient(135deg, var(--theme-inline-surface), rgba(255, 255, 255, 0.02));
    color: var(--theme-surface-text-primary);
    font-size: 14px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.history-icon-btn svg {
    width: 14px;
    height: 14px;
    display: block;
    fill: none;
    stroke: currentColor;
}

.history-icon-btn.is-loading {
    pointer-events: none;
    color: transparent;
}

.history-icon-btn.is-loading svg {
    opacity: 0;
}

.history-icon-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.22);
    border-top-color: var(--accent-primary);
    animation: profileShotSpin 0.8s linear infinite;
}

.history-icon-btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.08));
    color: #ef4444;
}

.history-icon-btn:hover,
.history-icon-btn:active {
    transform: scale(1.05);
    filter: brightness(1.08);
}

.cup-history-delete-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    opacity: 0.6;
}

.cup-history-delete-btn:hover,
.cup-history-delete-btn:active {
    opacity: 1;
    background: rgba(239, 68, 68, 0.25);
    transform: scale(1.1);
}

.cup-history-resume-btn {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--accent-primary, #f59e0b), var(--accent-secondary, #d97706));
    color: #fff;
    border: none;
    border-radius: var(--radius-md, 10px);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.cup-history-resume-btn:hover,
.cup-history-resume-btn:active {
    transform: scale(0.98);
    filter: brightness(1.1);
}

.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    animation: fadeIn 0.2s ease;
}

.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl, 16px);
    padding: 24px;
    max-width: 340px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.25s ease;
}

.confirm-dialog-icon {
    font-size: 40px;
    text-align: center;
    margin-bottom: 12px;
}

.confirm-dialog-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 8px;
}

.confirm-dialog-msg {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    margin-bottom: 20px;
}

.confirm-dialog-buttons {
    display: flex;
    gap: 10px;
}

.confirm-dialog-btn {
    flex: 1;
    padding: 12px;
    border-radius: var(--radius-md, 10px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.confirm-dialog-btn.cancel {
    background: var(--bg-input, #2a2a3a);
    color: var(--text-secondary);
}

.confirm-dialog-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
}

.confirm-dialog-btn:active {
    transform: scale(0.96);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.season-card {
    padding: 20px;
    margin-bottom: 16px;
    color: var(--theme-surface-text-primary);
}

@supports (content-visibility: auto) {
    .season-card {
        content-visibility: auto;
        contain-intrinsic-size: auto 420px;
    }
}

.season-card.is-unfinished {
    border-inline-start: 3px solid var(--theme-surface-accent);
}

.season-card-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.season-trophy {
    font-size: 36px;
    flex-shrink: 0;
}

.season-info {
    flex: 1;
}

.season-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 800;
    color: var(--theme-surface-text-primary);
}

.season-date {
    font-size: 12px;
    color: var(--theme-surface-text-secondary);
    margin-top: 2px;
}

.season-card-footer-actions {
    margin-top: 12px;
}

.season-results {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.season-result {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: var(--theme-surface-subtle-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--theme-surface-subtle-border);
}

.season-result.champion {
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.08)),
        var(--theme-surface-subtle-bg-alt);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.32);
}

.season-result.runner-up {
    background:
        linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(100, 116, 139, 0.08)),
        var(--theme-surface-subtle-bg-alt);
    border-color: rgba(148, 163, 184, 0.22);
}

.season-result-label {
    font-size: 13px;
    color: var(--theme-surface-text-secondary);
    font-weight: 600;
}

.season-result-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--theme-surface-text-primary);
}

.season-stats {
    display: flex;
    gap: 4px;
    margin-bottom: 12px;
}

.season-stat {
    flex: 1;
    text-align: center;
    padding: 10px 6px;
    background: var(--theme-surface-subtle-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--theme-surface-subtle-border);
}

.season-stat-num {
    display: block;
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 800;
    color: var(--theme-surface-accent);
}

.season-stat-label {
    display: block;
    font-size: 11px;
    color: var(--theme-surface-text-secondary);
    margin-top: 2px;
}

.season-standings-details {
    margin-top: 4px;
}

.season-standings-toggle {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-surface-accent);
    padding: 8px 0;
    list-style: none;
}

.season-standings-toggle::-webkit-details-marker {
    display: none;
}

.season-standings-toggle::before {
    content: '▸ ';
}

details[open]>.season-standings-toggle::before {
    content: '▾ ';
}

.season-standings-table {
    margin-top: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--theme-surface-subtle-border);
    border-radius: var(--radius-sm);
    background: var(--theme-surface-subtle-bg);
}

.season-standings-table table {
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 12px;
}

.season-standings-table th,
.season-standings-table td {
    padding: 8px 6px;
    text-align: center;
    border-bottom: 1px solid var(--theme-surface-subtle-border);
    box-sizing: border-box;
    white-space: nowrap;
}

.season-standings-table th {
    font-size: 11px;
    font-weight: 700;
    color: var(--theme-surface-text-muted);
    text-transform: uppercase;
}

.season-standings-table td {
    color: var(--theme-surface-text-primary);
}

.season-standings-table td:nth-child(2) {
    text-align: left;
    font-weight: 600;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.season-standings-table th:nth-child(1),
.season-standings-table td:nth-child(1) {
    width: 34px;
}

.season-standings-table th:nth-child(2),
.season-standings-table td:nth-child(2) {
    width: 132px;
}

.season-standings-table th:nth-child(n+3),
.season-standings-table td:nth-child(n+3) {
    width: calc((100% - 166px) / 8);
}

.season-standings-table .pts {
    font-weight: 800;
    color: var(--theme-surface-accent);
}

.season-standings-table .dif-positive {
    color: #22c55e;
    font-weight: 700;
}

.season-standings-table .dif-negative {
    color: #ef4444;
    font-weight: 700;
}

.season-standings-table .dif-neutral {
    color: var(--theme-surface-text-secondary);
    font-weight: 700;
}

.season-standings-table .champion-row {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), rgba(217, 119, 6, 0.05));
}

.season-standings-table .champion-row td:nth-child(2) {
    color: var(--theme-surface-accent);
}

@media (max-width: 480px) {
    .season-standings-table table {
        font-size: 11px;
    }

    .season-standings-table th,
    .season-standings-table td {
        padding: 7px 4px;
    }

    .season-standings-table th:nth-child(2),
    .season-standings-table td:nth-child(2) {
        width: 110px;
    }

    .season-standings-table th:nth-child(n+3),
    .season-standings-table td:nth-child(n+3) {
        width: calc((100% - 144px) / 8);
    }
}

/* ============================================
   Season Match Scores in Riwayat
   ============================================ */
.season-scores-details {
    margin-top: 4px;
}

.season-scores-toggle {
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-surface-accent);
    padding: 8px 0;
    list-style: none;
}

.season-scores-toggle::-webkit-details-marker {
    display: none;
}

.season-scores-toggle::before {
    content: '▸ ';
}

details[open]>.season-scores-toggle::before {
    content: '▾ ';
}

.season-scores-content {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.season-babak-group {
    background: var(--theme-surface-subtle-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--theme-surface-subtle-border);
    overflow: hidden;
}

.season-babak-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--theme-surface-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 12px;
    background: var(--theme-surface-subtle-bg-alt);
    border-bottom: 1px solid var(--theme-surface-subtle-border);
}

.season-match-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 8px;
    border-bottom: 1px solid var(--theme-surface-subtle-border);
}

.season-match-item:last-child {
    border-bottom: none;
}

.season-match-team {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-surface-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.season-match-team.right {
    text-align: right;
}

.season-match-team.winner {
    color: #22c55e;
    font-weight: 700;
}

.season-match-score {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 800;
    color: var(--theme-surface-text-primary);
    min-width: 50px;
    justify-content: center;
    flex-shrink: 0;
}

.season-match-score .score-sep {
    color: var(--theme-surface-text-muted);
    font-size: 12px;
}

.chat-media.chat-media-doc {
    max-width: 290px;
}

.chat-doc-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    min-width: 220px;
    max-width: 290px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.15));
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.chat-media.chat-media-doc:active .chat-doc-card {
    transform: scale(0.985);
}

.chat-doc-icon {
    font-size: 24px;
    line-height: 1;
    flex: 0 0 auto;
}

.chat-doc-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.chat-doc-name {
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.chat-doc-sub {
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.3;
    color: var(--text-secondary);
    opacity: 0.85;
}

.chat-doc-action {
    min-width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid var(--border-color, rgba(255, 255, 255, 0.2));
    background: rgba(255, 255, 255, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    flex: 0 0 auto;
}

.chat-doc-action-icon {
    font-size: 15px;
    line-height: 1;
}

.chat-doc-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: var(--accent-primary, #f59e0b);
    animation: chatDocSpin 0.8s linear infinite;
}

.chat-doc-progress {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: -0.2px;
    min-width: 24px;
    text-align: right;
}

.chat-media-doc.doc-state-downloading .chat-doc-card {
    border-color: rgba(245, 158, 11, 0.45);
    background: rgba(245, 158, 11, 0.11);
}

.chat-media-doc.doc-state-ready .chat-doc-card {
    border-color: rgba(74, 222, 128, 0.44);
    background: rgba(74, 222, 128, 0.12);
}

.chat-media-doc.doc-state-ready .chat-doc-action {
    border-color: rgba(74, 222, 128, 0.45);
    background: rgba(74, 222, 128, 0.16);
    color: #22c55e;
}

.chat-media-doc.doc-state-error .chat-doc-card {
    border-color: rgba(239, 68, 68, 0.44);
    background: rgba(239, 68, 68, 0.12);
}

.chat-media-doc.doc-state-error .chat-doc-action {
    border-color: rgba(239, 68, 68, 0.44);
    color: #f87171;
}

@keyframes chatDocSpin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.cup-history-score-text {
    font-size: 12px;
    line-height: 1.35;
    white-space: normal;
    text-align: center;
    min-width: 110px;
}

.history-absent-block {
    margin-top: 10px;
    border: 1px solid var(--theme-surface-subtle-border);
    border-radius: var(--radius-sm);
    background: var(--theme-surface-subtle-bg);
}

.history-absent-details {
    overflow: hidden;
}

.history-absent-toggle {
    list-style: none;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 12px;
    font-weight: 700;
    color: var(--theme-surface-text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}

.history-absent-toggle::-webkit-details-marker {
    display: none;
}

.history-absent-toggle::after {
    content: 'Lihat';
    font-size: 11px;
    font-weight: 600;
    color: var(--theme-surface-text-secondary);
}

details[open]>.history-absent-toggle::after {
    content: 'Tutup';
}

.history-absent-empty {
    padding: 0 12px 10px;
    font-size: 12px;
    color: var(--theme-surface-text-secondary);
}

.history-absent-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 12px 10px;
}

.history-absent-chip {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--theme-surface-text-primary);
    border: 1px solid rgba(239, 68, 68, 0.22);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.16), rgba(239, 68, 68, 0.08));
}

/* ============================================
   Player Profile - Head to Head
   ============================================ */
.pp-h2h-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.pp-h2h-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pp-h2h-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.pp-h2h-block+.pp-h2h-block {
    margin-top: 10px;
}

.pp-h2h-subtitle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 4px 10px;
    margin: 2px 0 8px;
}

.pp-h2h-row {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    gap: 8px;
}

.pp-h2h-opponent {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pp-h2h-record {
    display: flex;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.pp-h2h-w {
    color: #22c55e;
}

.pp-h2h-d {
    color: #f59e0b;
}

.pp-h2h-l {
    color: #ef4444;
}

.pp-matchlog-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-subtle);
}

.pp-matchlog-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.pp-matchlog-title .pp-ml-arrow {
    font-size: 10px;
    transition: transform 0.2s;
}

.pp-matchlog-title.open .pp-ml-arrow {
    transform: rotate(180deg);
}

.pp-matchlog-list {
    display: none;
    flex-direction: column;
    gap: 4px;
    max-height: 300px;
    overflow-y: auto;
}

.pp-matchlog-list.open {
    display: flex;
}

.pp-matchlog-season-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--accent-primary);
    padding: 6px 0 2px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pp-matchlog-platform {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    padding: 2px 8px;
    line-height: 1.2;
    white-space: nowrap;
}

.pp-matchlog-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-subtle);
    gap: 6px;
    font-size: 12px;
}

.pp-matchlog-result {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.pp-matchlog-result.win {
    background: #22c55e;
}

.pp-matchlog-result.draw {
    background: #f59e0b;
}

.pp-matchlog-result.loss {
    background: #ef4444;
}

.pp-matchlog-vs {
    flex: 1;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pp-matchlog-score {
    font-weight: 800;
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 13px;
    flex-shrink: 0;
}

/* ============================================
   Home Card - Tentang
   ============================================ */
.card-tentang {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.18), rgba(99, 102, 241, 0.12));
    border-color: rgba(168, 85, 247, 0.2);
}

.home-card-logo {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(168, 85, 247, 0.4));
}

/* ============================================
   Tentang View
   ============================================ */
.tentang-content {
    padding: 0 16px 32px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.tentang-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px 32px;
    position: relative;
    text-align: center;
}

.tentang-logo-glow {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, rgba(168, 85, 247, 0.1) 50%, transparent 70%);
    top: 20px;

    pointer-events: none;
}

@keyframes logoGlow {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.15);
        opacity: 1;
    }
}

.tentang-logo {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(245, 158, 11, 0.4);
    box-shadow: 0 0 30px rgba(245, 158, 11, 0.25), 0 0 60px rgba(168, 85, 247, 0.15);
    position: relative;
    z-index: 1;

}

@keyframes logoFloat {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.tentang-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-primary);
    margin-top: 20px;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--accent-primary), #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tentang-subtitle {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 600;
    letter-spacing: 4px;
    margin-top: 4px;
    text-transform: uppercase;
}

.tentang-card {
    margin-bottom: 16px;
    padding: 24px 20px;
}

.tentang-section-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.tentang-icon {
    font-size: 22px;
}

.tentang-story p {
    font-size: 14px;
    line-height: 1.85;
    color: var(--text-secondary);
    margin-bottom: 14px;
    text-align: justify;
}

.tentang-story p:last-child {
    margin-bottom: 0;
}

.tentang-story strong {
    color: var(--accent-primary);
    font-weight: 700;
}

.tentang-story em {
    color: var(--text-primary);
    font-style: italic;
}

.tentang-card-special {
    border: 1px solid rgba(245, 158, 11, 0.25);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), rgba(168, 85, 247, 0.04));
    position: relative;
    overflow: hidden;
}

.tentang-card-special::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-primary), #a855f7, var(--accent-primary));
}

.tentang-message p {
    font-size: 14.5px;
    line-height: 1.9;
    color: var(--text-secondary);
}

.filosofi-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.filosofi-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.filosofi-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.filosofi-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.filosofi-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-primary);
}

.filosofi-text {
    font-size: 13.5px;
    line-height: 1.8;
    color: var(--text-secondary);
    text-align: justify;
    padding-left: 30px;
}

.tentang-footer {
    text-align: center;
    padding: 32px 20px 16px;
    opacity: 0.7;
}

.tentang-footer-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    opacity: 0.6;
    filter: grayscale(0.3);
}

.tentang-footer p {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 600;
}

.tentang-footer-sub {
    font-size: 11px !important;
    font-weight: 400 !important;
    margin-top: 4px;
    letter-spacing: 0.5px;
}

/* ============================
   Photo Crop Modal
   ============================ */
.crop-modal-card {
    width: 92%;
    max-width: 380px;
    padding: 0;
    overflow: hidden;
}

.crop-modal-card .modal-header {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.crop-container {
    position: relative;
    width: 100%;
    height: 320px;
    background: #111;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.crop-container:active {
    cursor: grabbing;
}

.crop-container img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: center center;
    max-width: none;
    max-height: none;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    z-index: 1;
}

.crop-circle-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 220px;
    height: 220px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 2.5px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    z-index: 3;
}

.crop-controls {
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: var(--bg-card);
}

.crop-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.crop-label {
    font-size: 16px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.crop-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.15);
    outline: none;
    margin: 0;
}

.crop-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid var(--bg-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.crop-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: 2px solid var(--bg-card);
}

.crop-actions {
    display: flex;
    gap: 10px;
    padding: 12px 16px 16px;
    background: var(--bg-card);
}

.btn-crop-cancel {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-crop-cancel:active {
    background: rgba(255, 255, 255, 0.05);
}

.btn-crop-confirm {
    flex: 2;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-crop-confirm:active {
    transform: scale(0.97);
    opacity: 0.9;
}

.setting-change-pw-btn {
    width: 100%;
    padding: 12px;
    margin-top: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.setting-change-pw-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.setting-change-pw-btn:active {
    transform: scale(0.98);
}

.password-modal-card {
    width: 90%;
    max-width: 360px;
}

.story-privacy-modal-card {
    width: min(92vw, 420px);
    overflow: hidden;
}

.story-privacy-modal-body {
    padding: 16px;
}

.story-privacy-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 12px 0 10px;
    color: var(--theme-surface-text-primary);
    font-size: 12px;
    font-weight: 600;
}

.story-privacy-clear-btn {
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.05);
    color: var(--theme-surface-text-primary);
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.story-privacy-clear-btn:hover {
    color: var(--theme-surface-text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.story-privacy-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: min(46vh, 360px);
    overflow-y: auto;
    padding-right: 4px;
}

.story-privacy-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: all 0.2s;
}

.story-privacy-user:hover {
    border-color: rgba(245, 158, 11, 0.28);
    background: rgba(245, 158, 11, 0.08);
}

.story-privacy-user.selected {
    border-color: rgba(245, 158, 11, 0.38);
    background: rgba(245, 158, 11, 0.12);
}

.story-privacy-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.story-privacy-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.story-privacy-user-info {
    min-width: 0;
    flex: 1;
}

.story-privacy-user-name {
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.story-privacy-user-username {
    color: var(--text-secondary);
    font-size: 12px;
    margin-top: 2px;
}

.story-privacy-user-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1.5px solid var(--border-light);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: transparent;
    transition: all 0.2s;
}

.story-privacy-user.selected .story-privacy-user-check {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-color: transparent;
    color: #111827;
}

.story-privacy-empty {
    padding: 18px 12px;
    border-radius: 14px;
    border: 1px dashed var(--border-subtle);
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.6;
}

.pw-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1.65fr;
    gap: 10px;
    padding: 14px 0 0 !important;
    background: transparent;
    border-top: 1px solid var(--border-subtle);
    margin-top: 8px;
}

.pw-modal-actions.story-privacy-actions {
    padding: 14px 16px calc(18px + env(safe-area-inset-bottom, 0px)) !important;
    margin-top: 10px;
}

.pw-modal-cancel,
.pw-modal-confirm {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    border-radius: 14px;
    letter-spacing: 0.2px;
}

.pw-modal-cancel {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.pw-modal-cancel:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.pw-modal-confirm {
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.24);
    background: linear-gradient(135deg, #f7ab1f 0%, #f18a1a 52%, #e85f10 100%);
    box-shadow: 0 10px 22px rgba(241, 122, 26, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.pw-modal-confirm:hover {
    transform: translateY(-1px);
    filter: brightness(1.03);
}

.pw-modal-confirm:active {
    transform: scale(0.98);
}

:root[data-theme="light"] .pw-modal-cancel {
    background: #eef3fb;
    border-color: rgba(39, 64, 105, 0.2);
    color: #3f5579;
    box-shadow: none;
}

:root[data-theme="light"] .pw-modal-cancel:hover {
    background: #e4ecf9;
    color: #23375a;
}

:root[data-theme="light"] .pw-modal-confirm {
    border-color: rgba(185, 105, 13, 0.34);
    box-shadow: 0 10px 22px rgba(217, 119, 6, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ============================================
   Voice Call System
   ============================================ */

.dm-call-btn {
    margin-left: auto;
    background: rgba(34, 197, 94, 0.15);
    border: none;
    color: #22c55e;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dm-call-btn:hover,
.dm-call-btn:active {
    background: rgba(34, 197, 94, 0.3);
    transform: scale(1.1);
}

.grp-call-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-radius: var(--radius-md, 10px);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.grp-call-btn:hover,
.grp-call-btn:active {
    background: rgba(34, 197, 94, 0.25);
    transform: scale(0.98);
}

.grp-call-bar {
    padding: 8px 16px;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 8px;
}

.grp-call-btn {
    flex: 1;
}

.grp-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(34, 197, 94, 0.05));
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: #22c55e;
    border-radius: var(--radius-md, 10px);
    cursor: pointer;
    transition: all 0.2s;
}

.grp-search-btn:active {
    background: rgba(34, 197, 94, 0.25);
    transform: scale(0.92);
}

.grp-call-live {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.88));
    border-bottom: 1px solid rgba(148, 163, 184, 0.14);
}

.grp-call-live.hidden {
    display: none;
}

.grp-call-live-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.grp-call-live-title {
    color: #f8fafc;
    font-size: 13px;
    font-weight: 700;
}

.grp-call-live-subtitle {
    color: rgba(226, 232, 240, 0.7);
    font-size: 11px;
}

.grp-call-live-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.22);
}

.grp-call-live-action:active {
    transform: scale(0.97);
}

/* ---- Multi-Select Toolbar ---- */
.multi-select-toolbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: var(--accent-primary, #22c55e);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    animation: slideDown 0.2s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.multi-select-toolbar .ms-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.multi-select-toolbar .ms-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.multi-select-toolbar .ms-actions {
    display: flex;
    gap: 4px;
}

.multi-select-toolbar .ms-action-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: background 0.15s;
}

.multi-select-toolbar .ms-action-btn:active {
    background: rgba(255, 255, 255, 0.35);
}

.multi-select-toolbar .ms-action-btn.danger {
    background: rgba(239, 68, 68, 0.7);
}

.chat-bubble-wrapper.ms-selected {
    background: rgba(34, 197, 94, 0.12) !important;
}

.chat-bubble-wrapper.ms-selected .chat-bubble {
    box-shadow: 0 0 0 2px var(--accent-primary, #22c55e);
}

.call-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.call-overlay.hidden {
    display: none;
}

.call-screen {
    width: 100%;
    height: 100%;
    background: linear-gradient(160deg, #0f0f23 0%, #1a1a3e 30%, #0d1117 70%, #111827 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.call-screen::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 20%, rgba(34, 197, 94, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%);
    animation: callBgShift 8s ease-in-out infinite alternate;
}

@keyframes callBgShift {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(15deg);
    }
}

.call-pulse-ring {
    position: absolute;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 2px solid rgba(34, 197, 94, 0.4);
    animation: callPulse 1.5s ease-out infinite;
}

@keyframes callPulse {
    0% {
        transform: scale(0.8);
        opacity: 1;
    }

    100% {
        transform: scale(2);
        opacity: 0;
    }
}

.call-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    z-index: 1;
    box-shadow: 0 0 40px rgba(34, 197, 94, 0.3);
    margin-bottom: 20px;
    overflow: hidden;
}

.call-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.call-avatar-active {
    animation: avatarGlow 2s ease-in-out infinite alternate;
}

@keyframes avatarGlow {
    0% {
        box-shadow: 0 0 30px rgba(34, 197, 94, 0.2);
    }

    100% {
        box-shadow: 0 0 60px rgba(34, 197, 94, 0.4);
    }
}

.call-name {
    font-size: 22px;
    font-weight: 700;
    color: #fff;
    z-index: 1;
    margin-bottom: 4px;
}

.call-status {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
    z-index: 1;
    margin-bottom: 8px;
    animation: statusPulse 2s ease-in-out infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.call-type-badge {
    font-size: 11px;
    color: #22c55e;
    background: rgba(34, 197, 94, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    z-index: 1;
    margin-bottom: 40px;
    font-weight: 600;
}

.call-timer {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    z-index: 1;
    margin-bottom: 12px;
    font-variant-numeric: tabular-nums;
}

.call-participants {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    z-index: 1;
    margin-bottom: 40px;
    padding: 0 24px;
}

.call-participant-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.08);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.call-participant-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.call-group-tools {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    margin: -8px 0 28px;
    padding: 0 24px;
    z-index: 1;
}

.call-group-tools.hidden {
    display: none;
}

.call-chip-btn {
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.call-chip-btn:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.18);
}

.call-visualizer {
    display: flex;
    gap: 4px;
    align-items: flex-end;
    height: 60px;
    z-index: 1;
    margin-bottom: 20px;
}

.call-viz-bar {
    width: 4px;
    background: linear-gradient(to top, #22c55e, #3b82f6);
    border-radius: 4px;
    animation: vizBounce 0.8s ease-in-out infinite alternate;
}

.call-viz-bar:nth-child(1) {
    height: 20px;
    animation-delay: 0s;
}

.call-viz-bar:nth-child(2) {
    height: 35px;
    animation-delay: 0.15s;
}

.call-viz-bar:nth-child(3) {
    height: 50px;
    animation-delay: 0.3s;
}

.call-viz-bar:nth-child(4) {
    height: 30px;
    animation-delay: 0.45s;
}

.call-viz-bar:nth-child(5) {
    height: 25px;
    animation-delay: 0.6s;
}

@keyframes vizBounce {
    0% {
        transform: scaleY(0.4);
    }

    100% {
        transform: scaleY(1);
    }
}

.call-actions-incoming {
    display: flex;
    gap: 40px;
    z-index: 1;
    margin-top: 20px;
}

.call-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.call-btn:active {
    transform: scale(0.9);
}

.call-accept {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    animation: btnPulseGreen 1.5s ease-in-out infinite;
}

@keyframes btnPulseGreen {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
    }

    50% {
        box-shadow: 0 0 0 12px rgba(34, 197, 94, 0);
    }
}

.call-reject {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.call-actions-active {
    display: flex;
    gap: 14px;
    z-index: 3;
    margin-top: auto;
    padding-bottom: max(20px, env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: center;
}

/* ===== DCL Call UI: icon-only circular buttons (WhatsApp-style), bottom bar ===== */
.call-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 52px;
    padding: 0;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform 0.15s, background 0.2s;
}
.call-ctrl-btn span { display: none !important; }
.call-ctrl-btn svg { width: 24px; height: 24px; flex-shrink: 0; }

.call-ctrl-btn:active {
    transform: scale(0.93);
}

.call-ctrl-btn.active {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.4);
    color: #22c55e;
}

.call-ctrl-btn.muted {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.call-ctrl-btn.call-end {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: transparent;
    color: #fff;
    width: 62px;
    height: 62px;
    min-width: 62px;
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
.call-ctrl-btn.call-end svg { width: 28px; height: 28px; }

/* ---- Minimize Button (top-left of active call) ---- */
.call-minimize-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    top: calc(16px + env(safe-area-inset-top, 0px));
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s;
}

.call-minimize-btn:active {
    transform: scale(0.88);
    background: rgba(255, 255, 255, 0.2);
}

/* ---- Mini Call Bar (floating at top, WhatsApp-style) ---- */
.call-mini-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 19000;
    display: flex;
    align-items: center;
    padding: 0 12px;
    height: 44px;
    padding-top: env(safe-area-inset-top, 36px);
    background: linear-gradient(135deg, #16a34a, #15803d);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    animation: miniBarSlideDown 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 4px 20px rgba(22, 163, 74, 0.4);
}

.call-mini-bar.hidden {
    display: none;
}

@keyframes miniBarSlideDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.call-mini-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    margin-right: 10px;
    flex-shrink: 0;
    animation: miniBarPulse 1.5s ease-in-out infinite;
}

@keyframes miniBarPulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.7);
    }
}

.call-mini-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.call-mini-icon {
    color: #fff;
    flex-shrink: 0;
}

.call-mini-name {
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.call-mini-timer {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.call-mini-end {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ef4444;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    margin-left: 10px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.call-mini-end:active {
    transform: scale(0.85);
    background: #dc2626;
}

/* ============================================
   Jadwal / Schedule System
   ============================================ */

.btn-buat-jadwal {
    display: block;
    width: 80%;
    max-width: 300px;
    margin: 0 auto 20px;
    padding: 14px 24px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}

.btn-buat-jadwal:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.jadwal-babak {
    margin-bottom: 20px;
}

.jadwal-babak-title {
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-bottom: 10px;
    padding-left: 4px;
}

.jadwal-match-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all var(--transition-normal);
    animation: slideUp 0.4s ease both;
}

.jadwal-match-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateY(-1px);
}

.jadwal-match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.jadwal-match-team {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.jadwal-match-team span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jadwal-match-team-right {
    flex-direction: row-reverse;
    text-align: right;
}

.jadwal-match-result {
    flex-shrink: 0;
    text-align: center;
    min-width: 60px;
}

.jadwal-score {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
    background: rgba(245, 158, 11, 0.1);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
}

.jadwal-no-result {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-jadwal-action {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.league-schedule-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    padding: 0 4px;
    justify-content: flex-end;
}

.league-schedule-actions .league-shot-btn {
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border-radius: var(--radius-sm);
}

.btn-jadwal-action:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-jadwal-delete:hover {
    border-color: var(--red);
    background: var(--red-bg);
}

.match-score-dialog {
    text-align: center;
}

.match-score-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.match-score-team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.match-score-team-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
}

.match-score-inputs {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.match-score-input-group {
    text-align: center;
}

.match-score-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-primary);
    margin-bottom: 10px;
}

.match-score-input {
    width: 70px;
    height: 50px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-normal);
}

.match-score-input:focus {
    border-color: var(--accent-primary);
}

.stat-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #000;
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.stat-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    animation: slideUp 0.4s ease both;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.stat-item-value {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 16px;
    color: var(--text-primary);
}

/* ============================================
   Champion Banner
   ============================================ */

.champion-card {
    position: relative;
    margin-top: 16px;
    padding: 32px 20px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(234, 179, 8, 0.08), rgba(168, 85, 247, 0.06));
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    text-align: center;
    overflow: hidden;
    animation: championReveal 0.8s ease both;
}

@keyframes championReveal {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.champion-confetti {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 15% 20%, rgba(245, 158, 11, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 50% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 40%);
    pointer-events: none;
}

.champion-trophy {
    font-size: 56px;
    margin-bottom: 8px;
    animation: trophyBounce 1.5s ease infinite;
    filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.4));
}

@keyframes trophyBounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

.champion-title {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent-primary);
    text-transform: uppercase;
    margin-bottom: 16px;
}

.champion-name-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
}

.champion-main-name {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    text-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.champion-stats-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.champion-podium {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 20px;
}

.podium-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.podium-medal {
    font-size: 18px;
}

.podium-name {
    font-weight: 600;
    color: var(--text-primary);
}

.podium-pts {
    color: var(--text-muted);
    font-size: 12px;
}

.champion-quote {
    font-style: italic;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* ==================== VIEW TOP BAR ==================== */
.view-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(env(safe-area-inset-top, 44px) + 12px);
    background: var(--theme-topbar-fill);
    border-bottom: 1px solid var(--theme-topbar-border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(min(var(--theme-topbar-blur), var(--theme-topbar-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(var(--theme-topbar-blur), var(--theme-topbar-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
}

.view-top-bar h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
    flex: 1;
}

.view-top-bar .back-btn {
    background: var(--theme-back-btn-bg);
    border: none;
    color: var(--text-primary);
    width: 36px;
    height: 36px;
    border-radius: var(--theme-back-btn-radius);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-top-bar .back-btn:active {
    transform: scale(0.9);
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== SYSTEM MESSAGES ==================== */
.chat-system-msg {
    display: flex;
    justify-content: center;
    padding: 6px 16px;
}

.chat-system-bubble {
    background: rgba(255, 255, 255, 0.06);
    color: #999;
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    text-align: center;
    max-width: 80%;
}

/* ==================== FORWARDED LABEL ==================== */
.chat-forwarded-label {
    font-size: 11px;
    color: #888;
    font-style: italic;
    margin-bottom: 2px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.chat-forwarded-label::before {
    content: '↪';
    font-style: normal;
}

/* ==================== SWIPE GESTURE ==================== */
.view {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ==================== CARD PROFILE ==================== */
.card-profile {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(234, 179, 8, 0.12));
    border-color: rgba(245, 158, 11, 0.2);
}

/* ==================== PLAYER PROFILE ==================== */
.player-profile-list {
    padding: 16px;
}

.pp-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.pp-card.open {
    background: rgba(255, 255, 255, 0.06);
}

.pp-card.pp-card-focus-target {
    border-color: rgba(var(--accent-primary-rgb, 255, 165, 0), 0.4);
    box-shadow: 0 0 0 1px rgba(var(--accent-primary-rgb, 255, 165, 0), 0.14);
}

.pp-card .pp-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px 12px;
    cursor: pointer;
}

.pp-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}

.pp-card .pp-info {
    flex: 1;
    min-width: 0;
    padding-right: 10px;
}

.pp-card .pp-name {
    font-size: 15px;
    font-weight: 700;
    color: #e8e8e8;
    line-height: 1.25;
}

.pp-card .pp-subtitle {
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    line-height: 1.45;
    word-break: break-word;
}

.pp-card .pp-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s;
    flex-shrink: 0;
    margin-left: 8px;
    margin-top: 3px;
    width: 18px;
    text-align: center;
}

.pp-shot-btn {
    position: relative;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.22);
    background: rgba(var(--accent-primary-rgb, 255, 165, 0), 0.08);
    color: var(--accent-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
    flex-shrink: 0;
}

.pp-shot-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    fill: currentColor;
}

.pp-shot-btn.is-loading {
    pointer-events: none;
    color: transparent;
}

.pp-shot-btn.is-loading svg {
    opacity: 0;
}

.pp-shot-btn.is-loading::after {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(var(--accent-primary-rgb, 255, 165, 0), 0.22);
    border-top-color: var(--accent-primary);
    animation: profileShotSpin 0.8s linear infinite;
}

.pp-shot-btn:active {
    transform: scale(0.94);
    opacity: 0.92;
}

.pp-card-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.pp-shot-btn-inline {
    width: auto;
    min-width: 126px;
    height: 36px;
    padding: 0 14px;
    gap: 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.pp-shot-btn-inline span {
    color: currentColor;
    line-height: 1;
}

.pp-card.open .pp-arrow {
    transform: rotate(180deg);
}

.pp-details {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 16px;
}

.pp-card.open .pp-details {
    max-height: 3200px;
    padding: 10px 16px 16px;
}

.pp-platform-block + .pp-platform-block {
    margin-top: 10px;
}

.pp-platform-block .profile-section-title {
    margin-top: 0;
}

.pp-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.pp-stat {
    text-align: center;
    padding: 10px 8px 11px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 72px;
}

.pp-stat-val {
    font-size: 18px;
    font-weight: 800;
    color: #e0e0e0;
    line-height: 1;
}

.pp-stat-label {
    font-size: 11px;
    color: #888;
    margin-top: 6px;
    line-height: 1.2;
    font-weight: 650;
}

.pp-winrate {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #bbb;
    margin-bottom: 8px;
}

.pp-winrate-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.pp-winrate-fill {
    height: 100%;
    background: linear-gradient(90deg, #22c55e, #10b981);
    border-radius: 3px;
    transition: width 0.5s ease;
}

.pp-titles {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.pp-title-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    border: 1px solid rgba(245, 158, 11, 0.18);
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    font-size: 11px;
    font-weight: 600;
}

button.pp-title-badge {
    font: inherit;
    cursor: pointer;
    appearance: none;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    padding-right: 24px;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
    animation: clickableBadgeGlow 2.8s ease-in-out infinite;
}

button.pp-title-badge::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    opacity: 0;
    pointer-events: none;
    animation: clickableBadgeBorderPulse 2.8s ease-in-out infinite;
}

button.pp-title-badge::after {
    content: '›';
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    color: currentColor;
    opacity: 0.76;
    pointer-events: none;
    text-shadow: 0 0 10px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24);
    animation: clickableBadgeArrowFloat 2.1s ease-in-out infinite;
}

button.pp-title-badge:hover {
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.34);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14), 0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18);
    filter: saturate(1.04);
}

button.pp-title-badge:active {
    transform: scale(0.98);
}

.pp-titles .pp-title-badge:nth-child(2n),
.pp-titles .pp-title-badge:nth-child(2n)::before,
.pp-titles .pp-title-badge:nth-child(2n)::after {
    animation-delay: 0.35s;
}

.pp-titles .pp-title-badge:nth-child(3n),
.pp-titles .pp-title-badge:nth-child(3n)::before,
.pp-titles .pp-title-badge:nth-child(3n)::after {
    animation-delay: 0.7s;
}

.profile-season-open-hint::after {
    animation: clickableBadgeArrowNudge 2.1s ease-in-out infinite;
}

@keyframes clickableBadgeGlow {
    0%,
    100% {
        box-shadow: 0 0 0 rgba(var(--accent-primary-rgb, 245, 158, 11), 0);
    }

    50% {
        box-shadow: 0 8px 18px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
    }
}

@keyframes clickableBadgeBorderPulse {
    0%,
    100% {
        opacity: 0;
    }

    45%,
    55% {
        opacity: 1;
    }
}

@keyframes clickableBadgeArrowNudge {
    0%,
    100% {
        transform: translateY(0) translateX(0);
        opacity: 0.68;
    }

    50% {
        transform: translateY(0) translateX(2px);
        opacity: 1;
    }
}

@keyframes clickableBadgeArrowFloat {
    0%,
    100% {
        transform: translateY(-50%) translateX(0);
        opacity: 0.68;
    }

    50% {
        transform: translateY(-50%) translateX(2px);
        opacity: 1;
    }
}

.champion-season-modal {
    width: min(90vw, 648px);
    max-height: min(84vh, 860px);
    padding: 0;
    overflow: hidden;
}

.champion-season-modal .modal-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border-subtle);
}

.champion-season-modal-body {
    max-height: calc(84vh - 66px);
    overflow-y: auto;
    padding: 0 16px 16px;
}

.champion-season-hero {
    margin: 16px 0 14px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), transparent 42%),
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.1), rgba(15, 23, 42, 0.04)),
        var(--bg-secondary);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.16);
}

.champion-season-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-primary);
    margin-bottom: 8px;
}

.champion-season-name {
    font-size: clamp(22px, 3.5vw, 28px);
    line-height: 1.12;
    font-weight: 800;
    color: var(--text-primary);
}

.champion-season-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.champion-season-meta-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.champion-season-section {
    margin-top: 16px;
}

.champion-season-section:first-of-type {
    margin-top: 0;
}

.champion-season-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.champion-season-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.champion-season-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px solid rgba(148, 163, 184, 0.14);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.champion-season-empty {
    padding: 14px 16px;
    border-radius: 14px;
    background: rgba(148, 163, 184, 0.08);
    border: 1px dashed rgba(148, 163, 184, 0.24);
    color: var(--text-tertiary);
    font-size: 13px;
    text-align: center;
}

.champion-season-modal .season-standings-table,
.champion-season-modal .season-scores-content,
.champion-season-modal .history-absent-block {
    margin-top: 0;
}

.champion-season-modal .history-absent-block {
    background: var(--bg-secondary);
}

@media (max-width: 520px) {
    .champion-season-modal {
        width: min(94vw, 420px);
    }

    .champion-season-modal .modal-header {
        padding: 15px 14px 12px;
    }

    .champion-season-modal-body {
        max-height: calc(86vh - 64px);
        padding: 0 14px 14px;
    }

    .champion-season-hero {
        margin: 14px 0 12px;
        padding: 14px;
        border-radius: 18px;
    }

    .champion-season-name {
        font-size: clamp(20px, 6vw, 24px);
    }
}

/* ==================== EMOJI PICKER ==================== */
.chat-emoji-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 6px;
    flex-shrink: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.chat-emoji-btn:hover,
.chat-emoji-btn:active {
    opacity: 1;
}

.emoji-picker-panel {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 2px;
    padding: 8px;
    background: rgba(30, 30, 50, 0.98);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    max-height: 180px;
    overflow-y: auto;
    animation: emojiSlideUp 0.2s ease;
}

@keyframes emojiSlideUp {
    from {
        max-height: 0;
        opacity: 0;
    }

    to {
        max-height: 180px;
        opacity: 1;
    }
}

.emoji-pick-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.15s;
    line-height: 1;
}

.emoji-pick-btn:hover,
.emoji-pick-btn:active {
    background: rgba(255, 255, 255, 0.1);
}

/* ==================== CUP PARTICIPANT PICKER ==================== */
.cup-add-section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin: 14px 0 8px;
    text-transform: uppercase;
}

.cup-participant-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.cup-participant-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.cup-participant-info {
    flex: 1;
    min-width: 0;
}

.cup-participant-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cup-participant-uname {
    font-size: 11px;
    color: var(--accent-primary);
}

.cup-participant-remove {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: #ef4444;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
}

.cup-participant-remove:active {
    background: rgba(239, 68, 68, 0.3);
}

.cup-member-suggestions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 12px;
}

.cup-member-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}

.cup-member-item:active {
    background: rgba(245, 158, 11, 0.12);
}

.cup-member-info {
    flex: 1;
    min-width: 0;
}

.cup-member-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.cup-member-uname {
    font-size: 11px;
    color: var(--text-secondary);
}

.cup-member-add {
    font-size: 20px;
    color: var(--accent-primary);
    font-weight: 700;
}

.cup-manual-add-row {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.cup-manual-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-input);
    color: var(--text-primary);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: var(--font-display);
}

.cup-manual-add-btn {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.cup-manual-add-btn:active {
    opacity: 0.8;
}

.cup-setup-hint {
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    margin-top: 16px;
    font-style: italic;
}

.cup-add-player-area {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-trophy-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent-primary);
}

.profile-trophy-row span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ==========================================
   MULTI-SELECT MODE
   ========================================== */
.multi-select-toolbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 12px;
    margin: 8px 8px 4px;
    animation: msSlideDown 0.2s ease;
}

@keyframes msSlideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ms-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: #22c55e;
}

.ms-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.ms-close:active {
    background: rgba(255, 255, 255, 0.2);
}

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

.ms-action-btn {
    padding: 6px 14px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    transition: background 0.15s;
}

.ms-action-btn:active {
    background: rgba(34, 197, 94, 0.35);
}

.ms-action-btn.danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.ms-action-btn.danger:active {
    background: rgba(239, 68, 68, 0.35);
}

.chat-bubble-wrapper.ms-selected {
    background: rgba(34, 197, 94, 0.08) !important;
    border-left: 3px solid #22c55e;
    border-radius: 0 12px 12px 0;
    transition: background 0.15s, border 0.15s;
}

.chat-bubble-wrapper.ms-selected .chat-bubble {
    border-color: rgba(34, 197, 94, 0.25) !important;
}

/* ========================================================================
   LIGHT THEME OVERRIDES — MUST BE AT END OF FILE FOR CASCADE PRIORITY
   ======================================================================== */

/* ---- Light Theme: Agenda View ---- */
/* ---- Light Theme: Player Profile ---- */
/* ---- Light Theme: Cup Setup & Participants ---- */
/* ---- Light Theme: Emoji Picker ---- */
/* ---- Light Theme: Home View ---- */
/* ---- Light Theme: Chat Bubbles ---- */
/* ---- Light Theme: Standings / Table ---- */
/* ---- Light Theme: Quotes View ---- */
/* ---- Light Theme: Call Overlay ---- */
/* ---- Light Theme: Settings ---- */
/* ---- Light Theme: Matchday / Scores ---- */
/* ---- Light Theme: DM / Direct Messages ---- */
/* ---- Light Theme: General Inputs & Selects ---- */
/* ---- Light Theme: Misc elements with rgba(255) backgrounds ---- */
/* ---- Light Theme: View Top Bar ---- */
/* ---- Light Theme: Header ---- */
/* ---- Light Theme: System Messages ---- */
/* ---- Light Theme: Section Titles ---- */
/* ---- Light Theme: Setting Rows ---- */
/* ---- Light Theme: Empty State ---- */
/* ---- Light Theme: Quotes View ---- */
/* ---- Light Theme: Tab Navigation ---- */
/* ---- Light Theme: Table Header ---- */
/* ---- Light Theme: Search Input ---- */
/* ---- Light Theme: Players Grid ---- */
/* ---- Light Theme: Info Card ---- */
/* ==========================================
   MEDIA VIEWER
   ========================================== */
.media-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity var(--transition-normal);
    touch-action: none;
    overscroll-behavior: none;
    -webkit-overflow-scrolling: auto;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

.media-viewer-overlay.hidden {
    display: none;
    opacity: 0;
}

.media-viewer-content {
    max-width: 95vw;
    max-height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.media-viewer-content img,
.media-viewer-content video {
    max-width: 100%;
    max-height: 95vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.media-viewer-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.media-viewer-close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.media-viewer-close:active {
    transform: scale(0.9);
}

.media-viewer-download {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.media-viewer-download:hover {
    background: rgba(0, 0, 0, 0.8);
}

.media-viewer-download:active {
    transform: scale(0.9);
}

.media-viewer-download svg {
    width: 20px;
    height: 20px;
}

.ringing-pulse {
    animation: ringingPulse 1.5s ease-in-out infinite;
    color: #4ade80 !important;
}

@keyframes ringingPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes dlSpin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   RESPONSIVE: Small phones (≤ 380px)
   Scales down EVERYTHING so UI fits on
   the smallest Android phones
   ============================================ */
@media (max-width: 380px) {

    html {
        font-size: 13px;
    }

    .header-top {
        padding: 8px 10px;
        gap: 6px;
    }

    .header-title {
        font-size: 15px;
    }

    .header-subtitle {
        font-size: 10px;
    }

    .header-btn {
        width: 32px;
        height: 32px;
    }

    .tab-nav {
        top: 50px;
        padding: 0 8px;
    }

    .tab-btn {
        padding: 10px 4px;
    }

    .tab-btn svg {
        width: 18px;
        height: 18px;
    }

    .content {
        padding: 10px;
        padding-bottom: calc(24px + var(--safe-bottom));
    }

    .info-card {
        padding: 14px;
        margin-bottom: 10px;
    }

    .info-header {
        gap: 10px;
        margin-bottom: 14px;
    }

    .info-icon-wrap {
        width: 42px;
        height: 42px;
    }

    .info-icon {
        font-size: 20px;
    }

    .info-title {
        font-size: 17px;
    }

    .info-season {
        font-size: 11px;
    }

    .info-stats-grid {
        gap: 6px;
    }

    .info-stat {
        padding: 8px 2px;
    }

    .info-stat-value {
        font-size: 17px;
    }

    .info-stat-label {
        font-size: 9px;
    }

    .section-title {
        font-size: 13px;
        margin-bottom: 10px;
    }

    .player-card {
        gap: 8px;
        padding: 10px 10px;
    }

    .player-avatar {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .player-name {
        font-size: 12px;
    }

    .player-team {
        font-size: 10px;
    }

    .player-stat-value {
        font-size: 14px;
    }

    .player-stat-label {
        font-size: 8px;
    }

    .table-header {
        padding: 7px 6px;
        font-size: 9.5px;
    }

    .table-row {
        padding: 6px 6px;
    }

    .col-rank {
        width: 24px;
    }

    .col-stat {
        width: 16px;
    }

    .col-gd {
        width: 22px;
    }

    .col-pts {
        width: 24px;
    }

    .rank-badge {
        width: 18px;
        height: 18px;
        font-size: 8.5px;
    }

    .team-cell {
        gap: 3px;
        padding-left: 1px;
    }

    .team-shield {
        width: 16px;
        height: 16px;
    }

    .team-name {
        font-size: 10.5px;
    }

    .stat-cell {
        width: 16px;
        font-size: 9.5px;
    }

    .stat-cell.gd-cell {
        width: 22px;
        font-size: 8.5px;
    }

    .stat-cell.pts-cell {
        width: 24px;
        font-size: 10.5px;
    }

    .jadwal-babak {
        margin-bottom: 14px;
    }

    .jadwal-babak-title {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .jadwal-match-card {
        padding: 10px 10px;
        margin-bottom: 6px;
    }

    .jadwal-match-teams {
        gap: 4px;
    }

    .jadwal-match-team {
        gap: 5px;
        font-size: 11px;
    }

    .jadwal-match-team .match-team-shield {
        width: 20px;
        height: 20px;
    }

    .jadwal-match-result {
        min-width: 48px;
    }

    .jadwal-score {
        font-size: 13px;
        padding: 3px 6px;
    }

    .jadwal-no-result {
        font-size: 10px;
    }

    .btn-jadwal-action {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }

    .league-schedule-actions .league-shot-btn {
        width: 30px;
        min-width: 30px;
        height: 30px;
    }

    .league-shot-btn-pill {
        min-width: 122px;
        height: 34px;
        padding: 0 12px;
        font-size: 12px;
    }

    .stat-card {
        padding: 14px;
        margin-bottom: 10px;
    }

    .stat-item {
        gap: 8px;
        padding: 8px 8px;
    }

    .stat-rank {
        width: 20px;
        height: 20px;
        font-size: 9px;
    }

    .stat-item-name {
        font-size: 11px;
    }

    .stat-item-value {
        font-size: 13px;
    }

    .match-card {
        padding: 10px;
    }

    .match-team-name {
        font-size: 11px;
    }

    .match-team-shield {
        width: 28px;
        height: 28px;
    }

    .match-score-num {
        font-size: 18px;
        min-width: 22px;
    }

    .match-score-sep {
        font-size: 14px;
    }

    .match-vs {
        font-size: 11px;
    }

    .winner-title {
        font-size: 13px;
        letter-spacing: 2px;
    }

    .winner-name {
        font-size: 15px;
    }

    .champion-card {
        padding: 16px !important;
    }

    .champion-title {
        font-size: 11px !important;
        letter-spacing: 2px !important;
    }

    .champion-name {
        font-size: 20px !important;
    }

    .champion-stats {
        font-size: 11px !important;
    }

    .bracket-round {
        min-width: 110px;
    }

    .bracket-round-title {
        font-size: 8px;
    }

    .bracket-team {
        padding: 4px 5px;
        font-size: 10px;
        min-height: 22px;
    }

    .bracket-team .b-name {
        font-size: 9px;
    }

    .bracket-team .b-score {
        font-size: 10px;
    }

    .bracket-conn {
        width: 20px;
    }

    .modal {
        max-width: calc(100vw - 16px);
        margin: 8px;
    }

    .modal-header {
        padding: 14px 14px 0;
    }

    .modal-header h3 {
        font-size: 15px;
    }

    .btn-primary {
        padding: 10px 14px;
        font-size: 12px;
    }

    .btn-buat-jadwal {
        padding: 10px 18px;
        font-size: 13px;
    }

    .cup-btn-generate {
        padding: 10px 18px;
        font-size: 13px;
    }

    .chat-bubble {
        max-width: 85%;
        padding: 8px 10px;
        font-size: 12px;
    }

    .chat-name {
        font-size: 10px;
    }

    .chat-time {
        font-size: 8px;
    }

    .chat-input {
        font-size: 13px;
    }

    .home-card {
        padding: 14px;
    }

    .home-card h3 {
        font-size: 14px;
    }

    .home-card p {
        font-size: 11px;
    }

    .match-score-team-name,
    .cup-score-team-name {
        font-size: 12px;
    }

    .cup-score-input {
        width: 50px;
        height: 50px;
        font-size: 22px;
    }

    .splash-title {
        font-size: 22px;
    }

    .splash-quote {
        font-size: 11px;
    }

    .setting-row {
        padding: 10px 0;
    }

    .setting-label {
        font-size: 12px;
    }

    .setting-desc {
        font-size: 10px;
    }

    .profile-name {
        font-size: 18px;
    }

    .profile-bio {
        font-size: 11px;
    }

    .toast {
        font-size: 12px;
        padding: 10px 14px;
    }

    .heads-up-notif {
        width: calc(100vw - 16px);
        gap: 10px;
        padding: 12px 14px;
        border-radius: 18px;
    }

    .heads-up-notif-avatar {
        width: 42px;
        height: 42px;
        border-radius: 14px;
        padding: 2px;
    }

    .heads-up-notif-title {
        font-size: 13px;
    }

    .heads-up-notif-text {
        font-size: 11px;
    }

    .home-card-emoji {
        width: 46px;
        min-width: 46px;
        height: 46px;
        font-size: 34px;
    }

    .chat-input-bar {
        gap: 4px;
        padding: 8px 6px;
        padding-bottom: calc(12px + max(var(--safe-bottom), 8px));
    }

    .chat-send-btn {
        width: 34px;
        height: 34px;
    }

    .chat-send-btn svg {
        width: 16px;
        height: 16px;
    }

    .chat-attach-btn,
    .chat-plus-btn {
        width: 32px;
        height: 32px;
    }

    .chat-voice-btn {
        width: 30px;
        height: 30px;
    }

    .chat-input {
        padding: 8px 10px;
        font-size: 13px;
    }

    .chat-scroll-fab {
        width: 32px;
        height: 32px;
        bottom: 70px;
    }

    .chat-scroll-fab svg {
        width: 18px;
        height: 18px;
    }

    .chat-tab-bar {
        gap: 0;
    }

    .chat-tab {
        padding: 10px 12px;
        font-size: 12px;
    }

    .grp-call-bar {
        padding: 6px 8px;
    }

    .grp-call-btn {
        padding: 6px 12px;
        font-size: 11px;
    }

    .cup-play-order {
        padding: 14px 10px;
        margin-top: 16px;
    }

    .cup-play-order-title {
        font-size: 15px;
    }

    .cup-play-order-subtitle {
        font-size: 11px;
    }

    .cup-po-round-title {
        font-size: 10px;
        padding: 5px 8px;
    }

    .cup-po-item {
        gap: 6px;
        padding: 8px 8px;
    }

    .cup-po-num {
        width: 22px;
        height: 22px;
        font-size: 10px;
    }

    .cup-po-avatar {
        width: 22px;
        height: 22px;
    }

    .cup-po-shield {
        width: 22px;
        height: 22px;
    }

    .cup-po-player span {
        font-size: 11px;
    }

    .cup-po-vs {
        font-size: 9px;
    }

    .cup-po-leg {
        font-size: 8.5px;
        padding: 2px 6px;
    }

    .cup-po-check {
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    .agenda-input {
        font-size: 13px;
        padding: 8px 10px;
    }

    .agenda-add-btn {
        padding: 8px 14px;
        font-size: 12px;
    }

    .cup-setup {
        padding: 16px;
    }

    .cup-setup-title {
        font-size: 17px;
    }

    .cup-participants-input {
        padding: 10px;
        font-size: 13px;
    }

    .cup-setup-buttons {
        gap: 6px;
    }

    .cup-btn-generate,
    .cup-btn-manual {
        padding: 10px 14px;
        font-size: 12px;
    }

    .cup-header-bar {
        padding: 10px 12px;
    }

    .cup-header-bar h3 {
        font-size: 14px;
    }

    .bracket-game {
        margin: 3px 0;
    }

    .msd-header {
        padding: 12px;
    }

    .msd-name {
        font-size: 12px;
    }

    .msd-avatar {
        width: 36px;
        height: 36px;
    }

    .msd-shield {
        width: 36px;
        height: 36px;
    }

    .cup-score-modal {
        padding: 16px;
    }

    .cup-score-vs {
        gap: 10px;
        margin-bottom: 16px;
    }

    .cup-score-team-name {
        font-size: 11px;
    }

    .cup-score-vs-label {
        font-size: 13px;
    }

    .profile-avatar-wrap {
        width: 72px;
        height: 72px;
    }

    .profile-stat-num {
        font-size: 16px;
    }

    .profile-stat-label {
        font-size: 9px;
    }
}

/* ============================================
   RESPONSIVE: Very small phones (≤ 320px)
   Extra aggressive scaling
   ============================================ */
@media (max-width: 320px) {
    html {
        font-size: 12px;
    }

    .header-top {
        padding: 6px 8px;
    }

    .header-title {
        font-size: 14px;
    }

    .content {
        padding: 8px;
    }

    .table-row {
        padding: 6px 6px;
    }

    .col-rank {
        width: 22px;
    }

    .rank-badge {
        width: 18px;
        height: 18px;
        font-size: 8px;
    }

    .team-shield {
        width: 14px;
        height: 14px;
    }

    .team-name {
        font-size: 9px;
    }

    .stat-cell {
        width: 16px;
        font-size: 9px;
    }

    .stat-cell.gd-cell {
        width: 22px;
        font-size: 8px;
    }

    .stat-cell.pts-cell {
        width: 24px;
        font-size: 10px;
    }

    .jadwal-match-team {
        gap: 3px;
        font-size: 10px;
    }

    .jadwal-match-card {
        padding: 8px;
    }

    .jadwal-score {
        font-size: 12px;
        padding: 2px 5px;
    }

    .jadwal-match-result {
        min-width: 42px;
    }

    .stat-item-name {
        font-size: 10px;
    }

    .stat-item-value {
        font-size: 12px;
    }

    .player-name {
        font-size: 11px;
    }

    .player-avatar {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .bracket-round {
        min-width: 95px;
    }

    .bracket-team .b-name {
        font-size: 8px;
    }

    .chat-input-bar {
        gap: 4px;
        padding: 6px 6px;
    }

    .chat-send-btn {
        width: 32px;
        height: 32px;
    }

    .chat-attach-btn,
    .chat-plus-btn,
    .chat-voice-btn {
        width: 28px;
        height: 28px;
    }

    .chat-input {
        padding: 8px 10px;
        font-size: 12px;
    }

    .chat-bubble {
        font-size: 11px;
        padding: 6px 8px;
    }

    .cup-play-order {
        padding: 10px 8px;
    }

    .cup-play-order-title {
        font-size: 14px;
    }

    .cup-po-item {
        gap: 4px;
        padding: 6px 6px;
    }

    .cup-po-num {
        width: 18px;
        height: 18px;
        font-size: 9px;
    }

    .cup-po-avatar,
    .cup-po-shield {
        width: 18px;
        height: 18px;
    }

    .cup-po-player span {
        font-size: 10px;
    }

    .cup-po-leg {
        font-size: 8px;
        padding: 2px 4px;
    }
}

/* ============================================
   Match Score Dialog (MSD) — Redesigned
   ============================================ */
.msd-container {
    padding: 4px 0 0;
}

#edit-modal.match-score-modal .msd-container {
    color: var(--theme-surface-text-primary);
}

.msd-versus {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 12px;
    padding: 20px 16px 16px;
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, transparent 100%);
    border-radius: var(--radius-md);
    margin-bottom: 16px;
}

#edit-modal.match-score-modal .msd-versus {
    background:
        linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.11), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.05)),
        rgba(255, 255, 255, 0.05);
    border: 1px solid var(--theme-surface-subtle-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.msd-player {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.msd-player:active {
    transform: scale(0.95);
}

.msd-avatar-wrap {
    position: relative;
}

.msd-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    border: 2.5px solid rgba(245, 158, 11, 0.3);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.15);
    transition: border-color 0.3s, box-shadow 0.3s;
}

.msd-player:hover .msd-avatar {
    border-color: var(--accent-primary);
    box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
}

.msd-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.msd-avatar-shield {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(245, 158, 11, 0.08);
}

.msd-avatar-shield svg {
    width: 100%;
    height: 100%;
}

.msd-edit-badge {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #000;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-card);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.2s;
}

.msd-player:hover .msd-edit-badge {
    transform: scale(1.15);
}

.msd-player-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    color: var(--text-primary);
    text-align: center;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#edit-modal.match-score-modal .msd-player-name {
    color: var(--theme-surface-text-primary);
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.msd-player-hint {
    font-size: 10px;
    color: var(--text-muted);
    opacity: 0.6;
    transition: opacity 0.2s;
}

#edit-modal.match-score-modal .msd-player-hint {
    color: var(--theme-surface-text-muted);
    opacity: 0.92;
}

.msd-player:hover .msd-player-hint {
    opacity: 1;
    color: var(--accent-primary);
}

.msd-vs-badge {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 14px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    margin-top: 16px;
    letter-spacing: 2px;
    flex-shrink: 0;
}

.msd-score-section {
    padding: 16px 20px 20px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin: 0 0 16px;
}

#edit-modal.match-score-modal .msd-score-section {
    background: rgba(255, 255, 255, 0.07);
    border-color: var(--theme-surface-subtle-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.msd-score-label {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 14px;
}

#edit-modal.match-score-modal .msd-score-label {
    color: var(--theme-surface-text-secondary);
}

.msd-score-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.msd-score-input {
    width: 72px;
    height: 72px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-primary);
    background: var(--bg-input);
    border: 2px solid var(--border-light);
    border-radius: 16px;
    outline: none;
    transition: all 0.25s ease;
    -moz-appearance: textfield;
    appearance: textfield;
}

#edit-modal.match-score-modal .msd-score-input {
    background: rgba(255, 255, 255, 0.13);
    color: var(--theme-surface-accent);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.msd-score-input::-webkit-inner-spin-button,
.msd-score-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.msd-score-input::placeholder {
    color: var(--text-muted);
    opacity: 0.4;
}

#edit-modal.match-score-modal .msd-score-input::placeholder {
    color: var(--theme-surface-text-muted);
    opacity: 0.68;
}

.msd-score-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow), 0 4px 16px rgba(245, 158, 11, 0.15);
    transform: scale(1.05);
}

.msd-score-divider {
    display: none;
}

.msd-actions {
    display: flex;
    gap: 10px;
    padding: 0 0 4px;
}

.msd-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 16px;
    border: none;
    border-radius: 12px;
    font-family: var(--font-primary);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.msd-btn:active {
    transform: scale(0.96);
}

.msd-btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

#edit-modal.match-score-modal .msd-btn-delete {
    background: rgba(239, 68, 68, 0.14);
    color: #ff8b83;
    border-color: rgba(239, 68, 68, 0.2);
}

.msd-btn-delete:hover {
    background: rgba(239, 68, 68, 0.18);
}

.msd-btn-save {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #000;
    box-shadow: 0 4px 16px var(--accent-glow);
}

#edit-modal.match-score-modal .msd-btn-save {
    color: var(--theme-surface-text-primary);
}

.msd-btn-save:hover {
    box-shadow: 0 6px 24px var(--accent-glow);
    filter: brightness(1.05);
}

/* ============================================
   Player Picker (PP) — Redesigned
   ============================================ */
.pp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pp-overlay.pp-visible {
    opacity: 1;
}

.pp-container {
    background: var(--bg-card);
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.pp-visible .pp-container {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.pp-overlay .pp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.06) 0%, transparent 100%);
}

.pp-overlay .pp-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pp-overlay .pp-title-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.pp-overlay .pp-title-text {
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 800;
    color: var(--text-primary);
}

.pp-overlay .pp-title-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.pp-overlay .pp-close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--border-light);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.pp-overlay .pp-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--red);
    border-color: rgba(239, 68, 68, 0.3);
}

.pp-search-wrap {
    position: relative;
    padding: 12px 16px;
}

.pp-search-icon {
    position: absolute;
    left: 28px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    pointer-events: none;
}

.pp-search-input {
    width: 100%;
    padding: 12px 14px 12px 40px;
    border-radius: 12px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.pp-search-input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.pp-search-input::placeholder {
    color: var(--text-muted);
}

.pp-list {
    overflow-y: auto;
    flex: 1;
    padding: 4px 12px 16px;
    -webkit-overflow-scrolling: touch;
}

.pp-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    width: 100%;
    border-radius: 12px;
    background: transparent;
    appearance: none;
    cursor: pointer;
    margin-bottom: 2px;
    transition: all 0.15s ease;
    border: 1.5px solid transparent;
    text-align: left;
}

.pp-item:hover {
    background: rgba(245, 158, 11, 0.06);
    border-color: rgba(245, 158, 11, 0.12);
}

.pp-item:active {
    transform: scale(0.98);
}

.pp-item-current {
    background: rgba(245, 158, 11, 0.1) !important;
    border-color: rgba(245, 158, 11, 0.25) !important;
}

.pp-item-disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

.pp-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid var(--border-subtle);
    transition: border-color 0.2s;
}

.pp-item:hover .pp-item-avatar {
    border-color: var(--accent-primary);
}

.pp-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pp-item-name {
    flex: 1;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pp-item-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 20px;
    flex-shrink: 0;
    letter-spacing: 0.3px;
}

.pp-badge-current {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-primary);
}

.pp-badge-opponent {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.pp-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.pp-item-count {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

.pp-empty {
    padding: 32px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   EMOJI REACTIONS SYSTEM
   ============================================ */
.reaction-quick-bar {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 12px 16px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.reaction-quick-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.06);
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.reaction-quick-btn:active {
    transform: scale(1.3);
    background: rgba(255, 255, 255, 0.15);
}

.chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
    margin-bottom: -2px;
}

.chat-reaction-chip {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.chat-reaction-chip.mine {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.3);
}

.chat-reaction-chip:active {
    transform: scale(0.92);
}

.chat-reaction-count {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ============================================
   POLLING SYSTEM
   ============================================ */
.poll-add-option-btn {
    display: inline-flex;
    width: 100%;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 12px 14px;
    margin-top: 14px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(16, 185, 129, 0.08));
    border: 1px dashed rgba(59, 130, 246, 0.34);
    border-radius: 14px;
    color: var(--accent-primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.poll-add-option-btn:active {
    transform: scale(0.97);
}

.poll-creator-overlay {
    background: rgba(7, 13, 28, 0.38);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 0 10px;
}

.poll-creator-sheet {
    width: min(100%, 480px);
    max-height: min(84vh, 760px);
    overflow-y: auto;
    border-radius: 28px 28px 0 0;
    padding: 10px 0 calc(18px + var(--safe-bottom));
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 -22px 54px rgba(15, 23, 42, 0.22);
    background:
        radial-gradient(circle at top left, rgba(52, 211, 153, 0.1), transparent 38%),
        radial-gradient(circle at top right, rgba(59, 130, 246, 0.09), transparent 34%),
        var(--bg-card);
}

.poll-creator-handle {
    width: 46px;
    height: 5px;
    border-radius: 999px;
    margin: 2px auto 12px;
    background: rgba(148, 163, 184, 0.4);
}

.poll-creator-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px 18px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.poll-creator-head-copy {
    min-width: 0;
}

.poll-creator-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #3b82f6;
    margin-bottom: 8px;
}

.poll-creator-title {
    margin: 0;
    font-family: var(--font-display);
    font-size: 25px;
    line-height: 1.08;
    color: var(--text-primary);
}

.poll-creator-subtitle {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
    max-width: 340px;
}

.poll-creator-close {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(148, 163, 184, 0.08);
    color: var(--text-secondary);
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.poll-creator-close:active {
    transform: scale(0.96);
}

.poll-creator-body {
    padding: 18px 20px 0;
}

.poll-field {
    display: block;
}

.poll-field-label {
    display: inline-block;
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.poll-field-input {
    min-height: 54px;
    border-radius: 16px;
    padding: 14px 16px;
}

.poll-options-card {
    margin-top: 16px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(148, 163, 184, 0.06);
}

.poll-options-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.poll-options-note {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.poll-options-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 12px;
    font-weight: 700;
}

.poll-options-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.poll-option-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.poll-option-index {
    width: 32px;
    height: 32px;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(37, 99, 235, 0.12);
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
}

.poll-option-row .poll-option-input {
    margin-bottom: 0;
    flex: 1;
    min-width: 0;
    min-height: 50px;
    border-radius: 14px;
}

.poll-option-remove {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.18);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.poll-option-remove:active {
    transform: scale(0.95);
}

.poll-settings {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.poll-settings-grid {
    margin-top: 16px;
    display: grid;
    gap: 12px;
}

.poll-setting-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    padding: 15px 16px;
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
}

.poll-setting-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.poll-setting-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

.poll-setting-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.poll-setting-card input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
    accent-color: var(--accent-primary);
    flex-shrink: 0;
}

#edit-modal.match-score-modal .msd-vs-badge {
    background: var(--theme-surface-subtle-bg-alt);
    border-color: var(--theme-surface-subtle-border);
    color: var(--theme-surface-text-secondary);
}

.poll-creator-actions {
    display: grid;
    grid-template-columns: 1fr 1.3fr;
    gap: 12px;
    padding: 20px 20px 0;
}

.poll-creator-btn {
    min-height: 52px;
    border-radius: 16px;
    border: none;
    font-family: inherit;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.18s ease, filter 0.18s ease, box-shadow 0.18s ease;
}

.poll-creator-btn:active {
    transform: scale(0.98);
}

.poll-creator-btn-secondary {
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--text-secondary);
}

.poll-creator-btn-primary {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: #fff;
    box-shadow: 0 12px 28px rgba(234, 88, 12, 0.24);
}

.poll-bubble {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(59, 130, 246, 0.05));
    border: 1px solid rgba(59, 130, 246, 0.18);
    border-radius: 18px;
    padding: 15px;
    min-width: 240px;
}

.poll-badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.poll-question {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
    color: var(--text-primary);
    line-height: 1.5;
}

.poll-option {
    position: relative;
    border-radius: 12px;
    margin-bottom: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.poll-option:active {
    transform: scale(0.98);
}

.poll-option-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.25), rgba(139, 92, 246, 0.15));
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.poll-option-text {
    position: relative;
    z-index: 1;
    padding: 12px 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    gap: 12px;
}

.poll-option.voted {
    border-color: rgba(99, 102, 241, 0.4);
}

.poll-option.voted .poll-option-bar {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.4), rgba(139, 92, 246, 0.25));
}

.poll-option-pct {
    font-weight: 700;
    font-size: 12px;
    color: var(--accent-primary);
    min-width: 54px;
    text-align: right;
    flex-shrink: 0;
}

.poll-meta {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.poll-option-input {
    margin-bottom: 6px;
}

@media (max-width: 480px) {
    .poll-creator-overlay {
        padding: 0;
    }

    .poll-creator-sheet {
        width: 100%;
        border-radius: 24px 24px 0 0;
    }

    .poll-creator-head {
        padding: 0 16px 16px;
    }

    .poll-creator-body {
        padding: 16px 16px 0;
    }

    .poll-creator-title {
        font-size: 22px;
    }

    .poll-creator-actions {
        grid-template-columns: 1fr;
        padding: 18px 16px 0;
    }
}

/* ============================================
   STORIES / STATUS SYSTEM (WhatsApp-style)
   ============================================ */
.status-my {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.status-my:active {
    background: rgba(255, 255, 255, 0.04);
}

.status-my-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: visible;
    flex-shrink: 0;
    border: 2px dashed rgba(255, 255, 255, 0.15);
}

.status-my-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.status-my-avatar.has-status {
    border: 3px solid #25D366;
}

.status-my-plus {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--bg-primary);
    z-index: 2;
}

.status-my-info {
    flex: 1;
    min-width: 0;
}

.status-my-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
}

.status-my-hint {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.status-privacy-inline {
    width: calc(100% - 32px);
    margin: 10px 16px 2px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 16px;
    border: 1px solid var(--theme-inline-border);
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
    cursor: pointer;
    text-align: left;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.status-privacy-inline:active {
    transform: scale(0.99);
}

.status-privacy-inline-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.14);
    flex-shrink: 0;
}

.status-privacy-inline-copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.status-privacy-inline-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.status-privacy-inline-summary {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-secondary);
}

.status-privacy-inline-arrow {
    font-size: 22px;
    line-height: 1;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.status-section-label {
    padding: 10px 16px 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.status-user-list {
    padding-bottom: 20px;
}

.status-user-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.status-user-item:active {
    background: rgba(255, 255, 255, 0.04);
}

.status-user-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 3px;
    background: conic-gradient(#25D366 0deg, #25D366 360deg);
}

.status-user-avatar.multi-story {
    background: conic-gradient(#25D366 0deg, #25D366 170deg,
            transparent 170deg, transparent 190deg,
            #25D366 190deg, #25D366 360deg);
}

.status-user-avatar.viewed {
    background: conic-gradient(rgba(255, 255, 255, 0.25) 0deg, rgba(255, 255, 255, 0.25) 360deg);
}

.status-user-avatar.viewed.multi-story {
    background: conic-gradient(rgba(255, 255, 255, 0.25) 0deg, rgba(255, 255, 255, 0.25) 170deg,
            transparent 170deg, transparent 190deg,
            rgba(255, 255, 255, 0.25) 190deg, rgba(255, 255, 255, 0.25) 360deg);
}

/* ===== Story Shimmer Loading ===== */
.story-shimmer-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    background: rgba(0, 0, 0, 0.85);
    transition: opacity 0.3s ease;
}

.story-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
            rgba(255, 255, 255, 0.0) 0%,
            rgba(255, 255, 255, 0.03) 20%,
            rgba(255, 255, 255, 0.08) 40%,
            rgba(255, 255, 255, 0.03) 60%,
            rgba(255, 255, 255, 0.0) 80%);
    background-size: 200% 100%;
    animation: storyShimmer 1.5s ease-in-out infinite;
}

@keyframes storyShimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.story-loading-spinner {
    position: relative;
    z-index: 6;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
}

.status-user-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 18px;
    overflow: hidden;
    border: 2px solid var(--bg-primary);
}

.status-user-avatar-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.status-user-info {
    flex: 1;
    min-width: 0;
}

.status-user-name {
    font-weight: 600;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-user-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ===== Story Creator Modal (Modern Premium) ===== */
.sc-overlay {
    position: fixed;
    inset: 0;
    z-index: 9998;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: scFadeIn 0.25s ease;
}

@keyframes scFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.sc-modal {
    width: 100%;
    max-width: 480px;
    max-height: 85vh;
    background: var(--surface-card, #1a1b2e);
    border-radius: 20px 20px 0 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scSlideUp 0.3s cubic-bezier(0.32, 0.72, 0, 1);
    box-shadow: 0 -4px 32px rgba(0, 0, 0, 0.5);
}

@keyframes scSlideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

.sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sc-close {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #aaa;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sc-close:active {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(0.9);
}

.sc-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.3px;
}

.sc-post-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    border: none;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    letter-spacing: -0.2px;
}

.sc-post-btn:active {
    transform: scale(0.95);
    filter: brightness(0.9);
}

.sc-post-btn:disabled {
    opacity: 0.4;
    pointer-events: none;
}

.sc-upload-progress {
    padding: 8px 16px 4px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sc-upload-progress.hidden {
    display: none;
}

.sc-upload-progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.sc-upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #25D366, #128C7E);
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.sc-upload-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShimmer 1.5s infinite;
}

@keyframes progressShimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.sc-upload-progress-text {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    min-width: 75px;
    text-align: right;
}

.sc-tabs {
    display: flex;
    padding: 8px 12px;
    gap: 4px;
}

.sc-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.45);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    -webkit-tap-highlight-color: transparent;
}

.sc-tab:active {
    transform: scale(0.96);
}

.sc-tab.active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sc-tab-icon {
    font-size: 16px;
}

.sc-privacy-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 16px 10px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid var(--theme-inline-border);
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
}

.sc-privacy-copy {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.sc-privacy-title {
    font-size: 12px;
    font-weight: 700;
    color: #fff;
}

.sc-privacy-summary {
    margin-top: 4px;
    font-size: 11px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.72);
}

.sc-privacy-btn {
    border: 0;
    border-radius: 999px;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    font-weight: 700;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
}

.sc-privacy-btn:active {
    transform: scale(0.98);
    background: rgba(255, 255, 255, 0.22);
}

.sc-body {
    padding: 12px 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.sc-text-wrap {
    position: relative;
    text-align: left;
}

.sc-textarea {
    width: 100%;
    min-height: 80px;
    max-height: 160px;
    padding: 14px 16px;
    padding-bottom: 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    resize: none;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}

.sc-textarea:focus {
    border-color: rgba(37, 211, 102, 0.4);
    background: rgba(255, 255, 255, 0.06);
}

.sc-textarea::placeholder {
    color: rgba(255, 255, 255, 0.25);
}

.sc-char-count {
    position: absolute;
    bottom: 8px;
    right: 14px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    pointer-events: none;
}

.sc-drop-area {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 28px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.sc-drop-area:active {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(37, 211, 102, 0.3);
}

.sc-drop-icon {
    font-size: 36px;
    margin-bottom: 8px;
}

.sc-drop-text {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
}

.sc-drop-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 4px;
}

.sc-caption-wrap {
    position: relative;
    margin-top: 10px;
}

.sc-caption-input {
    width: 100%;
    padding: 10px 54px 10px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 13px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.sc-caption-input:focus {
    border-color: var(--accent-primary);
}

.sc-caption-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.sc-caption-count {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
}

.sc-preview {
    position: relative;
    margin-top: 12px;
    border-radius: 16px;
    overflow: hidden;
    background: #000;
}

.sc-preview-content img,
.sc-preview-content video {
    width: 100%;
    max-height: 240px;
    object-fit: contain;
    display: block;
    border-radius: 16px;
}

.sc-preview-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.sc-preview-remove:active {
    transform: scale(0.9);
    background: rgba(239, 68, 68, 0.8);
}

.sc-section {
    text-align: center;
}

.sc-bg-picker {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px 4px;
    scrollbar-width: none;
}

.sc-bg-picker::-webkit-scrollbar {
    display: none;
}

.sc-bg-swatch {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid transparent;
    flex-shrink: 0;
    cursor: pointer;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    position: relative;
}

.sc-bg-swatch:active {
    transform: scale(0.88);
}

.sc-bg-swatch.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px var(--accent-primary), 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: scale(1.12);
}

.sc-vn-idle {
    padding: 40px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sc-vn-idle-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.sc-vn-record-btn {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid rgba(37, 211, 102, 0.3);
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.15), rgba(37, 211, 102, 0.05));
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.sc-vn-pick-btn {
    min-width: 132px;
    height: 48px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.sc-vn-record-btn:active {
    transform: scale(0.92);
    border-color: #25D366;
}

.sc-vn-pick-btn:active {
    transform: scale(0.97);
    background: rgba(255, 255, 255, 0.1);
}

.sc-vn-mic {
    font-size: 28px;
}

.sc-vn-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 10px;
}

.sc-vn-recording {
    padding: 24px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sc-vn-pulse {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: #ef4444;
    margin: 0 auto;
    animation: scVnPulse 1.2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sc-vn-pulse::after {
    content: '🎤';
    font-size: 28px;
}

@keyframes scVnPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5);
    }

    50% {
        transform: scale(1.08);
        box-shadow: 0 0 0 14px rgba(239, 68, 68, 0);
    }
}

.sc-vn-timer {
    font-size: 32px;
    font-weight: 700;
    color: #ef4444;
    margin: 14px 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.sc-vn-controls {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.sc-vn-cancel,
.sc-vn-stop {
    padding: 10px 22px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.sc-vn-cancel {
    background: rgba(255, 255, 255, 0.08);
    color: #aaa;
}

.sc-vn-cancel:active {
    background: rgba(255, 255, 255, 0.12);
}

.sc-vn-stop {
    background: #ef4444;
    color: #fff;
}

.sc-vn-stop:active {
    filter: brightness(0.85);
    transform: scale(0.96);
}

.sc-vn-done {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.sc-vn-player {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 28px;
    padding: 10px 16px;
}

.sc-vn-play-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: none;
    background: #25D366;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
}

.sc-vn-play-btn:active {
    transform: scale(0.92);
}

.sc-vn-wave {
    flex: 1;
    height: 28px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.sc-vn-wave-bar {
    width: 3px;
    border-radius: 2px;
    background: rgba(37, 211, 102, 0.5);
    transition: height 0.15s;
}

.sc-vn-duration {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.sc-vn-rerecord {
    margin-top: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 13px;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.2s;
}

.sc-vn-ready-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.sc-vn-pick-link {
    margin-top: 12px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.52);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    transition: color 0.2s;
}

.sc-vn-rerecord:active {
    color: #fff;
}

.sc-vn-pick-link:active {
    color: #fff;
}

.story-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.story-viewer-progress {
    display: flex;
    gap: 3px;
    padding: 8px 8px 0;
    padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.story-viewer-progress-bar {
    flex: 1;
    height: 3px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

.story-viewer-progress-bar.done {
    background: #fff;
}

.story-viewer-progress-bar.active .story-viewer-progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    animation: storyProgressFill 5s linear forwards;
}

.story-viewer-overlay.paused .story-viewer-progress-bar.active .story-viewer-progress-fill {
    animation-play-state: paused;
}

@keyframes storyProgressFill {
    from {
        width: 0%;
    }

    to {
        width: 100%;
    }
}

.story-viewer-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 12px 8px;
    padding-top: calc(env(safe-area-inset-top, 0px) + 20px);
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent);
}

.story-viewer-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.story-viewer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.story-viewer-info {
    flex: 1;
}

.story-viewer-name {
    font-weight: 600;
    font-size: 14px;
    color: #fff;
}

.story-viewer-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

.story-viewer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.story-viewer-close:active {
    background: rgba(255, 255, 255, 0.3);
}

.story-viewer-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.story-viewer-action-btn:active {
    transform: scale(0.9);
    background: rgba(255, 0, 0, 0.3);
}

.story-viewer-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 0 0;
    text-align: center;
    overflow: hidden;
    position: relative;
    touch-action: none;

}

.story-viewer-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 0;
    transition: transform 0.1s ease;
    will-change: transform;
}

.story-viewer-content video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.1s ease;
    will-change: transform;
}

.story-viewer-content video::-webkit-media-controls {
    display: none !important;
}

.story-viewer-content video::-webkit-media-controls-enclosure {
    display: none !important;
}

.story-viewer-content video::-webkit-media-controls-panel {
    display: none !important;
}

.story-viewer-content video::-moz-media-controls {
    display: none !important;
}

.story-viewer-caption {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 14;
    padding: 12px 24px;
    text-align: center;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.55);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.38) 45%, transparent);
    pointer-events: none;
}

.story-viewer-caption.with-reply {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 104px);
}

.story-viewer-caption.with-viewers {
    bottom: calc(env(safe-area-inset-bottom, 0px) + 58px);
}

.story-viewer-caption.hidden {
    display: none;
}

.story-viewer-text {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    word-wrap: break-word;
    max-width: 90%;
    padding: 32px 24px;
    border-radius: 16px;
    transition: transform 0.1s ease;
    will-change: transform;
}

.story-viewer-nav {
    position: absolute;
    top: 80px;
    bottom: 80px;
    left: 0;
    right: 0;
    display: flex;
    z-index: 5;
}

.story-viewer-prev,
.story-viewer-next {
    flex: 1;
    cursor: pointer;
}

/* ---- Mute/Unmute Button ---- */
.story-mute-btn {
    position: absolute;
    bottom: 120px;
    right: 16px;
    z-index: 16;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.story-mute-btn:active {
    transform: scale(0.9);
    background: rgba(0, 0, 0, 0.6);
}

.story-mute-btn.hidden {
    display: none;
}

/* ---- Reply + React Footer (for others' stories) ---- */
.story-viewer-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    padding: 8px 12px calc(env(safe-area-inset-bottom, 8px) + 8px);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
}

.story-viewer-reply-bar {
    display: flex;
    align-items: center;
    gap: 8px;
}

.story-viewer-reply-bar input {
    flex: 1;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 10px 16px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.story-viewer-reply-bar input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.story-viewer-reply-bar input:focus {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.18);
}

.story-reply-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #25D366;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    opacity: 0.5;
    pointer-events: none;
}

.story-reply-send.active {
    opacity: 1;
    pointer-events: all;
}

.story-reply-send:active {
    transform: scale(0.9);
}

.story-viewer-react-bar {
    display: flex;
    gap: 2px;
    justify-content: center;
    margin-top: 8px;
}

.story-react-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.story-react-btn:active {
    transform: scale(1.4);
}

.story-react-btn.sent {
    animation: storyReactPop 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes storyReactPop {
    0% {
        transform: scale(1);
    }

    30% {
        transform: scale(1.8);
    }

    60% {
        transform: scale(0.9);
    }

    100% {
        transform: scale(1);
    }
}

.story-react-btn.reacted {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.15);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

/* ---- Viewers Footer (for own stories) ---- */
.story-viewers-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 15;
    padding: 12px 16px calc(env(safe-area-inset-bottom, 8px) + 8px);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    display: flex;
    justify-content: center;
    gap: 12px;
}

.story-viewers-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.story-viewers-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.97);
}

.story-viewers-icon {
    font-size: 18px;
}

.story-add-btn {
    background: #25D366;
    border: none;
    border-radius: 24px;
    padding: 10px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.story-add-btn:active {
    background: #1da851;
    transform: scale(0.95);
}

/* ---- Viewers Panel (slides up) ---- */
.story-viewers-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--bg-primary, #1a1b2e);
    border-radius: 20px 20px 0 0;
    max-height: 60vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.5);
}

.story-viewers-panel.show {
    transform: translateY(0);
}

.story-viewers-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #fff);
    font-size: 15px;
    font-weight: 600;
    position: sticky;
    top: 0;
    background: var(--bg-primary, #1a1b2e);
    z-index: 1;
}

.story-viewers-panel-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary, #fff);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.story-viewers-panel-list {
    padding: 8px 0;
}

.story-viewer-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
}

.story-viewer-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    font-size: 15px;
}

.story-viewer-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.story-viewer-item-info {
    flex: 1;
    min-width: 0;
}

.story-viewer-item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #fff);
}

.story-viewer-item-time {
    font-size: 12px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    margin-top: 2px;
}

.story-viewers-empty {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.5));
    font-size: 14px;
}

.story-viewer-overlay.hidden {
    display: none;
}

.story-viewers-panel.hidden {
    display: block;
    transform: translateY(100%);
}

.story-viewer-footer.hidden,
.story-viewers-footer.hidden {
    display: none;
}

.story-viewer-action-btn.hidden {
    display: none;
}

#story-creator-modal.hidden {
    display: none;
}

.stories-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   BADGES & ACHIEVEMENT SYSTEM
   ============================================ */

.badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
    animation: badgePop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes badgePop {
    from {
        opacity: 0;
        transform: scale(0.7);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.badge-chip.gold {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(251, 191, 36, 0.1));
    border-color: rgba(245, 158, 11, 0.3);
}

.badge-chip.silver {
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15), rgba(203, 213, 225, 0.1));
    border-color: rgba(148, 163, 184, 0.3);
}

.badge-chip.bronze {
    background: linear-gradient(135deg, rgba(180, 83, 9, 0.15), rgba(217, 119, 6, 0.1));
    border-color: rgba(180, 83, 9, 0.3);
}

.badge-chip.special {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(168, 85, 247, 0.1));
    border-color: rgba(236, 72, 153, 0.3);
}

.badge-chip.locked {
    opacity: 0.45;
    filter: grayscale(0.6);
}

.badge-chip.earned {
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.3);
}

.badge-chip.earned.gold {
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

.badge-chip.earned.special {
    box-shadow: 0 0 12px rgba(236, 72, 153, 0.4);
}

.badge-earned-tag,

/* ---- Badge Guide Section ---- */

/* ============================================
   AGENDA RSVP ENHANCEMENT
   ============================================ */
.agenda-rsvp {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.rsvp-buttons {
    display: flex;
    gap: 6px;
}

.rsvp-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.rsvp-btn:active {
    transform: scale(0.92);
}

.rsvp-btn.rsvp-yes.active {
    background: rgba(22, 163, 74, 0.2);
    border-color: rgba(22, 163, 74, 0.4);
    color: #22c55e;
}

.rsvp-btn.rsvp-no.active {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}

.rsvp-btn.rsvp-maybe.active {
    background: rgba(245, 158, 11, 0.2);
    border-color: rgba(245, 158, 11, 0.4);
    color: #f59e0b;
}

.rsvp-count {
    font-size: 11px;
    font-weight: 700;
}

.rsvp-names-container {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rsvp-names {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.rsvp-name-chip {
    font-size: 10.5px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 10px;
    line-height: 1.4;
}

.rsvp-names-yes .rsvp-name-chip {
    background: rgba(22, 163, 74, 0.12);
    color: #22c55e;
    border: 1px solid rgba(22, 163, 74, 0.2);
}

.rsvp-names-maybe .rsvp-name-chip {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.rsvp-names-no .rsvp-name-chip {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.agenda-rsvp-summary {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.home-card.card-stories {
    --card-accent: #a855f7;
}

.home-card.card-gallery {
    --card-accent: #2563eb;
}

.home-card.card-friendly {
    --card-accent: #10b981;
}

.home-card.card-info {
    --card-accent: var(--accent-secondary);
}

/* ========================================================================
   GLASSMORPHISM LIGHT THEME — COMPREHENSIVE COMPONENT OVERRIDES
   (must be at end for cascade priority)
   ======================================================================== */

/* ---- Bottom Navigation Glass ---- */
/* ---- Story Creator Glass ---- */
/* ---- Story Viewer Light ---- */
/* ---- Chat View Glass ---- */
/* ---- Group / DM Chat Items Glass ---- */
/* ---- Standings Table Glass ---- */
/* ---- Search / Input Glass ---- */
/* ---- Settings Glass ---- */
/* ---- Action Buttons Glass ---- */
/* ---- Dropdown / Select Glass ---- */
/* ---- Badge / Tag Glass ---- */
/* ---- Story List Items ---- */
/* ---- List / Card General ---- */
/* ---- Scrollbar Light ---- */
/* ---- Cup / Match View Glass ---- */
/* ---- Profile View Glass ---- */
/* ---- Splash Screen Light ---- */
/* ---- Reaction Bar Glass ---- */
/* ---- Story BG Picker in Light Theme ---- */
/* ---- RSVP Light ---- */
/* ---- General hardcoded white text overrides ---- */

/* ============================================
   Light Theme - Readability And Contrast Pass
   ============================================ */
:root[data-theme="light"] {
    --text-secondary: #465c7e;
    --text-muted: #5f7395;
    --border-subtle: rgba(27, 45, 78, 0.16);
    --border-light: rgba(27, 45, 78, 0.24);
}

:root[data-theme="light"] .header-title,
:root[data-theme="light"] .view-top-bar h2,
:root[data-theme="light"] .section-title {
    color: #1f2d46;
    font-weight: 750;
}

:root[data-theme="light"] .header-subtitle,
:root[data-theme="light"] .empty-state,
:root[data-theme="light"] .empty-text,
:root[data-theme="light"] .home-footer {
    color: #5b7091;
}

:root[data-theme="light"] .empty-icon {
    opacity: 0.72;
}

:root[data-theme="light"] .table-header {
    background: rgba(39, 64, 105, 0.06);
    color: #5a7091;
    font-weight: 700;
}

:root[data-theme="light"] .tab-btn {
    color: #62789b;
    font-weight: 600;
}

:root[data-theme="light"] .tab-btn.active {
    color: #d97706;
}

:root[data-theme="light"] .view-top-bar {
    background: rgba(247, 250, 255, 0.94);
    border-bottom-color: rgba(27, 45, 78, 0.16);
    backdrop-filter: blur(12px);
}

:root[data-theme="light"] .view-top-bar .back-btn {
    background: rgba(39, 64, 105, 0.1);
    border: 1px solid rgba(39, 64, 105, 0.16);
    color: #31496d;
}

:root[data-theme="light"] .view-top-bar .back-btn:active {
    background: rgba(39, 64, 105, 0.18);
}

:root[data-theme="light"] .agenda-tab {
    background: #edf3fd;
    border-color: rgba(39, 64, 105, 0.2);
    color: #405579;
    font-weight: 650;
}

:root[data-theme="light"] .agenda-tab.active {
    background: linear-gradient(135deg, #059669, #10b981);
    border-color: rgba(5, 150, 105, 0.36);
    color: #fff;
}

:root[data-theme="light"] .agenda-input,
:root[data-theme="light"] .quote-comment-input {
    background: #fff;
    border-color: rgba(39, 64, 105, 0.2);
    color: #1f2d46;
    font-weight: 500;
}

:root[data-theme="light"] .agenda-input::placeholder,
:root[data-theme="light"] .quote-comment-input::placeholder {
    color: #7a8cab;
}

:root[data-theme="light"] .agenda-item,
:root[data-theme="light"] .quotes-user-group,
:root[data-theme="light"] .pp-card,
:root[data-theme="light"] .pp-card.open,
:root[data-theme="light"] .cup-history-result,
:root[data-theme="light"] .cup-po-item,
:root[data-theme="light"] .cup-participant-item,
:root[data-theme="light"] .cup-member-item {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(39, 64, 105, 0.16);
    box-shadow: 0 8px 18px rgba(23, 41, 73, 0.06);
}

:root[data-theme="light"] .profile-detail-btn {
    background: rgba(39, 64, 105, 0.06);
    border-color: rgba(39, 64, 105, 0.14);
    color: #223656;
}

:root[data-theme="light"] .profile-modal-shot-btn {
    background: rgba(39, 64, 105, 0.06);
    border-color: rgba(39, 64, 105, 0.14);
    color: #223656;
}

:root[data-theme="light"] .pp-shot-btn {
    background: rgba(39, 64, 105, 0.06);
    border-color: rgba(39, 64, 105, 0.14);
    color: #223656;
}

:root[data-theme="light"] .agenda-item.done {
    opacity: 0.72;
}

:root[data-theme="light"] .agenda-item-title,
:root[data-theme="light"] .quotes-user-name,
:root[data-theme="light"] .quote-text,
:root[data-theme="light"] .pp-name,
:root[data-theme="light"] .status-my-name,
:root[data-theme="light"] .status-user-name {
    color: #1f2d46;
}

:root[data-theme="light"] .quote-text {
    font-weight: 600;
}

:root[data-theme="light"] .quote-reaction-btn {
    background: rgba(39, 64, 105, 0.06);
    border-color: rgba(39, 64, 105, 0.12);
    color: #223656;
}

:root[data-theme="light"] .quote-reaction-btn.active {
    background: rgba(236, 72, 153, 0.12);
    border-color: rgba(236, 72, 153, 0.22);
}

:root[data-theme="light"] .agenda-item-desc,
:root[data-theme="light"] .agenda-item-author,
:root[data-theme="light"] .agenda-empty,
:root[data-theme="light"] .quote-meta,
:root[data-theme="light"] .quote-comment-toggle,
:root[data-theme="light"] .quotes-user-count,
:root[data-theme="light"] .quotes-user-arrow,
:root[data-theme="light"] .pp-subtitle,
:root[data-theme="light"] .pp-stat-label,
:root[data-theme="light"] .pp-winrate,
:root[data-theme="light"] .pp-arrow,
:root[data-theme="light"] .status-my-hint,
:root[data-theme="light"] .status-user-time,
:root[data-theme="light"] .stories-empty,
:root[data-theme="light"] .chat-system-bubble,
:root[data-theme="light"] .chat-forwarded-label,
:root[data-theme="light"] .cup-setup-subtitle,
:root[data-theme="light"] .cup-history-date,
:root[data-theme="light"] .cup-history-label,
:root[data-theme="light"] .cup-history-stat-label,
:root[data-theme="light"] .cup-score-vs-label,
:root[data-theme="light"] .cup-po-vs {
    color: #5a7092;
}

:root[data-theme="light"] .quotes-user-count {
    background: rgba(39, 64, 105, 0.1);
}

:root[data-theme="light"] .quote-item,
:root[data-theme="light"] .quotes-user-items,
:root[data-theme="light"] .quote-comments-section,
:root[data-theme="light"] .qc-comment,
:root[data-theme="light"] .agenda-comment-section,
:root[data-theme="light"] .quotes-add-form,

:root[data-theme="light"] .agenda-composer-kicker,
:root[data-theme="light"] .agenda-item-date,
:root[data-theme="light"] .agenda-item-time,
:root[data-theme="light"] .agenda-inline-link,
:root[data-theme="light"] .agenda-comment-toggle {
    color: #047857;
}

:root[data-theme="light"] .agenda-item-category {
    background: #edf3fd;
    color: #405579;
}

:root[data-theme="light"] .agenda-status-pill.live {
    background: rgba(16, 185, 129, 0.12);
    border-color: rgba(5, 150, 105, 0.18);
    color: #047857;
}

:root[data-theme="light"] .agenda-status-pill.overdue {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.16);
    color: #b91c1c;
}

:root[data-theme="light"] .agenda-quick-chip {
    background: #f8fbff;
    border-color: rgba(39, 64, 105, 0.14);
    color: #4a6185;
}

:root[data-theme="light"] .agenda-quick-chip:hover {
    background: #edf3fd;
    color: #223656;
}

:root[data-theme="light"] .agenda-call-chip,
:root[data-theme="light"] .agenda-comment-toggle {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(5, 150, 105, 0.16);
}

:root[data-theme="light"] .agenda-editor-modal-card {
    background:
        radial-gradient(circle at top right, rgba(16, 185, 129, 0.1), transparent 38%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(246, 250, 255, 0.98));
    border-color: rgba(39, 64, 105, 0.12);
    box-shadow: 0 20px 46px rgba(23, 41, 73, 0.12);
}

:root[data-theme="light"] .agenda-item-actions button,
:root[data-theme="light"] .quote-actions button {
    background: #edf3fd;
    border: 1px solid rgba(39, 64, 105, 0.16);
    color: #4d6287;
}

:root[data-theme="light"] .agenda-item-actions button:hover,
:root[data-theme="light"] .quote-actions button:hover {
    background: #dde8f9;
    color: #223656;
}

:root[data-theme="light"] .quote-dm-btn {
    background: rgba(217, 119, 6, 0.14);
    border: 1px solid rgba(180, 83, 9, 0.22);
    color: #b45309;
}

:root[data-theme="light"] .chat-doc-card {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(39, 64, 105, 0.2);
}

@media (hover: none) and (pointer: coarse), (max-width: 768px) {
    .friendly-h2h-card,
    .friendly-card {
        box-shadow: 0 6px 14px rgba(15, 23, 42, 0.06);
    }
}

:root[data-theme="light"] .chat-doc-name {
    color: #1f2d46;
}

:root[data-theme="light"] .chat-doc-sub {
    color: #5a7092;
}

:root[data-theme="light"] .chat-doc-action {
    background: rgba(39, 64, 105, 0.08);
    border-color: rgba(39, 64, 105, 0.2);
    color: #31496d;
}

:root[data-theme="light"] .status-my,
:root[data-theme="light"] .status-user-item {
    border-bottom: 1px solid rgba(39, 64, 105, 0.08);
}

:root[data-theme="light"] .status-my:active,
:root[data-theme="light"] .status-user-item:active {
    background: rgba(39, 64, 105, 0.06);
}

:root[data-theme="light"] .status-my-avatar {
    border-color: rgba(39, 64, 105, 0.28);
}

:root[data-theme="light"] .status-privacy-inline {
    border-color: var(--theme-inline-border);
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
}

:root[data-theme="light"] .status-privacy-inline-icon {
    background: rgba(39, 64, 105, 0.08);
}

:root[data-theme="light"] .status-privacy-inline-summary,
:root[data-theme="light"] .status-privacy-inline-arrow {
    color: #5b6b84;
}

:root[data-theme="light"] .status-user-avatar.viewed {
    background: conic-gradient(rgba(60, 84, 122, 0.35) 0deg, rgba(60, 84, 122, 0.35) 360deg);
}

:root[data-theme="light"] .status-user-avatar.viewed.multi-story {
    background: conic-gradient(rgba(60, 84, 122, 0.35) 0deg, rgba(60, 84, 122, 0.35) 170deg,
            transparent 170deg, transparent 190deg,
            rgba(60, 84, 122, 0.35) 190deg, rgba(60, 84, 122, 0.35) 360deg);
}

:root[data-theme="light"] .pp-stat {
    background: #edf3fd;
    border: 1px solid rgba(39, 64, 105, 0.14);
}

:root[data-theme="light"] .pp-stat-val {
    color: #243754;
    font-weight: 800;
}

:root[data-theme="light"] .profile-extra-label {
    color: #4b6185;
    font-weight: 700;
}

:root[data-theme="light"] .profile-extra-value {
    color: #1f2d46;
    font-weight: 800;
}

:root[data-theme="light"] .pp-title-badge {
    background: rgba(217, 119, 6, 0.14);
    border: 1px solid rgba(180, 83, 9, 0.22);
    color: #b45309;
}

:root[data-theme="light"] .champion-season-hero {
    box-shadow: 0 20px 34px rgba(39, 64, 105, 0.14);
}

:root[data-theme="light"] .champion-season-meta-badge,
:root[data-theme="light"] .champion-season-chip {
    background: rgba(39, 64, 105, 0.06);
    border-color: rgba(39, 64, 105, 0.12);
    color: #42597e;
}

:root[data-theme="light"] .champion-season-empty {
    background: rgba(39, 64, 105, 0.04);
    border-color: rgba(39, 64, 105, 0.18);
    color: #5c7295;
}

:root[data-theme="light"] .chat-tab,
:root[data-theme="light"] .chat-tab-back {
    color: #546a8e;
    font-weight: 650;
}

:root[data-theme="light"] .chat-tab.active {
    color: #d97706;
}

:root[data-theme="light"] .chat-system-bubble {
    background: #edf3fd;
    border: 1px solid rgba(39, 64, 105, 0.16);
}

:root[data-theme="light"] .history-sort-actions {
    background: #edf3fd;
    border-color: rgba(39, 64, 105, 0.2);
}

:root[data-theme="light"] .history-sort-btn {
    color: #4f6488;
    font-weight: 700;
}

:root[data-theme="light"] .history-icon-btn {
    background: rgba(39, 64, 105, 0.1);
    border-color: rgba(39, 64, 105, 0.2);
    color: #2e466c;
}

:root[data-theme="light"] .history-icon-btn.danger {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.28);
    color: #dc2626;
}

:root[data-theme="light"] .qc-time,
:root[data-theme="light"] .qc-text,
:root[data-theme="light"] .qc-action-btn,
:root[data-theme="light"] .chat-location-label,

:root[data-theme="light"] .qc-name {
    color: #b45309;
}

:root[data-theme="light"] .qc-action-btn:active {
    background: rgba(39, 64, 105, 0.12);
}

:root[data-theme="light"] .announce-card {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(217, 119, 6, 0.24);
    box-shadow: 0 10px 24px rgba(23, 41, 73, 0.08);
}

:root[data-theme="light"] .announce-header {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.12), rgba(255, 255, 255, 0.96));
    border-bottom-color: rgba(217, 119, 6, 0.18);
}

:root[data-theme="light"] .announce-back-btn {
    background: rgba(255, 255, 255, 0.82);
    border-color: rgba(39, 64, 105, 0.14);
    color: #1f2d46;
}

:root[data-theme="light"] .announce-card-title {
    color: #1f2d46;
}

:root[data-theme="light"] .announce-card-body,
:root[data-theme="light"] .announce-comment-text {
    color: #4f6488;
}

:root[data-theme="light"] .announce-card-time,
:root[data-theme="light"] .announce-comment-time,
:root[data-theme="light"] .announce-delete-btn {
    color: #5f7395;
}

:root[data-theme="light"] .announce-card-actions,
:root[data-theme="light"] .announce-comments,
:root[data-theme="light"] .announce-comment-input-row {
    border-top-color: rgba(39, 64, 105, 0.12);
}

:root[data-theme="light"] .announce-comment-input {
    background: #fff;
    border-color: rgba(39, 64, 105, 0.2);
    color: #1f2d46;
}

:root[data-theme="light"] .modal-overlay {
    background: rgba(31, 45, 70, 0.4);
}

:root[data-theme="light"] .announce-create-modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
    border-color: rgba(39, 64, 105, 0.2);
    box-shadow: 0 18px 44px rgba(23, 41, 73, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

:root[data-theme="light"] .announce-create-title {
    color: #1f2d46;
}

:root[data-theme="light"] .announce-create-subtitle {
    color: #5d7193;
}

:root[data-theme="light"] .announce-create-input,
:root[data-theme="light"] .announce-create-textarea {
    background: #fff;
    border-color: rgba(39, 64, 105, 0.22);
    color: #1f2d46;
}

:root[data-theme="light"] .announce-create-input::placeholder,
:root[data-theme="light"] .announce-create-textarea::placeholder {
    color: #7a8dad;
}

:root[data-theme="light"] .announce-create-input:focus,
:root[data-theme="light"] .announce-create-textarea:focus {
    border-color: rgba(217, 119, 6, 0.45);
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.15);
}

:root[data-theme="light"] .announce-create-cancel {
    border-color: rgba(39, 64, 105, 0.2);
    background: #eef3fb;
    color: #465f86;
}

:root[data-theme="light"] .announce-create-submit {
    box-shadow: 0 8px 18px rgba(217, 119, 6, 0.26);
}

:root[data-theme="light"] .disappear-modal-content {
    background: linear-gradient(180deg, #ffffff 0%, #f4f8ff 100%);
    border-color: rgba(39, 64, 105, 0.22);
    box-shadow: 0 18px 44px rgba(23, 41, 73, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:root[data-theme="light"] .disappear-title {
    color: #1f2d46;
}

:root[data-theme="light"] .disappear-subtitle {
    color: #5f7395;
}

:root[data-theme="light"] .disappear-opt {
    background: #f7faff;
    border-color: rgba(39, 64, 105, 0.16);
    color: #34527b;
}

:root[data-theme="light"] .disappear-opt.active {
    border-color: rgba(217, 119, 6, 0.42);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(248, 191, 52, 0.18));
    color: #a45a05;
    box-shadow: 0 8px 20px rgba(217, 119, 6, 0.2);
}

:root[data-theme="light"] .chat-search-bar {
    background: rgba(247, 250, 255, 0.95);
    border-top-color: rgba(39, 64, 105, 0.14);
}

:root[data-theme="light"] .chat-search-input {
    background: #ffffff;
    border-color: rgba(39, 64, 105, 0.22);
    color: #1f2d46;
    font-weight: 600;
}

:root[data-theme="light"] .chat-search-input::placeholder {
    color: #7a8fb1;
}

:root[data-theme="light"] .chat-search-count {
    color: #627ba2;
    font-weight: 700;
}

:root[data-theme="light"] .chat-search-nav-btn {
    color: #4c678f;
}

:root[data-theme="light"] .chat-search-nav-btn:hover {
    background: rgba(39, 64, 105, 0.1);
    color: #d97706;
}

:root[data-theme="light"] .chat-search-close-btn {
    color: #6981a6;
}

:root[data-theme="light"] .chat-search-close-btn:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

:root[data-theme="light"] .sc-overlay {
    background: rgba(23, 37, 63, 0.32);
}

:root[data-theme="light"] .sc-modal {
    background: linear-gradient(180deg, #f9fbff 0%, #f1f6ff 100%);
    border: 1px solid rgba(39, 64, 105, 0.18);
    box-shadow: 0 -10px 30px rgba(26, 43, 74, 0.2);
}

:root[data-theme="light"] .sc-header {
    border-bottom: 1px solid rgba(39, 64, 105, 0.14);
}

:root[data-theme="light"] .sc-title {
    color: #1f2d46;
}

:root[data-theme="light"] .sc-close {
    background: rgba(39, 64, 105, 0.1);
    color: #466086;
    border: 1px solid rgba(39, 64, 105, 0.16);
}

:root[data-theme="light"] .sc-close:active {
    background: rgba(39, 64, 105, 0.2);
}

:root[data-theme="light"] .sc-tabs {
    background: rgba(255, 255, 255, 0.76);
    border-top: 1px solid rgba(39, 64, 105, 0.08);
    border-bottom: 1px solid rgba(39, 64, 105, 0.1);
}

:root[data-theme="light"] .sc-tab {
    color: #5a7092;
}

:root[data-theme="light"] .sc-tab.active {
    background: rgba(39, 64, 105, 0.12);
    color: #213657;
}

:root[data-theme="light"] .sc-privacy-row {
    border-color: var(--theme-inline-border);
    background: linear-gradient(135deg, var(--theme-inline-surface-strong), var(--accent-soft));
}

:root[data-theme="light"] .sc-privacy-title {
    color: #1f2d46;
}

:root[data-theme="light"] .sc-privacy-summary {
    color: #5b6b84;
}

:root[data-theme="light"] .sc-privacy-btn {
    background: rgba(39, 64, 105, 0.1);
    color: #2b4267;
}

:root[data-theme="light"] .sc-privacy-btn:active {
    background: rgba(39, 64, 105, 0.16);
}

:root[data-theme="light"] .sc-upload-progress-bar {
    background: rgba(39, 64, 105, 0.12);
}

:root[data-theme="light"] .sc-upload-progress-text {
    color: #607494;
}

:root[data-theme="light"] .sc-textarea {
    background: #fff;
    border: 1px solid rgba(39, 64, 105, 0.18);
    color: #1f2d46;
}

:root[data-theme="light"] .sc-textarea:focus {
    background: #fff;
    border-color: rgba(16, 185, 129, 0.44);
}

:root[data-theme="light"] .sc-textarea::placeholder {
    color: #8798b6;
}

:root[data-theme="light"] .sc-char-count {
    color: #90a0bc;
}

:root[data-theme="light"] .sc-drop-area {
    border: 2px dashed rgba(39, 64, 105, 0.22);
    background: rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .sc-drop-area:active {
    background: #eef4ff;
}

:root[data-theme="light"] .sc-drop-text {
    color: #435a7e;
}

:root[data-theme="light"] .home-notif-badge {
    border-color: #f2f5fb;
}

:root[data-theme="light"] .notif-center-overlay {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 217, 119, 6), 0.08), transparent 30%),
        rgba(31, 41, 55, 0.24);
}

:root[data-theme="light"] .notif-center-panel {
    box-shadow: 0 20px 38px rgba(33, 55, 94, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .notif-center-head {
    border-bottom-color: var(--accent-border-soft);
}

:root[data-theme="light"] .notif-center-mark-all,
:root[data-theme="light"] .notif-center-delete-read,
:root[data-theme="light"] .notif-center-close {
    color: var(--text-secondary);
}

:root[data-theme="light"] .notif-center-delete-read {
    color: #b91c1c;
}

:root[data-theme="light"] .notif-center-item {
    background: linear-gradient(180deg, rgba(var(--accent-primary-rgb, 217, 119, 6), 0.05), rgba(255, 255, 255, 0.7));
}

:root[data-theme="light"] .notif-center-item.unread {
    background: linear-gradient(180deg, rgba(var(--accent-primary-rgb, 217, 119, 6), 0.15), rgba(var(--accent-primary-rgb, 217, 119, 6), 0.08));
}

:root[data-theme="light"] .notif-center-item-icon {
    border-color: rgba(var(--accent-primary-rgb, 217, 119, 6), 0.12);
}

:root[data-theme="light"] .notif-center-item-title {
    color: var(--text-primary);
}

:root[data-theme="light"] .notif-center-item-body {
    color: var(--text-secondary);
}

:root[data-theme="light"] .notif-center-item-time {
    color: var(--text-muted);
}

:root[data-theme="light"] .notif-center-item-delete {
    color: #b91c1c;
}

:root[data-theme="light"] .heads-up-notif {
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .heads-up-notif-title {
    color: var(--text-primary);
}

:root[data-theme="light"] .heads-up-notif-text {
    color: var(--text-secondary);
}

:root[data-theme="light"] .heads-up-notif-avatar {
    box-shadow: inset 0 0 0 1px var(--accent-border-soft);
}

:root[data-theme="light"] .heads-up-notif-avatar-img {
    background: var(--bg-secondary);
}

:root[data-theme="light"] .heads-up-notif-close {
    color: var(--text-primary);
}

:root[data-theme="light"] .heads-up-notif-close:hover {
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 217, 119, 6), 0.18), var(--theme-inline-surface-strong));
}

:root[data-theme="light"] .sc-drop-hint {
    color: #7d90af;
}

:root[data-theme="light"] .sc-caption-input {
    background: #fff;
    border: 1px solid rgba(39, 64, 105, 0.18);
    color: #1f2d46;
}

:root[data-theme="light"] .sc-caption-input::placeholder {
    color: #8798b6;
}

:root[data-theme="light"] .sc-caption-count {
    color: #90a0bc;
}

:root[data-theme="light"] .sc-bg-swatch.selected {
    border-color: #fff;
    box-shadow: 0 0 0 2px #d97706, 0 2px 8px rgba(39, 64, 105, 0.24);
}

:root[data-theme="light"] .sc-vn-hint {
    color: #7a8dad;
}

:root[data-theme="light"] .sc-vn-pick-btn {
    background: #edf3fd;
    color: #2b4267;
    border-color: rgba(39, 64, 105, 0.16);
}

:root[data-theme="light"] .sc-vn-pick-btn:active {
    background: #e4ecf9;
}

:root[data-theme="light"] .sc-vn-cancel {
    background: #edf3fd;
    color: #4a6083;
    border: 1px solid rgba(39, 64, 105, 0.16);
}

:root[data-theme="light"] .sc-vn-cancel:active {
    background: #e4ecf9;
}

:root[data-theme="light"] .sc-vn-player {
    background: rgba(39, 64, 105, 0.08);
}

:root[data-theme="light"] .sc-vn-duration,
:root[data-theme="light"] .sc-vn-rerecord,
:root[data-theme="light"] .sc-vn-pick-link {
    color: #5f7395;
}

:root[data-theme="light"] .sc-vn-rerecord:active,
:root[data-theme="light"] .sc-vn-pick-link:active {
    color: #2b4267;
}

:root[data-theme="light"] .multi-select-toolbar {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.18), rgba(16, 185, 129, 0.15));
    border: 1px solid rgba(22, 163, 74, 0.34);
    box-shadow: 0 8px 18px rgba(23, 41, 73, 0.08);
}

:root[data-theme="light"] .multi-select-toolbar .ms-info {
    color: #166534;
    font-weight: 800;
}

:root[data-theme="light"] .multi-select-toolbar .ms-close {
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(39, 64, 105, 0.2);
    color: #355277;
}

:root[data-theme="light"] .multi-select-toolbar .ms-close:active {
    background: #e9effa;
}

:root[data-theme="light"] .multi-select-toolbar .ms-action-btn {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    border: 1px solid rgba(180, 83, 9, 0.45);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(234, 88, 12, 0.2);
}

:root[data-theme="light"] .multi-select-toolbar .ms-action-btn:active {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

:root[data-theme="light"] .multi-select-toolbar .ms-action-btn.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 1px solid rgba(185, 28, 28, 0.6);
    color: #fff;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.22);
}

:root[data-theme="light"] .multi-select-toolbar .ms-action-btn.danger:active {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
}

:root[data-theme="light"] .media-caption-modal {
    background: rgba(15, 23, 42, 0.42);
}

:root[data-theme="light"] .media-caption-sheet {
    background: #f8fafc;
    border: 1px solid rgba(39, 64, 105, 0.16);
    border-bottom: none;
    box-shadow: 0 -12px 34px rgba(30, 41, 59, 0.18);
}

:root[data-theme="light"] .media-caption-close {
    background: #eef3fb;
    border-color: rgba(39, 64, 105, 0.18);
    color: #4f6485;
}

:root[data-theme="light"] .media-caption-preview {
    background: #eef3fb;
    border-color: rgba(39, 64, 105, 0.16);
}

:root[data-theme="light"] .media-caption-count {
    background: rgba(30, 41, 59, 0.78);
}

:root[data-theme="light"] .media-caption-item {
    background: #ffffff;
    border-color: rgba(39, 64, 105, 0.2);
}

:root[data-theme="light"] .media-caption-item.active {
    outline-color: #f59e0b;
}

:root[data-theme="light"] .media-caption-item-badge {
    background: rgba(30, 41, 59, 0.8);
}

:root[data-theme="light"] .media-caption-item-remove {
    background: rgba(220, 38, 38, 0.94);
}

:root[data-theme="light"] .media-caption-add-tile {
    background: #ffffff;
    border-color: rgba(39, 64, 105, 0.28);
    color: #3f5678;
}

:root[data-theme="light"] .media-caption-input {
    background: #fff;
    border-color: rgba(39, 64, 105, 0.2);
    color: #1f2d46;
}

:root[data-theme="light"] .media-caption-input::placeholder {
    color: #8395b3;
}

:root[data-theme="light"] .chat-mention-picker {
    border-color: rgba(39, 64, 105, 0.14);
    background: linear-gradient(180deg, rgba(252, 253, 255, 0.98), rgba(242, 247, 255, 0.98));
    box-shadow: 0 18px 36px rgba(30, 41, 59, 0.18);
}

:root[data-theme="light"] .chat-mention-item {
    background: rgba(255, 255, 255, 0.88);
}

:root[data-theme="light"] .chat-mention-item:hover,
:root[data-theme="light"] .chat-mention-item.active {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.14);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
}

:root[data-theme="light"] .chat-mention-name {
    color: #1f2d46;
}

:root[data-theme="light"] .chat-mention-meta {
    color: #627a9e;
}

:root[data-theme="light"] .chat-mention-chip {
    background: rgba(255, 255, 255, 0.94);
    border-color: rgba(39, 64, 105, 0.14);
}

:root[data-theme="light"] .chat-mention-chip.ai {
    background: rgba(225, 238, 255, 0.96);
    border-color: rgba(79, 139, 255, 0.22);
}

:root[data-theme="light"] .chat-mention-chip.everyone {
    background: rgba(255, 245, 209, 0.96);
    border-color: rgba(245, 158, 11, 0.22);
}

:root[data-theme="light"] .chat-mention-chip-remove {
    background: rgba(39, 64, 105, 0.08);
    color: #516888;
}

:root[data-theme="light"] .chat-mention-chip-label {
    color: #1f2d46;
}

:root[data-theme="light"] .chat-mention-chip-meta {
    color: #627a9e;
}

:root[data-theme="light"] .media-caption-btn.cancel {
    background: #eef3fb;
    border-color: rgba(39, 64, 105, 0.18);
    color: #516888;
}
/* ==========================================
   Platform Selector Tabs (Mobile/Console/PC)
   ========================================== */
.platform-selector {
    display: flex;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-light);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.platform-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--theme-chip-radius);
    border: 1px solid var(--theme-chip-border);
    background: var(--theme-chip-bg);
    color: var(--text-muted);
    font-family: var(--font-primary);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    flex: 1;
    justify-content: center;
    box-shadow: var(--theme-chip-shadow);
    backdrop-filter: blur(min(calc(var(--theme-surface-blur) * 0.28), var(--theme-chip-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(calc(var(--theme-surface-blur) * 0.28), var(--theme-chip-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
}

.platform-tab:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.platform-tab.active {
    background: var(--theme-chip-active-bg);
    color: #fff;
    border-color: transparent;
    box-shadow: var(--theme-chip-active-shadow);
}

.platform-icon {
    font-size: 14px;
    line-height: 1;
}

.platform-label {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

:root[data-theme="light"] .platform-selector {
    background: linear-gradient(180deg, #eef3fb 0%, #e8eef8 100%);
    border-bottom-color: rgba(39, 64, 105, 0.14);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

:root[data-theme="light"] .platform-tab {
    background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
    color: #516689;
    border-color: rgba(39, 64, 105, 0.2);
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

:root[data-theme="light"] .platform-tab:hover {
    background: linear-gradient(180deg, #ffffff 0%, #eef4ff 100%);
    color: #2b3f60;
    border-color: rgba(39, 64, 105, 0.26);
}

:root[data-theme="light"] .platform-tab.active {
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--theme-active-gradient-end) 100%);
    color: #ffffff;
    border-color: var(--accent-border-soft);
    box-shadow: 0 6px 16px var(--theme-active-shadow), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

:root[data-theme="light"] .platform-tab.active .platform-icon,
:root[data-theme="light"] .platform-tab.active .platform-label {
    color: #ffffff;
}

@media (max-width: 380px) {
    .theme-palette-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .platform-tab {
        padding: 6px 10px;
        gap: 4px;
    }
    .platform-label {
        font-size: 11px;
    }
}

/* ============================================
   THEME ALIGNMENT: AGENDA + ANNOUNCEMENT
   ============================================ */
.agenda-top-action,
.announce-create-btn,
.agenda-editor-submit,
.announce-create-submit {
    background: linear-gradient(135deg, var(--accent-primary), var(--theme-active-gradient-end));
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 12px 24px var(--theme-active-shadow);
}

.agenda-top-action {
    border-radius: var(--theme-chip-radius);
    min-width: 38px;
}

.announce-header {
    background:
        linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.1), transparent 72%),
        var(--theme-topbar-fill);
    border-bottom: 1px solid var(--theme-topbar-border);
    backdrop-filter: blur(min(var(--theme-topbar-blur), var(--theme-topbar-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(var(--theme-topbar-blur), var(--theme-topbar-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
}

.announce-back-btn {
    border: 1px solid var(--theme-inline-border);
    background: var(--theme-back-btn-bg);
    border-radius: var(--theme-back-btn-radius);
    color: var(--text-primary);
    backdrop-filter: blur(min(calc(var(--theme-surface-blur) * 0.35), var(--theme-chip-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
    -webkit-backdrop-filter: blur(min(calc(var(--theme-surface-blur) * 0.35), var(--theme-chip-blur-cap))) saturate(min(var(--theme-surface-saturation), var(--theme-surface-saturation-cap)));
}

.announce-create-btn {
    border-radius: var(--theme-chip-radius);
    box-shadow: var(--theme-chip-active-shadow);
}

.announce-create-btn:active,
.agenda-editor-submit:active,
.announce-create-submit:active {
    box-shadow: 0 8px 18px var(--theme-active-shadow);
}

.agenda-editor-modal-card,
.announce-create-modal-content {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.16), transparent 38%),
        radial-gradient(circle at bottom left, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.08), transparent 34%),
        var(--theme-surface-fill);
    border: 1px solid var(--theme-surface-border);
    border-radius: calc(var(--theme-surface-radius) + 2px);
    box-shadow: var(--theme-surface-shadow), 0 0 0 1px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.05);
    backdrop-filter: blur(var(--theme-surface-blur)) saturate(var(--theme-surface-saturation));
    -webkit-backdrop-filter: blur(var(--theme-surface-blur)) saturate(var(--theme-surface-saturation));
}

.announce-create-title,
.agenda-editor-header h3,
.disappear-title,

.announce-create-subtitle,
.announce-create-hint,
.agenda-editor-label,
.disappear-subtitle,

.agenda-inline-link {
    color: var(--theme-surface-accent);
}

.agenda-input,
.announce-create-input,
.announce-create-textarea,
.disappear-opt {
    background: var(--theme-surface-subtle-bg);
    border: 1px solid var(--theme-surface-subtle-border);
    color: var(--theme-surface-text-primary);
    border-radius: 14px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.agenda-input::placeholder,
.announce-create-input::placeholder,
.announce-create-textarea::placeholder {
    color: var(--theme-surface-text-muted);
}

.agenda-input:focus,
.announce-create-input:focus,
.announce-create-textarea:focus {
    border-color: var(--theme-inline-border-strong);
    box-shadow: 0 0 0 3px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
}

.announce-create-cancel,
.agenda-editor-cancel {
    border: 1px solid var(--theme-surface-subtle-border);
    background: linear-gradient(135deg, var(--theme-surface-subtle-bg-alt), rgba(255, 255, 255, 0.02));
    color: var(--theme-surface-text-secondary);
    box-shadow: none;
}

.announce-create-cancel:hover,
.agenda-editor-cancel:hover {
    border-color: var(--theme-inline-border-strong);
    color: var(--theme-surface-text-primary);
}

:root[data-theme="light"] .agenda-editor-modal-card,
:root[data-theme="light"] .announce-create-modal-content {
    box-shadow: var(--theme-surface-shadow), 0 0 0 1px rgba(var(--accent-primary-rgb, 217, 119, 6), 0.05);
}

/* ============================================
   THEME CONTRAST SAFETY: HISTORY + SUBMODALS
   ============================================ */
.modal-content,
.agenda-editor-modal-card,
.announce-create-modal-content,
.disappear-modal-content {
    color: var(--theme-surface-text-primary);
}

.history-sort-actions {
    background: linear-gradient(135deg, var(--theme-inline-surface), rgba(255, 255, 255, 0.02));
    border-color: var(--theme-inline-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.history-icon-btn {
    border-color: var(--theme-inline-border);
    background: linear-gradient(135deg, var(--theme-inline-surface), rgba(255, 255, 255, 0.02));
    color: var(--theme-surface-text-primary);
}

.history-icon-btn.danger {
    border-color: rgba(239, 68, 68, 0.3);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.18), rgba(239, 68, 68, 0.08));
    color: #ef4444;
}

.cup-history-name {
    color: var(--theme-surface-accent);
}

.cup-history-date,
.cup-history-label,
.cup-history-stat-label {
    color: var(--theme-surface-text-secondary);
}

.cup-history-value {
    color: var(--theme-surface-text-primary);
}

.cup-history-result {
    background: var(--theme-surface-subtle-bg);
    border: 1px solid var(--theme-surface-subtle-border);
}

.cup-history-result.champion {
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.08)),
        var(--theme-surface-subtle-bg-alt);
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
}

.season-unfinished-banner {
    margin: 8px 0 12px;
    padding: 10px 12px;
    border-radius: 12px;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.08)),
        var(--theme-surface-subtle-bg-alt);
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.28);
}

.season-unfinished-title,
.season-unfinished-banner > div:first-child {
    font-size: 12px;
    color: var(--theme-surface-accent) !important;
    font-weight: 700;
    margin-bottom: 6px;
}

.season-unfinished-progress {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.season-unfinished-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 999px;
    transition: width 0.3s ease;
}

.season-unfinished-hint {
    font-size: 11px;
    color: var(--theme-surface-text-secondary);
    margin-top: 4px;
}

/* ============================================
   THEME CONTRAST SAFETY: GLOBAL
   ============================================ */
:root[data-theme="light"] {
    color-scheme: light;
    --theme-readable-shadow: 0 1px 0 rgba(255, 255, 255, 0.42);
    --theme-surface-text-primary: var(--text-primary);
    --theme-surface-text-secondary: var(--text-secondary);
    --theme-surface-text-muted: var(--text-muted);
}

:root[data-theme="dark"],
:root:not([data-theme="light"]) {
    --theme-readable-shadow: 0 1px 0 rgba(0, 0, 0, 0.28);
}

:root[data-theme] :is(
    .team-name,
    .match-team-name,
    .match-score-num,
    .section-title,
    .info-title,
    .info-stat-value,
    .winner-title,
    .winner-name,
    .agenda-item-title,
    .quotes-user-name,
    .quote-text,
    .status-user-name,
    .status-my-name,
    .pp-name,
    .pp-item-name,
    .profile-extra-value,
    .season-name,
    .season-result-value,
    .cup-history-title,
    .cup-history-value,
    .announce-card-title,
    .announce-create-title,
    .poll-setting-title,
    .poll-question,
    .poll-option-text,
    .home-card-title,
    .notif-center-item-title,
    .heads-up-notif-title,
    .champion-season-name,
    .champion-season-section-title,
    .cup-member-name,
    .cup-po-name,
    .view-top-bar h2,
    .profile-section-title,
    .badges-section-title,
    .tentang-section-title
) {
    color: var(--theme-surface-text-primary) !important;
    text-shadow: var(--theme-readable-shadow);
}

:root[data-theme] :is(
    .table-header,
    .stat-cell:not(.pts-cell):not(.dif-positive):not(.dif-negative),
    .match-date,
    .match-vs,
    .match-score-sep,
    .info-season,
    .info-stat-label,
    .info-text,
    .player-stat-label,
    .header-subtitle,
    .empty-state,
    .empty-text,
    .home-card-desc,
    .agenda-item-desc,
    .agenda-item-author,
    .agenda-empty,
    .agenda-editor-label,
    .agenda-toggle-desc,
    .quote-meta,
    .quote-comment-toggle,
    .quotes-user-count,
    .quotes-user-arrow,
    .status-my-hint,
    .status-user-time,
    .stories-empty,
    .chat-forwarded-label,
    .cup-setup-subtitle,
    .cup-hint,
    .cup-history-date,
    .cup-history-label,
    .cup-history-stat-label,
    .cup-score-vs-label,
    .profile-extra-label,
    .pp-subtitle,
    .pp-stat-label,
    .pp-item-count,
    .setting-label,
    .setting-hint,
    .badges-lb-preview,
    .badge-guide-desc,
    .announce-card-body,
    .announce-card-time,
    .announce-comment-time,
    .announce-delete-btn,
    .announce-create-subtitle,
    .announce-create-hint,
    .disappear-subtitle,
    .notif-center-item-body,
    .notif-center-item-time,
    .heads-up-notif-text,
    .poll-setting-desc,
    .poll-meta,
    .story-viewer-item-time,
    .story-viewers-empty,
    .season-date,
    .season-result-label,
    .season-stat-label,
    .season-unfinished-hint,
    .history-sort-label,
    .season-end-desc,
    .profile-season-open-hint,
    .status-section-label,
    .app-version-label,
    .poll-field-label
) {
    color: var(--theme-surface-text-secondary) !important;
}

:root[data-theme] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    textarea,
    select
) {
    color: var(--theme-surface-text-primary);
}

:root[data-theme] :is(
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]),
    textarea,
    select
)::placeholder {
    color: var(--theme-surface-text-muted) !important;
    opacity: 1;
}

:root[data-theme="light"] .table-row {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.12));
}

:root[data-theme="light"] .table-row:active {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.46), rgba(255, 255, 255, 0.22));
}

:root[data-theme="light"] :is(
    .glass-card,
    .match-card,
    .agenda-item,
    .quotes-user-group,
    .quote-item,
    .cup-history-card,
    .cup-history-result,
    .pp-card,
    .champion-season-empty,
    .poll-option,
    .poll-setting-card,
    .notif-center-item
) {
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34), var(--theme-surface-shadow);
}

/* ============================================
   THEME VISIBILITY + CONTRAST SAFETY: APP-WIDE
   ============================================ */
:root[data-theme="light"] {
    --theme-surface-text-primary: #0f1b31;
    --theme-surface-text-secondary: #415273;
    --theme-surface-text-muted: #617391;
}

:root[data-theme] .view-top-bar {
    background:
        linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.1), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.04)),
        var(--theme-topbar-fill);
}

:root[data-theme="light"] .view-top-bar {
    background:
        linear-gradient(180deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.08)),
        var(--theme-topbar-fill);
}

:root[data-theme] :is(
    .glass-card,
    .match-card,
    .cup-history-card,
    .agenda-item,
    .quotes-user-group,
    .quote-item,
    .pp-card,
    .notif-center-item,
    .poll-setting-card,
    .poll-option,
    .modal,
    .modal-content,
    .agenda-editor-modal-card,
    .announce-create-modal-content,
    .disappear-modal-content,
    .action-sheet,
    .poll-options-card,
    .status-user,
    .status-my,
    .story-viewers-panel,
    .story-viewer-caption,
    .champion-season-empty,
    .history-sort-actions
) {
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.1), transparent 34%),
        linear-gradient(150deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.06), transparent 46%, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.05)),
        var(--theme-surface-fill) !important;
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.16) !important;
}

:root[data-theme="light"] :is(
    .glass-card,
    .match-card,
    .cup-history-card,
    .agenda-item,
    .quotes-user-group,
    .quote-item,
    .pp-card,
    .notif-center-item,
    .poll-setting-card,
    .poll-option,
    .modal,
    .modal-content,
    .agenda-editor-modal-card,
    .announce-create-modal-content,
    .disappear-modal-content,
    .action-sheet,
    .poll-options-card,
    .status-user,
    .status-my,
    .story-viewers-panel,
    .story-viewer-caption,
    .champion-season-empty,
    .history-sort-actions
) {
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.2), transparent 36%),
        linear-gradient(152deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12), rgba(255, 255, 255, 0.12) 48%, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.11)),
        var(--theme-surface-fill) !important;
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.2) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.42), 0 18px 38px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.07), var(--theme-surface-shadow);
}

:root[data-theme] :is(
    .table-header,
    .table-row,
    .pp-stat,
    .pp-item,
    .agenda-comment-section,
    .agenda-item-actions button,
    .announce-card-actions,
    .announce-comments,
    .announce-comment,
    .announce-comment-input,
    .qc-comment,
    .quote-reaction-btn,
    .quote-comment-toggle,
    .story-viewers-panel-header,
    .poll-result-row,
    .poll-bar-track
) {
    background:
        linear-gradient(145deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.045), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.03)),
        var(--theme-surface-subtle-bg-alt) !important;
    border-color: var(--theme-surface-subtle-border) !important;
}

:root[data-theme="light"] :is(
    .table-header,
    .table-row,
    .pp-stat,
    .pp-item,
    .agenda-comment-section,
    .agenda-item-actions button,
    .announce-card-actions,
    .announce-comments,
    .announce-comment,
    .announce-comment-input,
    .qc-comment,
    .quote-reaction-btn,
    .quote-comment-toggle,
    .story-viewers-panel-header,
    .poll-result-row,
    .poll-bar-track
) {
    background:
        linear-gradient(145deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.09), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.06)),
        rgba(255, 255, 255, 0.34) !important;
}

:root[data-theme] :is(
    .modal-header h3,
    .modal-close,
    .msd-player-name,
    .msd-score-label,
    .msd-vs-badge,
    .agenda-item-title,
    .agenda-item-desc,
    .agenda-item-author,
    .agenda-item-date,
    .agenda-item-time,
    .agenda-item-category,
    .agenda-item-actions button,
    .agenda-empty,
    .agenda-comment-toggle,
    .quotes-user-name,
    .quotes-user-count,
    .quotes-user-arrow,
    .quote-text,
    .quote-meta,
    .announce-card-author,
    .announce-card-title,
    .announce-card-body,
    .announce-card-time,
    .announce-action-btn,
    .announce-comment-name,
    .announce-comment-text,
    .announce-comment-time,
    .announce-comment-input,
    .qc-name,
    .qc-time,
    .qc-text,
    .qc-action-btn,
    .chat-location-label,
    .pp-card .pp-name,
    .pp-card .pp-subtitle,
    .pp-card .pp-arrow,
    .pp-stat-val,
    .pp-stat-label,
    .pp-item-name,
    .pp-item-count,
    .poll-creator-title,
    .poll-creator-subtitle,
    .poll-options-note,
    .poll-options-count,
    .poll-field-label,
    .poll-setting-title,
    .poll-setting-desc,
    .sc-close,
    .sc-title,
    .sc-tab,
    .sc-upload-progress-text,
    .sc-privacy-title,
    .sc-privacy-summary,
    .sc-drop-hint,
    .sc-vn-hint,
    .sc-char-count,
    .story-viewer-name,
    .story-viewer-time,
    .story-viewers-empty,
    .status-privacy-inline-summary,
    .history-filter-pill,
    .season-name,
    .season-date,
    .season-result-label,
    .season-result-value
) {
    color: var(--theme-surface-text-primary) !important;
}

:root[data-theme] :is(
    .msd-player-hint,
    .poll-creator-kicker,
    .sc-upload-progress-text,
    .story-viewer-time,
    .story-viewers-empty,
    .agenda-item-author,
    .agenda-empty,
    .quotes-user-count,
    .quotes-user-arrow,
    .announce-card-time,
    .announce-comment-time,
    .qc-time,
    .pp-card .pp-subtitle,
    .pp-stat-label,
    .pp-item-count,
    .poll-setting-desc,
    .poll-options-note,
    .status-privacy-inline-summary,
    .season-date
) {
    color: var(--theme-surface-text-secondary) !important;
}

:root[data-theme="light"] #edit-modal.match-score-modal .modal {
    background:
        radial-gradient(circle at top right, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22), transparent 34%),
        radial-gradient(circle at bottom left, rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.16), transparent 38%),
        linear-gradient(160deg, rgba(255, 255, 255, 0.32), rgba(255, 255, 255, 0.08)),
        var(--theme-surface-fill) !important;
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24) !important;
    box-shadow: 0 24px 54px rgba(20, 37, 70, 0.24), 0 10px 30px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.08) !important;
}

:root[data-theme="light"] #edit-modal.match-score-modal .modal::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 244, 251, 0.92));
    opacity: 0.98;
}

:root[data-theme="light"] #edit-modal.match-score-modal .msd-versus,
:root[data-theme="light"] #edit-modal.match-score-modal .msd-score-section {
    background:
        linear-gradient(150deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.11), rgba(var(--accent-secondary-rgb, 249, 115, 22), 0.08)),
        rgba(255, 255, 255, 0.5) !important;
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

:root[data-theme="light"] #edit-modal.match-score-modal .msd-vs-badge,
:root[data-theme="light"] #edit-modal.match-score-modal .msd-score-input {
    background: rgba(255, 255, 255, 0.74) !important;
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22) !important;
    color: var(--theme-surface-text-primary) !important;
}

:root[data-theme="light"] #edit-modal.match-score-modal .msd-score-input::placeholder {
    color: var(--theme-surface-text-muted) !important;
    opacity: 0.8;
}

:root[data-theme="light"] #edit-modal.match-score-modal .msd-btn-delete {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.12), rgba(255, 255, 255, 0.48)) !important;
    color: #c2413c !important;
    border-color: rgba(239, 68, 68, 0.22) !important;
}

:root[data-theme="light"] #edit-modal.match-score-modal .msd-btn-save {
    color: #fff8f5 !important;
    text-shadow: 0 1px 0 rgba(88, 34, 16, 0.22);
}

:root[data-theme] .league-shot-capture.standings-table,
:root[data-theme] .league-shot-capture.glass-card,
:root[data-theme] .league-shot-capture.league-shot-pane,
:root[data-theme] .league-shot-capture.season-standings-table,
:root[data-theme] .league-shot-capture.season-scores-content,
:root[data-theme] .league-shot-capture.history-absent-block,
:root[data-theme] .league-shot-capture.season-babak-group,
:root[data-theme] .league-shot-capture.cup-shot-pane,
:root[data-theme] .league-shot-capture .standings-table,
:root[data-theme] .league-shot-capture .glass-card,
:root[data-theme] .league-shot-capture .league-shot-pane,
:root[data-theme] .league-shot-capture .season-standings-table,
:root[data-theme] .league-shot-capture .season-scores-content,
:root[data-theme] .league-shot-capture .history-absent-block,
:root[data-theme] .league-shot-capture .season-babak-group,
:root[data-theme] .league-shot-capture .cup-shot-pane {
    background: var(--screenshot-surface-fill) !important;
    border-color: var(--screenshot-surface-border) !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

:root[data-theme] .league-shot-capture .table-header,
:root[data-theme] .league-shot-capture .table-row,
:root[data-theme] .league-shot-capture .season-match-item,
:root[data-theme] .league-shot-capture .history-absent-empty,
:root[data-theme] .league-shot-capture .history-absent-list {
    background: var(--screenshot-row-fill) !important;
    backdrop-filter: none !important;
}

:root[data-theme] .league-shot-capture .table-header,
:root[data-theme] .league-shot-capture .season-babak-title,
:root[data-theme] .league-shot-capture .history-absent-toggle {
    background: var(--screenshot-row-fill-strong) !important;
}

:root[data-theme] .league-shot-capture .league-shot-sheet-badge {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.08)),
        var(--screenshot-badge-bg) !important;
}

:root[data-theme="light"] .league-shot-capture .league-shot-sheet-badge {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(247, 250, 255, 0.56)),
        var(--screenshot-badge-bg) !important;
}

.league-shot-capture.screenshot-safe-render,
.screenshot-safe-render .league-shot-capture,
.league-shot-capture.screenshot-safe-render *,
.screenshot-safe-render .league-shot-capture *,
.profile-shot-capture.screenshot-safe-render,
.screenshot-safe-render .profile-shot-capture,
.profile-shot-capture.screenshot-safe-render *,
.screenshot-safe-render .profile-shot-capture * {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    filter: none !important;
    mix-blend-mode: normal !important;
    text-shadow: none !important;
    box-shadow: none !important;
    animation: none !important;
    transition: none !important;
}

.league-shot-sheet.screenshot-safe-render,
.league-shot-pane.screenshot-safe-render,
.standings-table.screenshot-safe-render,
.season-standings-table.screenshot-safe-render,
.season-scores-content.screenshot-safe-render,
.history-shot-card.screenshot-safe-render,
.cup-shot-pane.screenshot-safe-render,
.profile-shot-capture.screenshot-safe-render,
.screenshot-safe-render .league-shot-sheet,
.screenshot-safe-render .league-shot-pane,
.screenshot-safe-render .standings-table,
.screenshot-safe-render .season-standings-table,
.screenshot-safe-render .season-scores-content,
.screenshot-safe-render .history-shot-card,
.screenshot-safe-render .cup-shot-pane,
.screenshot-safe-render .profile-shot-capture {
    background-clip: padding-box !important;
    isolation: isolate !important;
}

.league-shot-sheet.screenshot-safe-render::before,
.league-shot-sheet.screenshot-safe-render::after,
.league-shot-pane.screenshot-safe-render::before,
.league-shot-pane.screenshot-safe-render::after,
.standings-table.screenshot-safe-render::before,
.standings-table.screenshot-safe-render::after,
.season-standings-table.screenshot-safe-render::before,
.season-standings-table.screenshot-safe-render::after,
.season-scores-content.screenshot-safe-render::before,
.season-scores-content.screenshot-safe-render::after,
.history-shot-card.screenshot-safe-render::before,
.history-shot-card.screenshot-safe-render::after,
.cup-shot-pane.screenshot-safe-render::before,
.cup-shot-pane.screenshot-safe-render::after,
.profile-shot-capture.screenshot-safe-render::before,
.profile-shot-capture.screenshot-safe-render::after,
.screenshot-safe-render .league-shot-sheet::before,
.screenshot-safe-render .league-shot-sheet::after,
.screenshot-safe-render .league-shot-pane::before,
.screenshot-safe-render .league-shot-pane::after,
.screenshot-safe-render .standings-table::before,
.screenshot-safe-render .standings-table::after,
.screenshot-safe-render .season-standings-table::before,
.screenshot-safe-render .season-standings-table::after,
.screenshot-safe-render .season-scores-content::before,
.screenshot-safe-render .season-scores-content::after,
.screenshot-safe-render .history-shot-card::before,
.screenshot-safe-render .history-shot-card::after,
.screenshot-safe-render .cup-shot-pane::before,
.screenshot-safe-render .cup-shot-pane::after,
.screenshot-safe-render .profile-shot-capture::before,
.screenshot-safe-render .profile-shot-capture::after {
    content: none !important;
    display: none !important;
    background: none !important;
    box-shadow: none !important;
    filter: none !important;
}

.screenshot-safe-render .table-header,
.screenshot-safe-render .table-row,
.screenshot-safe-render .season-match-item,
.screenshot-safe-render .history-absent-empty,
.screenshot-safe-render .history-absent-list {
    background-clip: padding-box !important;
    contain: paint !important;
}

/* ---- DCL Leaderboard ---- */
.lb-screen {
    display: grid;
    gap: 16px;
    padding: 16px;
    color: var(--text-primary);
}

.lb-list,
.lb-empty {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.22);
    background:
        radial-gradient(circle at 12% 0%, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.18), transparent 32%),
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.08), rgba(96, 165, 250, 0.08)),
        var(--bg-card);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.16);
}

.lb-list::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(115deg, transparent 0 42%, rgba(255, 255, 255, 0.08) 50%, transparent 58% 100%);
    opacity: 0.45;
}

.lb-list > * {
    position: relative;
    z-index: 1;
}

.lb-list,
.lb-empty {
    padding: 16px;
    border-radius: 24px;
}

.lb-section-head h3 {
    margin: 3px 0 0;
    font-size: 18px;
    font-weight: 950;
}

.lb-section-head.compact h3 {
    margin: 0;
    font-size: 15px;
}

.lb-favorite-hint {
    font-size: 11px;
    opacity: 0.65;
    font-weight: 500;
}

.lb-avatar-wrap {
    display: inline-grid;
    place-items: center;
    justify-self: center;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: 2px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.38);
    background: rgba(255, 255, 255, 0.08);
}

.lb-avatar-wrap.champion {
    width: 68px;
    height: 68px;
    border-color: rgba(250, 204, 21, 0.78);
    box-shadow: 0 0 0 7px rgba(250, 204, 21, 0.1), 0 18px 30px rgba(0, 0, 0, 0.18);
}

.lb-avatar,
.lb-avatar-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
}

.lb-avatar {
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 950;
    background: linear-gradient(135deg, var(--accent-primary), #60a5fa);
}

.lb-avatar.empty {
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.08);
}

.lb-avatar.sm,
.lb-avatar-img.sm {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
}

.lb-name {
    overflow: hidden;
    font-size: 13px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lb-score {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 950;
}

.lb-badge-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 850;
    background: rgba(255, 255, 255, 0.07);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.lb-badge-chip.compact {
    padding: 5px 8px;
    font-size: 11px;
}

.lb-badge-chip .lb-badge-chip-name {
    min-width: 0;
    overflow: hidden;
    max-width: 120px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-detail-shot-capture .lb-badge-chip .lb-badge-chip-name {
    max-width: 90px;
}

.lb-badge-chip:focus-visible {
    outline: 2px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.72);
    outline-offset: 2px;
}

.lb-badge-chip.common {
    border-color: rgba(148, 163, 184, 0.38);
}

.lb-badge-chip.rare {
    border-color: rgba(56, 189, 248, 0.45);
    background: rgba(56, 189, 248, 0.11);
}

.lb-badge-chip.epic {
    border-color: rgba(168, 85, 247, 0.48);
    background: rgba(168, 85, 247, 0.13);
}

.lb-badge-chip.champion {
    border-color: rgba(250, 204, 21, 0.58);
    background: rgba(250, 204, 21, 0.13);
}

.lb-badge-chip.legendary {
    border-color: rgba(244, 114, 182, 0.58);
    background: linear-gradient(135deg, rgba(244, 114, 182, 0.16), rgba(96, 165, 250, 0.12));
}

.lb-badge-chip.social {
    border-color: rgba(34, 197, 94, 0.42);
    background: rgba(34, 197, 94, 0.11);
}

.lb-badge-chip.is-locked {
    opacity: 0.32;
    filter: grayscale(0.85) brightness(0.7);
    border-color: rgba(148, 163, 184, 0.2) !important;
    background: rgba(148, 163, 184, 0.06) !important;
    pointer-events: auto;
    position: relative;
}

.lb-badge-chip.is-locked .lb-badge-lock {
    font-size: 9px;
    margin-left: -2px;
    flex-shrink: 0;
    opacity: 0.8;
}

.lb-badge-chip.is-earned {
    position: relative;
}

.lb-badge-chip.is-earned .lb-badge-check {
    font-size: 9px;
    font-weight: 900;
    margin-left: -2px;
    flex-shrink: 0;
    color: #22c55e;
    text-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.lb-badge-chip.is-locked .lb-badge-chip-icon {
    filter: grayscale(1);
}

.lb-badge-chip.is-locked .lb-badge-chip-name {
    text-decoration: none;
}

@keyframes homeCardNativeAlertSpin {
    to {
        transform: rotate(360deg);
    }
}

.lb-rank-card .lb-badge-chip .lb-badge-chip-name {
    max-width: 180px;
}

.lb-rank-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.lb-rank-list > .empty-state {
    grid-column: 1 / -1;
}

.lb-rank-list-single {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.lb-rank-card {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.055);
    cursor: pointer;
    animation: lb-card-in 0.42s ease both;
}

.lb-rank-card:hover,
    border-color: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.46);
}

.lb-rank-pill {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--accent-primary);
    font-size: 12px;
    font-weight: 950;
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12);
}

.lb-rank-copy {
    min-width: 0;
}

.lb-badge-row {
    display: flex;
    gap: 6px;
    min-width: 0;
    margin-top: 4px;
}

.lb-rank-side {
    display: grid;
    justify-items: end;
    gap: 3px;
    min-width: 62px;
}

.lb-rank-mini {
    color: var(--text-secondary);
    font-size: 11px;
    font-weight: 750;
}

.lb-empty {
    display: grid;
    gap: 8px;
    justify-items: center;
    padding: 36px 18px;
    text-align: center;
}

.lb-empty-icon {
    font-size: 46px;
}

.leaderboard-detail-modal .modal {
    width: min(560px, calc(100vw - 24px));
    max-height: min(82vh, 760px);
}

.leaderboard-detail-modal .modal-body {
    max-height: calc(82vh - 72px);
    overflow: auto;
    padding-bottom: 18px;
}

.leaderboard-detail-modal .modal-header {
    gap: 10px;
}

.leaderboard-detail-modal .modal-header h3 {
    flex: 1;
}

.leaderboard-detail-shot-btn {
    flex: 0 0 auto;
}

.lb-detail-sheet,
.lb-guide-sheet {
    display: grid;
    gap: 16px;
    color: var(--text-primary);
}

.lb-detail-hero {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.24);
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12), rgba(96, 165, 250, 0.08));
}

.lb-detail-hero h3,
.lb-guide-intro h3 {
    margin: 0 0 4px;
    font-size: 20px;
    font-weight: 950;
}

.lb-detail-hero p,
.lb-guide-intro p,
.lb-next-progress p,
.lb-guide-badge p {
    margin: 0;
    font-size: 12px;
}

.lb-detail-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.lb-detail-stats div,
.lb-tier-card,
.lb-next-progress,
.lb-guide-badge {
    padding: 11px;
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.055);
}

.lb-detail-stats span,
.lb-tier-card span {
    display: block;
    color: var(--text-secondary);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.lb-tier-card span {
    text-transform: none;
    letter-spacing: 0.02em;
}

.lb-detail-stats strong,
.lb-tier-card strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 950;
}

.lb-tier-card p {
    margin: 7px 0 0;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1.35;
}

.lb-next-progress small {
    display: block;
    margin-top: 6px;
    color: var(--text-muted);
    font-size: 11px;
    line-height: 1.35;
}

.lb-badge-tooltip {
    position: fixed;
    z-index: 10050;
    width: min(280px, calc(100vw - 24px));
    padding: 12px 14px;
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.34);
    border-radius: 16px;
    color: var(--text-primary);
    background:
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 245, 158, 11), 0.12), rgba(96, 165, 250, 0.08)),
        var(--bg-card);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    opacity: 0;
    transform: translateY(6px) scale(0.98);
    transition: opacity 0.16s ease, transform 0.16s ease;
    pointer-events: none;
}

.lb-badge-tooltip.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.lb-badge-tooltip-title {
    font-size: 13px;
    font-weight: 950;
}

.lb-badge-tooltip-meta {
    margin-top: 4px;
    color: var(--accent-primary);
    font-size: 11px;
    font-weight: 900;
}

.lb-badge-tooltip-desc {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.lb-detail-section {
    display: grid;
    gap: 10px;
}

.lb-badge-reset-banner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.14), rgba(168, 85, 247, 0.14));
    border: 1px solid rgba(148, 163, 184, 0.28);
    color: var(--text);
}

.lb-badge-reset-banner.guide {
    margin-top: 4px;
}

.lb-badge-reset-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.lb-badge-reset-banner strong {
    display: block;
    font-size: 14px;
    margin-bottom: 4px;
}

.lb-badge-reset-banner p {
    margin: 0;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--muted);
}

.lb-detail-badges,
.lb-tier-grid,
.lb-guide-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lb-tier-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.lb-tier-card.common {
    border-color: rgba(148, 163, 184, 0.34);
}

.lb-tier-card.rare {
    border-color: rgba(56, 189, 248, 0.42);
}

.lb-tier-card.epic {
    border-color: rgba(168, 85, 247, 0.44);
}

.lb-tier-card.champion {
    border-color: rgba(250, 204, 21, 0.54);
}

.lb-tier-card.legendary {
    border-color: rgba(244, 114, 182, 0.54);
}

.lb-tier-card.social {
    border-color: rgba(34, 197, 94, 0.4);
}

.lb-badge-group {
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.04);
}

.lb-badge-group summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-weight: 950;
    cursor: pointer;
    list-style: none;
}

.lb-badge-group summary::-webkit-details-marker {
    display: none;
}

.lb-badge-group summary span {
    color: var(--accent-primary);
    font-size: 12px;
}

.lb-badge-search-wrap {
    display: grid;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(255, 255, 255, 0.04)),
        var(--surface-soft);
}

.lb-badge-search-label {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lb-badge-search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.54);
    color: var(--text-primary);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

:root[data-theme="dark"] .lb-badge-search-box {
    background: rgba(15, 23, 42, 0.72);
}

.lb-badge-search-box input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary);
    font: inherit;
    font-weight: 750;
}

.lb-badge-search-box input::placeholder {
    color: var(--text-muted);
    font-weight: 650;
}

.lb-badge-search-clear {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-subtle);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.46);
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}

.lb-badge-search-clear[hidden] {
    display: none;
}

.lb-badge-search-count {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 800;
}

.lb-badge-search-empty {
    padding: 20px 14px;
    border: 1px dashed rgba(var(--accent-rgb), 0.36);
    border-radius: 18px;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-secondary);
    text-align: center;
}

.lb-badge-search-empty strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.lb-badge-search-empty p {
    margin: 0;
    color: var(--text-muted);
}

.lb-badge-group .lb-detail-badges,
.lb-guide-list {
    padding: 0 12px 12px;
}

.lb-guide-badge {
    flex: 1 1 190px;
}

.lb-guide-badge p {
    margin-top: 8px;
}

@keyframes lb-card-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (hover: hover) and (pointer: fine) {
    .lb-screen {
        gap: 14px;
        padding: 14px 18px 18px;
    }

    .lb-list,
    .lb-empty {
        padding: 15px;
        border-radius: 22px;
    }

    .lb-title {
        max-width: 260px;
        font-size: clamp(30px, 4.4vw, 34px);
        line-height: 1;
        letter-spacing: -0.035em;
    }

    .lb-subtitle {
        max-width: 270px;
        font-size: 12px;
        line-height: 1.35;
    }

    .lb-avatar-wrap {
        width: 50px;
        height: 50px;
    }

    .lb-avatar-wrap.champion {
        width: 58px;
        height: 58px;
        box-shadow: 0 0 0 5px rgba(250, 204, 21, 0.1), 0 14px 24px rgba(0, 0, 0, 0.16);
    }

    .lb-avatar,
    .lb-avatar-img {
        width: 42px;
        height: 42px;
    }

    .lb-avatar-wrap.champion .lb-avatar,
    .lb-avatar-wrap.champion .lb-avatar-img {
        width: 50px;
        height: 50px;
    }

    .lb-name {
        font-size: 12px;
    }

    .lb-score {
        font-size: 12px;
    }

    .lb-badge-chip.compact {
        max-width: 100%;
        padding: 4px 7px;
        font-size: 10px;
    }

    .lb-section-head h3 {
        font-size: 16px;
    }

}

@media (max-width: 430px) {
    .lb-screen {
        padding: 12px;
        gap: 12px;
    }

    .lb-list,
    .lb-empty {
        border-radius: 22px;
        padding: 14px;
    }






    .lb-rank-list {
        grid-template-columns: minmax(0, 1fr);
    }

    .lb-rank-card {
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        gap: 10px;
        padding: 10px 11px;
    }

    .lb-detail-stats,
    .lb-tier-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (prefers-reduced-motion: reduce) {
    .lb-rank-card {
        animation: none;
    }
}

/* ============================================
   Badge Unlock Popup
   ============================================ */
.badge-unlock-overlay {
    position: fixed;
    inset: 0;
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    pointer-events: none;
}

.badge-unlock-overlay.active {
    background: rgba(0, 0, 0, 0.55);
    pointer-events: auto;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.badge-unlock-card {
    position: relative;
    width: min(340px, calc(100vw - 40px));
    background: var(--bg-card, #1a1f2e);
    border-radius: 24px;
    padding: 36px 28px 28px;
    text-align: center;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: scale(0.7) translateY(40px);
    opacity: 0;
    transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.35s ease;
    overflow: hidden;
    will-change: transform, opacity;
}

.badge-unlock-overlay.active .badge-unlock-card {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.badge-unlock-overlay.dismissing .badge-unlock-card {
    transform: scale(0.85) translateY(30px);
    opacity: 0;
    transition: transform 0.3s ease-in, opacity 0.25s ease-in;
}

.badge-unlock-bg-glow {
    position: absolute;
    inset: -40px;
    border-radius: 50%;
    opacity: 0.18;
    filter: blur(48px);
    animation: badgeGlowPulse 2.2s ease-in-out infinite;
    pointer-events: none;
}

.badge-unlock-kicker {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary, #94a3b8);
    margin-bottom: 18px;
}

.badge-unlock-icon-wrap {
    position: relative;
    width: 96px;
    height: 96px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.badge-unlock-icon-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 3px solid transparent;
    animation: badgeRingSpin 3s linear infinite;
}

.badge-unlock-icon-bg {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    line-height: 1;
    animation: badgeIconBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.25s both;
}

.badge-unlock-tier-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 20px;
    margin-bottom: 12px;
}

.badge-unlock-name {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary, #f1f5f9);
    line-height: 1.2;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.badge-unlock-desc {
    font-size: 13px;
    color: var(--text-secondary, #94a3b8);
    line-height: 1.5;
    margin-bottom: 8px;
}

.badge-unlock-points {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-primary, #f59e0b);
    margin-bottom: 22px;
}

.badge-unlock-dismiss {
    width: 100%;
    padding: 12px;
    border-radius: 14px;
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary, #f1f5f9);
}

.badge-unlock-dismiss:active {
    background: rgba(255, 255, 255, 0.14);
    transform: scale(0.97);
}

.badge-unlock-queue-indicator {
    position: absolute;
    top: 14px;
    right: 14px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary, #94a3b8);
    background: rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 2px 8px;
}

.badge-unlock-confetti {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    border-radius: 24px;
}

.badge-unlock-confetti-dot {
    position: absolute;
    top: -8px;
    width: 7px;
    height: 7px;
    border-radius: 2px;
    animation: confettiFall linear forwards;
}

@keyframes badgeGlowPulse {
    0%, 100% { opacity: 0.14; transform: scale(1); }
    50%       { opacity: 0.26; transform: scale(1.12); }
}

@keyframes badgeRingSpin {
    to { transform: rotate(360deg); }
}

@keyframes badgeIconBounce {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

@keyframes confettiFall {
    0%   { transform: translateY(0) rotate(0deg); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(320px) rotate(720deg); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .badge-unlock-card,
    .badge-unlock-overlay.active .badge-unlock-card {
        transition: opacity 0.2s ease;
        transform: none;
    }
    .badge-unlock-icon-ring { animation: none; }
    .badge-unlock-bg-glow   { animation: none; }
}

/* ---- Leaderboard Tour ---- */
.lb-tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 9100;
    pointer-events: none;
}

.lb-tour-overlay.active {
    pointer-events: all;
}

.lb-tour-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    transition: opacity 0.25s ease;
    opacity: 0;
}

.lb-tour-overlay.active .lb-tour-backdrop {
    opacity: 1;
}

.lb-tour-highlight {
    position: absolute;
    border-radius: 16px;
    box-shadow:
        0 0 0 4px rgba(var(--accent-primary-rgb, 245, 158, 11), 0.85),
        0 0 0 9999px rgba(0, 0, 0, 0.72);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9101;
}

.lb-tour-card {
    position: absolute;
    z-index: 9102;
    width: min(320px, calc(100vw - 32px));
    background: var(--surface-modal, #1e2330);
    border: 1px solid rgba(var(--accent-primary-rgb, 245, 158, 11), 0.35);
    border-radius: 20px;
    padding: 18px 18px 14px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.lb-tour-step-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-primary, #f59e0b);
    margin-bottom: 8px;
}

.lb-tour-step-dots {
    display: flex;
    gap: 5px;
    margin-left: auto;
}

.lb-tour-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.3);
    transition: all 0.2s ease;
}

.lb-tour-dot.active {
    width: 14px;
    border-radius: 3px;
    background: var(--accent-primary, #f59e0b);
}

.lb-tour-icon {
    font-size: 28px;
    margin-bottom: 8px;
    line-height: 1;
}

.lb-tour-title {
    font-size: 16px;
    font-weight: 900;
    color: var(--text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.lb-tour-body {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin: 0 0 14px;
}

.lb-tour-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lb-tour-skip {
    flex: 1;
    font-size: 12px;
    color: var(--text-muted);
    background: none;
    border: none;
    padding: 6px 0;
    cursor: pointer;
    text-align: left;
}

.lb-tour-prev,
.lb-tour-next {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

.lb-tour-prev {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
}

.lb-tour-next {
    background: linear-gradient(135deg, var(--accent-primary, #f59e0b), var(--theme-active-gradient-end, #fb923c));
    color: #fff;
}

.lb-tour-prev:hover,
.lb-tour-next:hover {
    opacity: 0.85;
}

.lb-tour-btn {
    border: 1px solid var(--border-subtle);
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.08);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 6px 13px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease;
}

.lb-tour-btn:hover {
    background: rgba(var(--accent-primary-rgb, 245, 158, 11), 0.15);
}

@media (prefers-reduced-motion: reduce) {
    .lb-tour-highlight,
    .lb-tour-card,
    .lb-tour-backdrop { transition: none; }
}

/* ==================== FOOTBALL HUB ==================== */
.footballhub-page {
    padding: 0 0 22px;
}

.footballhub-page .view-top-bar {
    margin: 0;
}

.footballhub-content {
    padding: 12px 16px 0;
}

.footballhub-competitions {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    margin-bottom: 12px;
}

.footballhub-competitions::-webkit-scrollbar {
    height: 4px;
}

.footballhub-competitions::-webkit-scrollbar-thumb {
    background: rgba(139, 92, 246, 0.5);
    border-radius: 2px;
}

.footballhub-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    background: rgba(139, 92, 246, 0.1);
    color: #ccc;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footballhub-chip.active,
.footballhub-chip:hover {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-color: transparent;
    color: #fff;
}

.footballhub-tabs {
    display: flex;
    gap: 6px;
    padding: 10px 0;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(139, 92, 246, 0.15);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.footballhub-tabs::-webkit-scrollbar {
    display: none;
}

.footballhub-tab {
    flex: 0 0 auto;
    white-space: nowrap;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.08);
    color: #ccc;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footballhub-tab.active,
.footballhub-tab:hover {
    background: linear-gradient(135deg, #8b5cf6, #a855f7);
    border-color: transparent;
    color: #fff;
}

.footballhub-content {
    min-height: 200px;
}

.footballhub-tab-content:not(.hidden) {
    display: block;
}

.footballhub-empty {
    padding: 14px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

.footballhub-matches-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 10px 12px 6px;
    margin: 0 8px;
}
.footballhub-nav-btn {
    background: rgba(128,128,128,0.15);
    border: none;
    color: var(--text-main, #333);
    font-size: 22px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
    flex-shrink: 0;
}
.footballhub-nav-btn:active { background: rgba(128,128,128,0.28); }
.footballhub-matches-label,
#footballhub-matches-label {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-main, #333);
    min-width: 140px;
    text-align: center;
}
.footballhub-matches-list {
    padding: 0 8px;
}

.football-table-card {
    padding: 0;
    overflow: hidden;
}

.football-table-head {
    display: grid;
    grid-template-columns: 32px 1fr 36px 36px 36px 36px 44px 44px;
    gap: 4px;
    padding: 12px 14px;
    background: rgba(139, 92, 246, 0.12);
    font-size: 11px;
    font-weight: 800;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.football-table-head span {
    text-align: center;
}

.football-table-head span:nth-child(2) {
    text-align: left;
}

.football-table-body {
    padding: 4px;
    min-width: 0;
}
.football-table-row {
    display: grid;
    grid-template-columns: 32px 1fr 36px 36px 36px 36px 44px 44px;
    gap: 4px;
    padding: 10px 10px;
    border-radius: 10px;
    font-size: 12px;
    align-items: center;
    transition: background 0.2s ease;
}

.football-table-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.football-table-row:hover {
    background: rgba(139, 92, 246, 0.08);
}

.football-table-row.top {
    background: rgba(139, 92, 246, 0.1);
}

.football-table-row span {
    text-align: center;
    font-weight: 600;
    color: #ccc;
}

.football-table-row .club-name {
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.football-table-row .pts {
    font-weight: 800;
    color: #fff;
}

.football-match-card {
    padding: 12px 14px;
    margin-bottom: 10px;
}

.football-match-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 11px;
}

.football-match-status {
    padding: 4px 10px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
}

.football-match-status.done {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.football-match-status.upcoming {
    background: rgba(139, 92, 246, 0.15);
    color: #a855f7;
}

.football-match-date {
    color: var(--text-muted);
    font-weight: 600;
}

.football-match-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
}

.football-team {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.football-team.right {
    text-align: right;
}

.football-score {
    font-size: 20px;
    font-weight: 800;
    font-family: var(--font-display);
    color: #fff;
    text-align: center;
    min-width: 60px;
}

.football-competition-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.football-competition-item {
    padding: 16px 12px;
    text-align: center;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: rgba(139, 92, 246, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.football-competition-item:hover,
.football-competition-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(168, 85, 247, 0.2));
    border-color: rgba(139, 92, 246, 0.5);
    transform: translateY(-2px);
}

.football-competition-code {
    font-size: 20px;
    font-weight: 800;
    color: #a855f7;
    margin-bottom: 4px;
}

.football-competition-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}

.footballhub-meta {
    margin-top: 16px;
    padding: 12px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.08);
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

@media (max-width: 480px) {
    .footballhub-competitions {
        gap: 6px;
    }

    .footballhub-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .football-table-head {
        grid-template-columns: 28px 1fr 32px 32px 32px 32px 40px 40px;
        padding: 10px 10px;
        font-size: 10px;
    }

    .football-table-row {
        grid-template-columns: 28px 1fr 32px 32px 32px 32px 40px 40px;
        padding: 8px 6px;
        font-size: 11px;
    }

    .football-team {
        font-size: 12px;
    }

    .football-score {
        font-size: 16px;
    }

    .football-competition-grid {
        grid-template-columns: 1fr;
    }
}

.footballhub-page,
.footballhub-page .view-top-bar,
.footballhub-content,
.footballhub-panel,
.football-table-card,
.football-table-body,
.footballhub-season-row,
.footballhub-hero {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

.footballhub-page {
    overflow-x: hidden;
}

.footballhub-content,
.footballhub-panel {
    overflow-x: clip;
}

.football-table-card {
    overflow: hidden;
}

@media (max-width: 420px) {
    .footballhub-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .football-table-card {
        padding-left: 8px;
        padding-right: 8px;
    }

    .football-table-title {
        display: grid;
        grid-template-columns: 1fr;
        align-items: flex-start;
        gap: 8px;
        padding-left: 4px;
        padding-right: 2px;
    }

    .football-table-title > div {
        min-width: 0;
    }

    .football-table-title strong {
        font-size: 15px;
    }

    .football-table-title > span {
        flex: 0 0 auto;
        justify-self: center;
        max-width: none;
        overflow: hidden;
        text-align: center;
        text-overflow: clip;
        white-space: nowrap;
    }

    .football-table-head,
    .football-table-row {
        grid-template-columns: 24px minmax(72px, 1fr) 28px 22px 22px 22px 30px 32px;
        gap: 2px;
        padding-left: 2px;
        padding-right: 2px;
    }

    .football-table-head {
        font-size: 8.5px;
        letter-spacing: 0.04em;
    }

    .football-table-row {
        font-size: 10px;
    }

    .football-rank {
        width: 24px;
        height: 28px;
        margin: 0;
        border-radius: 10px;
        font-size: 11px;
    }

    .football-table-row .club-name {
        gap: 5px;
        min-width: 0;
    }

    .football-table-row .club-name img {
        width: 16px;
        height: 16px;
    }

    .football-table-row .club-name strong {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 380px) {
    .footballhub-content {
        padding: 10px 12px 0;
    }

    .footballhub-chip {
        padding: 5px 10px;
        font-size: 11px;
    }

    .footballhub-tab {
        padding: 8px 10px;
        font-size: 12px;
    }

    .football-table-head {
        grid-template-columns: 24px 1fr 28px 28px 28px 28px 36px 36px;
        gap: 2px;
        padding: 8px 6px;
        font-size: 9px;
    }

    .football-table-row {
        grid-template-columns: 24px 1fr 28px 28px 28px 28px 36px 36px;
        gap: 2px;
        padding: 6px 4px;
        font-size: 10px;
    }

    .football-team {
        font-size: 11px;
    }
}

/* ==================== FOOTBALL HUB REFINEMENT ==================== */
.home-card.card-football {
    background:
        linear-gradient(135deg,
            rgba(var(--accent-primary-rgb, 99, 102, 241), 0.18),
            rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.12)),
        linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent);
    border-color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.22);
    --home-alert-color-1: rgba(255, 255, 255, 0.98);
    --home-alert-color-2: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.96);
    --home-alert-color-3: rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.88);
    --home-alert-shadow: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.22);
}

.footballhub-content {
    display: grid;
    gap: 14px;
    min-height: 200px;
}

.footballhub-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 24px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.16);
    background:
        radial-gradient(circle at top right, rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.16), transparent 42%),
        linear-gradient(135deg, rgba(var(--accent-primary-rgb, 99, 102, 241), 0.16), rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.08));
    box-shadow: 0 20px 42px rgba(0, 0, 0, 0.12);
}

.footballhub-kicker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.92);
}

.footballhub-hero h3 {
    margin: 0;
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    line-height: 0.95;
    color: var(--text-primary);
}

.footballhub-hero p {
    margin: 10px 0 0;
    max-width: 44ch;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.footballhub-live-pill,
.footballhub-meta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.18);
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.footballhub-season-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.16);
    background:
        linear-gradient(135deg,
            rgba(var(--accent-primary-rgb, 99, 102, 241), 0.08),
            rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.05));
}

.footballhub-season-row span {
    display: block;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.9);
}

.footballhub-season-row strong {
    display: block;
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 13px;
}

.footballhub-season-row select {
    width: min(230px, 52vw);
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.22);
    background: var(--surface-1, rgba(255, 255, 255, 0.08));
    color: var(--text-primary);
    font-weight: 700;
}

.footballhub-competitions {
    gap: 10px;
    padding: 2px 0 8px;
    margin-bottom: 0;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.38) transparent;
}

.footballhub-chip {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 134px;
    padding: 10px 14px;
    border-radius: 18px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    scroll-snap-align: start;
}

.footballhub-chip-name {
    font-size: 12px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.footballhub-chip.active,
.footballhub-chip:hover {
    background:
        linear-gradient(135deg,
            rgba(var(--accent-primary-rgb, 99, 102, 241), 0.2),
            rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.14));
    border-color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.36);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.footballhub-tabs {
    gap: 8px;
    padding: 0;
    margin: 0;
    border-bottom: 0;
    scroll-snap-type: x proximity;
}

.footballhub-tab {
    flex: 0 0 auto;
    min-height: 46px;
    border-radius: 16px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.18);
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 800;
    scroll-snap-align: start;
}

.footballhub-tab.active,
.footballhub-tab:hover {
    background:
        linear-gradient(135deg,
            rgba(var(--accent-primary-rgb, 99, 102, 241), 0.96),
            rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.86));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 16px 30px rgba(var(--accent-primary-rgb, 99, 102, 241), 0.2);
}

.footballhub-panel {
    display: grid;
    gap: 12px;
}

.footballhub-panel.hidden {
    display: none !important;
}

.footballhub-empty {
    padding: 20px 18px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
}

.football-table-card {
    padding: 12px;
    border-radius: 24px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.16);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.football-table-title {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 8px 14px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 700;
}

.football-table-title strong {
    display: block;
    margin-top: 4px;
    font-size: 18px;
    font-family: var(--font-display);
    color: var(--text-primary);
}

.football-table-kicker {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.9);
}

.football-table-head,
.football-table-row {
    grid-template-columns: 42px minmax(180px, 1fr) 54px 44px 44px 44px 56px 64px;
    gap: 8px;
}

.football-table-head {
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.12);
    color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.95);
    font-size: 10px;
    letter-spacing: 0.08em;
}

.football-table-body {
    padding: 8px 0 0;
}

.football-table-row {
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 12px;
    border: 1px solid transparent;
}

.football-table-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.05);
}

.football-table-row:hover {
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.08);
    border-color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.14);
}

.football-table-row.top {
    background:
        linear-gradient(135deg,
            rgba(var(--accent-primary-rgb, 99, 102, 241), 0.14),
            rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.08));
}

.football-table-row span {
    color: var(--text-secondary);
}

.football-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto;
    border-radius: 12px;
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.12);
    color: var(--text-primary);
    font-weight: 800;
}

.football-table-row.top .football-rank {
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.9);
    color: #fff;
}

.football-table-row .club-name {
    display: flex;
    align-items: center;
    gap: 10px;
}

.football-table-row .club-name img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.18));
}

.football-club-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.75);
    flex-shrink: 0;
}

.football-table-row .club-name strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.football-table-row .pts {
    color: var(--text-primary);
}

.football-match-card {
    padding: 16px;
    border-radius: 22px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
}

.football-match-status.done {
    background: rgba(34, 197, 94, 0.16);
    color: #16a34a;
}

.football-match-status.upcoming {
    background: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.14);
    color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.96);
}

.football-match-status.live {
    background: rgba(239, 68, 68, 0.16);
    color: #ef4444;
}

.football-match-card.live {
    border-color: rgba(239, 68, 68, 0.2);
}

.football-match-date {
    font-size: 12px;
}

.football-team {
    font-size: 15px;
    color: var(--text-primary);
}

.football-score {
    min-width: 82px;
    color: var(--text-primary);
}

.football-competition-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.football-competition-item {
    padding: 18px 14px;
    border-radius: 20px;
    border: 1px solid rgba(var(--accent-primary-rgb, 99, 102, 241), 0.14);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
    text-align: left;
}

.football-competition-item:hover,
.football-competition-item.active {
    background:
        linear-gradient(135deg,
            rgba(var(--accent-primary-rgb, 99, 102, 241), 0.16),
            rgba(var(--accent-secondary-rgb, 56, 189, 248), 0.12));
    border-color: rgba(var(--accent-primary-rgb, 99, 102, 241), 0.28);
    transform: translateY(-2px);
}

.football-competition-name {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
}

.football-competition-meta {
    margin-top: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
}

.football-scorer-list {
    display: grid;
    gap: 8px;
}

.football-scorer-row {
    display: grid;
    grid-template-columns: 38px 34px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
}

.football-scorer-row img {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    object-fit: cover;
}

.football-scorer-row strong,
.football-scorer-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.football-scorer-row strong {
    color: var(--text-primary);
    font-size: 13px;
}

.football-scorer-row small {
    color: var(--text-secondary);
    font-size: 11px;
}

.football-scorer-row b {
    color: var(--text-primary);
    font-size: 12px;
}

@media (max-width: 640px) {
    .footballhub-hero {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .footballhub-live-pill,
    .footballhub-meta {
        justify-content: flex-start;
        width: fit-content;
        max-width: 100%;
    }

    .footballhub-season-row {
        align-items: stretch;
        flex-direction: column;
    }

    .footballhub-season-row select {
        width: 100%;
    }

    .footballhub-chip {
        min-width: max-content;
        padding: 8px 12px;
    }

    .footballhub-chip-name {
        font-size: 11px;
    }

    .football-table-head,
    .football-table-row {
        grid-template-columns: 30px minmax(132px, 1fr) 40px 32px 32px 32px 42px 48px;
        gap: 6px;
    }

    .football-table-head {
        font-size: 9px;
        padding: 10px 10px;
    }

    .football-table-row {
        padding: 10px 10px;
        font-size: 11px;
    }

    .football-table-title strong {
        font-size: 16px;
    }

    .football-table-row .club-name img {
        width: 18px;
        height: 18px;
    }

    .football-competition-grid {
        grid-template-columns: 1fr;
    }

    .footballhub-page .glass-card,
    .footballhub-page .football-competition-item,
    .footballhub-page .football-match-card,
    .footballhub-page .football-table-card,
    .footballhub-page .footballhub-live-pill {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
    }

    .football-table-row,
    .football-match-card,
    .football-competition-item {
        content-visibility: auto;
        contain-intrinsic-size: auto 88px;
    }
}

@media (max-width: 420px) {
    .footballhub-content {
        padding: 10px 14px 0;
    }

    .footballhub-tab {
        min-height: 42px;
        padding: 0 10px;
        font-size: 12px;
    }

    .football-table-head,
    .football-table-row {
        grid-template-columns: 26px minmax(110px, 1fr) 34px 28px 28px 28px 38px 42px;
        gap: 4px;
    }

    .football-table-row .club-name {
        gap: 8px;
    }

    .football-table-row .club-name strong {
        font-size: 11px;
    }

    .football-score {
        min-width: 56px;
        font-size: 16px;
    }

    .football-competition-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .football-table-title {
        display: grid;
        grid-template-columns: 1fr;
        align-items: start;
        gap: 8px;
        padding: 6px 4px 12px;
    }

    .football-table-title > span {
        justify-self: center;
        text-align: center;
        white-space: nowrap;
    }

    .football-table-head,
    .football-table-row {
        grid-template-columns: 28px minmax(78px, 1fr) 26px 21px 21px 21px 28px 30px;
        gap: 4px;
        padding-left: 2px;
        padding-right: 2px;
    }

    .football-rank {
        width: 28px;
        height: 28px;
        border-radius: 10px;
        font-size: 11px;
    }

    .football-table-row .club-name {
        gap: 7px;
    }

    .football-table-row .club-name img {
        width: 16px;
        height: 16px;
    }
}

@media (min-width: 641px) and (pointer: fine) {
    .footballhub-page .view-top-bar {
        min-height: 58px;
    }

    .footballhub-content {
        max-width: 432px;
        margin: 0 auto;
        padding: 10px 14px 28px;
        gap: 10px;
    }

    .footballhub-hero {
        padding: 14px 16px;
        border-radius: 20px;
        gap: 10px;
    }

    .footballhub-kicker {
        margin-bottom: 6px;
        font-size: 9px;
        letter-spacing: 0.16em;
    }

    .footballhub-hero h3 {
        font-size: 1.45rem;
        line-height: 1;
    }

    .footballhub-live-pill,
    .footballhub-meta {
        min-height: 34px;
        padding: 0 12px;
        font-size: 11px;
    }

    .footballhub-season-row {
        padding: 10px 12px;
        border-radius: 16px;
    }

    .footballhub-season-row select {
        min-height: 36px;
        font-size: 12px;
    }

    .footballhub-competitions {
        gap: 8px;
        padding-bottom: 6px;
    }

    .footballhub-chip {
        min-width: 112px;
        padding: 8px 12px;
        border-radius: 14px;
    }

    .footballhub-chip-name,
    .footballhub-tab {
        font-size: 11px;
    }

    .footballhub-tabs {
        gap: 7px;
    }

    .footballhub-tab {
        min-height: 38px;
        padding: 0 12px;
        border-radius: 13px;
    }

    .football-table-card {
        padding: 10px;
        border-radius: 20px;
    }

    .football-table-title {
        padding: 4px 6px 10px;
        font-size: 11px;
    }

    .football-table-title strong {
        font-size: 15px;
    }

    .football-table-kicker {
        font-size: 9px;
    }

    .football-table-head,
    .football-table-row {
        grid-template-columns: 30px minmax(136px, 1fr) 38px 30px 30px 30px 38px 42px;
        gap: 5px;
    }

    .football-table-head {
        padding: 9px 10px;
        border-radius: 13px;
        font-size: 9px;
        letter-spacing: 0.07em;
    }

    .football-table-body {
        padding-top: 6px;
    }

    .football-table-row {
        padding: 8px 10px;
        border-radius: 13px;
        font-size: 11px;
    }

    .football-rank {
        width: 26px;
        height: 26px;
        border-radius: 10px;
        font-size: 11px;
    }

    .football-table-row .club-name {
        gap: 8px;
    }

    .football-table-row .club-name img {
        width: 18px;
        height: 18px;
    }

    .football-match-card {
        padding: 12px 14px;
        border-radius: 18px;
    }

    .football-team {
        font-size: 13px;
    }

    .football-score {
        min-width: 64px;
        font-size: 18px;
    }
}

/* ---- Video call ---- */
.call-video-wrap {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 0;
}

.call-video-wrap.hidden {
    display: none;
}

.call-remote-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;

    transform: none !important;
}

.call-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 14px;
    background: linear-gradient(160deg, #0f0f23 0%, #1a1a3e 100%);
}

.call-video-placeholder.hidden {
    display: none;
}

.call-video-ph-text {
    font-size: 13px;
    opacity: 0.8;
}

.call-local-video {
    position: absolute;
    right: 16px;
    bottom: 170px;
    width: 104px;
    height: 140px;
    border-radius: 14px;
    object-fit: cover;
    background: #1c1c22;
    border: 2px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    transform: scaleX(-1);
    z-index: 1;
}

.call-local-video.rear {
    transform: none;
}

.call-audio-ui {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.call-audio-ui.hidden {
    display: none;
}

.call-screen > .call-name,
.call-screen > .call-timer,
.call-screen > .call-participants,
.call-screen > .call-group-tools,
.call-screen > .call-actions-active,

.call-ctrl-btn.camera-off {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.55);
    color: #fca5a5;
}

/* ===== DCL Call UI v2.5: unified controls, recording, net quality, participants ===== */

.call-actions-active {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 12px;
    column-gap: 12px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 12px;
    padding-right: 12px;
}
@media (max-width: 420px) {
    .call-actions-active { gap: 10px; }
    .call-ctrl-btn { width: 48px; height: 48px; min-width: 48px; }
    .call-ctrl-btn.call-end { width: 58px; height: 58px; min-width: 58px; }
}

.call-ctrl-btn.video-only { display: none; }
#call-active.show-video .call-ctrl-btn.video-only { display: flex; }

/* ===== Video call layout fix: top info overlay, bottom controls, no overlap ===== */
#call-active.show-video .call-screen {
    justify-content: flex-start;
    padding-top: max(52px, calc(env(safe-area-inset-top, 0px) + 36px));
}
#call-active.show-video .call-name {
    margin-top: 6px;
    text-shadow: 0 1px 10px rgba(0,0,0,.75);
}
#call-active.show-video .call-timer,
#call-active.show-video .call-status-row,
#call-active.show-video .call-participants {
    text-shadow: 0 1px 10px rgba(0,0,0,.75);
}

#call-active.show-video .call-actions-active {
    margin-top: auto;
    margin-bottom: max(22px, env(safe-area-inset-bottom, 0px));
    position: relative;
    z-index: 3;
}

#call-active.show-video .call-screen::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 160px;
    background: linear-gradient(to bottom, rgba(0,0,0,.55), transparent);
    z-index: 1;
    pointer-events: none;
}

#call-active.show-video .call-actions-active::before {
    content: '';
    position: absolute;
    left: -24px; right: -24px; top: -34px; bottom: -28px;
    background: linear-gradient(to top, rgba(0,0,0,.5), transparent);
    z-index: -1;
    pointer-events: none;
    border-radius: 24px;
}

#call-active.show-video .call-local-video {
    bottom: 196px;
}

#call-active.is-group .call-ctrl-btn.private-only { display: none; }

.call-status-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
    min-height: 22px;
    position: relative;
    z-index: 2;
}
.call-rec-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.4);
    padding: 3px 10px;
    border-radius: 999px;
}
.call-rec-indicator.hidden { display: none; }
.rec-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #ef4444;
    animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.8); }
}
.call-net-quality {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 3px 10px;
    border-radius: 999px;
}
.net-dot { width: 9px; height: 9px; border-radius: 50%; background: #22c55e; }
.call-net-quality.net-mid .net-dot { background: #eab308; }
.call-net-quality.net-bad .net-dot { background: #ef4444; }

.call-ctrl-btn.recording {
    background: rgba(239, 68, 68, 0.22);
    border-color: rgba(239, 68, 68, 0.55);
    color: #fca5a5;
}
.call-ctrl-btn.recording svg circle:last-child { animation: recPulse 1.2s ease-in-out infinite; }

.call-ctrl-btn.switch-active {
    background: rgba(59, 130, 246, 0.2);
    border-color: rgba(59, 130, 246, 0.45);
    color: #93c5fd;
}

.call-participant-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 14px;
    min-width: 76px;
    max-width: 110px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.call-participant-tile.talking {
    border-color: #22c55e;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
}
.call-participant-tile .tile-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.12);
    font-size: 20px; font-weight: 700; color: #fff;
}
.call-participant-tile .tile-name {
    font-size: 11px; font-weight: 600; color: rgba(255,255,255,0.85);
    max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.call-participant-tile .tile-state { font-size: 10px; color: rgba(255,255,255,0.5); }
.call-participant-tile.self { border-style: dashed; }

.call-mini-bar { touch-action: none; user-select: none; -webkit-user-select: none; }
.call-mini-bar.dragging { transition: none; opacity: 0.92; }

.recording-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; margin-top: 8px;
    background: var(--card-bg, rgba(128,128,128,0.08));
    border: 1px solid var(--border-color, rgba(128,128,128,0.2));
    border-radius: 12px;
}
.recording-info { flex: 1; min-width: 0; }
.recording-title { font-size: 13px; font-weight: 700; }
.recording-meta { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.recording-actions { display: flex; gap: 6px; }
.recording-btn {
    padding: 6px 10px; border-radius: 8px; font-size: 12px; font-weight: 600;
    border: 1px solid var(--border-color, rgba(128,128,128,0.25));
    background: transparent; color: inherit; cursor: pointer;
}
.recording-btn.danger { color: #ef4444; border-color: rgba(239,68,68,0.4); }

.call-ctrl-btn.group-only { display: none; }
#call-active.is-group .call-ctrl-btn.group-only { display: flex; }

/* ===== WhatsApp-style call controls (v2.5.3) ===== */

#call-active .call-actions-active {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 14px !important;
    max-width: 100% !important;
    padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)) !important;
    margin: 0 !important;
    row-gap: 0 !important;
    column-gap: 14px !important;
    overflow-x: auto;
    scrollbar-width: none;
}
#call-active .call-actions-active::-webkit-scrollbar { display: none; }

#call-active .call-ctrl-btn {
    flex: 0 0 auto !important;
    width: 54px !important;
    height: 54px !important;
    min-width: 54px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
    font-size: 0 !important;
    background: rgba(255, 255, 255, 0.14) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,.35);
}
#call-active .call-ctrl-btn svg { width: 24px !important; height: 24px !important; }

#call-active .call-ctrl-btn > span { display: none !important; }

#call-active #btn-call-end {
    display: flex !important;
    visibility: visible !important;
    width: 62px !important;
    height: 62px !important;
    min-width: 62px !important;
    background: #e5484d !important;
    color: #fff !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}
#call-active #btn-call-end svg { width: 28px !important; height: 28px !important; transform: rotate(135deg); }

#call-active .call-ctrl-btn.muted,
#call-active .call-ctrl-btn.camera-off {
    background: rgba(229, 72, 77, 0.25) !important;
    color: #ff8a8a !important;
}
#call-active .call-ctrl-btn.active {
    background: rgba(34, 197, 94, 0.25) !important;
    color: #4ade80 !important;
    border: none !important;
}
#call-active .call-ctrl-btn.recording {
    background: rgba(229, 72, 77, 0.35) !important;
    color: #fff !important;
    animation: wa-rec-pulse 1.2s infinite;
}
@keyframes wa-rec-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229,72,77,.5); }
    50% { box-shadow: 0 0 0 8px rgba(229,72,77,0); }
}

#call-active .call-status-row {
    margin-bottom: 10px !important;
    min-height: 22px;
}
#call-active.show-video .call-video-ph-text {
    position: relative;
    z-index: 1;
    padding: 0 24px;
    text-align: center;
}

#call-video-wrap .call-remote-video,
#call-video-wrap .call-local-video {
    transition: all .25s ease;
}
#call-video-wrap.video-swapped .call-remote-video {
    position: absolute !important;
    width: 112px !important;
    height: 150px !important;
    right: 14px !important;
    left: auto !important;
    top: auto !important;
    bottom: 196px !important;
    border-radius: 12px !important;
    object-fit: cover;
    z-index: 3 !important;
    border: 2px solid rgba(255,255,255,.35);
}
#call-video-wrap.video-swapped .call-local-video {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
    z-index: 1 !important;
    border: none !important;
}
@media (max-width: 420px) {
    #call-active .call-actions-active { gap: 10px !important; padding-left: 8px !important; padding-right: 8px !important; }
    #call-active .call-ctrl-btn { width: 48px !important; height: 48px !important; min-width: 48px !important; }
    #call-active .call-ctrl-btn svg { width: 22px !important; height: 22px !important; }
    #call-active #btn-call-end { width: 56px !important; height: 56px !important; min-width: 56px !important; }
}

/* DCL AI generated images (web parity with Baileys !gambar) */
.home-ai-imagegen {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.25);
    font-size: 13px;
    color: var(--text-primary);
}
.home-ai-generated-images {
    margin-top: 10px;
    display: grid;
    gap: 8px;
}
.home-ai-generated-image {
    width: 100%;
    height: auto;
    border-radius: 14px;
    display: block;
    cursor: zoom-in;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.home-ai-imagegen-error {
    margin-top: 10px;
    font-size: 13px;
    color: #fca5a5;
}
/* DCL AI image viewer ala WhatsApp: pinch/wheel zoom, pan, swipe-down tutup, unduh */
#home-ai-imgview {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}
.home-ai-imgview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
}
.home-ai-imgview-stage {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    touch-action: none;
}
.home-ai-imgview-img {
    max-width: 100vw;
    max-height: 100vh;
    object-fit: contain;
    -webkit-user-drag: none;
    will-change: transform;
    touch-action: none;
}
.home-ai-imgview-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    padding-top: max(12px, env(safe-area-inset-top));
    z-index: 2;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}
.home-ai-imgview-bar .home-ai-imgview-btn {
    pointer-events: auto;
}
#home-ai-imgview.hide-chrome .home-ai-imgview-bar {
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
}
.home-ai-imgview-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: grid;
    place-items: center;
}
.home-ai-imgview-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

/* DCL AI agentic action result badge */
.home-ai-action-result {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 9px 12px;
    border-radius: 12px;
    background: rgba(96, 165, 250, 0.12);
    border: 1px solid rgba(96, 165, 250, 0.28);
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--text-primary);
}

/* === Football standings card layout (rombak total 2026-10-17) === */
.football-standings-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
}
.football-team-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
}
.football-team-card.top {
    background: rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.25);
}
.ftc-rank {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.08);
    color: #ccc;
}
.football-team-card.top .ftc-rank {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #fff;
}
.ftc-info {
    flex: 1;
    min-width: 0;
}
.ftc-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-primary);
}
.ftc-name img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
.ftc-name strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ftc-stats {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}
.ftc-points {
    text-align: right;
    min-width: 48px;
}
.ftc-pts-num {
    display: block;
    font-size: 20px;
    font-weight: 800;
    color: #a78bfa;
    line-height: 1;
}
.ftc-pts-label {
    font-size: 10px;
    color: #666;
    text-transform: uppercase;
}

