:root {
    --bg: #040508;
    --bg-soft: #0c1118;
    --text: #f4f8ff;
    --muted: #9fb1c7;
    --card: rgba(12, 18, 28, 0.76);
    --stroke: rgba(163, 196, 236, 0.22);
    --accent: #85d9ff;
    --accent-2: #78f3cc;
    --shadow: 0 24px 60px rgba(0, 0, 0, 0.56);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
}

body {
    font-family: "Space Grotesk", sans-serif;
    overflow-x: hidden;
    line-height: 1.45;
    text-rendering: optimizeLegibility;
    --spot-x: 50%;
    --spot-y: 25%;
}

.background {
    position: fixed;
    inset: 0;
    z-index: -2;
    background:
        radial-gradient(circle at 20% 20%, rgba(109, 211, 255, 0.12), transparent 28rem),
        radial-gradient(circle at 82% 72%, rgba(113, 245, 198, 0.11), transparent 30rem),
        linear-gradient(160deg, #06090d 0%, #05070a 55%, #090e15 100%);
    animation: bgShift 18s ease-in-out infinite alternate;
}

.stars {
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(1px 1px at 12% 18%, rgba(225, 241, 255, 0.45), transparent),
        radial-gradient(1px 1px at 26% 70%, rgba(225, 241, 255, 0.38), transparent),
        radial-gradient(1px 1px at 41% 32%, rgba(225, 241, 255, 0.42), transparent),
        radial-gradient(1px 1px at 58% 82%, rgba(225, 241, 255, 0.34), transparent),
        radial-gradient(1px 1px at 74% 27%, rgba(225, 241, 255, 0.4), transparent),
        radial-gradient(1px 1px at 88% 63%, rgba(225, 241, 255, 0.36), transparent);
    opacity: 0.5;
    animation: starPulse 6.5s ease-in-out infinite;
}

.grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(143, 185, 226, 0.08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(143, 185, 226, 0.08) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(circle at 50% 45%, black 15%, transparent 80%);
    opacity: 0.18;
}

.spotlight {
    position: absolute;
    inset: 0;
    background: radial-gradient(26rem circle at var(--spot-x) var(--spot-y), rgba(123, 206, 255, 0.15), transparent 70%);
    pointer-events: none;
    transition: background-position 120ms ease;
}

.ambient-wave {
    position: absolute;
    inset: -20% -10%;
    background:
        radial-gradient(42rem 22rem at 18% 14%, rgba(82, 159, 246, 0.16), transparent 70%),
        radial-gradient(46rem 26rem at 82% 84%, rgba(72, 209, 178, 0.14), transparent 72%);
    filter: blur(22px);
    opacity: 0.8;
    animation: ambientShift 18s ease-in-out infinite alternate;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.25;
    animation: drift 16s ease-in-out infinite;
}

.blob-a {
    width: 22rem;
    height: 22rem;
    left: -5rem;
    top: 6rem;
    background: #2f8dff;
}

.blob-b {
    width: 24rem;
    height: 24rem;
    right: -6rem;
    top: 18rem;
    background: #4bdcb7;
    animation-delay: -6s;
}

.blob-c {
    width: 18rem;
    height: 18rem;
    right: 32%;
    top: -4rem;
    background: #3bb7d6;
    animation-delay: -11s;
}

.noise {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.045) 0.4px, transparent 0.4px);
    background-size: 3px 3px;
    opacity: 0.18;
}

.scanlines {
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.028) 0px,
        rgba(255, 255, 255, 0.028) 1px,
        transparent 1px,
        transparent 3px
    );
    mix-blend-mode: soft-light;
    opacity: 0.18;
    animation: scanMove 8s linear infinite;
}

.vignette {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.45) 100%);
}

.container {
    width: min(1080px, 92vw);
    margin: 0 auto;
    padding: 3.5rem 0 2.5rem;
}

.hero {
    position: relative;
    padding: 2rem 1.6rem;
    border: 1px solid var(--stroke);
    border-radius: 1.2rem;
    background: linear-gradient(135deg, rgba(13, 20, 30, 0.9), rgba(7, 12, 18, 0.78));
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: -2px;
    background: linear-gradient(120deg, rgba(125, 203, 255, 0.35), rgba(120, 244, 208, 0.25), transparent 45%);
    filter: blur(24px);
    z-index: -1;
}

.kicker {
    margin: 0;
    color: var(--accent-2);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-size: 0.72rem;
    font-weight: 700;
}

h1 {
    margin: 0.45rem 0 0.35rem;
    font-family: "Syne", sans-serif;
    font-size: clamp(2.1rem, 7.5vw, 4.3rem);
    line-height: 0.9;
    letter-spacing: 0.01em;
    text-wrap: balance;
    text-shadow: 0 8px 26px rgba(87, 190, 255, 0.2);
}

.subtitle {
    margin: 0;
    color: #b3c3d7;
    max-width: 50ch;
    font-size: clamp(0.98rem, 1.55vw, 1.12rem);
    line-height: 1.5;
    text-wrap: pretty;
}

.identity {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1.2rem;
}

.identity span {
    border: 1px solid rgba(162, 201, 255, 0.26);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    color: #d8e7ff;
    background: rgba(17, 28, 43, 0.58);
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.2rem;
    margin-top: 1.3rem;
}

button {
    border: 1px solid rgba(107, 189, 255, 0.35);
    background: linear-gradient(140deg, rgba(95, 180, 255, 0.24), rgba(67, 236, 194, 0.14));
    color: #eef7ff;
    border-radius: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    padding: 0.66rem 1.08rem;
    cursor: pointer;
    transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

button:hover {
    transform: translateY(-1px);
    border-color: rgba(124, 209, 255, 0.6);
    box-shadow: 0 8px 26px rgba(113, 207, 255, 0.2);
}

button:disabled {
    cursor: progress;
    opacity: 0.75;
    transform: none;
}

.status {
    margin: 0;
    color: var(--muted);
    font-size: 0.85rem;
}

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

.stat-card {
    position: relative;
    border-radius: 1rem;
    border: 1px solid var(--stroke);
    background: var(--card);
    backdrop-filter: blur(6px);
    padding: 1.2rem 1rem;
    min-height: 6.8rem;
    box-shadow: var(--shadow);
    transition: transform 180ms ease, border-color 180ms ease;
    overflow: hidden;
}

.stat-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent, rgba(140, 220, 255, 0.14), transparent);
    transform: translateX(-120%);
    transition: transform 450ms ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(123, 199, 255, 0.42);
}

.stat-card:hover::after {
    transform: translateX(120%);
}

.stat-label {
    margin: 0;
    color: #bfd0e6;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.72rem;
}

.stat-value {
    margin: 0.45rem 0 0;
    font-size: clamp(1.5rem, 4.2vw, 2.4rem);
    font-weight: 700;
    color: #f8fbff;
}

.stat-value.loading {
    opacity: 0.6;
    animation: pulse 1.5s ease-in-out infinite;
}

.owned-groups {
    margin-top: 1.2rem;
    padding: 1.2rem 1rem 1rem;
    border-radius: 1rem;
    border: 1px solid var(--stroke);
    background: linear-gradient(165deg, rgba(12, 18, 27, 0.82), rgba(8, 12, 17, 0.72));
    box-shadow: var(--shadow);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

h2 {
    margin: 0;
    font-size: 1.1rem;
    letter-spacing: 0.01em;
}

.section-head a {
    color: #7fd5ff;
    font-size: 0.86rem;
    text-decoration: none;
}

.section-head a:hover {
    text-decoration: underline;
}

.groups-grid {
    margin-top: 0.95rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.7rem;
}

.group-card {
    border-radius: 0.9rem;
    border: 1px solid rgba(172, 208, 255, 0.2);
    background: rgba(14, 22, 33, 0.75);
    padding: 0.82rem 0.85rem;
    transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.group-card:hover {
    transform: translateY(-2px);
    border-color: rgba(127, 203, 255, 0.44);
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.33);
}

.group-name {
    margin: 0;
    font-weight: 700;
    font-size: 0.94rem;
    color: #e7f1ff;
}

.group-meta {
    margin: 0.35rem 0 0;
    color: #b7c7dc;
    font-size: 0.84rem;
}

.group-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: #79d8ff;
    text-decoration: none;
    font-size: 0.82rem;
}

.group-link:hover {
    text-decoration: underline;
}

.empty-groups {
    margin: 0;
    color: #a8bad2;
    font-size: 0.93rem;
}

.footer {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
    margin-top: 1rem;
    color: #95a8c1;
    font-size: 0.82rem;
}

.footer p {
    margin: 0;
}

.reveal {
    opacity: 0;
    transform: translateY(12px);
    animation: reveal 700ms ease forwards;
}

.reveal:nth-of-type(2) {
    animation-delay: 120ms;
}

.reveal:nth-of-type(3) {
    animation-delay: 210ms;
}

.reveal:nth-of-type(4) {
    animation-delay: 300ms;
}

@keyframes drift {
    0% {
        transform: translate(0, 0) scale(1);
    }
    50% {
        transform: translate(22px, -18px) scale(1.08);
    }
    100% {
        transform: translate(0, 0) scale(1);
    }
}

@keyframes bgShift {
    0% {
        filter: saturate(100%) brightness(96%);
    }
    100% {
        filter: saturate(116%) brightness(103%);
    }
}

@keyframes starPulse {
    0%,
    100% {
        opacity: 0.32;
    }
    50% {
        opacity: 0.58;
    }
}

@keyframes ambientShift {
    0% {
        transform: translate3d(-1%, 0%, 0) scale(1);
    }
    100% {
        transform: translate3d(1%, -1.5%, 0) scale(1.04);
    }
}

@keyframes scanMove {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(8px);
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.45;
    }
    50% {
        opacity: 0.88;
    }
}

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

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

@media (max-width: 880px) {
    .stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .container {
        padding-top: 2.2rem;
    }

    .hero,
    .owned-groups {
        padding: 1rem;
    }

    .section-head {
        flex-direction: column;
        align-items: flex-start;
    }
}
