/* ==========================================================================
   Кубок Акима — система дизайна «Night Glass»
   Тёмная стеклянная тема: глубокий синий фон, полупрозрачные карточки,
   неоновый синий акцент и тёплое оранжевое свечение.

   Как пользоваться:
   1. Цвета, радиусы, тени — только через токены ниже (var(--...)), не через hex.
   2. Поверхности: .glass / .league-section (карточка) → .tile (плитка внутри карточки) → .pill (чипы, неактивное).
   3. Акцент (--accent) — главное действие и активное состояние. Оранжевый/золото — тепло и награды.
      Зелёный/жёлтый/красный — только статусы (успех, внимание, ошибка/удаление).
   4. Живой пример всех компонентов: /design-system.html
   ========================================================================== */

:root {
    color-scheme: dark;

    /* Основа */
    --bg: #05070f;
    --bg-glow-blue: rgba(37, 99, 235, 0.45);
    --bg-glow-orange: rgba(234, 88, 12, 0.30);
    --bg-glow-violet: rgba(99, 102, 241, 0.20);

    /* Поверхности (стекло) */
    --surface: rgba(16, 24, 50, 0.58);          /* карточка */
    --surface-solid: #0d1430;                   /* окна, выпадающие списки */
    --surface-2: rgba(255, 255, 255, 0.045);    /* плитка внутри карточки */
    --surface-3: rgba(255, 255, 255, 0.085);    /* неактивные чипы и кнопки */
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(255, 255, 255, 0.16);

    /* Текст */
    --text: #eef2ff;
    --text-2: #9aa6c8;      /* второстепенный */
    --text-3: #66709a;      /* подписи, плейсхолдеры */
    --heading: #8ab4ff;     /* заголовки секций, ссылки */

    /* Акценты */
    --accent: #4f8cff;
    --accent-2: #5ac8fa;
    --violet: #a78bfa;
    --orange: #f59e54;
    --gold: #fbbf24;
    --accent-grad: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
    --warm-grad: linear-gradient(135deg, #f59e54 0%, #ef7b45 100%);
    --ring-grad: conic-gradient(from 200deg, #5ac8fa, #6366f1, #a78bfa, #5ac8fa);

    /* Статусы */
    --green: #4ade80;
    --green-bg: rgba(74, 222, 128, 0.10);
    --green-border: rgba(74, 222, 128, 0.28);
    --green-btn: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, 0.10);
    --red-soft: rgba(248, 113, 113, 0.20);
    --red-border: rgba(248, 113, 113, 0.32);
    --amber: #f5b94c;
    --amber-bg: rgba(251, 191, 36, 0.09);
    --amber-soft: rgba(251, 191, 36, 0.18);
    --amber-border: rgba(251, 191, 36, 0.30);

    /* Форма */
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 10px;
    --radius-pill: 999px;

    /* Эффекты */
    --blur: 18px;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
    --glow: 0 0 18px rgba(79, 140, 255, 0.45);
    --glow-soft: 0 4px 16px rgba(79, 140, 255, 0.28);
    --overlay: rgba(3, 5, 14, 0.74);
    --accent-ink: #cfe0ff;                       /* текст на подсвеченном синем */
    --zebra: rgba(255, 255, 255, 0.025);
    --hairline: rgba(255, 255, 255, 0.04);

    /* Типографика */
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --fs-xs: 11px;
    --fs-sm: 12px;
    --fs-md: 14px;
    --fs-lg: 16px;
    --fs-xl: 22px;
    --fs-stat: 34px;

    /* Совместимость со старыми именами */
    --primary-blue: var(--accent);
    --secondary-gold: var(--gold);
    --muted-text: var(--text-3);
    --border-color: var(--border);
}

/* ==========================================================================
   Светлая тема (включается атрибутом <html data-theme="light">: по настройкам Telegram, системы или вручную)
   Те же токены — другие значения, поэтому вся вёрстка работает без изменений.
   ========================================================================== */
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #eef2fb;
    --bg-glow-blue: rgba(79, 140, 255, 0.28);
    --bg-glow-orange: rgba(251, 146, 60, 0.20);
    --bg-glow-violet: rgba(99, 102, 241, 0.12);
    --surface: rgba(255, 255, 255, 0.74);
    --surface-solid: #ffffff;
    --surface-2: rgba(15, 23, 42, 0.04);
    --surface-3: rgba(15, 23, 42, 0.08);
    --border: rgba(15, 23, 42, 0.10);
    --border-strong: rgba(15, 23, 42, 0.18);
    --text: #0f172a;
    --text-2: #475569;
    --text-3: #7b8aa3;
    --heading: #1e40af;
    --accent: #2563eb;
    --accent-2: #0284c7;
    --orange: #ea580c;
    --gold: #d97706;
    --green: #15803d;
    --green-bg: rgba(22, 163, 74, 0.10);
    --green-border: rgba(22, 163, 74, 0.30);
    --red: #dc2626;
    --red-bg: rgba(220, 38, 38, 0.07);
    --red-soft: rgba(220, 38, 38, 0.14);
    --red-border: rgba(220, 38, 38, 0.28);
    --amber: #b45309;
    --amber-bg: rgba(217, 119, 6, 0.09);
    --amber-soft: rgba(217, 119, 6, 0.16);
    --amber-border: rgba(217, 119, 6, 0.32);
    --shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
    --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.22);
    --glow: 0 0 14px rgba(37, 99, 235, 0.30);
    --glow-soft: 0 4px 14px rgba(37, 99, 235, 0.25);
    --overlay: rgba(15, 23, 42, 0.45);
    --accent-ink: #1e40af;
    --zebra: rgba(15, 23, 42, 0.03);
    --hairline: rgba(15, 23, 42, 0.06);
}
:root[data-theme="light"] .header-logo { filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.25)); }
:root[data-theme="light"] .app-header { background: linear-gradient(135deg, rgba(79, 140, 255, 0.20) 0%, rgba(255, 255, 255, 0.74) 60%), var(--surface); }
:root[data-theme="light"] .app-title { color: var(--text); }

* { box-sizing: border-box; }
html { background: var(--bg); min-height: 100%; }

body {
    font-family: var(--font);
    background: transparent;
    color: var(--text);
    margin: 0 auto;
    padding: 16px 16px 80px;
    max-width: 600px;
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
}

/* Свечение фона: синее сверху, тёплое справа, фиолетовое снизу */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(70% 38% at 100% 0%, var(--bg-glow-blue), transparent 62%),
        radial-gradient(55% 34% at 100% 58%, var(--bg-glow-orange), transparent 66%),
        radial-gradient(60% 30% at 0% 100%, var(--bg-glow-violet), transparent 64%);
}

::selection { background: rgba(79, 140, 255, 0.4); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
img { max-width: 100%; }

/* ---------- Поверхности ---------- */
.glass, .league-section, .app-header, .tabs {
    background: var(--surface);
    border: 1px solid var(--border);
    -webkit-backdrop-filter: blur(var(--blur));
    backdrop-filter: blur(var(--blur));
    box-shadow: var(--shadow);
}
.tile { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.pill { background: var(--surface-3); border-radius: var(--radius-pill); }

/* ---------- Шапка ---------- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    margin-bottom: 14px;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(79, 140, 255, 0.22) 0%, rgba(16, 24, 50, 0.58) 55%),
        var(--surface);
}
/* Логотипы показываем целиком: без круглой маски, рамки и обрезки (object-fit: contain) */
.header-logo {
    width: 52px; height: 52px; object-fit: contain; flex-shrink: 0;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}
.header-title-wrapper { text-align: center; flex: 1; }
.header-subtitle { font-size: var(--fs-xs); font-weight: 600; color: var(--orange); text-transform: uppercase; letter-spacing: 1.4px; margin: 5px 0 0; }
.app-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.25; letter-spacing: 0.2px; }

/* ---------- Навигация ---------- */
.tabs {
    display: flex; gap: 4px; padding: 4px; margin-bottom: 12px;
    border-radius: var(--radius-md); overflow-x: auto;
}
.tab-btn {
    flex: 1 1 auto; padding: 10px 8px; border: none; border-radius: 11px; background: transparent;
    color: var(--text-2); font: 600 11.5px/1 var(--font); cursor: pointer; white-space: nowrap; text-align: center;
    transition: color .15s, background .15s, box-shadow .15s;
}
.tab-btn:hover { color: var(--text); background: var(--surface-2); }
.tab-btn.active { background: var(--accent-grad); color: #fff; box-shadow: var(--glow-soft); }

.league-subtabs { display: flex; gap: 6px; margin-bottom: 14px; overflow-x: auto; }
.subtab-btn {
    flex: 1; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--surface-2); color: var(--text-2); font: 600 var(--fs-xs)/1 var(--font);
    cursor: pointer; white-space: nowrap; text-align: center; transition: all .15s;
}
.subtab-btn:hover { color: var(--text); border-color: var(--border-strong); }
.subtab-btn.active {
    background: rgba(79, 140, 255, 0.18); color: var(--accent-ink); border-color: rgba(79, 140, 255, 0.6);
    box-shadow: 0 0 14px rgba(79, 140, 255, 0.25);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- Карточка-секция ---------- */
.league-section { border-radius: var(--radius-lg); padding: 16px; margin-bottom: 14px; }
.league-section h3 {
    margin: 0 0 12px; padding: 0 0 10px; font-size: var(--fs-md); font-weight: 600; letter-spacing: 0.2px;
    color: var(--text); border-bottom: 1px solid var(--border);
}

/* ---------- Таблица ---------- */
.table-responsive { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; white-space: nowrap; }
th, td { padding: 9px 6px; text-align: center; }
th { color: var(--text-3); font-weight: 600; border-bottom: 1px solid var(--border); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: 0.6px; }
td:nth-child(2) { text-align: left; }
tr:nth-child(even) td { background: var(--zebra); }
tr td { border-bottom: 1px solid var(--hairline); }

/* ---------- Матчи ---------- */
.match-card {
    /* Три колонки: команда хозяев | счёт/время | команда гостей. Края равные, поэтому логотипы стоят строго
       в одну линию по краям карточки, а названия вплотную к ним, независимо от длины названия. */
    display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 10px; padding: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
    margin-bottom: 8px; font-size: 13px;
    -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
    transition: border-color .15s, transform .15s;
}
.match-card[onclick]:hover { border-color: rgba(79, 140, 255, 0.5); }
.match-card > div:nth-child(2) { min-width: 84px; text-align: center; }   /* центр одинаковой ширины во всех карточках */
.match-team { display: flex; align-items: center; gap: 8px; min-width: 0; cursor: pointer; }
.match-team span { flex: 1 1 auto; min-width: 0; line-height: 1.25; overflow-wrap: anywhere; }
.match-team.away { text-align: right; }      /* порядок в разметке: название, логотип — логотип у правого края */
.match-team img { width: 34px; height: 34px; object-fit: contain; flex: 0 0 34px; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.match-score {
    display: inline-block; font-weight: 800; font-size: 15px; background: var(--accent-grad); color: #fff;
    padding: 5px 12px; border-radius: var(--radius-sm); box-shadow: var(--glow-soft);
}
.match-time { font-size: var(--fs-xs); color: var(--text-2); font-weight: 600; }

/* ---------- Состояния и вспомогательные ---------- */
.disq-item { padding: 12px; background: var(--red-bg); border: 1px solid var(--red-border); border-left: 3px solid var(--red); border-radius: var(--radius-md); font-size: 13px; margin-bottom: 8px; }
.no-data { color: var(--text-3); font-size: 13px; font-style: italic; text-align: center; padding: 14px; }

.form-badge { display: inline-block; width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 6px; font-size: var(--fs-xs); font-weight: bold; margin-right: 3px; color: #04101f; }
.form-w { background-color: var(--green); }
.form-d { background-color: var(--amber); }
.form-l { background-color: var(--red); }

/* ---------- Формы и кнопки ---------- */
input, select, textarea {
    background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm); font-family: var(--font);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(79, 140, 255, 0.2); }
select option { background: var(--surface-solid); color: var(--text); }
input[type="file"] { padding: 6px; font-size: var(--fs-sm); color: var(--text-2); width: 100%; }
input[type="file"]::file-selector-button {
    background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
    border-radius: 8px; padding: 6px 10px; margin-right: 10px; cursor: pointer; font-family: var(--font);
}
button { font-family: var(--font); transition: filter .15s, transform .1s; }
button:hover:not(:disabled) { filter: brightness(1.1); }
button:active:not(:disabled) { transform: translateY(1px); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border: 1px solid transparent;
    border-radius: var(--radius-sm); font: 700 var(--fs-sm)/1 var(--font); cursor: pointer; color: #fff;
}
.btn-primary { background: var(--accent-grad); box-shadow: var(--glow-soft); }
.btn-success { background: var(--green-btn); }
.btn-warm { background: var(--warm-grad); }
.btn-ghost { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.btn-danger { background: var(--red-bg); border-color: var(--red-border); color: var(--red); }

.badge { display: inline-block; padding: 3px 9px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; }
.badge-accent { background: rgba(79, 140, 255, 0.18); color: var(--accent-ink); }
.badge-success { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-warn { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-danger { background: var(--red-bg); color: var(--red); border: 1px solid var(--red-border); }
.badge-muted { background: var(--surface-3); color: var(--text-2); }

@media (min-width: 480px) { .tab-btn { padding: 10px 12px; font-size: var(--fs-sm); } }

/* ---------- Админ-панель ---------- */
#admin-panel h3 { font-size: var(--fs-lg); }
#admin-panel {
    background: var(--surface) !important; border: 1px solid var(--border) !important; border-radius: var(--radius-lg);
    -webkit-backdrop-filter: blur(var(--blur)); backdrop-filter: blur(var(--blur));
}

/* ---------- Окна ---------- */
#team-modal, #player-modal, #admin-modal, #sanction-modal, #schedule-modal, #about-modal, #settings-modal, #match-modal {
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
#team-modal > div, #player-modal > div, #admin-modal > div, #sanction-modal > div, #schedule-modal > div, #about-modal > div, #settings-modal > div, #match-modal > div {
    border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg);
    background-image: linear-gradient(160deg, rgba(79, 140, 255, 0.10), transparent 40%);
}

/* ---------- «О турнире» ---------- */
.header-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 8px; }
.about-btn { margin-top: 0; padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text-2); font-size: var(--fs-xs); font-weight: 600; cursor: pointer; }
.about-btn:hover { color: var(--text); border-color: var(--accent); }
.about-sec { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.about-sec summary { padding: 11px 12px; font-size: 13px; font-weight: 700; cursor: pointer; list-style: none; }
.about-sec summary::-webkit-details-marker { display: none; }
.about-sec summary::after { content: "＋"; float: right; color: var(--text-3); }
.about-sec[open] summary::after { content: "−"; }
.about-body { padding: 0 12px 12px; font-size: 13px; color: var(--text-2); line-height: 1.55; }
.about-body p { margin: 0 0 6px; }
.about-body ul, .about-body ol { margin: 4px 0 6px; padding-left: 20px; }
.about-body b { color: var(--text); }
.about-social { margin-top: 12px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.about-social-title { font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.about-social-row { display: flex; gap: 8px; flex-wrap: wrap; }
.about-social-row .btn { flex: 1 1 140px; text-decoration: none; }

/* ---------- Подробности матча ---------- */
.match-score.clickable { cursor: pointer; }
.match-score.clickable:hover { filter: brightness(1.12); }
.mt-score { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 10px; padding: 12px; border-radius: var(--radius-md); background: var(--surface-2); border: 1px solid var(--border); }
.mt-team { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; min-width: 0; }
.mt-team img { width: 48px; height: 48px; object-fit: contain; }
.mt-team span { font-size: 12px; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.mt-result { font-size: 28px; font-weight: 800; letter-spacing: 1px; white-space: nowrap; color: var(--text); }
.mt-motm { margin-top: 10px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--amber-bg); border: 1px solid var(--amber-border); font-size: 13px; text-align: center; }
.mt-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr); align-items: center; gap: 6px; padding: 6px 4px; border-bottom: 1px solid var(--hairline); font-size: 13px; }
.mt-home { text-align: right; }
.mt-away { text-align: left; }
.mt-min { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--text-2); background: var(--surface-3); border-radius: var(--radius-pill); padding: 2px 0; }
.mt-note { font-size: 10px; color: var(--text-3); }
.mt-min.empty { background: none; }

/* ---------- Моя команда, настройки ---------- */
.my-team-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 12px; border-radius: var(--radius-md); cursor: pointer;
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.16), transparent 70%), var(--surface); border: 1px solid rgba(79, 140, 255, 0.45); box-shadow: var(--glow-soft); }
.my-team-title { font-size: 13px; font-weight: 700; color: var(--heading); }
.my-team-sub { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; line-height: 1.4; }
tr.my-team td { box-shadow: inset 0 1px 0 var(--accent), inset 0 -1px 0 var(--accent); font-weight: 700; }
.seg { display: flex; gap: 4px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.seg-btn { flex: 1; padding: 8px 6px; border: none; border-radius: 8px; background: transparent; color: var(--text-2); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
.seg-btn.active { background: var(--accent-grad); color: #fff; box-shadow: var(--glow-soft); }
.switch-row { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); cursor: pointer; }
.switch-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); flex-shrink: 0; }

/* ---------- Снятие команды ---------- */
.badge-withdrawn { display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: var(--radius-pill); background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red); font-size: 10px; font-weight: 700; }
.match-card.annulled { opacity: 0.45; }

/* ---------- Зоны переходов между лигами (регламент 3.6) ---------- */
tr.zone-up td:first-child { box-shadow: inset 3px 0 0 var(--green); }
tr.zone-down td:first-child { box-shadow: inset 3px 0 0 var(--red); }
tr.zone-up td { background: var(--green-bg) !important; }
tr.zone-down td { background: var(--red-bg) !important; }
.zone-legend { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 10px; font-size: var(--fs-xs); color: var(--text-2); }
.zone-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; margin-right: 4px; }
.zone-dot.up { background: var(--green); }
.zone-dot.down { background: var(--red); }

/* ---------- Окно результата: техническое поражение и предупреждения ---------- */
.warn-banner { margin-bottom: 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-bg); border: 1px solid var(--red-border); color: var(--text); font-size: var(--fs-sm); line-height: 1.45; }
.tech-box { margin-bottom: 12px; padding: 10px; border-radius: var(--radius-sm); background: var(--amber-bg); border: 1px solid var(--amber-border); }
.tech-title { font-size: var(--fs-sm); font-weight: 700; color: var(--amber); margin-bottom: 8px; }
.tech-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tech-btn { flex: 1 1 140px; padding: 8px; border-radius: 8px; border: 1px solid var(--amber-border); background: var(--surface-2); color: var(--text); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.tech-btn.ghost { flex: 0 0 auto; color: var(--text-2); border-color: var(--border-strong); }
.tech-note { font-size: var(--fs-xs); color: var(--amber); margin-top: 6px; }
#match-details.is-disabled { opacity: 0.35; pointer-events: none; }

/* ---------- Голосование ---------- */
.vote-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.vote-badge { font-size: var(--fs-xs); font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); }
.vote-badge.live { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.vote-badge.done { background: var(--surface-3); color: var(--text-2); }
.vote-countdown { font-size: var(--fs-sm); font-weight: 700; color: var(--accent-2); }
.vote-note { font-size: 13px; color: var(--text-2); margin: 6px 0 10px; }
.vote-list { display: flex; flex-direction: column; gap: 8px; }
.vote-candidate { display: flex; align-items: center; gap: 10px; padding: 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-md); }
.vote-candidate.mine { border-color: rgba(79, 140, 255, 0.6); background: rgba(79, 140, 255, 0.10); }
.vote-candidate.winner { border-color: var(--amber-border); background: var(--amber-bg); box-shadow: 0 0 22px rgba(251, 191, 36, 0.18); }
.vote-photo { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; object-position: 50% 12%; border: 2px solid var(--accent); background: var(--surface-2); flex-shrink: 0; }
.vote-info { flex: 1; min-width: 0; }
.vote-name { font-size: var(--fs-md); font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.vote-mine { font-size: var(--fs-xs); font-weight: 700; color: var(--green); white-space: nowrap; }
.vote-sub { font-size: var(--fs-xs); color: var(--text-2); margin-top: 2px; overflow-wrap: anywhere; }
.vote-bar { height: 6px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; margin-top: 6px; }
.vote-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-2), var(--accent)); border-radius: var(--radius-pill); box-shadow: var(--glow); }
.vote-candidate.winner .vote-bar-fill { background: linear-gradient(90deg, var(--gold), var(--orange)); box-shadow: 0 0 12px rgba(251, 191, 36, 0.5); }
.vote-btn { background: var(--accent-grad); color: #fff; border: none; padding: 9px 12px; border-radius: var(--radius-sm); font-size: var(--fs-sm); font-weight: 700; cursor: pointer; flex-shrink: 0; box-shadow: var(--glow-soft); }
.vote-btn:disabled { opacity: 0.5; cursor: default; box-shadow: none; }
.vote-total { font-size: var(--fs-xs); color: var(--text-3); margin: 10px 0 0; text-align: center; }

/* ---------- Санкции КДК ---------- */
.disq-player { cursor: pointer; }
.sanction-row { margin-top: 8px; padding: 9px 11px; background: var(--surface-2); border: 1px solid var(--red-border); border-radius: var(--radius-sm); font-size: var(--fs-sm); color: var(--text); }
.sanction-row.pending { color: var(--text-3); font-style: italic; border-style: dashed; }
.sanction-actions { display: flex; gap: 6px; margin-top: 6px; }
.sanction-btn { background: var(--accent-grad); color: #fff; border: none; padding: 6px 10px; border-radius: 8px; font-size: var(--fs-xs); font-weight: 700; cursor: pointer; margin-top: 8px; }
.sanction-btn.danger { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red); }
.sanction-actions .sanction-btn { margin-top: 0; }
.sanction-btn.add-top { margin: 0 0 10px; padding: 8px 12px; background: var(--green-btn); }
.sanction-auto { font-size: 10px; font-weight: 700; color: var(--amber); background: var(--amber-soft); padding: 1px 7px; border-radius: var(--radius-pill); }
.sanction-hint { font-size: var(--fs-xs); color: var(--text-3); margin: 2px 0 6px; }
.sanction-player { font-weight: 700; color: var(--heading); margin-bottom: 8px; }
.sanction-label { display: block; font-size: var(--fs-sm); font-weight: 700; color: var(--heading); margin: 10px 0 4px; }
.sanction-input { width: 100%; padding: 9px; font-size: var(--fs-md); margin-bottom: 4px; }

/* ---------- Компоненты дашборда (для новых экранов) ---------- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-value { font-size: var(--fs-stat); font-weight: 700; letter-spacing: -0.5px; line-height: 1.1; }
.stat-label { font-size: var(--fs-sm); color: var(--text-2); }
.ring {
    --p: 78; width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
    background: conic-gradient(var(--accent-2) calc(var(--p) * 1%), var(--surface-3) 0);
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
    mask: radial-gradient(farthest-side, transparent calc(100% - 9px), #000 calc(100% - 8px));
    filter: drop-shadow(0 0 8px rgba(90, 200, 250, 0.45));
}
.bar-track { height: 6px; background: var(--surface-3); border-radius: var(--radius-pill); overflow: hidden; }
.bar-fill { height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--accent-2), var(--accent)); box-shadow: var(--glow); }

/* Турнирная таблица: все 10 колонок помещаются на узком экране, длинное название переносится по словам, а не наезжает на цифры */
table.standings { table-layout: fixed; font-size: 12px; white-space: normal; }
.standings th, .standings td { padding: 7px 1px; overflow: hidden; }
.standings th:nth-child(1) { width: 20px; }
.standings th:nth-child(2) { width: auto; text-align: left; padding-left: 4px; }
.standings th:nth-child(n+3):nth-child(-n+6) { width: 20px; }
.standings th:nth-child(7), .standings th:nth-child(8) { width: 24px; }
.standings th:nth-child(9) { width: 28px; }
.standings th:nth-child(10) { width: 26px; }
.standings th { letter-spacing: 0; font-size: 10px; }
.standings td:nth-child(2) { line-height: 1.2; overflow-wrap: break-word; word-break: normal; hyphens: auto; padding-left: 4px; }
.standings td:nth-child(2) img { width: 18px; height: 18px; margin-right: 4px; }
@media (max-width: 359px) {
    .league-section { padding-left: 10px; padding-right: 10px; }
    .standings td:nth-child(2) img { display: none; }   /* на самых узких экранах логотип уступает место названию */
}

/* Вкладки на узких телефонах: все 5 видны сразу, без прокрутки */
@media (max-width: 389px) {
    .tabs { gap: 2px; padding: 3px; overflow-x: hidden; }
    .tab-btn { flex: 1 1 0; min-width: 0; padding: 10px 1px; font-size: 10px; letter-spacing: -0.2px; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 339px) { .tab-btn { font-size: 9px; } }


/* Заглушки загрузки */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: skeleton-shimmer 1.3s linear infinite; border-radius: 14px; }
.skeleton-title { height: 22px; width: 55%; margin: 4px auto 14px; }
.skeleton-row { height: 66px; margin-bottom: 10px; }
@keyframes skeleton-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ---------- «Поделиться»: кнопки и окно с картинкой ---------- */
.share-row { text-align: center; margin: 14px 0 6px; }
.share-btn { background: var(--surface-3); color: var(--accent-ink); border: 1px solid rgba(79, 140, 255, 0.5); padding: 7px 14px; border-radius: var(--radius-pill); font-size: var(--fs-xs); font-weight: 700; cursor: pointer; }
.share-btn:hover { border-color: var(--accent); box-shadow: 0 0 12px rgba(79, 140, 255, 0.25); }
.share-icon { background: none; border: none; font-size: 19px; cursor: pointer; padding: 2px 6px; line-height: 1; }
.share-icon.abs { position: absolute; top: 12px; right: 50px; background: var(--surface-2); border-radius: 50%; width: 30px; height: 30px; padding: 0; font-size: 15px; display: flex; align-items: center; justify-content: center; }
.share-box { background: var(--surface-solid); width: 100%; max-width: 420px; max-height: 94vh; overflow-y: auto; border-radius: 16px; padding: 16px; box-sizing: border-box; box-shadow: var(--shadow-lg); }
.share-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: var(--heading); }
.share-x { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-2); }
.share-loading { padding: 50px 10px; text-align: center; color: var(--text-2); font-size: var(--fs-sm); }
.share-img { display: block; width: 100%; max-height: 58vh; object-fit: contain; border-radius: 10px; background: var(--surface-2); }
.share-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.share-primary, .share-sec { flex: 1 1 auto; padding: 11px 12px; border-radius: 10px; font-size: var(--fs-sm); font-weight: 700; cursor: pointer; border: 1px solid var(--border-strong); }
.share-primary { background: var(--accent-grad); color: #fff; border: none; flex-basis: 100%; }
.share-sec { background: var(--surface-3); color: var(--text); }
.share-msg { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--text-3); min-height: 1em; }
