/* static/css/tournament/current_round.css
   The current round page's own styles, moved out of the page unchanged. */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.title {
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    padding: 1rem 0;
}

.title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 2px;
}

/* One card per image. A pair's two cards stand side by side and share their
   rows (title and image, player band, numbers), so every line of one card
   is level with the same line of the other. */
.image-item {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    min-width: 0;
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
    row-gap: 0;
}

/* Every image in the same square frame, shown whole. */
.image-item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    background: white;
    display: block;
}

.image-item a {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Two lines at most, then "…". The space above and below is a white border,
   not padding: a third line would show through padding. */
.image-title {
    box-sizing: content-box;
    height: 2.6em;
    padding: 0 1rem;
    border-top: 0.6rem solid white;
    border-bottom: 0.6rem solid white;
    background: white;
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
}

/* The player (small round photo and name), then Pair Winner / Group Winner. */
.image-wins {
    padding: 0.6rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.35rem;
    background: white;
    border-top: 2px solid #667eea;
    border-bottom: 2px solid #667eea;
}

.win-player {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    max-width: 100%;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.win-player span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-item .player-avatar {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    aspect-ratio: auto;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #667eea;
}

.win-badge {
    display: inline-block;
    padding: 0.15rem 0.75rem;
    background: #F2E6AC;
    border: 2px solid #36454F;
    border-radius: 20px;
    color: #1a1a2e;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
}

/* The numbers: label on the card's outer side, value on the inner side, so
   the pair's two values meet in the middle (Total 0.73 | 1.82 Total). */
.image-text {
    padding: 1rem;
    background: white;
}

.image-text p,
.prev-judge-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: #333;
}

.image-text strong,
.prev-judge-row b {
    color: #667eea;
    min-width: 0;
}

.image-text .rating-badge {
    flex-shrink: 0;
}

/* The right-hand card is the mirror of the left-hand one. */
.image-item:nth-child(even) .image-text p,
.image-item:nth-child(even) .prev-judge-row,
.image-item:nth-child(even) .win-player {
    flex-direction: row-reverse;
}

.image-item:nth-child(even) .image-wins {
    align-items: flex-end;
}

.image-item:nth-child(even) .image-title,
.image-item:nth-child(even) .image-text strong,
.image-item:nth-child(even) .prev-judge-row b,
.image-item:nth-child(even) .prev-judge-title {
    text-align: right;
}

/* The judge's four scores and their average, then the players' votes. */
.prev-judge {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 2px solid #667eea;
}

.prev-judge-title {
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.rating-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.95rem;
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 16px;
    max-width: 600px;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.empty-state p {
    font-size: 1.5rem;
    color: #666;
    margin-bottom: 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.center {
    text-align: center;
    margin-top: 1rem;
}

.home {
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.2rem 1.5rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.home:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
    background: #f8f9ff;
}

/* Yesterday's results: one block per group. */
.prev-day {
    max-width: 1400px;
    margin: 2rem auto 1rem;
}

.prev-day-theme {
    text-align: center;
    color: white;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.prev-group {
    margin-bottom: 1.5rem;
}

.prev-group-name {
    color: white;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

/* The pairs: two frames side by side on a wide screen. */
.prev-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto 1rem;
}

/* Each pair in its own coloured frame, named Pair 1, Pair 2. */
.prev-pair {
    min-width: 0;
    border: 4px solid #D4AF37;
    border-radius: 16px;
    padding: 0.75rem;
    background: rgba(212, 175, 55, 0.15);
}

.prev-pair:nth-child(even) {
    border-color: #2EC4B6;
    background: rgba(46, 196, 182, 0.15);
}

.prev-pair-name {
    display: inline-block;
    padding: 0.2rem 1rem;
    margin-bottom: 0.75rem;
    border-radius: 20px;
    background: #D4AF37;
    color: #1a1a2e;
    font-size: 1.1rem;
    font-weight: 700;
}

.prev-pair:nth-child(even) .prev-pair-name {
    background: #2EC4B6;
}

.prev-pair-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 1000px) {
    .prev-grid {
        grid-template-columns: 1fr;
    }
}

/* Phones: a pair takes the whole screen width, its two cards side by side;
   no padding above 2px. */
@media (max-width: 768px) {
    body,
    .container {
        padding: 0;
    }

    .prev-grid {
        gap: 0.75rem;
    }

    .prev-pair {
        border-width: 2px;
        border-radius: 8px;
        padding: 0;
    }

    .prev-pair-name {
        margin: 2px;
        font-size: 1rem;
    }

    .prev-pair-cards {
        gap: 2px;
    }

    .image-item {
        border-radius: 6px;
        box-shadow: none;
    }

    .image-title {
        padding: 0 2px;
        border-width: 2px 0;
        font-size: 1rem;
    }

    .image-wins,
    .image-text {
        padding: 2px;
    }

    .image-text p,
    .prev-judge-row {
        font-size: 0.8rem;
        gap: 0.25rem;
    }

    .win-badge {
        font-size: 0.8rem;
        padding: 0.1rem 0.5rem;
    }

    .rating-badge {
        font-size: 0.85rem;
        padding: 0.2rem 0.6rem;
    }
}
