/* =========================================
   FootScore — общие стили для всех тем
   JohnCMS: размеры картинок задаются в HTML (height/width),
   CSS только выравнивает и ограничивает «голые» баннеры без атрибутов.
   ========================================= */

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body, html, input, textarea, select, button {
    font-family: Arial, Tahoma, "Segoe UI Emoji", "Segoe UI Symbol", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
}

/* Компактные поля/кнопки/select как на ПК — без нативного «мобильного» раздувания */
input[type="text"],
input[type="password"],
input[type="number"],
input[type="email"],
input[type="search"],
input[type="tel"],
input[type="url"],
input:not([type]),
textarea,
select,
button,
input[type="submit"],
input[type="button"],
input[type="reset"] {
    -webkit-appearance: none;
    appearance: none;
    border-radius: 0;
    vertical-align: middle;
    box-sizing: border-box;
    font-size: inherit;
    line-height: normal;
    max-width: 100%;
    min-height: 0;
    height: auto;
}
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23555555'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 4px center;
    padding-right: 16px;
}
input[type="submit"],
input[type="button"],
input[type="reset"],
button {
    padding: 1px 6px;
    cursor: pointer;
}

/* Тотализатор: столбец «Статус» — одинаковая высота полей */
form.total-bet {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    text-align: center;
}
form.total-bet .total-bet-row {
    white-space: nowrap;
    margin: 1px 0;
}
form.total-bet input[type="text"],
form.total-bet select,
form.total-bet input[type="submit"] {
    height: 22px;
    font-size: 12px;
    padding: 0 4px;
    margin: 0 1px;
    vertical-align: middle;
    max-width: none;
}
form.total-bet input.total-bet-score {
    width: 28px;
    text-align: center;
}
form.total-bet input.total-bet-sum {
    width: 48px;
    text-align: right;
}
form.total-bet select {
    width: auto;
    min-width: 48px;
    padding-right: 16px;
}
form.total-bet input[type="submit"] {
    padding: 0 8px;
}
input[type="checkbox"],
input[type="radio"],
input[type="file"],
input[type="image"],
input[type="range"],
input[type="color"] {
    -webkit-appearance: auto;
    appearance: auto;
    border-radius: initial;
    min-height: auto;
    height: auto;
    padding: initial;
}

/* Не трогаем height/width — уважаем разметку движка */
img {
    vertical-align: middle;
}

/* Логотипы команд — квадратные в счёте/таблице, без растягивания */
img.logo-team {
    width: 35px;
    height: 35px;
    max-width: 35px;
    max-height: 35px;
    object-fit: contain;
}
img.logo-team-score {
    width: 25px;
    height: 25px;
    max-width: 25px;
    max-height: 25px;
    object-fit: contain;
}

/* Бейдж дивизиона/лиги в шапке страницы */
img.league-badge,
.gmenu > center > img[src*="img/man/"] {
    width: 45px !important;
    height: 45px !important;
    max-width: 45px !important;
    max-height: 45px !important;
    object-fit: contain;
}

/* Фото игрока: крупное только в карточке */
#rad-player-foto {
    max-width: 96px;
    max-height: 120px;
    height: auto;
}
/* Крупное фото в карточке лота аукциона ФМ */
img.fm-lot-foto,
.fm-lot-foto {
    max-width: 96px !important;
    max-height: 96px !important;
    width: 96px;
    height: 96px;
    object-fit: cover;
    vertical-align: middle;
}
img[src*="foto/"]:not(#rad-player-foto):not(.fm-lot-foto) {
    max-width: 32px;
    max-height: 32px;
    vertical-align: middle;
}

/* Шкалы img.php — не растягивать на % ширины экрана */
img[src*="img.php"] {
    max-width: 56px !important;
    width: auto !important;
    height: auto;
    vertical-align: middle;
}

/* Лента событий, меню: логотипы в HTML без width/height */
.menu img:not([width]):not([height]),
.gmenu img:not([width]):not([height]),
.list1 img:not([width]):not([height]),
.list2 img:not([width]):not([height]),
.rmenu img:not([width]):not([height]),
.fmenu img:not([width]):not([height]) {
    max-width: 48px;
    max-height: 48px;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Исключение: бейдж дивизиона/лиги в шапке */
.gmenu > center > img.league-badge,
.gmenu > center > img[src*="img/man/"] {
    max-width: 45px !important;
    max-height: 45px !important;
}

/* Иллюстрации в длинных текстах статей — только без размеров в HTML */
.maintxt img:not([width]):not([height]),
.news img:not([width]):not([height]) {
    max-width: 100%;
    height: auto;
}

/* Мелкие логотипы в таблицах — только если размер не задан в HTML.
   Не трогаем .logo-team / .logo-team-score (анкета, карточки и т.д.). */
table img[src*="logo/"]:not([width]):not([height]):not(.logo-team):not(.logo-team-score) {
    max-width: 16px;
    max-height: 16px;
    width: auto;
    height: auto;
    object-fit: contain;
    vertical-align: middle;
}

/* Логотипы с width/height в разметке — не перебивать (главная, лиги и т.д.) */
table img[src*="logo/"][width],
table img[src*="logo/"][height] {
    object-fit: contain;
    vertical-align: middle;
}

/* Явный размер .logo-team внутри table (выше специфичности правила list/table) */
table img.logo-team {
    width: 35px;
    height: 35px;
    max-width: 35px;
    max-height: 35px;
    object-fit: contain;
    vertical-align: middle;
}
table img.logo-team-score {
    width: 25px;
    height: 25px;
    max-width: 25px;
    max-height: 25px;
    object-fit: contain;
    vertical-align: middle;
}

/* Логотипы соперников в уведомлениях матчей (главная менеджера) */
a.panel > img[src*="logo/"],
.menu a.panel img[src*="logo/"],
table a.panel img[src*="logo/"] {
    width: auto !important;
    height: 40px !important;
    max-width: 48px !important;
    max-height: 40px !important;
    object-fit: contain;
}

/* --- Карточка матча дня на главной менеджера --- */
.fm-match-head {
    cursor: pointer;
}
.fm-match-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 6px;
    box-sizing: border-box;
}
.fm-match-side {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
    color: inherit;
    gap: 4px;
}
.fm-match-side:hover .fm-match-name {
    text-decoration: underline;
}
.fm-match-logo {
    width: 44px !important;
    height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    object-fit: contain;
    display: block;
}
.fm-match-name {
    display: block;
    font-size: 12px;
    font-weight: bold;
    line-height: 1.2;
    max-width: 100%;
    word-wrap: break-word;
}
.fm-match-status {
    flex: 0 0 auto;
    min-width: 92px;
    max-width: 38%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none !important;
    padding: 8px 12px;
    border-radius: 14px;
    border: 1px solid #b8c9df;
    background: linear-gradient(180deg, #f4f8ff 0%, #dde8f8 100%);
    box-shadow: 0 1px 2px rgba(0, 40, 80, 0.08);
}
.fm-match-score {
    display: block;
    font-size: 15px;
    font-weight: bold;
    line-height: 1.15;
    color: #14325c;
}
.fm-match-meta {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    line-height: 1.2;
    color: #5a6f8a;
}
.fm-match-status--wait {
    background: linear-gradient(180deg, #fff8e8 0%, #ffe3a8 100%);
    border-color: #e0b85a;
}
.fm-match-status--wait .fm-match-score {
    color: #8a5a00;
    font-size: 13px;
}
.fm-match-status--live {
    background: linear-gradient(180deg, #ffe8e8 0%, #ffb8b8 100%);
    border-color: #d86a6a;
}
.fm-match-status--live .fm-match-score {
    color: #a01010;
    font-size: 18px;
}
.fm-match-status--live .fm-match-meta {
    color: #a01010;
    font-weight: bold;
}
.fm-match-status--done {
    background: linear-gradient(180deg, #eef6ff 0%, #cfe0f5 100%);
    border-color: #8aa8c4;
}
.fm-match-status--done .fm-match-score {
    color: #1a3c6e;
    font-size: 18px;
}
.fm-match-venue {
    margin: 0 4px 8px;
    padding: 5px 8px;
    text-align: center;
    font-size: 11px;
    color: #4a6078;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid #d5e0ec;
    border-radius: 8px;
}

@media screen and (max-width: 360px) {
    .fm-match-logo {
        width: 36px !important;
        height: 36px !important;
        max-width: 36px !important;
        max-height: 36px !important;
    }
    .fm-match-status {
        min-width: 78px;
        padding: 6px 8px;
    }
    .fm-match-name {
        font-size: 11px;
    }
}

/* Предупреждения лиг: эмодзи вместо картинки warning.png */
.warning {
    background-image: none !important;
    position: relative;
    padding-left: 38px;
}
.warning::before {
    content: "⚠️";
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    line-height: 1;
}

/* Логотип в шапке */
.menu > center > img {
    max-height: 48px;
    width: auto;
}

/* Плитки матчей на главной FM */
a.panel > img {
    display: block;
    margin: 0 auto 3px;
    max-height: 40px;
    width: auto;
}

/* --- Сетка таблиц JohnCMS (bgcolor + cellspacing) --- */
table[cellspacing] {
    border-collapse: separate !important;
    border-spacing: 1px;
    /* background-color: #d0d0d0; */
}
table[cellspacing="2"] { border-spacing: 2px; }
table[cellspacing="3"] { border-spacing: 3px; }
table[border="1"] {
    border-collapse: collapse;
    border: 1px solid #b0b0b0;
}
table[border="1"] td,
table[border="1"] th {
    border: 1px solid #c8c8c8;
}

/* Раскрывающийся блок */
.spoiler-toggle {
    float: right;
    font-size: 14px;
    line-height: 1.2;
    opacity: 0.85;
    user-select: none;
}

/* --- Полосы списков менеджера --- */
.b {
    background-color: #e6effc;
    border: 1px solid #a4bbe3;
    padding: 3px;
    margin: 1px 0;
    box-sizing: border-box;
}
.c {
    background-color: #dce7f8;
    border: 1px solid #b5caea;
    padding: 3px;
    margin: 1px 0;
    box-sizing: border-box;
}

/* --- Плитки меню менеджера --- */
.panel,
a.panel {
    display: block;
    width: 100%;
    height: 100%;
    text-align: center;
    padding: 1px 1px;
/*     font-size: 11px; */
/*     line-height: 1.35; */
    word-wrap: break-word;
    box-sizing: border-box;
    text-decoration: none;
}
.panel img,
a.panel img {
    display: block;
    margin: 0 auto 3px;
}

/* --- Таблицы в блоках меню --- */
.menu > table,
.c > table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}
.menu > table td,
.c > table td {
    vertical-align: top;
    padding: 3px;
    word-wrap: break-word;
    word-break: break-word;
    border: none;
}
/* Сетка менеджера на главной FM — без видимых полей */
.menu > table[width="100%"] td {
    vertical-align: top;
    text-align: center;
}
.c > table td {
    vertical-align: middle;
}
