* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Literata', serif;
    background-color: #f0f0f0;
    color: #000;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.header-wrapper {
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: center;
    width: 100%;
}

.header-container {
    width: 100%;
    max-width: 1280px;
    padding: 0 20px;
}

.nav-container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.header-title h1 {
    margin: 0;
    font-size: 32px;
    color: #333;
}

.nav-links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links a {
    text-decoration: none;
    color: #0074D9;
    font-weight: bold;
    font-family: 'Literata', serif;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.nav-links a:hover {
    text-decoration: none;
    background-color: #f0f7ff;
}

.nav-links a.current-page {
    background-color: #e6f3ff;
    color: #0056b3;
}

.separator {
    margin: 0 3px;
    color: #ddd;
    font-family: 'Literata', serif;
}

.nav-dropdown {
    position: relative;
    display: inline-block;
}

.nav-dropdown > .nav-dropdown-trigger {
    text-decoration: none;
    color: #0074D9;
    font-weight: bold;
    font-family: 'Literata', serif;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
    cursor: pointer;
    user-select: none;
}

.nav-dropdown > .nav-dropdown-trigger.current-page {
    background-color: #e6f3ff;
    color: #0056b3;
}

.nav-dropdown > .nav-dropdown-trigger:hover {
    background-color: #f0f7ff;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    min-width: 180px;
    z-index: 200;
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-menu a {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #0074D9;
    font-weight: normal;
    font-family: 'Literata', serif;
    white-space: nowrap;
    transition: background-color 0.2s;
}

.nav-dropdown-menu a:hover {
    background-color: #f0f7ff;
}

.nav-dropdown-menu a.current-page {
    background-color: #e6f3ff;
    color: #0056b3;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333;
    padding: 8px;
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    z-index: 99;
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #0074D9;
    font-weight: bold;
    border-bottom: 1px solid #f0f0f0;
}

.mobile-menu a:hover {
    background-color: #f0f7ff;
}

.mobile-menu .mobile-stats-toggle::after {
    content: ' ▾';
    display: inline-block;
}

.mobile-menu .mobile-stats-toggle.open::after {
    content: ' ▾';
}

.mobile-menu .mobile-submenu {
    display: none;
}

.mobile-menu .mobile-submenu.open {
    display: block;
}

.mobile-menu .mobile-submenu a {
    padding-left: 36px;
    font-weight: normal;
}

.main-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    background-color: #f0f0f0;
    width: 100%;
}

.page-container {
    width: 100%;
    max-width: 1280px;
    background-color: white;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    text-align: left;
    box-sizing: border-box;
    min-height: calc(100vh - 180px);
}

.footer-wrapper {
    background-color: #f0f0f0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60px;
    width: 100%;
    margin-top: auto;
}

.footer-container {
    width: 100%;
    max-width: 1280px;
    text-align: center;
    padding: 15px 20px;
    box-sizing: border-box;
}

.footer-text {
    font-size: 14px;
    color: #666;
    font-family: 'Literata', serif;
    line-height: 1.5;
}

.footer-text a {
    color: #666;
    text-decoration: none;
}

.footer-text a:hover {
    text-decoration: underline;
}

.footer-separator {
    margin: 0 8px;
}

h1 {
    font-size: 28px;
    margin-bottom: 20px;
    color: #000000;
    font-weight: 700;
}

.table-container, .results-container {
    width: 100%;
    overflow-x: auto;
    margin: 0 0 20px 0;
    -webkit-overflow-scrolling: touch;
    page-break-inside: avoid;
}

.tournament-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.tournament-tree {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-width: max-content;
    width: 100%;
    gap: 20px;
    padding: 0px 40px;
    position: relative;
    height: 1000px;
}

.tournament-round {
    position: relative;
    width: 280px;
    height: 1000px;
}

.match {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    overflow: hidden;
    width: 280px;
    position: absolute;
    left: 0;
}

.match-header {
    background: #f5f7fa;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    text-align: left;
    color: #000;
    border-bottom: 2px solid #e0e0e0;
}

.player {
    padding: 10px 16px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s;
    line-height: 1.3;
    color: #000;
    height: 44px;
}

.player:last-child {
    border-bottom: none;
}

.player-name {
    flex: 1;
    font-family: 'Literata', serif;
}

.player-status {
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 3px;
    font-weight: 600;
    font-family: 'Literata', serif;
    color: #000 !important;
}

.status-qualified {
    background-color: #d4edda;
}

.status-eliminated {
    background-color: #f8d7da;
}

.status-pending {
    background-color: #fff3cd;
}

.status-qualified .player-status,
.status-eliminated .player-status,
.status-pending .player-status {
    color: #000 !important;
}

.sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(1),
.sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(1) { top: 60px; }
.sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(2),
.sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(2) { top: 300px; }
.sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(3),
.sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(3) { top: 540px; }
.sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(4),
.sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(4) { top: 780px; }
.sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(5) { top: 1020px; }

.sub-tab-content[style*="display: block"] .semifinals .match:nth-child(1) { top: 180px; }
.sub-tab-content[style*="display: block"] .semifinals .match:nth-child(2) { top: 660px; }

.sub-tab-content[style*="display: block"] .final .match:nth-child(1) { top: 420px; }

.connections {
    position: relative;
    width: 80px;
    height: 1000px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.connections svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

.connection-line {
    stroke: #666;
    stroke-width: 2;
    fill: none;
}

#resultsTable {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    margin-bottom: 30px;
    font-size: 1em;
}

#resultsTable th:nth-child(2) {
    background-color: #f5f7fa !important;
}

.results-container table {
    width: auto;
    min-width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
    font-size: 13px;
    margin-bottom: 30px;
    color: #000;
}

#resultsTable th, 
#resultsTable td,
.results-container th,
.results-container td {
    border: 1px solid #e0e0e0;
}

#resultsTable th,
.results-container thead th {
    background-color: #f5f7fa;
    font-weight: 600;
    color: #34495e;
    position: sticky;
    top: 0;
    text-align: center;
    padding: 8px 10px;
    height: 22px;
}

#resultsTable td,
.results-container td {
    padding: 4px 5px;
    height: 16px;
    line-height: 1.2;
}

#resultsTable th:nth-child(1),
#resultsTable td:nth-child(1) {
    width: 70px;
    text-align: center;
    position: sticky;
    left: 0;
    background: #f5f7fa;
    z-index: 2;
}

#resultsTable th:nth-child(2),
#resultsTable td:nth-child(2) {
    width: 160px;
    min-width: 160px;
    position: sticky;
    left: 70px;
    background: white;
    z-index: 2;
    text-align: left;
}

#resultsTable th:nth-child(3),
#resultsTable td:nth-child(3) {
    width: 70px;
    text-align: center;
}

#resultsTable th:nth-child(n+4),
#resultsTable td:nth-child(n+4) {
    width: 60px;
    text-align: center;
}

.rg-column,
.player-column,
.stats-column {
    position: sticky;
    background-color: #f2f2f2;
    z-index: 2;
}

.rg-column {
    left: 0;
    width: 25px;
    text-align: center;
}

.player-column {
    left: 25px;
    width: 140px;
    min-width: 140px;
    text-align: left;
    font-size: 12px;
}

.stats-column {
    left: 165px;
    width: 25px;
    text-align: center;
}

.results-container th.player-column {
    text-align: left;
}

.q-column {
    width: 8px;
    max-width: 8px;
    min-width: 8px;
    overflow: hidden;
    color: #000;
    text-align: center;
    padding: 3px 4px !important;
}

.player-header {
    background-color: #f2f2f2;
    text-align: left;
}

.round-header {
    height: 22px;
    padding: 4px 10px;
    white-space: nowrap;
    font-size: 12px;
}

.match-title {
    font-size: 1.1em;
    font-weight: bold;
    margin: 20px 0 8px 0;
    color: #000;
}

.cell-R-1 { background-color: #84bd4b; }
.cell-R-2 { background-color: #a3cd78; }
.cell-R-3 { background-color: #c1dea5; }
.cell-R-4 { background-color: #dceccd; }
.cell-F-1 { background-color: #d1334e; }
.cell-F-2 { background-color: #dc667a; }
.cell-F-3 { background-color: #e899a7; }
.cell-F-4 { background-color: #f1d2d7; }
.cell-P { background-color: #ffff99; }

.rank-1 td {
    background-color: rgba(255, 215, 0, 0.2) !important;
}

.rank-2 td {
    background-color: rgba(192, 192, 192, 0.2) !important;
}

.rank-3 td {
    background-color: rgba(205, 127, 50, 0.2) !important;
}

.rank-1 td:first-child {
    background-color: rgba(255, 215, 0, 0.4) !important;
    font-weight: bold;
}

.rank-2 td:first-child {
    background-color: rgba(192, 192, 192, 0.4) !important;
    font-weight: bold;
}

.rank-3 td:first-child {
    background-color: rgba(205, 127, 50, 0.4) !important;
    font-weight: bold;
}

.rg-column,
.player-column,
.stats-column {
    background-color: inherit !important;
    z-index: 2;
}

.division-line {
    border-bottom: 2px solid #000 !important;
}

.division-line td {
    border-bottom: 2px solid #000 !important;
}

.search-container {
    max-width: 100%;
    margin: 20px 0 15px 0;
    display: flex;
    justify-content: flex-end;
}

.search-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
    font-family: 'Literata', serif;
    font-size: 15px;
    transition: border 0.3s;
}

.search-input:focus {
    border-color: #3498db;
    outline: none;
}

.loading {
    text-align: center;
    padding: 40px;
    font-style: italic;
    color: #7f8c8d;
    font-size: 17px;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    padding: 20px;
    background-color: #fde8e8;
    border-radius: 4px;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

.no-results {
    text-align: center;
    padding: 40px;
    color: #000;
    font-size: 17px;
}

.retry-button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 15px;
    border-radius: 4px;
    cursor: pointer;
    font-family: 'Literata', serif;
    transition: background 0.3s;
}

.retry-button:hover {
    background-color: #2980b9;
}

.tab-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    position: relative;
}

.tab-button {
    padding: 10px 20px;
    background: #f1f1f1;
    border: none;
    cursor: pointer;
    width: auto;
    text-align: center;
    font-family: 'Literata', serif;
    font-size: 16px;
    transition: all 0.3s;
    flex: 0 1 auto;
    margin: 0 5px;
}

.tab-button.active {
    background: #ddd;
    font-weight: bold;
}

.tab-button.live-tab {
    color: #e74c3c;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.sub-tab-content {
    display: none;
}

.sub-tab-container {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.sorting-info {
    font-style: italic;
    font-size: 0.875em;
    margin-top: -20px;
    margin-bottom: 20px;
    color: #666;
}

#resultsTable th {
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

#resultsTable th:hover {
    background-color: #e0e0e0;
}

#resultsTable th.sorted-asc::after,
#resultsTable th.sorted-desc::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
}

#resultsTable th.sorted-asc::after {
    border-bottom: 5px solid #2c3e50;
    margin-top: -2px;
}

#resultsTable th.sorted-desc::after {
    border-top: 5px solid #2c3e50;
    margin-top: 2px;
}

#resultsTable th.sorted-asc,
#resultsTable th.sorted-desc {
    background-color: #e0e0e0;
}

.sub-tab-button {
    padding: 8px 15px;
    background: #f1f1f1;
    border: none;
    cursor: pointer;
    font-family: 'Literata', serif;
    font-size: 14px;
    transition: all 0.3s;
    margin: 0 3px;
}

.sub-tab-button.active {
    background: #3498db;
    color: white;
    font-weight: bold;
}

.refresh-toggle label {
    font-size: 14px;
    cursor: pointer;
}

.refresh-toggle input {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Finale Ränge - Medaillen-Farben für die ganze Spieler-Zeile */
.final-gold {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.25) 0%, rgba(255, 215, 0, 0.15) 100%) !important;
    border: 2px solid rgba(255, 215, 0, 0.5) !important;
}

.final-silver {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.25) 0%, rgba(192, 192, 192, 0.15) 100%) !important;
    border: 2px solid rgba(192, 192, 192, 0.5) !important;
}

.final-bronze {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.25) 0%, rgba(205, 127, 50, 0.15) 100%) !important;
    border: 2px solid rgba(205, 127, 50, 0.5) !important;
}

.final-fourth {
    background-color: #f8f9fa !important;
    border: 2px solid #e0e0e0 !important;
}

.final-gold .player-name,
.final-silver .player-name,
.final-bronze .player-name,
.final-fourth .player-name {
    font-weight: normal;
}

/* Status-Badge Styling für Medaillen */
.final-gold .player-status {
    background-color: transparent;
    color: #000 !important;
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
}

.final-silver .player-status {
    background-color: transparent;
    color: #000 !important;
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
}

.final-bronze .player-status {
    background-color: transparent;
    color: #000 !important;
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
}

.final-fourth .player-status {
    background-color: transparent;
    color: #000 !important;
    padding: 0;
    border-radius: 0;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
}

/* Hover-Effekte für Medaillen-Gewinner */
.final-gold:hover {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.35) 0%, rgba(255, 215, 0, 0.25) 100%) !important;
}

.final-silver:hover {
    background: linear-gradient(135deg, rgba(192, 192, 192, 0.35) 0%, rgba(192, 192, 192, 0.25) 100%) !important;
}

.final-bronze:hover {
    background: linear-gradient(135deg, rgba(205, 127, 50, 0.35) 0%, rgba(205, 127, 50, 0.25) 100%) !important;
}

.ko-results-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.ko-section {
    margin: 30px 0;
}

.ko-section h3 {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    border-bottom: none;
    padding-bottom: 8px;
}

.ko-match-container {
    margin-bottom: 25px;
}

.ko-match-container h4 {
    font-size: 1em;
    font-weight: 600;
    color: #333;
}

.ko-match-table {
    width: auto;
    min-width: auto;
    border-collapse: collapse;
    white-space: nowrap;
    margin-bottom: 20px;
    font-size: 1em;
}

.ko-match-table th {
    background-color: #f5f7fa;
    font-weight: 600;
    color: #34495e;
    text-align: center;
    padding: 8px 10px;
    height: 22px;
    border: 1px solid #e0e0e0;
}

.ko-match-table td {
    padding: 4px 5px;
    height: 16px;
    line-height: 1.2;
    border: 1px solid #e0e0e0;
    text-align: center;
}

.ko-match-table th:nth-child(1),
.ko-match-table td:nth-child(1) {
    width: 70px;
}

.ko-match-table th:nth-child(2),
.ko-match-table td:nth-child(2) {
    width: 200px;
    min-width: 200px;
    text-align: left;
}

.ko-match-table th:nth-child(n+3),
.ko-match-table td:nth-child(n+3) {
    width: 100px;
}

.live-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.live-header h1 {
    margin: 0;
}

.placement-916-wrapper {
    padding: 20px 0;
}

.placement-group-header {
    text-align: left;
    margin: 30px 0 20px 0;
    color: #333;
    font-size: 1.5em;
}

.placement-group-separator {
    margin: 40px auto;
    border: none;
    border-top: 2px solid #ddd;
    width: 100%;
    max-width: 100%;
}

.placement-tournament-container {
    max-width: 900px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
}

.placement-tournament-tree {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
}

.placement-tournament-round {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.placement-tournament-final {
    display: flex;
    align-items: center;
}

.placement-match {
    width: 280px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.placement-match .match-header {
    background: #f8f9fa;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.9em;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.placement-connections {
    position: relative;
    width: 80px;
    height: 440px;
    flex-shrink: 0;
}

.placement-connections svg {
    width: 100%;
    height: 100%;
}

.placement-ko-section {
    margin-top: 30px;
}

@media (max-width: 1200px) {
    .tournament-tree {
        min-width: max-content;
        gap: 50px;
        height: 900px;
        padding: 15px 30px;
    }
    
    .tournament-round {
        height: 900px;
    }
    
    .match, .tournament-round {
        width: 240px;
    }
    
    .connections {
        width: 60px;
        height: 900px;
    }

    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(1),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(1) { top: 50px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(2),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(2) { top: 240px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(3),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(3) { top: 600px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(4),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(4) { top: 790px; }
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(5) { top: 970px; }

    .sub-tab-content[style*="display: block"] .semifinals .match:nth-child(1) { top: 145px; }
    .sub-tab-content[style*="display: block"] .semifinals .match:nth-child(2) { top: 695px; }

    .sub-tab-content[style*="display: block"] .final .match:nth-child(1) { top: 420px; }
}

@media (max-width: 768px) {
    .header-container, .footer-container {
        padding: 0 15px;
    }

    .header-title h1 {
        font-size: 28px;
    }

    .nav-links {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .page-container {
        padding: 15px;
    }

    #resultsTable, .results-container table {
        font-size: 12px;
    }

    #resultsTable th, 
    #resultsTable td,
    .results-container th,
    .results-container td {
        padding: 6px 8px;
    }

    .search-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .search-input {
        width: 100%;
    }

    #resultsTable th:nth-child(2),
    #resultsTable td:nth-child(2) {
        width: 130px;
        left: 70px;
    }

    .tab-button {
        padding: 8px 12px;
        font-size: 14px;
    }

    .footer-text {
        font-size: 12px;
        white-space: normal;
    }

    .footer-separator {
        margin: 0 6px;
    }

    .tournament-tree {
        min-width: max-content;
        gap: 40px;
        height: 700px;
        padding: 10px 20px;
    }

    .tournament-round {
        height: 700px;
    }

    .connections {
        width: 50px;
        height: 700px;
    }

    .match, .tournament-round {
        width: 220px;
    }

    .player {
        padding: 8px 12px;
        font-size: 13px;
        height: 40px;
    }

    .match-header {
        padding: 8px 12px;
        font-size: 13px;
    }

    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(1),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(1) { top: 40px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(2),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(2) { top: 200px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(3),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(3) { top: 480px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(4),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(4) { top: 640px; }
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(5) { top: 840px; }

    .sub-tab-content[style*="display: block"] .semifinals .match:nth-child(1) { top: 120px; }
    .sub-tab-content[style*="display: block"] .semifinals .match:nth-child(2) { top: 560px; }

    .sub-tab-content[style*="display: block"] .final .match:nth-child(1) { top: 340px; }

    .ko-match-table {
        font-size: 12px;
    }
    
    .ko-match-table th,
    .ko-match-table td {
        padding: 6px 8px;
    }
}

@media (max-width: 480px) {
    .header-container, .footer-container {
        padding: 0 10px;
    }

    .header-title h1 {
        font-size: 20px;
        margin-left: 0px;
    }

    .page-container {
        padding: 10px;
    }

    #resultsTable th:nth-child(n+4),
    #resultsTable td:nth-child(n+4) {
        width: 50px;
    }

    h1 {
        font-size: 24px;
    }

    .tab-button {
        padding: 6px 8px;
        font-size: 13px;
        margin: 0 2px;
    }

    .footer-text {
        font-size: 11px;
    }

    .footer-separator {
        margin: 0 4px;
    }

    .tournament-tree {
        min-width: max-content;
        gap: 35px;
        height: 600px;
        padding: 5px 15px;
    }

    .tournament-round {
        height: 600px;
    }

    .connections {
        width: 45px;
        height: 600px;
    }

    .match, .tournament-round {
        width: 200px;
    }

    .player {
        padding: 7px 10px;
        font-size: 12px;
        height: 36px;
    }

    .match-header {
        padding: 7px 10px;
        font-size: 12px;
    }

.final-gold .player-status,
.final-silver .player-status,
.final-bronze .player-status,
.final-fourth .player-status {
    background-color: transparent !important;
    color: #000 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    font-weight: 700;
    font-size: 28px;
    line-height: 1;
}

.placement-916-wrapper {
    padding: 20px 0;
}

.placement-group-header {
    text-align: left;
    margin: 30px 0 20px 0;
    color: #333;
    font-size: 1.5em;
}

.placement-group-separator {
    margin: 40px auto;
    border: none;
    border-top: 2px solid #ddd;
    width: 100%;
    max-width: 100%;
}

.placement-tournament-container {
    max-width: 900px;
    margin: 0 auto 30px auto;
    padding: 0 20px;
}

.placement-tournament-tree {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 30px;
}

.placement-tournament-round {
    display: flex;
    flex-direction: column;
    gap: 60px;
}

.placement-tournament-final {
    display: flex;
    align-items: center;
}

.placement-match {
    width: 280px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.placement-match .match-header {
    background: #f8f9fa;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 0.9em;
    border-bottom: 1px solid #ddd;
    text-align: left;
}

.placement-connections {
    position: relative;
    width: 80px;
    height: 440px;
    flex-shrink: 0;
}

.placement-connections svg {
    width: 100%;
    height: 100%;
}

.placement-ko-section {
    margin-top: 30px;
}

    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(1),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(1) { top: 35px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(2),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(2) { top: 175px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(3),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(3) { top: 420px; }
    .sub-tab-content[style*="display: block"] .quarterfinals .match:nth-child(4),
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(4) { top: 560px; }
    .sub-tab-content[style*="display: block"] .quarterfinals-extended .match:nth-child(5) { top: 755px; }

    .sub-tab-content[style*="display: block"] .semifinals .match:nth-child(1) { top: 105px; }
    .sub-tab-content[style*="display: block"] .semifinals .match:nth-child(2) { top: 490px; }

    .sub-tab-content[style*="display: block"] .final .match:nth-child(1) { top: 297px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ERWEITERTE GRUPPE – 5 Viertelfinale-Matches (letzte Gruppe bei nicht durch
   16 teilbarer Teilnehmerzahl). Klasse .quarterfinals-extended wird per PHP
   gesetzt wenn qfCount > 4.
   ═══════════════════════════════════════════════════════════════════════════ */

/* Desktop ≥ 1201px: bestehende Container-Höhe 1000px → auf 1280px erweitern */
.tournament-tree:has(.quarterfinals-extended) {
    height: 1280px;
}
.tournament-round.quarterfinals-extended {
    height: 1280px;
}
.tournament-tree:has(.quarterfinals-extended) .connections {
    height: 1280px;
}

/* Match-Positionen Desktop */

/* Halbfinale-Positionen für erweiterte Gruppe (vertikal zentriert zwischen
   Paar 1+2 und Paar 3+4, Match 5 hat Freilos → wird in Platzierungsrunde gewertet).
   HF1 liegt zwischen QF1+QF2, HF2 zwischen QF3+QF4 – unverändert. */
.tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(1) { top: 180px; }
.tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(2) { top: 660px; }

/* Finale-Position unverändert */
.tournament-tree:has(.quarterfinals-extended) .final .match:nth-child(1) { top: 420px; }

/* ── Breakpoint ≤ 1200px ─────────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .tournament-tree:has(.quarterfinals-extended) {
        height: 1200px;
    }
    .tournament-round.quarterfinals-extended {
        height: 1200px;
    }
    .tournament-tree:has(.quarterfinals-extended) .connections {
        height: 1200px;
    }


    .tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(1) { top: 165px; }
    .tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(2) { top: 625px; }
    .tournament-tree:has(.quarterfinals-extended) .final .match:nth-child(1) { top: 395px; }
}

/* ── Breakpoint ≤ 768px ──────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .tournament-tree:has(.quarterfinals-extended) {
        height: 1050px;
    }
    .tournament-round.quarterfinals-extended {
        height: 1050px;
    }
    .tournament-tree:has(.quarterfinals-extended) .connections {
        height: 1050px;
    }


    .tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(1) { top: 140px; }
    .tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(2) { top: 540px; }
    .tournament-tree:has(.quarterfinals-extended) .final .match:nth-child(1) { top: 340px; }
}

/* ── Breakpoint ≤ 480px ──────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .tournament-tree:has(.quarterfinals-extended) {
        height: 950px;
    }
    .tournament-round.quarterfinals-extended {
        height: 950px;
    }
    .tournament-tree:has(.quarterfinals-extended) .connections {
        height: 950px;
    }


    .tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(1) { top: 125px; }
    .tournament-tree:has(.quarterfinals-extended) .semifinals .match:nth-child(2) { top: 485px; }
    .tournament-tree:has(.quarterfinals-extended) .final .match:nth-child(1) { top: 305px; }
}
