/* Team generator (/team-generator): only what is the app's own, the team cards (each in a chart series colour of the
   kit) and their short shuffle. Panels, fields, buttons and the colours come from the app kit (css/app-kit,
   docs/app-kit.md). Loaded only on this app's page (StylePaths in its demo catalog entry). */

/* The shared app layout gives the stage a fixed height with overflow hidden: the stage scrolls on its own, so many
   teams stay reachable. */
body .filter-landing-app.team-generator-landing-app > .filter-landing-stage.ak-stage {
    justify-content: flex-start;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

.team-generator-landing-app > .filter-landing-stage.ak-stage > * {
    flex-shrink: 0;
    align-self: stretch;
    min-width: 0;
    max-width: 100%;
}

/* The list of names: a text area with the panel's corners (the kit's fields are pills). */
.team-generator-landing-app textarea.tg-names {
    min-height: 11rem;
    border-radius: var(--ak-radius);
    resize: vertical;
}

.team-generator-landing-app .tg-teams {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 11rem;
    padding: var(--ak-space-3, 0.75rem) 0;
}

.team-generator-landing-app .tg-placeholder {
    color: var(--ak-muted);
    font-size: 5rem;
    font-weight: 800;
    line-height: 1;
    opacity: 0.45;
}

.team-generator-landing-app .tg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
    align-items: start;
    width: 100%;
    gap: 0.75rem;
}

.team-generator-landing-app .tg-team {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--ak-border);
    border-top: 4px solid var(--tg-color);
    border-radius: var(--ak-radius);
    background: var(--ak-field);
    color: var(--ak-text);
}

.team-generator-landing-app .tg-team-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: color-mix(in srgb, var(--tg-color) 14%, transparent);
}

.team-generator-landing-app .tg-team-name {
    color: var(--tg-color);
    font-weight: 800;
}

.team-generator-landing-app .tg-team-count {
    min-width: 1.6rem;
    padding: 0.05rem 0.45rem;
    border-radius: var(--ak-radius-pill);
    background: var(--tg-color);
    color: #ffffff;
    font-size: var(--ak-fs-xs);
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.team-generator-landing-app .tg-team-list {
    margin: 0;
    padding: 0.5rem 0.75rem 0.65rem 2rem;
    font-weight: 600;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

[dir="rtl"] .team-generator-landing-app .tg-team-list {
    padding: 0.5rem 2rem 0.65rem 0.75rem;
}

.team-generator-landing-app .tg-summary {
    min-height: 1.4em;
    margin: 0;
    color: var(--ak-muted);
    font-size: var(--ak-fs-md);
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.team-generator-landing-app .tg-actions {
    display: flex;
    justify-content: center;
    margin-top: 0.75rem;
}

.team-generator-landing-app .tg-actions > .ak-btn {
    min-width: 11rem;
}

/* A short shuffle while throw-away teams flash by; the real teams were made before it started. */
.team-generator-landing-app .tg-teams.is-rolling .tg-team {
    animation: tg-shake 0.12s ease-in-out infinite alternate;
}

@keyframes tg-shake {
    from { transform: translateY(-2px); }
    to { transform: translateY(2px); }
}

@media (prefers-reduced-motion: reduce) {
    .team-generator-landing-app .tg-teams.is-rolling .tg-team {
        animation: none;
    }
}
