/* ===== PulseCore — Base ===== */
:root {
    --bg: #0c0c18;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dim: #4f46e5;
}

html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
}

* {
    transition: all 0.2s ease;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    min-height: 100vh; min-height: 100dvh;
    background: var(--bg);
    position: relative; overflow-x: hidden; overflow-y: auto;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    color: #d4d4d8;
}

.bg-orb { display: none; }

/* ===== Карточки — псевдо-стекло ===== */
.widget-card {
    background: linear-gradient(180deg,
        rgba(255,255,255,0.055) 0%,
        rgba(255,255,255,0.02) 100%);
    border-radius: 14px;
    padding: clamp(14px, 2.5vw, 20px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.18),
        0 1px 2px rgba(0,0,0,0.12);
    cursor: pointer; display: flex; flex-direction: column;
    transition: all 0.3s ease;
}
.widget-card:hover {
    background: linear-gradient(180deg,
        rgba(255,255,255,0.075) 0%,
        rgba(255,255,255,0.03) 100%);
    border-color: rgba(99,102,241,0.28);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        inset 0 -1px 0 rgba(0,0,0,0.18),
        0 0 16px rgba(99,102,241,0.12),
        0 2px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px);
}

/* Стекло — тот же псевдо-стеклянный стиль */
.glass {
    background: linear-gradient(180deg,
        rgba(255,255,255,0.06) 0%,
        rgba(255,255,255,0.02) 100%);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.15);
}
.glass-strong {
    background: linear-gradient(180deg,
        rgba(255,255,255,0.08) 0%,
        rgba(255,255,255,0.03) 100%);
    backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        inset 0 -1px 0 rgba(0,0,0,0.18);
}
.glass-sidebar {
    background: rgba(12,12,24,0.88);
    backdrop-filter: blur(26px); -webkit-backdrop-filter: blur(26px);
    border-right: 1px solid rgba(255,255,255,0.04);
}

/* Навигация */
.nav-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 13px;
    border-radius: 8px; cursor: pointer; color: #71717a;
    border-left: 2px solid transparent; user-select: none;
    font-size: 0.85rem; font-weight: 500;
}
.nav-item:hover { background: rgba(99,102,241,0.06); color: #a5b4fc; }
.nav-item.active { background: rgba(99,102,241,0.10); color: var(--accent-light); border-left-color: var(--accent); }
.nav-item .nav-icon { font-size: 1.05rem; width: 20px; text-align: center; }
.nav-item.admin-item { border-left-color: #10b981; }

/* Кнопки */
.btn-gold {
    background: linear-gradient(135deg, var(--accent), #4f46e5);
    color: #fff; font-weight: 600; border: none; border-radius: 10px;
    padding: 11px 18px; cursor: pointer; font-size: 0.88rem;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 3px 10px rgba(0,0,0,0.2);
}
.btn-gold:hover { opacity: 0.92; transform: translateY(-1px); }

/* PRO */
.pro-badge {
    background: linear-gradient(135deg, #a855f7, #6b21a8);
    color: #fff; font-weight: 700; font-size: 0.6rem; padding: 2px 10px;
    border-radius: 20px; display: inline-flex; align-items: center; gap: 3px;
}
.pro-diamond { animation: diamondSpin 4s linear infinite; }
@keyframes diamondSpin { 0% { transform: rotateY(0deg); } 100% { transform: rotateY(360deg); } }

.amount-gold { color: var(--accent-light); font-weight: 600; }

/* Табы */
.league-tab {
    padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 600;
    cursor: pointer; color: #71717a;
    background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.015) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    white-space: nowrap;
}
.league-tab:hover { color: #a5b4fc; background: rgba(99,102,241,0.06); }
.league-tab.active { color: var(--accent-light); background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.30); }
.league-tab.my-league { border-color: rgba(99,102,241,0.35); }

.content-panel { animation: slideIn 0.3s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.spinner { width: 32px; height: 32px; border: 2px solid rgba(255,255,255,0.05); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
.spinner-sm { width: 14px; height: 14px; border-width: 2px; border: 2px solid rgba(255,255,255,0.10); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.mobile-nav-item {
    display: flex; align-items: center; gap: 10px; padding: 10px 13px;
    border-radius: 8px; cursor: pointer; color: #71717a;
    border-left: 2px solid transparent; font-weight: 500; font-size: 0.85rem;
}

.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal-box { background: #12121f; border-radius: 14px; padding: 20px; max-width: 400px; width: 90%; border: 1px solid rgba(255,255,255,0.08); }

.flatpickr-input {
    background: rgba(255,255,255,0.03)!important; border: 1px solid rgba(255,255,255,0.06)!important;
    border-radius: 8px!important; color: #fff!important; padding: 10px 12px!important;
    font-size: 0.85rem!important; font-family: 'Inter'!important; width: 100%!important;
}
.flatpickr-input:focus { border-color: var(--accent)!important; outline: none!important; }

::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(99,102,241,0.08); border-radius: 20px; }
* { scrollbar-width: thin; scrollbar-color: rgba(99,102,241,0.08) transparent; }

.ptr-indicator { position: fixed; top: 0; left: 0; right: 0; z-index: 100; display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--accent-light); font-size: 0.75rem; height: 0; overflow: hidden; transition: height 0.3s; background: rgba(12,12,24,0.95); backdrop-filter: blur(10px); }
.ptr-indicator.active { height: 48px; }
.ptr-indicator.done { color: #34d399; }

#mobileHeader { padding-top: 0; padding-bottom: 0; }

.hall-checkbox-card {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    padding: 5px 8px !important;
    border-radius: 6px !important;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255,255,255,0.045) 0%, rgba(255,255,255,0.015) 100%) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    box-sizing: border-box;
    min-width: 0;
}

.hall-checkbox-card:hover {
    background: rgba(99, 102, 241, 0.06) !important;
    border-color: rgba(99, 102, 241, 0.2) !important;
}

.hall-checkbox-card.selected {
    background: rgba(99, 102, 241, 0.1) !important;
    border-color: rgba(99, 102, 241, 0.3) !important;
}

.hall-checkbox-card input[type="checkbox"] {
    accent-color: #6366f1 !important;
    width: 13px !important;
    height: 13px !important;
    flex-shrink: 0;
    margin: 0;
}

.hall-checkbox-card span {
    flex: 0 0 auto !important;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px !important;
    color: #ffffff !important;
    text-align: left !important;
}

.lineup-row { display: flex; align-items: flex-start; padding: 9px 10px; border-radius: 8px; margin-bottom: 4px; background: rgba(255,255,255,0.012); border: 1px solid rgba(255,255,255,0.03); gap: 8px; }
.player-row { background: rgba(99,102,241,0.06) !important; border-color: rgba(99,102,241,0.12) !important; }
.lineup-row .lineup-info { display: flex; align-items: center; gap: 6px; flex-shrink: 0; flex-wrap: wrap; min-width: 100px; }
.lineup-row .time-badge { font-size: 0.7rem; font-weight: 600; color: var(--accent-light); background: rgba(99,102,241,0.08); padding: 2px 6px; border-radius: 4px; }
.lineup-row .league-badge { font-size: 0.65rem; font-weight: 600; color: #818cf8; background: rgba(99,102,241,0.06); padding: 2px 6px; border-radius: 4px; }
.lineup-row .hall-badge { font-size: 0.65rem; color: #71717a; }
.lineup-row .players-text { font-size: 0.7rem; color: #71717a; flex: 1; line-height: 1.4; }
.players-text .player-name { display: block; }

.date-tab {
    padding: 6px 12px; border-radius: 6px; font-size: 0.75rem; font-weight: 600;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.015) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.05);
    color: #71717a;
}
.date-tab.active { background: rgba(99,102,241,0.10); border-color: rgba(99,102,241,0.30); color: var(--accent-light); }
.date-tab:hover { background: rgba(255,255,255,0.03); color: #a5b4fc; }

@media (max-width: 480px) {
    .lineup-row { flex-direction: column; gap: 6px; }
    .lineup-row .lineup-info { width: 100%; }
    .lineup-row .players-text { width: 100%; }
}

/* ===== Live Tournament ===== */
.live-badge {
    background: #ef4444; color: #fff; font-size: 0.65rem; font-weight: 700;
    padding: 3px 10px; border-radius: 20px; display: inline-flex;
    align-items: center; gap: 4px; animation: pulse 2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }

.player-tag {
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.02) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    border-radius: 10px; padding: 4px 10px; font-size: 0.75rem; color: #d1d5db;
}

/* Чат */
.chat-message {
    background: rgba(255,255,255,0.02); border-radius: 12px; padding: 8px 12px;
    margin-bottom: 6px; position: relative; overflow: hidden;
    touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.chat-name { color: #818cf8; font-weight: 600; font-size: 0.75rem; }
.chat-text { color: #e5e5e5; font-size: 0.85rem; word-break: break-word; }
.chat-time { color: #52525b; font-size: 0.6rem; }

.reply-preview-bar {
    background: rgba(99,102,241,0.1); border-left: 2px solid #6366f1;
    border-radius: 4px; padding: 5px 8px; margin-bottom: 6px; cursor: pointer;
}
.reply-sender { color: #6366f1; font-weight: 600; font-size: 0.7rem; }
.reply-content {
    color: #a1a1aa; font-size: 0.73rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.reply-bar {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: rgba(99,102,241,0.08); border-left: 3px solid #6366f1;
    border-radius: 10px; margin-bottom: 8px;
    animation: slideDown 0.2s ease;
}
.reply-bar.hidden { display: none; }
.reply-bar-info { flex: 1; min-width: 0; }
.reply-bar-sender { color: #6366f1; font-weight: 600; font-size: 0.72rem; }
.reply-bar-text {
    color: #a1a1aa; font-size: 0.75rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.reply-bar-close {
    color: #71717a; font-size: 1.2rem; cursor: pointer;
    padding: 4px 8px; flex-shrink: 0;
}
.reply-bar-close:hover { color: #ef4444; }

.chat-input {
    background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; color: #e5e5e5; padding: 10px 14px;
    font-size: 0.85rem; width: 100%; outline: none; font-family: 'Inter';
}
.chat-input:focus { border-color: #6366f1; }

.btn-send {
    background: linear-gradient(135deg, #6366f1, #4f46e5); color: #fff;
    font-weight: 600; border: none; border-radius: 12px; padding: 10px 16px;
    cursor: pointer; font-size: 0.85rem; white-space: nowrap; flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 3px 10px rgba(0,0,0,0.2);
}
.btn-send:hover { opacity: 0.92; }
.btn-send:disabled { opacity: 0.4; cursor: not-allowed; }

.fullscreen-btn {
    position: absolute; bottom: 12px; right: 12px; z-index: 10;
    background: rgba(0,0,0,0.6); color: #fff; border: 1px solid rgba(255,255,255,0.2);
    border-radius: 8px; padding: 6px 12px; font-size: 0.75rem; cursor: pointer;
    display: flex; align-items: center; gap: 6px;
}
.fullscreen-btn:hover { background: rgba(0,0,0,0.8); }

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

#topWeekPanel { scroll-behavior: smooth; }

/* ===== Dark Theme (Deep Space) ===== */
[data-theme="dark"] {
    --bg: #0c0c18;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-dim: #4f46e5;
}
[data-theme="dark"] .bg-mesh {
    position: fixed; inset: 0; z-index: -5; opacity: 0.5;
    background: radial-gradient(ellipse at 30% 50%, rgba(99,102,241,0.08) 0%, transparent 60%), radial-gradient(ellipse at 70% 40%, rgba(139,92,246,0.05) 0%, transparent 50%), radial-gradient(ellipse at 50% 80%, rgba(79,70,229,0.04) 0%, transparent 55%);
}
[data-theme="dark"] .bg-grid {
    position: fixed; inset: 0; z-index: -4; opacity: 0.05;
    background-image: linear-gradient(rgba(99,102,241,0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(99,102,241,0.08) 1px, transparent 1px);
    background-size: 44px 44px;
}
@media (max-width: 767px) { [data-theme="dark"] .bg-grid { background-size: 30px 30px; } }
[data-theme="dark"] .nebula {
    position: fixed; inset: 0; z-index: -3; pointer-events: none;
    background: radial-gradient(ellipse at 50% 50%, rgba(99,102,241,0.04) 0%, transparent 70%);
    animation: nebulaBreathe 8s ease-in-out infinite;
}
[data-theme="dark"] .stars { position: fixed; inset: 0; z-index: -2; pointer-events: none; }

/* ===== Ocean Theme (Северное сияние) ===== */
[data-theme="ocean"] {
    --bg: #0a1628;
    --accent: #2ee5f5;
    --accent-light: #8af0ff;
    --accent-dim: #22d3ee;
}
[data-theme="ocean"] body { background: #060d1a; color: #cbd5e1; }
[data-theme="ocean"] .bg-mesh {
    position: fixed; inset: 0; z-index: -5; opacity: 0.7;
    background:
            radial-gradient(ellipse at 30% 50%, rgba(6,182,212,0.12) 0%, transparent 60%),
            radial-gradient(ellipse at 70% 30%, rgba(34,211,238,0.08) 0%, transparent 50%),
            radial-gradient(ellipse at 50% 90%, rgba(8,145,178,0.1) 0%, transparent 55%),
            linear-gradient(180deg, #040d1a 0%, #061220 40%, #0a1830 70%, #061220 100%);
    animation: oceanWaves 12s ease-in-out infinite;
}
[data-theme="ocean"] .bg-grid {
    position: fixed; inset: 0; z-index: -4; opacity: 0.03;
    background-image:
            linear-gradient(rgba(6,182,212,0.2) 1px, transparent 1px),
            linear-gradient(90deg, rgba(6,182,212,0.12) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: oceanGrid 15s linear infinite;
}
@media (max-width: 767px) { [data-theme="ocean"] .bg-grid { background-size: 40px 40px; } }
[data-theme="ocean"] .nebula {
    position: fixed; inset: 0; z-index: -3; pointer-events: none;
    background:
            radial-gradient(ellipse at 50% 20%, rgba(6,182,212,0.1) 0%, transparent 55%),
            radial-gradient(ellipse at 50% 100%, rgba(34,211,238,0.06) 0%, transparent 50%);
    animation: oceanBreathe 8s ease-in-out infinite;
}
[data-theme="ocean"] .stars { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
[data-theme="ocean"] .widget-card {
    background: linear-gradient(180deg, rgba(6,182,212,0.055) 0%, rgba(6,182,212,0.02) 100%);
    border-color: rgba(6,182,212,0.12);
    box-shadow: inset 0 1px 0 rgba(138,240,255,0.10), inset 0 -1px 0 rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
}
[data-theme="ocean"] .widget-card:hover {
    background: linear-gradient(180deg, rgba(6,182,212,0.09) 0%, rgba(6,182,212,0.03) 100%);
    border-color: rgba(6,182,212,0.32);
    box-shadow: inset 0 1px 0 rgba(138,240,255,0.16), inset 0 -1px 0 rgba(0,0,0,0.18), 0 0 16px rgba(6,182,212,0.15), 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="ocean"] .glass, [data-theme="ocean"] .glass-strong {
    background: linear-gradient(180deg, rgba(6,182,212,0.06) 0%, rgba(6,182,212,0.02) 100%);
    border-color: rgba(6,182,212,0.10);
    box-shadow: inset 0 1px 0 rgba(138,240,255,0.08), inset 0 -1px 0 rgba(0,0,0,0.15);
}
[data-theme="ocean"] .glass-sidebar { background: rgba(6,13,26,0.9); border-right-color: rgba(6,182,212,0.08); }
[data-theme="ocean"] .nav-item { color: #94a3b8; }
[data-theme="ocean"] .nav-item:hover { background: rgba(6,182,212,0.08); color: #67e8f9; }
[data-theme="ocean"] .nav-item.active { background: rgba(6,182,212,0.12); color: #22d3ee; border-left-color: #06b6d4; }
[data-theme="ocean"] .mobile-nav-item { color: #94a3b8; }
[data-theme="ocean"] .btn-gold { background: linear-gradient(135deg, #06b6d4, #0891b2); }
[data-theme="ocean"] .pro-badge { background: linear-gradient(135deg, #06b6d4, #0891b2); }
[data-theme="ocean"] .amount-gold { color: #22d3ee; }
[data-theme="ocean"] .chat-message { background: rgba(6,182,212,0.04); }
[data-theme="ocean"] .chat-name { color: #22d3ee; }
[data-theme="ocean"] .chat-input { background: rgba(6,182,212,0.05); border-color: rgba(6,182,212,0.1); color: #e2e8f0; }
[data-theme="ocean"] .chat-input:focus { border-color: #06b6d4; }
[data-theme="ocean"] .btn-send { background: linear-gradient(135deg, #06b6d4, #0891b2); }
[data-theme="ocean"] .live-badge { background: #06b6d4; }
[data-theme="ocean"] .player-tag {
    background: linear-gradient(180deg, rgba(6,182,212,0.06) 0%, rgba(6,182,212,0.02) 100%);
    border-color: rgba(6,182,212,0.14);
    color: #cbd5e1;
}
[data-theme="ocean"] .hall-checkbox-card {
    background: linear-gradient(180deg, rgba(6,182,212,0.05) 0%, rgba(6,182,212,0.015) 100%) !important;
    border-color: rgba(6,182,212,0.10) !important;
}
[data-theme="ocean"] .hall-checkbox-card:hover { background: rgba(6,182,212,0.08) !important; }
[data-theme="ocean"] .hall-checkbox-card.selected { background: rgba(6,182,212,0.12) !important; border-color: rgba(6,182,212,0.25) !important; }
[data-theme="ocean"] .hall-checkbox-card input[type="checkbox"] { accent-color: #06b6d4; }
[data-theme="ocean"] .date-tab {
    background: linear-gradient(180deg, rgba(6,182,212,0.045) 0%, rgba(6,182,212,0.015) 100%);
    border-color: rgba(6,182,212,0.10);
    color: #94a3b8;
}
[data-theme="ocean"] .date-tab.active { background: rgba(6,182,212,0.12); color: #22d3ee; }
[data-theme="ocean"] .lineup-row { background: rgba(6,182,212,0.02); border-color: rgba(6,182,212,0.05); }
[data-theme="ocean"] .player-row { background: rgba(6,182,212,0.06)!important; border-color: rgba(6,182,212,0.15)!important; }
[data-theme="ocean"] .lineup-row .time-badge { color: #22d3ee; background: rgba(6,182,212,0.1); }
[data-theme="ocean"] .lineup-row .league-badge { color: #67e8f9; background: rgba(6,182,212,0.08); }
[data-theme="ocean"] .ptr-indicator { background: rgba(6,13,26,0.95); color: #22d3ee; }
[data-theme="ocean"] .spinner { border-color: rgba(6,182,212,0.1); border-top-color: #06b6d4; }
[data-theme="ocean"] .spinner-sm { border-color: rgba(6,182,212,0.1); border-top-color: #06b6d4; }
[data-theme="ocean"] ::-webkit-scrollbar-thumb { background: rgba(6,182,212,0.1); }
[data-theme="ocean"] .flatpickr-input { background: rgba(6,182,212,0.05)!important; border-color: rgba(6,182,212,0.1)!important; }
[data-theme="ocean"] .flatpickr-input:focus { border-color: #06b6d4!important; }
[data-theme="ocean"] .modal-box { background: #0a1628; border-color: rgba(6,182,212,0.1); }

/* ===== Mars Theme (Марсианская пустыня) ===== */
[data-theme="mars"] {
    --bg: #1a0f0a;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-dim: #d97706;
}
[data-theme="mars"] body {
    background: #120a06;
    color: #d4c5b5;
}
[data-theme="mars"] .bg-mesh {
    position: fixed; inset: 0; z-index: -5; opacity: 0.6;
    background:
            radial-gradient(ellipse at 50% 30%, rgba(245,158,11,0.08) 0%, transparent 60%),
            radial-gradient(ellipse at 50% 80%, rgba(251,191,36,0.06) 0%, transparent 55%),
            linear-gradient(180deg, #1a0f0a 0%, #241410 40%, #2d1a10 70%, #1a0f0a 100%);
}
[data-theme="mars"] .bg-grid { display: none; }
[data-theme="mars"] .nebula { display: none; }
[data-theme="mars"] .stars { position: fixed; inset: 0; z-index: -2; pointer-events: none; }
[data-theme="mars"] .widget-card {
    background: linear-gradient(180deg, rgba(245,158,11,0.055) 0%, rgba(245,158,11,0.02) 100%);
    border-color: rgba(245,158,11,0.12);
    box-shadow: inset 0 1px 0 rgba(251,191,36,0.10), inset 0 -1px 0 rgba(0,0,0,0.18), 0 1px 2px rgba(0,0,0,0.12);
}
[data-theme="mars"] .widget-card:hover {
    background: linear-gradient(180deg, rgba(245,158,11,0.09) 0%, rgba(245,158,11,0.03) 100%);
    border-color: rgba(245,158,11,0.28);
    box-shadow: inset 0 1px 0 rgba(251,191,36,0.16), inset 0 -1px 0 rgba(0,0,0,0.18), 0 0 16px rgba(245,158,11,0.12), 0 2px 8px rgba(0,0,0,0.2);
}
[data-theme="mars"] .glass, [data-theme="mars"] .glass-strong {
    background: linear-gradient(180deg, rgba(245,158,11,0.06) 0%, rgba(245,158,11,0.02) 100%);
    border-color: rgba(245,158,11,0.10);
    box-shadow: inset 0 1px 0 rgba(251,191,36,0.08), inset 0 -1px 0 rgba(0,0,0,0.15);
}
[data-theme="mars"] .glass-sidebar { background: rgba(26,15,10,0.9); border-right-color: rgba(245,158,11,0.08); }
[data-theme="mars"] .nav-item { color: #a09480; }
[data-theme="mars"] .nav-item:hover { background: rgba(245,158,11,0.08); color: #fbbf24; }
[data-theme="mars"] .nav-item.active { background: rgba(245,158,11,0.12); color: #f59e0b; border-left-color: #f59e0b; }
[data-theme="mars"] .mobile-nav-item { color: #a09480; }
[data-theme="mars"] .btn-gold { background: linear-gradient(135deg, #f59e0b, #d97706); }
[data-theme="mars"] .pro-badge { background: linear-gradient(135deg, #f59e0b, #d97706); }
[data-theme="mars"] .amount-gold { color: #fbbf24; }
[data-theme="mars"] .chat-message { background: rgba(245,158,11,0.04); }
[data-theme="mars"] .chat-name { color: #fbbf24; }
[data-theme="mars"] .chat-input { background: rgba(245,158,11,0.05); border-color: rgba(245,158,11,0.1); color: #d4c5b5; }
[data-theme="mars"] .chat-input:focus { border-color: #f59e0b; }
[data-theme="mars"] .btn-send { background: linear-gradient(135deg, #f59e0b, #d97706); }
[data-theme="mars"] .live-badge { background: #f59e0b; }
[data-theme="mars"] .player-tag {
    background: linear-gradient(180deg, rgba(245,158,11,0.06) 0%, rgba(245,158,11,0.02) 100%);
    border-color: rgba(245,158,11,0.14);
    color: #d4c5b5;
}
[data-theme="mars"] .hall-checkbox-card {
    background: linear-gradient(180deg, rgba(245,158,11,0.05) 0%, rgba(245,158,11,0.015) 100%) !important;
    border-color: rgba(245,158,11,0.10) !important;
}
[data-theme="mars"] .hall-checkbox-card:hover { background: rgba(245,158,11,0.08) !important; }
[data-theme="mars"] .hall-checkbox-card.selected { background: rgba(245,158,11,0.12) !important; border-color: rgba(245,158,11,0.25) !important; }
[data-theme="mars"] .hall-checkbox-card input[type="checkbox"] { accent-color: #f59e0b; }
[data-theme="mars"] .date-tab {
    background: linear-gradient(180deg, rgba(245,158,11,0.045) 0%, rgba(245,158,11,0.015) 100%);
    border-color: rgba(245,158,11,0.10);
    color: #a09480;
}
[data-theme="mars"] .date-tab.active { background: rgba(245,158,11,0.12); color: #fbbf24; }
[data-theme="mars"] .lineup-row { background: rgba(245,158,11,0.02); border-color: rgba(245,158,11,0.05); }
[data-theme="mars"] .player-row { background: rgba(245,158,11,0.06)!important; border-color: rgba(245,158,11,0.15)!important; }
[data-theme="mars"] .lineup-row .time-badge { color: #fbbf24; background: rgba(245,158,11,0.1); }
[data-theme="mars"] .lineup-row .league-badge { color: #fcd34d; background: rgba(245,158,11,0.08); }
[data-theme="mars"] .ptr-indicator { background: rgba(26,15,10,0.95); color: #fbbf24; }
[data-theme="mars"] .spinner { border-color: rgba(245,158,11,0.1); border-top-color: #f59e0b; }
[data-theme="mars"] .spinner-sm { border-color: rgba(245,158,11,0.1); border-top-color: #f59e0b; }
[data-theme="mars"] ::-webkit-scrollbar-thumb { background: rgba(245,158,11,0.1); }
[data-theme="mars"] .flatpickr-input { background: rgba(245,158,11,0.05)!important; border-color: rgba(245,158,11,0.1)!important; }
[data-theme="mars"] .flatpickr-input:focus { border-color: #f59e0b!important; }
[data-theme="mars"] .modal-box { background: #1a0f0a; border-color: rgba(245,158,11,0.1); }

@keyframes oceanWaves {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}
@keyframes oceanGrid {
    0% { transform: translateY(0); }
    100% { transform: translateY(-60px); }
}
@keyframes oceanBreathe {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.03); }
}

@keyframes nebulaBreathe { 0%,100%{opacity:.5;transform:scale(1)} 50%{opacity:.8;transform:scale(1.05)} }

@keyframes sandDrift {
    0% { transform: translate(0, 0); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translate(var(--drift-x), var(--drift-y)); opacity: 0; }
}

/* ===== Theme Picker (Bottom Sheet) ===== */
.theme-sheet-overlay {
    position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,0.5);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
}
.theme-sheet-overlay.open { opacity: 1; pointer-events: auto; }

.theme-sheet {
    background: #18181b; border-radius: 20px 20px 0 0; width: 100%; max-width: 500px;
    padding: 20px 16px 32px; transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    border: 1px solid rgba(255,255,255,0.06); border-bottom: none;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}
.theme-sheet-overlay.open .theme-sheet { transform: translateY(0); }

.theme-sheet-handle {
    width: 36px; height: 4px; background: rgba(255,255,255,0.2);
    border-radius: 2px; margin: 0 auto 18px;
}

.theme-sheet-title {
    color: #fff; font-size: 1rem; font-weight: 700; margin-bottom: 16px; text-align: center;
}

.theme-sheet-btn {
    display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px;
    border-radius: 12px; font-size: 0.9rem; font-weight: 500; cursor: pointer;
    border: none; text-align: left;
    color: #d4d4d8;
    background: rgba(255,255,255,0.03);
    margin-bottom: 4px;
}
.theme-sheet-btn:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}
.theme-sheet-btn.active {
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-weight: 600;
}

.theme-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #d4d4d8;
}
.theme-sheet-btn.active .theme-name {
    color: #fff;
}

.theme-desc {
    font-size: 0.7rem;
    color: #71717a;
    margin-top: 2px;
}

.theme-toggle-btn {
    display: flex; align-items: center; gap: 5px; padding: 6px 12px;
    border-radius: 8px; font-size: 0.78rem; font-weight: 500; cursor: pointer;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.025) 100%);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    color: #a1a1aa;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.theme-toggle-btn:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.15);
    color: #e5e5e5;
}

/* ===== Context Menu ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
#starsContainer {
    position: fixed !important;
    inset: 0 !important;
    z-index: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
    pointer-events: none;
}

/* Матчи турнира */
.matches-container {
    margin-top: 10px;
    background: rgba(255,255,255,0.02);
    border-radius: 10px;
    padding: 10px;
    border: 1px solid rgba(255,255,255,0.04);
}

.matches-header {
    display: grid;
    grid-template-columns: 80px 1fr 50px 100px;
    gap: 8px;
    padding: 6px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    color: #52525b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 4px;
}

.match-row {
    display: grid;
    grid-template-columns: 80px 1fr 50px 100px;
    gap: 8px;
    padding: 6px 8px;
    font-size: 0.75rem;
    color: #d4d4d8;
    align-items: center;
    border-radius: 6px;
    transition: background 0.15s;
}

.match-row:hover {
    background: rgba(255,255,255,0.03);
}

.match-stage {
    color: #818cf8;
    font-weight: 600;
    font-size: 0.7rem;
}

.match-players {
    color: #e5e5e5;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.match-score {
    color: #fff;
    font-weight: 700;
    text-align: center;
    font-size: 0.75rem;
}

.match-winner {
    color: #34d399;
    font-size: 0.7rem;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 480px) {
    .matches-header,
    .match-row {
        grid-template-columns: 60px 1fr 40px 80px;
        gap: 4px;
        padding: 4px 5px;
    }

    .matches-header {
        font-size: 0.55rem;
    }

    .match-row {
        font-size: 0.65rem;
    }

    .match-stage {
        font-size: 0.6rem;
    }

    .match-score {
        font-size: 0.65rem;
    }

    .match-winner {
        font-size: 0.6rem;
    }
}
/* ===== PWA Fix — input короче ===== */
.apple-card input,
.apple-card .flatpickr-input,
.flatpickr-input {
    width: 93% !important;
    max-width: 93% !important;
    box-sizing: border-box !important;
}

/* Сайдбар для десктопа */
@media (min-width: 768px) {
    .glass-sidebar.hidden {
        display: flex !important;
    }
}

.sub-block {
    background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.025) 100%);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 48px 24px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.18),
        0 8px 32px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    margin: 0 auto;
}

.sub-block-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(10, 132, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.sub-block-title {
    font-size: 20px;
    font-weight: 800;
    color: #f5f5f7;
    letter-spacing: -0.3px;
    margin-bottom: 8px;
}

.sub-block-text {
    font-size: 14px;
    color: #98989d;
    margin-bottom: 24px;
    line-height: 1.4;
}

.sub-block-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: 999px;
    background: #0a84ff;
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.2px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.sub-block-btn:hover {
    background: #409cff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(10, 132, 255, 0.3);
}

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

.action-title-3d {
    font-size: 24px;
    font-weight: 900;
    background: linear-gradient(180deg, #ffffff 0%, #e0e7ff 25%, #818cf8 50%, #4f46e5 75%, #312e81 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
    position: relative;
    display: inline-block;
    line-height: 1.1;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5))
    drop-shadow(0 0 20px rgba(99, 102, 241, 0.3))
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    transform: perspective(600px) rotateX(8deg);
    transition: all 0.4s cubic-bezier(0.25, 0.1, 0.25, 1);
    animation: titlePulse 3s ease-in-out infinite;
    flex: 1;
}

.action-title-3d::before {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    color: rgba(79, 70, 229, 0.6);
    -webkit-text-fill-color: rgba(79, 70, 229, 0.6);
    transform: translateY(8px) translateX(3px);
    filter: blur(8px);
    opacity: 0.8;
}

.action-title-3d::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #818cf8, #c7d2fe, #818cf8, transparent);
    border-radius: 2px;
    filter: drop-shadow(0 0 8px rgba(99, 102, 241, 0.8));
    animation: lineGlow 3s ease-in-out infinite;
}

@media (min-width: 768px) {
    .action-title-3d {
        font-size: 28px;
        letter-spacing: -1px;
    }
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #f5f5f7;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.025) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    text-decoration: none;
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.mobile-nav-item:active {
    transform: scale(0.97);
    background: rgba(10, 132, 255, 0.15);
    border-color: rgba(10, 132, 255, 0.3);
}

.mobile-nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    flex-shrink: 0;
}

/* ===== БУРГЕР-МЕНЮ ===== */

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #f5f5f7;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.025) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    text-decoration: none;
}

.mobile-nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
}

.mobile-nav-item:active {
    transform: scale(0.97);
    background: rgba(10, 132, 255, 0.15);
    border-color: rgba(10, 132, 255, 0.3);
}

.mobile-nav-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a5b4fc;
    flex-shrink: 0;
}

/* Админка — зелёная подсветка */
#mobile-nav-admin {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #a7f3d0;
}

#mobile-nav-admin .mobile-nav-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

#mobile-nav-admin:hover {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.4);
}

.profile-premium-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 0;
}

.profile-premium-badge svg {
    display: block;
    width: 100%;
    height: 100%;
}

#profilePage #settings-account,
#profilePage #settings-subscription,
#profilePage #settings-appearance,
#profilePage #settings-security,
#profilePage #settings-share {
}

/* ===== SPA layout: #appRoot как flex-child на десктопе ===== */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
@media (min-width: 768px) {
    body {
        flex-direction: row;
    }
}

#appRoot {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    min-height: 0;
}

#appRoot > main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

#appRoot {
    flex: 1;
    min-width: 0;
    min-height: 0;
}

#appRoot > #sidebarContainer {
    flex-shrink: 0;
    width: auto;
}

#appRoot > #sidebarContainer > aside {
    height: 100vh;
    min-height: 100vh;
}

#appRoot > main {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    #appRoot {
        display: flex !important;
        flex-direction: row !important;
    }
}

@media (max-width: 767px) {
    #appRoot {
        display: flex;
        flex-direction: column;
    }
    #appRoot > #sidebarContainer {
        width: 100%;
    }
}

/* ===== NEBULA THEME — брендовый космос PulseCore ===== */
[data-theme="nebula"] {
    --bg: #0A0A0F;
    --accent: #8B5CF6;
    --accent-light: #A78BFA;
    --accent-dim: #6366F1;
}
[data-theme="nebula"] body {
    background: #0A0A0F;
    color: #d8c8f0;
}

/* ===== ФОН — глубина + свет, без шума ===== */

/* Слой 1. Глубина (статика): вертикальный градиент */
[data-theme="nebula"] .bg-mesh {
    position: fixed; inset: 0; z-index: -6;
    background:
        /* источник света: violet, 30% слева, 35% сверху */
        radial-gradient(ellipse 85% 75% at 30% 35%,
            rgba(139, 92, 246, 0.07) 0%,
            rgba(139, 92, 246, 0.03) 40%,
            transparent 75%),
        /* вторичный источник: indigo, правый-низ */
        radial-gradient(ellipse 60% 55% at 80% 80%,
            rgba(99, 102, 241, 0.04) 0%,
            transparent 65%),
        /* основа: вертикальный градиент глубины */
        linear-gradient(180deg,
            #08070C 0%,
            #0A0A0F 50%,
            #0C0B14 100%);
    animation: nebulaDrift 180s ease-in-out infinite;
    will-change: transform;
}

/* Слой 2. Точка-сетка (статика): тонкая структура */
[data-theme="nebula"] .bg-grid {
    position: fixed; inset: 0; z-index: -5;
    background-image:
        radial-gradient(circle, rgba(167, 139, 250, 0.05) 1px, transparent 1px);
    background-size: 64px 64px;
    background-position: 0 0;
    opacity: 1;
    animation: none;
}

/* Слой 3. Дыхание (микро): вторичный источник света чуть дышит */
[data-theme="nebula"] .nebula {
    position: fixed; inset: 0; z-index: -4; pointer-events: none;
    background:
        radial-gradient(ellipse 50% 45% at 30% 35%,
            rgba(139, 92, 246, 0.03) 0%,
            transparent 70%);
    animation: nebulaBreathe 20s ease-in-out infinite;
    will-change: opacity;
}

/* Слой 4. Пыль убрана — никаких точек */
[data-theme="nebula"] .stars { display: none; }

/* ===== Стеклянные карточки — брендовые цвета ===== */
[data-theme="nebula"] .widget-card,
[data-theme="nebula"] .apple-card {
    position: relative;
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.06) 0%, rgba(99, 102, 241, 0.025) 100%);
    border: 1px solid rgba(139, 92, 246, 0.14);
    box-shadow:
            inset 0 1px 0 rgba(167, 139, 250, 0.12),
            inset 0 -1px 0 rgba(0, 0, 0, 0.20),
            0 1px 2px rgba(0, 0, 0, 0.15);
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
}
[data-theme="nebula"] .widget-card:hover,
[data-theme="nebula"] .apple-card:hover {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.09) 0%, rgba(99, 102, 241, 0.035) 100%);
    border-color: rgba(167, 139, 250, 0.32);
    box-shadow:
            inset 0 1px 0 rgba(167, 139, 250, 0.20),
            inset 0 -1px 0 rgba(0, 0, 0, 0.20),
            0 0 20px rgba(139, 92, 246, 0.15),
            0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="nebula"] .widget-card::before,
[data-theme="nebula"] .apple-card::before {
    content: '';
    position: absolute;
    top: 0; left: 12%; right: 12%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(167, 139, 250, 0.35), transparent);
    pointer-events: none;
}

[data-theme="nebula"] .glass,
[data-theme="nebula"] .glass-strong {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.07) 0%, rgba(99, 102, 241, 0.025) 100%);
    border: 1px solid rgba(139, 92, 246, 0.12);
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.10), inset 0 -1px 0 rgba(0,0,0,0.15);
}
[data-theme="nebula"] .glass-sidebar {
    background: rgba(10, 10, 15, 0.94);
    border-right: 1px solid rgba(139, 92, 246, 0.10);
    box-shadow: 1px 0 0 rgba(167, 139, 250, 0.04) inset;
}

[data-theme="nebula"] .glass-sidebar h1 {
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5))
            drop-shadow(0 0 16px rgba(99, 102, 241, 0.25));
}

[data-theme="nebula"] .nav-item { color: #a99bc4; }
[data-theme="nebula"] .nav-item:hover {
    background: rgba(139, 92, 246, 0.07);
    color: #c4b5fd;
}
[data-theme="nebula"] .nav-item.active {
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.18) 0%, rgba(99, 102, 241, 0.04) 100%);
    color: #e9d5ff;
    border-left-color: #A78BFA;
    box-shadow:
            inset 0 1px 0 rgba(167, 139, 250, 0.15),
            0 0 12px rgba(139, 92, 246, 0.15);
    text-shadow: 0 0 8px rgba(167, 139, 250, 0.4);
}

[data-theme="nebula"] .btn-gold {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.20),
            0 4px 14px rgba(139, 92, 246, 0.35);
}
[data-theme="nebula"] .btn-gold:hover {
    box-shadow:
            inset 0 1px 0 rgba(255, 255, 255, 0.25),
            0 6px 20px rgba(139, 92, 246, 0.55);
}

[data-theme="nebula"] .btn-send {
    background: linear-gradient(135deg, #8B5CF6 0%, #6366F1 100%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.20), 0 4px 12px rgba(139, 92, 246, 0.3);
}

[data-theme="nebula"] .pro-badge { background: linear-gradient(135deg, #8B5CF6, #6366F1); }
[data-theme="nebula"] .amount-gold { color: #A78BFA; text-shadow: 0 0 10px rgba(167, 139, 250, 0.4); }

[data-theme="nebula"] .chat-message {
    background: rgba(139, 92, 246, 0.05);
    border: 1px solid rgba(139, 92, 246, 0.08);
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.06);
}
[data-theme="nebula"] .chat-name { color: #A78BFA; text-shadow: 0 0 8px rgba(167, 139, 250, 0.3); }
[data-theme="nebula"] .chat-input {
    background: rgba(139, 92, 246, 0.06);
    border-color: rgba(139, 92, 246, 0.12);
    color: #e8dcff;
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.06);
}
[data-theme="nebula"] .chat-input:focus {
    border-color: #8B5CF6;
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.1), 0 0 0 3px rgba(139, 92, 246, 0.12);
}

[data-theme="nebula"] .live-badge { background: #8B5CF6; box-shadow: 0 0 12px rgba(139, 92, 246, 0.5); }
[data-theme="nebula"] .player-tag {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.08) 0%, rgba(99, 102, 241, 0.025) 100%);
    border-color: rgba(139, 92, 246, 0.15);
    color: #e8dcff;
}

[data-theme="nebula"] .hall-checkbox-card {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.06) 0%, rgba(99, 102, 241, 0.02) 100%) !important;
    border-color: rgba(139, 92, 246, 0.12) !important;
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.08);
}
[data-theme="nebula"] .hall-checkbox-card:hover { background: rgba(139, 92, 246, 0.10) !important; }
[data-theme="nebula"] .hall-checkbox-card.selected {
    background: rgba(139, 92, 246, 0.15) !important;
    border-color: rgba(167, 139, 250, 0.35) !important;
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.15), 0 0 10px rgba(139, 92, 246, 0.15);
}
[data-theme="nebula"] .hall-checkbox-card input[type="checkbox"] { accent-color: #8B5CF6; }

[data-theme="nebula"] .date-tab {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.015) 100%);
    border-color: rgba(139, 92, 246, 0.12);
    color: #a99bc4;
}
[data-theme="nebula"] .date-tab.active {
    background: rgba(139, 92, 246, 0.15);
    color: #A78BFA;
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.15), 0 0 10px rgba(139, 92, 246, 0.15);
}

[data-theme="nebula"] .lineup-row {
    background: rgba(139, 92, 246, 0.025);
    border-color: rgba(139, 92, 246, 0.06);
}
[data-theme="nebula"] .player-row {
    background: rgba(139, 92, 246, 0.08)!important;
    border-color: rgba(167, 139, 250, 0.20)!important;
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.10);
}
[data-theme="nebula"] .lineup-row .time-badge { color: #A78BFA; background: rgba(139, 92, 246, 0.12); }
[data-theme="nebula"] .lineup-row .league-badge { color: #c4b5fd; background: rgba(139, 92, 246, 0.10); }

[data-theme="nebula"] .league-tab {
    background: linear-gradient(180deg, rgba(139, 92, 246, 0.05) 0%, rgba(99, 102, 241, 0.015) 100%);
    border-color: rgba(139, 92, 246, 0.12);
    color: #a99bc4;
}
[data-theme="nebula"] .league-tab:hover { color: #c4b5fd; background: rgba(139, 92, 246, 0.08); }
[data-theme="nebula"] .league-tab.active {
    color: #A78BFA;
    background: rgba(139, 92, 246, 0.15);
    border-color: rgba(167, 139, 250, 0.35);
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.15), 0 0 8px rgba(139, 92, 246, 0.12);
}
[data-theme="nebula"] .league-tab.my-league { border-color: rgba(167, 139, 250, 0.45); }

[data-theme="nebula"] .ptr-indicator {
    background: rgba(10, 10, 15, 0.95);
    color: #A78BFA;
    box-shadow: 0 1px 0 rgba(139, 92, 246, 0.15) inset;
}
[data-theme="nebula"] .spinner { border-color: rgba(139, 92, 246, 0.12); border-top-color: #8B5CF6; }
[data-theme="nebula"] .spinner-sm { border-color: rgba(139, 92, 246, 0.12); border-top-color: #8B5CF6; }
[data-theme="nebula"] ::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.14); }
[data-theme="nebula"] .flatpickr-input {
    background: rgba(139, 92, 246, 0.06)!important;
    border-color: rgba(139, 92, 246, 0.12)!important;
}
[data-theme="nebula"] .flatpickr-input:focus { border-color: #8B5CF6!important; }
[data-theme="nebula"] .modal-box {
    background: #12121F;
    border-color: rgba(167, 139, 250, 0.20);
    box-shadow: inset 0 1px 0 rgba(167, 139, 250, 0.10), 0 20px 40px rgba(0, 0, 0, 0.5);
}

/* ===== Анимации nebula — только микро-дыхание, без шума ===== */
@keyframes nebulaDrift {
    /* почти незаметно: ±0.5% за 180s */
    0%, 100% { transform: translate(0, 0); }
    50%      { transform: translate(-0.5%, 0.3%); }
}
@keyframes nebulaBreathe {
    0%, 100% { opacity: 0.7; }
    50%      { opacity: 1; }
}

/* ===== Фикс длинных имен в карточке сравнения ===== */
.h2h-player-name {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    min-height: 2.6em !important; /* Чтобы суммы не прыгали, если имя в 1 строку */
    line-height: 1.3 !important;
    margin-bottom: 4px !important;
}

