/* assets/css/style.css – light & dark juicy PvZ style */

:root {
    --pvz-bg: #f5f7ff;
    --pvz-bg-grad: radial-gradient(circle at top, #ffffff 0, #f5f7ff 45%, #edf9ff 100%);
    --pvz-card-bg: rgba(255, 255, 255, 0.96);
    --pvz-card-soft: linear-gradient(135deg, #fff7ff, #f3f7ff 40%, #f0fff8 100%);
    --pvz-accent: #34c879;
    --pvz-accent-soft: #e4ffe9;
    --pvz-accent-2: #ffb653;
    --pvz-purple: #8f7bff;
    --pvz-danger: #ff6680;
    --pvz-text-main: #1e2430;
    --pvz-text-muted: #8a93aa;
    --pvz-border: rgba(151, 177, 214, 0.4);
    --pvz-radius-xl: 22px;
    --pvz-radius-lg: 18px;
    --pvz-radius-md: 14px;
    --pvz-shadow-soft: 0 14px 40px rgba(7, 20, 55, 0.16);
    --pvz-font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}

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

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
}

body.pvz-body {
    min-height: 100vh;
    color: var(--pvz-text-main);
    font-family: var(--pvz-font-main);
    background:
        radial-gradient(circle at 0 0, #ffe6ff 0, transparent 45%),
        radial-gradient(circle at 100% 0, #dff6ff 0, transparent 50%),
        var(--pvz-bg-grad);
    background-attachment: fixed;
    background-size: cover;
    -webkit-font-smoothing: antialiased;
}

#app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) calc(64px + env(safe-area-inset-bottom)) env(safe-area-inset-left);
}

/* Glass panels */

.glass-panel {
    background: var(--pvz-card-bg);
    border-radius: var(--pvz-radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: var(--pvz-shadow-soft);
    backdrop-filter: blur(24px) saturate(150%);
    -webkit-backdrop-filter: blur(24px) saturate(150%);
}

/* Topbar */

.pvz-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    margin: 6px 8px 10px;
    gap: 8px;
    background: linear-gradient(120deg, #ffffff, #f3f6ff);
    border-radius: 18px;
    border: 1px solid rgba(212, 221, 243, 0.9);
    box-shadow: 0 10px 30px rgba(40, 60, 120, 0.12);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar-wrapper {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    padding: 2px;
    background: conic-gradient(from 140deg, #34c879, #8f7bff, #ffb653, #34c879);
    box-shadow: 0 0 14px rgba(120, 195, 255, 0.6);
}

.avatar-wrapper img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
}

.user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.user-name {
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* рейтинг в топбаре */

.user-rating-pill {
    margin-top: 2px;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(205, 216, 255, 0.9);
    background: rgba(255, 255, 255, 0.95);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #4a5775;
    cursor: pointer;
    outline: none;
    max-width: 160px;
}

.user-rating-pill .rating-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.user-rating-pill .rating-rank {
    font-weight: 700;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* icon toggles: язык + тема */

.icon-toggle {
    border-radius: 999px;
    border: 1px solid rgba(210, 220, 255, 0.9);
    background: rgba(255, 255, 255, 0.96);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 8px 18px rgba(60, 86, 160, 0.16);
    cursor: pointer;
    outline: none;
}

.icon-toggle:active {
    transform: translateY(1px) scale(0.96);
    box-shadow: 0 4px 12px rgba(32, 49, 102, 0.2);
}

.lang-icon {
    display: block;
    width: 20px;
    height: 14px;
    border-radius: 3px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.06);
}

 #lang-toggle[data-lang="ru"]  .lang-icon-current,
.lang-icon.lang-ru {
    background-image: url("/assets/img/flag-ru.svg");
}

#lang-toggle[data-lang="en"]  .lang-icon-current,
.lang-icon.lang-en {
    background-image: url("/assets/img/flag-en.svg");
}

#lang-toggle[data-lang="es"]  .lang-icon-current,
.lang-icon.lang-es {
    background-image: url("/assets/img/flag-es.svg?1");
}

#lang-toggle[data-lang="uk"]  .lang-icon-current,
.lang-icon.lang-uk {
    background-image: url("/assets/img/flag-uk.svg?1");
}
#lang-toggle[data-lang="uz"]  .lang-icon-current,
.lang-icon.lang-uz {
    background-image: url("/assets/img/flag-uz.svg?1");
}
#lang-toggle[data-lang="fa"]  .lang-icon-current,
.lang-icon.lang-fa {
    background-image: url("/assets/img/flag-fa.svg?1");
}

#lang-toggle[data-lang="ar"]  .lang-icon-current,
.lang-icon.lang-ar {
    background-image: url("/assets/img/flag-ar.svg?1");
}

.lang-dropdown {
    position: relative;
}

.lang-menu {
    position: absolute;
    right: 0;
    top: 110%;
    margin-top: 4px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    border: 1px solid rgba(210, 220, 255, 0.95);
    box-shadow: 0 12px 32px rgba(28, 45, 100, 0.34);
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 150px;
    opacity: 0;
    transform: translateY(-4px);
    pointer-events: none;
    transition: opacity .14s ease, transform .14s ease;
    z-index: 50;
}

.lang-dropdown.open .lang-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: 11px;
    border: none;
    background: transparent;
    font-size: 12px;
    cursor: pointer;
    outline: none;
}

.lang-option:hover {
    background: rgba(226, 236, 255, 0.9);
}

.lang-option.active {
    background: rgba(210, 228, 255, 0.95);
}

.lang-option-label {
    flex: 1;
    text-align: left;
}

/* тёмная тема */
body.pvz-body.theme-dark .lang-menu {
    background: rgba(5, 24, 19, 0.97);
    border-color: rgba(126, 255, 188, 0.55);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
}

body.pvz-body.theme-dark .lang-option:hover {
    background: rgba(8, 40, 28, 0.96);
}

body.pvz-body.theme-dark .lang-option.active {
    background: rgba(12, 52, 38, 0.96);
}

.theme-icon-moon {
    display: none;
}

/* Buttons */

.glass-button {
    border-radius: 999px;
    border: 1px solid rgba(188, 206, 255, 0.8);
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.9), rgba(239, 245, 255, 0.95));
    padding: 6px 12px;
    color: #1f2633;
    font-size: 13px;
    font-weight: 600;
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 10px 24px rgba(58, 86, 166, 0.16);
    transition: transform 0.08s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.glass-button:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 5px 15px rgba(32, 49, 102, 0.2);
}

.wallet-button {
    white-space: nowrap;
}

.wallet-icon {
    font-size: 15px;
}

/* Main */

.pvz-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 8px 10px;
}

/* Sections */

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

.section-header {
    padding: 0 2px;
}

/* HERO */

.section-header.hero-card {
    margin: 4px 0 2px;
    padding: 12px 12px 12px;
    display: flex;
    gap: 10px;
    align-items: center;
    background: radial-gradient(circle at 0 0, #fff5fb, #f3f7ff 40%, #f2fff7 100%);
    border-radius: 22px;
    border: 1px solid rgba(207, 215, 255, 0.8);
    box-shadow: 0 16px 40px rgba(51, 75, 140, 0.18);
}

.hero-text {
    flex: 1.8;
    min-width: 0;
}

.section-title {
    margin: 2px 0 4px;
    font-size: 20px;
    font-weight: 800;
}

.section-subtitle {
    margin: 0;
    font-size: 13px;
    color: var(--pvz-text-muted);
}

.hero-tags {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hero-pill {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(196, 216, 255, 0.8);
    color: #46506e;
}

.hero-art {
    flex: 1.2;
    display: flex;
    justify-content: center;
    align-items: center;
    min-width: 0;
}

.hero-orbit {
    position: relative;
    width: 96px;
    height: 96px;
}

.hero-orbit-ring {
    position: absolute;
    inset: 10px;
    border-radius: 50%;
    border: 1px dashed rgba(165, 184, 255, 0.7);
}

.hero-orbit-ring-2 {
    inset: 0;
    border-style: solid;
    border-color: rgba(255, 198, 125, 0.7);
    opacity: 0.7;
}

.hero-planet {
    position: absolute;
    inset: 22px;
    border-radius: 24px;
    background: radial-gradient(circle at 30% 20%, #fffef5, #ffe2a7 40%, #ffb653 80%);
    box-shadow: 0 0 20px rgba(255, 191, 96, 0.9);
}

.hero-plant-bubble {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffffff, #ecf9ff 50%, #dde9ff 100%);
    box-shadow: 0 8px 18px rgba(37, 80, 178, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-plant-bubble img {
    max-width: 70%;
    max-height: 70%;
    object-fit: contain;
}

.bubble-1 { top: -6px; left: 6px; animation: bubbleFloat 3.6s ease-in-out infinite; }
.bubble-2 { top: 8px; right: -8px; animation: bubbleFloat 4.1s ease-in-out infinite; }
.bubble-3 { bottom: -4px; left: 32px; animation: bubbleFloat 3.8s ease-in-out infinite; }

@keyframes bubbleFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Section blocks */

.section-block {
    padding: 10px 12px 12px;
    margin-bottom: 6px;
    background: var(--pvz-card-soft);
}

.section-block-header h2 {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
}

.section-block-hint {
    margin: 0;
    font-size: 12px;
    color: var(--pvz-text-muted);
}

.section-block-empty {
    margin: 8px 0 0;
    font-size: 12px;
    color: var(--pvz-text-muted);
}

/* GAME FIELD */

.game-field {
    position: relative;
    overflow: hidden;
    padding: 10px 10px 12px;
    margin-top: 4px;
    background: radial-gradient(circle at -10% -10%, #fff9f5, transparent 60%),
                radial-gradient(circle at 120% 0, #f3fffb, transparent 55%),
                linear-gradient(135deg, #f8fbff, #f3fff9);
}

/* mining bar */

.field-mining-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(215, 223, 252, 0.9);
    box-shadow: 0 10px 26px rgba(86, 117, 186, 0.12);
    flex-wrap: wrap;
}

.field-mining-col {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.field-mining-col-speed {
    flex: 1;
}

.field-mining-col-action {
    flex: 0 0 auto;
    display: flex;
    justify-content: flex-end;
}

.field-balance-label,
.field-speed-label {
    font-size: 11px;
    color: var(--pvz-text-muted);
}

.field-balance-row,
.field-speed-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #172235;
}

.field-balance-row span:first-child,
.field-speed-row span:first-child {
    font-feature-settings: "tnum" 1, "lnum" 1;
}

.field-balance-unit {
    font-size: 11px;
    color: var(--pvz-text-muted);
}

.field-collect-btn {
    padding-inline: 14px;
    background: linear-gradient(135deg, #34c879, #8fddff);
    color: #ffffff;
    border: none;
    white-space: nowrap;
}

/* при узком экране кнопка уходит в отдельную строку и растягивается */

@media (max-width: 360px) {
    .field-mining-col-action {
        width: 100%;
        justify-content: stretch;
        margin-top: 4px;
    }

    .field-collect-btn {
        width: 100%;
        justify-content: center;
    }
}

/* внутреннее поле */

.field-inner {
    position: relative;
    margin-top: 10px;
    border-radius: 18px;
    overflow: hidden;
    min-height: 150px;
    background: linear-gradient(140deg, #f9fff9, #f0f4ff);
    border: 1px solid rgba(204, 220, 255, 0.9);
}

.field-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(196, 215, 255, 0.3) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(210, 229, 255, 0.3) 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.5;
}

.field-plants-layer {
    position: absolute;
    inset: 10px 10px 10px 10px;
    pointer-events: none;
    --plant-scale: 1;
}

/* пустое поле: центр с кнопкой Магазин */

.field-empty-center {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.field-empty-box {
    text-align: center;
    max-width: 220px;
    padding: 10px 12px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 26px rgba(88, 110, 173, 0.25);
}

.field-empty-text {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--pvz-text-muted);
}

.field-empty-cta {
    padding-inline: 24px;
}

/* значки растений на поле */

.field-plant-badge {
    position: absolute;
    left: var(--x, 50%);
    top: var(--y, 50%);
    transform: translate(-50%, -50%) scale(var(--plant-scale));
    animation: fieldPlantFloat 4s ease-in-out infinite;
}

.field-plant-circle {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 20%, #ffffff, #f1f6ff 45%, #e3fcf0 80%);
    border: 2px solid rgba(167, 207, 255, 0.9);
    box-shadow: 0 10px 20px rgba(82, 118, 186, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.field-plant-circle img {
    max-width: 72%;
    max-height: 72%;
    object-fit: contain;
}

@keyframes fieldPlantFloat {
    0%, 100% { transform: translate(-50%, -50%) scale(var(--plant-scale)); }
    50% { transform: translate(-50%, calc(-50% - 4px)) scale(var(--plant-scale)); }
}

/* overlay для пуль и монет */

.game-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

/* пули */

.projectile {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    filter: blur(0.2px);
    animation: projectileMove 2.4s linear forwards;
}

.projectile-pea {
    background: radial-gradient(circle at 30% 30%, #f8fff0, #b1ff6e 40%, #55d13d 100%);
    box-shadow: 0 0 8px rgba(166, 255, 142, 0.9);
}

.projectile-fire {
    background: radial-gradient(circle at 20% 20%, #fff6e0, #ffb15a 40%, #ff5b1c 100%);
    box-shadow: 0 0 10px rgba(255, 136, 74, 0.9);
}

.projectile-lightning {
    background: radial-gradient(circle at 20% 20%, #ffffff, #9de4ff 40%, #3eb5ff 100%);
    box-shadow: 0 0 10px rgba(140, 222, 255, 0.9);
}

@keyframes projectileMove {
    0% { transform: translateX(0); opacity: 0; }
    10% { opacity: 1; }
    100% { transform: translateX(230px); opacity: 0; }
}

/* монетки */

.coin-drop {
    position: absolute;
    top: 10%;
    left: 45%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fffbe6, #ffe072 35%, #f8b132 60%, #b97300 100%);
    box-shadow:
        0 0 10px rgba(255, 215, 92, 0.9),
        0 0 20px rgba(255, 215, 92, 0.6);
    animation: coinFall 2.4s ease-out forwards;
}

@keyframes coinFall {
    0% { transform: translateY(0) scale(0.3); opacity: 0; }
    20% { opacity: 1; transform: translateY(10px) scale(1); }
    100% { transform: translateY(80px) scale(0.9); opacity: 0; }
}

/* Stats */

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

.stat-card {
    border-radius: var(--pvz-radius-md);
    background: linear-gradient(135deg, #ffffff, #f0f5ff);
    padding: 8px 10px 9px;
    border: 1px solid rgba(214, 224, 255, 0.9);
}

.stat-label {
    font-size: 11px;
    color: var(--pvz-text-muted);
    margin-bottom: 2px;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
}

/* Plants summary */

.plants-summary-list {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.plant-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffffff, #f0f7ff);
    border: 1px solid rgba(207, 218, 255, 0.9);
}

.plant-chip-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(152, 255, 200, 0.25), transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
}

.plant-chip-body {
    flex: 1;
    min-width: 0;
}

.plant-chip-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 1px;
}

.plant-chip-meta {
    font-size: 11px;
    color: var(--pvz-text-muted);
}

/* STORE GRID */

.plants-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
}

.plant-card {
    display: flex;
    gap: 8px;
    padding: 8px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff, #f3f7ff);
}

.plant-card.loading::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg,
    rgba(255, 255, 255, 0.02) 0%,
    rgba(255, 255, 255, 0.18) 18%,
    rgba(255, 255, 255, 0.02) 36%);
    animation: shimmer 1s linear infinite;
    opacity: 0.9;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.plant-media {
    flex: 0 0 70px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.plant-card-img {
    width: 64px;
    max-height: 72px;
    object-fit: contain;
}

.plant-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.plant-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.plant-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    font-size: 11px;
}

.plant-label {
    color: var(--pvz-text-muted);
}

.plant-value {
    font-weight: 600;
}

.plant-buy-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
}

 
.plant-qty-input {
    flex: 0 0 56px;     
    max-width: 56px;
    padding: 4px 6px;
    background: #f5f7ff;
    border-radius: 999px;
    border: 1px solid rgba(196, 212, 255, 0.9);
    color: var(--pvz-text-main);
    font-size: 12px;
    outline: none;
    text-align: center;
}

.plant-qty-input::-webkit-outer-spin-button,
.plant-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.plant-qty-input[type=number] {
    -moz-appearance: textfield;
}

.buy-button {
    flex: 1;
    justify-content: center;
}


.plant-qty-input::-webkit-outer-spin-button,
.plant-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.plant-qty-input[type=number] {
    -moz-appearance: textfield;
}

.buy-button {
    flex: 1;
    justify-content: center;
}
 

.rating-list {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rating-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff, #f3f7ff);
    border: 1px solid rgba(207, 218, 255, 0.9);
}

.rating-item-me {
    border-width: 2px;
    border-color: #ffb653;
    box-shadow: 0 12px 28px rgba(255, 182, 83, 0.25);
}

.rating-pos {
    width: 32px;
    text-align: center;
    font-weight: 700;
    color: #4b5680;
}

.rating-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.rating-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #e3ebff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rating-avatar-placeholder {
    font-size: 18px;
}

.rating-user-info {
    flex: 1;
    min-width: 0;
}

.rating-name {
    font-size: 13px;
    font-weight: 600;
}

.rating-meta {
    font-size: 11px;
    color: var(--pvz-text-muted);
}

/* Bottom nav */

.pvz-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 6px 10px calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 18px 18px 0 0;
    background: #ffffff;
    border-top: 1px solid rgba(205, 215, 244, 0.9);
    box-shadow: 0 -10px 28px rgba(38, 58, 112, 0.22);
    z-index: 20;
}

.pvz-bottom-nav .nav-item {
    flex: 1;
    text-align: center;
    text-decoration: none;
    color: var(--pvz-text-muted);
    font-size: 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    justify-content: center;
    padding: 4px 4px;
    border-radius: 999px;
    transition: background 0.14s ease, color 0.12s ease, transform 0.08s ease;
}

.nav-icon {
    font-size: 15px;
}

.pvz-bottom-nav .nav-item.active {
    color: #1f2637;
    background: radial-gradient(circle at 50% 0, #fdf4e0, #f2f6ff 70%);
}

/* Toast */

#pvz-toast-root {
    position: fixed;
    left: 0;
    right: 0;
    bottom: calc(60px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 30;
}

.pvz-toast {
    pointer-events: auto;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 12px;
    max-width: 90%;
    text-align: center;
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    background: linear-gradient(135deg, #ffffff, #f6f0ff);
    border: 1px solid rgba(211, 202, 255, 0.9);
    box-shadow: 0 12px 32px rgba(69, 55, 127, 0.25);
}

.pvz-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

/* DARK THEME VARIABLES */

body.pvz-body.theme-dark {
    --pvz-bg: #020b0a;
    --pvz-bg-grad: radial-gradient(circle at top, #072218 0, #020b0a 60%, #000000 100%);
    --pvz-card-bg: rgba(7, 32, 23, 0.96);
    --pvz-card-soft: linear-gradient(135deg, #041813, #071e15 40%, #082a1d 100%);
    --pvz-accent: #5df07e;
    --pvz-accent-soft: #042718;
    --pvz-accent-2: #ffde5c;
    --pvz-purple: #bca7ff;
    --pvz-danger: #ff6680;
    --pvz-text-main: #f6fff9;
    --pvz-text-muted: #9bb7a6;
    --pvz-border: rgba(138, 255, 188, 0.35);
    --pvz-shadow-soft: 0 18px 40px rgba(0, 0, 0, 0.9);
}

body.pvz-body.theme-dark {
    background:
        linear-gradient(135deg, rgba(9, 52, 37, 0.8), transparent 45%),
        linear-gradient(315deg, rgba(5, 35, 26, 0.8), transparent 60%),
        radial-gradient(circle at top, #042018 0, #010806 60%, #000000 100%);
}

/* DARK THEME COMPONENT TWEAKS */

body.pvz-body.theme-dark .pvz-topbar {
    background: linear-gradient(120deg, #071c16, #03100c);
    border-color: rgba(112, 221, 173, 0.6);
    box-shadow: 0 10px 32px rgba(0, 0, 0, 0.85);
}

body.pvz-body.theme-dark .icon-toggle {
    background: rgba(5, 24, 19, 0.96);
    border-color: rgba(126, 255, 188, 0.5);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.8);
}

body.pvz-body.theme-dark .glass-button {
    background: linear-gradient(135deg, #073121, #042519);
    border-color: rgba(138, 255, 188, 0.6);
    color: var(--pvz-text-main);
}

body.pvz-body.theme-dark .user-rating-pill {
    background: rgba(5, 35, 27, 0.96);
    border-color: rgba(136, 255, 193, 0.6);
    color: #e1fff1;
}

body.pvz-body.theme-dark .section-header.hero-card {
    background: radial-gradient(circle at 0 0, rgba(93, 240, 126, 0.25), rgba(4, 32, 24, 0.96));
    border-color: rgba(126, 255, 188, 0.65);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.95);
}

body.pvz-body.theme-dark .hero-plant-bubble {
    background: radial-gradient(circle at 30% 20%, #0e3424, #062218 50%, #041610 100%);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.9);
}

body.pvz-body.theme-dark .section-block {
    background: linear-gradient(135deg, rgba(7, 34, 25, 0.96), rgba(3, 18, 14, 0.98));
}

body.pvz-body.theme-dark .plant-card {
    background: linear-gradient(135deg, #071f17, #02120d);
}

body.pvz-body.theme-dark .stat-card {
    background: radial-gradient(circle at 0 0, rgba(123, 255, 171, 0.18), rgba(4, 27, 21, 0.98));
    border-color: rgba(126, 255, 188, 0.4);
}

body.pvz-body.theme-dark .plant-chip {
    background: linear-gradient(135deg, #071f17, #02120d);
    border-color: rgba(126, 255, 188, 0.4);
}

body.pvz-body.theme-dark .pvz-bottom-nav {
    background: linear-gradient(180deg, #041914, #010806);
    border-top-color: rgba(136, 255, 193, 0.5);
    box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.95);
}

body.pvz-body.theme-dark .game-field {
    background: radial-gradient(circle at -10% -10%, rgba(93,240,126,0.15), transparent 60%),
                radial-gradient(circle at 120% 0, rgba(62,205,152,0.12), transparent 55%),
                linear-gradient(135deg, #041813, #020a07);
}

body.pvz-body.theme-dark .field-mining-bar {
    background: rgba(5, 29, 21, 0.96);
    border-color: rgba(126, 255, 188, 0.5);
    box-shadow: 0 10px 28px rgba(0,0,0,0.9);
}

body.pvz-body.theme-dark .field-collect-btn {
    background: linear-gradient(135deg, #34c879, #48d3ff);
}

body.pvz-body.theme-dark .field-inner {
    background: linear-gradient(140deg, #071f15, #03120e);
    border-color: rgba(126, 255, 188, 0.4);
}

body.pvz-body.theme-dark .field-grid {
    opacity: 0.35;
}

body.pvz-body.theme-dark .field-empty-box {
    background: rgba(4, 25, 19, 0.98);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.95);
}

body.pvz-body.theme-dark .rating-item {
    background: linear-gradient(135deg, #071f17, #02120d);
    border-color: rgba(126, 255, 188, 0.4);
}

body.pvz-body.theme-dark .rating-avatar {
    background: #08251b;
}

body.pvz-body.theme-dark .rating-pos {
    color: #ffe59f;
}

body.pvz-body.theme-dark .pvz-toast {
    background: linear-gradient(135deg, #062119, #04140f);
    border-color: rgba(126, 255, 188, 0.7);
}

/* theme icons */

body.pvz-body.theme-dark .theme-icon-sun {
    display: none;
}

body.pvz-body.theme-dark .theme-icon-moon {
    display: inline;
}

/* Responsive */

@media (min-width: 480px) {
    #app {
        max-width: 480px;
        margin: 0 auto;
    }
}

@media (min-width: 560px) {
    .plants-grid {
    grid-template-columns: minmax(0, 1fr) !important;
}
}
/* ТЕКСТ в тёмной теме — делаем светлым там, где раньше был жёсткий HEX */

body.pvz-body.theme-dark .field-balance-row,
body.pvz-body.theme-dark .field-speed-row {
    color: var(--pvz-text-main);
}

body.pvz-body.theme-dark .plant-value,
body.pvz-body.theme-dark .stat-value {
    color: var(--pvz-text-main);
}

body.pvz-body.theme-dark .plant-label,
body.pvz-body.theme-dark .section-subtitle,
body.pvz-body.theme-dark .section-block-hint,
body.pvz-body.theme-dark .section-block-empty,
body.pvz-body.theme-dark .rating-meta {
    color: var(--pvz-text-muted);
}

 
body.pvz-body.theme-dark .pvz-bottom-nav {
    background: linear-gradient(180deg, #041914, #010806);
    border-top-color: rgba(136, 255, 193, 0.5);
    box-shadow: 0 -12px 35px rgba(0, 0, 0, 0.95);
}

body.pvz-body.theme-dark .pvz-bottom-nav .nav-item {
    color: var(--pvz-text-muted);
}

body.pvz-body.theme-dark .pvz-bottom-nav .nav-item.active {
    color: var(--pvz-accent-2);
    background: radial-gradient(circle at 50% 0, rgba(93,240,126,0.35), rgba(4,25,18,0.96));
}

 
body.pvz-body.theme-dark .plant-qty-input {
    background: #041914;
    border-color: rgba(126, 255, 188, 0.7);
    color: var(--pvz-text-main);
}
 

body.pvz-body.theme-dark .field-balance-label,
body.pvz-body.theme-dark .field-speed-label {
    color: var(--pvz-text-muted);
}
.partner-section {
    margin-top: 12px;
}

.partner-percents {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.partner-percent-pill {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    background: linear-gradient(135deg, #ffce71, #ff8a3c);
    color: #3a2400;
    box-shadow: 0 4px 10px rgba(255, 152, 56, 0.45);
}

.partner-percent-2 {
    background: linear-gradient(135deg, #9a7bff, #4ecbff);
    color: #0b1630;
    box-shadow: 0 4px 10px rgba(131, 110, 255, 0.45);
}

.partner-percent-3 {
    background: linear-gradient(135deg, #9af78b, #40d697);
    color: #042b18;
    box-shadow: 0 4px 10px rgba(90, 230, 153, 0.45);
}

.partner-link-block {
    border-radius: 18px;
    padding: 10px 10px 8px;
    background: linear-gradient(135deg, rgba(255,255,255,0.9), rgba(244,249,255,0.9));
    border: 1px solid rgba(190, 204, 255, 0.7);
}

body.pvz-body.theme-dark .partner-link-block {
    background: radial-gradient(circle at 0 0, rgba(79,255,189,0.18), rgba(2,18,14,0.95));
    border-color: rgba(136, 255, 193, 0.7);
}

.partner-link-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 2px;
}

.partner-link-hint {
    font-size: 11px;
    margin-bottom: 8px;
    color: var(--pvz-text-muted);
}

.partner-link-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.partner-ref-input {
    flex: 1;
    padding: 6px 9px;
    border-radius: 999px;
    border: 1px solid rgba(196, 212, 255, 0.9);
    background: rgba(255,255,255,0.95);
    font-size: 11px;
    color: var(--pvz-text-main);
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

body.pvz-body.theme-dark .partner-ref-input {
    background: rgba(3, 22, 17, 0.96);
    border-color: rgba(126, 255, 188, 0.7);
}

.partner-ref-input:focus {
    outline: none;
}

.partner-icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.85);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.partner-icon-btn svg {
    width: 16px;
    height: 16px;
    display: block;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.pvz-body.theme-dark .partner-icon-btn {
    background: rgba(6, 40, 29, 0.95);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.partner-scratch-link {
    text-decoration: underline;
    text-decoration-style: dashed;
    cursor: pointer;
}
.partner-scratch-link {
    color: #15803d;  
    font-weight: 600;
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 2px;
    cursor: pointer;
}

.partner-scratch-link:hover {
    opacity: 0.9;
}

body.theme-dark .partner-scratch-link,
body.pvz-body.theme-dark .partner-scratch-link {
    color: #6ee7b7; /* мятный для тёмной темы */
}
/* --- правки для блока процентов партнёрки --- */

/* Отступ сверху и в одну строку */
.partner-percents {
    margin-top: 10px;      /* топ-отступ от заголовка/описания */
    display: flex;
    flex-wrap: nowrap;     /* не переносим на новую строку */
    gap: 6px;
}

/* Делаем так, чтобы три пилюли ровно влезали по ширине */
.partner-percent-pill {
    flex: 1 1 0;
    text-align: center;
    padding: 4px 6px;      /* чуть компактнее, чтобы поместилось */
    font-size: 10px;       /* можно 11px, если всё ещё нормально влазит */
}
/* Светлая тема: тёмные иконки */
.partner-icon-btn {
    color: #111827; /* насыщенный тёмно-серый вместо чисто чёрного */
}

/* Тёмная тема: светлые иконки поверх тёмного фона */
body.theme-dark .partner-icon-btn,
body.pvz-body.theme-dark .partner-icon-btn {
    color: #e5fef4;               /* почти белый с мятным оттенком */
    border: 1px solid rgba(148, 232, 196, 0.5); /* лёгкий контур, чтобы не сливалось */
}
/* === Partner page === */

.partner-page {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Hero */

.hero-card.hero-partner {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.partner-hero-main {
    flex: 1.4;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.partner-hero-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    background: linear-gradient(135deg, #f97316, #facc15);
    color: #1e293b;
    box-shadow: 0 4px 14px rgba(248, 181, 76, 0.55);
}

.partner-hero-text {
    font-size: 12px;
    line-height: 1.4;
    color: var(--pvz-text-muted);
}

.partner-hero-art {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.partner-hero-orbit {
    position: relative;
    width: 100%;
    max-width: 140px;
    aspect-ratio: 1/1;
}

.partner-hero-orbit-ring {
    position: absolute;
    inset: 10%;
    border-radius: 999px;
    border: 1px dashed rgba(148, 163, 184, 0.7);
}

.partner-hero-orbit-ring.ring-2 {
    inset: 18%;
    opacity: 0.7;
}

.partner-hero-orbit-ring.ring-3 {
    inset: 26%;
    opacity: 0.5;
}

.partner-hero-coin {
    position: absolute;
    inset: 32%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #fef9c3, #f97316);
    box-shadow: 0 0 20px rgba(248, 181, 76, 0.7);
}

.partner-hero-zombie,
.partner-hero-plant {
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 16px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.partner-hero-zombie {
    top: 8%;
    left: -2%;
    background: rgba(15, 23, 42, 0.9);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.9);
}

.partner-hero-zombie::before {
    content: "🧟‍♂️";
}

.partner-hero-plant {
    bottom: -2%;
    right: 0;
    background: rgba(22, 163, 74, 0.12);
    box-shadow: 0 10px 30px rgba(22, 163, 74, 0.5);
}

.partner-hero-plant::before {
    content: "🌱";
}

body.pvz-body.theme-dark .hero-card.hero-partner {
    background: radial-gradient(circle at 0 0, rgba(45,212,191,0.16), rgba(15,23,42,0.96));
}

/* Overview stats */

.partner-stats-block {
    margin-top: 2px;
}

.partner-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 8px;
}

.partner-overview-card {
    border-radius: 16px;
    padding: 8px 8px 6px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(241,248,255,0.98));
    border: 1px solid rgba(209, 213, 219, 0.9);
}

body.pvz-body.theme-dark .partner-overview-card {
    background: radial-gradient(circle at 0 0, rgba(34,197,94,0.12), rgba(15,23,42,0.98));
    border-color: rgba(55, 65, 81, 0.9);
}

.partner-overview-label {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 4px;
}

.partner-overview-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 2px;
}

.partner-overview-value {
    font-size: 15px;
    font-weight: 700;
}

.partner-overview-caption {
    font-size: 10px;
    opacity: 0.8;
}

.partner-total-income {
    margin-top: 10px;
    padding: 8px 10px;
    border-radius: 16px;
    background: linear-gradient(135deg, #22c55e, #a3e635);
    color: #022c22;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.partner-total-label {
    font-size: 11px;
    font-weight: 600;
}

.partner-total-value {
    font-size: 16px;
    font-weight: 800;
}

/* Refs section */

.partner-refs-section {
    margin-bottom: 8px;
}

.partner-refs-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}

.partner-refs-search {
    flex: 1.3;
}

.partner-search-input {
    width: 100%;
    border-radius: 999px;
    border: 1px solid rgba(209, 213, 219, 0.9);
    background: rgba(255,255,255,0.96);
    padding: 6px 10px;
    font-size: 12px;
}

body.pvz-body.theme-dark .partner-search-input {
    background: rgba(15,23,42,0.98);
    border-color: rgba(55, 65, 81, 1);
    color: #e5e7eb;
}

.partner-refs-sort {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.partner-sort-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

.partner-sort-group {
    display: flex;
    gap: 4px;
}

.partner-sort-btn {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 4px 6px;
    font-size: 11px;
    background: rgba(148, 163, 184, 0.15);
    color: inherit;
}

.partner-sort-btn.active {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #022c22;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.45);
}

/* Refs list */

.partner-ref-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.partner-ref-card {
    display: flex;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 14px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(226,232,240,0.9);
}

body.pvz-body.theme-dark .partner-ref-card {
    background: rgba(15,23,42,0.96);
    border-color: rgba(51,65,85,1);
}

.partner-ref-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
    background: radial-gradient(circle at 30% 20%, #bbf7d0, #22c55e);
    display: flex;
    align-items: center;
    justify-content: center;
}

.partner-ref-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.partner-ref-avatar-fallback {
    font-size: 13px;
    font-weight: 700;
    color: #022c22;
}

.partner-ref-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.partner-ref-row {
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.partner-ref-row.meta {
    font-size: 10px;
    opacity: 0.8;
}

.partner-ref-name {
    font-size: 13px;
    font-weight: 600;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.partner-ref-income {
    font-size: 12px;
    font-weight: 600;
}

.partner-ref-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.partner-ref-username {
    opacity: 0.9;
}

.partner-ref-id {
    opacity: 0.7;
}

.partner-ref-date {
    opacity: 0.8;
}

/* Pagination */

.partner-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.partner-page-btn {
    min-width: 76px;
    padding: 5px 10px;
    border-radius: 999px;
    border: none;
    font-size: 11px;
    background: rgba(148, 163, 184, 0.16);
}

.partner-page-btn.disabled {
    opacity: 0.5;
}

.partner-page-indicator {
    font-size: 11px;
    opacity: 0.85;
}

/* Адаптив */

@media (max-width: 380px) {
    .partner-overview-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
.partner-refs-sort {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.partner-sort-group {
    display: flex;
    gap: 4px;
}

.partner-sort-btn {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    padding: 0;
    background: rgba(148, 163, 184, 0.15);
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.partner-sort-btn.active {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #022c22;
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.45);
}

.partner-sort-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.partner-page-btn {
    min-width: 76px;
    padding: 5px 10px;
    border-radius: 999px;
    border: none;
    font-size: 11px;
    background: rgba(148, 163, 184, 0.16);
}

.partner-page-btn.disabled {
    opacity: 0.5;
}

body.pvz-body.theme-dark .partner-page-btn {
    background: rgba(15, 23, 42, 0.96);
    color: #e5e7eb;
    border: 1px solid rgba(148, 163, 184, 0.7);
}

body.pvz-body.theme-dark .partner-page-btn.disabled {
    opacity: 0.45;
}
/* --- Wallet page --- */
.hero-wallet {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: stretch;
}

.hero-wallet-tiles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.wallet-balance-main {
    padding: 10px 14px;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.8);
    color: #0f172a;
}

.theme-dark .wallet-balance-main {
    background: rgba(15, 23, 42, 0.85);
    color: #e5e7eb;
}

.wallet-balance-label {
    font-size: 12px;
    opacity: 0.7;
}

.wallet-balance-value {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 700;
}

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

.wallet-badge {
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(16px);
}

.theme-dark .wallet-badge {
    background: rgba(15, 23, 42, 0.8);
}

.wallet-badge-label {
    font-size: 11px;
    opacity: 0.7;
}

.wallet-badge-value {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 600;
}

/* actions */
.wallet-actions {
    margin-top: 14px;
    display: flex;
    gap: 8px;
    padding: 10px;
}

.wallet-action-btn {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.wallet-action-btn.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.45);
}

.wallet-action-btn.secondary {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

.wallet-action-btn.ghost {
    max-width: 140px;
    background: rgba(15, 23, 42, 0.03);
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.theme-dark .wallet-action-btn.ghost {
    background: rgba(15, 23, 42, 0.8);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.5);
}

.wallet-action-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

/* methods */
.wallet-methods-section {
    margin-top: 14px;
}

.wallet-methods-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.wallet-method-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(18px);
}

.theme-dark .wallet-method-card {
    background: rgba(15, 23, 42, 0.9);
}

.wallet-method-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 20%, #fff, #e5e7eb);
    flex-shrink: 0;
}

.wallet-method-icon-cryptobot {
    background: radial-gradient(circle at 30% 20%, #22c55e, #15803d);
}

.wallet-method-icon-ton {
    background: radial-gradient(circle at 30% 20%, #38bdf8, #0ea5e9);
}

.wallet-method-icon-stars {
    background: radial-gradient(circle at 30% 20%, #facc15, #eab308);
}

.wallet-method-title {
    font-size: 14px;
    font-weight: 600;
}

.wallet-method-desc {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.8;
}

.wallet-footnote {
    margin-top: 10px;
    font-size: 11px;
    opacity: 0.7;
}

 
.wallet-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    background: radial-gradient(circle at top, rgba(34, 197, 94, 0.05), transparent),
                rgba(15, 23, 42, 0.65);
    display: flex;
    justify-content: center;
    align-items: flex-end;
}
.wallet-modal-overlay[hidden] {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}
.wallet-modal {
    width: 100%;
    max-width: 480px;
    border-radius: 24px 24px 0 0;
    padding: 14px 16px 16px;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45);
}

.wallet-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.wallet-modal-header h3 {
    font-size: 16px;
    font-weight: 700;
}

.wallet-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
}

.theme-dark .wallet-modal-close {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

.wallet-modal-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.wallet-field-label {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 4px;
}

.wallet-input {
    margin-top: 2px;
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 8px 10px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.theme-dark .wallet-input {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
}

.wallet-deposit-summary {
    margin-top: 4px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.03);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.theme-dark .wallet-deposit-summary {
    background: rgba(15, 23, 42, 0.8);
}

.wallet-deposit-summary-label {
    font-size: 12px;
    opacity: 0.8;
}

.wallet-deposit-summary-value {
    font-size: 14px;
    font-weight: 600;
}

.wallet-modal-section {
    margin-top: 6px;
}

.wallet-modal-methods {
    margin-top: 6px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.wallet-method-pill {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 6px 10px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
}

.theme-dark .wallet-method-pill {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(148, 163, 184, 0.7);
    color: #e5e7eb;
}

.wallet-method-pill.selected {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.pill-icon {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: #e5e7eb;
}

.pill-icon-cryptobot {
    background: radial-gradient(circle at 30% 20%, #22c55e, #15803d);
}

.pill-icon-ton {
    background: radial-gradient(circle at 30% 20%, #0ea5e9, #1d4ed8);
}

.pill-icon-stars {
    background: radial-gradient(circle at 30% 20%, #facc15, #eab308);
}

.wallet-modal-hint {
    margin-top: 6px;
    font-size: 11px;
    opacity: 0.75;
}

.wallet-withdraw-notes {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wallet-withdraw-note {
    font-size: 11px;
    opacity: 0.8;
}

.wallet-withdraw-summary {
    margin-top: 8px;
    font-size: 12px;
    opacity: 0.85;
}

.wallet-withdraw-summary-line {
    margin-top: 2px;
}

.wallet-modal-footer {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.wallet-modal-btn {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 9px 0;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.wallet-modal-btn.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
}

.wallet-modal-btn.ghost {
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}

.theme-dark .wallet-modal-btn.ghost {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

/* history */
.history-controls {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.history-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.history-filter-pill {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    padding: 4px 10px;
    font-size: 11px;
    background: rgba(255, 255, 255, 0.9);
}

.theme-dark .history-filter-pill {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

.history-filter-pill.selected {
    border-color: #22c55e;
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.history-sort {
    display: flex;
    gap: 4px;
}

.history-sort-btn {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: none;
    background: rgba(148, 163, 184, 0.12);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-dark .history-sort-btn {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
}

.history-sort-btn.selected {
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.4);
}

.sort-icon {
    width: 16px;
    height: 16px;
    border-radius: 4px;
    border: 2px solid rgba(148, 163, 184, 0.9);
}

.sort-icon-date {
    border-top-width: 4px;
}

.sort-icon-amount {
    border-right-width: 4px;
}

.sort-icon-action {
    border-radius: 999px;
}

/* history list */
.history-list-block {
    margin-top: 12px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-item {
    padding: 9px 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
}

.theme-dark .history-item {
    background: rgba(15, 23, 42, 0.96);
}

.history-item-main {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.history-item-action {
    font-size: 13px;
    font-weight: 600;
}

.history-item-meta {
    margin-top: 2px;
    font-size: 11px;
    opacity: 0.8;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.history-item-right {
    text-align: right;
}

.history-item-right-in .history-item-amount {
    color: #16a34a;
}

.history-item-right-out .history-item-amount {
    color: #ef4444;
}

.history-item-amount {
    font-size: 14px;
    font-weight: 700;
}

.history-item-balance {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 2px;
}

.history-pagination {
    margin-top: 10px;
    display: flex;
    justify-content: center;
    gap: 6px;
}
/* --- Wallet page --- */
.hero-wallet {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: stretch;
    flex-wrap: wrap;
}

.hero-wallet-tiles {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    flex: 1.1;
}

@media (max-width: 420px) {
    .hero-wallet {
        flex-direction: column;
    }
    .hero-wallet-tiles {
        width: 100%;
    }
}

.wallet-balance-main {
    padding: 10px 14px;
    border-radius: 16px;
    backdrop-filter: blur(20px);
    background: rgba(255, 255, 255, 0.9);
    color: #0f172a;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.16);
}

body.pvz-body.theme-dark .wallet-balance-main {
    background: rgba(15, 23, 42, 0.92);
    color: #e5e7eb;
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.8);
}

.wallet-balance-label {
    font-size: 12px;
    opacity: 0.7;
}

.wallet-balance-value {
    margin-top: 4px;
    font-size: 20px;
    font-weight: 700;
}

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

.wallet-badge {
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(209, 213, 219, 0.9);
}

body.pvz-body.theme-dark .wallet-badge {
    background: rgba(10, 19, 26, 0.96);
    border-color: rgba(55, 65, 81, 0.9);
}

.wallet-badge-label {
    font-size: 11px;
    opacity: 0.7;
}

.wallet-badge-value {
    margin-top: 2px;
    font-size: 14px;
    font-weight: 600;
}

/* actions */
.wallet-actions {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    border-radius: var(--pvz-radius-xl);
    background: var(--pvz-card-soft);
    border: 1px solid var(--pvz-border);
    box-shadow: var(--pvz-shadow-soft);
}

body.pvz-body.theme-dark .wallet-actions {
    background: linear-gradient(135deg, #041914, #020910);
    border-color: rgba(136, 255, 193, 0.55);
}

.wallet-action-btn {
    flex: 1;
    min-width: 0;
    border-radius: 999px;
    border: none;
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.wallet-action-btn.primary {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 8px 20px rgba(34, 197, 94, 0.45);
}

.wallet-action-btn.secondary {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: #fff;
    box-shadow: 0 8px 20px rgba(56, 189, 248, 0.4);
}

.wallet-action-btn.ghost {
    flex-basis: 100%;
    background: rgba(15, 23, 42, 0.03);
    color: #0f172a;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

body.pvz-body.theme-dark .wallet-action-btn.ghost {
    background: rgba(15, 23, 42, 0.9);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.7);
}

@media (min-width: 430px) {
    .wallet-action-btn.ghost {
        flex-basis: auto;
        max-width: 150px;
    }
}

.wallet-action-btn:active {
    transform: scale(0.97);
    box-shadow: none;
}

/* methods */
.wallet-methods-section {
    margin-top: 14px;
}

.wallet-methods-grid {
    margin-top: 10px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.wallet-method-card {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(209, 213, 219, 0.9);
}

body.pvz-body.theme-dark .wallet-method-card {
    background: rgba(5, 18, 16, 0.97);
    border-color: rgba(45, 212, 191, 0.4);
}

.wallet-method-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: radial-gradient(circle at 30% 20%, #fff, #e5e7eb);
    flex-shrink: 0;
}

.wallet-method-icon-cryptobot {
    background: radial-gradient(circle at 30% 20%, #22c55e, #15803d);
}

.wallet-method-icon-ton {
    background: radial-gradient(circle at 30% 20%, #38bdf8, #0ea5e9);
}

.wallet-method-icon-stars {
    background: radial-gradient(circle at 30% 20%, #facc15, #eab308);
}

.wallet-method-title {
    font-size: 14px;
    font-weight: 600;
}

.wallet-method-desc {
    margin-top: 2px;
    font-size: 12px;
    opacity: 0.8;
}

.wallet-footnote {
    margin-top: 10px;
    font-size: 11px;
    opacity: 0.7;
}
/* === DARK WALLET TUNING === */

/* Главная карточка баланса */
body.pvz-body.theme-dark .wallet-balance-main {
    background: radial-gradient(circle at 0 0,
        rgba(45, 212, 191, 0.18),
        rgba(4, 25, 18, 0.98)
    );
    border-radius: 18px;
    border: 1px solid rgba(45, 212, 191, 0.55);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.9);
    color: var(--pvz-text-main);
}

/* Маленькие бейджи "Доступно / Пополнено / Выведено" */
body.pvz-body.theme-dark .wallet-badge {
    background: linear-gradient(135deg, #041914, #020b08);
    border-color: rgba(45, 212, 191, 0.45);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.85);
}

body.pvz-body.theme-dark .wallet-badge-label {
    color: var(--pvz-text-muted);
}

body.pvz-body.theme-dark .wallet-badge-value {
    color: var(--pvz-text-main);
}

/* Плашка действий (Пополнить / Вывести / История операций) */
body.pvz-body.theme-dark .wallet-actions {
    background: linear-gradient(135deg, #041914, #020910);
    border-color: rgba(45, 212, 191, 0.55);
}

/* Кнопки действий чуть подсвечиваем, но не синим ковром */
body.pvz-body.theme-dark .wallet-action-btn.primary {
    box-shadow: 0 10px 24px rgba(16, 185, 129, 0.55);
}

body.pvz-body.theme-dark .wallet-action-btn.secondary {
    box-shadow: 0 10px 24px rgba(56, 189, 248, 0.5);
}

/* "История операций" – outlined под общий стиль */
body.pvz-body.theme-dark .wallet-action-btn.ghost {
    background: rgba(3, 22, 18, 0.96);
    color: var(--pvz-text-main);
    border: 1px solid rgba(45, 212, 191, 0.6);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.8);
}

/* Модалка вывода/пополнения */
body.pvz-body.theme-dark .wallet-modal {
    background: linear-gradient(135deg, #041914, #020a07);
    border-top: 1px solid rgba(45, 212, 191, 0.7);
}

/* Инпуты в модалке */
body.pvz-body.theme-dark .wallet-input {
    background: rgba(3, 22, 18, 0.96);
    border-color: rgba(45, 212, 191, 0.55);
    color: var(--pvz-text-main);
}

/* Саммари пополнения/вывода */
body.pvz-body.theme-dark .wallet-deposit-summary {
    background: rgba(3, 22, 18, 0.96);
}

body.pvz-body.theme-dark .wallet-withdraw-summary {
    color: var(--pvz-text-main);
    opacity: 0.9;
}

/* Кнопка "Отмена" в модалке */
body.pvz-body.theme-dark .wallet-modal-btn.ghost {
    background: rgba(3, 22, 18, 0.96);
    color: var(--pvz-text-main);
    border: 1px solid rgba(45, 212, 191, 0.6);
}

/* На всякий случай чутка подчистим историю, чтобы карточки были в зелёной гамме */
body.pvz-body.theme-dark .history-item {
    background: linear-gradient(135deg, #041914, #020b08);
    border-radius: 14px;
}
/* === Wallet layout: stack tiles under title === */

/* делаем блок кошелька колонкой: сначала текст, ниже – плитки баланса */
.hero-wallet {
    flex-direction: column;
    align-items: stretch;
}

/* плитки на всю ширину строки + небольшой отступ сверху */
.hero-wallet-tiles {
    width: 100%;
    margin-top: 10px;
}
/* --- Toast всегда поверх модалок --- */
#pvz-toast-root {
    z-index: 1000; /* больше, чем у .wallet-modal-overlay */
}

.wallet-modal-overlay {
    z-index: 900;  /* опционально, просто фиксируем порядок */
}

 /* Строка промокода + кнопка "Применить" */
.wallet-promo-row {
    margin-top: 2px;
    display: flex;
    gap: 6px;
    align-items: center;
}

.wallet-promo-row .wallet-input {
    flex: 1;
}

/* Кнопка "Применить" промокод */
.wallet-promo-apply {
    flex-shrink: 0;
    border-radius: 999px;
    border: none;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, opacity 0.12s ease;
}

.wallet-promo-apply:active {
    transform: scale(0.97);
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.5);
}

.wallet-promo-apply:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

/* Текст под полем промокода (статус/ошибка) */
.wallet-promo-message {
    margin-top: 4px;
    font-size: 11px;
    color: #6b7280;
}

.wallet-promo-message.error {
    color: #dc2626;
}

 .wallet-deposit-bonus {
    margin-left: 6px;
    font-size: 12px;
    font-weight: 500;
    color: #16a34a;
    opacity: 0.9;
}

body.pvz-body.theme-dark .wallet-promo-message {
    color: #9ca3af;
}

body.pvz-body.theme-dark .wallet-promo-message.error {
    color: #fecaca;
}

body.pvz-body.theme-dark .wallet-deposit-bonus {
    color: #22c55e;
}
 
body.pvz-body:not(.theme-dark) .wallet-modal input,
body.pvz-body:not(.theme-dark) .wallet-modal textarea,
body.pvz-body:not(.theme-dark) .wallet-modal .wallet-input {
    color: #0f172a !important;             
    -webkit-text-fill-color: #0f172a !important;  
    caret-color: #0f172a !important;       
    background-color: rgba(255, 255, 255, 0.96);  
}

 

 body.pvz-body:not(.theme-dark) .wallet-modal {
    color-scheme: light;
}
  
 body.pvz-body:not(.theme-dark) .wallet-modal input::placeholder,
body.pvz-body:not(.theme-dark) .wallet-modal textarea::placeholder,
body.pvz-body:not(.theme-dark) .wallet-modal .wallet-input::placeholder {
    color: var(--pvz-text-muted) !important;  
    opacity: 1;
}
/* TON-details inside standard wallet-modal */
.wallet-ton-details {
    margin-top: 4px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wallet-ton-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wallet-ton-input-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* делаем readonly-инпуты чуть компактнее, но в общем стиле */
.wallet-input.wallet-input-readonly {
    flex: 1;
    font-size: 13px;
    padding: 7px 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* кнопки копирования – маленькие пилюли в том же стиле */
.wallet-ton-copy-btn {
    flex-shrink: 0;
    border-radius: 999px;
    border: none;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    box-shadow: 0 6px 14px rgba(34, 197, 94, 0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.wallet-ton-copy-btn:active {
    transform: scale(0.97);
    box-shadow: 0 4px 10px rgba(22, 163, 74, 0.5);
}

.wallet-ton-copy-btn:disabled {
    opacity: 0.6;
    cursor: default;
    box-shadow: none;
}

body.pvz-body.theme-dark .wallet-input.wallet-input-readonly {
    background: rgba(3, 22, 18, 0.96);
    border-color: rgba(45, 212, 191, 0.55);
    color: var(--pvz-text-main);
}


/* -------- Ambassador page -------- */

.ambassador-page {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-bottom: 80px;
}

.hero-ambassador {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

.hero-ambassador::before {
    content: '';
    position: absolute;
    inset: -40%;
    opacity: 0.28;
    background:
        radial-gradient(circle at 0% 0%, rgba(102, 187, 255, 0.25), transparent 60%),
        radial-gradient(circle at 100% 0%, rgba(255, 89, 186, 0.2), transparent 60%),
        radial-gradient(circle at 50% 100%, rgba(151, 255, 164, 0.18), transparent 55%);
    pointer-events: none;
}

.hero-ambassador .hero-text {
    position: relative;
    z-index: 1;
}

.amb-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

body.theme-light .amb-badge {
    background: rgba(255, 255, 255, 0.7);
    border-color: rgba(0, 0, 0, 0.06);
}

.amb-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.amb-meta-pill {
    min-width: 0;
    flex: 1;
    min-width: 150px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.theme-light .amb-meta-pill {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(0, 0, 0, 0.04);
}

.amb-meta-label {
    opacity: 0.7;
    font-size: 11px;
}

.amb-meta-value {
    font-size: 14px;
    font-weight: 600;
}

.amb-meta-value-accent {
    font-size: 16px;
}

.amb-progress-block {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-light .amb-progress-block {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.06);
}

.amb-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    margin-bottom: 6px;
}

.amb-progress-label {
    opacity: 0.8;
}

.amb-progress-value {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.amb-progress-bar {
    position: relative;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    overflow: hidden;
    background: linear-gradient(90deg,
        rgba(255, 255, 255, 0.03),
        rgba(255, 255, 255, 0.06));
}

.amb-progress-fill {
    position: absolute;
    inset: 0;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg,
        #5effaf,
        #6fd2ff,
        #ff8af5);
    transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.amb-progress-footer {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    opacity: 0.85;
}

.amb-progress-small {
    font-variant-numeric: tabular-nums;
}

.amb-hero-hint {
    margin-top: 10px;
    font-size: 11px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    opacity: 0.9;
}

.amb-hero-dot {
    font-size: 12px;
    margin-top: 1px;
}

/* Ladder */

.amb-ladder-section {
    position: relative;
}

.amb-ladder {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.amb-step {
    position: relative;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: radial-gradient(circle at 0 0, rgba(255, 255, 255, 0.05), transparent 55%);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(6px);
    transition:
        opacity 0.35s ease-out,
        transform 0.35s ease-out,
        border-color 0.25s ease-out,
        box-shadow 0.25s ease-out,
        background 0.25s ease-out;
}

body.theme-light .amb-step {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.05);
}

.amb-ladder-ready .amb-step {
    opacity: 1;
    transform: translateY(0);
}

.amb-ladder-ready .amb-step {
    transition-delay: calc(var(--amb-step-index, 0) * 40ms);
}

.amb-step-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.amb-step-level {
    display: flex;
    align-items: center;
    gap: 6px;
}

.amb-step-pill {
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

body.theme-light .amb-step-pill {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.1);
}

.amb-step-title {
    font-size: 13px;
    font-weight: 600;
}

.amb-step-status {
    font-size: 11px;
    opacity: 0.85;
}

.amb-step-body {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.amb-step-row {
    font-size: 11px;
}

.amb-step-label {
    opacity: 0.9;
    font-variant-numeric: tabular-nums;
}

.amb-step-row-secret {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.amb-step-secret {
    font-size: 12px;
    font-weight: 600;
}

.amb-step-secret-hint {
    font-size: 10px;
    opacity: 0.8;
    text-align: right;
}

/* statuses */

.amb-step-current {
    border-color: rgba(110, 214, 255, 0.7);
    box-shadow: 0 0 0 1px rgba(110, 214, 255, 0.6), 0 8px 20px rgba(0, 0, 0, 0.5);
}

.amb-step-done {
    border-color: rgba(124, 255, 179, 0.6);
}

.amb-step-locked {
    opacity: 0.85;
}

.amb-step-locked .amb-step-secret {
    opacity: 0.7;
}

/* legend */

.amb-legend {
    margin-top: 12px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 10px;
    opacity: 0.85;
}

.amb-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.amb-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.amb-legend-dot-current {
    background: linear-gradient(135deg, #6ed6ff, #ff8af5);
}

.amb-legend-dot-unlocked {
    background: #7effb1;
}

.amb-legend-dot-locked {
    background: rgba(255, 255, 255, 0.35);
}

 

.amb-promo-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.amb-promo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.amb-promo-level-badge {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

body.theme-light .amb-promo-level-badge {
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
}

.amb-promo-body {
    margin-top: 4px;
}

.amb-promo-row {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.amb-promo-row .wallet-input {
    flex: 1;
}

.amb-promo-hint {
    margin-top: 6px;
    font-size: 11px;
    opacity: 0.85;
}

.amb-promo-limit {
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.9;
}

.amb-promo-empty {
    font-size: 12px;
    opacity: 0.9;
}
/* === SCRATCH ZONE === */

.scratch-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Верхний блок */
.scratch-hero {
    padding: 14px 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.scratch-hero-text .section-subtitle {
    margin-top: 4px;
}

.scratch-card-hint {
    margin-top: 6px;
    font-size: 13px;
    color: var(--pvz-text-muted);
}

.scratch-tickets-pill {
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 13px;
    border: 1px solid rgba(151, 177, 214, 0.6);
    background: rgba(239, 245, 255, 0.96);
    color: var(--pvz-text-main);
    white-space: nowrap;
}

body.pvz-body.theme-dark .scratch-tickets-pill {
    background: rgba(15, 23, 42, 0.96);
    border-color: rgba(148, 163, 184, 0.8);
    color: #e5e7eb;
}

/* Карточка с полем */
.scratch-card-shell {
    padding: 14px 14px 16px;
}

.scratch-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.6);
    background: radial-gradient(circle at top, #e5e7eb, #cbd5f5);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.45);
}

.scratch-card::before {
    content: "";
    display: block;
    padding-top: 100%;
}

/* Подложка 3x3 */
.scratch-underlay {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(3, 1fr);
    gap: clamp(6px, 1.4vw, 10px);
    padding: clamp(8px, 1.8vw, 14px);
    z-index: 1;
}

.scratch-underlay .scratch-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: linear-gradient(180deg, #0f172a, #0b1120);
    border: 1px solid #1f2937;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
    font-weight: 800;
    font-size: clamp(16px, 4vw, 22px);
    color: #e5e7eb;
}

.scratch-underlay .scratch-cell.win {
    box-shadow:
        0 0 0 2px rgba(250, 204, 21, 0.95),
        0 0 32px rgba(250, 204, 21, 0.45);
    color: #fef3c7;
}

/* Серебряный слой */
#scratch-overlay {
    position: absolute;
    inset: 0;
    touch-action: none;
    cursor: grab;
    z-index: 3;
}

/* Водяной знак */
.scratch-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.scratch-watermark span {
    font-weight: 1000;
    font-size: clamp(32px, 8vw, 64px);
    letter-spacing: .22em;
    opacity: .10;
    transform: rotate(-8deg);
    color: #0f172a;
}

/* Кнопки */
.scratch-buttons {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.scratch-start-btn {
    padding-inline: 18px;
    background: linear-gradient(135deg, #34c879, #8f7bff);
    color: #ffffff;
    border: none;
}

.scratch-reset-btn {
    padding-inline: 14px;
    background: linear-gradient(135deg, #e5e7eb, #d1d5db);
}

/* Темная тема */
body.pvz-body.theme-dark .scratch-card {
    background: radial-gradient(circle at top, #111827, #020617);
    border-color: #1e293b;
}

/* Модалка */
.scratch-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: radial-gradient(circle at top, rgba(56, 189, 248, 0.08), transparent),
                rgba(15, 23, 42, 0.78);
    display: flex;
    justify-content: center;
    align-items: center;
}

.scratch-modal-overlay[hidden] {
    display: none;
}

.scratch-modal {
    max-width: 420px;
    width: calc(100% - 32px);
    padding: 18px 16px 16px;
    border-radius: 24px;
    text-align: center;
}

.scratch-modal-emoji {
    font-size: 40px;
    margin-bottom: 4px;
}

.scratch-modal-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 4px;
}

.scratch-modal-prize {
    font-size: 26px;
    font-weight: 900;
    margin-bottom: 4px;
}

.scratch-modal-sub {
    font-size: 13px;
    color: var(--pvz-text-muted);
    margin-bottom: 10px;
}

.scratch-modal-close {
    margin-top: 4px;
    padding-inline: 18px;
}

/* ===== TASKS PAGE v2 ===== */

/* общий паддинг и сетка для страницы задач */
.pvz-main.tasks-page {
    padding: 12px 12px 80px;
    gap: 16px;
}

@media (min-width: 480px) {
    .pvz-main.tasks-page {
        padding-inline: 16px;
    }
}

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

/* HERO блока задач */

.tasks-hero {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px 16px;
    border-radius: var(--pvz-radius-xl);
    background: radial-gradient(circle at 0 0, #fff5fb, #f3f7ff 45%, #f2fff7 100%);
    border: 1px solid rgba(207, 215, 255, 0.9);
    box-shadow: 0 16px 40px rgba(51, 75, 140, 0.18);
}

.tasks-hero-title {
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 4px;
}

.tasks-hero-sub {
    margin: 0;
    font-size: 13px;
    color: var(--pvz-text-muted);
}

.tasks-hero-meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tasks-hero-pill {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(196, 216, 255, 0.8);
    color: #46506e;
}

/* блоки "Основные / Социальные" */

.tasks-group {
    border-radius: var(--pvz-radius-xl);
    padding: 10px 12px 12px;
    background: var(--pvz-card-soft);
    border: 1px solid var(--pvz-border);
    box-shadow: var(--pvz-shadow-soft);
}

.tasks-group-header {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 6px;
}

.tasks-group-title {
    font-size: 15px;
    font-weight: 700;
}

.tasks-group-caption {
    font-size: 12px;
    color: var(--pvz-text-muted);
}

.tasks-group-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}

.tasks-empty {
    font-size: 12px;
    color: var(--pvz-text-muted);
    padding-top: 4px;
}

/* карточка задания */

.task-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 10px;
    border-radius: 14px;
    background: linear-gradient(135deg, #ffffff, #f3f7ff);
    border: 1px solid rgba(196, 212, 255, 0.9);
    box-shadow: 0 10px 26px rgba(58, 86, 166, 0.14);
}

.task-card-main {
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.task-card-title {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-card-reward {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
}

.task-card-reward-label {
    color: var(--pvz-text-muted);
}

.task-card-reward-value {
    font-weight: 600;
}

.task-card-status {
    margin-top: 3px;
    font-size: 11px;
    color: var(--pvz-text-muted);
}

.task-card-actions {
    flex-shrink: 0;
}

.task-card-open-btn {
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 999px;
    border: none;
    background: linear-gradient(135deg, #34c879, #8fddff);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(52, 200, 121, 0.45);
    cursor: pointer;
}

/* модалка задач — нормальный bottom-sheet */

.tasks-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 90;
    background: radial-gradient(circle at top, rgba(52, 200, 121, 0.06), transparent),
                rgba(15, 23, 42, 0.70);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 14px 10px calc(10px + env(safe-area-inset-bottom));
}

/* чтобы не всплывала сама — как у кошелька */
.tasks-modal-backdrop[hidden] {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.tasks-modal-window {
    width: 100%;
    max-width: 420px;
    border-radius: 22px 22px 18px 18px;
    padding: 14px 14px 12px;
    box-shadow: 0 -16px 40px rgba(0, 0, 0, 0.45);
}

.tasks-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.tasks-modal-title {
    font-size: 16px;
    font-weight: 700;
}

.tasks-modal-close {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: none;
    background: rgba(15, 23, 42, 0.06);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.tasks-modal-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    margin-bottom: 10px;
}

.tasks-modal-reward {
    font-weight: 600;
}

.tasks-modal-desc {
    opacity: 0.9;
}

.tasks-modal-extra {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tasks-modal-links {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tasks-link-btn {
    font-size: 11px;
    padding: 5px 10px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.05);
}

.tasks-modal-footer {
    display: flex;
    gap: 8px;
}

.tasks-modal-footer .btn-primary,
.tasks-modal-footer .btn-secondary {
    flex: 1;
    font-size: 13px;
}

/* Тёмная тема для задач */

body.pvz-body.theme-dark .tasks-hero {
    background: radial-gradient(circle at 0 0, rgba(93,240,126,0.18), rgba(4,25,18,0.98));
    border-color: rgba(136, 255, 193, 0.6);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.95);
}

body.pvz-body.theme-dark .tasks-hero-pill {
    background: radial-gradient(circle at 0 0, rgba(45,212,191,0.22), rgba(4,25,18,0.98));
    border-color: rgba(136, 255, 193, 0.6);
    color: var(--pvz-text-main);
}

body.pvz-body.theme-dark .tasks-group {
    background: linear-gradient(135deg, #041914, #020910);
    border-color: rgba(136, 255, 193, 0.55);
}

body.pvz-body.theme-dark .task-card {
    background: linear-gradient(135deg, #041914, #020910);
    border-color: rgba(136, 255, 193, 0.5);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.9);
}

body.pvz-body.theme-dark .tasks-link-btn {
    background: rgba(3, 22, 18, 0.96);
}

body.pvz-body.theme-dark .tasks-modal-window {
    background: linear-gradient(135deg, #041914, #020a07);
    border: 1px solid rgba(136, 255, 193, 0.7);
}

body.pvz-body.theme-dark .tasks-modal-close {
    background: rgba(3, 22, 18, 0.96);
    color: var(--pvz-text-main);
}
/* Generic primary / secondary buttons */

.btn-primary,
.btn-secondary {
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition:
        transform 0.08s ease,
        box-shadow 0.12s ease,
        background 0.12s ease,
        opacity 0.12s ease;
}

/* зелёный акцент – как task-card-open-btn / collect-btn */
.btn-primary {
    background: linear-gradient(135deg, #34c879, #8fddff);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(52, 200, 121, 0.45);
}

/* вторичная – стеклянная, под PvZ-карточки */
.btn-secondary {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(196, 212, 255, 0.9);
    color: var(--pvz-text-main);
    box-shadow: 0 8px 18px rgba(58, 86, 166, 0.18);
}

.btn-primary:active,
.btn-secondary:active {
    transform: translateY(1px) scale(0.97);
    box-shadow: 0 4px 12px rgba(32, 49, 102, 0.3);
}

.btn-primary:disabled,
.btn-secondary:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
    box-shadow: none;
}
body.pvz-body.theme-dark .btn-secondary {
    background: rgba(3, 22, 18, 0.96);
    border-color: rgba(136, 255, 193, 0.6);
    color: var(--pvz-text-main);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.85);
}

body.pvz-body.theme-dark .btn-primary {
    background: linear-gradient(135deg, #22c55e, #0ea5e9);
    box-shadow: 0 10px 24px rgba(34, 197, 94, 0.55);
}

/* Кнопка-ссылка в модалке заданий */
body.theme-dark .tasks-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.04);
    color: #fff;               
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

  .tasks-link-btn {
    border-color: rgba(15, 23, 42, 0.12);
    background: rgba(15, 23, 42, 0.04);
    color: #0f172a;
}
