﻿
/* =========================================================
   TOURNAMENTS PAGE
   ========================================================= */

.tournaments-page {
    color: #513b2d;
}

    .tournaments-page h1 {
        color: #65452e;
        font-weight: 800;
    }

    .tournaments-page header p {
        color: #806e60;
    }

.tournaments-kicker {
    color: #b4783f;
    font-size: .74rem;
    font-weight: 800;
    letter-spacing: .16em;
}


/* =========================================================
   TOURNAMENT LIST
   ========================================================= */

.tournament-list {
    display: grid;
    gap: 12px;
}

.tournament-entry {
    background: #fffaf3;
    border: 1px solid #e6d5be;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(74, 47, 22, .06);
}

.tournament-row {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr) 165px;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
}

.tournament-image-button {
    border: 0;
    background: transparent;
    padding: 0;
    cursor: pointer;
    border-radius: 10px;
}

    .tournament-image-button:focus-visible {
        outline: 2px solid #a87847;
        outline-offset: 3px;
    }

.tournament-image {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

.tournament-primary {
    min-width: 0;
}

    .tournament-primary h2 {
        color: #65452e;
        font-weight: 800;
        font-size: 1.12rem;
        margin: 5px 0 9px;
    }

.tournament-kind {
    color: #aa7543;
    text-transform: uppercase;
    font-size: .73rem;
    letter-spacing: .08em;
    font-weight: 800;
}

.tournament-people {
    color: #795637;
    font-weight: 700;
    font-size: .85rem;
}

.tournament-start {
    color: #735339;
    font-size: .82rem;
    font-weight: 650;
    margin-top: 5px;
}

.tournament-status {
    color: #795637;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.45;
    margin-top: 5px;
}


/* =========================================================
   TOURNAMENT ACTIONS
   ========================================================= */

.tournament-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
}

.tournament-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    width: 100%;
    text-align: center;
    text-decoration: none;
}

    .tournament-action:disabled {
        opacity: .55;
        cursor: default;
    }

.tournament-closed {
    color: #876b4f;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
}

.tournament-completed {
    color: #32734e;
    font-weight: 800;
}

.tournament-empty {
    padding: 30px;
    text-align: center;
    color: #876b4f;
    background: #fffaf3;
    border: 1px solid #e6d5be;
    border-radius: 14px;
}


/* =========================================================
   TOURNAMENT MODALS
   Bootstrap controls positioning and dimensions.
   ========================================================= */

.tournament-modal-content {
    border: 1px solid #e0c7a7;
    border-radius: 16px;
}

.tournament-modal-body {
    max-height: 25rem;
    overflow-y: auto;
}

.tournament-modal-image {
    width: min(180px, 55vw);
    height: 180px;
    object-fit: contain;
}


/* =========================================================
   TOURNAMENT INFORMATION
   ========================================================= */

.tournament-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 20px;
}

    .tournament-facts > div {
        background: #faf3e9;
        border: 1px solid #e9dcca;
        border-radius: 10px;
        padding: 10px;
    }

    .tournament-facts span,
    .tournament-facts strong {
        display: block;
        overflow-wrap: anywhere;
    }

    .tournament-facts span {
        font-size: .74rem;
        color: #98775a;
    }

    .tournament-facts strong {
        font-size: .86rem;
        color: #65452e;
        margin-top: 3px;
    }


/* =========================================================
   REGISTERED PLAYERS
   ========================================================= */

.tournament-participant-title {
    color: #65452e;
    font-weight: 800;
}

.tournament-players {
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e9dcca;
    border-radius: 10px;
    background: #fff;
}

.tournament-player {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 38px 42px;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    color: #65452e;
    font-size: .84rem;
}

    .tournament-player + .tournament-player {
        border-top: 1px solid #f0e8dc;
    }

.tournament-player-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 750;
}

.tournament-no-players {
    padding: 24px;
    text-align: center;
    color: #876b4f;
}


/* =========================================================
   PLAYER AVATAR
   ========================================================= */

.tournament-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1e4d0;
    color: #795637;
}

    .tournament-avatar img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }


/* =========================================================
   PLAYER LEVEL BADGE
   ========================================================= */

.tournament-player-level {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 32px;
    height: 32px;
    border: 1px solid #c9a675;
    border-radius: 9px;
    background: linear-gradient(145deg, #fff4df, #e8d0a9);
    color: #65452e;
    box-shadow: 0 2px 5px rgba(80, 51, 23, .12);
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}


/* =========================================================
   PLAYER COUNTRY FLAG
   Large circular flag without badge background.
   ========================================================= */

.tournament-player-country {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    line-height: 1;
}

    .tournament-player-country .fi {
        display: inline-block;
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        border-radius: 50%;
        background-size: cover;
        background-position: center;
        box-shadow: 0 1px 5px rgba(80, 51, 23, .16);
    }

    .tournament-player-country [hidden],
    .tournament-avatar [hidden] {
        display: none !important;
    }


/* =========================================================
   PLAYERS MODAL
   ========================================================= */

#tournamentPlayersModal .tournament-players {
    border: 1px solid #e9dcca;
    border-radius: 10px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 767.98px) {

    .tournament-row {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 10px;
        padding: 12px;
    }

    .tournament-image {
        width: 80px;
        height: 80px;
    }

    .tournament-primary h2 {
        font-size: .98rem;
    }

    .tournament-actions {
        grid-column: 1 / -1;
        width: 100%;
    }

    .tournament-action {
        width: 100%;
    }

    .tournament-player {
        grid-template-columns: 32px minmax(0, 1fr) 34px 38px;
        gap: 8px;
        padding: 8px;
        font-size: .74rem;
    }

    .tournament-avatar {
        width: 30px;
        height: 30px;
    }

    .tournament-player-level {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .tournament-player-country {
        width: 36px;
        height: 36px;
    }

        .tournament-player-country .fi {
            width: 34px;
            height: 34px;
        }
}
