/* ==========================================================================
   FISHING ANALYZER PRO™ — LIVE TOURNAMENT SCOREBOARD STYLES (v0.1.0.16)
   Фирменная темная палитра KET FISH с золотыми и неоновыми акцентами
   ========================================================================== */

:root {
    --bg-main: #14100C;
    --bg-card: rgba(27, 22, 18, 0.75);
    --bg-card-hover: rgba(45, 36, 30, 0.85);
    --gold: #D4AF37;
    --gold-bright: #F9E498;
    --gold-glow: rgba(212, 175, 55, 0.25);
    --cyan: #00E5FF;
    --cyan-glow: rgba(0, 229, 255, 0.25);
    --emerald: #00E676;
    --coral: #FF5252;
    --text-white: #FFFFFF;
    --text-gray: #A09A96;
    --border-gold: rgba(212, 175, 55, 0.3);
    --border-subtle: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-white);
    line-height: 1.5;
    min-height: 100vh;
    padding-bottom: 60px;
    background-image: radial-gradient(circle at 50% 0%, rgba(212, 175, 55, 0.08) 0%, transparent 60%);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px;
}

/* Шапка страницы */
.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(20, 16, 12, 0.9);
    border: 1px solid var(--border-gold);
    border-radius: 16px;
    backdrop-filter: blur(12px);
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.brand-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--gold-bright);
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid var(--border-gold);
    color: var(--gold-bright);
    border-radius: 10px;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 700;
    transition: all 0.2s ease;
}

.btn-nav-back:hover {
    background: rgba(212, 175, 55, 0.25);
    transform: translateY(-1px);
}

/* Переключатель 8 языков */
.lang-switcher {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-wrap: wrap;
}

.lang-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    min-width: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-gray);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.lang-btn img {
    width: 14px;
    height: 10px;
    border-radius: 2px;
    object-fit: cover;
}

.lang-btn.active, .lang-btn:hover {
    background: var(--gold-glow);
    border-color: var(--gold);
    color: var(--gold-bright);
}

/* Карточка Турнира (Hero) */
.tournament-hero {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 24px;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.tournament-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--cyan), var(--emerald), var(--gold));
}

.hero-top-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.tournament-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid var(--emerald);
    color: var(--emerald);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--emerald);
    border-radius: 50%;
    animation: pulseGlow 1.5s infinite;
}

@keyframes pulseGlow {
    0% { transform: scale(0.9); opacity: 0.8; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 10px var(--emerald); }
    100% { transform: scale(0.9); opacity: 0.8; }
}

.badge-discipline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold-bright);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
}

.tournament-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: #FFFFFF;
    margin-bottom: 8px;
    text-align: left;
}

.tournament-meta {
    display: flex;
    gap: 16px;
    color: var(--text-gray);
    font-size: 0.88rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 18px;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.meta-item .material-icons {
    font-size: 18px;
    color: var(--gold);
}

/* Виджет обратного отсчета */
.timer-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(18, 14, 11, 0.8);
    border: 1px solid var(--border-gold);
    border-radius: 14px;
    padding: 12px 18px;
    margin-top: 14px;
    flex-wrap: wrap;
    gap: 12px;
}

.timer-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text-gray);
}

.timer-digits {
    font-family: 'Montserrat', monospace;
    font-size: 1.4rem;
    font-weight: 900;
    color: var(--gold-bright);
    letter-spacing: 2px;
    text-shadow: 0 0 12px var(--gold-glow);
}

/* Пьедестал и Big Fish (4 карточки лидеров) */
.podium-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.podium-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 18px;
    position: relative;
    backdrop-filter: blur(12px);
    transition: transform 0.2s, box-shadow 0.2s;
    text-align: left;
}

.podium-card:hover {
    transform: translateY(-2px);
}

.podium-card.gold-card {
    border-color: #FFD700;
    background: linear-gradient(145deg, rgba(255, 215, 0, 0.12), rgba(27, 22, 18, 0.8));
    box-shadow: 0 8px 24px rgba(255, 215, 0, 0.15);
}

.podium-card.silver-card {
    border-color: #C0C0C0;
    background: linear-gradient(145deg, rgba(192, 192, 192, 0.1), rgba(27, 22, 18, 0.8));
}

.podium-card.bronze-card {
    border-color: #CD7F32;
    background: linear-gradient(145deg, rgba(205, 127, 50, 0.1), rgba(27, 22, 18, 0.8));
}

.podium-card.bigfish-card {
    border-color: var(--cyan);
    background: linear-gradient(145deg, rgba(0, 229, 255, 0.15), rgba(27, 22, 18, 0.8));
    box-shadow: 0 8px 24px var(--cyan-glow);
}

.card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.place-badge {
    font-size: 1.1rem;
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    display: flex;
    align-items: center;
    gap: 6px;
}

.gold-card .place-badge { color: #FFD700; }
.silver-card .place-badge { color: #E0E0E0; }
.bronze-card .place-badge { color: #CD7F32; }
.bigfish-card .place-badge { color: var(--cyan); }

.sector-chip {
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-white);
}

.team-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #FFFFFF;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-sub {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.weight-display {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.35rem;
    font-weight: 900;
    color: var(--gold-bright);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-top: 1px solid var(--border-subtle);
    padding-top: 10px;
}

.weight-label {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-weight: 600;
}

/* Таблица на 50 секторов */
.table-section {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 20px;
    backdrop-filter: blur(16px);
    margin-bottom: 24px;
}

.table-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 10px;
}

.table-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--gold-bright);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-input {
    background: rgba(18, 14, 11, 0.8);
    border: 1px solid var(--border-gold);
    color: #FFFFFF;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    outline: none;
    min-width: 220px;
}

.search-input:focus {
    border-color: var(--gold-bright);
    box-shadow: 0 0 10px var(--gold-glow);
}

.table-container {
    overflow-x: auto;
}

.live-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.live-table th {
    background: rgba(18, 14, 11, 0.9);
    padding: 12px 14px;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-gold);
}

.live-table td {
    padding: 14px;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--border-subtle);
    color: #FFFFFF;
}

.live-table tr:hover {
    background: var(--bg-card-hover);
}

.rank-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 800;
    font-size: 0.82rem;
    background: rgba(255, 255, 255, 0.08);
}

.rank-1 { background: #FFD700; color: #000000; box-shadow: 0 0 10px rgba(255, 215, 0, 0.4); }
.rank-2 { background: #C0C0C0; color: #000000; }
.rank-3 { background: #CD7F32; color: #FFFFFF; }

.sector-tag {
    font-weight: 800;
    color: var(--cyan);
}

.weight-highlight {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: var(--gold-bright);
}

/* Панель шеринга */
.share-bar {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn-share {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 800;
    text-decoration: none;
    color: #FFFFFF;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-share:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
}

.btn-excel { background: linear-gradient(135deg, #107C41, #1E5C38); color: #FFFFFF; border: 1px solid rgba(16, 124, 65, 0.6); box-shadow: 0 4px 14px rgba(16, 124, 65, 0.3); }
.btn-tg { background: #229ED9; }
.btn-wa { background: #25D366; color: #000000; font-weight: 900; }
.btn-fb { background: #1877F2; }
.btn-copy { background: rgba(212, 175, 55, 0.2); border: 1px solid var(--gold); color: var(--gold-bright); }

/* --- ФИРМЕННЫЙ ТЕМНЫЙ ДИАЛОГ KET FISH --- */
.custom-modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.custom-modal-card {
    background: #1B1612 !important;
    border: 1.5px solid var(--border-gold) !important;
    border-radius: 24px !important;
    padding: 32px 28px !important;
    max-width: 440px !important;
    width: 90% !important;
    text-align: center !important;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9), 0 0 30px rgba(212, 175, 55, 0.2) !important;
    position: relative !important;
    margin: auto !important;
    box-sizing: border-box;
}

.modal-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    margin: 0 auto 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.modal-icon-success {
    background: rgba(0, 230, 118, 0.15);
    border: 1px solid #00E676;
    color: #00E676;
}

.modal-icon-warning {
    background: rgba(212, 175, 55, 0.15);
    border: 1px solid var(--gold);
    color: var(--gold-bright);
}

.custom-modal-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    color: #FFFFFF;
    margin-bottom: 8px;
}

.custom-modal-message {
    font-size: 0.95rem;
    color: var(--text-gray);
    line-height: 1.5;
    margin-bottom: 24px;
}

.custom-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-modal {
    flex: 1;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 800;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-modal-ok {
    background: linear-gradient(135deg, #D4AF37 0%, #F9E498 100%) !important;
    color: #000000 !important;
    font-family: 'Montserrat', sans-serif !important;
    font-weight: 900 !important;
    letter-spacing: 0.5px !important;
    border-radius: 14px !important;
    padding: 13px 26px !important;
    box-shadow: 0 4px 18px rgba(212, 175, 55, 0.4) !important;
    cursor: pointer !important;
    border: none !important;
}
.btn-modal-ok:hover {
    box-shadow: 0 6px 22px rgba(212, 175, 55, 0.6) !important;
    transform: translateY(-2px) !important;
}

/* --- ДВУХКОЛОНОЧНЫЙ МАКЕТ: ТАБЛИЦА + СПУТНИКОВАЯ КАРТА ВОДОЕМА --- */
.live-grid-layout {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 24px;
    margin-bottom: 24px;
    align-items: start;
}

.map-section {
    background: var(--bg-card);
    border: 1px solid var(--border-gold);
    border-radius: 20px;
    padding: 24px;
    backdrop-filter: blur(16px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}

.btn-recenter-lake {
    background: rgba(212, 175, 55, 0.2) !important;
    border: 1.5px solid var(--gold) !important;
    border-radius: 10px !important;
    color: var(--gold-bright) !important;
    padding: 6px 14px !important;
    font-size: 0.8rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    transition: all 0.2s !important;
}

.btn-recenter-lake:hover {
    background: var(--gold) !important;
    color: #000000 !important;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6) !important;
}

.map-lake-chip {
    background: rgba(0, 229, 255, 0.15);
    border: 1px solid var(--cyan);
    color: var(--cyan);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 4px 12px;
    border-radius: 8px;
    text-transform: uppercase;
}

.live-map-card {
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #000;
}

.tournament-lake-map {
    width: 100%;
    height: 520px;
    background: #0d131a;
}

.map-legend-bar {
    display: flex;
    justify-content: space-around;
    padding: 10px 14px;
    background: rgba(20, 16, 12, 0.95);
    border-top: 1px solid rgba(212, 175, 55, 0.3);
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    flex-wrap: wrap;
    gap: 8px;
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.gold-dot { background: #FFD700; box-shadow: 0 0 8px #FFD700; }
.silver-dot { background: #C0C0C0; box-shadow: 0 0 6px #C0C0C0; }
.bronze-dot { background: #CD7F32; box-shadow: 0 0 6px #CD7F32; }
.bigfish-dot { background: #00E5FF; box-shadow: 0 0 8px #00E5FF; }

/* Кастомные маркеры секторов Leaflet */
.peg-marker {
    background: rgba(18, 14, 10, 0.92);
    border: 2px solid var(--cyan);
    border-radius: 50%;
    color: #fff;
    font-weight: 900;
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 229, 255, 0.5);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.peg-marker:hover {
    transform: scale(1.25);
    z-index: 1000 !important;
}

.peg-marker.peg-gold {
    border-color: #FFD700;
    background: linear-gradient(135deg, #FFD700 0%, #B8860B 100%);
    color: #000;
    box-shadow: 0 0 16px rgba(255, 215, 0, 0.9);
}

.peg-marker.peg-silver {
    border-color: #C0C0C0;
    background: linear-gradient(135deg, #FFFFFF 0%, #808080 100%);
    color: #000;
    box-shadow: 0 0 12px rgba(192, 192, 192, 0.8);
}

.peg-marker.peg-bronze {
    border-color: #CD7F32;
    background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
    color: #fff;
    box-shadow: 0 0 12px rgba(205, 127, 50, 0.8);
}

.peg-marker.peg-bigfish {
    border-color: #00E5FF;
    outline: 2px dashed #00E5FF;
    outline-offset: 2px;
}

/* RTL поддержка для Иврита и Арабского */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] .tournament-name,
[dir="rtl"] .podium-card,
[dir="rtl"] .live-table {
    text-align: right;
}

@media (max-width: 1024px) {
    .live-grid-layout { grid-template-columns: 1fr; }
    .tournament-lake-map { height: 380px; }
}

@media (max-width: 768px) {
    .tournament-name { font-size: 1.4rem; }
    .podium-grid { grid-template-columns: 1fr; }
    .live-header { flex-direction: column; align-items: stretch; }
    .header-actions { justify-content: space-between; }
}

/* 🌟 Премиальное темное фирменное оформление всплывающей карточки сектора на карте */
.custom-lake-popup .leaflet-popup-content-wrapper {
    background: #18130E !important;
    border: 1.5px solid var(--gold) !important;
    border-radius: 16px !important;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95), 0 0 20px rgba(212, 175, 55, 0.3) !important;
    color: #FFFFFF !important;
    padding: 4px 6px !important;
}

.custom-lake-popup .leaflet-popup-tip {
    background: #18130E !important;
    border: 1.5px solid var(--gold) !important;
}

.custom-lake-popup .leaflet-popup-close-button {
    color: var(--gold) !important;
    font-size: 18px !important;
    padding: 6px 8px !important;
}

.custom-lake-popup .leaflet-popup-close-button:hover {
    color: #FFFFFF !important;
}
