:root {
    --bg: #eeeeef;
    --panel: #ffffff;
    --text: #050505;
    --muted: #6d6876;
    --line: #e5e2f5;
    --violet: #7000ff;
    --violet-2: #8f2cff;
    --pink: #ff0a82;
    --soft-violet: #dedfff;
    --app-width: 428px;
    --header-height: 72px;
    --bottom-nav-height: 0px;
    --tg-header-top-padding: 10px;
    --tg-header-top-padding: constant(safe-area-inset-top);
    --tg-header-top-padding: env(safe-area-inset-top, 10px);
    --tg-bottom-safe-padding: 0px;
    --tg-bottom-safe-padding: constant(safe-area-inset-bottom);
    --tg-bottom-safe-padding: env(safe-area-inset-bottom, 0px);
    box-sizing: border-box;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "TT Uzum", "Adelle Sans Global", "iQOO Type", Arial, sans-serif;
    -webkit-text-size-adjust: 100%;
}

*,
*::before,
*::after {
    box-sizing: inherit;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    margin: 0;
    min-width: 100%;
    min-height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100svh;
    background: var(--bg);
}

a,
button,
[role="button"],
input,
select,
textarea {
    -webkit-tap-highlight-color: transparent;
}

button {
    font: inherit;
    cursor: pointer;
}

a:focus,
a:focus-visible,
a:active,
button:focus,
button:focus-visible,
button:active,
[role="button"]:focus,
[role="button"]:focus-visible,
[role="button"]:active,
input:focus,
input:focus-visible,
select:focus,
select:focus-visible,
textarea:focus,
textarea:focus-visible {
    outline: none;
    box-shadow: none;
}

img {
    display: block;
    max-width: 100%;
}

img,
svg {
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    user-select: none;
}

.fixed-slot {
    flex: 0 0 auto;
    width: 100%;
    height: 0;
    visibility: hidden;
    pointer-events: none;
}

.fixed-slot--header {
    min-height: var(--header-height);
}

.page-header,
.page-main,
.bottom-nav {
    width: min(100%, var(--app-width));
    max-width: var(--app-width);
    margin: 0 auto;
}

.page-header {
    position: fixed;
    top: 0;
    left: 50%;
    z-index: 20;
    transform: translateX(-50%);
    padding: calc(6px + var(--tg-header-top-padding)) 22px 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom-right-radius: 36px;
    border-bottom-left-radius: 36px;
    background: linear-gradient(135deg, #7a00ff 0%, #6f00f8 48%, #8300ff 100%);
}

.page-header__logo {
    width: 152px;
    height: 48px;
    cursor: pointer;
    object-fit: contain;
}

.page-main {
    flex: 1;
    min-height: 0;
    padding: 22px 22px 18px;
    background: var(--bg);
}

.page-layers {
    min-height: 0;
}

.page-layer {
    display: flex;
    flex-direction: column;
    gap: 26px;
    min-height: 0;
    padding-bottom: calc(var(--bottom-nav-height) + 22px);
}

.page-layer[hidden] {
    display: none;
}

.page-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.page-section--fill {
    flex: 1;
    min-height: 0;
}

.section-title,
.section-sub-title {
    margin: 0;
    color: var(--text);
    font-weight: 700;
    line-height: 1.08;
    letter-spacing: 0;
}

.section-title {
    font-size: 30px;
}

.section-title--dates {
    font-size: 18px;
    font-weight: 700;
}

.section-sub-title {
    font-size: 22px;
}

.panel {
    border: 0;
    border-radius: 24px;
    background: var(--panel);
}

.referral-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px;
}

.referral-card__box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 18px;
    background: var(--soft-violet);
}

.referral-card__url {
    min-height: 34px;
    padding: 7px 10px;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
    color: var(--text);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.referral-card__actions {
    display: flex;
}

.action-button {
    min-height: 56px;
    border: 0;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    background: var(--pink);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    user-select: none;
}

.action-button--primary {
    flex: 1;
    padding: 14px 18px;
}

.action-button--icon {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 14px;
    background: transparent;
}

.action-button--icon img {
    width: 20px;
    height: 20px;
    filter: invert(21%) sepia(99%) saturate(6740%) hue-rotate(267deg) brightness(98%) contrast(126%);
}

.result-card {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-radius: 22px;
}

.result-card__label {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.result-card__value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.result-card__value::after,
.referral-item__status--accent::after,
.leaderboard-entry__balance::after,
.market-entry__buy::after,
.streak-reward-modal__points::after {
    content: "";
    width: 25px;
    height: 26px;
    flex: 0 0 auto;
    display: inline-block;
    background: url("data/coin_emoji.png") center / contain no-repeat;
}

.top-place {
    gap: 16px;
}

.referrals-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    flex: 1;
    min-height: 0;
    padding: 0 18px;
    border-radius: 24px;
    background: var(--panel);
}

.referral-item {
    min-height: 64px;
    padding: 11px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.referral-item:last-child {
    border-bottom: 0;
}

.referral-item__info {
    min-width: 0;
}

.referral-item__name {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
}

.referral-item__date {
    margin-top: 7px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 400;
    line-height: 1.2;
}

.referral-item__status {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.referral-item__status--accent {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
}

.leaderboard-section {
    gap: 16px;
}

.leaderboard-card {
    display: flex;
    flex-direction: column;
    background-color: var(--panel);
    border-radius: 18px;
}

.leaderboard-entry {
    min-height: 66px;
    display: grid;
    padding: 0 16px;
    grid-template-columns: 34px minmax(0, 1fr) max-content;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    border-bottom: 1px solid var(--line);
    color: var(--text);
}

.leaderboard-entry:last-child {
    border-bottom: 0;
}

.leaderboard-entry--me {
    min-height: 62px;
    padding: 0 16px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(135deg, #3f0084 0%, #7000ff 58%, #8a00ff 100%);
    color: #fff;
}

.leaderboard-entry--me:last-child {
    border-bottom: 0;
    margin: 10px -6px;
}

.leaderboard-entry__place,
.leaderboard-entry__name,
.leaderboard-entry__balance {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
}

.leaderboard-entry__place {
    text-align: center;
}

.leaderboard-entry__person {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 4px;
}

.leaderboard-entry__name {
    overflow: hidden;
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.leaderboard-entry__note {
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    opacity: 0.9;
}

.leaderboard-entry__balance {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.leaderboard-me {
    border-radius: 20px;
}

.leaderboard-me[hidden] {
    display: none;
}

.leaderboard-me .leaderboard-entry {
    margin: 0;
    min-height: 68px;
}

.leaderboard-empty {
    min-height: 86px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.08);
    text-align: center;
}

.leaderboard-empty__title {
    color: var(--muted);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
}

.leaderboard-empty__description {
    max-width: 260px;
    color: var(--faint);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
}

.leaderboard-empty--error {
    border-color: rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
}

.market-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.market-entry {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-radius: 24px;
}

.market-entry.fat {
    grid-column: 1 / -1;
}

.market-entry__image {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    object-fit: cover;
    background: #f0eef7;
}

.market-entry__info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.market-entry__title {
    color: var(--text);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
}

.market-entry__quantity {
    color: var(--muted);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
}

.market-entry__buy {
    min-height: 46px;
    border: 0;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: var(--pink);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}

.prizes-card {
    min-height: 196px;
    display: grid;
    grid-template-columns: minmax(132px, 42%) minmax(0, 1fr);
    overflow: hidden;
    border-radius: 24px;
    background: var(--panel);
}

.prizes-card__content {
    min-width: 0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 26px;
    border-radius: 24px;
    background: #8967f1;
    color: #fff;
}

.prizes-card__title {
    max-width: 150px;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.18;
    letter-spacing: 0;
    white-space: pre-line;
}

.prizes-card__items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0;
}

.prizes-card__image {
    width: 100%;
    height: 100%;
    min-height: 196px;
    object-fit: cover;
    object-position: 55% center;
}

.dates-card {
    padding: 22px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    border-radius: 24px;
    background: var(--panel);
}

.dates-card__month {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: 0;
}

.dates-card__header {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: center;
    padding: 0 13px;
}

.dates-card__weekday {
    min-width: 0;
    color: #adadbf;
    font-family: "TT Uzum", Arial, sans-serif;
    font-size: 12px;
    font-weight: 500;
    font-style: normal;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
}

.dates-card__calendar {
    width: 100%;
    aspect-ratio: 361 / 251;
    object-fit: contain;
}

.dates-card__legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px 20px;
}

.dates-card__legend-item {
    position: relative;
    min-height: 24px;
    padding-left: 30px;
    display: inline-flex;
    align-items: center;
    color: var(--text);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.1;
}

.dates-card__legend-item::before {
    content: "";
    position: absolute;
    left: 0;
    width: 20px;
    height: 20px;
    border: 1px solid currentColor;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.dates-card__legend-item--main::before {
    border-color: #37a500;
    background: #dcffce;
}

.dates-card__legend-item--score::before {
    border-color: #a8a500;
    background: #ffffb4;
}

.dates-card__legend-item--final::before {
    border-color: #4923bc;
    background: #e0d4ff;
}

.dates-card__button {
    min-height: 58px;
    border: 0;
    border-radius: 20px;
    background: #8967f1;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
}

.bottom-nav {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    z-index: 20;
    transform: translateX(-50%);
    padding: 12px 22px calc(20px + var(--tg-bottom-safe-padding));
    background: transparent;
}

.bottom-nav__items {
    position: relative;
    height: 68px;
    padding: 4px;
    display: flex;
    gap: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #7b00ff, #7700f5);
    box-shadow: 0 10px 22px rgba(112, 0, 255, 0.18);
}

.bottom-nav__indicator {
    position: absolute;
    top: 4px;
    bottom: 4px;
    left: 4px;
    width: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    opacity: 0;
    pointer-events: none;
    transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1), width 260ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease;
}

.bottom-nav__item {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    padding: 8px 6px;
    border: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: transparent;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
}

.bottom-nav__icon,
.bottom-nav__icon img {
    width: 25px;
    height: 25px;
}

.bottom-nav__icon img {
    filter: brightness(0) invert(1);
}

.bottom-nav__label {
    font-family: "TT Uzum", Arial, sans-serif;
    font-size: 12px;
    font-weight: 600;
    font-style: normal;
    line-height: 1;
    letter-spacing: 0;
    text-align: center;
}

.market-purchase-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: rgba(0, 0, 0, 0.36);
}

.market-purchase-modal--open {
    display: flex;
}

.market-purchase-modal__card {
    width: min(340px, 100%);
    padding: 18px;
    border-radius: 24px;
    background: #fff;
    color: var(--text);
}

.market-purchase-modal__title {
    color: var(--text);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
}

.market-purchase-modal__text {
    margin-top: 8px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.35;
}

.market-purchase-modal__actions {
    margin-top: 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.market-purchase-modal__actions--single {
    grid-template-columns: 1fr;
}

.market-purchase-modal__button {
    min-height: 44px;
    border: 0;
    border-radius: 16px;
    background: var(--violet);
    color: #fff;
    font-size: 16px;
    font-weight: 800;
}

.market-purchase-modal__button--accent {
    background: var(--pink);
    color: #fff;
}

.streak-reward-modal__card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    text-align: center;
}

.streak-reward-modal__group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.streak-reward-modal__gift {
    width: 116px;
    height: 116px;
    object-fit: contain;
}

.streak-reward-modal__points {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--violet);
    font-size: 24px;
    font-weight: 850;
    line-height: 1;
}

.streak-reward-modal__text {
    margin-top: 0;
}

.streak-reward-modal__actions {
    margin-top: 0;
}

.language-page {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    background: var(--violet);
}

.language-select {
    width: min(100%, var(--app-width));
    min-height: 100vh;
    min-height: 100svh;
    margin: 0 auto;
    padding: 40px 22px;
    display: flex;
    flex-direction: column;
    background: var(--violet);
    color: #fff;
    justify-content: center;
}

.language-select__logo {
    max-width: 100%;
    height: auto;
    margin: 0 24px 40px 24px;
    object-fit: contain;
}

.language-select__title {
    margin: 0 0 16px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: 0;
}

.language-select__actions {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.language-select__button {
    min-height: 52px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #fff;
    color: var(--text);
    text-decoration: none;
    font-size: 20px;
    font-weight: 800;
    line-height: 1;
}

.language-select__flag {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

@media (max-width: 360px) {
    :root {
        --header-height: 68px;
    }

    .page-header {
        padding: calc(6px + var(--tg-header-top-padding)) 18px 8px;
    }

    .page-header__logo {
        width: 132px;
    }

    .page-main {
        padding-inline: 18px;
    }

    .section-title {
        font-size: 26px;
    }

    .bottom-nav {
        padding-inline: 18px;
    }

    .bottom-nav__item {
        font-size: 12px;
    }
}
