/* ==========================================
   BetWise Analytics — Premium Dashboard CSS
   Dark mode with glassmorphism & vibrant accents
   ========================================== */

/* ---- CSS Variables ---- */
:root {
    /* Background layers - BetWise Brand (Ink palette) */
    --bg-primary: #0B0F14;
    --bg-secondary: #0B0F14;
    --bg-card: #141820;
    --bg-card-hover: #1c2230;
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-modal: rgba(11, 15, 20, 0.92);

    /* Brand Primary — Signal Green */
    --accent-blue: #0CCE6B;
    --accent-blue-soft: rgba(12, 206, 107, 0.14);

    /* Functional: value tiers + states */
    --accent-green: #0CCE6B;
    --accent-green-soft: rgba(12, 206, 107, 0.14);
    --accent-red: #E0443A;
    --accent-red-soft: rgba(224, 68, 58, 0.14);
    --accent-yellow: #F5A524;
    --accent-yellow-soft: rgba(245, 165, 36, 0.14);
    --accent-purple: #af52de;
    --accent-purple-soft: rgba(175, 82, 222, 0.15);

    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --font-serif: 'Instrument Serif', 'Times New Roman', serif;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.80);
    --text-muted: rgba(255, 255, 255, 0.48);
    --text-accent: #0CCE6B;

    /* Borders */
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-active: rgba(12, 206, 107, 0.35);

    /* Shadows */
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.5);
    --shadow-glow-green: 0 0 20px rgba(12, 206, 107, 0.25);
    --shadow-glow-red: none;

    /* Layout Constraints */
    --sidebar-width: 220px;
    --topbar-height: 48px;
    --radius-sm: 8px;
    --radius-md: 11px;
    --radius-lg: 12px;
    --radius-xl: 18px;

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);

    --card-bg: #141820;
}

/* ---- Login Overlay ---- */
.login-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(59, 130, 246, 0.06) 0%, transparent 50%),
        var(--bg-primary);
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.login-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Trava scroll/overscroll enquanto a tela de login está visível
   (impede o bounce do mobile de revelar o app por baixo) */
body.login-active {
    overflow: hidden;
    overscroll-behavior: none;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
}

.login-card {
    width: 100%;
    max-width: 420px;
    margin: 0 20px;
    padding: 40px 36px;
    background: var(--bg-card);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 60px rgba(16, 185, 129, 0.06);
    text-align: start;
    animation: loginSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes loginSlideUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

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

.login-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 8px;
}

.login-brand-icon {
    display: block;
    flex-shrink: 0;
    /* color herdado do bloco acima */
}

.login-brand-wordmark {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
}

.login-brand-name {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    -webkit-text-fill-color: unset;
    background: none;
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 0;
}

.brand-dot {
    color: #0CCE6B;
}

/* Logo da marca: nunca espelha (ponto verde sempre após "BetWise") */
.brand-name,
.login-brand-name {
    direction: ltr;
    unicode-bidi: isolate;
}

.login-brand-tag {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.login-subtitle {
    font-family: var(--font-serif, 'Instrument Serif', serif);
    color: var(--text-primary);
    font-size: 26px;
    margin-bottom: 28px;
    margin-top: 12px;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field {
    text-align: start;
}

.login-field label {
    display: block;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.login-field input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 15px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.login-field input:focus {
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

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

.login-error {
    background: var(--accent-red-soft);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    text-align: start;
}

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

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--accent-green);
    border: none;
    border-radius: 980px;
    color: var(--bg-primary);
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
    letter-spacing: 0.5px;
    margin-top: 4px;
}

.login-btn:hover {
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

.login-btn:active {
    transform: translateY(0);
}

.login-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.login-footer {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    color: var(--text-muted);
    font-size: 10px;
    margin-top: 24px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-align: center;
}

.login-theme-toggle {
    position: absolute;
    top: 24px;
    inset-inline-end: 24px;
    z-index: 10;
}

/* Light mode login */
[data-theme="light"] .login-overlay {
    background:
        radial-gradient(ellipse at 30% 20%, rgba(5, 150, 105, 0.06) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(37, 99, 235, 0.04) 0%, transparent 50%),
        var(--bg-primary);
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .login-field input {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .login-btn {
    color: #ffffff;
}

/* ---- Light Theme ---- */
[data-theme="light"] {
    /* BetWise Paper palette */
    --bg-primary: #F4F1EA;
    --bg-secondary: #FBF9F4;
    --bg-card: #FBF9F4;
    --bg-card-hover: #EAE5DA;
    --bg-glass: rgba(255, 255, 255, 0.8);
    --bg-modal: rgba(11, 15, 20, 0.4);

    --accent-blue: #0CCE6B;
    --accent-blue-soft: rgba(12, 206, 107, 0.12);

    --accent-green: #0CCE6B;
    --accent-green-soft: rgba(12, 206, 107, 0.12);
    --accent-red: #E0443A;
    --accent-red-soft: rgba(224, 68, 58, 0.10);
    --accent-yellow: #F5A524;
    --accent-yellow-soft: rgba(245, 165, 36, 0.12);
    --accent-purple: #af52de;
    --accent-purple-soft: rgba(175, 82, 222, 0.1);

    --text-primary: #0B0F14;
    --text-secondary: rgba(11, 15, 20, 0.80);
    --text-muted: rgba(11, 15, 20, 0.48);
    --text-accent: #089A50;

    --border-subtle: rgba(11, 15, 20, 0.08);
    --border-active: rgba(12, 206, 107, 0.40);

    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.10);
    --shadow-glow-green: 0 0 16px rgba(12, 206, 107, 0.20);
    --shadow-glow-red: none;

    --card-bg: #FBF9F4;
}

/* Light-mode overrides for specific components */
[data-theme="light"] .sidebar {
    background: #ffffff;
    border-inline-end: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .nav-item {
    color: #475569;
}

[data-theme="light"] .nav-item:hover {
    background: rgba(5, 150, 105, 0.06);
    color: #1e293b;
}

[data-theme="light"] .nav-item.active {
    background: rgba(5, 150, 105, 0.1);
    color: #059669;
}

[data-theme="light"] .top-bar {
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .action-btn {
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .action-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #1e293b;
}

[data-theme="light"] .action-btn-primary {
    background: var(--accent-blue);
    color: #fff;
    border: none;
}

[data-theme="light"] .modal-content {
    background: #ffffff;
    border: 1.5px solid rgba(12, 206, 107, 0.55);
}

[data-theme="light"] .match-card {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .match-card:hover {
    border-color: rgba(5, 150, 105, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .search-input {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
}

[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea {
    color: #1e293b;
}

[data-theme="light"] .toast {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: #1e293b;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .ai-alt-table th {
    background: rgba(0, 0, 0, 0.04);
    color: #475569;
}

[data-theme="light"] .ai-alt-table td {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: #475569;
}

[data-theme="light"] .custom-bet-input-area textarea {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.12);
    color: #1e293b;
}

[data-theme="light"] .custom-bet-ai-msg {
    background: #f8fafc;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .custom-bet-user-msg {
    background: rgba(37, 99, 235, 0.05);
    border: 1px solid rgba(37, 99, 235, 0.12);
}

/* Theme toggle button */
.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.theme-toggle .theme-icon {
    font-size: 16px;
}

/* Sidebar footer actions row (theme + settings + support) */
.sidebar-footer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* App settings & support modals */
.app-settings-modal-content,
.app-support-modal-content {
    max-width: 480px;
}

.app-settings-title,
.app-support-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 16px 0;
    color: var(--text-primary);
}

.app-support-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

/* Settings list items */
.app-settings-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all var(--transition-normal);
    color: var(--text-primary);
    width: 100%;
    text-align: inset-inline-start;
    font-size: 0.95rem;
}

.app-settings-item:hover:not(.disabled) {
    background: var(--bg-card-hover);
    border-color: var(--accent-green);
}

.app-settings-item.disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.app-settings-item-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green);
}

.app-settings-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-settings-item-title {
    font-weight: 500;
    color: var(--text-primary);
}

.app-settings-item-sub {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.app-settings-section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin: 18px 0 8px 0;
    font-weight: 600;
}

.app-settings-account {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-settings-account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.9rem;
}

.app-settings-account-row .label {
    color: var(--text-secondary);
}

.app-settings-account-row .value {
    color: var(--text-primary);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.app-settings-logout {
    margin-top: 6px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.app-settings-logout:hover {
    background: rgba(220, 53, 69, 0.10);
    border-color: rgba(220, 53, 69, 0.45);
    color: #ff6b6b;
}

.app-settings-password-toggle {
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all var(--transition-normal);
}

.app-settings-password-toggle:hover {
    background: rgba(12, 206, 107, 0.08);
    border-color: rgba(12, 206, 107, 0.45);
    color: var(--accent-green);
}

.app-settings-password-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    background: var(--bg-card);
}

.app-settings-password-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.app-settings-password-input {
    width: 100%;
    min-height: 40px;
    padding: 9px 11px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-glass);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
}

.app-settings-password-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(12, 206, 107, 0.12);
}

.app-settings-password-submit {
    min-height: 40px;
    margin-top: 2px;
    border: none;
    border-radius: 8px;
    background: var(--accent-green);
    color: #fff;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
}

.app-settings-password-submit:disabled {
    opacity: 0.65;
    cursor: wait;
}

.app-settings-password-feedback {
    min-height: 16px;
    margin: 0;
    color: var(--accent-red);
    font-size: 0.78rem;
}

.app-settings-password-feedback[data-type="success"] {
    color: var(--accent-green);
}

/* Support form */
.app-support-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 12px 0 6px 0;
}

.app-support-input,
.app-support-textarea {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color var(--transition-normal), background var(--transition-normal);
    box-sizing: border-box;
}

.app-support-textarea {
    resize: vertical;
    min-height: 120px;
}

.app-support-input:focus,
.app-support-textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    background: var(--bg-card-hover);
}

.app-support-feedback {
    margin: 10px 0 0 0;
    min-height: 20px;
    font-size: 0.85rem;
}

/* Support uploader */
.app-support-uploader {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.app-support-attach-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--bg-glass);
    border: 1px dashed var(--border-subtle);
    border-radius: 10px;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all var(--transition-normal);
}

.app-support-attach-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-green);
    color: var(--accent-green);
}

.app-support-attach-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.app-support-files-list {
    list-style: none;
    padding: 0;
    margin: 8px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.app-support-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    font-size: 0.85rem;
}

.app-support-file-thumb {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    object-fit: cover;
    background: var(--bg-card-hover);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.app-support-file-thumb img,
.app-support-file-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.app-support-file-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text-primary);
}

.app-support-file-size {
    color: var(--text-secondary);
    font-size: 0.78rem;
    flex-shrink: 0;
}

.app-support-file-remove {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all var(--transition-normal);
    flex-shrink: 0;
}

.app-support-file-remove:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.10);
}

.app-support-feedback.success {
    color: var(--accent-green);
}

.app-support-feedback.error {
    color: #ff6b6b;
}

.app-support-submit {
    margin-top: 14px;
    width: 100%;
    padding: 12px 16px;
    background: var(--accent-green);
    border: none;
    border-radius: 10px;
    color: #0b0f14;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: opacity var(--transition-normal), transform var(--transition-normal);
}

.app-support-submit:hover:not(:disabled) {
    opacity: 0.92;
}

.app-support-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Smooth transition for theme switch */
body,
.sidebar,
.main-content,
.top-bar,
.modal-content,
.match-card,
.action-btn,
.nav-item,
input,
select,
textarea {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* ---- Reset & Base ---- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', 'Helvetica', 'Arial', sans-serif;
    letter-spacing: -0.374px;
    /* Apple signature tightening */
    line-height: 1.47;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* Subtle gradient background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.04) 0%, transparent 60%),
        radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.03) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

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

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

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

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

/* ---- Sidebar ---- */
.sidebar {
    position: fixed;
    inset-inline-start: 0;
    top: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-secondary);
    border-inline-end: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 100;
    transition: transform var(--transition-slow);
    overflow: hidden;
}

.sidebar-brand {
    padding: 24px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid var(--border-subtle);
    position: relative;
}

.sidebar-brand-icon,
.login-brand-icon {
    display: block;
    flex-shrink: 0;
    color: #ffffff;
}

[data-theme="light"] .sidebar-brand-icon,
[data-theme="light"] .login-brand-icon {
    color: #0B0F14;
}

.brand-name {
    font-family: var(--font-sans, 'Inter', sans-serif);
    font-size: 19px;
    font-weight: 700;
    color: var(--text-primary);
    -webkit-text-fill-color: unset;
    background: none;
    letter-spacing: -0.04em;
    line-height: 1;
}

.brand-wordmark {
    display: flex;
    flex-direction: column;
    gap: 1px;
    align-items: flex-start;
}

.brand-tag {
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--text-muted);
    margin-inline-start: 1px;
}

/* Plan Badge — mobile default: floating top-right, below close button (overridden in mobile @media) */
.plan-badge {
    position: absolute;
    top: 8px;
    inset-inline-end: 20px;
}

@media (min-width: 769px) {
    .sidebar-brand {
        padding-top: 36px;
    }
}

.plan-badge-label {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-weight: 500;
    font-size: 10px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: var(--radius-pill, 999px);
    border: 1px solid transparent;
    line-height: 1.4;
    transition: background var(--t-fast, 150ms ease), color var(--t-fast, 150ms ease), border-color var(--t-fast, 150ms ease);
}

/* Per-tier colors — dark theme (default) — mesma escala dos badges de força */
.plan-badge[data-tier="free"] .plan-badge-label {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.55);
    border-color: rgba(255, 255, 255, 0.14);
}

.plan-badge[data-tier="starter"] .plan-badge-label {
    background: rgba(245, 165, 36, 0.14);
    color: #F5A524;
    border-color: rgba(245, 165, 36, 0.35);
}

.plan-badge[data-tier="pro"] .plan-badge-label {
    background: rgba(0, 113, 227, 0.14);
    color: #0071E3;
    border-color: rgba(0, 113, 227, 0.35);
}

.plan-badge[data-tier="full"] .plan-badge-label {
    background: rgba(12, 206, 107, 0.14);
    color: #0CCE6B;
    border-color: rgba(12, 206, 107, 0.35);
}

.plan-badge[data-tier="admin"] .plan-badge-label {
    background: rgba(0, 0, 0, 0.80);
    color: #0CCE6B;
    border-color: #0CCE6B;
}

.plan-badge[data-tier="world_cup"] .plan-badge-label {
    background: rgba(255, 215, 0, 0.14);
    color: #FFD700;
    border-color: rgba(255, 215, 0, 0.40);
}

.plan-badge[data-tier="beta"] .plan-badge-label {
    background: rgba(236, 72, 153, 0.14);
    color: #EC4899;
    border-color: rgba(236, 72, 153, 0.35);
}

/* Light theme overrides */
[data-theme="light"] .plan-badge[data-tier="free"] .plan-badge-label {
    background: rgba(0, 0, 0, 0.06);
    color: rgba(0, 0, 0, 0.50);
    border-color: rgba(0, 0, 0, 0.14);
}

[data-theme="light"] .plan-badge[data-tier="starter"] .plan-badge-label {
    background: rgba(245, 165, 36, 0.18);
    color: #C07A0A;
    border-color: rgba(245, 165, 36, 0.40);
}

[data-theme="light"] .plan-badge[data-tier="pro"] .plan-badge-label {
    background: rgba(0, 113, 227, 0.18);
    color: #0058B3;
    border-color: rgba(0, 113, 227, 0.40);
}

[data-theme="light"] .plan-badge[data-tier="full"] .plan-badge-label {
    background: rgba(12, 206, 107, 0.18);
    color: #089A50;
    border-color: rgba(12, 206, 107, 0.40);
}

[data-theme="light"] .plan-badge[data-tier="world_cup"] .plan-badge-label {
    background: rgba(255, 215, 0, 0.20);
    color: #B8860B;
    border-color: rgba(255, 215, 0, 0.50);
}

[data-theme="light"] .plan-badge[data-tier="beta"] .plan-badge-label {
    background: rgba(236, 72, 153, 0.18);
    color: #BE185D;
    border-color: rgba(236, 72, 153, 0.40);
}

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    min-height: 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-item:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-green-soft);
    color: var(--accent-green);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    inset-inline-start: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent-green);
    border-radius: 0 2px 2px 0;
}

/* Favorites label + quota stacked vertically */
.nav-fav-label-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

@media (min-width: 769px) {
    .nav-fav-label-group {
        align-items: flex-start;
        text-align: start;
    }
}

/* Favorites quota badge in sidebar nav */
.nav-fav-quota {
    display: none;
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
}
.nav-fav-quota.nfq--limited,
.nav-fav-quota.nfq--has-items {
    display: flex;
    align-items: center;
    gap: 3px;
}
.nfq-sep {
    opacity: 0.4;
}
.nfq-t, .nfq-m {
    font-family: var(--font-mono);
}
.nfq--active {
    color: var(--text-muted);
}
.nav-fav-quota[data-tier="starter"] .nfq--active {
    color: #F5A524;
}
.nav-fav-quota[data-tier="pro"] .nfq--active {
    color: #0071E3;
}
.nav-fav-quota[data-tier="full"] .nfq--active,
.nav-fav-quota[data-tier="admin"] .nfq--active {
    color: #0CCE6B;
}
.nav-fav-quota[data-tier="world_cup"] .nfq--active {
    color: #FFD700;
}
.nfq--full {
    color: var(--accent-red);
    font-weight: 800;
}
.nfq--inf {
    font-size: 1.2em;
    line-height: 1;
    color: inherit;
}

.mt-usage-widget {
    margin: auto 12px 12px;
    padding: 9px 11px;
    border: 1px solid rgba(79, 140, 255, 0.26);
    border-radius: var(--radius-md);
    background: rgba(79, 140, 255, 0.07);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.mt-usage-row {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.mt-usage-icon {
    width: 13px;
    height: 13px;
    color: #4f8cff;
    flex-shrink: 0;
}

.mt-usage-label {
    min-width: 0;
    flex: 1;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    line-height: 1;
    text-transform: uppercase;
    white-space: nowrap;
}

.mt-usage-count {
    color: #4f8cff;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.mt-usage-track {
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(79, 140, 255, 0.16);
    overflow: hidden;
}

.mt-usage-bar {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #4f8cff;
    transition: width var(--transition-normal), background var(--transition-normal);
}

.mt-usage-widget.mt-usage-widget--full {
    border-color: rgba(224, 68, 58, 0.35);
    background: rgba(224, 68, 58, 0.09);
}

.mt-usage-widget.mt-usage-widget--full .mt-usage-icon,
.mt-usage-widget.mt-usage-widget--full .mt-usage-count {
    color: var(--accent-red);
}

.mt-usage-widget.mt-usage-widget--full .mt-usage-bar {
    background: var(--accent-red);
}

.nav-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.sidebar-actions {
    padding: 16px 12px;
    display: none;
    flex-direction: column;
    gap: 8px;
    border-top: 1px solid var(--border-subtle);
    margin-top: auto;
}

.sidebar-actions.is-admin-visible {
    display: flex;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid var(--border-subtle);
    border-radius: 980px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
}

.action-btn:hover {
    background: var(--bg-glass);
    border-color: var(--border-active);
    color: var(--text-primary);
}

.action-btn-primary {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.action-btn-primary:hover {
    background: rgba(12, 206, 107, 0.22);
    box-shadow: var(--shadow-glow-green);
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.action-icon {
    font-size: 16px;
}

.sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

.api-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-yellow);
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--accent-green);
    animation: none;
}

.status-dot.updating {
    background: var(--accent-yellow);
}

.status-dot.offline {
    background: var(--accent-red);
    animation: none;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* ---- Logout Button (icon, in sidebar-footer-actions row) ---- */
#btn-logout {
    border-color: rgba(239, 68, 68, 0.4);
    color: var(--accent-red);
}

#btn-logout:hover {
    background: var(--accent-red);
    border-color: var(--accent-red);
    color: #fff;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-inline-start: var(--sidebar-width);
    min-height: 100vh;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
}

/* ---- Top Bar ---- */
.top-bar {
    position: sticky;
    top: 0;
    height: var(--topbar-height);
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 50;
}

.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
}

.page-title {
    font-size: 18px;
    font-weight: 700;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 8px 16px;
    width: 300px;
    transition: border-color var(--transition-fast);
}

.search-box:focus-within {
    border-color: var(--accent-green);
}

.search-icon {
    font-size: 14px;
}

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

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

.search-box--locked {
    position: relative;
    overflow: hidden;
    border-color: rgba(12, 206, 107, 0.34);
    cursor: pointer;
}

.search-box--locked > svg,
.search-box--locked input,
.search-box--locked #search-clear-btn {
    filter: blur(2px) opacity(0.55);
    pointer-events: none;
    user-select: none;
}

.search-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0CCE6B;
    pointer-events: none;
}

.search-lock-overlay svg {
    width: 18px;
    height: 18px;
    padding: 4px;
    box-sizing: content-box;
    border-radius: 50%;
    border: 1.5px solid rgba(12, 206, 107, 0.42);
    background: rgba(12, 206, 107, 0.14);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px rgba(12,206,107,0.55)) drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}

[data-theme="light"] .search-lock-overlay {
    color: #059940;
}

[data-theme="light"] .search-lock-overlay svg {
    border-color: rgba(5,153,64,0.5);
    background: rgba(5,153,64,0.14);
    filter: drop-shadow(0 0 4px rgba(5,153,64,0.45)) drop-shadow(0 1px 3px rgba(0,0,0,0.22));
}

.favorite-trend-btn.favorite-btn--locked {
    position: relative;
}

.favorite-btn--locked {
    overflow: visible;
}

.favorite-btn--locked > svg {
    filter: blur(1.7px) opacity(0.48) !important;
    pointer-events: none;
    user-select: none;
}

.favorite-lock-overlay {
    position: absolute;
    inset: -6px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0CCE6B;
    pointer-events: none;
}

.favorite-lock-overlay svg {
    width: 15px;
    height: 15px;
    padding: 4px;
    box-sizing: content-box;
    border-radius: 50%;
    border: 1.5px solid rgba(12, 206, 107, 0.42);
    background: rgba(12, 206, 107, 0.16);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px rgba(12,206,107,0.55)) drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}

[data-theme="light"] .favorite-lock-overlay {
    color: #059940;
}

[data-theme="light"] .favorite-lock-overlay svg {
    border-color: rgba(5,153,64,0.5);
    background: rgba(5,153,64,0.16);
    filter: drop-shadow(0 0 4px rgba(5,153,64,0.45)) drop-shadow(0 1px 3px rgba(0,0,0,0.22));
}

/* ---- Views ---- */
.view {
    display: none;
    padding: 28px 32px;
    animation: fadeIn 0.3s ease;
}

.view.active {
    display: block;
}

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

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

/* ---- Stats Row ---- */
.stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    backdrop-filter: blur(10px);
    transition: all var(--transition-normal);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-green-soft);
    border-radius: var(--radius-md);
    color: var(--accent-green);
    flex-shrink: 0;
}

.stat-icon svg {
    width: 30px;
    height: 30px;
}

.stat-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 32px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 500;
}

/* ---- Content Sections ---- */
.content-section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h3 {
    font-size: 22px;
    font-weight: 700;
}

.section-header h3 svg {
    width: 32px;
    height: 32px;
}

.see-all-link {
    font-size: 13px;
    color: var(--accent-green);
    text-decoration: none;
    font-weight: 500;
    transition: opacity var(--transition-fast);
}

.see-all-link:hover {
    opacity: 0.8;
}

/* ---- Value Bet Cards ---- */
.value-bets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 16px;
}

.vb-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.vb-card::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    height: 3px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.vb-card.strong-value::before {
    background: linear-gradient(90deg, var(--accent-green), #34d399);
}

.vb-card.value::before {
    background: linear-gradient(90deg, var(--accent-yellow), #fbbf24);
}

.vb-card.no-value::before {
    background: linear-gradient(90deg, var(--accent-red), #f87171);
}

.vb-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-active);
}

.vb-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.vb-match-label {
    font-size: 14px;
    font-weight: 600;
}

.vb-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
}

.vb-badge.strong-value {
    background: rgba(16, 185, 129, 0.12) !important;
    color: var(--accent-green) !important;
    border: 1px solid var(--accent-green);
}

.vb-badge.value {
    background: rgba(245, 158, 11, 0.12) !important;
    color: var(--accent-yellow) !important;
    border: 1px solid var(--accent-yellow);
}

.vb-badge.no-value {
    background: rgba(239, 68, 68, 0.12) !important;
    color: var(--accent-red) !important;
    border: 1px solid var(--accent-red);
}

/* Trend strength badge colors — stroke outline matching the 3rd print */
.vb-badge.green {
    background: rgba(16, 185, 129, 0.12) !important;
    color: var(--accent-green) !important;
    border: 1px solid var(--accent-green);
}

.vb-badge.blue {
    background: rgba(59, 130, 246, 0.12) !important;
    color: #3b82f6 !important;
    border: 1px solid #3b82f6;
}

.vb-badge.yellow {
    background: rgba(245, 158, 11, 0.12) !important;
    color: var(--accent-yellow) !important;
    border: 1px solid var(--accent-yellow);
}

.vb-badge.gray {
    background: rgba(148, 163, 184, 0.12) !important;
    color: var(--text-secondary) !important;
    border: 1px solid var(--text-secondary);
}

/* Trend card: isolated strength line on top-left */
.trend-strength-line {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
}

.vb-market {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.vb-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.vb-metric {
    text-align: center;
}

.vb-metric-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.vb-metric-value.green {
    color: var(--accent-green);
}

.vb-metric-value.yellow {
    color: var(--accent-yellow);
}

.vb-metric-value.red {
    color: var(--accent-red);
}

.vb-metric-value.blue {
    color: var(--accent-blue);
}

.vb-metric-label {
    display: block;
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

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

.vb-action-btn {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.vb-action-btn:hover {
    background: var(--bg-glass);
    color: var(--text-primary);
}

.vb-action-btn.add-combined {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.vb-action-btn.add-combined:hover {
    background: var(--accent-purple-soft);
}

/* ---- Match Cards ---- */
.matches-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
}

.match-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    overflow: hidden;
    transition: all var(--transition-normal);
    cursor: pointer;
    min-height: 120px;
}

@media (min-width: 769px) {
    .match-card {
        min-height: 180px;
        padding: 24px;
        align-content: space-between;
        /* Distribui para usar o espaço vertical */
    }
}

.match-card:hover {
    background: var(--bg-card-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.match-date {
    text-align: center;
    min-width: 56px;
    flex-shrink: 0;
}

.match-date-day {
    font-size: 18px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--accent-green);
}

.match-date-month {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.match-teams {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 14px;
}

.match-team {
    font-weight: 500;
    white-space: normal;
    line-height: 1.3;
}

.match-team.home {
    font-weight: 700;
}

.match-vs {
    font-size: 11px;
    color: var(--text-muted);
}

.match-round {
    font-size: 11px;
    color: var(--text-muted);
    min-width: auto;
    text-align: start;
}

.match-score {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    min-width: 50px;
    text-align: center;
}

.match-status {
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 600;
    min-width: auto;
    flex-shrink: 0;
    text-align: center;
}

.match-status.scheduled {
    background: var(--accent-blue-soft);
    color: var(--accent-blue);
}

.match-status.finished {
    background: var(--accent-red-soft);
    color: var(--accent-red);
}

.match-status.live {
    background: var(--accent-purple-soft);
    color: var(--accent-purple);
    animation: pulse 1.5s infinite;
}

/* ---- Teams Grid ---- */
.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}

.team-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    transition: all var(--transition-normal);
    cursor: pointer;
}

.team-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-green);
}

.team-name {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 4px;
}

.team-short {
    font-size: 12px;
    color: var(--text-muted);
}

/* ---- Filters Bar ---- */
.filters-bar {
    display: flex;
    align-items: flex-end;
    gap: 24px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.filter-group label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.filter-group input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    outline: none;
}

.filter-group input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--accent-green);
    cursor: pointer;
    border: 2px solid var(--bg-primary);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.3);
}

.filter-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-green);
}

.filter-date-input {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 6px 10px;
    font-family: inherit;
    font-size: 13px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.filter-date-input:focus {
    border-color: var(--accent-green);
}

.filter-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1) brightness(0.7);
    cursor: pointer;
}

.filter-apply-btn {
    padding: 10px 24px;
    background: var(--accent-green);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.filter-apply-btn:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-green);
}

/* ---- Glossary ---- */
.glossary-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    font-family: inherit;
    white-space: nowrap;
}

.glossary-btn:hover {
    border-color: var(--accent-green);
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.08);
}

.glossary-modal-content {
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
}

.glossary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 14px;
}

.glossary-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-inline-start: 3px solid var(--accent-green);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    transition: border-color var(--transition-fast);
}

.glossary-item:hover {
    border-color: var(--accent-green);
}

.glossary-item:last-child {
    border-inline-start-color: #f59e0b;
}

.glossary-item h4 {
    margin: 0 0 6px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.glossary-item p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-secondary);
}

.glossary-item strong {
    color: var(--accent-green);
    font-weight: 600;
}

/* ---- AI Insights ---- */
.ai-modal-content {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.ai-loading {
    text-align: center;
    padding: 60px 20px;
}

.ai-loading p {
    margin-top: 16px;
    font-size: 15px;
}

.ai-error {
    text-align: center;
    padding: 40px;
    color: #f87171;
    font-size: 14px;
}

.ai-report-header {
    margin-bottom: 16px;
}

.ai-report-header h2 {
    font-size: 18px;
    margin: 0 0 10px 0;
}

.ai-confidence {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.ai-confidence-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.ai-confidence-badge.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.ai-confidence-badge.yellow {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.ai-confidence-badge.red {
    background: rgba(248, 113, 113, 0.15);
    color: #f87171;
}

.ai-model-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-family: 'JetBrains Mono', monospace;
}

.ai-summary {
    padding: 14px 16px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-inline-start: 3px solid var(--accent-blue);
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.ai-section {
    margin-bottom: 16px;
}

.ai-section h4 {
    font-size: 14px;
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.ai-insight-item,
.ai-risk-item {
    padding: 10px 14px;
    margin-bottom: 6px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}

.ai-insight-item {
    border-inline-start: 3px solid var(--accent-green);
}

.ai-risk-item {
    border-inline-start: 3px solid #fbbf24;
}

.ai-prob-compare {
    margin-bottom: 16px;
}

.ai-prob-compare h4 {
    font-size: 14px;
    margin: 0 0 10px 0;
}

.ai-prob-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.ai-prob-table th,
.ai-prob-table td {
    padding: 8px 12px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle);
}

.ai-prob-table th {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-prob-table td:first-child {
    text-align: start;
    color: var(--text-primary);
}

.ai-prob-table .text-green {
    color: var(--accent-green);
}

.ai-prob-table .text-red {
    color: #f87171;
}

.ai-best-bet {
    margin-bottom: 16px;
}

.ai-best-bet h4 {
    font-size: 14px;
    margin: 0 0 10px 0;
}

.ai-best-bet-content {
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(16, 185, 129, 0.1));
    border: 1px solid var(--accent-purple);
    border-radius: var(--radius-md);
    font-size: 13px;
}

.ai-best-bet-market {
    display: inline-block;
    padding: 3px 10px;
    background: var(--accent-purple);
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    color: white;
    margin-bottom: 8px;
}

.ai-best-bet-content p {
    margin: 6px 0;
    color: var(--text-secondary);
}

.ai-best-bet-reason {
    font-style: italic;
    color: var(--text-muted) !important;
}

.vb-action-btn.ai-btn {
    background: rgba(139, 92, 246, 0.1);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

.vb-action-btn.ai-btn:hover {
    background: rgba(139, 92, 246, 0.2);
}

.vb-action-btn--soon {
    position: relative;
    overflow: hidden;
    cursor: pointer;
    min-height: 32px;
}

.vb-action-btn--soon:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
}

.vb-action-btn--soon > svg,
.vb-action-btn--soon > span:not(.soon-lock-overlay) {
    filter: blur(1.1px) opacity(0.74);
    pointer-events: none;
    user-select: none;
}

.vb-action-btn--soon .soon-lock-overlay {
    background: rgba(88, 28, 135, 0.22);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}

.vb-action-btn--soon .soon-lock-overlay--icon-only svg {
    width: 16px;
    height: 16px;
    padding: 4px;
    box-sizing: content-box;
    border-radius: 50%;
    color: #ffffff;
    background: rgba(88, 28, 135, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.58);
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.32));
}

.vb-action-btn.match-trends-card-btn {
    background: rgba(79, 140, 255, 0.1);
    border-color: #4f8cff;
    color: #4f8cff;
}

.vb-action-btn.match-trends-card-btn:hover {
    background: rgba(79, 140, 255, 0.2);
}

/* ---- Settings Modal ---- */
.settings-modal-content {
    max-width: 480px;
}

.settings-group {
    margin-bottom: 16px;
}

.settings-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.settings-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition-fast);
    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 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

.settings-select:focus {
    outline: none;
    border-color: var(--accent-green);
}

.settings-hint {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}


.combined-builder {
    max-width: 700px;
}

.combined-selections {
    margin-bottom: 20px;
}

.combined-selection-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    transition: all var(--transition-fast);
}

.combined-selection-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.combined-selection-match {
    font-size: 14px;
    font-weight: 600;
}

.combined-selection-bet {
    font-size: 12px;
    color: var(--text-secondary);
}

.combined-selection-odds {
    display: flex;
    align-items: center;
    gap: 12px;
}

.combined-selection-odd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-blue);
}

.combined-selection-remove {
    background: none;
    border: none;
    color: var(--accent-red);
    cursor: pointer;
    font-size: 18px;
    padding: 4px;
    transition: opacity var(--transition-fast);
}

.combined-selection-remove:hover {
    opacity: 0.7;
}

.combined-summary {
    background: var(--bg-card);
    border: 1px solid var(--border-active);
    border-radius: var(--radius-lg);
    padding: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
}

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

.summary-value {
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.summary-value.highlight {
    color: var(--accent-green);
    font-size: 18px;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 55vh;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 48px;
    display: block;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 14px;
}

.empty-hint {
    font-size: 12px;
    margin-top: 8px;
}

/* ---- Modal ---- */
.modal {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.modal.hidden {
    display: none;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: var(--bg-modal);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--bg-secondary);
    border: 1.5px solid rgba(12, 206, 107, 0.55);
    border-radius: var(--radius-xl);
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 28px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }

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

.modal-close {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    background: var(--bg-hover);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
    z-index: 1101;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
    color: #ef4444;
    transform: scale(1.12);
}

/* When modal-close shows back text (🔙 Voltar), adapt to pill shape */
.modal-close.is-back {
    width: auto;
    border-radius: 20px;
    padding: 0 14px;
    font-size: 13px;
    font-weight: 600;
    gap: 6px;
}

.modal-close.is-back:hover {
    background: var(--accent-blue-soft);
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: none;
}

/* Generic modal overlay (fullscreen backdrop) — for upsell gate */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* League selection modal (Starter/Pro onboarding) */
.lsm-overlay {
    padding: 24px;
    background: rgba(0, 0, 0, 0.64);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.lsm-modal {
    position: relative;
    width: min(920px, calc(100vw - 40px));
    max-height: min(760px, calc(100vh - 48px));
    padding: 28px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    border-radius: var(--radius-xl);
    border: 1.5px solid rgba(12, 206, 107, 0.55);
    background: var(--bg-card);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

.lsm-close-btn {
    position: absolute;
    top: 16px;
    inset-inline-end: 16px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    transition: color var(--transition-fast), border-color var(--transition-fast), background var(--transition-fast);
}

.lsm-close-btn:hover {
    color: var(--accent-green);
    border-color: rgba(12, 206, 107, 0.42);
    background: rgba(12, 206, 107, 0.10);
}

.lsm-header {
    padding-inline-end: 42px;
}

.lsm-kicker {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 9px;
    margin-bottom: 10px;
    border-radius: 999px;
    border: 1px solid rgba(12, 206, 107, 0.38);
    background: rgba(12, 206, 107, 0.12);
    color: var(--accent-green);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
}
.lsm-kicker[data-tier="starter"] {
    border-color: rgba(245, 165, 36, 0.38);
    background: rgba(245, 165, 36, 0.12);
    color: #F5A524;
}
.lsm-kicker[data-tier="pro"] {
    border-color: rgba(0, 113, 227, 0.38);
    background: rgba(0, 113, 227, 0.12);
    color: #0071E3;
}
.lsm-kicker[data-tier="full"] {
    border-color: rgba(12, 206, 107, 0.38);
    background: rgba(12, 206, 107, 0.12);
    color: var(--accent-green);
}
.lsm-kicker[data-tier="world_cup"] {
    border-color: rgba(255, 215, 0, 0.38);
    background: rgba(255, 215, 0, 0.12);
    color: #FFD700;
}

.lsm-title {
    margin: 0;
    color: var(--text-primary);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
}

.lsm-subtitle {
    max-width: 680px;
    margin: 8px 0 0;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

.lsm-bonus-note {
    display: inline-flex;
    align-items: center;
    margin-inline-start: 4px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(245, 165, 36, 0.36);
    background: var(--accent-yellow-soft);
    color: var(--accent-yellow);
    font-weight: 750;
}

.lsm-status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-primary);
}

.lsm-slot-counter {
    flex: 0 0 auto;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lsm-slot--full {
    color: var(--accent-green);
}

.lsm-monthly-note,
.lsm-monthly-lock {
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.4;
    text-align: end;
}

.lsm-monthly-lock {
    color: var(--accent-yellow);
}

.lsm-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 10px;
    overflow-y: auto;
    padding: 2px 2px 4px;
}

.lsm-item {
    position: relative;
    min-height: 64px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 24px;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: border-color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.lsm-item:hover {
    border-color: rgba(12, 206, 107, 0.34);
    background: rgba(12, 206, 107, 0.07);
    transform: translateY(-1px);
}

.lsm-item.is-selected {
    border-color: rgba(12, 206, 107, 0.72);
    background: rgba(12, 206, 107, 0.14);
    box-shadow: inset 0 0 0 1px rgba(12, 206, 107, 0.24);
}

.lsm-item--bonus,
.lsm-item--bonus:hover {
    border-color: rgba(245, 165, 36, 0.72);
    background: var(--accent-yellow-soft);
    box-shadow: inset 0 0 0 1px rgba(245, 165, 36, 0.22);
    transform: none;
}

.lsm-item--locked {
    cursor: not-allowed;
    opacity: 0.58;
}

.lsm-item--locked:hover {
    transform: none;
    background: var(--bg-primary);
    border-color: var(--border-subtle);
}

.lsm-check {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.lsm-logo-wrap {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.lsm-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.lsm-icon {
    font-size: 22px;
    line-height: 1;
}

.lsm-name {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 650;
    line-height: 1.25;
}

.lsm-bonus-badge {
    display: inline-flex;
    align-items: center;
    height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid rgba(245, 165, 36, 0.46);
    background: rgba(245, 165, 36, 0.16);
    color: var(--accent-yellow);
    font-family: var(--font-mono);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.lsm-checkmark {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border-subtle);
    color: transparent;
    background: transparent;
}

.lsm-checkmark svg {
    width: 14px;
    height: 14px;
}

.lsm-item.is-selected .lsm-checkmark {
    border-color: var(--accent-green);
    background: var(--accent-green);
    color: #063D1F;
}

.lsm-item--bonus.is-selected .lsm-checkmark {
    border-color: var(--accent-yellow);
    background: var(--accent-yellow);
    color: #3D2400;
}

.lsm-lock {
    position: absolute;
    inset-inline-end: 10px;
    bottom: 7px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 800;
}

.lsm-error {
    min-height: 18px;
    margin: -4px 0 0;
    color: var(--accent-red);
    font-size: 12px;
    font-weight: 600;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.lsm-error.is-visible {
    opacity: 1;
}

.lsm-confirm-panel {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid rgba(245, 165, 36, 0.40);
    background: var(--accent-yellow-soft);
}

.lsm-confirm-title {
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 800;
    line-height: 1.3;
}

.lsm-confirm-text {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.lsm-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.lsm-save-btn,
.lsm-cancel-btn {
    min-height: 40px;
    padding: 0 18px;
    border-radius: 999px;
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    cursor: pointer;
    transition: opacity var(--transition-fast), transform var(--transition-fast), border-color var(--transition-fast);
}

.lsm-save-btn {
    border: 1px solid var(--accent-green);
    background: var(--accent-green);
    color: #063D1F;
}

.lsm-cancel-btn {
    border: 1px solid var(--border-subtle);
    background: transparent;
    color: var(--text-secondary);
}

.lsm-save-btn:hover:not(:disabled),
.lsm-cancel-btn:hover {
    transform: translateY(-1px);
}

.lsm-save-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
}

.lsm-review-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

[data-theme="light"] .lsm-modal {
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(11, 15, 20, 0.18);
}

[data-theme="light"] .lsm-status-row,
[data-theme="light"] .lsm-item {
    background: #FBF9F4;
}

[data-theme="light"] .lsm-item:hover {
    background: rgba(12, 206, 107, 0.08);
}

[data-theme="light"] .lsm-item.is-selected {
    background: rgba(12, 206, 107, 0.13);
}

[data-theme="light"] .lsm-item--bonus,
[data-theme="light"] .lsm-item--bonus:hover {
    background: rgba(245, 165, 36, 0.13);
}

@media (max-width: 720px) {
    .lsm-overlay {
        padding: 12px;
        align-items: stretch;
    }

    .lsm-modal {
        width: 100%;
        max-height: calc(100vh - 24px);
        padding: 22px 18px;
    }

    .lsm-status-row,
    .lsm-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .lsm-monthly-note,
    .lsm-monthly-lock {
        text-align: start;
    }

    .lsm-list {
        grid-template-columns: 1fr;
    }

    .lsm-save-btn,
    .lsm-cancel-btn {
        width: 100%;
    }
}

/* Upsell Modal (Free tier gate) */
.upsell-modal-content {
    max-width: 340px;
    width: calc(100% - 32px);
    padding: 40px 28px 28px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    border: 1.5px solid rgba(12, 206, 107, 0.55);
}

.upsell-lock-wrap {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(12, 206, 107, 0.12);
    border: 1px solid rgba(12, 206, 107, 0.30);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #0CCE6B;
}

.upsell-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 10px;
    line-height: 1.3;
}

.upsell-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 28px;
    line-height: 1.6;
}

.upsell-cta-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #0CCE6B;
    color: #063D1F;
    border: none;
    border-radius: var(--radius-pill, 999px);
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-weight: 600;
    font-size: 13px;
    letter-spacing: 0.06em;
    padding: 10px 24px;
    cursor: pointer;
    transition: opacity 150ms ease, transform 150ms ease;
    margin-bottom: 14px;
    width: 100%;
}

.upsell-cta-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
}

.upsell-dismiss-link {
    font-size: 13px;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 150ms ease;
}

.upsell-dismiss-link:hover {
    color: var(--text-secondary);
}

.ai-coming-soon-modal {
    background: rgba(24, 12, 42, 0.66);
    backdrop-filter: blur(5px) saturate(130%);
    -webkit-backdrop-filter: blur(5px) saturate(130%);
}

.ai-coming-soon-modal .upsell-modal-content {
    border-color: rgba(175, 82, 222, 0.72);
    background:
        radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.22), transparent 58%),
        linear-gradient(180deg, rgba(34, 18, 54, 0.98), rgba(18, 14, 28, 0.98));
    box-shadow:
        0 24px 70px rgba(88, 28, 135, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.ai-coming-soon-modal .upsell-lock-wrap {
    color: #ffffff;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-color: rgba(255, 255, 255, 0.28);
    box-shadow: 0 16px 36px rgba(139, 92, 246, 0.38);
}

.ai-coming-soon-modal .upsell-title {
    color: #f7f2ff;
}

.ai-coming-soon-modal .upsell-desc {
    color: rgba(247, 242, 255, 0.72);
}

.ai-coming-soon-modal .upsell-cta-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(139, 92, 246, 0.30);
}

.ai-coming-soon-modal .upsell-cta-btn:hover {
    opacity: 1;
    box-shadow: 0 16px 34px rgba(139, 92, 246, 0.42);
}

[data-theme="light"] .ai-coming-soon-modal {
    background: rgba(36, 18, 60, 0.34);
}

[data-theme="light"] .ai-coming-soon-modal .upsell-modal-content {
    background:
        radial-gradient(circle at 50% 0%, rgba(139, 92, 246, 0.18), transparent 60%),
        linear-gradient(180deg, #fbf8ff, #f3ecff);
    border-color: rgba(139, 92, 246, 0.58);
    box-shadow:
        0 24px 70px rgba(88, 28, 135, 0.22),
        0 0 0 1px rgba(88, 28, 135, 0.06) inset;
}

[data-theme="light"] .ai-coming-soon-modal .upsell-title {
    color: #25123d;
}

[data-theme="light"] .ai-coming-soon-modal .upsell-desc {
    color: rgba(37, 18, 61, 0.66);
}

/* Fix: centra o ícone de cadeado dentro do modal-body (block context) */
.upsell-lock-wrap {
    margin-inline-start: auto;
    margin-inline-end: auto;
}

/* Match Trends Gating Overlay (Free/Starter tier paywall teaser) */
#match-trends-gating-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(10, 14, 26, 0.78);
    backdrop-filter: blur(2px);
    border-radius: var(--radius-xl, 16px);
    z-index: 10;
    padding: 40px 28px;
    text-align: center;
}

#match-trends-gating-overlay .upsell-title {
    font-size: 17px;
}

#match-trends-gating-overlay .upsell-desc {
    max-width: 300px;
}

#match-trends-gating-overlay .upsell-cta-btn,
#match-trends-gating-overlay .upsell-dismiss-link {
    width: auto;
    min-width: 200px;
}

[data-theme="light"] #match-trends-gating-overlay {
    background: rgba(251, 249, 244, 0.86);
    backdrop-filter: blur(3px) saturate(120%);
    -webkit-backdrop-filter: blur(3px) saturate(120%);
    box-shadow: inset 0 0 0 1px rgba(11, 15, 20, 0.08);
}

[data-theme="light"] #match-trends-gating-overlay .upsell-lock-wrap {
    background: rgba(12, 206, 107, 0.14);
    border-color: rgba(12, 206, 107, 0.34);
    box-shadow: 0 10px 26px rgba(12, 206, 107, 0.18);
}

[data-theme="light"] #match-trends-gating-overlay .upsell-title {
    color: #0B0F14;
}

[data-theme="light"] #match-trends-gating-overlay .upsell-desc,
[data-theme="light"] #match-trends-gating-overlay .upsell-dismiss-link {
    color: rgba(11, 15, 20, 0.62);
}

[data-theme="light"] #match-trends-gating-overlay .upsell-dismiss-link:hover {
    color: rgba(11, 15, 20, 0.84);
}

/* Locked nav items (Free tier) */
.nav-item--locked {
    position: relative;
    overflow: hidden;
}

.nav-item--locked .nav-icon,
.nav-item--locked .nav-label {
    filter: blur(2.5px);
    user-select: none;
    pointer-events: none;
}

.nav-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0CCE6B;
    pointer-events: none;
}

.nav-lock-overlay svg {
    filter: drop-shadow(0 0 6px rgba(12,206,107,0.55)) drop-shadow(0 1px 2px rgba(0,0,0,0.6));
    stroke-width: 2.5;
    width: 18px;
    height: 18px;
    background: rgba(12,206,107,0.12);
    border-radius: 50%;
    padding: 4px;
    box-sizing: content-box;
    border: 1.5px solid rgba(12,206,107,0.4);
}

/* Light mode: lock icons need stronger contrast against light bg */
[data-theme="light"] .nav-lock-overlay {
    color: #059940;
}
[data-theme="light"] .nav-lock-overlay svg {
    filter: drop-shadow(0 0 4px rgba(5,153,64,0.45)) drop-shadow(0 1px 3px rgba(0,0,0,0.25));
    stroke-width: 2.5;
    background: rgba(5,153,64,0.14);
    border-color: rgba(5,153,64,0.5);
}
[data-theme="light"] .nav-item--locked .nav-icon,
[data-theme="light"] .nav-item--locked .nav-label {
    filter: blur(2px) opacity(0.5);
}

/* Locked top-bar competition filter */
.competition-filter--locked {
    position: relative;
}

.competition-filter--locked .comp-dropdown-btn {
    position: relative;
    overflow: hidden;
    border-color: rgba(12, 206, 107, 0.34);
}

.competition-filter--locked .comp-dropdown-btn .comp-dd-icon,
.competition-filter--locked .comp-dropdown-btn .comp-dd-label,
.competition-filter--locked .comp-dropdown-btn .comp-dd-arrow {
    filter: blur(2px) opacity(0.55);
    pointer-events: none;
    user-select: none;
}

/* Period dropdown locked: opacity only — click is intercepted by the JS handler */
.period-dd--locked .comp-dropdown-btn {
    opacity: 0.4;
    cursor: not-allowed;
}

/* "Filtrar Datas" button locked state — exclude the lock overlay span from blur */
.filter-dates-btn--locked > svg,
.filter-dates-btn--locked > span:not(.date-btn-lock-overlay) {
    filter: blur(2px) opacity(0.45);
    pointer-events: none;
    user-select: none;
}
.date-btn-lock-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    pointer-events: none;
    cursor: not-allowed;
}
.date-btn-lock-overlay svg {
    width: 16px;
    height: 16px;
    padding: 3px;
    box-sizing: content-box;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.18);
    stroke-width: 2.5;
    filter: drop-shadow(0 1px 3px rgba(0,0,0,0.5));
}

.competition-filter-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0CCE6B;
    pointer-events: none;
}

.competition-filter-lock-overlay svg {
    width: 18px;
    height: 18px;
    padding: 4px;
    box-sizing: content-box;
    border-radius: 50%;
    border: 1.5px solid rgba(12, 206, 107, 0.42);
    background: rgba(12, 206, 107, 0.14);
    stroke-width: 2.5;
    filter: drop-shadow(0 0 6px rgba(12,206,107,0.55)) drop-shadow(0 1px 2px rgba(0,0,0,0.45));
}

[data-theme="light"] .competition-filter-lock-overlay {
    color: #059940;
}

[data-theme="light"] .competition-filter-lock-overlay svg {
    border-color: rgba(5,153,64,0.5);
    background: rgba(5,153,64,0.14);
    filter: drop-shadow(0 0 4px rgba(5,153,64,0.45)) drop-shadow(0 1px 3px rgba(0,0,0,0.22));
}

/* Language dropdown: theme-aware colors (inline colors removed from HTML) */
#lang-selector {
    background: #ffffff;
    color: #1a1a1a;
}
#lang-name { color: #1a1a1a; }
#lang-btn { appearance: none; -webkit-appearance: none; }
#lang-code, #lang-chevron, .lang-opt-code { color: #6b7280; }
#lang-menu { background: #ffffff; }
#lang-menu button[data-lang] { color: #1a1a1a; background: transparent; appearance: none; -webkit-appearance: none; }
#lang-menu button[data-lang]:hover { background: rgba(12,206,107,0.08); }

[data-theme="dark"] #lang-selector {
    background: var(--bg-secondary);
    color: var(--text-primary);
}
[data-theme="dark"] #lang-name { color: var(--text-primary); }
[data-theme="dark"] #lang-code,
[data-theme="dark"] #lang-chevron,
[data-theme="dark"] .lang-opt-code { color: var(--text-muted); }
[data-theme="dark"] #lang-menu { background: var(--bg-secondary); }
[data-theme="dark"] #lang-menu button[data-lang] { color: var(--text-primary); }
[data-theme="dark"] #lang-menu button[data-lang]:hover { background: rgba(12,206,107,0.08); }

/* Clickable team in match detail */
.clickable-team {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 8px;
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.clickable-team:hover {
    background: rgba(79, 140, 255, 0.12);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(79, 140, 255, 0.15);
}

.clickable-team:hover h2 {
    color: var(--accent);
}

/* ---- Loading Overlay ---- */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

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

.global-loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 16px;
    width: 100%;
    min-height: 50vh;
    flex: 1;
    grid-column: 1 / -1;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-subtle);
    border-top: 3px solid var(--accent-green);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ---- Toast Notifications ---- */
.toast-container {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body:has(.fab-clear-favorites) .toast-container {
    bottom: 96px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    animation: slideIn 0.3s ease;
    max-width: 360px;
    box-shadow: var(--shadow-md);
}

.toast.success {
    background: var(--accent-green-soft);
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
}

.toast.error {
    background: var(--accent-red-soft);
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
}

.toast.info {
    background: var(--accent-blue-soft);
    border: 1px solid var(--accent-blue);
    color: var(--accent-blue);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

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

/* ---- Planner Match List (Compact Dropdown) ---- */
.planner-match-scroll-area {
    max-height: 340px;
    overflow-y: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    background: var(--bg-color);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* Custom Scrollbar for the list */
.planner-match-scroll-area::-webkit-scrollbar {
    width: 6px;
}

.planner-match-scroll-area::-webkit-scrollbar-track {
    background: transparent;
}

.planner-match-scroll-area::-webkit-scrollbar-thumb {
    background-color: var(--border-subtle);
    border-radius: 10px;
}

/* Compact single-line match item */
.planner-match-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.875rem;
    user-select: none;
}

.planner-match-item:hover {
    background: var(--surface-light);
    border-color: var(--border-subtle);
}

.planner-match-item.selected {
    background: linear-gradient(145deg, rgba(5, 150, 105, 0.08) 0%, rgba(5, 150, 105, 0.02) 100%);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.planner-match-item .pm-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 42px;
    font-size: 0.7rem;
    line-height: 1.3;
    color: var(--text-secondary);
    font-weight: 600;
}

.planner-match-item .pm-date .pm-day {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-color);
}

.planner-match-item .pm-teams {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    font-weight: 500;
    color: var(--text-primary);
}

.planner-match-item .pm-teams img {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.planner-match-item .pm-teams .pm-vs {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 400;
    margin: 0 2px;
}

.planner-match-item .pm-teams .pm-team-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.planner-match-item .pm-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    margin-inline-start: auto;
}

.planner-match-item .pm-round {
    font-size: 0.7rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .value-bets-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-inline-start: 0;
    }

    .menu-toggle {
        display: block;
    }

    .stats-row {
        grid-template-columns: 1fr;
    }

    .search-box {
        width: 200px;
    }

    .top-bar {
        padding: 0 16px;
    }

    .view {
        padding: 16px;
    }

    .filters-bar {
        flex-direction: column;
    }

    .teams-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ---- Utility Classes ---- */
body.modal-open {
    overflow: hidden;
    touch-action: none;
}

.hidden {
    display: none !important;
}

.mono {
    font-family: 'JetBrains Mono', monospace;
}

.text-green {
    color: var(--accent-green);
}

.text-red {
    color: var(--accent-red);
}

.text-yellow {
    color: var(--accent-yellow);
}

.text-blue {
    color: var(--accent-blue);
}

/* ---- Derby Badge ---- */
.ai-derby-badge {
    background: linear-gradient(135deg, #e74c3c, #f39c12);
    color: #fff;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: derbyPulse 2s ease-in-out infinite;
}

@keyframes derbyPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.4);
    }

    50% {
        box-shadow: 0 0 12px 4px rgba(231, 76, 60, 0.2);
    }
}

/* ---- Alternative Bets ---- */
.ai-alt-bet-item {
    background: rgba(52, 152, 219, 0.1);
    border-inline-start: 3px solid #3498db;
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 8px;
}

.ai-alt-bet-market {
    display: inline-block;
    background: rgba(52, 152, 219, 0.2);
    color: #5dade2;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

.ai-alt-bet-item p {
    margin: 4px 0 0;
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---- Enriched Data Section ---- */
.ai-enriched-section {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    padding: 14px;
}

.ai-data-indicators {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ai-data-tag {
    font-size: 11px;
    padding: 3px 10px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-data-tag.active {
    background: rgba(39, 174, 96, 0.12);
    border-color: rgba(39, 174, 96, 0.3);
    color: var(--accent-green);
}

.ai-form-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-bottom: 12px;
}

.ai-form-table th {
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 6px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-form-table th:first-child {
    text-align: start;
}

.ai-form-table td {
    padding: 5px 8px;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.ai-form-table td:first-child {
    text-align: start;
    color: var(--text-muted);
    font-size: 11px;
}

.ai-h2h-section h5 {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.ai-h2h-match {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 12px;
}

.ai-h2h-date {
    color: var(--text-muted);
    font-size: 11px;
    min-width: 70px;
}

.ai-h2h-teams {
    color: var(--text-secondary);
}

.ai-h2h-teams strong {
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}


/* ── Alt Markets (Corners & Cards) ── */
.ai-alt-markets-section {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.06), rgba(255, 152, 0, 0.04));
    border: 1px solid rgba(255, 193, 7, 0.15);
    border-radius: 12px;
    padding: 16px;
}

.ai-referee-badge {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: var(--text-secondary);
}

.ai-referee-cards {
    background: rgba(255, 193, 7, 0.15);
    color: #ffc107;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.ai-alt-market-block {
    margin-bottom: 12px;
}

.ai-alt-market-block:last-child {
    margin-bottom: 0;
}

.ai-alt-market-block h5 {
    color: var(--text-primary);
    font-size: 13px;
    margin: 0 0 6px 0;
}

.ai-ref-factor {
    color: #ffc107;
    font-size: 11px;
    font-weight: 500;
}

/* ── Stat Accordion (collapsible sections) ── */
.stat-accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 10px 12px;
    margin: 0 -12px;
    border-radius: 8px;
    transition: background 0.2s ease;
    user-select: none;
}

.stat-accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.stat-accordion-header h5 {
    margin: 0 !important;
    flex: 1;
}

.stat-accordion-arrow {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-inline-start: 8px;
}

.stat-accordion.collapsed .stat-accordion-arrow {
    transform: rotate(-90deg);
}

.stat-accordion-body {
    overflow: hidden;
    max-height: 2000px;
    transition: max-height 0.35s ease, opacity 0.25s ease;
    opacity: 1;
}

.stat-accordion.collapsed .stat-accordion-body {
    max-height: 0;
    opacity: 0;
    margin: 0;
    padding: 0;
}

/* ── Per-team breakdown ── */
.ai-team-breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 8px 0 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.ai-team-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ai-team-stat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ai-team-name {
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
}

.ai-home-badge {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.ai-away-badge {
    background: rgba(249, 115, 22, 0.2);
    color: #fb923c;
}

.ai-team-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.ai-stat-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 3px;
    overflow: hidden;
}

.ai-stat-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.5s ease;
}

.ai-bar-home {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.ai-bar-away {
    background: linear-gradient(90deg, #f97316, #fb923c);
}

.ai-team-games {
    font-size: 10px;
    color: var(--text-muted);
    letter-spacing: 0.3px;
}

.ai-alt-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ai-alt-table th {
    color: var(--text-muted);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.ai-alt-table th:first-child {
    text-align: start;
}

.ai-alt-table td {
    padding: 5px 8px;
    text-align: center;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-family: 'JetBrains Mono', monospace;
}

.ai-alt-table td:first-child {
    text-align: start;
    color: var(--text-muted);
    font-size: 11px;
    font-family: inherit;
}

.ai-alt-table td strong {
    color: var(--text-primary);
}

/* ======== Custom Bet (AI Chat) ======== */
.custom-bet-container {
    max-width: 800px;
    margin: 0 auto;
}

.custom-bet-header h3 {
    font-size: 20px;
    margin-bottom: 6px;
}

.custom-bet-subtitle {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 16px;
}

.custom-bet-examples {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.custom-bet-example {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.custom-bet-example:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

.custom-bet-input-area {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
}

.custom-bet-input-area textarea {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 14px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    transition: border-color 0.3s;
}

.custom-bet-input-area textarea:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

.custom-bet-send {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: #fff;
    border: none;
    border-radius: 12px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
    align-self: flex-end;
}

.custom-bet-send:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.custom-bet-send:disabled {
    opacity: 0.6;
    cursor: wait;
}

.custom-bet-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 48px 0;
}

.custom-bet-loading .loading-spinner.large {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.custom-bet-response {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.custom-bet-user-msg,
.custom-bet-ai-msg {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-radius: 12px;
}

.custom-bet-user-msg {
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.custom-bet-ai-msg {
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
}

.msg-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.ai-msg-content {
    flex: 1;
    min-width: 0;
}

.ai-text-response {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.ai-text-response p {
    margin-bottom: 8px;
}

.ai-text-response strong {
    color: var(--text-primary);
}

.ai-text-response h3,
.ai-text-response h4 {
    color: var(--text-primary);
    margin: 16px 0 8px;
}

.custom-bet-heading {
    color: var(--accent-green) !important;
    font-size: 15px !important;
}

.custom-bet-summary-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

.custom-bet-summary-metrics .metric-card {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.15);
    border-radius: 10px;
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.custom-bet-summary-metrics .metric-value {
    font-size: 22px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.custom-bet-summary-metrics .metric-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-bet-error {
    text-align: center;
    padding: 32px;
    color: var(--accent-red);
}

.custom-bet-error .error-icon {
    font-size: 32px;
    display: block;
    margin-bottom: 8px;
}

.emoji-highlight {
    font-size: 1.1em;
}

/* Context badge for home/away split */
.ctx-badge {
    display: inline-block;
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    vertical-align: middle;
    margin-inline-start: 6px;
}

/* Context breakdown table (🏠/✈️/🌐) */
.ctx-breakdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    margin-top: 4px;
}

.ctx-breakdown-table th {
    font-weight: 600;
    color: var(--text-muted);
    padding: 4px 8px;
    text-align: center;
    font-size: 11px;
    border-bottom: 1px solid var(--border-subtle);
}

.ctx-breakdown-table td {
    text-align: center;
    padding: 6px 8px;
    color: var(--text-secondary);
}

.ctx-breakdown-table td strong {
    font-size: 14px;
    color: var(--text-primary);
}

.ctx-breakdown-table td small {
    color: var(--text-muted);
    font-size: 10px;
}

.ctx-breakdown-table .ctx-highlight {
    background: var(--accent-green-soft);
    border-radius: 6px;
    position: relative;
}

.ctx-breakdown-table .ctx-highlight strong {
    color: var(--accent-green);
}

/* ---- Period Toggle Buttons (FT / 1T / 2T) ---- */
.period-toggle-group {
    display: inline-flex;
    gap: 0;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.period-toggle-btn {
    padding: 5px 14px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

.period-toggle-btn:not(:last-child)::after {
    content: '';
    position: absolute;
    inset-inline-end: 0;
    top: 25%;
    height: 50%;
    width: 1px;
    background: var(--border-subtle);
}

.period-toggle-btn.active {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: #fff;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.period-toggle-btn.active::after {
    display: none;
}

.period-toggle-btn:hover:not(.active) {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-green);
}

.period-badge-card {
    display: inline-flex;
    align-items: center;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Courier New", monospace;
    flex-shrink: 0;
    background: transparent;
}

/* Matcha palette period badge colors */
.period-badge-card.period-badge-1t {
    background: rgba(132, 231, 165, 0.12) !important;
    color: #84e7a5 !important;
    border: 1px solid #84e7a5;
}

.period-badge-card.period-badge-2t {
    background: rgba(7, 138, 82, 0.12) !important;
    color: #078a52 !important;
    border: 1px solid #078a52;
}

.period-badge-card.period-badge-p {
    background: rgba(2, 73, 42, 0.12) !important;
    color: #02492a !important;
    border: 1px solid #02492a;
}

/* ---- Team Stats Modal ---- */
.team-stats-modal h2 {
    margin-bottom: 4px;
}

.team-form-sequence {
    margin-bottom: 16px;
}

.result-badge {
    display: inline-block;
    width: 22px;
    height: 22px;
    line-height: 22px;
    text-align: center;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}

.result-w {
    background: var(--accent-green);
}

.result-d {
    background: #f59e0b;
}

.result-l {
    background: var(--accent-red);
}

.team-kpi-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}

.team-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.team-stat-block {
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
}

.team-stat-block h5 {
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.team-history-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-subtle);
}

.team-history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.team-history-table th {
    text-align: start;
    padding: 8px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-glass);
    border-bottom: 1px solid var(--border-subtle);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.team-history-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

.team-history-table tbody tr:hover {
    background: var(--bg-glass);
}

.venue-badge {
    display: inline-block;
    font-size: 14px;
}

/* ---- Team Logos ---- */
.team-logo {
    display: inline-block;
    vertical-align: middle;
    border-radius: 4px;
    object-fit: contain;
    margin-inline-end: 4px;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.35));
}

.team-card-logo {
    width: 40px;
    height: 40px;
    object-fit: contain;
    margin-bottom: 8px;
    filter: drop-shadow(0px 2px 4px rgba(0, 0, 0, 0.35));
}

.team-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.team-stats-modal h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.match-team {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* ---- Trend Cards ---- */
.trend-card {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.trend-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ---- Match Tabs ---- */
.matches-tabs {
    display: flex;
    gap: 4px;
    align-items: center;
    margin-bottom: 16px;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
}

.matches-tab-spacer {
    flex: 1 1 auto;
    min-width: 20px;
}

.matches-date-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.matches-tab {
    padding: 8px 20px;
    border: none;
    border-radius: 980px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.matches-tab.active {
    background: var(--accent-green);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.matches-tab:hover:not(.active) {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.fab-clear-favorites {
    position: fixed;
    bottom: 24px;
    inset-inline-end: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    pointer-events: auto;
    transition: all var(--transition-fast) ease;
}

.fab-clear-favorites:hover {
    transform: scale(1.08) translateY(-2px);
    background: #dc2626;
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.5);
}

@media (max-width: 768px) {
    .fab-clear-favorites {
        bottom: 20px;
        inset-inline-end: 20px;
        width: 52px;
        height: 52px;
    }

    .fav-matches-tabs {
        flex-wrap: wrap !important;
        width: 100% !important;
        gap: 8px !important;
    }

    .fav-matches-tabs .matches-tab {
        flex: 1 1 calc(50% - 4px) !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 12px 0 !important;
        font-size: 0.85rem !important;
    }
}

/* ---- Matches Filter Bar (tabs + date filter) ---- */
.matches-filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    gap: 12px;
}

.matches-date-input {
    padding: 8px 14px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
}

.matches-date-input:hover {
    color: var(--text-primary);
    background: var(--bg-secondary);
}

.matches-date-input:focus {
    outline: none;
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.matches-date-input::-webkit-calendar-picker-indicator {
    filter: invert(0.6);
    cursor: pointer;
}

.matches-date-sep {
    color: var(--text-muted);
    font-size: 12px;
    user-select: none;
    padding: 0 2px;
}

@media (max-width: 768px) {
    .matches-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ---- Finished Match Cards ---- */
.finished-match {
    border-inline-start: 3px solid var(--text-muted);
    position: relative;
}

.finished-match.result-home-win {
    border-inline-start-color: var(--green);
}

.finished-match.result-draw {
    border-inline-start-color: var(--yellow);
}

.finished-match.result-away-win {
    border-inline-start-color: var(--red);
}

.finished-match .match-vs {
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}

.match-analysis-hint {
    font-size: 12px;
    color: var(--accent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.finished-match:hover .match-analysis-hint {
    opacity: 1;
}

/* VB card logo alignment */
.vb-match-label {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
}

/* ---- Prediction vs Result Comparison ---- */
.comparison-section {
    margin-bottom: 24px;
}

.comparison-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
}

.comparison-score-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.comparison-score-result {
    text-align: center;
}

.comparison-actual-score {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.comparison-predicted-score {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-bottom: 16px;
}

.comparison-table thead th {
    background: var(--bg-secondary);
    padding: 8px 12px;
    text-align: center;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.comparison-table thead th:first-child {
    text-align: start;
    border-radius: 8px 0 0 0;
}

.comparison-table thead th:last-child {
    border-radius: 0 8px 0 0;
}

.comparison-table tbody td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-subtle);
    text-align: center;
    vertical-align: middle;
}

.comparison-table tbody td:first-child {
    text-align: start;
    font-weight: 500;
}

.comparison-table tbody tr:nth-child(even) {
    background: var(--bg-secondary);
}

.comparison-table tbody td small {
    color: var(--text-muted);
    font-size: 11px;
}

.comparison-check {
    font-size: 18px;
    min-width: 32px;
}

.comparison-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 20px;
}

.comparison-summary-label {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
}

.comparison-summary-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    font-weight: 700;
}

/* ---- Clickable Team History Rows ---- */
.team-history-row {
    transition: background var(--transition-fast), transform var(--transition-fast);
    border-radius: var(--radius-sm);
}

.team-history-row[onclick] {
    cursor: pointer;
}

.team-history-row[onclick]:hover {
    background: var(--accent-green-soft);
}

.team-history-row[onclick]:hover td {
    color: var(--text-primary);
}

.team-history-row[onclick]:active {
    transform: scale(0.99);
}

/* ---- Modal Back Button ---- */
.modal-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    margin-bottom: 16px;
    background: var(--accent-blue-soft);
    border: 1px solid var(--accent-blue);
    border-radius: var(--radius-sm);
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-back-btn:hover {
    background: var(--accent-blue);
    color: #fff;
    box-shadow: 0 0 16px rgba(59, 130, 246, 0.25);
}

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

/* ==========================================
   MOBILE RESPONSIVENESS
   ========================================== */

/* ---- Sidebar Backdrop Overlay ---- */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition-normal);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.sidebar-backdrop.visible {
    display: block;
    opacity: 1;
}

/* ---- Mobile Close Button inside Sidebar ---- */
.sidebar-close-btn {
    display: none;
    /* hidden on desktop */
}

@media (max-width: 768px) {

    /* ---- Base Layout ---- */
    html,
    body {
        flex-direction: column;
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* ---- Sidebar as Drawer ---- */
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        inset-inline-start: 0;
        top: 0;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        /* dynamic viewport for phones with browser chrome */
        z-index: 1000;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.5);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        background: var(--bg-secondary);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Close button inside drawer header */
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--bg-glass);
        border: 1px solid var(--border-subtle);
        color: var(--text-secondary);
        font-size: 20px;
        cursor: pointer;
        position: absolute;
        inset-inline-end: 16px;
        top: 16px;
        transition: all var(--transition-fast);
        line-height: 1;
    }

    .sidebar-close-btn:hover {
        background: var(--accent-red-soft);
        color: var(--accent-red);
        border-color: var(--accent-red);
    }

    /* Badge: absolute below close button (top:16px + height:36px + 6px gap = 58px) */
    .plan-badge {
        position: absolute;
        top: 58px;
        inset-inline-end: 16px;
        margin: 0;
    }

    /* ---- Main Content ---- */
    .main-content {
        margin-inline-start: 0;
        width: 100%;
        padding: 0;
    }

    /* ---- Top Bar ---- */
    .top-bar {
        padding: 12px 16px;
        height: auto;
        min-height: 52px;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        position: sticky;
        top: 0;
        z-index: 50;
    }

    .top-bar-left {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
        flex: 1 1 auto;
        justify-content: space-between;
    }

    .competition-filter {
        margin-inline-start: auto;
    }

    .top-bar-right {
        flex: 1 1 100%;
        min-width: 100%;
        /* forces new line */
    }

    .page-title {
        font-size: 15px;
        white-space: nowrap;
    }

    /* ---- Hamburger Menu Toggle ---- */
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        border-radius: var(--radius-sm);
        background: var(--bg-glass);
        border: 1px solid var(--border-subtle);
        color: var(--text-primary);
        font-size: 20px;
        cursor: pointer;
        flex-shrink: 0;
        transition: all var(--transition-fast);
    }

    .menu-toggle:hover,
    .menu-toggle:active {
        background: var(--accent-green-soft);
        border-color: var(--accent-green);
        color: var(--accent-green);
    }

    /* ---- Search Box (compact) ---- */
    .search-box {
        width: 100%;
        max-width: none;
        padding: 6px 12px;
    }

    .search-box input {
        font-size: 13px;
    }

    /* ---- View Padding ---- */
    .view {
        padding: 20px 16px;
    }

    /* ---- Stats & Grids ---- */
    .stats-row {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 16px 14px;
    }

    .stat-value {
        font-size: 22px;
    }

    .stat-label {
        font-size: 11px;
    }

    .value-bets-grid,
    .teams-grid,
    .glossary-grid {
        grid-template-columns: 1fr;
    }

    .team-stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* ---- Section Headers ---- */
    .section-header {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
    }

    .section-header h3,
    #dashboard-trends-title {
        font-size: 28px !important;
        line-height: 1.1;
    }

    .section-header h3 svg,
    #dashboard-trends-title svg {
        width: 36px !important;
        height: 36px !important;
    }

    /* ---- Tables (allow horizontal scroll) ---- */
    .comparison-table-wrapper,
    .team-history-table-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* ---- Modals ---- */
    .modal-content {
        width: 96%;
        max-height: 90vh;
        max-height: 90dvh;
        padding: 20px 16px;
        border-radius: var(--radius-lg);
        margin: auto;
    }

    .vb-modal-grid {
        grid-template-columns: 1fr;
    }

    /* ---- Planner ---- */
    .planner-markets {
        flex-direction: column;
        gap: 10px;
    }

    .planner-markets select,
    .planner-markets input,
    .planner-markets button {
        width: 100%;
        max-width: none;
    }

    /* ---- Combined Bets ---- */
    .combined-summary {
        width: 100%;
    }

    .combined-selections {
        gap: 8px;
    }

    /* ---- Sidebar internals on mobile ---- */

    /* Nav: grid 2 colunas com ícone em cima e label abaixo */
    .sidebar-nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 12px;
        flex: none;
        overflow-y: visible;
    }

    .nav-item {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 14px 8px;
        text-align: center;
        font-size: 11px;
    }

    .nav-icon {
        width: 24px;
        height: 24px;
    }

    .nav-item.active::before {
        display: none;
    }

    .sidebar-actions {
        padding: 12px;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sidebar-actions.is-admin-visible {
        display: grid;
    }

    .sidebar-footer {
        margin-top: auto;
    }

    .action-btn {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        padding: 14px 8px;
        font-size: 11px;
        border-radius: var(--radius-md);
    }

    .action-btn svg {
        width: 20px;
        height: 20px;
    }

    /* ---- Comparison Summary ---- */
    .comparison-summary {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }

    /* ---- Content Sections ---- */
    .content-section {
        margin-bottom: 20px;
    }



    /* ---- Extra Mobile Fixes (Dropdowns, Planner, etc) ---- */
    .comp-dropdown,
    .cat-dropdown {
        min-width: 0 !important;
        width: 100% !important;
        max-width: none !important;
        flex: 1;
    }

    .comp-dropdown-btn {
        min-width: 0 !important;
        font-size: 13px !important;
        padding: 8px 12px !important;
    }

    .comp-dropdown-menu {
        position: fixed !important;
        top: 80px !important;
        inset-inline-start: 16px !important;
        inset-inline-end: 16px !important;
        bottom: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100vh - 120px) !important;
        z-index: 9999 !important;
        border-radius: 16px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    }

    .vb-actions {
        flex-wrap: wrap;
    }

    .vb-actions button {
        flex: 1 1 auto;
        min-width: 45%;
    }

    .planner-match-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 12px;
        gap: 8px;
        height: auto;
    }

    .planner-match-item .pm-teams {
        font-size: 14px;
        flex-wrap: wrap;
        width: 100%;
    }

    .planner-match-item .pm-date,
    .planner-match-item .pm-time,
    .planner-match-item .pm-round {
        margin-inline-start: 0;
    }

    /* ---- Mobile Match Card Improvements ---- */
    .match-card .team-logo {
        width: 28px !important;
        height: 28px !important;
    }

    .match-teams {
        overflow: hidden;
        word-break: break-word;
    }

    .match-team {
        white-space: normal;
        line-height: 1.3;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    /* Smaller V/D/E result badges in match detail on mobile */
    .result-badge {
        width: 16px;
        height: 16px;
        line-height: 16px;
        font-size: 9px;
    }
}

/* ---- Extra small devices (phones < 480px) ---- */
@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }

    .team-stats-grid {
        grid-template-columns: 1fr;
    }

    .top-bar {
        padding: 10px 12px;
    }

    .page-title {
        font-size: 14px;
    }

    .view {
        padding: 16px 12px;
    }

    .modal-content {
        width: 98%;
        padding: 14px 10px;
        max-height: 92vh;
        max-height: 92dvh;
    }

    .competition-filter select {
        max-width: 160px;
        font-size: 12px;
    }

    /* ---- Match Detail Modal Mobile Fixes ---- */

    /* Score section: stack vertically on small screens */
    .comparison-score {
        flex-direction: column;
        gap: 8px;
        padding: 12px 14px;
        text-align: center;
    }

    .comparison-score-team {
        font-size: 12px;
        gap: 5px;
        justify-content: center;
    }

    .comparison-score-team strong {
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .comparison-score-team[style*="text-align:right"] {
        text-align: center !important;
    }

    .comparison-actual-score {
        font-size: 22px;
    }

    .comparison-predicted-score {
        font-size: 10px;
    }

    /* Comparison table: reduce padding and font size */
    .comparison-table {
        font-size: 11px;
    }

    .comparison-table thead th {
        padding: 6px 4px;
        font-size: 9px;
        letter-spacing: 0;
    }

    .comparison-table tbody td {
        padding: 7px 4px;
        font-size: 11px;
        word-break: break-word;
    }

    .comparison-table tbody td:first-child {
        max-width: 110px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .comparison-check {
        font-size: 14px;
        min-width: 24px;
    }

    .comparison-summary {
        flex-wrap: wrap;
        gap: 8px;
    }

    .comparison-summary-item {
        font-size: 12px;
    }

    /* Section headers inside modal */
    .comparison-section h3 {
        font-size: 14px;
    }

    /* Period toggle inside modal */
    .comparison-section .period-toggle-group {
        margin-top: 4px;
    }

    .comparison-section .period-toggle-btn {
        padding: 4px 10px;
        font-size: 10px;
    }

    /* Alt markets section */
    .ai-alt-markets-section {
        padding: 12px 10px;
    }

    .ai-alt-markets-section h4 {
        font-size: 13px;
    }

    .ai-alt-market-block h5 {
        font-size: 12px;
    }

    .ai-prediction-table {
        font-size: 11px;
    }

    .ai-prediction-table th,
    .ai-prediction-table td {
        padding: 5px 4px;
    }

    /* Referee badge */
    .ai-referee-badge {
        flex-wrap: wrap;
        gap: 4px;
        font-size: 11px;
        padding: 6px 10px;
    }

    /* VB metrics inside cards */
    .vb-metrics {
        gap: 8px;
    }

    .vb-metric-value {
        font-size: 16px;
    }

    .vb-metric-label {
        font-size: 9px;
    }

    /* Section header inside match detail */
    .section-header {
        gap: 6px;
    }

    .section-header h3 {
        font-size: 13px;
    }

    /* News section inside modal */
    .news-card {
        padding: 10px;
    }

    .news-card h4 {
        font-size: 12px;
    }

    /* Modal close button — own line on mobile */
    .modal-close {
        position: static;
        display: block;
        margin-inline-start: auto;
        margin-bottom: 4px;
        font-size: 22px;
        width: 32px;
        height: 32px;
        text-align: center;
        line-height: 32px;
        padding: 0;
        border-radius: 50%;
        background: var(--bg-hover);
    }

    /* Match detail header: teams row */
    .clickable-team h2 {
        font-size: 13px !important;
        word-break: break-word;
        line-height: 1.3;
    }

    .clickable-team h2 span {
        font-size: 11px !important;
        padding: 1px 4px !important;
        margin-inline-start: 3px !important;
    }

    .clickable-team img {
        max-width: 24px !important;
        max-height: 24px !important;
    }

    /* Modal body general font scaling */
    #modal-body h2 {
        font-size: 14px;
    }

    #modal-body h3 {
        font-size: 13px;
    }

    #modal-body h4 {
        font-size: 12px;
    }

    #modal-body p {
        font-size: 12px;
    }

    /* Match detail teams header: no right margin (close is static now), smaller gap */
    .match-detail-teams-header {
        margin-inline-end: 0 !important;
        gap: 8px !important;
        margin-bottom: 10px !important;
        flex-wrap: wrap;
    }

    /* Period toggle heading alignment */
    .comparison-section>div:first-child {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* Mobile match detail: medium phones */
@media (max-width: 600px) {
    .comparison-score {
        flex-direction: column;
        gap: 6px;
        padding: 12px;
    }

    .comparison-score-team[style*="text-align:right"] {
        text-align: center !important;
    }

    .comparison-table {
        font-size: 12px;
    }

    .comparison-table thead th {
        padding: 6px 6px;
        font-size: 10px;
    }

    .comparison-table tbody td {
        padding: 8px 6px;
    }
}

/* =======================================
   Competition Filter Dropdown (Top Bar)
   ======================================= */
.competition-filter {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comp-filter-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    border-radius: 980px;
    background: var(--accent-green);
    color: white;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.15s;
}

.comp-filter-action-btn svg {
    width: 16px;
    height: 16px;
}

.comp-filter-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow-green);
}

.comp-filter-action-btn--clear {
    background: #ef4444;
}

.comp-filter-action-btn--clear:hover {
    background: #dc2626;
    box-shadow: 0 0 12px rgba(239, 68, 68, 0.45);
}

.competition-filter select {
    appearance: none;
    -webkit-appearance: none;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 36px 8px 14px;
    cursor: pointer;
    transition: all var(--transition-fast);
    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='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 200px;
}

.competition-filter select:hover {
    border-color: var(--accent-green);
}

.competition-filter select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12);
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* =======================================
   Odds Button (Sidebar)
   ======================================= */
.action-btn-odds {
    background: var(--accent-yellow-soft);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.action-btn-odds:hover {
    background: rgba(245, 158, 11, 0.25);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.15);
}

[data-theme="light"] .action-btn-odds {
    background: rgba(217, 119, 6, 0.08);
    border-color: #d97706;
    color: #d97706;
}

[data-theme="light"] .action-btn-odds:hover {
    background: rgba(217, 119, 6, 0.15);
}

/* =======================================
   Competition Selection Modal
   ======================================= */
.competitions-modal-content,
.odds-modal-content {
    max-width: 520px;
}

.comp-select-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.comp-select-all {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.comp-select-all:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.competitions-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 380px;
    overflow-y: auto;
    padding-inline-end: 4px;
}

.comp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    user-select: none;
}

.comp-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-active);
}

.comp-item.selected {
    background: var(--accent-green-soft);
    border-color: var(--accent-green);
}

.comp-item input[type="checkbox"],
.comp-item input[type="radio"] {
    accent-color: var(--accent-green);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.comp-flag {
    font-size: 20px;
    flex-shrink: 0;
}

.comp-logo-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 4px;
}

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

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

.comp-country {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 1px;
}

.comp-cup-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--accent-purple-soft);
    color: var(--accent-purple);
    flex-shrink: 0;
}

.comp-sync-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    margin-inline-start: auto;
    white-space: nowrap;
}

.comp-sync-badge.synced {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.comp-sync-badge.stale {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.comp-sync-badge.not-synced {
    background: rgba(239, 68, 68, 0.10);
    color: #ef4444;
}

.comp-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
}

.comp-selected-count {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.full-sync-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-subtle);
    background: var(--bg-glass);
    transition: all var(--transition-fast);
    user-select: none;
}

.full-sync-toggle:hover {
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.full-sync-toggle:has(input:checked) {
    background: var(--accent-yellow-soft);
    border-color: var(--accent-yellow);
    color: var(--accent-yellow);
}

.full-sync-toggle input[type="checkbox"] {
    accent-color: var(--accent-yellow);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.comp-loading {
    text-align: center;
    padding: 32px 0;
    color: var(--text-muted);
    font-size: 13px;
}

/* =======================================
   Odds Quota Info
   ======================================= */
.odds-quota-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--accent-yellow-soft);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--accent-yellow);
    margin-bottom: 14px;
}

.quota-icon {
    font-size: 16px;
}

/* =======================================
   Scrape Progress Modal
   ======================================= */
.scrape-progress-content {
    max-width: 500px;
}

.scrape-progress-bar-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.scrape-progress-bar-track {
    flex: 1;
    height: 8px;
    background: var(--bg-glass);
    border-radius: 10px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.scrape-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #34d399);
    border-radius: 10px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
    position: relative;
}

.scrape-progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.scrape-progress-pct {
    font-size: 13px;
    font-weight: 700;
    color: var(--accent-green);
    min-width: 36px;
    text-align: end;
    font-family: 'JetBrains Mono', monospace;
}

.scrape-progress-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.scrape-progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--bg-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}

.scrape-progress-item .sp-flag {
    font-size: 20px;
    flex-shrink: 0;
}

.scrape-progress-item .sp-info {
    flex: 1;
    min-width: 0;
}

.scrape-progress-item .sp-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.scrape-progress-item .sp-status {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.sp-bar-track {
    height: 4px;
    background: var(--bg-glass);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 6px;
    border: 1px solid var(--border-subtle);
}

.sp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-green), #34d399);
    border-radius: 4px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 4px rgba(16, 185, 129, 0.3);
}

.sp-done .sp-bar-fill {
    background: linear-gradient(90deg, var(--accent-green), #34d399);
    width: 100% !important;
}

.sp-error .sp-bar-fill {
    background: var(--accent-red);
    width: 100% !important;
    box-shadow: 0 0 4px rgba(239, 68, 68, 0.3);
}

.sp-pending .sp-bar-track {
    opacity: 0.4;
}

.scrape-progress-item .sp-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.scrape-progress-item.sp-pending .sp-icon::after {
    content: '⏳';
}

.scrape-progress-item.sp-active .sp-icon::after {
    content: '🔄';
}

.scrape-progress-item.sp-done .sp-icon::after {
    content: '✅';
}

.scrape-progress-item.sp-error .sp-icon::after {
    content: '❌';
}

.scrape-progress-item.sp-active {
    border-color: var(--accent-blue);
    background: var(--accent-blue-soft);
}

.scrape-progress-item.sp-done {
    border-color: var(--accent-green);
    background: var(--accent-green-soft);
}

.scrape-progress-item.sp-error {
    border-color: var(--accent-red);
    background: var(--accent-red-soft);
}

/* ---- Custom Competition Dropdown ---- */
.comp-dropdown {
    position: relative;
    min-width: 280px;
    width: 280px;
}

.comp-dropdown-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.comp-dropdown-btn:hover {
    border-color: var(--accent);
}

.comp-dd-label {
    flex: 1;
    text-align: start;
}

.comp-dd-arrow {
    font-size: 12px;
    color: var(--text-muted);
}

.comp-dropdown-menu {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    z-index: 100;
    max-height: 300px;
    overflow-y: auto;
    padding: 4px;
}

.comp-dropdown-menu.hidden {
    display: none;
}

.comp-dd-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    transition: background 0.15s, box-shadow 0.15s;
}

.comp-dd-item:hover {
    background: var(--accent-soft, rgba(59, 130, 246, 0.08));
}

.comp-dd-item.active {
    background: var(--accent-soft, rgba(59, 130, 246, 0.10));
    font-weight: 600;
}

.comp-dd-item--locked {
    opacity: 0.62;
    cursor: not-allowed;
}

.comp-dd-item--locked:hover {
    background: transparent;
}

.comp-dd-item--locked .comp-dd-logo,
.comp-dd-item--locked .comp-dd-icon,
.comp-dd-item--locked > span:not(.comp-dd-lock) {
    filter: blur(1.2px) grayscale(0.45);
}

.comp-dd-item--locked .comp-dd-check {
    cursor: not-allowed;
    pointer-events: none;
}

.comp-dd-lock {
    margin-inline-start: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-green, #0CCE6B);
}

.comp-dd-check {
    width: 16px;
    height: 16px;
    accent-color: var(--accent, #3b82f6);
    flex-shrink: 0;
    cursor: pointer;
}

.comp-dd-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 8px;
}

.comp-dd-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 22px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dd-filter-svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.comp-dd-logo {
    width: 22px;
    height: 22px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 3px;
}

/* ---- Match Card Competition Logo ---- */
.match-comp-logo {
    object-fit: contain;
    vertical-align: middle;
    border-radius: 2px;
    margin-inline-end: 4px;
}

.match-comp-name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    vertical-align: middle;
}

/* ---- Category Filter Dropdown ---- */
.cat-dropdown {
    position: relative;
    min-width: 220px;
    width: 220px;
}

/* =======================================
   AI Chat FAB (Minimized State)
   ======================================= */
.ai-chat-fab {
    position: fixed;
    inset-inline-end: 24px;
    bottom: 24px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #10b981);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.35);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ai-chat-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 28px rgba(59, 130, 246, 0.5);
}

.ai-chat-fab.dragging {
    cursor: grabbing;
    opacity: 0.9;
}

.ai-chat-fab-text {
    font-size: 16px;
    font-weight: 900;
    color: white;
    letter-spacing: 1px;
    z-index: 2;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.ai-chat-fab-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid #3b82f6;
    animation: fab-pulse-ring 2s ease-out infinite;
}

@keyframes fab-pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

/* =======================================
   AI Chat Panel (Floating)
   ======================================= */
.ai-chat-panel {
    position: fixed;
    inset-inline-end: 24px;
    bottom: 24px;
    width: 420px;
    max-height: 80vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 16px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(139, 92, 246, 0.06);
    overflow: auto;
    animation: chatPanelSlideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .ai-chat-panel {
    background: #fff;
    border-color: rgba(139, 92, 246, 0.1);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(139, 92, 246, 0.05);
}

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

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

/* ---- Header ---- */
.ai-chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08), rgba(16, 185, 129, 0.06));
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
}

[data-theme="light"] .ai-chat-panel-header {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(16, 185, 129, 0.04));
}

.ai-chat-panel-title {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.2px;
}

.ai-chat-panel-controls {
    display: flex;
    gap: 4px;
}

.ai-chat-panel-controls button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
    opacity: 0.6;
    line-height: 1;
}

.ai-chat-panel-controls button:hover {
    opacity: 1;
    background: var(--bg-secondary);
}

/* ---- Filters ---- */
.ai-chat-filters {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--bg-secondary);
}

[data-theme="light"] .ai-chat-filters {
    background: #f8fafc;
}

.ai-filter-row {
    display: flex;
    gap: 8px;
}

.ai-filter-group {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.ai-filter-group.full {
    flex: 1 1 100%;
}

.ai-filter-group label {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-filter-group.required label::after {
    content: ' *';
    color: #ef4444;
    font-weight: 800;
}

.ai-filter-hint {
    font-weight: 600;
    font-size: 9px;
    color: var(--accent-green);
    text-transform: none;
    letter-spacing: 0;
}

.ai-filter-group input[type="date"],
.ai-filter-group select {
    padding: 6px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    transition: border-color 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.ai-filter-group input[type="date"]:focus,
.ai-filter-group select:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.15);
}

[data-theme="light"] .ai-filter-group input[type="date"],
[data-theme="light"] .ai-filter-group select {
    background: #fff;
    border-color: #e2e8f0;
}

/* Matches multi-select dropdown */
.ai-matches-wrapper {
    position: relative;
}

.ai-matches-toggle {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
    text-align: start;
    transition: border-color 0.2s;
}

.ai-matches-toggle:hover {
    border-color: var(--accent-green);
}

[data-theme="light"] .ai-matches-toggle {
    background: #fff;
    border-color: #e2e8f0;
}

.ai-matches-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    inset-inline-start: 0;
    inset-inline-end: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    padding: 4px;
}

[data-theme="light"] .ai-matches-dropdown {
    background: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
}

.ai-match-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--text-primary);
    transition: background 0.15s;
}

.ai-match-option:hover {
    background: var(--bg-secondary);
}

.ai-match-option input[type="checkbox"] {
    accent-color: var(--accent-green);
    flex-shrink: 0;
}

.ai-match-option.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.ai-match-option-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-match-option-badge {
    font-size: 10px;
    font-weight: 700;
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.1);
    padding: 1px 6px;
    border-radius: 8px;
    flex-shrink: 0;
}

/* ---- Chat Messages ---- */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 180px;
    max-height: 40vh;
    scroll-behavior: smooth;
}

.ai-msg {
    display: flex;
    flex-direction: column;
    max-width: 92%;
    animation: msgFadeIn 0.25s ease-out;
}

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

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

.ai-msg-user {
    align-self: flex-end;
}

.ai-msg-bot {
    align-self: flex-start;
}

.ai-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-primary);
}

.ai-msg-user .ai-msg-bubble {
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    border-bottom-right-radius: 4px;
}

.ai-msg-bot .ai-msg-bubble {
    background: var(--bg-secondary);
    border-bottom-left-radius: 4px;
}

[data-theme="light"] .ai-msg-bot .ai-msg-bubble {
    background: #f1f5f9;
    color: #334155;
}

.ai-msg-bubble p {
    margin: 0 0 4px;
}

.ai-msg-bubble p:last-child {
    margin-bottom: 0;
}

.ai-msg-time {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.ai-msg-user .ai-msg-time {
    text-align: end;
}

/* Loading dots */
.ai-msg-loading .ai-msg-bubble::after {
    content: '';
    display: inline-block;
    width: 4px;
    height: 4px;
    background: var(--text-muted);
    border-radius: 50%;
    margin-inline-start: 4px;
    animation: loadDots 1.2s ease-in-out infinite;
}

@keyframes loadDots {

    0%,
    80%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    40% {
        opacity: 1;
        transform: scale(1.2);
    }
}

/* AI response cards inside chat */
.ai-msg-bot .trend-card-ai {
    margin-top: 8px;
}

.ai-msg-bot .trends-ai-verdict {
    margin-top: 10px;
}

/* ---- Chat Input ---- */
.ai-chat-input-area {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    flex-shrink: 0;
}

[data-theme="light"] .ai-chat-input-area {
    background: #f8fafc;
}

#ai-chat-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    resize: none;
    line-height: 1.5;
    transition: border-color 0.2s;
    max-height: 80px;
}

#ai-chat-input:focus {
    outline: none;
    border-color: var(--accent-green);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.12);
}

[data-theme="light"] #ai-chat-input {
    background: #fff;
    border-color: #e2e8f0;
}

.ai-chat-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.ai-chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

.ai-chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- Mobile ---- */
@media (max-width: 768px) {
    .ai-chat-panel {
        width: calc(100% - 16px);
        inset-inline-end: 8px;
        bottom: 8px;
        max-height: 85vh;
        border-radius: 16px;
    }

    .ai-chat-fab {
        inset-inline-end: 16px;
        bottom: 16px;
    }

    .ai-chat-messages {
        max-height: 35vh;
    }
}

/* =======================================
   Action Buttons Row (Trends View)
   ======================================= */
.trends-action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* =======================================
   AI General Button (Trends View)
   ======================================= */
.trends-ai-general-btn {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9) !important;
    color: #fff !important;
    font-weight: 700 !important;
    border: none !important;
    border-radius: 980px !important;
    padding: 8px 16px !important;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
    animation: pulse-glow 3s ease-in-out infinite;
}

.trends-ai-general-btn:hover {
    background: linear-gradient(135deg, #7c3aed, #5b21b6) !important;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    transform: translateY(-1px);
}

.trends-ai-general-btn--soon {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(168, 85, 247, 0.42) !important;
    cursor: pointer;
    animation: none !important;
}

.trends-ai-general-btn--soon:hover {
    transform: none;
}

.trends-ai-general-btn--soon > svg,
.trends-ai-general-btn--soon > span:not(.soon-lock-overlay) {
    filter: blur(2px) opacity(0.55);
    pointer-events: none;
    user-select: none;
}

.soon-lock-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #ffffff;
    font-family: var(--font-mono, 'JetBrains Mono', monospace);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(88, 28, 135, 0.52);
    pointer-events: none;
}

.soon-lock-overlay svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.5;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.35));
}

[data-theme="light"] .soon-lock-overlay {
    background: rgba(126, 34, 206, 0.64);
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.25);
    }

    50% {
        box-shadow: 0 2px 16px rgba(139, 92, 246, 0.45);
    }
}

/* =======================================
   Bet Slip / Carrinho de Combinadas
   ======================================= */
.bet-slip {
    position: fixed;
    inset-inline-end: 0;
    bottom: 30px;
    top: auto;
    z-index: 900;
    display: flex;
    align-items: flex-end;
    pointer-events: none;
}

.bet-slip>* {
    pointer-events: auto;
}

.bet-slip-toggle {
    background: linear-gradient(135deg, #f97316, #ea580c);
    border: none;
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 12px 0 0 12px;
    cursor: grab;
    -webkit-user-select: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: relative;
    box-shadow: -3px 0 16px rgba(249, 115, 22, 0.3);
    transition: all 0.2s;
    flex-shrink: 0;
    margin-bottom: 20px;
}

.bet-slip-toggle:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    width: 52px;
}

.bet-slip.dragging .bet-slip-toggle {
    cursor: grabbing;
    opacity: 0.85;
}

.bet-slip-badge {
    position: absolute;
    top: -4px;
    inset-inline-end: -2px;
    background: var(--accent-red, #ef4444);
    color: white;
    font-size: 10px;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}

.bet-slip-panel {
    background: linear-gradient(135deg, #ffb74d, #fff3e0);
    border: none;
    border-radius: 12px 0 0 12px;
    width: 330px;
    display: flex;
    flex-direction: column;
    box-shadow: -6px 0 32px rgba(230, 81, 0, 0.25);
    overflow: hidden;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    color: #424242;
}

[data-theme="dark"] .bet-slip-panel {
    background: linear-gradient(135deg, #e65100, #bf360c);
    box-shadow: -6px 0 32px rgba(191, 54, 12, 0.5);
    color: white;
}

.bet-slip.collapsed .bet-slip-panel {
    width: 0;
    opacity: 0;
    pointer-events: none;
    border: none;
    box-shadow: none;
}

.bet-slip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid rgba(255, 152, 0, 0.2);
    flex-shrink: 0;
}

[data-theme="dark"] .bet-slip-header {
    background: rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.bet-slip-header h3 {
    font-size: 14px;
    font-weight: 800;
    color: #e65100;
    margin: 0;
}

[data-theme="dark"] .bet-slip-header h3 {
    color: white;
}

.bet-slip-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #e65100;
    opacity: 0.6;
    transition: opacity 0.2s;
    padding: 4px;
}

[data-theme="dark"] .bet-slip-clear {
    color: white;
    opacity: 0.6;
}

.bet-slip-clear:hover {
    opacity: 1;
}

[data-theme="dark"] .bet-slip-clear:hover {
    opacity: 1;
    color: white;
}

.bet-slip-items {
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 60vh;
}

.bet-slip-empty {
    text-align: center;
    padding: 24px 16px;
    color: rgba(0, 0, 0, 0.5);
    font-size: 13px;
    font-weight: 500;
}

[data-theme="dark"] .bet-slip-empty {
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
}

.bet-slip-item {
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    position: relative;
    animation: slideInRight 0.2s ease-out;
}

[data-theme="dark"] .bet-slip-item {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

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

.bet-slip-item-match {
    font-size: 11px;
    color: #616161;
    font-weight: 600;
    margin-bottom: 4px;
}

[data-theme="dark"] .bet-slip-item-match {
    color: rgba(255, 255, 255, 0.8);
}

.bet-slip-item-trend {
    font-size: 13px;
    font-weight: 800;
    color: #e65100;
    margin-bottom: 4px;
}

[data-theme="dark"] .bet-slip-item-trend {
    font-weight: 700;
    color: white;
}

.bet-slip-item-prob {
    font-size: 12px;
    color: #424242;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
}

[data-theme="dark"] .bet-slip-item-prob {
    color: #fff;
}

.bet-slip-item-remove {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    background: none;
    border: none;
    color: #e65100;
    font-size: 14px;
    cursor: pointer;
    padding: 2px;
    opacity: 0.4;
    transition: all 0.2s;
}

[data-theme="dark"] .bet-slip-item-remove {
    color: white;
    opacity: 0.5;
}

.bet-slip-item-remove:hover {
    opacity: 1;
}

[data-theme="dark"] .bet-slip-item-remove:hover {
    opacity: 1;
    color: #ffcccc;
}

.bet-slip-footer {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.5);
    border-top: 1px solid rgba(255, 152, 0, 0.2);
}

[data-theme="dark"] .bet-slip-footer {
    background: rgba(0, 0, 0, 0.15);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.bet-slip-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bet-slip-stat {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bet-slip-stat-label {
    font-size: 10px;
    color: rgba(0, 0, 0, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

[data-theme="dark"] .bet-slip-stat-label {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
}

.bet-slip-stat-value {
    font-size: 16px;
    font-weight: 800;
    color: #e65100;
    font-family: 'JetBrains Mono', monospace;
}

[data-theme="dark"] .bet-slip-stat-value {
    color: white;
}

.bet-slip-stat-value.accent {
    color: #d84315;
    text-shadow: none;
}

[data-theme="dark"] .bet-slip-stat-value.accent {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.4);
}


/* =======================================
   Match Trends Button & Modal
   ======================================= */

/* Button inside match detail modal header */
.match-trends-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    white-space: nowrap;
    letter-spacing: 0.2px;
    flex-shrink: 0;
}

.match-trends-btn:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    box-shadow: 0 4px 18px rgba(59, 130, 246, 0.45);
    transform: translateY(-1px);
}

.match-trends-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

/* Match trends modal */
.match-trends-modal-content {
    max-width: 800px;
    padding: 24px;
}

/* Header with teams and stats */
.match-trends-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.match-trends-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.match-trends-team {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.match-trends-stats-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.match-trends-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 60px;
}

.match-trends-stat-value {
    font-size: 20px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-primary);
}

.match-trends-stat-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tabs */
.match-trends-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.match-trends-tab {
    padding: 6px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 20px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.match-trends-tab:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
    color: var(--text-primary);
}

.match-trends-tab.active {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* Grid inside the trends modal */
.match-trends-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 600px) {
    .match-trends-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .match-trends-modal-content {
        max-width: 100%;
        padding: 16px;
    }

    .match-trends-teams {
        gap: 10px;
    }

    .match-trends-team {
        font-size: 14px;
    }

    .match-trends-stats-row {
        gap: 12px;
    }

    .match-trends-stat-value {
        font-size: 16px;
    }

    .match-trends-tab {
        font-size: 11px;
        padding: 5px 10px;
    }

    .match-trends-btn {
        padding: 7px 12px;
        font-size: 12px;
    }
}

/* =======================================
   Trends AI Modal — Premium Design
   ======================================= */
#trends-ai-modal .modal-content {
    border: 1.5px solid rgba(12, 206, 107, 0.55);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(12, 206, 107, 0.10);
}

.trends-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
    gap: 10px;
}

.trends-ai-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.trends-ai-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}

.trends-ai-confidence {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.trends-ai-confidence.high {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.trends-ai-confidence.medium {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.trends-ai-confidence.low {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.trends-ai-model {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    background: var(--bg-glass);
    color: var(--text-muted);
    border: 1px solid var(--border-subtle);
}

.trends-ai-section {
    margin-bottom: 20px;
}

.trends-ai-section-title {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-subtle);
}

/* ---- Individual Trend Card ---- */
.trend-card-ai {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.trend-card-ai::before {
    content: '';
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--accent-green), #059669);
    border-radius: 12px 0 0 12px;
}

.trend-card-ai:hover {
    border-color: rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-1px);
}

[data-theme="light"] .trend-card-ai {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .trend-card-ai:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.trend-card-ai-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-inline-start: 8px;
}

.trend-card-ai-rank {
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    background: linear-gradient(135deg, var(--accent-green), #059669);
    padding: 3px 10px;
    border-radius: 12px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.trend-card-ai-stars {
    font-size: 14px;
    letter-spacing: 2px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
}

.trend-card-ai-label {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 3px;
    padding-inline-start: 8px;
    letter-spacing: -0.2px;
}

.trend-card-ai-team {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
    padding-inline-start: 8px;
    font-weight: 500;
}

.trend-card-ai-stats {
    display: flex;
    gap: 16px;
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-family: 'JetBrains Mono', monospace;
    padding: 6px 10px;
    background: var(--bg-secondary);
    border-radius: 8px;
    margin-inline-start: 8px;
    font-weight: 600;
}

.trend-card-ai-reasoning {
    font-size: 12.5px;
    color: var(--text-secondary);
    line-height: 1.65;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(59, 130, 246, 0.04));
    border-radius: 8px;
    border-inline-start: 3px solid var(--accent-green);
    margin-inline-start: 8px;
    font-style: italic;
}

[data-theme="light"] .trend-card-ai-reasoning {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(59, 130, 246, 0.06));
    color: #475569;
}

.trend-card-ai-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding-inline-start: 8px;
}

.trend-add-btn {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
    border: 1px solid var(--accent-green);
    color: var(--accent-green);
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.trend-add-btn:hover {
    background: var(--accent-green);
    color: white;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    transform: translateY(-1px);
}

/* ---- Verdict & Risk ---- */
.trends-ai-verdict {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), rgba(59, 130, 246, 0.06));
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 12px;
    padding: 16px 18px;
    font-size: 13.5px;
    color: var(--text-primary);
    line-height: 1.7;
    position: relative;
}

.trends-ai-verdict::before {
    content: '💬';
    position: absolute;
    top: -10px;
    inset-inline-start: 14px;
    font-size: 18px;
    background: var(--bg-card);
    padding: 0 4px;
}

[data-theme="light"] .trends-ai-verdict {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05), rgba(59, 130, 246, 0.04));
    color: #334155;
}

[data-theme="light"] .trends-ai-verdict::before {
    background: #fff;
}

.trends-ai-risk {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 12.5px;
    color: var(--accent-yellow);
    line-height: 1.6;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.trends-ai-risk::before {
    content: '⚠️';
    flex-shrink: 0;
    font-size: 16px;
}

/* ---- Light theme overrides ---- */
[data-theme="light"] #trends-ai-modal .modal-content {
    background: #fff;
    border-color: rgba(12, 206, 107, 0.55);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(12, 206, 107, 0.10);
}

[data-theme="light"] .trend-card-ai-stats {
    background: #f1f5f9;
}

[data-theme="light"] .trends-ai-section-title {
    border-bottom-color: #e2e8f0;
}

[data-theme="light"] .trends-ai-header {
    border-bottom-color: #e2e8f0;
}

/* Removed light theme bet-slip overrides */

/* ---- Mobile: bet slip & filter layout ---- */
@media (max-width: 768px) {

    /* === Trends Filter Bar: each group in its own row === */
    .matches-tabs {
        flex-wrap: wrap;
        width: 100% !important;
        gap: 6px !important;
    }

    /* Each child div/element inside the filter bar takes full width */
    .matches-tabs>div,
    .matches-tabs>.cat-dropdown {
        flex: 1 1 100% !important;
        width: 100% !important;
    }

    .matches-tab-spacer {
        display: none;
    }

    /* Date row: own line between tabs and Filtrar */
    .matches-date-row {
        flex: 1 1 100% !important;
        width: 100% !important;
        order: 2;
    }

    .matches-date-input {
        flex: 1;
        min-width: 0;
        font-size: 12px;
        padding: 8px 8px;
    }

    .matches-date-sep {
        flex-shrink: 0;
    }

    /* Filter button: icon-only inside date row on mobile */
    #btn-apply-matches-filters {
        flex: 0 0 auto;
        width: auto !important;
        order: unset;
        padding: 8px 10px;
        text-align: center;
        border-radius: 980px;
    }

    .filter-btn-label {
        display: none;
    }

    .trends-action-buttons {
        flex-direction: row;
        gap: 8px !important;
        width: 100%;
    }

    /* Próximas/Passadas tabs: 50% each on first row */
    .matches-tab[onclick*="switchMatchTab"] {
        flex: 1 1 calc(50% - 4px) !important;
        width: auto !important;
        text-align: center;
        padding: 8px 0;
        order: 1;
    }

    .matches-tab[onclick*="loadTrendsView"],
    .matches-tab[onclick*="loadMatches"] {
        flex: 1 1 calc(50% - 4px);
        width: auto !important;
        text-align: center;
        padding: 8px 0;
    }

    .trends-ai-general-btn {
        flex: 1 1 calc(50% - 4px) !important;
        width: auto !important;
        margin-top: 0;
        text-align: center;
        padding: 8px 0 !important;
    }

    /* Dropdown buttons: full width */
    .comp-dropdown-btn {
        width: 100%;
    }

    /* Dropdown menus: centered modal overlay on mobile */
    .cat-dropdown {
        position: static !important;
    }

    .cat-dropdown .comp-dropdown-menu {
        position: fixed !important;
        top: 80px !important;
        inset-inline-start: 16px !important;
        inset-inline-end: 16px !important;
        bottom: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100vh - 120px) !important;
        z-index: 9999 !important;
        border-radius: 16px;
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
    }


    /* === Bet Slip: bottom-left as compact FAB === */
    .bet-slip {
        inset-inline-end: auto;
        inset-inline-start: 16px;
        bottom: 16px;
        top: auto;
        transform: none;
        width: auto;
        flex-direction: column-reverse;
    }

    .bet-slip-toggle {
        border-radius: 50%;
        width: 52px;
        height: 52px;
        margin: 0;
        box-shadow: 0 4px 16px rgba(249, 115, 22, 0.35);
    }

    .bet-slip-panel {
        width: calc(100vw - 32px);
        max-height: 50vh;
        border-radius: 16px;
        border-inline-end: 1px solid var(--border-subtle);
        position: fixed;
        bottom: 76px;
        inset-inline-start: 16px;
    }

    .bet-slip.collapsed .bet-slip-panel {
        height: 0;
        max-height: 0;
        opacity: 0;
        pointer-events: none;
    }

    /* === FAB: bottom-right === */
    .ai-chat-fab {
        inset-inline-end: 16px;
        bottom: 16px;
    }

    /* === Chat Panel: full width on mobile === */
    .ai-chat-panel {
        inset-inline-start: 8px;
        inset-inline-end: 8px;
        bottom: 8px;
        width: auto;
        max-height: 85vh;
    }
}

/* =========================================
   STANDINGS & BRACKETS (VIEW: CLASSFICAÇÃO)
   ========================================= */

.standings-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    min-width: 0;
}

.standings-group {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 24px;
}

.standings-group-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.standings-group-header {
    background: var(--bg-secondary);
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}

.standings-table th {
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 700;
    padding: 10px 6px;
    border-bottom: 1px solid var(--border-subtle);
    white-space: nowrap;
}

.standings-table th.col-team {
    text-align: start;
}

.standings-table td {
    padding: 12px 6px;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    white-space: nowrap;
}

.standings-table tr:last-child td {
    border-bottom: none;
}

.standings-table .col-pos {
    width: 36px;
    font-weight: 700;
    color: var(--text-primary);
    border-inline-start: 3px solid transparent;
}

.standings-table .col-team {
    text-align: start;
    font-weight: 600;
    color: var(--text-primary);
}

.standings-table .col-team>div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.standings-table .col-pts {
    width: 44px;
    font-weight: 700;
    color: var(--text-primary);
}

.standings-table tr.promo-champions .col-pos {
    border-inline-start-color: #3b82f6;
}

.standings-table tr.promo-europa .col-pos {
    border-inline-start-color: #f59e0b;
}

.standings-table tr.promo-conference .col-pos {
    border-inline-start-color: #10b981;
}

.standings-table tr.promo-libertadores .col-pos {
    border-inline-start-color: #3b82f6;
}

.standings-table tr.promo-sulamericana .col-pos {
    border-inline-start-color: #f59e0b;
}

.standings-table tr.promo-rebaixamento .col-pos {
    border-inline-start-color: #ef4444;
}

.standings-table tr.promo-playoffs .col-pos {
    border-inline-start-color: #8b5cf6;
}

/* Legenda da Tabela */
.standings-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 16px;
    font-size: 11px;
    color: var(--text-muted);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.legend-color {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.legend-color.promo-champions,
.legend-color.promo-libertadores {
    background: #3b82f6;
}

.legend-color.promo-europa,
.legend-color.promo-sulamericana {
    background: #f59e0b;
}

.legend-color.promo-conference {
    background: #10b981;
}

.legend-color.promo-rebaixamento {
    background: #ef4444;
}

.legend-color.promo-playoffs {
    background: #8b5cf6;
}

/* ========================================================= */
/* MINDMAP BRACKET TREES */
/* ========================================================= */
.bracket-root {
    overflow-x: auto;
    padding: 30px 10px;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.bracket-inner {
    display: flex;
    align-items: center;
    width: max-content;
    /* CSS centering (justify-content: center / margin: auto) on overflowing flex-containers 
       causes permanent scroll clamping and data loss on Desktop Chromium browsers.
       The centering is purposefully handled by JavaScript's scrollLeft calculation! */
}

.bracket-node-wrapper {
    display: flex;
    align-items: center;
    position: relative;
}

.bracket-children {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0;
    margin: 0;
    list-style: none;
    position: relative;
    transition: opacity 0.3s, max-height 0.3s;
}

.bracket-children.hidden {
    display: none !important;
}

.bracket-branch {
    position: relative;
    padding: 8px 0;
    margin: 0;
    display: flex;
    align-items: center;
}

/* Base card */
.bracket-node-card {
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    padding: 10px;
    font-size: 13px;
    position: relative;
    border: 1px solid var(--border-subtle);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    min-width: 190px;
    z-index: 2;
    transition: var(--transition-fast);
}

.bracket-node-card:hover {
    border-color: var(--border-active);
    box-shadow: var(--shadow-md), var(--shadow-glow-green);
}

/* Optional: if you still need the old .bracket-match inside */
.bracket-match {
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* Collapse Button */
.node-collapse-btn {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-active);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 5;
    font-size: 14px;
    line-height: 1;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    top: 50%;
    margin-top: -10px;
}

/* ========================================================= */
/* LEFT TREE (Grows leftwards) */
/* ========================================================= */
.tree-left.bracket-node-wrapper {
    flex-direction: row;
}

.tree-left>.bracket-children {
    margin-inline-end: 40px;
}

/* Keep branches anchored to the spine when width shrinks */
.tree-left .bracket-branch {
    justify-content: flex-end;
}

/* Spine */
.tree-left>.bracket-children>.bracket-branch::after {
    content: '';
    position: absolute;
    inset-inline-end: -20px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--border-active);
}

.tree-left>.bracket-children>.bracket-branch:first-child::after {
    top: 50%;
    height: 50%;
}

.tree-left>.bracket-children>.bracket-branch:last-child::after {
    height: calc(50% + 2px);
}

.tree-left>.bracket-children>.bracket-branch:only-child::after {
    display: none;
}

/* Line from Spine to Child */
.tree-left>.bracket-children>.bracket-branch::before {
    content: '';
    position: absolute;
    inset-inline-end: -20px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--border-active);
}

/* Line from Parent to Spine */
.tree-left>.bracket-node-card.has-children-left::before {
    content: '';
    position: absolute;
    inset-inline-start: -20px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--border-active);
}

/* Hide parent line if collapsed */
.tree-left>.bracket-node-card.lines-hidden::before {
    display: none;
}

/* Add padding so the button doesn't overlap team logo */
.tree-left>.bracket-node-card.has-children-left {
    padding-inline-start: 28px !important;
}

/* Button position */
.tree-left .node-collapse-btn {
    inset-inline-start: -10px;
}

/* ========================================================= */
/* RIGHT TREE (Grows rightwards) */
/* ========================================================= */
.tree-right.bracket-node-wrapper {
    flex-direction: row;
}

.tree-right>.bracket-children {
    margin-inline-start: 40px;
}

/* Keep branches anchored to the spine when width shrinks */
.tree-right .bracket-branch {
    justify-content: flex-start;
}

/* Spine */
.tree-right>.bracket-children>.bracket-branch::after {
    content: '';
    position: absolute;
    inset-inline-start: -20px;
    top: 0;
    width: 2px;
    height: 100%;
    background: var(--border-active);
}

.tree-right>.bracket-children>.bracket-branch:first-child::after {
    top: 50%;
    height: 50%;
}

.tree-right>.bracket-children>.bracket-branch:last-child::after {
    height: calc(50% + 2px);
}

.tree-right>.bracket-children>.bracket-branch:only-child::after {
    display: none;
}

/* Line from Spine to Child */
.tree-right>.bracket-children>.bracket-branch::before {
    content: '';
    position: absolute;
    inset-inline-start: -20px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--border-active);
}

/* Line from Parent to Spine */
.tree-right>.bracket-node-card.has-children-right::before {
    content: '';
    position: absolute;
    inset-inline-end: -20px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--border-active);
}

/* Hide parent line if collapsed */
.tree-right>.bracket-node-card.lines-hidden::before {
    display: none;
}

/* Add padding so the button doesn't overlap team logo */
.tree-right>.bracket-node-card.has-children-right {
    padding-inline-end: 28px !important;
}

/* Button position */
.tree-right .node-collapse-btn {
    inset-inline-end: -10px;
}

/* ========================================================= */
/* FINAL / ROOT NODE */
/* ========================================================= */
.bracket-node-card.root-card {
    margin: 0 40px;
    transform: translateY(30px);
    /* O degrau para isolar a final */
}

.bracket-node-card.root-card.has-children-both::before {
    content: '';
    position: absolute;
    inset-inline-start: -40px;
    top: calc(50% - 30px);
    width: 40px;
    height: 30px;
    border-bottom: 2px solid var(--border-active);
    border-inline-start: 2px solid var(--border-active);
    background: transparent;
    border-bottom-left-radius: 6px;
    z-index: 1;
}

.bracket-node-card.root-card.has-children-both::after {
    content: '';
    position: absolute;
    inset-inline-end: -40px;
    top: calc(50% - 30px);
    width: 40px;
    height: 30px;
    border-bottom: 2px solid var(--border-active);
    border-inline-end: 2px solid var(--border-active);
    background: transparent;
    border-bottom-right-radius: 6px;
    z-index: 1;
}

/* =======================================
   Penalty / Extra Time Score Badge
   ======================================= */
.match-extra-score {
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 700;
    text-align: center;
    margin-top: 2px;
    letter-spacing: 0.5px;
    font-family: 'JetBrains Mono', monospace;
}

.match-extra-score .pen-badge {
    display: inline-block;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
}

[data-theme="light"] .match-extra-score .pen-badge {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.match-extra-score .aet-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 1px 8px;
    border-radius: 6px;
    font-size: 0.68rem;
    font-weight: 700;
}

[data-theme="light"] .match-extra-score .aet-badge {
    background: rgba(245, 158, 11, 0.08);
    color: #d97706;
}

/* =======================================
   iPhone Style Switch
   ======================================= */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    transition: .3s;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    inset-inline-start: 3px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: .3s;
}

.switch input:checked+.slider {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.switch input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

.switch input:checked+.slider:before {
    transform: translateX(18px);
    background-color: #ffffff;
}

.switch .slider.round {
    border-radius: 34px;
}

.switch .slider.round:before {
    border-radius: 50%;
}

/* =======================================
   iPhone Style Switch
   ======================================= */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    inset-inline-start: 0;
    inset-inline-end: 0;
    bottom: 0;
    background-color: var(--bg-hover);
    border: 1px solid var(--border-subtle);
    transition: .3s;
}

.switch .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    inset-inline-start: 3px;
    bottom: 2px;
    background-color: var(--text-muted);
    transition: .3s;
}

.switch input:checked+.slider {
    background: linear-gradient(135deg, #4f8cff, #3366cc);
    border-color: transparent;
}

.switch input:focus+.slider {
    box-shadow: 0 0 1px var(--primary-color);
}

.switch input:checked+.slider:before {
    transform: translateX(18px);
    background-color: #ffffff;
}

.switch .slider.round {
    border-radius: 34px;
}

.switch .slider.round:before {
    border-radius: 50%;
}

/* ── Flame icon animation (Top Tendências) ── */
.trend-flame-icon {
    animation: flame-flicker 0.933s cubic-bezier(0.333, 0, 0.667, 1) infinite;
    transform-origin: center bottom;
    display: block;
}

@keyframes flame-flicker {
    0% {
        transform: scaleX(1) scaleY(1) skewX(0deg) rotate(0deg);
        opacity: 1;
    }

    7% {
        transform: scaleX(0.91) scaleY(1.07) skewX(-3deg) rotate(-2deg);
        opacity: 0.88;
    }

    14% {
        transform: scaleX(1.06) scaleY(0.93) skewX(2deg) rotate(2.5deg);
        opacity: 1;
    }

    21% {
        transform: scaleX(0.94) scaleY(1.05) skewX(-2deg) rotate(-1.5deg);
        opacity: 0.92;
    }

    28% {
        transform: scaleX(1.04) scaleY(0.96) skewX(3deg) rotate(2deg);
        opacity: 1;
    }

    35% {
        transform: scaleX(0.92) scaleY(1.06) skewX(-4deg) rotate(-2.5deg);
        opacity: 0.85;
    }

    42% {
        transform: scaleX(1.05) scaleY(0.94) skewX(2deg) rotate(1.5deg);
        opacity: 0.97;
    }

    50% {
        transform: scaleX(0.95) scaleY(1.04) skewX(-1deg) rotate(-1deg);
        opacity: 1;
    }

    57% {
        transform: scaleX(1.03) scaleY(0.97) skewX(3deg) rotate(2deg);
        opacity: 0.9;
    }

    64% {
        transform: scaleX(0.93) scaleY(1.05) skewX(-3deg) rotate(-2deg);
        opacity: 1;
    }

    71% {
        transform: scaleX(1.06) scaleY(0.95) skewX(2deg) rotate(1deg);
        opacity: 0.87;
    }

    78% {
        transform: scaleX(0.96) scaleY(1.03) skewX(-2deg) rotate(-1.5deg);
        opacity: 0.95;
    }

    85% {
        transform: scaleX(1.04) scaleY(0.97) skewX(1deg) rotate(2deg);
        opacity: 1;
    }

    92% {
        transform: scaleX(0.94) scaleY(1.04) skewX(-3deg) rotate(-2deg);
        opacity: 0.9;
    }

    100% {
        transform: scaleX(1) scaleY(1) skewX(0deg) rotate(0deg);
        opacity: 1;
    }
}

/* ==========================================
   RTL OVERRIDES (Árabe / dir="rtl")
   Espelha SVGs e ícones direcionais que não
   são cobertos por CSS logical properties.
   Mantenha este bloco no fim do arquivo.
   ========================================== */
[dir="rtl"] .icon-arrow-back,
[dir="rtl"] .icon-arrow-forward,
[dir="rtl"] .icon-chevron-left,
[dir="rtl"] .icon-chevron-right,
[dir="rtl"] .sidebar-toggle-chevron,
[dir="rtl"] svg.icon-directional {
    transform: scaleX(-1);
}

/* Toast slide-in: espelha direção da animação em RTL */
[dir="rtl"] .toast-enter {
    transform: translateX(-20px);
}

/* Background-position de chevron em selects (não tem versão lógica) */
[dir="rtl"] select {
    background-position: left 12px center;
}

/* Mobile drawer: em RTL o sidebar deve esconder pra DIREITA (off-screen),
   já que com inset-inline-start: 0 ele fica ancorado na borda direita.
   translateX não é direction-aware, então precisamos inverter o sinal. */
@media (max-width: 768px) {
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
        box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
    }
    [dir="rtl"] .sidebar.open {
        transform: translateX(0);
    }
}
