:root {
    --bg: #f3f5f0;
    --surface: rgba(255, 255, 255, 0.86);
    --surface-solid: #ffffff;
    --surface-soft: #f7f9f4;
    --line: rgba(24, 32, 22, 0.1);
    --line-strong: rgba(132, 233, 0, 0.55);
    --text: #171b16;
    --muted: #747a70;
    --green: #8bea00;
    --green-dark: #57a800;
    --cyan: #21c6a8;
    --amber: #f0b429;
    --shadow: 0 26px 70px rgba(31, 36, 30, 0.16);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
    background: var(--bg);
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background:
        radial-gradient(circle at 42% 8%, rgba(139, 234, 0, 0.34), transparent 24rem),
        radial-gradient(circle at 75% 24%, rgba(33, 198, 168, 0.12), transparent 26rem),
        linear-gradient(180deg, #fbfcf8 0, #eef1ea 46rem, #f8f9f6 100%);
}

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

button,
input,
select {
    font: inherit;
}

.ambient-stage {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.ambient-grid {
    position: absolute;
    inset: 0;
    opacity: 0.34;
    background-image:
        linear-gradient(rgba(24, 32, 22, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 32, 22, 0.03) 1px, transparent 1px);
    background-size: 96px 96px;
    mask-image: linear-gradient(180deg, #000 0, transparent 78%);
}

.modegg-loader {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    gap: 14px;
    align-content: center;
    background: #f8faf4;
    transition: opacity 260ms ease, visibility 260ms ease;
}

.modegg-loader.is-hidden {
    visibility: hidden;
    opacity: 0;
}

.loader-shell {
    width: min(620px, calc(100vw - 32px));
    padding: clamp(22px, 5vw, 38px);
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-solid);
    box-shadow: var(--shadow);
}

.loader-tagline {
    color: var(--green-dark);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.loader-brand {
    display: grid;
    gap: 4px;
    margin: 12px 0;
    line-height: 0.9;
}

.loader-brand span {
    color: var(--muted);
    font-weight: 900;
}

.loader-brand strong {
    color: var(--text);
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
}

.loader-bar {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(24, 32, 22, 0.08);
}

.loader-bar span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--green), var(--cyan));
    transform-origin: left;
    animation: loaderBar 800ms ease-out both;
}

.loader-dots {
    display: none;
}

.site-header {
    position: sticky;
    top: 18px;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.84);
    box-shadow: 0 14px 42px rgba(31, 36, 30, 0.1);
    transition: box-shadow 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.site-header.is-scrolled {
    border-color: rgba(139, 234, 0, 0.48);
    box-shadow: 0 18px 50px rgba(31, 36, 30, 0.15);
    transform: translateY(-4px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    font-weight: 900;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    color: #182016;
    background: linear-gradient(135deg, var(--green), #c9ff65);
    font-size: 0.95rem;
    font-weight: 900;
    box-shadow: 0 0 0 4px rgba(139, 234, 0, 0.14);
}

.brand-name {
    color: var(--text);
    font-size: 1rem;
    font-weight: 900;
}

.flash,
.notice {
    width: min(1180px, calc(100% - 32px));
    margin: 18px auto 0;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: var(--surface);
    box-shadow: 0 12px 34px rgba(31, 36, 30, 0.08);
}

.site-main {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: clamp(42px, 7vw, 92px) 0 64px;
}

.hero-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
    gap: clamp(26px, 5vw, 72px);
    align-items: center;
    min-height: 430px;
}

.hero-profile {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: clamp(22px, 4vw, 34px);
    align-items: center;
}

.profile-avatar {
    position: relative;
    width: 168px;
    height: 168px;
    overflow: hidden;
    border: 5px solid var(--green);
    border-radius: 999px;
    background: #101610;
    box-shadow:
        0 24px 58px rgba(139, 234, 0, 0.23),
        0 0 0 12px rgba(139, 234, 0, 0.08);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 64% 50%;
    transform: scale(1.44);
    filter: saturate(1.05) contrast(1.08);
}

.partner-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-bottom: 18px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: #4d5549;
    background: rgba(255, 255, 255, 0.72);
    font-size: 0.78rem;
    font-weight: 900;
}

.hero-content h1 {
    margin: 0;
    color: var(--text);
    font-size: clamp(4.4rem, 11vw, 7.8rem);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.88;
}

.hero-content h1 span {
    color: var(--green-dark);
}

.hero-copy {
    max-width: 560px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 1.7vw, 1.2rem);
    font-weight: 700;
    line-height: 1.6;
}

.social-row,
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.social-row {
    margin-top: 18px;
}

.social-row a,
.social-row span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #3f463c;
    background: rgba(255, 255, 255, 0.82);
    font-size: 0.82rem;
    font-weight: 900;
    box-shadow: 0 8px 22px rgba(31, 36, 30, 0.06);
}

.hero-actions {
    margin-top: 22px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.9);
    font-weight: 900;
    transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
    transform: translateY(-2px);
    border-color: rgba(139, 234, 0, 0.72);
    background: #fff;
}

.button-primary {
    border-color: transparent;
    color: #182016;
    background: linear-gradient(135deg, var(--green), #c9ff65);
    box-shadow: 0 14px 28px rgba(139, 234, 0, 0.22);
}

.live-card,
.points-card,
.mini-card,
.panel,
.usage-card,
.points-zone,
.stats-strip {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.live-card {
    padding: 18px;
}

.live-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.live-card-head strong {
    display: block;
    font-size: 1.05rem;
    font-weight: 900;
}

.live-card-head span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.live-card-head b {
    padding: 6px 9px;
    border-radius: 999px;
    color: #182016;
    background: var(--green);
    font-size: 0.74rem;
    white-space: nowrap;
}

.live-preview {
    display: grid;
    align-items: end;
    min-height: 170px;
    margin-top: 18px;
    overflow: hidden;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(10, 14, 10, 0.58)),
        url("../images/modegg-hero.png") center / cover no-repeat;
}

.live-preview span {
    width: fit-content;
    padding: 7px 10px;
    border-radius: 8px;
    color: #182016;
    background: var(--green);
    font-size: 0.8rem;
    font-weight: 900;
}

.live-metrics,
.stats-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.live-metrics {
    margin-top: 14px;
}

.points-card,
.mini-card {
    min-height: 96px;
    padding: 14px;
    box-shadow: none;
}

.card-kicker,
.points-card span,
.mini-card span,
.section-heading span,
.usage-card span {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.points-card strong,
.mini-card strong {
    display: block;
    margin-top: 8px;
    color: var(--text);
    font-size: clamp(2rem, 4vw, 3.2rem);
    font-weight: 900;
    line-height: 1;
}

.points-card.is-featured strong {
    color: var(--green-dark);
}

.mini-card strong {
    color: var(--cyan);
}

.stats-strip {
    position: sticky;
    top: 78px;
    z-index: 70;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    margin-top: clamp(36px, 6vw, 76px);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.84);
}

.stats-strip div {
    min-height: 86px;
    padding: 18px 20px;
    border-right: 1px solid var(--line);
}

.stats-strip div:last-child {
    border-right: 0;
}

.stats-strip strong {
    display: block;
    color: var(--text);
    font-size: clamp(1.4rem, 3vw, 2.2rem);
    font-weight: 900;
    line-height: 1;
}

.stats-strip span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 18px;
    margin-top: 18px;
    content-visibility: auto;
    contain-intrinsic-size: 520px;
}

.panel {
    padding: 22px;
}

.points-zone {
    margin-top: 18px;
    padding: 24px;
    content-visibility: auto;
    contain-intrinsic-size: 640px;
    animation: pointsZoneIn 420ms ease both;
}

.points-zone-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.section-heading {
    margin-bottom: 18px;
}

.points-zone .section-heading,
.points-zone-head .section-heading {
    margin-bottom: 0;
}

.section-heading h2 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    line-height: 1.08;
}

.points-refresh {
    min-height: 32px;
    padding: 8px 10px;
    border: 1px solid rgba(139, 234, 0, 0.42);
    border-radius: 999px;
    color: #365300;
    background: rgba(139, 234, 0, 0.16);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    white-space: nowrap;
}

.activity-list,
.points-list {
    display: grid;
    gap: 10px;
}

.points-list-featured {
    gap: 12px;
}

.activity-row,
.points-row {
    display: grid;
    align-items: center;
    gap: 14px;
    min-height: 70px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-solid);
    transition: transform 160ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.activity-row {
    grid-template-columns: minmax(0, 1fr) auto;
}

.points-row {
    position: relative;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    overflow: hidden;
    animation: pointsRowIn 360ms ease both;
    animation-delay: var(--row-delay, 0ms);
}

.points-row::before {
    content: "";
    position: absolute;
    inset: 10px auto 10px 0;
    width: 3px;
    border-radius: 0 8px 8px 0;
    background: linear-gradient(180deg, var(--green), var(--cyan));
    opacity: 0.72;
}

.activity-row:hover,
.points-row:hover {
    transform: translateX(4px);
    border-color: rgba(139, 234, 0, 0.5);
    background: #fbfff3;
    box-shadow: 0 14px 28px rgba(31, 36, 30, 0.08);
}

.activity-row.is-new,
.points-row.is-highlight {
    border-color: rgba(139, 234, 0, 0.62);
    background: #f7ffe9;
    animation: pointsPulse 760ms ease both;
}

.activity-row strong,
.points-row strong {
    display: block;
    color: var(--text);
    overflow-wrap: anywhere;
}

.points-person {
    min-width: 0;
}

.points-person span {
    display: block;
    margin-top: 4px;
}

.activity-row span,
.points-row span,
.empty-state,
.sound-copy {
    color: var(--muted);
}

.activity-row b,
.points-row b {
    color: var(--green-dark);
    white-space: nowrap;
}

.rank-badge {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    color: #182016;
    background: linear-gradient(135deg, var(--green), #c9ff65);
    font-weight: 900;
}

.points-row.rank-1 {
    border-color: rgba(240, 180, 41, 0.42);
    background: #fffaf0;
}

.points-row.rank-1 .rank-badge {
    background: linear-gradient(135deg, var(--amber), #ffe7a0);
}

.usage-card {
    margin-bottom: 0;
    padding: 16px;
    background: var(--surface-soft);
    box-shadow: none;
}

.usage-card p {
    margin: 0;
    color: #4d5549;
    line-height: 1.58;
}

.usage-card strong {
    color: var(--green-dark);
}

.sound-panel {
    align-content: start;
}

.sound-rule {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 20px;
    border: 1px solid rgba(139, 234, 0, 0.24);
    border-radius: 8px;
    background: #f8ffe9;
}

.sound-rule strong {
    color: var(--text);
    font-size: clamp(2.7rem, 7vw, 4.4rem);
    line-height: 0.9;
    text-align: center;
}

.sound-rule span {
    color: var(--muted);
    font-weight: 900;
    text-align: center;
    text-transform: uppercase;
}

.sound-rule b {
    color: var(--green-dark);
    font-size: 2rem;
    text-align: center;
}

.sound-copy {
    margin: 16px 0 0;
    line-height: 1.6;
}

.empty-state {
    margin: 0;
    padding: 24px;
    border: 1px dashed rgba(24, 32, 22, 0.18);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.58);
    text-align: center;
    font-weight: 900;
}

.site-footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 34px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.9rem;
}

.event-alert-layer,
.toast-stack {
    position: fixed;
    right: clamp(14px, 4vw, 38px);
    z-index: 120;
    width: min(390px, calc(100vw - 28px));
    pointer-events: none;
}

.event-alert-layer {
    top: 92px;
    display: grid;
    gap: 10px;
}

.toast-stack {
    bottom: clamp(14px, 4vw, 34px);
    display: grid;
    gap: 8px;
}

.event-alert,
.toast {
    border: 1px solid rgba(139, 234, 0, 0.44);
    border-radius: 8px;
    color: var(--text);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 20px 46px rgba(31, 36, 30, 0.16);
}

.event-alert {
    padding: 16px;
    animation: alertIn 180ms ease both, alertOut 180ms ease 4.6s forwards;
}

.event-alert-title {
    color: var(--green-dark);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.event-alert-user {
    display: block;
    margin-top: 6px;
    font-size: clamp(1.35rem, 4vw, 2.1rem);
    font-weight: 900;
}

.event-alert-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
    color: var(--muted);
    font-weight: 800;
}

.event-alert-points {
    color: var(--green-dark);
}

.event-alert-gift {
    float: right;
    padding: 6px 8px;
    border-radius: 8px;
    color: #182016;
    background: var(--green);
    font-size: 0.78rem;
    font-weight: 900;
}

.toast {
    padding: 12px 13px;
    animation: alertIn 160ms ease both, alertOut 180ms ease 3.6s forwards;
}

.floating-points {
    position: fixed;
    z-index: 125;
    color: var(--green-dark);
    font-size: 1.2rem;
    font-weight: 900;
    pointer-events: none;
    animation: floatingPoints 760ms ease both;
}

@keyframes loaderBar {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

@keyframes alertIn {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
}

@keyframes alertOut {
    to {
        opacity: 0;
        transform: translateX(18px);
    }
}

@keyframes floatingPoints {
    to {
        opacity: 0;
        transform: translateY(-34px);
    }
}

@keyframes pointsZoneIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
}

@keyframes pointsRowIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
}

@keyframes pointsPulse {
    50% {
        transform: translateX(4px);
    }
}

@media (max-width: 980px) {
    .site-main {
        padding-top: 36px;
    }

    .hero-shell,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .hero-profile {
        grid-template-columns: 132px minmax(0, 1fr);
    }

    .profile-avatar {
        width: 132px;
        height: 132px;
    }

    .stats-strip {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .site-header,
    .site-main,
    .site-footer,
    .flash,
    .notice {
        width: min(100% - 22px, 1180px);
    }

    .site-header {
        top: 10px;
        margin-top: 10px;
    }

    .hero-profile {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .profile-avatar {
        width: 118px;
        height: 118px;
    }

    .partner-badge,
    .social-row,
    .hero-actions {
        justify-content: center;
    }

    .hero-content h1 {
        font-size: clamp(3.3rem, 18vw, 4.8rem);
    }

    .hero-actions,
    .site-footer,
    .stats-strip,
    .live-metrics {
        display: grid;
        grid-template-columns: 1fr;
    }

    .button {
        width: 100%;
    }

    .stats-strip div {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

    .stats-strip div:last-child {
        border-bottom: 0;
    }

    .points-zone,
    .panel,
    .live-card {
        padding: 16px;
    }

    .points-zone-head {
        align-items: stretch;
        flex-direction: column;
    }

    .points-refresh {
        width: fit-content;
    }

    .points-row,
    .activity-row {
        grid-template-columns: 1fr;
    }

    .points-list-featured .points-row {
        grid-template-columns: 44px minmax(0, 1fr);
    }

    .activity-row b,
    .points-row b {
        justify-self: start;
    }

    .points-list-featured .points-row b {
        grid-column: 2;
    }

    .sound-rule {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }
}
