:root {
    color-scheme: dark;
    font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

html {
    min-width: 320px;
    scroll-behavior: smooth;
    background: #070a15;
}

body {
    min-width: 320px;
    margin: 0;
    color: #dce0ef;
    background:
        radial-gradient(circle at 83% 9%, rgba(56, 189, 248, .055), transparent 26rem),
        #070a15;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after {
    box-sizing: border-box;
}

button, input, select, textarea {
    font: inherit;
}

a, button {
    -webkit-tap-highlight-color: transparent;
}

:focus-visible {
    outline: 2px solid #8d7bff;
    outline-offset: 3px;
}

::selection {
    color: #fff;
    background: rgba(108, 92, 231, .65);
}

#blazor-error-ui {
    display: none;
    position: fixed;
    z-index: 1000;
    right: 1rem;
    bottom: 1rem;
    left: 1rem;
    padding: 1rem;
    border: 1px solid #e96a6a;
    border-radius: 12px;
    color: white;
    background: #3c171d;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .4);
}

#blazor-error-ui .reload { color: #fff; font-weight: 800; }
#blazor-error-ui .dismiss { float: right; color: #fff; cursor: pointer; }

/* Keep legacy content pages readable inside the new full-width shell. */
.site-content > :not(.landing) {
    width: calc(100% - 2rem);
    max-width: 1140px;
    margin-right: auto;
    margin-left: auto;
}

.site-content > :not(.landing):first-child {
    margin-top: clamp(2.5rem, 6vw, 4.5rem);
}

.site-content > :not(.landing):last-child {
    margin-bottom: clamp(3.5rem, 8vw, 6rem);
}

/* Shared leaderboard pages */
.ranking-page {
    max-width: 1040px !important;
    color: #dce0ef;
}

.ranking-hero {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 5vw, 3.5rem);
    border: 1px solid rgba(255, 255, 255, .085);
    border-radius: 30px;
    background:
        radial-gradient(circle at 85% 5%, rgba(98, 230, 213, .12), transparent 17rem),
        radial-gradient(circle at 5% 100%, rgba(141, 123, 255, .15), transparent 21rem),
        linear-gradient(150deg, rgba(23, 29, 53, .92), rgba(9, 13, 27, .98));
    box-shadow: 0 30px 85px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .045);
    text-align: center;
}

.ranking-eyebrow,
.ranking-board__heading > div > span,
.ranking-cta > div:first-child > span {
    color: #62e6d5;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.ranking-hero h1 {
    margin: .65rem 0 .8rem;
    color: #f5f6fc;
    font-size: clamp(2.5rem, 7vw, 4.8rem);
    letter-spacing: -.06em;
    line-height: .98;
}

.ranking-hero > p {
    max-width: 630px;
    margin: 0 auto;
    color: #929bb8;
    font-size: clamp(.9rem, 2vw, 1.02rem);
    line-height: 1.7;
}

.ranking-tabs {
    display: inline-flex;
    gap: .35rem;
    margin-top: 1.75rem;
    padding: .3rem;
    border: 1px solid rgba(255, 255, 255, .075);
    border-radius: 14px;
    background: rgba(4, 7, 16, .38);
}

.ranking-tabs a {
    display: inline-flex;
    min-height: 2.55rem;
    align-items: center;
    gap: .5rem;
    padding: 0 .9rem;
    border-radius: 10px;
    color: #77819e;
    font-size: .76rem;
    font-weight: 800;
    text-decoration: none;
}

.ranking-tabs a:hover { color: #e5e8f5; }

.ranking-tabs .ranking-tabs__active {
    color: #f1efff;
    background: linear-gradient(115deg, rgba(141, 123, 255, .22), rgba(98, 230, 213, .1));
    box-shadow: inset 0 1px rgba(255, 255, 255, .055);
}

.ranking-board {
    margin-top: 1.25rem;
    padding: clamp(1.1rem, 3vw, 1.8rem);
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 26px;
    background: rgba(13, 17, 33, .72);
    box-shadow: 0 24px 70px rgba(0, 0, 0, .2), inset 0 1px rgba(255, 255, 255, .035);
}

.ranking-board__heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0 .35rem;
}

.ranking-board__heading h2 {
    margin: .25rem 0 0;
    color: #edf0f9;
    font-size: 1.35rem;
    letter-spacing: -.035em;
}

.ranking-period {
    display: inline-flex;
    min-height: 2.15rem;
    align-items: center;
    gap: .45rem;
    padding: 0 .7rem;
    border: 1px solid rgba(255, 255, 255, .07);
    border-radius: 999px;
    color: #7d87a3;
    background: rgba(255, 255, 255, .025);
    font-size: .68rem;
    font-weight: 750;
    white-space: nowrap;
}

.ranking-list {
    display: grid;
    gap: .45rem;
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: ranking;
}

.ranking-list li {
    display: grid;
    min-width: 0;
    min-height: 4.6rem;
    align-items: center;
    grid-template-columns: 2.7rem 2.65rem minmax(0, 1fr) auto;
    gap: .8rem;
    padding: .6rem .85rem;
    border: 1px solid transparent;
    border-radius: 16px;
    background: rgba(255, 255, 255, .025);
    transition: border-color .18s, background .18s;
}

.ranking-list li:hover {
    border-color: rgba(141, 123, 255, .16);
    background: rgba(141, 123, 255, .045);
}

.ranking-list--groups li {
    grid-template-columns: 2.7rem 2.65rem minmax(0, 1fr) 5.2rem auto;
}

.ranking-list li:nth-child(1) {
    border-color: rgba(248, 206, 105, .14);
    background: linear-gradient(90deg, rgba(248, 206, 105, .065), rgba(255, 255, 255, .02));
}

.ranking-list li:nth-child(2) { background: linear-gradient(90deg, rgba(190, 201, 225, .045), rgba(255, 255, 255, .018)); }
.ranking-list li:nth-child(3) { background: linear-gradient(90deg, rgba(217, 148, 104, .045), rgba(255, 255, 255, .018)); }

.ranking-list__position {
    color: #707a98;
    font-size: .82rem;
    font-weight: 850;
    text-align: center;
}

.ranking-list__avatar {
    display: grid;
    width: 2.65rem;
    height: 2.65rem;
    place-items: center;
    border: 1px solid rgba(141, 123, 255, .16);
    border-radius: 12px;
    color: #d8d3ff;
    background: linear-gradient(145deg, rgba(141, 123, 255, .16), rgba(98, 230, 213, .055));
    font-size: .82rem;
    font-weight: 900;
}

.ranking-list__avatar--group {
    border-color: rgba(98, 230, 213, .13);
    color: #a4f2e7;
    background: rgba(98, 230, 213, .06);
}

.ranking-list__name {
    overflow: hidden;
    color: #e7e9f4;
    font-size: .86rem;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

a.ranking-list__name:hover { color: #62e6d5; }

.ranking-list__name--link {
    text-decoration: underline;
    text-decoration-color: rgba(98, 230, 213, .28);
    text-decoration-thickness: 1px;
    text-underline-offset: .25rem;
}

.ranking-list__open-group {
    display: inline-flex;
    width: 100%;
    min-height: 2rem;
    align-items: center;
    justify-content: center;
    gap: .38rem;
    border: 1px solid rgba(84, 181, 234, .24);
    border-radius: 999px;
    color: #a9def8;
    background: rgba(45, 164, 224, .08);
    font-size: .64rem;
    font-weight: 850;
    text-decoration: none;
    transition: border-color .18s, color .18s, background .18s;
}

.ranking-list__open-group i {
    color: #58bcea;
    font-size: .82rem;
}

.ranking-list__open-group:hover,
.ranking-list__open-group:focus-visible {
    border-color: rgba(84, 181, 234, .5);
    color: #eefaff;
    background: rgba(45, 164, 224, .16);
}

.ranking-list__open-placeholder { width: 100%; }

.ranking-list__score {
    min-width: 6rem;
    text-align: right;
}

.ranking-list__score strong,
.ranking-list__score small {
    display: block;
}

.ranking-list__score strong {
    color: #a8f3e9;
    font-size: .9rem;
}

.ranking-list__score small {
    margin-top: .1rem;
    color: #5f6885;
    font-size: .6rem;
}

.ranking-note {
    margin: 1rem .35rem 0;
    color: #626b87;
    font-size: .68rem;
    line-height: 1.6;
    text-align: center;
}

.ranking-empty {
    padding: 3.5rem 1rem;
    color: #7c86a3;
    text-align: center;
}

.ranking-skeleton {
    display: grid;
    gap: .45rem;
}

.ranking-skeleton span {
    height: 4.6rem;
    border-radius: 16px;
    background: linear-gradient(100deg, rgba(255,255,255,.025) 30%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.025) 70%);
    background-size: 220% 100%;
    animation: ranking-shimmer 1.4s infinite;
}

.ranking-cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-top: 1.25rem;
    padding: clamp(1.4rem, 4vw, 2.2rem);
    border: 1px solid rgba(98, 230, 213, .1);
    border-radius: 24px;
    background: linear-gradient(120deg, rgba(98, 230, 213, .055), rgba(141, 123, 255, .05));
}

.ranking-cta h2 {
    margin: .35rem 0 0;
    color: #eff1f8;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    letter-spacing: -.035em;
}

.ranking-cta > div:last-child {
    display: flex;
    flex: 0 0 auto;
    gap: .5rem;
}

.ranking-cta a {
    display: inline-flex;
    min-height: 2.8rem;
    align-items: center;
    justify-content: center;
    padding: 0 .9rem;
    border: 1px solid rgba(255, 255, 255, .11);
    border-radius: 12px;
    color: #c8cde0;
    font-size: .72rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.ranking-cta .ranking-cta__telegram {
    border-color: transparent;
    color: #07121a;
    background: linear-gradient(105deg, #73d8ff, #62e6d5);
}

@keyframes ranking-shimmer { to { background-position-x: -220%; } }

@media (max-width: 680px) {
    .ranking-hero { border-radius: 23px; }
    .ranking-hero h1 { font-size: clamp(2.4rem, 13vw, 3.7rem); }
    .ranking-board { border-radius: 21px; }
    .ranking-list li { grid-template-columns: 2rem 2.45rem minmax(0, 1fr) auto; gap: .55rem; padding-inline: .55rem; }
    .ranking-list--groups li { grid-template-columns: 2rem 2.45rem minmax(0, 1fr) 4.9rem auto; }
    .ranking-list__score { min-width: 4.2rem; }
    .ranking-list__score small { max-width: 5rem; }
    .ranking-list__open-group { min-height: 1.9rem; }
    .ranking-cta { align-items: stretch; flex-direction: column; }
    .ranking-cta > div:last-child { display: grid; }
}

@media (max-width: 390px) {
    .ranking-period { display: none; }
    .ranking-list__avatar { display: none; }
    .ranking-list li { grid-template-columns: 2rem minmax(0, 1fr) auto; }
    .ranking-list--groups li { grid-template-columns: 2rem minmax(0, 1fr) 4.65rem auto; }
}

/* Private purchase and gift pages */
.transaction-page {
    display: grid;
    max-width: 680px !important;
    min-height: 55vh;
    align-items: center;
}

.transaction-card {
    position: relative;
    overflow: hidden;
    padding: clamp(1.5rem, 5vw, 3.25rem);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 30px;
    background:
        radial-gradient(circle at 100% 0, rgba(248, 206, 105, .12), transparent 18rem),
        radial-gradient(circle at 0 100%, rgba(141, 123, 255, .14), transparent 20rem),
        linear-gradient(150deg, rgba(24, 30, 54, .94), rgba(9, 13, 27, .98));
    box-shadow: 0 30px 90px rgba(0, 0, 0, .3), inset 0 1px rgba(255, 255, 255, .05);
    text-align: center;
}

.transaction-icon {
    display: grid;
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1.25rem;
    place-items: center;
    border: 1px solid rgba(248, 206, 105, .19);
    border-radius: 18px;
    color: #f7d67b;
    background: linear-gradient(145deg, rgba(248, 206, 105, .12), rgba(141, 123, 255, .09));
    box-shadow: 0 15px 35px rgba(0, 0, 0, .2);
    font-size: 1.25rem;
}

.transaction-eyebrow {
    color: #62e6d5;
    font-size: .7rem;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.transaction-card h1 {
    margin: .65rem 0 .85rem;
    color: #f5f6fc;
    font-size: clamp(2rem, 7vw, 3.65rem);
    letter-spacing: -.055em;
    line-height: 1.03;
}

.transaction-card > p:not(.transaction-notice) {
    max-width: 510px;
    margin: 0 auto;
    color: #8d96b3;
    font-size: .88rem;
    line-height: 1.7;
}

.transaction-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: .55rem;
    margin: 1.65rem 0 1rem;
}

.transaction-price s {
    color: #626b86;
    font-size: .85rem;
}

.transaction-price strong {
    color: #fff;
    font-size: 2rem;
    letter-spacing: -.045em;
}

.transaction-price span {
    color: #717a97;
    font-size: .7rem;
}

.transaction-primary,
.transaction-secondary {
    display: inline-flex;
    min-height: 3.15rem;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    padding: 0 1.3rem;
    border-radius: 14px;
    font-size: .82rem;
    font-weight: 850;
    text-decoration: none;
}

.transaction-primary {
    border: 0;
    color: #10121a;
    background: linear-gradient(110deg, #f7d778, #d3b5ff);
    box-shadow: 0 14px 35px rgba(211, 181, 255, .13);
    cursor: pointer;
}

.transaction-secondary {
    margin-top: 1.4rem;
    border: 1px solid rgba(141, 123, 255, .2);
    color: #c7c0ff;
    background: rgba(141, 123, 255, .055);
}

.transaction-notice {
    max-width: 480px;
    margin: 1.4rem auto 0;
    color: #66708d;
    font-size: .68rem;
    line-height: 1.6;
}

.transaction-notice i { margin-right: .25rem; color: #7f88a7; }

.transaction-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: .5rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, .075);
}

.transaction-stats span,
.transaction-stats strong,
.transaction-stats small {
    display: block;
}

.transaction-stats strong { color: #eef0f8; font-size: 1.1rem; }
.transaction-stats small { margin-top: .2rem; color: #68718e; font-size: .65rem; }

.transaction-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

.transaction-loading span {
    width: .65rem;
    height: .65rem;
    border-radius: 50%;
    background: #8d7bff;
    animation: transaction-pulse .8s infinite alternate;
}

.transaction-loading span:nth-child(2) { animation-delay: .15s; }
.transaction-loading span:nth-child(3) { animation-delay: .3s; }

@keyframes transaction-pulse { to { opacity: .25; transform: translateY(-5px); } }

@media (max-width: 560px) {
    .transaction-card { border-radius: 22px; }
    .transaction-primary, .transaction-secondary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .ranking-skeleton span { animation: none; }
    .ranking-list li { transition: none; }
    .transaction-loading span { animation: none; }
}
