/* Kun styling til forsiden / ny turnering. */

.index-shell {
    max-width: 920px;
}

.index-header {
    margin-bottom: 20px;
}

.index-intro {
    max-width: 620px;
    margin: 8px 0 0;
    color: var(--text-muted);
}

.tournament-setup {
    padding: 0;
    overflow: hidden;
}

.setup-section {
    padding: 24px;
}

.setup-section+.setup-section {
    border-top: 1px solid var(--border);
}

.section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading h2 {
    margin: 0;
}

.minimum-note {
    border-radius: 999px;
    background: var(--surface-muted);
    color: var(--text-muted);
    padding: 6px 10px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
}

.date-field {
    display: grid;
    gap: 7px;
    max-width: 280px;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 700;
}

.date-field input[type="date"] {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: #fff;
    color: var(--text);
    padding: 9px 11px;
}

.player-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.player-option {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 52px;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface-muted);
    padding: 10px 42px 10px 12px;
    cursor: pointer;
    transition:
        border-color 0.15s ease,
        background 0.15s ease,
        transform 0.08s ease;
}

.player-option:hover {
    border-color: #9fb9cb;
    background: #f4f9fc;
}

.player-option:active {
    transform: translateY(1px);
}

.player-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.player-option-name {
    min-width: 0;
    overflow-wrap: anywhere;
    font-weight: 650;
}

.check-indicator {
    position: absolute;
    right: 12px;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 50%;
    background: #fff;
    color: transparent;
    font-size: 0.85rem;
    font-weight: 900;
}

.player-option:has(input:checked) {
    border-color: #8bb8d6;
    background: var(--accent);
}

.player-option:has(input:checked) .check-indicator {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}

.setup-actions {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--border);
    background: var(--surface-muted);
    padding: 18px 24px;
}

.create-tournament-button {
    min-width: 180px;
}

@media (max-width: 760px) {
    .player-selector {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .index-shell {
        padding-left: 12px;
        padding-right: 12px;
    }

    .setup-section {
        padding: 18px 16px;
    }

    .section-heading {
        display: block;
    }

    .minimum-note {
        display: inline-flex;
        margin-top: 8px;
    }

    .date-field {
        max-width: none;
    }

    .player-selector {
        grid-template-columns: 1fr;
    }

    .setup-actions {
        padding: 14px 16px;
    }

    .create-tournament-button {
        width: 100%;
    }
}

/* Opret ny spiller på forsiden */

.message-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #acd7bc;
}

.add-player-card {
    margin-top: 20px;
}

.add-player-intro {
    margin: 4px 0 0;
    color: var(--muted);
}

.add-player-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}

.add-player-form label {
    display: grid;
    gap: 6px;
    font-weight: 700;
}

.add-player-form input[type="text"] {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    color: var(--text);
    padding: 10px 12px;
}

.add-player-form input[type="text"]:focus {
    outline: 3px solid rgba(31, 95, 139, 0.16);
    border-color: var(--primary);
}

@media (max-width: 620px) {
    .add-player-form {
        grid-template-columns: 1fr;
    }

    .add-player-form button {
        width: 100%;
        margin: 0;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}