:root {
    --bg: #0c070a;
    --bg-alt: #171015;
    --panel: rgba(22, 13, 18, 0.94);
    --text: #f7ebf0;
    --muted: #bda9b2;
    --accent: #c1121f;
    --accent-2: #ff2b2b;
    --danger: #ff6e6e;
    --border: rgba(255, 92, 92, 0.28);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'Space Grotesk', sans-serif;
    color: var(--text);
    background: #080408;
}

.home-page {
    background: #080304;
}

.home-page.age-locked {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

.background-glow {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: none;
    z-index: -1;
}

.home-page .background-glow {
    background-image: none;
}

.age-consent {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 1rem;
    background: rgba(7, 4, 8, 0.88);
    backdrop-filter: blur(7px);
}

.age-consent-card {
    width: min(560px, 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    padding: 1.25rem;
    background: #130607;
}

.age-consent-card h2 {
    margin: 0.65rem 0 0;
}

.age-consent-card p {
    color: #e6c8d2;
    line-height: 1.5;
}

.age-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.site-header,
.site-footer,
main,
.admin-main,
.admin-header {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 0;
}

.brand {
    font-family: 'Sora', sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.4px;
}

.top-nav {
    display: flex;
    gap: 1rem;
}

.top-nav a {
    color: var(--muted);
    font-weight: 500;
    transition: color 0.2s ease;
}

.top-nav a:hover {
    color: var(--text);
}

.admin-link {
    padding: 0.4rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: 999px;
}

.hero {
    padding: 4rem 0 2.6rem;
}

.eyebrow {
    display: inline-block;
    margin: 0;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    font-size: 0.8rem;
}

.hero h1 {
    margin: 0.85rem 0 0;
    font-family: 'Sora', sans-serif;
    font-size: clamp(2rem, 4vw, 3.3rem);
    line-height: 1.08;
    max-width: 720px;
}

.hero-subtitle {
    margin: 1.2rem 0 0;
    max-width: 720px;
    color: var(--muted);
    line-height: 1.65;
}

.adult-warning {
    margin: 1rem 0 0;
    display: inline-block;
    border: 1px solid rgba(255, 114, 114, 0.48);
    color: #ffb1b1;
    background: rgba(255, 66, 66, 0.12);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
}

.hero-actions {
    margin-top: 1.8rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.72rem 1rem;
    border: 1px solid transparent;
    font-weight: 700;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-2), var(--accent));
    color: #031019;
}

.home-page .btn-primary {
    background: #d90429;
    color: #fff1f1;
}

.btn-ghost {
    border-color: var(--border);
    color: var(--text);
    background: rgba(255, 255, 255, 0.02);
}

.section-heading h2 {
    margin: 0;
    font-family: 'Sora', sans-serif;
    font-size: 1.6rem;
}

.section-heading p {
    margin: 0.45rem 0 0;
    color: var(--muted);
}

.categories-section,
.groups-section,
.admin-table-wrap {
    margin-top: 2.1rem;
}

.view-switch {
    margin-top: 0.9rem;
    display: inline-flex;
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    background: #11090e;
    box-shadow: none;
}

.view-btn {
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 0.52rem 1rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
}

.view-btn.is-active {
    background: #3a0f12;
    color: #ffc8c8;
}

.category-grid {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.category-pill {
    border: 1px solid rgba(255, 80, 80, 0.35);
    background: #1a0c0f;
    color: #f4d8dd;
    border-radius: 999px;
    padding: 0.52rem 1rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.category-pill.is-active {
    border-color: rgba(255, 43, 43, 0.8);
    background: #3b0d12;
    color: #ffd9df;
}

.home-page .category-pill.is-active {
    border-color: rgba(255, 43, 43, 0.8);
    background: #3b0d12;
    color: #ffd2d2;
}

.category-pill:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 120, 120, 0.65);
}

.group-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.95rem;
}

.group-grid.is-list {
    grid-template-columns: 1fr;
    gap: 1.3rem;
}

.group-grid.is-list .group-card {
    display: block;
    padding: 0;
    overflow: hidden;
    border-radius: 18px;
    border: 1px solid rgba(255, 82, 82, 0.4);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.25);
}

.group-grid.is-list .group-banner {
    margin-bottom: 0;
    border: 0;
    border-radius: 0;
    min-height: clamp(360px, 68vh, 760px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.25rem;
}

.group-grid.is-list .group-content {
    padding: 1.05rem 1.25rem 1.2rem;
    background: #0f0607;
}

.group-card {
    background: var(--panel);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 92, 92, 0.22);
    border-radius: 14px;
    padding: 1rem;
    animation: reveal 420ms ease both;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

.group-card:hover {
    border-color: rgba(255, 92, 92, 0.48);
    transform: translateY(-2px);
}

.group-banner {
    border: 1px solid rgba(255, 110, 110, 0.28);
    border-radius: 11px;
    padding: 0.85rem;
    margin-bottom: 0.8rem;
    min-height: 96px;
    background: #3a0c10;
}

.group-banner.has-image {
    background-size: cover;
    background-position: center;
}

.group-banner h4 {
    margin: 0;
    font-size: 1rem;
    color: #ffe8f1;
}

.group-banner p {
    margin: 0.45rem 0 0;
    color: #ffd2d2;
    font-size: 0.88rem;
}

.group-card.is-hidden {
    display: none;
}

.group-grid.is-list .group-card.is-hidden {
    display: none;
}

.group-content {
    margin-top: 0;
}

.group-meta {
    display: flex;
    justify-content: space-between;
    gap: 0.4rem;
    align-items: center;
    margin-top: 0.2rem;
}

.badge {
    font-size: 0.77rem;
    background: rgba(30, 211, 164, 0.18);
    border: 1px solid rgba(30, 211, 164, 0.45);
    border-radius: 999px;
    padding: 0.25rem 0.52rem;
    font-weight: 700;
}

.home-page .badge {
    background: #351012;
    border: 1px solid rgba(255, 70, 70, 0.75);
    color: #ffd0d0;
}

.members {
    color: var(--muted);
    font-size: 0.86rem;
}

.group-card h3 {
    margin: 0.9rem 0 0;
    font-size: 1.16rem;
}

.group-card p {
    margin: 0.6rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.card-link {
    margin-top: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #ffeef0;
    background: #c1121f;
    border: 1px solid #e03131;
    padding: 0.58rem 0.95rem;
    border-radius: 10px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.82rem;
    transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.home-page .card-link,
.home-page .back-link {
    color: #ff9a9a;
}

.home-page .group-grid.is-list .card-link {
    margin-top: 1.2rem;
    width: fit-content;
}

.card-link:hover {
    background: #e71d36;
    border-color: #ff4d4d;
    transform: translateY(-1px);
}

.site-footer {
    margin-top: 3rem;
    padding: 1.2rem 0 2rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
}

.admin-page {
    background: linear-gradient(180deg, #081018 0%, #06080e 100%);
}

.auth-wrapper {
    display: grid;
    place-items: center;
    min-height: 100vh;
}

.auth-card {
    width: min(460px, calc(100% - 2rem));
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.35rem;
}

.auth-card h1 {
    margin: 0.5rem 0 0;
}

.auth-card p {
    color: var(--muted);
}

.auth-error {
    color: var(--danger);
    font-weight: 700;
}

.install-success {
    color: var(--accent);
    font-weight: 700;
}

.install-hint {
    color: #ffd36a;
    font-weight: 600;
}

.auth-form {
    margin-top: 1rem;
    display: grid;
    gap: 0.45rem;
}

.auth-form label {
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-form input {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 9px;
    padding: 0.62rem 0.7rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
}

.auth-select,
.auth-textarea {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 9px;
    padding: 0.62rem 0.7rem;
    font-family: inherit;
    margin-bottom: 0.5rem;
}

.checkbox-row {
    display: inline-flex;
    gap: 0.55rem;
    align-items: center;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.back-link {
    margin-top: 1rem;
    display: inline-block;
    color: var(--accent);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    padding-top: 1.4rem;
}

.admin-actions {
    display: flex;
    gap: 0.6rem;
}

.admin-main {
    padding: 1.2rem 0 2rem;
}

.developer-contact-box {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr);
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 80, 80, 0.35);
    background: #1a0a0e;
}

.developer-contact-box h2 {
    margin: 0.5rem 0 0;
}

.developer-contact-box p {
    color: var(--muted);
}

.developer-phone {
    color: #ffd3d3 !important;
    font-weight: 700;
}

.developer-contact-form {
    display: grid;
    gap: 0.45rem;
}

.developer-contact-form label {
    font-size: 0.9rem;
    color: var(--muted);
}

.developer-contact-form input {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    border-radius: 9px;
    padding: 0.62rem 0.7rem;
    font-family: inherit;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.8rem;
}

.kpi-card {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.95rem;
}

.kpi-card p {
    margin: 0;
    color: var(--muted);
}

.kpi-card strong {
    display: block;
    margin-top: 0.4rem;
    font-size: 1.4rem;
}

.admin-table-wrap {
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.8rem;
}

.admin-table th,
.admin-table td {
    text-align: left;
    padding: 0.65rem 0.4rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.admin-table th {
    color: var(--muted);
    font-weight: 600;
}

.table-btn {
    display: inline-block;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
}

.table-btn-disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.row-actions {
    display: flex;
    gap: 0.45rem;
    align-items: center;
}

.inline-form {
    margin: 0;
}

.inline-form button {
    font-family: inherit;
}

@keyframes reveal {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 900px) {
    .group-grid,
    .kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .group-grid.is-list .group-card {
        display: block;
    }

    .group-grid.is-list .group-banner {
        min-height: clamp(280px, 54vh, 520px);
    }
}

@media (max-width: 700px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.8rem;
    }

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

    .group-grid,
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .developer-contact-box {
        grid-template-columns: 1fr;
    }

    .admin-table {
        font-size: 0.9rem;
    }
}
