/* PAGE */

.teams-page {
    width: min(1300px, calc(100% - 40px));
    margin: 65px auto;
}

.teams-heading {
    text-align: center;
    margin-bottom: 55px;
}

.teams-tag {
    display: inline-block;
    color: var(--color-primary);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    margin-bottom: 12px;
}

.teams-heading h1 {
    font-size: clamp(30px, 5vw, 44px);
    margin: 0 0 12px;
    font-weight: 800;
}

.teams-heading p {
    color: var(--text-muted);
    font-size: 16px;
    margin: 0;
}

/* LAYOUT */

.teams-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
    gap: 30px;
    max-width: 1050px;
    margin: auto;
}

/* PANELS */

.teams-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 25px;
}

.panel-header h2 {
    margin: 0 0 5px;
    font-size: 22px;
}

.panel-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.item-count {
    background: var(--color-primary-light);
    color: var(--text);
    padding: 7px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

/* AJOUT JOUEUR */

.add-player {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.add-player input,
.config-input {
    min-width: 0;
    padding: 13px 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--background);
    color: var(--text);
    font-size: 14px;
    outline: none;
}

.add-player input {
    flex: 1;
}

.add-player input:focus,
.config-input:focus,
.team-name-input:focus {
    border-color: var(--color-primary);
}

.add-player button {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 9px;
    background: var(--color-primary);
    color: #171717;
    font-size: 25px;
    font-weight: 600;
    cursor: pointer;
}

.add-player img {
  width: 30px;
  height: 30px;
  margin-top: 7.5px;
  margin-left: 1px;
  object-fit: contain;
}

/* LISTE DES JOUEURS */

.player-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 350px;
    overflow-y: auto;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 9px;
}

.player-number {
    color: var(--text-muted);
    font-size: 12px;
    min-width: 20px;
}

.player-name {
    flex: 1;
    min-width: 0;
    padding: 4px 0;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
}

.player-name:focus {
    border-bottom: 1px solid var(--color-primary);
}

.remove-player {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 19px;
    cursor: pointer;
    padding: 0 5px;
}

.remove-player:hover {
    color: #e05252;
}

/* CONFIGURATION */

.field-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 10px;
}

.config-input {
    width: 100%;
    box-sizing: border-box;
}

.team-names-section {
    margin-top: 25px;
}

.field-description {
    margin: -3px 0 15px;
    color: var(--text-muted);
    font-size: 12px;
    line-height: 1.5;
}

.team-name-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 250px;
    overflow-y: auto;
}

.team-name-input {
    width: 100%;
    box-sizing: border-box;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--background);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.generate-button {
    width: 100%;
    margin-top: 25px;
    padding: 15px;
    border: none;
    border-radius: 9px;
    background: var(--color-primary);
    color: #171717;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: filter 150ms ease, transform 150ms ease;
}

.generate-button:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.error-message {
    color: #e05252;
    font-size: 13px;
    margin: 12px 0 0;
    text-align: center;
}

/* RÉSULTATS */

.results-section {
    max-width: 1050px;
    margin: 65px auto 0;
}

.results-section[hidden] {
    display: none;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 25px;
}

.results-header h2 {
    margin: 0 0 7px;
    font-size: 28px;
}

.results-header p {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
}

.secondary-button {
    padding: 11px 15px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: transparent;
    color: var(--text-muted);
    font-size: 13px;
    cursor: pointer;
}

.secondary-button:hover {
    background: var(--background);
}

.teams-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

.team-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow);
    border-top: 3px solid var(--color-primary);
}

.team-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 17px;
}

.team-card h3 {
    margin: 0;
    font-size: 17px;
    overflow-wrap: anywhere;
}

.team-size {
    padding: 5px 9px;
    border-radius: 20px;
    background: var(--color-primary-light);
    color: var(--text);
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
}

.team-members {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.member-dot {
    width: 7px;
    height: 7px;
    flex-shrink: 0;
    border-radius: 50%;
    background: var(--color-primary);
}

/* RESPONSIVE */

@media (max-width: 800px) {
    .teams-layout {
        grid-template-columns: 1fr;
        max-width: 530px;
    }

    .results-section {
        max-width: 530px;
    }
}

@media (max-width: 600px) {
    .teams-page {
        width: calc(100% - 25px);
        margin: 40px auto;
    }

    .teams-heading {
        margin-bottom: 35px;
    }

    .teams-panel {
        padding: 20px;
    }

    .results-header {
        align-items: flex-start;
        flex-direction: column;
    }
}