/* =====================================================
   scoreboard.css – BedWars Turniermodus
   ===================================================== */

.current-meta {
    text-align: center;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 22px;
    line-height: 1.25;
    letter-spacing: 0.4px;
}

/* =====================================================
   HAUPTLAYOUT
   ===================================================== */

#main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 430px;
    gap: 30px;
    align-items: start;
}

#main-column {
    min-width: 0;
}

#sidebar-column {
    min-width: 0;
    align-self: stretch;
}

#sidebar-column .panel-title {
    margin-bottom: 14px;
}

/* =====================================================
   TÖPFE A / B – 2 SPALTEN, KOMPAKT
   ===================================================== */

#overview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    margin-bottom: 18px;
}

#overview-grid .panel {
    padding: 14px 16px;
}

.panel-title {
    margin: 0 0 12px;
    text-align: center;
    font-size: 22px;
    color: #c7d2fe;
}

#pot-a,
#pot-b {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 12px;
    align-items: start;
}

.team-card {
    padding: 8px 10px;
    border: 1px solid #1e293b;
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.72);
    min-width: 0;
}

.team-row {
    display: block;
}

.team-name {
    display: block;
    font-weight: 800;
    font-size: 17px;
    line-height: 1.18;
    color: #f8fafc;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.team-minecraft {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.15;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* =====================================================
   SPIELPLAN & RESULTATE
   ===================================================== */

.section-title {
    margin-top: 18px;
    margin-bottom: 14px;
    font-size: 32px;
}

#schedule {
    padding: 22px 24px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 22px;
}

.schedule-round {
    background: #020617;
    border: 3px solid #1e293b;
    border-radius: 14px;
    padding: 18px 16px 20px;
    min-width: 0;
    position: relative;
}

.schedule-round.running {
    border-color: #ef4444;
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.65);
    animation: pulse-running-round 1.7s ease-in-out infinite;
}

@keyframes pulse-running-round {
    0% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
    }
    50% {
        box-shadow: 0 0 28px rgba(239, 68, 68, 1);
    }
    100% {
        box-shadow: 0 0 8px rgba(239, 68, 68, 0.35);
    }
}

.schedule-round.final {
    border-color: #facc15;
}

.schedule-round.final.running {
    border-color: #ef4444;
}

.schedule-round h4 {
    text-align: center;
    margin: 0 0 14px;
    font-size: 23px;
    color: #93c5fd;
    line-height: 1.15;
}

.schedule-round.final h4 {
    color: #fde047;
}

/* Gruppenzuteilung in noch nicht gespielten Runden */

.schedule-team {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    padding: 8px 6px;
    border-bottom: 1px solid #1e293b;
    font-size: 16px;
    line-height: 1.15;
    min-width: 0;
}

.schedule-team:last-child {
    border-bottom: none;
}

.schedule-team-main {
    min-width: 0;
}

.schedule-team-name {
    display: block;
    font-weight: 900;
    color: #f8fafc;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.schedule-team-minecraft {
    display: block;
    color: #94a3b8;
    font-size: 12px;
    margin-top: 3px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

/* Gewinnerhälfte aus Runde 1 auch in Runde 2 hervorheben */
.schedule-team.seeded-row {
    background: rgba(34, 197, 94, 0.16);
    border-radius: 8px;
}

.schedule-team.seeded-row .schedule-team-name {
    color: #dcfce7;
}

.schedule-team.seeded-row .schedule-team-minecraft {
    color: #bbf7d0;
}

.team-color {
    display: inline-block;
    min-width: 76px;
    text-align: center;
    font-weight: 900;
    padding: 5px 8px;
    border-radius: 999px;
    color: #020617;
    background: #e5e7eb;
    white-space: nowrap;
}

/* =====================================================
   RESULTAT-TABELLEN IM SPIELPLAN
   ===================================================== */

.round-result-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
}

.round-result-table td {
    padding: 6px 5px;
    border-bottom: 1px solid #1e293b;
    vertical-align: middle;
    background-clip: padding-box;
}

.round-result-table tr:last-child td {
    border-bottom: none;
}

.round-result-table td:nth-child(1) {
    width: 38px;
    font-weight: 900;
}

.round-result-table td:nth-child(2) {
    width: 78px;
}

.round-result-table td:nth-child(4),
.round-result-table td:nth-child(5) {
    width: 36px;
    text-align: center;
    font-weight: 900;
}

.round-result-table .team-color {
    min-width: 66px;
    padding: 4px 6px;
    font-size: 12px;
}

.round-result-name {
    display: block;
    font-weight: 900;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.12;
}

.round-result-players {
    display: block;
    color: #94a3b8;
    font-size: 10.5px;
    margin-top: 3px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.12;
}

/* Top-Hälfte / Finalqualifikation */
.round-result-table tr.qualifier-row td {
    background: rgba(34, 197, 94, 0.18);
    color: #dcfce7;
    font-weight: 800;
}

.round-result-table tr.qualifier-row .round-result-players {
    color: #bbf7d0;
}

/* Finale – Platz 1–3 */
.round-result-table tr.podium-1 td,
.player-table tr.podium-1 td {
    background: #facc15;
    color: #1e293b !important;
    font-weight: 900;
}

.round-result-table tr.podium-1 .round-result-name,
.round-result-table tr.podium-1 .round-result-players,
.round-result-table tr.podium-1 td,
.player-table tr.podium-1 td {
    color: #1e293b !important;
}

.round-result-table tr.podium-2 td,
.player-table tr.podium-2 td {
    background: rgba(148, 163, 184, 0.24);
    color: #e5e7eb;
    font-weight: 800;
}

.round-result-table tr.podium-3 td,
.player-table tr.podium-3 td {
    background: rgba(180, 83, 9, 0.34);
    color: #fed7aa;
    font-weight: 800;
}

/* Kommentar Finalqualifikation */
.final-qualification-comment {
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px solid rgba(250, 204, 21, 0.5);
    border-radius: 10px;
    background: rgba(250, 204, 21, 0.08);
    color: #fde68a;
    font-size: 14px;
    line-height: 1.35;
}

.final-qualification-comment strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
    color: #fef08a;
}

/* =====================================================
   TABELLEN
   ===================================================== */

.current-table {
    font-size: 25px;
}

.current-table th,
.current-table td {
    padding: 12px 16px;
}

.compact-table {
    font-size: 17px;
}

.compact-table th,
.compact-table td {
    padding: 7px 8px;
}

.player-table {
    font-size: 14px;
    table-layout: fixed;
}

.player-table th,
.player-table td {
    padding: 6px 6px;
    vertical-align: middle;
}

.player-table th:nth-child(1),
.player-table td:nth-child(1) {
    width: 42px;
}

.player-table th:nth-child(2),
.player-table td:nth-child(2) {
    width: 190px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    line-height: 1.15;
}

.player-table th:nth-child(3),
.player-table td:nth-child(3) {
    width: 58px;
    text-align: center;
}

.player-table th:nth-child(4),
.player-table td:nth-child(4),
.player-table th:nth-child(5),
.player-table td:nth-child(5) {
    width: 38px;
    text-align: center;
}

.ranking-table tr {
    box-shadow: inset 0 -2px rgba(255, 255, 255, 0.08);
}

.ranking-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.04);
}

/* =====================================================
   BEDWARS-FARBEN
   ===================================================== */

.color-yellow { background: #fde047; color: #1e293b; }
.color-red    { background: #ef4444; color: #fff; }
.color-blue   { background: #3b82f6; color: #fff; }
.color-green  { background: #22c55e; color: #052e16; }
.color-white  { background: #f8fafc; color: #020617; }
.color-gray   { background: #9ca3af; color: #020617; }
.color-pink   { background: #ec4899; color: #fff; }
.color-cyan   { background: #06b6d4; color: #022c22; }

/* =====================================================
   STATES
   ===================================================== */

.empty-state,
.error-state {
    text-align: center;
    font-size: 22px;
    padding: 24px 0;
}

.empty-state { color: #94a3b8; }
.error-state { color: #fca5a5; }

/* =====================================================
   RESPONSIVE
   ===================================================== */

@media (max-width: 1600px) {
    #main-layout {
        grid-template-columns: minmax(0, 1fr) 420px;
    }
}

@media (max-width: 1200px) {
    #main-layout {
        grid-template-columns: minmax(0, 1fr) 390px;
    }

    #pot-a,
    #pot-b {
        grid-template-columns: 1fr;
    }
}