/* Community connections: hubs, play profiles, suggestions and play sessions. */

.community-shell {
    display: grid;
    gap: 1.25rem;
}

.community-hero {
    display: grid;
    gap: 0.6rem;
    background: var(--hero-gradient);
    color: var(--hero-ink);
}

.community-hero h1,
.community-hero p {
    margin: 0;
    color: inherit;
}

.community-hero-actions,
.community-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
}

.community-actions form {
    margin: 0;
}

.community-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: community-step;
}

.community-steps li {
    position: relative;
    padding: 0.85rem 0.9rem 0.85rem 3rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--paper);
    color: var(--ink);
    counter-increment: community-step;
}

.community-steps li::before {
    content: counter(community-step);
    position: absolute;
    top: 0.8rem;
    left: 0.85rem;
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--aqua);
    color: #102a2a;
    font-weight: 800;
}

.community-steps li.is-done::before {
    content: "✓";
    background: var(--violet);
    color: white;
}

.community-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr));
    gap: 1rem;
    align-items: start;
}

.community-section-heading {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: end;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}

.community-section-heading h2,
.community-section-heading p {
    margin: 0;
}

.community-card {
    display: grid;
    gap: 0.55rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    color: var(--ink);
}

.community-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.community-card p {
    margin: 0;
}

.community-card-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.community-card-head img,
.community-avatar {
    flex: none;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    object-fit: cover;
}

.community-avatar {
    display: grid;
    place-items: center;
    background: var(--avatar-color, var(--violet));
    color: white;
    font-weight: 800;
}

.community-score {
    margin-left: auto;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: var(--soft);
    color: var(--violet-dark);
    font-size: 0.85rem;
    font-weight: 800;
    white-space: nowrap;
}

.community-reasons {
    display: grid;
    gap: 0.3rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.community-reasons li {
    position: relative;
    padding-left: 1.25rem;
    font-size: 0.93rem;
}

.community-reasons li::before {
    content: "";
    position: absolute;
    top: 0.45em;
    left: 0.2rem;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--aqua-dark);
}

.community-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.community-tag {
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--aqua) 22%, transparent);
    color: var(--ink);
    font-size: 0.82rem;
    font-weight: 700;
}

.community-tag.is-violet {
    background: var(--soft);
    color: var(--violet-dark);
}

.community-muted,
.community-card small {
    color: var(--muted);
}

.community-meter {
    height: 0.55rem;
    overflow: hidden;
    border-radius: 999px;
    background: var(--line);
}

.community-meter span {
    display: block;
    height: 100%;
    width: var(--value, 0%);
    background: linear-gradient(90deg, var(--aqua), var(--violet));
}

.community-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 1rem;
}

.community-filters label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.community-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.75rem;
}

.community-tabs a {
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    font-weight: 700;
    text-decoration: none;
}

.community-tabs a[aria-current="page"] {
    border-color: var(--violet);
    background: var(--violet);
    color: white;
}

.community-notice {
    padding: 0.85rem 1rem;
    border-left: 4px solid var(--aqua-dark);
    border-radius: 10px;
    background: color-mix(in srgb, var(--aqua) 14%, var(--paper));
    color: var(--ink);
}

.community-notice p {
    margin: 0;
}

.community-rules {
    white-space: pre-line;
}

/* Play profile editor */

.community-profile-form {
    display: grid;
    gap: 1rem;
}

.community-step {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
}

.community-step > summary {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.2rem;
    cursor: pointer;
    font-weight: 800;
    list-style: none;
}

.community-step > summary::-webkit-details-marker {
    display: none;
}

.community-step > summary::after {
    content: "+";
    color: var(--violet);
}

.community-step[open] > summary::after {
    content: "−";
}

.community-step-body {
    display: grid;
    gap: 1rem;
    padding: 0 1.2rem 1.2rem;
}

.community-choice-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.community-choice-list label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    cursor: pointer;
}

.community-choice-list label:has(input:checked) {
    border-color: var(--violet);
    background: var(--soft);
    color: var(--violet-dark);
}

.community-field {
    display: grid;
    gap: 0.4rem;
}

.community-field > label,
.community-field > legend {
    font-weight: 700;
}

.community-field fieldset {
    margin: 0;
    padding: 0;
    border: 0;
}

.community-availability {
    min-width: 0;
    max-width: 100%;
}

.community-availability table {
    width: 100%;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 3px;
}

.community-availability thead th:first-child {
    width: 6.5rem;
}

.community-availability th {
    font-size: 0.82rem;
    font-weight: 700;
    text-align: center;
}

.community-availability th[scope="row"] {
    text-align: left;
    white-space: nowrap;
}

.community-availability th[scope="row"] small {
    display: block;
    color: var(--muted);
    font-weight: 400;
}

.community-availability td {
    padding: 0;
}

.community-availability label {
    display: grid;
    place-items: center;
    min-height: 40px;
    border: 1px solid var(--line);
    border-radius: 8px;
    cursor: pointer;
}

.community-availability label:has(input:checked) {
    border-color: var(--aqua-dark);
    background: var(--aqua);
}

.community-availability input {
    width: 1.1rem;
    height: 1.1rem;
    accent-color: var(--aqua-dark);
}

.community-form-errors {
    color: var(--danger);
}

.community-save-bar {
    position: sticky;
    bottom: 0.75rem;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Sessions */

.community-seats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.community-seat {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    border: 1px solid var(--line);
}

.community-seat.is-taken {
    border-color: var(--violet);
    background: var(--violet);
}

.community-people {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.community-people li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.community-people li form {
    margin: 0;
}

.community-people .community-actions {
    gap: 0.35rem;
}

.community-people button,
.community-people .button {
    min-height: 36px;
    padding: 0.4rem 0.8rem;
}

/* Streamer dashboard */

.community-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
    gap: 0.75rem;
    margin: 0;
}

.community-stats div {
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 12px;
}

.community-stats dt {
    color: var(--muted);
    font-size: 0.85rem;
}

.community-stats dd {
    margin: 0.2rem 0 0;
    font-size: 1.5rem;
    font-weight: 800;
}

.community-trend {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 0.4rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.community-trend li {
    display: grid;
    gap: 0.2rem;
    padding: 0.5rem;
    border-radius: 8px;
    background: color-mix(in srgb, var(--aqua) 12%, transparent);
    text-align: center;
    font-size: 0.8rem;
}

.community-trend strong {
    font-size: 1rem;
}

.community-settings-form p {
    margin: 0 0 0.8rem;
}

.community-settings-form ul {
    margin: 0.3rem 0 0;
    padding: 0;
    list-style: none;
}

@media (max-width: 640px) {
    .community-trend {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Seven day columns still fit on a phone: shorter row labels, slimmer cells. */
    .community-availability thead th:first-child {
        width: 4.6rem;
    }

    .community-availability th {
        font-size: 0.75rem;
    }

    .community-availability th[scope="row"] {
        white-space: normal;
    }

    .community-availability th[scope="row"] small {
        font-size: 0.65rem;
    }

    .community-availability label {
        min-height: 36px;
    }

    .community-step-body {
        padding: 0 0.8rem 1rem;
    }

    .community-save-bar {
        position: static;
    }
}

.community-game-results {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.community-game-results .button {
    min-height: 36px;
    padding: 0.35rem 0.75rem;
    font-weight: 700;
}

.community-steps a {
    color: inherit;
    font-weight: 700;
    text-decoration: none;
}

.community-steps a:hover,
.community-steps a:focus-visible {
    color: var(--violet-dark);
    text-decoration: underline;
}
