/* tournament_results.css - Professional and cheerful tournament results page */

/* ========================================
   TOURNAMENT RESULTS CONTAINER
   ======================================== */

.tournament-results-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ========================================
   SUMMARY BOX
   ======================================== */

/* The month and its size in a dark band, then who leads: the tournament list's
   Standings box, still, with no emoji */
.tr-summary {
    box-sizing: border-box;
    width: 100%;
    max-width: 480px;
    margin: 8px auto 30px;
    border: 2px solid var(--dark-surface);
    background: #fff;
    font-family: 'Roboto', sans-serif;
    color: var(--dark-surface);
}
.tr-summary-band {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 6px 12px;
    background: var(--bg-footer);
    border-bottom: 2px solid var(--accent-gold);
}
.tr-summary-title {
    margin: 0;
    color: var(--accent-gold);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
}
.tr-summary-count { color: var(--bg-primary); font-size: 14px; white-space: nowrap; }

/* the champion is the heart of the box: the title, then the crowned name, in
   white on the top bar's deep blue, lit from the middle */
.tr-summary-leader {
    padding: 22px 12px 24px;
    background: radial-gradient(ellipse at 50% 60%, #2c3fc4 0%, #141080 50%, #07004D 100%);
    color: #fff;
    text-align: center;
}
.tr-summary-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
}
.tr-summary-name {
    display: block;
    margin-top: 6px;
    font-size: 34px;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.tr-summary-crown {
    width: 0.95em;
    height: 0.8em;
    margin-right: 0.3em;
    vertical-align: -0.02em;
    fill: var(--accent-gold);
}

/* ========================================
   RESULTS TABLE CONTAINER
   ======================================== */

.results-table-container {
    background: var(--surface);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow-x: auto;
}

/* ========================================
   RESULTS TABLE
   ======================================== */

.results-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-family: 'Roboto', sans-serif;
}

.results-table thead {
    background: linear-gradient(135deg, #134e5e 0%, #296437ff 100%);
    color: var(--surface);
}

.results-table thead th {
    padding: 18px 12px;
    text-align: center;
    font-weight: 600;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.results-table thead th:first-child {
    border-top-left-radius: 12px;
    text-align: left;
    padding-left: 24px;
}

.results-table thead th:last-child {
    border-top-right-radius: 12px;
}

.results-table tbody tr {
    transition: all 0.3s ease;
    background: var(--surface);
}

.results-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.results-table tbody tr:hover {
    background: #e0f7fa;
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.results-table tbody td {
    padding: 16px 12px;
    text-align: center;
    border-bottom: 1px solid #ff3903ff;
    font-size: 1em;
    color: var(--text-secondary);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

.results-table tbody tr:last-child td:first-child {
    border-bottom-left-radius: 12px;
}

.results-table tbody tr:last-child td:last-child {
    border-bottom-right-radius: 12px;
}

/* ========================================
   PLAYER NAME CELL
   ======================================== */

.player-name-cell {
    text-align: left !important;
    font-weight: 700;
    padding-left: 24px !important;
    color: var(--text-primary);
    position: relative;
}

.player-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%);
    color: var(--surface);
    border-radius: 50%;
    font-weight: 700;
    margin-right: 12px;
    font-size: 0.9em;
}

.suspended-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    background: var(--danger);
    color: var(--surface);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}

.waiting-badge {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 10px;
    background: var(--gold-bright);
    color: var(--ink);
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    vertical-align: middle;
}

/* Gold, silver and bronze for the top 3 */
.player-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: var(--text-main);
    font-size: 1.1em;
}

.player-rank.rank-2 {
    background: linear-gradient(135deg, var(--line-strong) 0%, var(--surface-3) 100%);
    color: var(--text-main);
}

.player-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #e5a76d 100%);
    color: var(--surface);
}

/* ========================================
   SCORE CELLS
   ======================================== */

.score-cell {
    font-weight: 500;
    color: var(--text-secondary);
}

.score-cell.high-score {
    background: linear-gradient(135deg, #a8e6cf 0%, #56ccf2 100%);
    font-weight: 700;
    color: #0d47a1;
}

.total-score-cell {
    background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%) !important;
    font-weight: 800 !important;
    font-size: 1.15em !important;
    color: var(--surface) !important;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.no-results-message {
    text-align: center;
    padding: 60px 20px;
    background: var(--surface);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.no-results-message h3 {
    font-size: 1.8em;
    color: var(--text-primary);
    margin: 0 0 10px 0;
}

.no-results-message p {
    font-size: 1.1em;
    color: var(--ink-3);
    margin: 0;
}

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

@media (max-width: 768px) {
    .results-table-container {
        padding: 20px 15px;
        overflow-x: auto;
    }

    .results-table {
        font-size: 0.9em;
    }

    .results-table thead th,
    .results-table tbody td {
        padding: 12px 8px;
    }

    .player-name-cell {
        padding-left: 12px !important;
    }

    .player-rank {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
        margin-right: 8px;
    }
}

@media (max-width: 480px) {
    .tournament-results-page {
        padding: 2px;
    }

    .tr-summary { margin-bottom: 16px; }

    .results-table-container {
        padding: 8px 4px;
        border-radius: 10px;
    }

    .results-table {
        font-size: 0.875rem;
    }

    .results-table thead th {
        padding: 6px 3px;
        font-size: 0.875rem;
        letter-spacing: 0;
    }

    .results-table thead th:first-child {
        padding-left: 6px;
    }

    .results-table tbody td {
        padding: 8px 3px;
        font-size: 0.875rem;
    }

    .player-name-cell {
        font-size: 0.875rem;
        padding-left: 4px !important;
    }

    .player-rank {
        width: 20px;
        height: 20px;
        font-size: 0.875rem;
        margin-right: 4px;
    }

    .total-score-cell {
        font-size: 0.875rem !important;
    }

    .no-results-message {
        padding: 30px 10px;
    }

    .no-results-message h3 {
        font-size: 1.1em;
    }

    .no-results-message p {
        font-size: 0.875rem;
    }
}

/* 480 -- space is gold: the shell gives its padding back to the content. */
@media (max-width: 480px) {
  .tournament-results-page { padding-left: 4px; padding-right: 4px; }
  .results-table-container { padding-left: 4px; padding-right: 4px; }
}
