/* ===== Сумма за период — псевдо-стекло ===== */
.sum-stat {
    text-align: center;
    padding: 10px 8px;
    border-radius: 12px;
    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),
        inset 0 -1px 0 rgba(0,0,0,0.15);
}

.sum-stat-label {
    font-size: 11px;
    font-weight: 500;
    color: #71717a;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.sum-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
}

.sum-stat-value.gold {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 0 6px rgba(251,191,36,0.35));
}

.sum-stat-value.blue {
    color: var(--accent-light, #60a5fa);
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent, #6366f1) 50%, transparent);
}

/* ===== Строка турнира — стеклянная ===== */
.tournament-row {
    cursor: pointer;
    border-radius: 10px;
    padding: 6px 8px;
    transition: background 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tournament-row:hover {
    background: linear-gradient(180deg, rgba(255,255,255,0.055) 0%, rgba(255,255,255,0.02) 100%);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.08),
        inset 0 -1px 0 rgba(0,0,0,0.15);
}

/* ===== Турнир со снятием (hasRemoved = true) ===== */
.tour-row-removed {
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.04),
        0 0 14px rgba(239, 68, 68, 0.18);
}

.tour-row-removed:hover {
    border-color: rgba(239, 68, 68, 0.65) !important;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.06),
        0 0 20px rgba(239, 68, 68, 0.28);
}

.removed-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    padding: 2px 6px;
    border-radius: 6px;
    color: #fca5a5;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.tournament-number {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #a1a1aa;
    background: linear-gradient(180deg, rgba(255,255,255,0.06) 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: 50%;
    flex-shrink: 0;
}

.tournament-date {
    font-size: 14px;
    font-weight: 500;
    color: #ffffff;
}

.tournament-amount {
    font-size: 14px;
    font-weight: 700;
    color: #fbbf24;
    text-shadow: 0 0 8px rgba(251,191,36,0.35);
}

/* ===== Кнопка редактирования — стеклянная ===== */
.edit-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.055) 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: 8px;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-btn:hover {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--accent, #6366f1) 18%, transparent) 0%,
        color-mix(in srgb, var(--accent, #6366f1) 8%, transparent) 100%);
    border-color: color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
    color: #ffffff;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        0 0 10px color-mix(in srgb, var(--accent, #6366f1) 25%, transparent);
}

/* ===== Пагинация — стеклянная ===== */
.pagination-btn {
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #a1a1aa;
    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);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    color: #ffffff;
    border-color: rgba(255,255,255,0.14);
}

.pagination-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 12px;
    color: #71717a;
}

/* ===== Карточки меню — стеклянные ===== */
.menu-card {
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    padding: 12px 14px;
    border-radius: 14px;
    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.07),
        inset 0 -1px 0 rgba(0,0,0,0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.menu-card:hover {
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--accent, #6366f1) 10%, rgba(255,255,255,0.05)) 0%,
        color-mix(in srgb, var(--accent, #6366f1) 4%, rgba(255,255,255,0.02)) 100%);
    border-color: color-mix(in srgb, var(--accent, #6366f1) 30%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        inset 0 -1px 0 rgba(0,0,0,0.15),
        0 0 16px color-mix(in srgb, var(--accent, #6366f1) 18%, transparent);
    transform: translateX(3px);
}

.menu-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(180deg,
        color-mix(in srgb, var(--accent, #6366f1) 20%, transparent) 0%,
        color-mix(in srgb, var(--accent, #6366f1) 8%, transparent) 100%);
    border: 1px solid color-mix(in srgb, var(--accent, #6366f1) 30%, transparent);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.10),
        0 0 8px color-mix(in srgb, var(--accent, #6366f1) 20%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.menu-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
    letter-spacing: 0.2px;
}

.menu-subtitle {
    font-size: 12px !important;
    color: #d4d4d8 !important;
    margin-top: 2px;
    font-weight: 500 !important;
}

.menu-arrow {
    color: #a1a1aa;
    flex-shrink: 0;
}

/* ===== PWA fix — input короче ===== */
.apple-card input,
.apple-card .flatpickr-input,
.flatpickr-input {
    width: 93% !important;
    max-width: 93% !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

/* ===== Карусель матчей (по 2 карточки на слайд) ===== */
.matches-carousel {
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 12px 0 16px 0;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.matches-carousel::-webkit-scrollbar {
    display: none;
}

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    display: flex;
    gap: 10px;
    padding: 0 4px;
    box-sizing: border-box;
}

.carousel-match-card {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    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);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
    padding: 10px;
    animation: slideInRight 0.3s ease-out both;
}

.carousel-match-stage {
    font-size: 10px;
    color: #a1a1aa;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.carousel-match-players {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.carousel-player-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #e4e4e7;
    font-weight: 500;
    gap: 6px;
}

.carousel-player-row.winner {
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 8px color-mix(in srgb, var(--accent, #6366f1) 40%, transparent);
}

.carousel-player-row .c-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.carousel-player-row .c-score {
    font-weight: 700;
    color: #fbbf24;
    flex-shrink: 0;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* ===== МОДАЛЬНОЕ ОКНО ДЛЯ РАСЧЕТОВ ===== */
.sum-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.sum-modal-overlay.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.sum-modal-content {
    background: #18181b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: modalSlideUp 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    overflow: hidden;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sum-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.sum-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.sum-modal-close {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #a1a1aa;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.sum-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.sum-modal-body {
    padding: 16px 20px 20px 20px;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
}

/* Скрываем скроллбар в модалке для красоты (по желанию) */
.sum-modal-body::-webkit-scrollbar {
    width: 6px;
}
.sum-modal-body::-webkit-scrollbar-track {
    background: transparent;
}
.sum-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

/* ===== ТЕМЫ ===== */
[data-theme="ocean"] .sum-stat {
    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"] .sum-stat-value { text-shadow: 0 0 8px rgba(34,211,238,0.4); }
[data-theme="ocean"] .tournament-amount { color: #fbbf24; }
[data-theme="ocean"] .menu-icon {
    background: linear-gradient(180deg, rgba(6,182,212,0.20) 0%, rgba(6,182,212,0.08) 100%);
    border-color: rgba(6,182,212,0.30);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 0 8px rgba(6,182,212,0.20);
}

[data-theme="mars"] .sum-stat {
    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"] .sum-stat-value { text-shadow: 0 0 8px rgba(245,158,11,0.4); }
[data-theme="mars"] .menu-icon {
    background: linear-gradient(180deg, rgba(245,158,11,0.20) 0%, rgba(245,158,11,0.08) 100%);
    border-color: rgba(245,158,11,0.30);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 0 8px rgba(245,158,11,0.20);
}

[data-theme="nebula"] .sum-stat {
    background: linear-gradient(180deg, rgba(168,85,247,0.06) 0%, rgba(168,85,247,0.02) 100%);
    border-color: rgba(168,85,247,0.12);
    box-shadow: inset 0 1px 0 rgba(192,132,252,0.10), inset 0 -1px 0 rgba(0,0,0,0.18);
}
[data-theme="nebula"] .sum-stat-value { text-shadow: 0 0 8px rgba(168,85,247,0.5); }
[data-theme="nebula"] .menu-icon {
    background: linear-gradient(180deg, rgba(168,85,247,0.22) 0%, rgba(168,85,247,0.08) 100%);
    border-color: rgba(192,132,252,0.35);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 0 10px rgba(168,85,247,0.30);
}