/* Основные стили */
html {
    font-family: Tahoma, sans-serif;
}

body {
    font-family: 'Noto Sans', 'Helvetica', sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    background-color: #f5f5f5;
    font-size: 16px;
    box-sizing: border-box;
}


h1, h2, h3 {
    text-align: center;
    font-weight: 700;
    word-wrap: break-word;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: #71c0a1;
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

h3 {
    font-size: 1.2em;
}

.tournament-info {
    text-align: center;
    margin-bottom: 30px;
}

/* Стили для центрирования таблицы */
.replayTable {
    position: relative;
    float: left;
    clear: both;
    margin-bottom: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Стили для внутренних элементов таблицы */
.table-container, 
.controls-container,
.table-container table {
    margin-left: auto !important;
    margin-right: auto !important;
    max-width: 900px !important;
    width: 100% !important;
}
/* Центрирование контейнера таблицы */
.content {
    flex: 1;
    display: flex;
    justify-content: center;
    width: 100%;
}

/* Стили для футера */
footer, .footer {
    margin-top: 40px;
    text-align: center;
    font-size: 14px;
    color: #666;
    padding: 20px 15px;
    width: 100%;
    box-sizing: border-box;
    max-width: 100%;
}

footer a {
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Дополнительные стили для гарантированного центрирования */
#chgk-table {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Стили для элементов управления Replay Table */
.replayTable > .controls-container {
    margin-bottom: 30px;
}

.replayTable > .controls-container > .controls.hidden {
    display: none;
}

.replayTable > .controls-container > .controls > div {
    display: inline-block;
    vertical-align: bottom;
    margin-right: 5px;
    position: relative;
    cursor: pointer;
}

.replayTable > .controls-container > .controls > div.disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Кнопки управления */
.replayTable > .controls-container > .controls > .play {
    width: 14px;
    height: 14px;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    border-left: 12px solid #000;
    border-top: 7px solid transparent;
    border-bottom: 7px solid transparent;
    border-right: 0 solid transparent;
    -webkit-border-radius: 2px;
    -moz-border-radius: 2px;
    border-radius: 2px;
}
.replayTable > .controls-container > .controls > .pause {
    width: 14px;
    height: 14px;
}

.replayTable > .controls-container > .controls > .pause:before {
    left: 0;
}

.replayTable > .controls-container > .controls > .pause:after,
.replayTable > .controls-container > .controls > .pause:before {
    content: "";
    display: block;
    position: absolute;
    width: 5px;
    height: 100%;
    background: #000;
    top: 0;
    -webkit-border-radius: 2px;
    -moz-border-radius: 2px;
    border-radius: 2px;
}

.replayTable > .controls-container > .controls > .pause:after {
    right: 0;
}

.replayTable > .controls-container > .controls > .replay {
    width: 10px;
    height: 10px;
    border: 2px solid #000;
    -webkit-border-radius: 20px;
    -moz-border-radius: 20px;
    border-radius: 20px;
}

.replayTable > .controls-container > .controls > .replay:before {
    width: 8px;
    height: 8px;
    background: #fff;
    right: -6px;
    top: 4px;
}

.replayTable > .controls-container > .controls > .replay:after,
.replayTable > .controls-container > .controls > .replay:before {
    content: "";
    display: block;
    position: absolute;
    -webkit-transform: rotate(-45deg);
    -moz-transform: rotate(-45deg);
    -ms-transform: rotate(-45deg);
    -o-transform: rotate(-45deg);
    transform: rotate(-45deg);
}

.replayTable > .controls-container > .controls > .replay:after {
    border: 4px solid transparent;
    border-top-color: #000;
    right: -7px;
    top: 1px;
}
.replayTable > .controls-container > .controls > .next,
.replayTable > .controls-container > .controls > .previous {
    width: 14px;
    height: 14px;
}

.replayTable > .controls-container > .controls > .next:before,
.replayTable > .controls-container > .controls > .previous:before {
    content: "";
    position: absolute;
    display: block;
    top: 2px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #000;
    border-top: 2px solid #000;
}

.replayTable > .controls-container > .controls > .previous:before {
    left: 5px;
    -webkit-transform: rotate(-135deg);
    -moz-transform: rotate(-135deg);
    -ms-transform: rotate(-135deg);
    -o-transform: rotate(-135deg);
    transform: rotate(-135deg);
}

.replayTable > .controls-container > .controls > .next:before {
    right: 5px;
    -webkit-transform: rotate(45deg);
    -moz-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    -o-transform: rotate(45deg);
    transform: rotate(45deg);
}

/* Стили для слайдера */
.replayTable .slider {
    display: inline-block;
    margin-left: 20px;
    width: 230px;
    position: relative;
    height: 1px;
    background: rgba(0, 0, 0, .1);
}

.replayTable .slider .slider-toggle {
    position: absolute;
    display: block;
    width: auto;
    white-space: nowrap;
    padding: 0 2px;
    min-width: 12px;
    height: 16px;
    background: #fff;
    border: 1px solid #999;
    top: -24px;
    cursor: pointer;
    border-radius: 3px;
    text-align: center;
    line-height: 17px;
    font-size: 10px;
    color: #000;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.replayTable .slider .slider-toggle:before {
    bottom: -5px;
    border-color: #fff transparent;
    z-index: 2;
}

.replayTable .slider .slider-toggle:after,
.replayTable .slider .slider-toggle:before {
    content: "";
    position: absolute;
    left: 50%;
    margin-left: -4px;
    border-width: 6px 4px 0;
    border-style: solid;
    display: block;
    width: 0;
}

.replayTable .slider .slider-toggle:after {
    bottom: -7px;
    border-color: #999 transparent;
}

.replayTable .slider .slider-available {
    position: absolute;
    display: block;
    height: 100%;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, .1);
}

.replayTable .slider .slider-progress {
    position: absolute;
    display: block;
    height: 100%;
    left: 0;
    top: 0;
    background: rgba(0, 0, 0, .3);
}

/* Стили для drilldown-контролов */
.drilldown-contorls .back {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    width: 14px;
    height: 14px;
    margin-right: 10px;
    font-size: 0;
    cursor: pointer;
}

.drilldown-contorls .back:before {
    content: "";
    position: absolute;
    display: block;
    top: 2px;
    left: 5px;
    width: 8px;
    height: 8px;
    border-right: 2px solid #000;
    border-top: 2px solid #000;
    -webkit-transform: rotate(-135deg);
    -moz-transform: rotate(-135deg);
    -ms-transform: rotate(-135deg);
    -o-transform: rotate(-135deg);
    transform: rotate(-135deg);
}

.drilldown-contorls .item {
    display: inline-block;
    vertical-align: bottom;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 800;
}
/* Стили для таблицы */
.replayTable .table-container {
    position: relative;
}

.replayTable .table-container table {
    position: relative;
    left: 0;
    top: 0;
    border-spacing: 0;
}

.replayTable .table-container table + table {
    position: absolute;
    left: 0;
    top: 0;
}

.replayTable .table-container table.drilldown {
    position: relative;
}

.replayTable .hidden {
    visibility: hidden;
}

.replayTable .table-container.classic.drilldowned .hidden {
    display: none;
}

.replayTable th {
    text-align: left;
    text-transform: uppercase;
    font-size: 12px;
    padding-bottom: 5px;
    border-bottom: 1px dotted rgba(0, 0, 0, .1);
}

.replayTable td {
    white-space: nowrap;
    padding: 0 5px;
    font-size: 14px;
    line-height: 14px;
    min-height: 23px;
    height: 23px;
}

.replayTable td.outcome {
    width: 5px;
    padding: 0;
    min-height: 23px;
}

.replayTable .clickable {
    cursor: pointer;
}

.replayTable .clickable:hover {
    text-decoration: underline;
}

.replayTable .calculation {
    text-align: center;
}
/* Стили для спарклайнов */
.replayTable .controls-container.sparklines {
    margin-bottom: 10px;
}

.replayTable .table-container.sparklines:after {
    content: "";
    display: block;
    clear: both;
}

.replayTable .table-container.sparklines > table {
    float: left;
    position: relative;
}

.replayTable .table-container.sparklines > table td {
    border-bottom: 2px solid #fff;
}

.replayTable .table-container.sparklines .slider-cell {
    height: 0;
}

.replayTable td.spark {
    width: 5px !important;
    max-width: 5px;
    height: 17px;
    padding: 3px 0;
    position: relative;
    white-space: nowrap;
    font-size: 14px;
    min-height: 23px;
}

.replayTable td.spark .spark-position {
    position: absolute;
    display: block;
    width: 100%;
    height: 1px !important;
    line-height: 1px;
    font-size: 1px;
    background: #000;
    left: 0;
}

.replayTable td.spark.muted .spark-position {
    opacity: .4;
}

.replayTable td.change {
    color: rgba(0, 0, 0, .8);
    font-size: 14px;
}

.replayTable .main.right td.change {
    text-align: center;
}

.replayTable .main.right td.label.change,
.replayTable .main.right td.opponent.change {
    text-align: left;
}
.replayTable td.spark.muted {
    background-color: transparent !important;
}

.replayTable td.spark.overlapped {
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: grayscale(100%);
    filter: gray;
}

.replayTable span.spark-score {
    position: absolute;
    left: 7px;
    top: 0;
    line-height: 23px;
}

.replayTable .sparklines tr.muted,
.replayTable span.spark-score.muted {
    visibility: hidden;
}

.replayTable .sparklines tr.muted > td.opponent {
    font-size: 0;
}

.replayTable .main.right {
    z-index: 2;
    background: hsla(0, 0%, 100%, .3);
}

.controls-container.sparklines .drilldown-control {
    display: inline-block;
    vertical-align: bottom;
    margin-left: 10px;
    line-height: 13px;
    font-size: 14px;
    text-transform: uppercase;
    font-weight: 800;
}

/* Стили для слайдера спарклайнов */
.replayTable .sparklines-slider .slider-cell {
    position: relative;
}

.replayTable .sparklines-slider.top .slider-toggle {
    position: absolute;
    display: block;
    width: auto;
    white-space: nowrap;
    padding: 0 2px;
    min-width: 12px;
    height: 16px;
    background: #fff;
    border: 1px solid #999;
    top: -23px;
    margin-left: -6px;
    cursor: pointer;
    border-radius: 3px;
    text-align: center;
    line-height: 17px;
    font-size: 10px;
    color: #000;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
.replayTable .sparklines-slider.top .slider-toggle:before {
    bottom: -5px;
    border-color: #fff transparent;
    z-index: 2;
}

.replayTable .sparklines-slider.top .slider-toggle:after,
.replayTable .sparklines-slider.top .slider-toggle:before {
    content: "";
    position: absolute;
    left: 50%;
    margin-left: -4px;
    border-width: 6px 4px 0;
    border-style: solid;
    display: block;
    width: 0;
}

.replayTable .sparklines-slider.top .slider-toggle:after {
    bottom: -7px;
    border-color: #999 transparent;
}

.replayTable .sparklines-slider.bottom .slider-toggle {
    position: absolute;
    display: block;
    width: auto;
    white-space: nowrap;
    padding: 0 2px;
    min-width: 12px;
    height: 16px;
    background: #fff;
    border: 1px solid #999;
}

/* Добавленные стили из генерируемого HTML */

.container, .flag-links, .flag-nav {
    width: 100%;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.container {
    background-color: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.main-chart {
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100% !important;
    height: auto;
    min-height: 400px;
}

.chart-container {
    margin-top: 20px;
    margin-bottom: 20px;
    width: 100%;
    height: auto;
    min-height: 400px;
}

.statistics {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.statistics-section {
    margin-bottom: 20px;
}

.flag-links, .flag-nav {
    margin-top: 30px;
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.flag-section {
    margin-top: 50px;
    padding-top: 20px;
    border-top: 2px solid #ddd;
}

.question-list {
    list-style-type: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.question-list li {
    background-color: #f0f0f0;
    padding: 5px 10px;
    border-radius: 4px;
}

.hardest-questions .question-item {
    margin-bottom: 10px;
}

.teams-took {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.footer {
    margin-top: 30px;
    text-align: center;
    font-size: 0.8em;
    color: #999;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.8rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    .tournament-info p {
        font-size: 0.9rem;
    }
    
    /* Уменьшаем размер шрифта в таблице для мобильных */
    .table-container table {
        font-size: 0.9rem !important;
    }
    
    /* Уменьшаем отступы в ячейках таблицы */
    .table-container td, 
    .table-container th {
        padding: 5px !important;
    }
    
    /* Уменьшаем ширину первой колонки с позицией */
    .table-container td:first-child,
    .table-container th:first-child {
        width: 30px !important;
        min-width: 30px !important;
    }
    
    .chart-container {
        min-height: 300px;
    }
    
    .question-list {
        gap: 5px;
    }
    
    .question-list li {
        padding: 3px 6px;
        font-size: 0.9em;
    }
}
/* Для очень маленьких экранов */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.1rem;
    }
    
    h3 {
        font-size: 1.1em;
    }
    
    .tournament-info p {
        font-size: 0.8rem;
    }
    
    /* Еще сильнее уменьшаем размер шрифта */
    .table-container table {
        font-size: 0.8rem !important;
    }
    
    /* Максимально компактные ячейки */
    .table-container td, 
    .table-container th {
        padding: 3px !important;
    }
    
    /* Делаем кнопки управления меньше */
    .controls-container .controls {
        transform: scale(0.9);
        transform-origin: center center;
    }
}

/* Медиа-запросы для адаптивности из генерируемого HTML */
@media (min-width: 768px) {
    .container {
        max-width: 95%;
        padding: 20px;
    }
    
    body {
        padding: 20px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 90%; /* Было 1200px, теперь используем проценты */
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1300px; /* Увеличиваем максимальную ширину */
    }
    
    body {
        padding: 20px 40px; /* Увеличиваем боковые отступы */
    }
}

@media (min-width: 1800px) {
    .container {
        max-width: 1600px; /* Еще больше для очень широких экранов */
    }
}

/* Принудительное исправление ширины контейнера */
body {
    max-width: 100% !important;
    padding: 10px !important;
}

.container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 15px !important;
    box-sizing: border-box !important;
}

@media (min-width: 768px) {
    body {
        padding: 20px !important;
    }
    
    .container {
        max-width: 95% !important;
        width: 95% !important;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 90% !important;
        width: 90% !important;
    }
}
