/* Общая обертка страницы с отступом сверху */
.table-page {
    width: 720px;
    height: 720px;
    position: relative;
    font-family: 'Montserrat', 'Segoe UI', Arial, sans-serif;
    color: #ffffff;
    box-sizing: border-box;
    margin: 70px auto 0; /* 70px отступ сверху */
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    padding: 15px;
    overflow: hidden;
}

/* Header */
.print-header { 
    text-align: center; 
    margin-bottom: 8px;
}
.print-header-main-title { 
    font-size: 28px; 
    font-weight: 700; 
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.print-header-secondary-title { 
    font-size: 22px; 
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.print-footer { 
    text-align: center; 
    margin-top: 10px;
}
.print-footer img { 
    width: 700px; 
    height: auto;
    filter: brightness(1.1);
}
.print-header-logo { 
    height: 65px; 
    margin-right: 15px; 
    vertical-align: middle;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.print-header-container { 
    display: flex; 
    flex-direction: row; 
    align-items: center; 
    justify-content: center; 
}
.print-header-text { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
}

/* Заголовки таблиц */
.poo-title-main { 
    text-align: center; 
    font-size: 22px; 
    font-weight: 700; 
    margin: 70px 0 10px 0;
    padding: 6px 0;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.poo-title { 
    text-align: center; 
    font-size: 22px; 
    font-weight: 700; 
    margin: 10px 0;
    padding: 6px 0;
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Основные таблицы - ОБЩИЕ НАСТРОЙКИ */
.poo-table { 
    width: 690px; 
    border-collapse: separate;
    border-spacing: 0;
    margin: 8px auto; 
    text-align: center; 
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    table-layout: fixed;
}
/* ВОССТАНОВЛЕННЫЕ ШРИФТЫ ЗАГОЛОВКОВ ТАБЛИЦ */
.poo-table th { 
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: #fff; 
    padding: 8px 0px;
    font-size: 12px !important; /* Восстановлен исходный размер */
    font-weight: 600;
    border-bottom: 2px solid #003d82;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}
.poo-table td { 
    padding: 6px 2px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1); 
    height: 22px; 
    vertical-align: middle; 
    font-size: 12px; /* Восстановлен исходный размер */
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    line-height: 1.2;
}
.poo-table tr:nth-child(even) td {
    background: rgba(240, 245, 255, 0.7);
}
.poo-table tr:last-child td {
    border-bottom: none;
}
.team-logo { 
    width: 22px; 
    height: 22px; 
    display: block; 
    margin: 0 auto;
    border-radius: 50%;
    border: 1px solid rgba(0, 123, 255, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ТАБЛИЦА ПОЛОЖЕНИЯ КОМАНД - специальные настройки для colspan */
.poo-table:has(th[colspan="2"]) {
    table-layout: fixed;
}
/* Столбец 1: Место */
.poo-table:has(th[colspan="2"]) th:nth-child(1),
.poo-table:has(th[colspan="2"]) td:nth-child(1) {
    width: 50px;
    min-width: 50px;
    max-width: 50px;
    font-size: 12px !important;
    text-align: center;
    font-weight: 600;
}
/* Столбец 2: Логотип - фиксированная ширина */
.poo-table:has(th[colspan="2"]) td:nth-child(2) {
    width: 35px !important;
    min-width: 35px !important;
    max-width: 35px !important;
    padding-left: 2px;
    padding-right: 2px;
}
/* Столбец 3: Название команды */
.poo-table:has(th[colspan="2"]) td:nth-child(3) {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
    font-size: 12px !important;
    font-weight: 500;
    text-align: left;
    padding-left: 8px;
    padding-right: 8px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.3;
    overflow: visible;
}
/* Заголовок "Команда" который объединяет 2 и 3 столбцы */
.poo-table:has(th[colspan="2"]) th[colspan="2"] {
    width: 315px;
    min-width: 315px;
    max-width: 315px;
}
/* Столбцы 4-9: Числовые данные */
.poo-table:has(th[colspan="2"]) th:nth-child(n+3),
.poo-table:has(th[colspan="2"]) td:nth-child(n+4) {
    width: 48px;
    min-width: 48px;
    max-width: 48px;
    font-weight: 600;
    white-space: nowrap;
}

/* Шахматка */
.poo-table:has(th:first-child:empty) {
    table-layout: fixed;
    border-radius: 8px;
}
.poo-table:has(th:first-child:empty) th:first-child {
    width: 120px;
    text-align: left;
    padding-left: 12px;
    font-size: 12px;
}
.poo-table:has(th:first-child:empty) th:not(:first-child),
.poo-table:has(th:first-child:empty) td:not(:first-child) {
    width: 70px;
    min-width: 50px;
    max-width: 70px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    font-size: 12px;
    line-height: 1.1;
}
.poo-table:has(th:first-child:empty) th {
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: #fff;
    font-weight: 600;
    padding: 6px 2px;
    font-size: 12px;
    word-break: break-word;
}
.poo-table:has(th:first-child:empty) td {
    padding: 5px 2px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    font-size: 12px;
}
.poo-table:has(th:first-child:empty) td:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 12px;
    padding-left: 8px;
    text-align: left;
    font-weight: 600;
    color: #0056b3;
}
/* Закругления углов для шахматки */
.poo-table:has(th:first-child:empty) tr:first-child th:first-child {
    border-top-left-radius: 8px;
}
.poo-table:has(th:first-child:empty) tr:first-child th:last-child {
    border-top-right-radius: 8px;
}
.poo-table:has(th:first-child:empty) tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}
.poo-table:has(th:first-child:empty) tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* Плейофф */
.playoff-container { 
    display: flex; 
    justify-content: center; 
    gap: 8px; 
    padding: 8px; 
    flex-wrap: wrap;
}
.match-box { 
    width: 140px;
    padding: 6px; 
    margin: 2px; 
    background: rgba(255, 255, 255, 0.95);
    border-radius: 6px; 
    text-align: center; 
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    font-size: 12px;
    border: 1px solid rgba(0, 123, 255, 0.2);
    word-wrap: break-word;
}
.match-title { 
    font-weight: 700; 
    margin-bottom: 4px;
    color: #007bff;
    font-size: 12px;
    padding-bottom: 2px;
    border-bottom: 1px solid rgba(0, 123, 255, 0.2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.match-team { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    padding: 2px 0; 
    font-size: 11px;
    color: #333;
}
.match-team div {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 1;
    min-width: 0;
}
.match-team span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}
.match-team img { 
    width: 16px; 
    height: 16px; 
    border-radius: 50%;
    border: 1px solid rgba(0, 123, 255, 0.3);
    flex-shrink: 0;
}
.match-score { 
    font-weight: 700; 
    font-size: 12px;
    color: #0056b3;
    min-width: 22px;
    text-align: right;
    flex-shrink: 0;
    margin-left: 4px;
}

/* Итоговая таблица */
.poo-final-standings-table { 
    width: 620px; 
    border-collapse: separate;
    border-spacing: 0;
    margin: 10px auto; 
    text-align: center; 
    font-size: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    table-layout: fixed;
}
.poo-final-standings-table th { 
    background: linear-gradient(135deg, #0056b3 0%, #007bff 100%);
    color: #fff; 
    padding: 8px 4px;
    border-bottom: 2px solid #003d82;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-wrap: break-word;
    white-space: normal;
}
.poo-final-standings-table td { 
    padding: 6px 4px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1); 
    height: auto; 
    vertical-align: middle; 
    font-size: 12px;
    color: #333;
    word-wrap: break-word;
    white-space: normal;
}
.poo-final-standings-table tr:nth-child(even) td {
    background: rgba(240, 245, 255, 0.7);
}
.poo-final-standings-table tr:last-child td {
    border-bottom: none;
}
.poo-final-standings-logo { 
    width: 22px; 
    height: 22px; 
    display: block; 
    margin: 0 auto;
    border-radius: 50%;
    border: 1px solid rgba(0, 123, 255, 0.3);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}
/* Колонки с названиями команд в итоговой таблице */
.poo-final-standings-table td:nth-child(3),
.poo-final-standings-table td:nth-child(6) {
    text-align: left;
    padding-left: 8px;
    white-space: normal;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

.page-divider { 
    border-bottom: 1px solid rgba(255, 255, 255, 0.2); 
    margin: 10px 0; 
}

/* Кнопки скачивания */
.download-panel { 
    text-align: center; 
    margin-top: 10px; 
    margin-bottom: 15px;
}
.download-btn { 
    padding: 10px 20px; 
    font-size: 14px; 
    cursor: pointer;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(0, 123, 255, 0.3);
}
.download-btn:hover {
    background: linear-gradient(135deg, #0056b3 0%, #003d82 100%);
}
.page-meta { 
    font-size: 11px; 
    text-align: center; 
    margin-top: 3px;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Глобальные настройки */
.table-page * {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Улучшения для таблиц на темном фоне */
.poo-table th,
.poo-final-standings-table th {
    border-top: none;
}
.poo-table tr:first-child th:first-child {
    border-top-left-radius: 8px;
}
.poo-table tr:first-child th:last-child {
    border-top-right-radius: 8px;
}
.poo-table tr:last-child td:first-child {
    border-bottom-left-radius: 8px;
}
.poo-table tr:last-child td:last-child {
    border-bottom-right-radius: 8px;
}

/* Для лучшего отображения на темном фоне */
.table-page {
    font-kerning: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
