:root {
    --bg: #f4f7ff;
    --surface: rgba(255, 255, 255, 0.96);
    --surface-soft: #edf3ff;
    --line: #e3e9f6;
    --line-strong: #d6def0;
    --text: #18284a;
    --muted: #8a94ad;
    --accent: #2c79ff;
    --accent-strong: #1f62ea;
    --state-color: #2c79ff;
    --fire-filter: none;
    --fire-glow: 0 0 0 rgba(0, 0, 0, 0);
    --fire-scale: 1;
    --shadow: 0 18px 44px rgba(84, 121, 197, 0.12);
    --radius-xl: 34px;
    --radius-lg: 28px;
    --radius-md: 22px;
    --radius-sm: 18px;
    --app-width: 100%;
    --app-height: 100dvh;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

body {
    min-height: var(--app-height);
    overscroll-behavior: none;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

button,
a,
iframe {
    font: inherit;
}

img,
svg,
canvas,
iframe {
    max-width: 100%;
}

button {
    appearance: none;
    border: 0;
}

.app-shell {
    width: 100%;
    height: var(--app-height);
    padding:
        max(12px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
}

.menu-screen,
.player-screen {
    width: 100%;
    height: 100%;
}

/* Tab layout */
.menu-screen {
    overflow: hidden;
}

.home-surface {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
}

.tab-content {
    min-height: 0;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

.tab-panel {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding: 0 0 14px;
}

.tab-panel::-webkit-scrollbar {
    display: none;
}

.tab-panel.is-hidden {
    display: none;
}

.home-tab {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 8px;
    overflow-y: auto;
}

.tab-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.tab-header h1 {
    margin: 0;
    font-size: 32px;
    line-height: 1;
    letter-spacing: -0.04em;
}

.tab-balance,
.rewards-balance {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid rgba(227, 233, 246, 0.95);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(96, 124, 185, 0.08);
}

.tab-balance img,
.rewards-balance img {
    width: 16px;
    height: 16px;
}

.tab-hero {
    min-height: 190px;
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0.95fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.tab-hero::before {
    content: "";
    position: absolute;
    right: 8%;
    top: 4%;
    width: 170px;
    height: 170px;
    border-radius: 50%;
    background: rgba(222, 234, 255, 0.64);
}

.tab-hero__card {
    min-height: 92px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 14px 28px rgba(96, 124, 185, 0.08);
    position: relative;
    z-index: 1;
}

.tab-hero__icon {
    font-size: 30px;
    line-height: 1;
}

.tab-hero__card p {
    margin: 0;
    color: #657392;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
}

.tab-hero__mascot {
    width: min(42vw, 210px);
    justify-self: center;
    align-self: end;
    position: relative;
    z-index: 1;
    filter: drop-shadow(0 16px 22px rgba(56, 119, 227, 0.14));
}

/* Tasks */
.task-list,
.leaderboard-list,
.profile-menu {
    display: grid;
    gap: 10px;
}

.task-card {
    min-height: 92px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(227, 233, 246, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(96, 124, 185, 0.06);
}

.task-card__icon {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: #f3f7ff;
    color: var(--accent);
    font-size: 25px;
    font-weight: 700;
}

.task-card__copy h3,
.battle-reward-card__copy h3 {
    margin: 0;
    color: var(--text);
    font-size: 17px;
    line-height: 1.25;
}

.task-card__copy p,
.task-card__copy span,
.battle-reward-card__copy p {
    margin: 4px 0 0;
    color: #71809d;
    font-size: 14px;
    line-height: 1.3;
}

.task-card__reward {
    color: var(--accent);
    font-size: 18px;
    white-space: nowrap;
}

.task-card__arrow {
    color: #b0bbcf;
    font-size: 24px;
}

/* Battle pass */
.rewards-header {
    grid-template-columns: auto minmax(0, 1fr) auto;
}

.rewards-header h1 {
    text-align: center;
}

.battle-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: stretch;
    margin-bottom: 16px;
    padding: 16px;
    border-radius: 24px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(244, 249, 255, 0.9));
    box-shadow: 0 14px 28px rgba(96, 124, 185, 0.08);
}

.battle-kicker {
    margin: 0 0 4px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.battle-hero h2 {
    margin: 0;
    font-size: 22px;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.battle-hero p:not(.battle-kicker) {
    margin: 8px 0 0;
    color: #71809d;
    font-size: 14px;
    line-height: 1.35;
}

.battle-progress-card {
    min-width: 132px;
    display: grid;
    align-content: center;
    gap: 6px;
    padding: 12px;
    border-radius: 18px;
    background: #edf4ff;
}

.battle-progress-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.battle-progress-card strong {
    color: var(--accent);
    font-size: 18px;
}

.battle-pass-track {
    position: relative;
    display: grid;
    gap: 0;
    padding: 4px 0 6px;
}

.battle-pass-track::before {
    content: "";
    position: absolute;
    left: 37px;
    top: 26px;
    bottom: 28px;
    width: 2px;
    border-radius: 999px;
    background: #dfe8f7;
}

.battle-step {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 98px;
}

.battle-marker {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    gap: 6px;
}

.battle-marker__level {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border: 2px solid #dfe8f7;
    border-radius: 50%;
    background: #ffffff;
    color: #8290aa;
    font-size: 18px;
    font-weight: 800;
}

.battle-marker__state {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #edf4ff;
    color: #9aa5bb;
    font-size: 12px;
}

.battle-reward-card {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border: 1px solid rgba(227, 233, 246, 0.95);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
}

.battle-reward-card__icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #f3f7ff;
    font-size: 22px;
}

.battle-reward-card__badge {
    min-height: 30px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: #f0f4fb;
    color: #7a87a2;
    font-size: 12px;
    font-weight: 800;
    white-space: nowrap;
}

.battle-step.is-received .battle-marker__level,
.battle-step.is-received .battle-marker__state {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.battle-step.is-received .battle-reward-card__badge {
    background: #e8f8ef;
    color: #1c9b55;
}

.battle-step.is-current .battle-marker__level {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 6px rgba(44, 121, 255, 0.1);
}

.battle-step.is-current .battle-reward-card {
    border-color: var(--accent);
    box-shadow: 0 12px 28px rgba(44, 121, 255, 0.12);
}

.battle-step.is-current .battle-reward-card__badge {
    background: var(--accent);
    color: #ffffff;
}

/* Rating */
.leaderboard-podium {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: end;
    gap: 10px;
    margin-bottom: 16px;
}

.podium-card {
    min-height: 150px;
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 7px;
    padding: 12px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 26px rgba(96, 124, 185, 0.08);
}

.podium-card--1 {
    min-height: 178px;
    background: #fff8e8;
}

.podium-card img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 50%;
}

.podium-card h3,
.podium-card strong {
    margin: 0;
}

.podium-card__place {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent);
    color: #ffffff;
    font-weight: 800;
}

.leaderboard-row {
    min-height: 64px;
    display: grid;
    grid-template-columns: 34px 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    border: 1px solid rgba(227, 233, 246, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
}

.leaderboard-row.is-current {
    border-color: #cfe0ff;
    background: #edf4ff;
}

.leaderboard-row img {
    width: 42px;
    height: 42px;
    object-fit: cover;
    border-radius: 50%;
}

.leaderboard-row span {
    color: #7f8ba8;
    font-size: 18px;
    font-weight: 700;
}

.leaderboard-row em {
    color: var(--accent);
    font-style: normal;
    font-weight: 800;
}

.rating-note {
    display: grid;
    grid-template-columns: 78px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    padding: 14px;
    border-radius: 24px;
    background: #edf4ff;
}

.rating-note img {
    width: 74px;
}

.rating-note p {
    margin: 0;
    color: #657392;
    font-size: 15px;
    line-height: 1.35;
    font-weight: 700;
}

/* Profile */
.profile-hero {
    position: relative;
    display: grid;
    justify-items: center;
    padding: 8px 0 18px;
}

.profile-avatar {
    position: relative;
}

.profile-avatar img {
    width: 118px;
    height: 118px;
    object-fit: cover;
    border-radius: 50%;
}

.profile-avatar button {
    position: absolute;
    right: -8px;
    bottom: 10px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #ffffff;
    color: var(--accent);
    box-shadow: 0 10px 22px rgba(96, 124, 185, 0.14);
}

.profile-mascot {
    position: absolute;
    right: 3%;
    bottom: 0;
    width: min(33vw, 170px);
}

.profile-hero h2 {
    margin: 12px 0 2px;
    font-size: 28px;
}

.profile-hero p {
    margin: 0;
    color: var(--muted);
    font-size: 16px;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-bottom: 16px;
    padding: 14px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
}

.profile-stats article {
    display: grid;
    justify-items: center;
    gap: 5px;
    text-align: center;
}

.profile-stats article + article {
    border-left: 1px solid var(--line);
}

.profile-stats span {
    color: var(--accent);
    font-size: 22px;
}

.profile-stats p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.profile-stats strong {
    font-size: 22px;
}

.achievements-card,
.profile-menu {
    padding: 16px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 12px 26px rgba(96, 124, 185, 0.08);
}

.profile-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.profile-section-head h2 {
    margin: 0;
    font-size: 20px;
}

.profile-section-head button {
    color: var(--accent);
    background: transparent;
    font-weight: 700;
}

.achievements-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.achievement-item {
    display: grid;
    justify-items: center;
    gap: 6px;
    text-align: center;
}

.achievement-item span {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 16px;
    background: #edf4ff;
    font-size: 24px;
}

.achievement-item h3 {
    margin: 0;
    font-size: 12px;
}

.achievement-item p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.profile-menu {
    margin-top: 16px;
    gap: 0;
}

.profile-menu button {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    font-size: 17px;
    font-weight: 700;
}

.profile-menu button:last-child {
    border-bottom: 0;
}

.profile-menu span {
    color: #aeb7cd;
    font-size: 24px;
}

.menu-screen {
    display: block;
    overflow-y: auto;
}

.home-surface {
    position: relative;
    min-height: 100%;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 8px;
    padding: 10px 10px 8px;
    border-radius: 36px;
    background: #edf4ff;
    overflow: hidden;
}

.home-surface::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: url("./assets_home/дом фон.webp") center top / cover no-repeat;
    filter: saturate(1.08) contrast(1.03) brightness(1.01);
    pointer-events: none;
    z-index: 0;
}

.home-surface::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(245, 249, 255, 0.26));
    pointer-events: none;
    z-index: 1;
}

.home-surface > * {
    position: relative;
    z-index: 2;
}

.home-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: start;
}

.series-panel {
    display: grid;
    gap: 8px;
}

.series-row,
.gift-pill {
    min-height: 56px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    width: fit-content;
    max-width: min(100%, 320px);
    padding: 6px 12px 6px 6px;
    border: 1px solid rgba(227, 233, 246, 0.95);
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(96, 124, 185, 0.08);
}

.gift-pill {
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.series-icon,
.gift-pill__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #f3f7ff;
}

.series-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform: scale(var(--fire-scale));
    filter: var(--fire-filter) drop-shadow(var(--fire-glow));
}

.series-copy p,
.series-copy strong,
.gift-copy,
.gift-copy span,
.gift-copy strong,
.friends-label {
    margin: 0;
}

.series-copy,
.gift-copy {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.series-label,
.gift-label {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.15;
    font-weight: 600;
}

.series-value,
.gift-value {
    display: block;
    margin: 0 0 2px;
    color: var(--text);
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.gift-pill:hover,
.gift-pill:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(96, 124, 185, 0.12);
    border-color: #cfdaf3;
    outline: none;
}

.gift-pill:active {
    transform: translateY(0);
}

.gift-value,
.gift-pill strong {
    color: var(--accent);
}

.gift-pill__icon {
    color: var(--accent);
}

.gift-pill__icon svg {
    width: 21px;
    height: 21px;
    fill: currentColor;
}

.gift-pill__arrow {
    margin-left: 2px;
    color: #b2bbcf;
    font-size: 22px;
    line-height: 1;
}

.friends-panel {
    padding-top: 6px;
    text-align: center;
}

.friends-stack {
    display: flex;
    justify-content: flex-end;
    padding-right: 8px;
}

.friend-avatar {
    width: 44px;
    height: 44px;
    display: block;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 10px 24px rgba(96, 124, 185, 0.14);
    background-size: cover;
    background-position: center;
    background-image: url("./assets_home/профиль без фото.jpg");
}

.friend-avatar + .friend-avatar {
    margin-left: -10px;
}

.friends-label {
    margin-top: 8px;
    color: var(--muted);
    font-size: 14px;
}

.hero-panel {
    min-height: 430px;
    display: grid;
    place-items: end center;
    padding-top: 0;
}

.hero-character {
    width: min(66vw, 410px);
    height: min(66vw, 410px);
    display: grid;
    place-items: end center;
    position: relative;
}

.hero-shadow {
    position: absolute;
    left: 50%;
    bottom: 28px;
    width: 48%;
    height: 8%;
    border-radius: 999px;
    background: rgba(92, 127, 189, 0.18);
    transform: translateX(-50%);
    filter: blur(3px);
    pointer-events: none;
}

.hero-character img {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transform-origin: center bottom;
}

.hero-character[data-mascot-state="base"] .hero-shadow {
    width: 46%;
    height: 7.5%;
    bottom: 34px;
    opacity: 0.9;
}

.hero-character[data-mascot-state="base"] img {
    transform: translateY(-12px) scale(1.09);
}

.hero-character[data-mascot-state="surprise"] .hero-shadow {
    width: 52%;
    height: 8.5%;
    bottom: 28px;
    opacity: 0.92;
}

.hero-character[data-mascot-state="surprise"] img {
    transform: scale(1.31);
}

.hero-character[data-mascot-state="angry"] .hero-shadow {
    width: 50%;
    height: 8%;
    bottom: 28px;
    transform: translateX(-42%);
    opacity: 0.94;
}

.hero-character[data-mascot-state="angry"] img {
    transform: translateX(14px) scale(1.31);
}

.hero-character[data-mascot-state="sleep"] .hero-shadow {
    width: 58%;
    height: 9%;
    bottom: 18px;
    opacity: 0.82;
}

.hero-character[data-mascot-state="sleep"] img {
    transform: scale(1.05);
}

.info-card,
.play-button,
.bottom-nav,
.player-topbar {
    border: 1px solid rgba(227, 233, 246, 0.92);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.info-card {
    padding: 14px 16px;
}

.recovery-card {
    display: grid;
    gap: 10px;
    padding: 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
}

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

.recovery-badge {
    width: fit-content;
    min-height: 26px;
    padding: 0 10px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: #edf4ff;
    color: #5e79aa;
    font-size: 11px;
    font-weight: 700;
}

.recovery-heading {
    display: grid;
    gap: 4px;
}

.recovery-heading h2 {
    margin: 0;
    font-size: 17px;
    line-height: 1.15;
}

.recovery-copy {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.recovery-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    margin-top: 2px;
}

.recovery-button {
    min-height: 50px;
    padding: 0 18px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.recovery-button--ghost {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
}

.recovery-button--ghost:disabled {
    opacity: 0.5;
}

.recovery-button--primary {
    border: 1px solid rgba(32, 103, 235, 0.22);
    background: linear-gradient(180deg, #3286ff 0%, #1f62ea 100%);
    color: #ffffff;
    box-shadow: 0 14px 24px rgba(45, 120, 255, 0.2);
}

.recovery-button--full {
    width: 100%;
}

.recovery-button:hover:not(:disabled),
.recovery-button:focus-visible:not(:disabled),
.back-button:hover,
.back-button:focus-visible,
.rewards-screen__back:hover,
.rewards-screen__back:focus-visible {
    transform: translateY(-1px);
    border-color: #cfdaf3;
    box-shadow: 0 10px 22px rgba(96, 124, 185, 0.1);
    outline: none;
}

.recovery-button:active:not(:disabled),
.back-button:active,
.rewards-screen__back:active {
    transform: translateY(0);
}

.demo-banner {
    position: relative;
    padding: 10px 38px 10px 12px;
    border: 1px solid rgba(194, 210, 246, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(72, 112, 186, 0.12);
}

.demo-banner.is-hidden {
    display: none;
}

.demo-banner__title {
    display: block;
    margin-bottom: 3px;
    font-size: 12px;
    line-height: 1.2;
}

.demo-banner__copy {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.35;
}

.demo-banner__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border: 0;
    border-radius: 999px;
    background: rgba(237, 243, 255, 0.95);
    color: #7e8cae;
    font-size: 18px;
    line-height: 1;
}

.activity-card {
    padding: 6px 8px;
    border-radius: 18px;
}

.activity-card .section-heading {
    margin-bottom: 4px;
}

.activity-card .section-heading h2 {
    font-size: 13px;
}

.activity-card .section-heading span,
.activity-card .activity-score {
    font-size: 11px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.section-heading h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.section-heading span {
    color: var(--accent);
    font-size: 14px;
}

.activity-score {
    font-size: 16px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.activity-score em {
    color: var(--muted);
    font-style: normal;
    font-weight: 500;
}

.activity-score__icon {
    width: 12px;
    height: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.activity-score__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.activity-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px;
    align-items: center;
}

.progress-track {
    height: 16px;
    overflow: hidden;
    border: 0;
    border-radius: 999px;
    background: #e9effb;
}

.progress-fill {
    width: 60%;
    height: 100%;
    display: flex;
    align-items: center;
    padding-left: 6px;
    border-radius: inherit;
    background: var(--state-color);
}

.progress-icon {
    width: 8px;
    height: 8px;
}

.progress-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.info-button {
    width: 28px;
    height: 28px;
    border: 1.5px solid var(--line);
    border-radius: 50%;
    background: #ffffff;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, border-color 0.18s ease;
}

.info-button:hover,
.info-button:focus-visible {
    border-color: #cfdaf3;
    background: #f6f9ff;
    outline: none;
}

.info-button:active {
    transform: scale(0.96);
}

.activity-popover {
    position: absolute;
    right: 18px;
    top: 308px;
    width: min(240px, calc(100% - 36px));
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 18px 40px rgba(84, 121, 197, 0.16);
    z-index: 8;
}

.activity-popover.is-hidden {
    display: none;
}

.activity-popover__header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.activity-popover__header strong {
    font-size: 12px;
    line-height: 1.2;
    color: var(--text);
}

.activity-popover__icon {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.activity-popover__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.activity-popover p {
    margin: 0;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
}

.activity-popover p + p {
    margin-top: 6px;
}

.games-card {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 150px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 0;
    overflow: hidden;
    transition: opacity 0.2s ease, transform 0.25s ease, padding 0.25s ease, margin 0.25s ease;
    max-height: 360px;
    opacity: 1;
    transform: translateY(0);
    padding: 10px 12px;
    border-radius: 22px;
}

.games-sheet.is-collapsed {
    opacity: 0;
    transform: translateY(24px);
    pointer-events: none;
}

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

.game-option {
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: #ffffff;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.game-option:hover,
.game-option:focus-visible {
    border-color: #cfdaf3;
    background: #f9fbff;
    outline: none;
}

.game-option.is-selected {
    border-color: #d7e6ff;
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
    box-shadow: 0 14px 24px rgba(90, 123, 194, 0.08);
    transform: translateY(-1px);
}

.game-option__icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    overflow: hidden;
    border-radius: 10px;
    background: var(--surface-soft);
}

.game-option__icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.game-option__body {
    min-width: 0;
    flex: 1 1 auto;
}

.game-option__title {
    font-size: 12px;
    line-height: 1.1;
    font-weight: 500;
}

.game-option__arrow {
    color: #b2bbcf;
    font-size: 20px;
    line-height: 1;
}

.game-option__status {
    position: absolute;
    top: 7px;
    right: 7px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid rgba(44, 121, 255, 0.16);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
    color: var(--accent);
    font-size: 10px;
    line-height: 1;
    font-weight: 700;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(-4px) scale(0.96);
    pointer-events: none;
    box-shadow: 0 8px 18px rgba(90, 123, 194, 0.12);
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.game-option--coming-soon {
    position: relative;
}

.game-option--coming-soon.is-revealed {
    border-color: #d7e6ff;
    background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
    box-shadow: 0 14px 24px rgba(90, 123, 194, 0.08);
}

.game-option--coming-soon.is-revealed .game-option__status {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.play-button {
    min-height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 1px solid rgba(32, 103, 235, 0.22);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, #3286ff 0%, #1f62ea 100%);
    color: #ffffff;
    box-shadow: 0 16px 30px rgba(45, 120, 255, 0.24);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.play-button:hover,
.play-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 20px 34px rgba(45, 120, 255, 0.28);
    outline: none;
}

.play-button:active {
    transform: translateY(0);
    filter: brightness(0.98);
}

.play-button.is-hidden {
    display: none;
}

.play-button--home {
    margin-top: 2px;
    position: relative;
    z-index: 6;
}

.play-button--share {
    min-height: 72px;
}

.play-button__icon {
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
}

.play-button__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.play-button--share .play-button__icon img {
    width: 100%;
    height: 100%;
}

.play-button span:last-child {
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
}

.bottom-nav {
    min-height: 66px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 2px;
    padding: 8px;
    align-self: end;
    position: relative;
    z-index: 6;
}

.bottom-nav__item {
    min-width: 0;
    height: 50px;
    display: grid;
    grid-template-rows: 23px 13px;
    place-items: center;
    align-content: center;
    gap: 4px;
    padding: 5px 2px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: #9aa5bb;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.bottom-nav__item:hover,
.bottom-nav__item:focus-visible {
    background: rgba(237, 244, 255, 0.78);
    outline: none;
}

.bottom-nav__item.is-active {
    border-color: #dce8ff;
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
    color: var(--accent);
}

.bottom-nav__item:active {
    transform: scale(0.98);
}

.bottom-nav__icon {
    width: 23px;
    height: 23px;
    display: grid;
    place-items: center;
    line-height: 1;
}

.bottom-nav__icon svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav__item span:last-child {
    font-size: 10px;
    line-height: 1.05;
    font-weight: 700;
    white-space: nowrap;
}

.rewards-screen {
    position: absolute;
    inset:
        max(12px, env(safe-area-inset-top))
        max(12px, env(safe-area-inset-right))
        max(12px, env(safe-area-inset-bottom))
        max(12px, env(safe-area-inset-left));
    z-index: 20;
}

.rewards-screen.is-hidden {
    display: none;
}

.rewards-screen__surface {
    height: 100%;
    overflow-y: auto;
    padding: 14px 14px 14px;
    border-radius: 28px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.24), rgba(255, 255, 255, 0.18)),
        url("./assets_home/дом фон.webp") center top / cover no-repeat,
        #edf4ff;
    box-shadow: 0 24px 60px rgba(70, 104, 170, 0.18);
}

.rewards-screen__header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.rewards-screen__header h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1;
    text-align: center;
}

.rewards-screen__back,
.rewards-balance {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 22px rgba(96, 124, 185, 0.08);
}

.rewards-screen__back {
    color: var(--text);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.rewards-balance {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.rewards-balance img {
    width: 14px;
    height: 14px;
}

.rewards-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 0.95fr;
    gap: 10px;
    align-items: center;
    margin-bottom: 18px;
}

.rewards-hero__copy {
    padding: 12px 12px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 28px rgba(96, 124, 185, 0.08);
}

.rewards-hero__badge {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 8px;
    border-radius: 14px;
    background: #edf4ff;
    color: var(--accent);
}

.rewards-hero__badge svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.rewards-hero__copy p {
    margin: 0;
    color: #5d6d90;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
}

.rewards-hero__copy p img {
    width: 12px;
    height: 12px;
    vertical-align: -2px;
}

.rewards-hero__mascot {
    min-height: 150px;
    display: grid;
    place-items: end center;
}

.rewards-hero__mascot img {
    width: 100%;
    max-width: 145px;
    object-fit: contain;
    filter: drop-shadow(0 16px 24px rgba(56, 119, 227, 0.16));
}

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

.rewards-section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.rewards-section__header h2 {
    margin: 0;
    font-size: 15px;
}

.rewards-section__hint {
    color: var(--muted);
    font-size: 11px;
}

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

.reward-card {
    min-height: 154px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 8px;
    padding: 10px;
    border: 1px solid rgba(223, 231, 246, 0.95);
    border-radius: 18px;
    box-shadow: 0 14px 28px rgba(96, 124, 185, 0.08);
}

.reward-card--blue {
    background: linear-gradient(180deg, #eef5ff 0%, #e9f1ff 100%);
}

.reward-card--green {
    background: linear-gradient(180deg, #f2fbf0 0%, #eef8ec 100%);
}

.reward-card--violet {
    background: linear-gradient(180deg, #f5f0ff 0%, #f1ecff 100%);
}

.reward-card--gold {
    background: linear-gradient(180deg, #fff8ea 0%, #fff4de 100%);
}

.reward-card--soft-blue {
    background: linear-gradient(180deg, rgba(238, 245, 255, 0.62) 0%, rgba(233, 241, 255, 0.52) 100%);
}

.reward-card--soft-peach {
    background: linear-gradient(180deg, rgba(255, 243, 238, 0.62) 0%, rgba(255, 236, 226, 0.5) 100%);
}

.reward-card--soft-aqua {
    background: linear-gradient(180deg, rgba(237, 251, 250, 0.62) 0%, rgba(227, 248, 247, 0.5) 100%);
}

.reward-card--soft-pink {
    background: linear-gradient(180deg, rgba(255, 240, 247, 0.62) 0%, rgba(255, 234, 244, 0.5) 100%);
}

.reward-card.is-locked {
    opacity: 0.82;
}

.reward-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
}

.reward-card__sparkle {
    color: #d6e2ff;
    font-size: 13px;
    line-height: 1;
}

.reward-card__lock {
    color: #aeb7cd;
    font-size: 13px;
    line-height: 1;
}

.reward-card__icon {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    display: grid;
    place-items: center;
    border-radius: 16px;
    color: currentColor;
}

.reward-card__icon svg {
    width: 38px;
    height: 38px;
    display: block;
    filter: drop-shadow(0 10px 14px rgba(76, 115, 186, 0.12));
}

.reward-card__copy {
    display: grid;
    align-content: start;
    gap: 4px;
    text-align: center;
}

.reward-card__title {
    margin: 0;
    font-size: 12px;
    line-height: 1.2;
}

.reward-card__subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
}

.reward-card__meta {
    min-height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-top: 1px solid rgba(222, 230, 244, 0.92);
    color: #4d5c81;
    font-size: 12px;
    font-weight: 700;
}

.reward-card__meta img {
    width: 13px;
    height: 13px;
}

.reward-card__meta strong {
    color: var(--accent);
}

.rewards-note {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(234, 241, 255, 0.78);
    color: #7b88a8;
}

.rewards-note p {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
    font-weight: 600;
}

.rewards-note__lock {
    font-size: 15px;
}

.rewards-bottom-nav {
    margin-top: auto;
}

.player-screen {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    gap: 10px;
}

.player-screen.is-hidden,
.menu-screen.is-hidden {
    display: none;
}

.player-topbar {
    min-height: 54px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 6px;
}

.back-button {
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.player-title {
    margin: 0;
    text-align: center;
    font-size: 15px;
}

.player-topbar__spacer {
    width: 62px;
}

.game-frame {
    width: 100%;
    height: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: #fff;
}

@media (max-width: 420px) {
    .app-shell {
        padding:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .home-surface {
        gap: 8px;
        padding: 10px 10px 6px;
    }

    .games-card {
        left: 10px;
        right: 10px;
        bottom: 128px;
        max-height: 318px;
        padding: 8px 10px;
    }

    .series-row,
    .gift-pill {
        min-height: 52px;
        padding: 6px 10px 6px 6px;
        gap: 8px;
    }

    .series-icon,
    .gift-pill__icon {
        width: 38px;
        height: 38px;
    }

    .series-label,
    .gift-label,
    .friends-label {
        font-size: 12px;
    }

    .series-value,
    .gift-value {
        font-size: 20px;
    }

    .friend-avatar {
        width: 36px;
        height: 36px;
    }

    .hero-panel {
        min-height: 340px;
    }

    .hero-character {
        width: min(70vw, 300px);
        height: min(70vw, 300px);
    }

    .info-card {
        padding: 12px 14px;
    }

    .recovery-card {
        padding: 7px 9px;
    }

    .recovery-copy {
        margin-bottom: 6px;
        font-size: 10px;
    }

    .recovery-button {
        min-height: 28px;
        font-size: 10px;
    }

    .activity-card {
        padding: 5px 7px;
    }

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

    .section-heading h2 {
        font-size: 16px;
    }

    .section-heading span,
    .activity-score {
        font-size: 13px;
    }

    .activity-score__icon {
        width: 10px;
        height: 10px;
    }

    .activity-row {
        gap: 4px;
    }

    .progress-track {
        height: 14px;
    }

    .progress-fill {
        padding-left: 5px;
    }

    .progress-icon {
        width: 7px;
        height: 7px;
    }

    .info-button {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .activity-popover {
        right: 14px;
        top: 268px;
        width: min(220px, calc(100% - 28px));
        padding: 9px 10px;
    }

    .activity-popover__header {
        margin-bottom: 6px;
        gap: 6px;
    }

    .activity-popover__header strong {
        font-size: 11px;
    }

    .activity-popover__icon {
        width: 14px;
        height: 14px;
    }

    .activity-popover p {
        font-size: 11px;
    }

    .games-grid {
        gap: 8px;
    }

    .game-option {
        min-height: 60px;
        gap: 6px;
        padding: 7px;
    }

    .game-option__icon {
        width: 36px;
        height: 36px;
        border-radius: 9px;
    }

    .game-option__title {
        font-size: 11px;
    }

    .game-option__arrow {
        font-size: 18px;
    }

    .play-button {
        min-height: 56px;
        gap: 9px;
    }

    .play-button__icon {
        width: 32px;
        height: 32px;
    }

    .play-button span:last-child {
        font-size: 16px;
    }

    .bottom-nav {
        min-height: 62px;
        padding: 7px;
        border-radius: 24px;
    }

    .bottom-nav__item {
        height: 48px;
        border-radius: 14px;
    }

    .bottom-nav__icon,
    .bottom-nav__icon svg {
        width: 21px;
        height: 21px;
    }

    .bottom-nav__item span:last-child {
        font-size: 9px;
    }

    .tab-header {
        margin-bottom: 14px;
    }

    .tab-header h1 {
        font-size: 28px;
    }

    .tab-hero {
        min-height: 150px;
        margin-bottom: 14px;
    }

    .tab-hero__card {
        min-height: 76px;
        padding: 14px;
        border-radius: 20px;
    }

    .tab-hero__card p {
        font-size: 13px;
    }

    .tab-hero__mascot {
        width: min(38vw, 150px);
    }

    .task-card {
        min-height: 78px;
        grid-template-columns: 46px minmax(0, 1fr) auto;
        gap: 10px;
        padding: 11px 12px;
        border-radius: 20px;
    }

    .task-card__arrow {
        display: none;
    }

    .task-card__icon {
        width: 44px;
        height: 44px;
        border-radius: 15px;
        font-size: 21px;
    }

    .task-card__copy h3,
    .battle-reward-card__copy h3 {
        font-size: 15px;
    }

    .task-card__copy p,
    .task-card__copy span,
    .battle-reward-card__copy p {
        font-size: 12px;
    }

    .task-card__reward {
        font-size: 15px;
    }

    .battle-hero {
        grid-template-columns: 1fr;
        padding: 14px;
    }

    .battle-step {
        grid-template-columns: 58px minmax(0, 1fr);
        gap: 8px;
        min-height: 92px;
    }

    .battle-pass-track::before {
        left: 28px;
    }

    .battle-marker__level {
        width: 44px;
        height: 44px;
        font-size: 15px;
    }

    .battle-reward-card {
        grid-template-columns: 38px minmax(0, 1fr);
        gap: 9px;
        padding: 10px;
    }

    .battle-reward-card__icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }

    .battle-reward-card__badge {
        grid-column: 2;
        justify-self: start;
        min-height: 26px;
        font-size: 11px;
    }

    .leaderboard-podium {
        gap: 7px;
    }

    .podium-card {
        min-height: 132px;
        padding: 10px;
    }

    .podium-card--1 {
        min-height: 154px;
    }

    .podium-card img {
        width: 52px;
        height: 52px;
    }

    .leaderboard-row {
        grid-template-columns: 28px 40px minmax(0, 1fr) auto;
        min-height: 58px;
        gap: 9px;
        padding: 8px 11px;
    }

    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px 0;
    }

    .profile-stats article:nth-child(3) {
        border-left: 0;
    }

    .achievements-list {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .rewards-screen {
        inset:
            max(8px, env(safe-area-inset-top))
            max(8px, env(safe-area-inset-right))
            max(8px, env(safe-area-inset-bottom))
            max(8px, env(safe-area-inset-left));
    }

    .rewards-screen__surface {
        padding: 12px 10px;
        border-radius: 24px;
    }

    .rewards-screen__header {
        margin-bottom: 10px;
    }

    .rewards-screen__header h1 {
        font-size: 20px;
    }

    .rewards-screen__back,
    .rewards-balance {
        min-height: 32px;
        padding: 0 9px;
        font-size: 12px;
    }

    .rewards-hero {
        gap: 8px;
        margin-bottom: 14px;
    }

    .rewards-hero__copy {
        padding: 10px;
        border-radius: 18px;
    }

    .rewards-hero__badge {
        width: 34px;
        height: 34px;
        margin-bottom: 6px;
    }

    .rewards-hero__copy p {
        font-size: 11px;
    }

    .rewards-hero__mascot {
        min-height: 120px;
    }

    .rewards-hero__mascot img {
        max-width: 120px;
    }

    .rewards-section {
        margin-bottom: 14px;
    }

    .rewards-section__header {
        margin-bottom: 8px;
    }

    .rewards-section__header h2 {
        font-size: 14px;
    }

    .rewards-section__hint {
        font-size: 10px;
    }

    .rewards-grid {
        gap: 8px;
    }

    .reward-card {
        min-height: 136px;
        padding: 8px;
        border-radius: 16px;
        gap: 7px;
    }

    .reward-card__icon {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .reward-card__icon svg {
        width: 32px;
        height: 32px;
    }

    .reward-card__title {
        font-size: 11px;
    }

    .reward-card__subtitle {
        font-size: 10px;
    }

    .reward-card__meta {
        min-height: 30px;
        font-size: 11px;
    }

    .rewards-note {
        margin-bottom: 12px;
        padding: 8px 10px;
        border-radius: 16px;
    }

    .rewards-note p {
        font-size: 11px;
    }
}

/* UX cleanup overrides */
.home-tab {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-bottom: 10px;
}

.home-tab .hero-panel {
    min-height: clamp(220px, 42vh, 360px);
    flex: 0 0 auto;
}

.home-tab .activity-card,
.home-tab .play-button {
    flex: 0 0 auto;
}

.games-card {
    bottom: 82px;
}

.tasks-tab .tab-hero {
    min-height: 150px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tasks-tab .tab-hero::before {
    right: -24px;
    top: -22px;
    width: 148px;
    height: 148px;
    opacity: 0.42;
}

.tasks-tab .tab-hero__mascot {
    width: min(34vw, 132px);
    align-self: center;
    opacity: 0.92;
}

.tasks-tab .tab-hero__card {
    min-height: 78px;
    padding: 14px;
    z-index: 2;
}

.task-list {
    gap: 18px;
}

.task-section {
    display: grid;
    gap: 10px;
}

.task-section__header {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
}

.task-section__header > span {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 8px 18px rgba(96, 124, 185, 0.08);
}

.task-section__header h2,
.task-section__header p,
.partner-group h3 {
    margin: 0;
}

.task-section__header h2 {
    font-size: 18px;
    line-height: 1.1;
}

.task-section__header p {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.task-section__grid {
    display: grid;
    gap: 8px;
}

.task-card {
    min-height: 68px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 20px;
    text-align: left;
    cursor: pointer;
}

.task-card__icon {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 20px;
}

.task-card__copy {
    display: grid;
    gap: 3px;
}

.task-card__copy strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.2;
}

.task-card__copy em {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    font-style: normal;
}

.task-card__state {
    color: #aeb7cd;
    font-size: 22px;
}

.task-card__reward,
.task-card__arrow {
    display: none;
}

.partner-groups {
    display: grid;
    gap: 10px;
}

.partner-group {
    padding: 12px;
    border: 1px solid rgba(227, 233, 246, 0.9);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 10px 24px rgba(96, 124, 185, 0.06);
}

.partner-group h3 {
    margin-bottom: 9px;
    color: var(--text);
    font-size: 15px;
}

.partner-group__items {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.task-chip {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #f7faff;
    color: #52617f;
    font-size: 12px;
    font-weight: 700;
}

.task-chip em {
    color: #aeb7cd;
    font-style: normal;
}

.profile-hero {
    min-height: 270px;
    align-content: start;
    padding-bottom: 26px;
}

.profile-mascot {
    right: 0;
    bottom: 72px;
    width: min(26vw, 120px);
    opacity: 0.95;
}

.profile-hero h2,
.profile-hero p {
    position: relative;
    z-index: 2;
}

@media (max-width: 420px) {
    .home-tab {
        gap: 8px;
    }

    .home-tab .hero-panel {
        min-height: clamp(190px, 38vh, 300px);
    }

    .games-card {
        bottom: 76px;
    }

    .tasks-tab .tab-hero {
        min-height: 132px;
    }

    .tasks-tab .tab-hero::before {
        right: -34px;
        top: -26px;
        width: 132px;
        height: 132px;
    }

    .tasks-tab .tab-hero__mascot {
        width: min(31vw, 112px);
    }

    .task-list {
        gap: 16px;
    }

    .task-section__header h2 {
        font-size: 16px;
    }

    .task-card {
        min-height: 62px;
        grid-template-columns: 38px minmax(0, 1fr) auto;
        padding: 9px 10px;
    }

    .task-card__icon {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }

    .profile-hero {
        min-height: 240px;
    }

    .profile-mascot {
        bottom: 68px;
        width: min(24vw, 98px);
    }
}

/* Unified stroke icons for all UI symbols. */
.hi-icon {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    color: currentColor;
    line-height: 1;
}

.hi-icon svg {
    width: 100%;
    height: 100%;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hi-icon--small {
    width: 16px;
    height: 16px;
}

.hi-icon--tiny {
    width: 14px;
    height: 14px;
}

.hi-icon--inline {
    width: 16px;
    height: 16px;
    display: inline-grid;
    margin-left: 4px;
    color: var(--accent);
    vertical-align: -3px;
}

.gift-pill__arrow,
.game-option__arrow,
.task-card__state,
.profile-menu button > .hi-icon,
.profile-section-head button .hi-icon {
    color: #aeb7cd;
}

.demo-banner__close,
.profile-avatar button,
.profile-section-head button,
.profile-menu button,
.task-chip,
.task-card {
    align-items: center;
}

.demo-banner__close {
    display: grid;
    place-items: center;
    font-size: 0;
}

.tab-hero__icon.hi-icon {
    width: 34px;
    height: 34px;
    color: var(--accent);
}

.task-section__header > .task-section__svg {
    width: 36px;
    height: 36px;
    padding: 8px;
    color: var(--accent);
}

.task-card__icon,
.battle-reward-card__icon,
.achievement-item > span,
.profile-stats article > span {
    font-size: 0;
    color: var(--accent);
}

.task-card__icon .hi-icon,
.task-card__svg {
    width: 22px;
    height: 22px;
}

.battle-reward-card__icon .hi-icon,
.battle-reward-card__svg {
    width: 23px;
    height: 23px;
}

.achievement-item > span .hi-icon,
.achievement-item__svg {
    width: 24px;
    height: 24px;
}

.profile-stats article > .hi-icon {
    width: 24px;
    height: 24px;
}

.battle-marker__state .hi-icon {
    width: 13px;
    height: 13px;
}

.task-chip em {
    display: inline-grid;
    place-items: center;
    font-size: 0;
}

.leaderboard-row em,
.podium-card strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.profile-avatar button {
    display: grid;
    place-items: center;
    font-size: 0;
}

.profile-section-head button {
    display: inline-flex;
    gap: 4px;
}

/* Cross-platform mobile viewport and portrait safety layer. */
.app-shell {
    width: 100%;
    max-width: 100%;
    height: var(--app-height);
    min-height: var(--app-height);
    overflow: hidden;
    isolation: isolate;
}

.menu-screen,
.player-screen,
.home-surface {
    min-width: 0;
    max-width: 100%;
}

.home-surface {
    height: 100%;
    min-height: 0;
    grid-template-rows: minmax(0, 1fr) auto;
}

.tab-content,
.tab-panel {
    min-width: 0;
    max-width: 100%;
}

.tab-panel {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    overflow-x: hidden;
    scroll-padding-bottom: 88px;
}

.home-tab {
    min-height: 0;
    padding-bottom: 12px;
}

.bottom-nav {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    transform: translateZ(0);
}

.games-sheet {
    max-width: calc(100% - 20px);
    max-height: min(54vh, calc(var(--app-height) - 168px));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.player-screen {
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.player-topbar {
    flex: 0 0 auto;
    min-width: 0;
}

.game-frame {
    display: block;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    max-height: 100%;
    overflow: hidden;
    transform: translateZ(0);
}

.orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    place-items: center;
    padding:
        max(18px, env(safe-area-inset-top))
        max(18px, env(safe-area-inset-right))
        max(18px, env(safe-area-inset-bottom))
        max(18px, env(safe-area-inset-left));
    background:
        radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.72) 34%, transparent 58%),
        linear-gradient(180deg, #eef5ff 0%, #dceaff 100%);
}

.orientation-lock__card {
    width: min(360px, 100%);
    display: grid;
    justify-items: center;
    gap: 12px;
    padding: 26px 22px;
    border: 1px solid rgba(214, 224, 244, 0.95);
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 24px 58px rgba(70, 104, 170, 0.18);
    text-align: center;
}

.orientation-lock__icon {
    width: 46px;
    height: 46px;
    padding: 10px;
    border-radius: 18px;
    background: #edf4ff;
    color: var(--accent);
}

.orientation-lock h2,
.orientation-lock p {
    margin: 0;
}

.orientation-lock h2 {
    font-size: 22px;
    line-height: 1.12;
    letter-spacing: -0.03em;
}

.orientation-lock p {
    max-width: 280px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.38;
    font-weight: 650;
}

html.is-landscape .orientation-lock {
    display: grid;
}

html.is-landscape .app-shell {
    visibility: hidden;
    pointer-events: none;
}

@media (orientation: landscape) and (max-height: 540px) {
    .orientation-lock {
        display: grid;
    }

    .app-shell {
        visibility: hidden;
        pointer-events: none;
    }
}

@supports (height: 100svh) {
    :root {
        --app-height: 100svh;
    }
}

@supports (height: 100dvh) {
    :root {
        --app-height: 100dvh;
    }
}

@media (max-width: 380px) {
    .tab-header h1 {
        font-size: 26px;
    }

    .series-row,
    .gift-pill {
        max-width: 100%;
    }

    .home-header {
        gap: 8px;
    }

    .bottom-nav {
        padding: 6px;
        gap: 1px;
    }

    .bottom-nav__item span:last-child {
        font-size: 8.5px;
    }
}

@media (max-height: 780px) {
    .home-surface {
        gap: 8px;
    }

    .hero-panel {
        min-height: 300px;
    }

    .games-card {
        bottom: 118px;
        max-height: 286px;
    }

    .info-card {
        padding: 16px;
    }

    .game-option {
        min-height: 56px;
    }

    .play-button {
        min-height: 54px;
    }

    .rewards-hero__mascot {
        min-height: 110px;
    }

    .reward-card {
        min-height: 128px;
    }
}

/* Final tab-layout overrides: keep bottom nav fixed while tab content scrolls. */
.menu-screen {
    overflow: hidden;
}

.home-surface {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
}

.tab-content {
    min-height: 0;
    overflow: hidden;
}

.tab-panel {
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    padding-bottom: 14px;
}

.tab-panel::-webkit-scrollbar {
    display: none;
}

.tab-panel.is-hidden {
    display: none;
}

.home-tab {
    position: relative;
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto auto;
    gap: 8px;
}

.bottom-nav {
    min-height: 66px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    align-items: center;
    gap: 2px;
    padding: 8px;
    border: 1px solid rgba(227, 233, 246, 0.92);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
    z-index: 6;
}

.bottom-nav__item {
    min-width: 0;
    height: 50px;
    display: grid;
    grid-template-rows: 23px 13px;
    place-items: center;
    align-content: center;
    gap: 4px;
    padding: 5px 2px;
    border: 1px solid transparent;
    border-radius: 15px;
    background: transparent;
    color: #9aa5bb;
}

.bottom-nav__item.is-active {
    border-color: #dce8ff;
    background: linear-gradient(180deg, #ffffff 0%, #edf4ff 100%);
    color: var(--accent);
}

.bottom-nav__icon,
.bottom-nav__icon svg {
    width: 22px;
    height: 22px;
}

.bottom-nav__icon svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-nav__item span:last-child {
    font-size: 10px;
    line-height: 1.05;
    font-weight: 700;
}

.rewards-balance,
.tab-balance {
    min-height: 42px;
    gap: 7px;
    padding: 0 14px;
    border: 1px solid rgba(227, 233, 246, 0.95);
    border-radius: 999px;
    background: #ffffff;
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    box-shadow: 0 8px 22px rgba(96, 124, 185, 0.08);
}

.battle-reward-card__copy h3,
.task-card__copy h3 {
    font-size: 17px;
}

.battle-reward-card__copy p,
.task-card__copy p,
.task-card__copy span {
    font-size: 14px;
}

.battle-reward-card__icon {
    width: 42px;
    height: 42px;
    font-size: 22px;
}

@media (max-width: 420px) {
    .bottom-nav {
        min-height: 62px;
        padding: 7px;
        border-radius: 24px;
    }

    .bottom-nav__item {
        height: 48px;
        border-radius: 14px;
    }

    .bottom-nav__icon,
    .bottom-nav__icon svg {
        width: 21px;
        height: 21px;
    }

    .bottom-nav__item span:last-child {
        font-size: 9px;
    }

    .battle-reward-card__copy h3,
    .task-card__copy h3 {
        font-size: 15px;
    }

    .battle-reward-card__copy p,
    .task-card__copy p,
    .task-card__copy span {
        font-size: 12px;
    }

    .battle-reward-card__icon {
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Last-mile layout fixes for overlap-prone mobile areas. */
.home-tab {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    padding-bottom: 10px;
}

.home-tab .hero-panel {
    min-height: clamp(220px, 42vh, 360px);
    flex: 0 0 auto;
}

.home-tab .activity-card,
.home-tab .play-button {
    flex: 0 0 auto;
}

.home-tab .games-card {
    bottom: 82px;
}

.tasks-tab .tab-hero {
    min-height: 150px;
    overflow: hidden;
    margin-bottom: 10px;
}

.tasks-tab .tab-hero::before {
    right: -24px;
    top: -22px;
    width: 148px;
    height: 148px;
    opacity: 0.42;
}

.tasks-tab .tab-hero__mascot {
    width: min(34vw, 132px);
    align-self: center;
    opacity: 0.92;
}

.tasks-tab .tab-hero__card {
    min-height: 78px;
    padding: 14px;
    z-index: 2;
}

.profile-hero {
    min-height: 270px;
    align-content: start;
    padding-bottom: 26px;
}

.profile-mascot {
    right: 0;
    bottom: 72px;
    width: min(26vw, 120px);
    opacity: 0.95;
}

.profile-hero h2,
.profile-hero p {
    position: relative;
    z-index: 2;
}

@media (max-width: 420px) {
    .home-tab {
        gap: 8px;
    }

    .home-tab .hero-panel {
        min-height: clamp(190px, 38vh, 300px);
    }

    .home-tab .games-card {
        bottom: 76px;
    }

    .tasks-tab .tab-hero {
        min-height: 132px;
    }

    .tasks-tab .tab-hero::before {
        right: -34px;
        top: -26px;
        width: 132px;
        height: 132px;
    }

    .tasks-tab .tab-hero__mascot {
        width: min(31vw, 112px);
    }

    .profile-hero {
        min-height: 240px;
    }

    .profile-mascot {
        bottom: 68px;
        width: min(24vw, 98px);
    }
}
