
        * { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
:root {
    --bg: #07070f;
    --bg-elevated: #12121f;
    --bg-card: rgba(22, 22, 42, 0.72);
    --border: rgba(255, 255, 255, 0.08);
    --border-strong: rgba(240, 97, 20, 0.45);
    --text: #f4f1ea;
    --muted: #8b8799;
    --gold: #e8b04f;
    --orange: #f06114;
    --amber: #b6743e;
    --green: #4fb76c;
    --glow: 0 0 40px rgba(240, 97, 20, 0.25);
    /* Quicksand everywhere; pixel logo only for MIPIXLAND hero */
    --font-body: 'Quicksand', sans-serif;
    --font-display: 'Quicksand', sans-serif;
    --font-logo: 'Press Start 2P', monospace;
}
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    font-size: 18px;
    line-height: 1.5;
    position: relative;
}

/* ===== КВАДРАТНЫЕ АВАТАРКИ ===== */
.mc-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 4px;
    background: #c6c6c6;
    color: #fff;
    font-weight: 800;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.mc-avatar img,
.mc-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0 !important;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    display: block;
    background: #c6c6c6;
}
/* фон — только body.mipix-shell в assets/mipix.css */
body::before,
body::after {
    content: none !important;
    display: none !important;
}
@keyframes gridDrift {
    from { background-position: 0 0, 0 0; }
    to { background-position: 48px 48px, 48px 48px; }
}
section, .profile-page, .toast {
    position: relative;
    z-index: 1;
}

/* ===== REVEAL ===== */
.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }

/* ===== ГЛАВНЫЙ ЭКРАН ===== */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 2rem 2rem 7rem;
    position: relative;
    overflow: hidden;
}
.hero-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transform: translateY(-4vh);
}
.hero::before {
    content: '';
    position: absolute;
    width: 520px;
    height: 520px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(240, 97, 20, 0.22), transparent 70%);
    top: 8%;
    left: 50%;
    transform: translateX(-50%);
    filter: blur(20px);
    animation: heroOrb 8s ease-in-out infinite;
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to top, var(--bg), transparent);
    pointer-events: none;
}
@keyframes heroOrb {
    0%, 100% { transform: translateX(-50%) scale(1); opacity: 0.85; }
    50% { transform: translateX(-50%) scale(1.15); opacity: 1; }
}
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    border-radius: 14px;
    background: rgba(15, 15, 28, 0.7);
    border: 1px solid var(--border);
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #c9c5d4;
    margin-bottom: 36px;
    backdrop-filter: blur(12px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
    animation: fadeSlideDown 0.9s ease both;
}
.hero-badge i {
    color: var(--green);
    font-size: 10px;
    animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; transform: scale(1); text-shadow: 0 0 0 transparent; }
    50% { opacity: 0.7; transform: scale(1.25); text-shadow: 0 0 12px var(--green); }
}
.hero-title {
    font-family: var(--font-logo);
    font-size: clamp(1.6rem, 5.5vw, 4.2rem);
    font-weight: 400;
    line-height: 1.35;
    background: linear-gradient(120deg, #b6743e 0%, #e8b04f 35%, #fff1c8 50%, #f06114 75%, #b6743e 100%);
    background-size: 220% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 24px;
    letter-spacing: 2px;
    filter: drop-shadow(0 4px 0 rgba(90, 40, 10, 0.55)) drop-shadow(0 0 28px rgba(240, 97, 20, 0.35));
    animation: titleShine 5s linear infinite, fadeSlideUp 0.9s 0.1s ease both;
}
@keyframes titleShine {
    to { background-position: 220% center; }
}
.hero-subtitle {
    font-size: clamp(1.05rem, 2.2vw, 1.45rem);
    color: var(--muted);
    font-weight: 500;
    margin-bottom: 52px;
    max-width: 640px;
    animation: fadeSlideUp 0.9s 0.2s ease both;
}
.hero-join {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    width: min(540px, 100%);
    margin: 0 auto 56px;
    padding: 14px;
    border-radius: 24px;
    background:
        linear-gradient(145deg, rgba(32, 28, 48, 0.92), rgba(14, 14, 28, 0.88)),
        radial-gradient(ellipse at 10% 50%, rgba(79, 183, 108, 0.12), transparent 55%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(18px);
    box-shadow:
        0 16px 48px rgba(0,0,0,0.4),
        inset 0 1px 0 rgba(255,255,255,0.06);
    animation: fadeSlideUp 0.9s 0.35s ease both;
    transition: border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}
.hero-join:hover {
    border-color: rgba(240, 97, 20, 0.4);
    box-shadow:
        0 20px 56px rgba(0,0,0,0.45),
        0 0 36px rgba(240, 97, 20, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.08);
    transform: translateY(-4px);
}
.hero-join-online {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1 1 170px;
    min-width: 0;
    min-height: 56px;
    padding: 10px 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(79, 183, 108, 0.18), rgba(79, 183, 108, 0.05));
    border: 1px solid rgba(79, 183, 108, 0.35);
    box-shadow: inset 0 0 24px rgba(79, 183, 108, 0.08);
}
.hero-join-online .dot-wrap {
    position: relative;
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    display: grid;
    place-items: center;
}
.hero-join-online .dot-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(79, 183, 108, 0.35);
    animation: onlineRing 2.2s ease-out infinite;
}
.hero-join-online .dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #4fb76c;
    box-shadow: 0 0 14px rgba(79, 183, 108, 0.9), 0 0 28px rgba(79, 183, 108, 0.4);
    animation: onlinePulse 2s ease-in-out infinite;
}
@keyframes onlinePulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.75; transform: scale(0.88); }
}
@keyframes onlineRing {
    0% { transform: scale(0.7); opacity: 0.8; }
    100% { transform: scale(1.25); opacity: 0; }
}
.hero-join-online .meta .label {
    color: #7dcca0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    font-weight: 800;
    margin-bottom: 2px;
}
.hero-join-online .meta .value {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 26px;
    letter-spacing: 0.5px;
    line-height: 1.45;
    color: #6dff9a;
    text-shadow: 0 0 18px rgba(79, 183, 108, 0.45);
}
.hero-join-online .meta .unit {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    color: rgba(125, 204, 160, 0.85);
    margin-left: 4px;
}
/* Original join CTA (pre-Uiverse) */
.hero-join-btn {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 200px;
    min-height: 56px;
    height: 56px;
    padding: 0 28px;
    border: 1px solid rgba(240, 97, 20, 0.55);
    border-radius: 16px;
    outline: none;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.4px;
    white-space: nowrap;
    color: #fff;
    background: linear-gradient(135deg, #b6743e, #f06114);
    box-shadow: 0 10px 28px rgba(240, 97, 20, 0.32);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.hero-join-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px rgba(240, 97, 20, 0.42);
}
.hero-join-btn:active {
    transform: translateY(0);
}
.hero-join-btn .btn-spinner,
.hero-join-btn .btn-check {
    display: none;
    width: 1.15em;
    height: 1.15em;
}
.hero-join-btn.is-busy .btn-label-text { opacity: 0.15; }
.hero-join-btn.is-busy .btn-spinner {
    display: block;
    position: absolute;
    inset: 0;
    margin: auto;
    border: 2.5px solid rgba(255, 255, 255, 0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: mipixSpin 0.7s linear infinite;
}
.hero-join-btn.is-success {
    background: linear-gradient(135deg, #3d9a58, #4fb76c);
    border-color: rgba(79, 183, 108, 0.55);
    box-shadow: 0 10px 28px rgba(79, 183, 108, 0.32);
}
.hero-join-btn.is-success .btn-label-text { opacity: 0; }
.hero-join-btn.is-success .btn-check {
    display: grid;
    place-items: center;
    position: absolute;
    inset: 0;
    margin: auto;
    color: #fff;
    font-size: 1.25em;
    animation: mipixPop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes mipixSpin { to { transform: rotate(360deg); } }
@keyframes mipixPop {
    from { opacity: 0; transform: scale(0.5); }
    to { opacity: 1; transform: scale(1); }
}
.hero-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
    max-width: 720px;
    animation: fadeSlideUp 0.9s 0.45s ease both;
}
.hero-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(15, 15, 28, 0.55);
    color: #f4f1ea;
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-decoration: none;
    cursor: pointer;
    backdrop-filter: blur(12px);
    transition: transform 0.25s, border-color 0.25s, background 0.25s, box-shadow 0.25s, color 0.25s;
}
.hero-nav-btn:hover {
    /* без translateY — иначе курсор «теряет» кнопку и она дёргается */
    border-color: rgba(240, 97, 20, 0.55);
    background: rgba(240, 97, 20, 0.12);
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
    color: #fff;
}
.hero-nav-btn i { font-size: 15px; opacity: 0.9; }
.hero-nav-btn--tg:hover { border-color: rgba(42,171,238,0.65); background: rgba(42,171,238,0.14); }
.hero-nav-btn--ds:hover { border-color: rgba(88,101,242,0.65); background: rgba(88,101,242,0.14); }
.hero-nav-row-break { flex-basis: 100%; height: 0; }
.hero-scroll-hint {
    position: absolute;
    left: 50%;
    bottom: 36px;
    transform: translateX(-50%);
    margin-top: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #6a6678;
    animation: heroScrollHintIn 0.9s 0.55s ease both;
    pointer-events: none;
    z-index: 2;
    width: max-content;
    text-align: center;
}
@keyframes heroScrollHintIn {
    from { opacity: 0; transform: translate(-50%, 24px); }
    to { opacity: 1; transform: translate(-50%, 0); }
}
.hero-scroll-hint .hint-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.scroll-mouse {
    width: 26px;
    height: 42px;
    border: 2px solid rgba(232, 176, 79, 0.55);
    border-radius: 16px;
    position: relative;
    opacity: 0.9;
}
.scroll-mouse::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 8px;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 4px;
    background: var(--gold);
    animation: scrollWheel 1.6s ease-in-out infinite;
}
.scroll-chevrons {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: rgba(232, 176, 79, 0.7);
    font-size: 12px;
    animation: scrollChevrons 1.6s ease-in-out infinite;
}
@keyframes scrollWheel {
    0% { transform: translateY(0); opacity: 1; }
    70% { transform: translateY(12px); opacity: 0; }
    100% { transform: translateY(12px); opacity: 0; }
}
@keyframes scrollChevrons {
    0%, 100% { transform: translateY(0); opacity: 0.35; }
    50% { transform: translateY(6px); opacity: 1; }
}
@keyframes fadeSlideUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideDown {
    from { opacity: 0; transform: translateY(-18px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== КНОПКА АВТОРИЗАЦИИ ===== */
.admin-btn {
    position: fixed;
    top: 24px;
    left: 28px;
    z-index: 1000;
    width: 48px;
    height: 48px;
    border-radius: 16px;
    background: rgba(18, 18, 32, 0.78);
    border: 1px solid rgba(255, 80, 80, 0.35);
    color: #ff6b6b;
    font-size: 18px;
    cursor: pointer;
    backdrop-filter: blur(16px);
    display: none !important;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    transition: transform 0.3s, border-color 0.3s, background 0.3s, box-shadow 0.3s;
    text-decoration: none;
}
.admin-btn.visible { display: flex !important; }
.admin-btn:hover {
    background: rgba(40, 18, 24, 0.92);
    border-color: rgba(255, 100, 100, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 0 28px rgba(255, 80, 80, 0.2);
    color: #ff8a8a;
}
.auth-btn {
    position: fixed;
    top: 24px;
    right: 28px;
    z-index: 1000;
    padding: 12px 22px;
    border-radius: 16px;
    background: rgba(18, 18, 32, 0.78);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(16px);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s, background 0.3s;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
}
.auth-btn:hover {
    background: rgba(30, 24, 40, 0.92);
    border-color: var(--border-strong);
    transform: translateY(-2px);
    box-shadow: var(--glow);
}
.auth-btn .avatar {
    width: 36px;
    height: 36px;
    border-radius: 4px;
    background: linear-gradient(135deg, #b6743e, #f06114);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 800;
    color: #fff;
    overflow: hidden;
}
.auth-btn .auth-text {
    font-size: 14px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
}
.auth-btn .auth-text .rank-grad {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* ===== МОДАЛКА ВХОДА ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(4, 4, 10, 0.72);
    backdrop-filter: blur(16px);
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.active { display: flex; animation: fadeIn 0.28s ease; }
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal {
    background: linear-gradient(165deg, #1a1a2e 0%, #12121f 100%);
    border-radius: 24px;
    padding: 48px 42px;
    max-width: 460px;
    width: 100%;
    border: 1px solid var(--border);
    box-shadow: 0 32px 100px rgba(0,0,0,0.65), 0 0 0 1px rgba(240,97,20,0.08), var(--glow);
    position: relative;
    animation: modalPop 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes modalPop {
    from { opacity: 0; transform: translateY(18px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-close {
    position: absolute;
    top: 16px;
    right: 18px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    width: 40px;
    height: 40px;
    color: #777;
    font-size: 22px;
    cursor: pointer;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.modal-close:hover { color: #fff; border-color: rgba(255,255,255,0.2); background: rgba(255,255,255,0.08); }
.modal-title {
    font-family: var(--font-display);
    font-size: 36px;
    font-weight: 400;
    margin-bottom: 8px;
    letter-spacing: 1px;
    line-height: 1.15;
}
.modal-subtitle { color: var(--muted); font-size: 15px; margin-bottom: 28px; }
.modal .form-group { margin-bottom: 10px; }
.modal .form-group.mipix-fc-ready > label:not(.mipix-fc-label) { display: none; }
.modal .form-control { margin: 26px 0 24px; }
.modal .form-control > label { top: 14px; }
.modal .form-control input,
.modal .form-control textarea {
    caret-color: #fff;
}
.modal .form-control input:focus,
.modal .form-control input:valid,
.modal .form-control input:-webkit-autofill,
.modal .form-control input:-webkit-autofill:focus {
    border-bottom-color: rgba(255, 255, 255, 0.28) !important;
    box-shadow: 0 0 0 1000px #161625 inset !important;
    -webkit-box-shadow: 0 0 0 1000px #161625 inset !important;
}
.modal .form-control input:focus + label span,
.modal .form-control input:valid + label span,
.modal .form-control input:-webkit-autofill + label span {
    color: rgba(255, 255, 255, 0.55) !important;
    transform: translateY(-34px);
}
.modal .btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, #b6743e, #f06114);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.55;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: transform 0.25s, opacity 0.25s, box-shadow 0.25s;
    margin-top: 6px;
    box-shadow: 0 10px 28px rgba(240, 97, 20, 0.3);
    position: relative;
    overflow: hidden;
}
.modal .btn-primary::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,0.25) 50%, transparent 70%);
    transform: translateX(-120%);
    transition: transform 0.6s;
}
.modal .btn-primary:hover { opacity: 0.95; transform: translateY(-2px); }
.modal .btn-primary:hover::after { transform: translateX(120%); }
.modal .btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.modal .error-msg { color: #ff6b6b; font-size: 14px; margin-top: 12px; display: none; }

/* ===== TELEGRAM-ВХОД ===== */
.modal-view { animation: tgViewIn 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes tgViewIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.modal .btn-telegram {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    margin-top: 14px;
    background: linear-gradient(135deg, #2AABEE, #1E88D0);
    border: none;
    border-radius: 14px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    font-family: var(--font-body);
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(42, 171, 238, 0.28);
    transition: transform 0.25s, opacity 0.25s, box-shadow 0.25s;
}
.modal .btn-telegram i { font-size: 19px; }
.modal .btn-telegram:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(42, 171, 238, 0.4); }
.modal .btn-telegram:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.modal .btn-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 16px;
    padding: 6px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: color 0.25s;
}
.modal .btn-link:hover { color: #fff; }
.tg-center { text-align: center; }
.tg-hero {
    width: 64px;
    height: 64px;
    margin-bottom: 18px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #fff;
    background: linear-gradient(135deg, #2AABEE, #1E88D0);
    box-shadow: 0 12px 30px rgba(42, 171, 238, 0.35);
}

.tg-wait-ring {
    position: relative;
    width: 110px;
    height: 110px;
    margin: 4px auto 22px;
}
.tg-wait-pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(42, 171, 238, 0.55);
    animation: tgPulse 2s ease-out infinite;
}
.tg-wait-pulse-2 { animation-delay: 1s; }
@keyframes tgPulse {
    from { transform: scale(0.7); opacity: 1; }
    to { transform: scale(1.35); opacity: 0; }
}
.tg-wait-icon {
    position: absolute;
    inset: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #fff;
    background: linear-gradient(135deg, #2AABEE, #1E88D0);
    box-shadow: 0 0 40px rgba(42, 171, 238, 0.45);
    animation: tgFloat 2.4s ease-in-out infinite;
}
@keyframes tgFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
.tg-timer { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 4px; }
.tg-timer b { color: var(--text); font-variant-numeric: tabular-nums; }

.tg-steps { list-style: none; margin: 0 0 18px; padding: 0; }
.tg-steps li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    margin-bottom: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: rgba(8, 8, 18, 0.6);
    color: var(--muted);
    font-size: 14px;
    transition: color 0.3s, border-color 0.3s, background 0.3s;
}
.tg-step-dot {
    flex: 0 0 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--muted);
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}
.tg-steps li.active { color: var(--text); border-color: rgba(42, 171, 238, 0.5); background: rgba(42, 171, 238, 0.08); }
.tg-steps li.active .tg-step-dot { border-color: #2AABEE; box-shadow: 0 0 10px rgba(42, 171, 238, 0.7); animation: tgBlink 1.2s ease-in-out infinite; }
.tg-steps li.done { color: #9fe3b3; }
.tg-steps li.done .tg-step-dot { background: var(--green); border-color: var(--green); }
@keyframes tgBlink { 50% { opacity: 0.35; } }

.tg-check { width: 120px; height: 120px; margin: 4px auto 18px; }
.tg-check svg { width: 100%; height: 100%; overflow: visible; }
.tg-check-circle {
    fill: rgba(79, 183, 108, 0.12);
    stroke: var(--green);
    stroke-width: 5;
    stroke-dasharray: 277;
    stroke-dashoffset: 277;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
    animation: tgCircle 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.tg-check-mark {
    fill: none;
    stroke: var(--green);
    stroke-width: 7;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 70;
    stroke-dashoffset: 70;
    animation: tgMark 0.4s cubic-bezier(0.65, 0, 0.45, 1) 0.55s forwards;
}
.tg-check svg { animation: tgPop 0.45s ease 0.9s both; }
@keyframes tgCircle { to { stroke-dashoffset: 0; } }
@keyframes tgMark { to { stroke-dashoffset: 0; } }
@keyframes tgPop {
    0% { transform: scale(1); filter: drop-shadow(0 0 0 rgba(79,183,108,0)); }
    50% { transform: scale(1.1); filter: drop-shadow(0 0 18px rgba(79,183,108,0.7)); }
    100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(79,183,108,0.35)); }
}

.tg-error-icon {
    width: 84px;
    height: 84px;
    margin: 4px auto 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.1);
    border: 2px solid rgba(255, 107, 107, 0.45);
    animation: tgShake 0.5s ease 0.15s both;
}
.tg-error-icon.warn { color: var(--gold); background: rgba(232, 176, 79, 0.1); border-color: rgba(232, 176, 79, 0.45); }
@keyframes tgShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.tg-howto {
    margin: -8px 0 18px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: rgba(8, 8, 18, 0.6);
    font-size: 14px;
    color: var(--muted);
}
.tg-howto-title { color: var(--text); font-weight: 800; margin-bottom: 8px; }
.tg-howto ol { margin: 0 0 10px; padding-left: 20px; line-height: 1.8; }
.tg-howto b { color: var(--text); }
.tg-howto-note { font-size: 13px; }

/* ===== НАШИ РЕЖИМЫ ===== */
.modes-section {
    padding: 72px 32px 48px;
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
}
.modes-section h2 {
    font-family: var(--font-display);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    font-size: clamp(2rem, 4.5vw, 2.85rem);
    letter-spacing: 0.5px;
}
.modes-section .subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 40px;
}
.modes-stack {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.mode-card {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    min-height: 320px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    isolation: isolate;
}
.mode-card__bg {
    position: absolute;
    inset: -8px;
    background-size: cover;
    background-position: center;
    filter: blur(5px) saturate(1.05);
    transform: scale(1.06);
    z-index: 0;
}
.mode-card__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(105deg, rgba(8, 8, 16, 0.88) 0%, rgba(8, 8, 16, 0.72) 42%, rgba(8, 8, 16, 0.45) 100%),
        linear-gradient(180deg, rgba(8, 8, 16, 0.2) 0%, rgba(8, 8, 16, 0.55) 100%);
}
.mode-card--anarchy .mode-card__veil {
    background:
        linear-gradient(105deg, rgba(28, 10, 28, 0.9) 0%, rgba(18, 8, 22, 0.75) 48%, rgba(12, 8, 20, 0.5) 100%),
        linear-gradient(180deg, rgba(10, 6, 16, 0.15), rgba(10, 6, 16, 0.55));
}
.mode-card--vanilla .mode-card__veil {
    background:
        linear-gradient(105deg, rgba(10, 22, 14, 0.9) 0%, rgba(8, 16, 12, 0.75) 48%, rgba(8, 12, 10, 0.5) 100%),
        linear-gradient(180deg, rgba(6, 14, 10, 0.15), rgba(6, 14, 10, 0.55));
}
.mode-card--monopoly .mode-card__veil {
    background:
        linear-gradient(105deg, rgba(8, 28, 22, 0.9) 0%, rgba(12, 22, 16, 0.75) 48%, rgba(18, 14, 10, 0.5) 100%),
        linear-gradient(180deg, rgba(6, 16, 12, 0.15), rgba(10, 10, 8, 0.55));
}
.mode-card__inner {
    position: relative;
    z-index: 2;
    padding: 28px 30px 30px;
}
.mode-card__head {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}
.mode-card__ver {
    font-size: 13px;
    font-weight: 600;
    color: rgba(244, 241, 234, 0.72);
    justify-self: start;
}
.mode-card__title {
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 800;
    text-align: center;
    letter-spacing: 0.4px;
    background: linear-gradient(120deg, #e8b04f, #fff1c8 45%, #f06114);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    justify-self: center;
}
.mode-card--vanilla .mode-card__title {
    background: linear-gradient(120deg, #86efac, #f4f1ea 48%, #4ade80);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.mode-card--monopoly .mode-card__title {
    background: linear-gradient(120deg, #34d399, #fff7d6 48%, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.mode-card__online {
    justify-self: end;
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.mode-card__online-label {
    font-size: 12px;
    color: rgba(244, 241, 234, 0.62);
    font-weight: 600;
}
.mode-card__online-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--green);
    text-shadow: 0 0 18px rgba(79, 183, 108, 0.35);
}
.mode-card__lead {
    font-weight: 700;
    margin-bottom: 14px;
    color: rgba(244, 241, 234, 0.92);
}
.mode-card__features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
}
.mode-card__features li {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: start;
}
.mode-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #f0c14b;
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
}
.mode-card__icon i {
    color: inherit;
    font-size: inherit;
    line-height: 1;
}
.mode-card--anarchy .mode-card__icon {
    color: #f0c14b;
    background: rgba(240, 193, 75, 0.12);
    border-color: rgba(240, 193, 75, 0.22);
}
.mode-card--vanilla .mode-card__icon {
    color: #86efac;
    background: rgba(134, 239, 172, 0.12);
    border-color: rgba(134, 239, 172, 0.22);
}
.mode-card--monopoly .mode-card__icon {
    color: #6ee7b7;
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(251, 191, 36, 0.28);
}
.mode-card__features strong {
    display: block;
    font-size: 1rem;
    margin-bottom: 2px;
    color: #fff;
}
.mode-card__features li > div > span {
    display: block;
    font-size: 0.92rem;
    line-height: 1.45;
    color: rgba(244, 241, 234, 0.78);
}
.mode-card__path {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.95rem;
    line-height: 1.5;
    color: rgba(244, 241, 234, 0.82);
}
.mode-card--anarchy .mode-card__path strong {
    color: #f0c14b;
}
.mode-card--vanilla .mode-card__path strong {
    color: #86efac;
}
.mode-card--monopoly .mode-card__path strong {
    background: linear-gradient(90deg, #34d399, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@media (max-width: 760px) {
    .modes-section { padding: 48px 16px 28px; }
    .mode-card__inner { padding: 22px 18px 24px; }
    .mode-card__head {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 8px;
    }
    .mode-card__ver,
    .mode-card__online {
        justify-self: center;
        text-align: center;
    }
}

/* ===== GunGame | KitPvP | Monopoly hover panel ===== */
.mode-duo {
    --duo-ease: cubic-bezier(0.22, 0.8, 0.22, 1);
    --duo-time: 0.65s;
    container-type: inline-size;
    display: flex;
    align-items: stretch;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(10, 10, 20, 0.85);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
    isolation: isolate;
    min-height: 300px;
}
.mode-duo__panel {
    --accent-a: #e8b04f;
    --accent-b: #f06114;
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    cursor: default;
    outline: none;
    background:
        linear-gradient(160deg, rgba(26, 18, 14, 0.92), rgba(12, 10, 18, 0.94));
    transition:
        flex-grow var(--duo-time) var(--duo-ease),
        background-color var(--duo-time) var(--duo-ease);
}
.mode-duo__panel--kitpvp {
    --accent-a: #60a5fa;
    --accent-b: #f472b6;
    background:
        linear-gradient(200deg, rgba(14, 18, 34, 0.92), rgba(24, 12, 26, 0.94));
}
.mode-duo__panel--monopoly {
    --accent-a: #34d399;
    --accent-b: #fbbf24;
    background:
        linear-gradient(180deg, rgba(8, 16, 14, 0.88), rgba(10, 12, 20, 0.94));
}
.mode-duo__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    transition: transform var(--duo-time) var(--duo-ease);
}
.mode-duo__veil {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(6, 10, 14, 0.55), rgba(6, 10, 14, 0.82) 55%, rgba(6, 10, 14, 0.92)),
        linear-gradient(90deg, rgba(6, 10, 14, 0.35), transparent 40%, rgba(6, 10, 14, 0.45));
}
/* vertical divider with soft gradient */
.mode-duo__panel + .mode-duo__panel::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    z-index: 3;
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.22) 20%, rgba(255, 255, 255, 0.22) 80%, transparent);
}
.mode-duo__glow {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.55;
    background:
        radial-gradient(ellipse 70% 60% at 50% 0%, color-mix(in srgb, var(--accent-a) 28%, transparent), transparent 70%),
        radial-gradient(ellipse 60% 55% at 50% 110%, color-mix(in srgb, var(--accent-b) 22%, transparent), transparent 72%);
    transition: opacity var(--duo-time) var(--duo-ease), transform var(--duo-time) var(--duo-ease);
}
.mode-duo__inner {
    position: relative;
    z-index: 2;
    padding: 30px 28px;
    display: flex;
    flex-direction: column;
}
.mode-duo__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
}
.mode-duo__badge {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 1.2rem;
    color: var(--accent-a);
    background: color-mix(in srgb, var(--accent-a) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent-a) 30%, transparent);
    transition: transform var(--duo-time) var(--duo-ease), box-shadow var(--duo-time) var(--duo-ease);
}
.mode-duo__title {
    font-family: var(--font-display);
    font-size: clamp(1.55rem, 3vw, 2.1rem);
    font-weight: 800;
    letter-spacing: 0.4px;
    line-height: 1.15;
    background: linear-gradient(120deg, var(--accent-a), #fff1c8 48%, var(--accent-b));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.mode-duo__panel--kitpvp .mode-duo__title {
    background: linear-gradient(120deg, #60a5fa, #f4f1ea 48%, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
}
.mode-duo__online {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(244, 241, 234, 0.7);
}
.mode-duo__online-val {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--green);
    text-shadow: 0 0 18px rgba(79, 183, 108, 0.35);
    font-variant-numeric: tabular-nums;
}

/* description: height via grid rows, fade/slide via opacity+transform */
.mode-duo__more {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows var(--duo-time) var(--duo-ease);
}
.mode-duo__more-clip {
    min-height: 0;
    overflow: hidden;
}
.mode-duo__desc {
    /* fixed to the expanded (~55%) width so text never reflows mid-animation */
    width: calc(55cqw - 58px);
    padding-top: 22px;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.mode-duo__panel--gungame .mode-card__icon {
    color: #f0c14b;
    background: rgba(240, 193, 75, 0.12);
    border-color: rgba(240, 193, 75, 0.22);
}
.mode-duo__panel--gungame .mode-card__path strong { color: #f0c14b; }
.mode-duo__panel--kitpvp .mode-card__icon {
    color: #8ab8fb;
    background: rgba(96, 165, 250, 0.12);
    border-color: rgba(244, 114, 182, 0.24);
}
.mode-duo__panel--kitpvp .mode-card__path strong {
    background: linear-gradient(90deg, #60a5fa, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.mode-duo__panel--monopoly .mode-duo__title {
    background: linear-gradient(120deg, #34d399, #fff7d6 48%, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
}
.mode-duo__panel--monopoly .mode-card__icon {
    color: #6ee7b7;
    background: rgba(52, 211, 153, 0.12);
    border-color: rgba(251, 191, 36, 0.28);
}
.mode-duo__panel--monopoly .mode-card__path strong {
    background: linear-gradient(90deg, #34d399, #fbbf24);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* hover states (desktop only) */
@media (hover: hover) and (min-width: 761px) {
    .mode-duo[data-active] .mode-duo__panel { flex-grow: 2; }
    .mode-duo[data-active="gungame"] .mode-duo__panel--gungame,
    .mode-duo[data-active="kitpvp"] .mode-duo__panel--kitpvp,
    .mode-duo[data-active="monopoly"] .mode-duo__panel--monopoly { flex-grow: 6; }

    .mode-duo[data-active="gungame"] .mode-duo__panel--gungame .mode-duo__more,
    .mode-duo[data-active="kitpvp"] .mode-duo__panel--kitpvp .mode-duo__more,
    .mode-duo[data-active="monopoly"] .mode-duo__panel--monopoly .mode-duo__more { grid-template-rows: 1fr; }

    .mode-duo[data-active="gungame"] .mode-duo__panel--gungame .mode-duo__desc,
    .mode-duo[data-active="kitpvp"] .mode-duo__panel--kitpvp .mode-duo__desc,
    .mode-duo[data-active="monopoly"] .mode-duo__panel--monopoly .mode-duo__desc {
        opacity: 1;
        transform: translateY(0);
        transition: opacity 0.45s ease 0.22s, transform 0.55s var(--duo-ease) 0.18s;
    }

    .mode-duo[data-active="gungame"] .mode-duo__panel--gungame .mode-duo__glow,
    .mode-duo[data-active="kitpvp"] .mode-duo__panel--kitpvp .mode-duo__glow,
    .mode-duo[data-active="monopoly"] .mode-duo__panel--monopoly .mode-duo__glow { opacity: 1; transform: scale(1.06); }
    .mode-duo[data-active="gungame"] .mode-duo__panel:not(.mode-duo__panel--gungame) .mode-duo__glow,
    .mode-duo[data-active="kitpvp"] .mode-duo__panel:not(.mode-duo__panel--kitpvp) .mode-duo__glow,
    .mode-duo[data-active="monopoly"] .mode-duo__panel:not(.mode-duo__panel--monopoly) .mode-duo__glow { opacity: 0.28; }

    .mode-duo[data-active="monopoly"] .mode-duo__panel--monopoly .mode-duo__bg { transform: scale(1.08); }

    .mode-duo[data-active="gungame"] .mode-duo__panel--gungame .mode-duo__badge,
    .mode-duo[data-active="kitpvp"] .mode-duo__panel--kitpvp .mode-duo__badge,
    .mode-duo[data-active="monopoly"] .mode-duo__panel--monopoly .mode-duo__badge {
        transform: translateY(-2px) scale(1.06);
        box-shadow: 0 0 28px color-mix(in srgb, var(--accent-a) 40%, transparent);
    }
}

/* touch / narrow: stacked, everything visible, no hover expand */
@media (max-width: 760px), (hover: none) {
    .mode-duo { flex-direction: column; min-height: 0; container-type: normal; }
    .mode-duo__panel { flex: 1 1 auto; }
    .mode-duo__panel + .mode-duo__panel::before {
        left: 0;
        right: 0;
        top: 0;
        bottom: auto;
        width: auto;
        height: 1px;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22) 20%, rgba(255, 255, 255, 0.22) 80%, transparent);
    }
    .mode-duo__more { grid-template-rows: 1fr; }
    .mode-duo__desc { width: auto; opacity: 1; transform: none; }
}
@media (max-width: 760px) {
    .mode-duo__inner { padding: 24px 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .mode-duo__panel,
    .mode-duo__more,
    .mode-duo__desc,
    .mode-duo__glow,
    .mode-duo__badge { transition-duration: 0.01s !important; transition-delay: 0s !important; }
}

/* ===== ТОПЫ ===== */
.tops-section {
    padding: 90px 32px 70px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.section-kicker {
    display: block;
    text-align: center;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    color: var(--gold);
    letter-spacing: 2px;
    margin-bottom: 16px;
    text-transform: uppercase;
}
.tops-section h2,
.shop-section h2,
.purchases-section h2,
.economy-section h3 {
    font-family: var(--font-display);
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    line-height: 1.2;
}
.tops-section h2 { font-size: clamp(2rem, 4.5vw, 3rem); }
.tops-section .subtitle,
.shop-section .desc,
.economy-section .subtitle,
.purchases-section .subtitle {
    text-align: center;
    color: var(--muted);
    font-size: 16px;
    margin-bottom: 48px;
}
.tops-section .subtitle {
    margin-bottom: 28px;
}
.shop-section .desc {
    margin-bottom: 16px;
}
.tops-layout {
    display: flex;
    flex-direction: column;
    gap: 28px;
    max-width: 1100px;
    margin: 0 auto;
    align-items: stretch;
}
.honorary-card {
    background: var(--bg-card);
    border-radius: 26px;
    padding: 36px 32px 40px;
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    position: relative;
    overflow: hidden;
    scrollbar-width: none;
    -ms-overflow-style: none;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
    min-height: 0;
}
.honorary-card::-webkit-scrollbar { display: none; width: 0; height: 0; }
.honorary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, #FDE68A, #F59E0B, transparent);
    opacity: 1;
}
.honorary-top,
.honorary-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    width: 100%;
}
.honorary-divider { display: none; }
.honorary-header {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.65rem, 3.2vw, 2.15rem);
    letter-spacing: 0.3px;
    line-height: 1.15;
    margin: 0;
    background: linear-gradient(90deg, #FDE68A, #F59E0B);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.honorary-skin-wrap {
    width: 168px;
    min-height: 300px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 4px 0;
    overflow: hidden;
}
.honorary-skin {
    width: 168px;
    height: auto;
    aspect-ratio: 1 / 2;
    object-fit: contain;
    object-position: center top;
    display: block;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    filter: drop-shadow(0 20px 32px rgba(0,0,0,0.5));
    animation: honorarySkinFloat 4.5s ease-in-out infinite;
}
@keyframes honorarySkinFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}
.honorary-skin-fallback,
.honorary-skin-empty {
    width: 120px;
    height: 220px;
    border-radius: 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(253, 230, 138, 0.25);
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 52px;
    color: #8b8799;
}
.honorary-skin-fallback:not([hidden]),
.honorary-skin-empty {
    display: flex;
}
.honorary-skin-empty {
    height: 180px;
    font-size: 36px;
    color: #F59E0B;
}
.honorary-name {
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: 700;
    line-height: 1.4;
    max-width: 100%;
    word-break: break-word;
}
.honorary-name .rank-grad {
    font-weight: 800;
}
.honorary-held {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.honorary-held-label {
    font-size: 13px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
}
.honorary-held-value {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3vw, 1.85rem);
    font-weight: 700;
    background: linear-gradient(90deg, #FF6A00, #FFB347);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.honorary-meta {
    font-size: 14px;
    color: var(--muted);
}
.honorary-loading,
.honorary-empty {
    color: var(--muted);
    font-size: 15px;
    margin: auto 0;
}
.tops-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 1100px;
    margin: 0 auto;
    justify-items: stretch;
    min-width: 0;
    width: 100%;
}
.tops-grid .top-card.top-card-center {
    grid-column: 1 / -1;
    width: min(100%, calc((100% - 24px) / 2));
    justify-self: center;
}
.tops-grid.mode-pair {
    max-width: 900px;
}
.top-card .clan-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(240, 97, 20, 0.18);
    color: var(--gold);
    font-size: 12px;
}
.top-card .clan-name {
    font-weight: 700;
    color: #ffb347;
}
.top-card .clan-tag {
    color: #9a96a8;
    font-weight: 700;
    white-space: nowrap;
}
.top-card .clan-tag-inner .rank-grad {
    font-weight: 800;
}
.top-card {
    background: var(--bg-card);
    border-radius: 22px;
    padding: 26px 22px;
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
    min-width: 0;
    position: relative;
    overflow: visible;
}
.top-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--orange), var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.35s;
}
.top-card:hover {
    border-color: rgba(240, 97, 20, 0.35);
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.35), 0 0 24px rgba(240, 97, 20, 0.12);
}
.top-card:hover::before { opacity: 1; }
.top-card .top-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.2px;
    line-height: 1.3;
    color: #f4f1ea;
}
.top-card .top-header .icon { display: none; }
.top-card .top-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.top-card .top-list li {
    display: flex;
    align-items: center;
    padding: 11px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 15px;
    gap: 10px;
    flex-wrap: nowrap;
    min-width: 0;
    border-radius: 10px;
    transition: background 0.25s;
}
.top-card .top-list li:hover { background: rgba(255,255,255,0.03); }
.top-card .top-list li:last-child { border-bottom: none; }
.top-card .top-list .position {
    color: #666;
    font-family: var(--font-body);
    font-weight: 700;
    min-width: 38px;
    font-size: 14px;
    flex-shrink: 0;
}
.top-card .top-list .pos-1 { color: #ffd700; text-shadow: 0 0 10px rgba(255,215,0,0.35); }
.top-card .top-list .pos-2 { color: #c0c0c0; }
.top-card .top-list .pos-3 { color: #cd7f32; }
.top-card .top-list .player-avatar {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #fff;
    background: #c6c6c6;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.top-card .top-list .player-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.top-card .top-list .separator {
    display: none;
}
.top-card .top-list .player-name {
    flex: 1 1 auto;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.4;
    white-space: normal;
    overflow: visible;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-width: 0;
}
.top-card .top-list .player-name .rank-grad {
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}
.tops-grid.mode-kitpvp .top-card.top-card-center {
    grid-column: auto;
    width: 100%;
    justify-self: stretch;
}
.tops-grid .top-card.is-hidden { display: none; }
.top-card .top-list .player-name .rank-prefix { font-weight: 700; }
.top-card .top-list .player-name .player-suffix { font-weight: 400; }
.top-card .top-list .value {
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 14px;
    min-width: 72px;
    text-align: right;
    flex-shrink: 0;
    white-space: nowrap;
}
.top-card .top-list .value.coins { color: #f5b342; }
.top-card .top-list .value.pix { color: #b388ff; }
.top-card .top-list .value.playtime { color: #4fb76c; }
.top-card .top-list .value.kills { color: #f87171; }
.top-card .top-list .value.deaths { color: #94a3b8; }
.top-card .top-list .value.tokens { color: #22d3ee; }
.top-card .top-list .value.elo { color: #fb923c; }
.top-card .top-list .value.ancoins { color: #67e8f9; }
.top-card .top-loading,
.top-card .top-empty {
    text-align: center;
    color: #555;
    padding: 30px 0;
    font-size: 15px;
}
.top-update-time {
    text-align: center;
    color: #4a4758;
    font-size: 12px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

/* Переключатель режимов статистики */
.stats-mode-switch {
    display: flex;
    width: fit-content;
    position: relative;
    gap: 4px;
    padding: 6px;
    margin: -18px auto 36px;
    background: rgba(12, 12, 22, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}
.stats-mode-switch .mode-btn {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: #8b8798;
    font-family: inherit;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 22px;
    border-radius: 12px;
    cursor: pointer;
    transition: color 0.35s ease, transform 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.stats-mode-switch .mode-btn i { font-size: 13px; opacity: 0.85; }
.stats-mode-switch .mode-btn:hover { color: #d4d0e0; }
.stats-mode-switch .mode-btn.active { color: #fff; }
.stats-mode-switch .mode-glider {
    position: absolute;
    top: 6px;
    left: 6px;
    height: calc(100% - 12px);
    width: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.35), rgba(255, 179, 71, 0.22));
    border: 1px solid rgba(255, 140, 40, 0.35);
    box-shadow: 0 0 24px rgba(255, 120, 20, 0.25);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
@media (max-width: 640px) {
    .stats-mode-switch {
        max-width: calc(100% - 24px);
        overflow-x: auto;
        scrollbar-width: none;
    }
    .stats-mode-switch::-webkit-scrollbar { display: none; }
    .stats-mode-switch .mode-btn { padding: 10px 14px; font-size: 13px; white-space: nowrap; }
}

/* Плашка сезона (топы Anarchy) */
.season-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: fit-content;
    max-width: calc(100% - 24px);
    margin: -14px auto 32px;
    padding: 12px 22px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(255, 59, 59, 0.16), rgba(255, 159, 28, 0.12));
    border: 1px solid rgba(255, 110, 40, 0.35);
    box-shadow: 0 0 28px rgba(255, 80, 30, 0.18);
    color: #f1ede8;
    font-size: 14px;
    line-height: 1.45;
    text-align: center;
}
.season-banner i { color: #ff9f1c; font-size: 16px; }
.season-banner b {
    background: linear-gradient(90deg, #FF3B3B, #FF9F1C);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.season-banner.is-hidden { display: none; }

.tops-grid.is-switching {
    animation: topsSwap 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes topsSwap {
    0% { opacity: 0; transform: translateY(14px) scale(0.98); filter: blur(4px); }
    100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.rank-name-default { color: #888; }
.rank-name-vip { color: #4ADE80; }
.rank-name-vip_plus { color: #2DD4BF; }
.rank-name-mvp { color: #38BDF8; }
.rank-name-mvp_plus { color: #A855F7; }
.rank-name-mvp_plus_plus { color: #FBBF24; }
.rank-name-helper { color: #22C55E; }
.rank-name-builder { color: #F59E0B; }
.rank-name-media { color: #EC4899; }
.rank-name-moder { color: #3B82F6; }
.rank-name-st_moder { color: #FF8C00; }
.rank-name-admin { color: #FF1E1E; }
.rank-name-dev { color: #00F5FF; }

/* ===== МАГАЗИН ===== */
.shop-section {
    padding: 70px 32px 120px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.shop-section h2 { font-size: clamp(2.4rem, 5vw, 3.4rem); }
.shop-mode-bar {
    display: inline-flex;
    position: relative;
    gap: 4px;
    padding: 5px;
    margin: 8px auto 20px;
    background: rgba(8, 8, 18, 0.85);
    border: 1px solid var(--border);
    border-radius: 16px;
    left: 50%;
    transform: translateX(-50%);
}
.shop-mode-bar--sub { margin-top: 0; margin-bottom: 28px; }
.shop-mode-bar .mode-glider {
    position: absolute;
    top: 5px;
    left: 5px;
    height: calc(100% - 10px);
    width: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 106, 0, 0.38), rgba(255, 179, 71, 0.2));
    border: 1px solid rgba(255, 140, 40, 0.35);
    box-shadow: 0 0 20px rgba(255, 120, 20, 0.22);
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.shop-mode-bar .mode-btn {
    position: relative;
    z-index: 1;
    border: none;
    background: transparent;
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 14px;
    padding: 11px 18px;
    border-radius: 12px;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}
.shop-mode-bar .mode-btn.active { color: #fff; }
.shop-mode-bar .mode-btn:hover { color: #e8e4f0; }
.shop-pane { display: none; }
.shop-pane.active {
    display: block;
    animation: shopPaneIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.shop-subpane { display: none; }
.shop-subpane.active {
    display: block;
    animation: shopPaneIn 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes shopPaneIn {
    from { opacity: 0; transform: translateY(12px) scale(0.98); filter: blur(3px); }
    to { opacity: 1; transform: none; filter: none; }
}
.rank-features li.rank-plus .label {
    color: var(--orange);
    font-weight: 700;
}

/* ===== Модалка возможностей ранга ===== */
.rank-features-modal {
    width: min(920px, 96vw);
    max-width: 920px;
    padding: 0;
    overflow: hidden;
}
.rank-features-modal .modal-close {
    z-index: 5;
}
.rf-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    min-height: 420px;
    max-height: min(78vh, 640px);
}
.rf-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 28px 16px 22px;
    background:
        linear-gradient(180deg, rgba(240, 97, 20, 0.12), transparent 40%),
        rgba(10, 8, 14, 0.92);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.rf-rank-badge {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 8px 14px;
    letter-spacing: 0.4px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    background-image: linear-gradient(135deg, #ffb347, #f06114);
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.35));
}
/* rank color on badge via .rank-X .rf-rank-badge */
.rf-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(244, 241, 234, 0.72);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    cursor: pointer;
    transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}
.rf-nav-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    flex-shrink: 0;
    transition: background 0.25s, box-shadow 0.25s, transform 0.25s;
}
.rf-nav:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}
.rf-nav.active {
    background: rgba(240, 97, 20, 0.16);
    border-color: rgba(240, 97, 20, 0.4);
    color: #ffc46b;
}
.rf-nav.active .rf-nav-dot {
    background: #f06114;
    box-shadow: 0 0 12px rgba(240, 97, 20, 0.65);
    transform: scale(1.15);
}
.rf-main {
    padding: 28px 28px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.rank-features-modal .modal-title {
    font-size: 28px;
    margin-bottom: 4px;
}
.rank-features-modal .modal-subtitle {
    margin-bottom: 18px;
}
.rf-panel-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}
.rank-features.rf-panel {
    list-style: none;
    padding: 0 6px 8px 0;
    margin: 0;
    position: absolute;
    inset: 0;
    overflow: auto;
    text-align: left;
    scrollbar-width: thin;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(18px);
}
.rank-features.rf-panel.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: none;
    position: relative;
}
.rank-features.rf-panel.rf-enter {
    animation: rfPanelIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.rank-features.rf-panel.rf-leave {
    animation: rfPanelOut 0.28s ease both;
    position: absolute;
}
@keyframes rfPanelIn {
    from { opacity: 0; transform: translateX(22px) scale(0.985); filter: blur(2px); }
    to { opacity: 1; transform: none; filter: none; }
}
@keyframes rfPanelOut {
    from { opacity: 1; transform: none; filter: none; }
    to { opacity: 0; transform: translateX(-16px) scale(0.99); filter: blur(2px); }
}
.rank-features li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 14px;
    color: #c9c2b6;
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
    line-height: 1.4;
}
.rank-features li:last-child { border-bottom: none; }
.rank-features .label { color: #fff4e8; }
.rank-features .value { color: #ffc46b; font-weight: 700; }
.rank-features .cmd {
    color: #ff8a2b;
    font-weight: 700;
    font-family: ui-monospace, 'Cascadia Code', monospace;
    font-size: 12px;
    background: rgba(240, 97, 20, 0.14);
    padding: 2px 7px;
    border-radius: 5px;
}
.rank-features .gray { color: #888; }
.rank-features .value.rank-grad {
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    font-weight: 800;
}
.services-grid {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
}
.service-card .icon {
    font-size: 42px;
    line-height: 1;
    margin-bottom: 12px;
}
.service-card .rank-price span {
    color: var(--gold);
    font-family: var(--font-display);
    font-weight: 400;
    font-size: 22px;
}

.ranks-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
    margin: 0 auto 48px;
    max-width: 1080px;
    align-items: stretch;
}

/* Shop cards: Parallax Ticket (see parallax-ticket.css). Legacy flip markup upgraded by JS. */
.flip-card {
    background-color: transparent;
    width: calc((100% - 40px) / 3);
    max-width: 340px;
    min-width: 240px;
    flex: 0 0 calc((100% - 40px) / 3);
    height: 360px;
    perspective: 900px;
    font-family: var(--font-body);
    cursor: pointer;
}
/* Legacy pre-upgrade shell (brief FOUC) — no hover flip (breaks purchase buttons) */
.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transform-style: preserve-3d;
}
.flip-card-front,
.flip-card-back {
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.4);
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border: 1px solid rgba(255, 138, 43, 0.45);
    border-radius: 1.15rem;
    overflow: hidden;
    padding: 22px 18px;
}
.flip-card-front {
    background: rgba(12, 8, 6, 0.55);
    color: #ffb347;
    z-index: 2;
}
.flip-card-front::before,
.flip-card-back::before {
    content: '';
    position: absolute;
    inset: -12px;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    z-index: 0;
    opacity: 0.95;
    filter: blur(7px);
    transform: scale(1.06);
}
.flip-card-front::after,
.flip-card-back::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 5, 4, 0.35) 0%, rgba(8, 5, 4, 0.62) 45%, rgba(8, 5, 4, 0.9) 100%),
        linear-gradient(120deg, rgba(255, 138, 43, 0.16), transparent 55%);
    z-index: 1;
}
.flip-card-front > *,
.flip-card-back > * { position: relative; z-index: 2; }
.flip-card-back {
    background: rgba(18, 10, 8, 0.72);
    color: #fff;
    transform: rotateY(180deg);
    justify-content: center;
    padding: 20px 16px;
    gap: 10px;
    z-index: 1;
    pointer-events: none;
}
.rank-haunt.flip-card .flip-card-front::before,
.rank-haunt.flip-card .flip-card-back::before { background-image: url('/img/ranks/haunt.jpg'); }
.rank-silence.flip-card .flip-card-front::before,
.rank-silence.flip-card .flip-card-back::before { background-image: url('/img/ranks/silence.jpg'); }
.rank-imperium.flip-card .flip-card-front::before,
.rank-imperium.flip-card .flip-card-back::before { background-image: url('/img/ranks/imperium.jpg'); }
.rank-genesis.flip-card .flip-card-front::before,
.rank-genesis.flip-card .flip-card-back::before { background-image: url('/img/ranks/genesis.jpg'); }
.rank-devour.flip-card .flip-card-front::before,
.rank-devour.flip-card .flip-card-back::before { background-image: url('/img/ranks/devour.jpg'); }
.rank-ancient.flip-card .flip-card-front::before,
.rank-ancient.flip-card .flip-card-back::before { background-image: url('/img/ranks/ancient.jpg'); }
.rank-eclipse.flip-card .flip-card-front::before,
.rank-eclipse.flip-card .flip-card-back::before { background-image: url('/img/ranks/eclipse.jpg'); }
.rank-infinity.flip-card .flip-card-front::before,
.rank-infinity.flip-card .flip-card-back::before { background-image: url('/img/ranks/infinity.jpg'); }
.rank-custom.flip-card .flip-card-front::before,
.rank-custom.flip-card .flip-card-back::before { background-image: url('/img/ranks/custom.jpg'); }

.case-ordinary.flip-card .flip-card-front::before,
.case-ordinary.flip-card .flip-card-back::before { background-image: url('/img/cases/ordinary.jpg'); }
.case-dark.flip-card .flip-card-front::before,
.case-dark.flip-card .flip-card-back::before { background-image: url('/img/cases/dark.jpg'); }
.case-items.flip-card .flip-card-front::before,
.case-items.flip-card .flip-card-back::before,
.case-pix.flip-card .flip-card-front::before,
.case-pix.flip-card .flip-card-back::before { background-image: url('/img/cases/pix.jpg'); }
.case-kits.flip-card .flip-card-front::before,
.case-kits.flip-card .flip-card-back::before { background-image: url('/img/cases/kits.png'); }
.case-titles.flip-card .flip-card-front::before,
.case-titles.flip-card .flip-card-back::before { background-image: url('/img/cases/titles.jpg'); }

.flip-card .rank-name {
    font-family: var(--font-logo);
    font-size: clamp(1.05rem, 2.1vw, 1.45rem);
    font-weight: 400;
    margin: 0 0 14px;
    line-height: 1.45;
    letter-spacing: 0.5px;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    filter: drop-shadow(0 2px 10px rgba(0,0,0,0.75));
}
.flip-card .rank-price {
    font-size: 18px;
    color: #f0ebe3;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
    font-weight: 600;
}
.flip-card .rank-price span {
    color: #ffc46b;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 36px;
    letter-spacing: 0.3px;
}
.flip-card .rank-card-actions {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-top: auto;
    flex-shrink: 0;
}
.flip-card .rank-card-actions--stack {
    flex-direction: column;
    margin: 0;
    gap: 10px;
    padding: 0 4px;
    width: 100%;
    max-width: 260px;
}
.economy-card .buy-btn {
    padding: 9px 8px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #b6743e, #f06114);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s, box-shadow 0.2s, border-color 0.2s, background 0.2s;
    width: 100%;
    box-shadow: 0 6px 16px rgba(240, 97, 20, 0.28);
    position: relative;
    overflow: hidden;
}
.economy-card .buy-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,0.28) 50%, transparent 65%);
    transform: translateX(-130%);
    transition: transform 0.55s;
}
.economy-card .buy-btn:hover {
    opacity: 0.95;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(240, 97, 20, 0.4);
}
.economy-card .buy-btn:hover::before { transform: translateX(130%); }
.economy-card .buy-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.rank-haunt .rank-name,
.rank-haunt .rf-rank-badge { background-image: linear-gradient(135deg, #A5A5A5, #DBDBDB); }
.rank-silence .rank-name,
.rank-silence .rf-rank-badge { background-image: linear-gradient(135deg, #00CBFF, #00FCE7); }
.rank-imperium .rank-name,
.rank-imperium .rf-rank-badge { background-image: linear-gradient(135deg, #00FC1B, #A7FF5C); }
.rank-genesis .rank-name,
.rank-genesis .rf-rank-badge { background-image: linear-gradient(135deg, #B100FC, #FF00EE); }
.rank-devour .rank-name,
.rank-devour .rf-rank-badge { background-image: linear-gradient(135deg, #FF5D00, #FFA500); }
.rank-ancient .rank-name,
.rank-ancient .rf-rank-badge { background-image: linear-gradient(135deg, #0059FC, #5C9CFF); }
.rank-eclipse .rank-name,
.rank-eclipse .rf-rank-badge { background-image: linear-gradient(135deg, #8000FF, #B300FF); }
.rank-infinity .rank-name,
.rank-infinity .rf-rank-badge { background-image: linear-gradient(135deg, #F1FF00, #FFFDAF); }
.rank-custom .rank-name,
.rank-custom .rf-rank-badge { background-image: linear-gradient(135deg, #FF6A00, #FFB347); }

/* Case cards: name above price must be readable (gradient text clip needs background-image) */
.case-ordinary .rank-name { background-image: linear-gradient(135deg, #FF6A00, #FFB347); }
.case-dark .rank-name { background-image: linear-gradient(135deg, #A78BFA, #E9D5FF); }
.case-items .rank-name,
.case-pix .rank-name { background-image: linear-gradient(135deg, #A855F7, #E879F9); }
.case-kits .rank-name { background-image: linear-gradient(135deg, #22D3EE, #A5F3FC); }
.case-titles .rank-name { background-image: linear-gradient(135deg, #F472B6, #C084FC); }
.flip-card[data-case] .rank-name {
    margin: 0 0 10px;
    text-align: center;
    max-width: 92%;
    font-size: clamp(0.95rem, 1.9vw, 1.28rem);
    line-height: 1.25;
}
.flip-card[data-case] .flip-card-front {
    justify-content: center;
    align-items: center;
    gap: 6px;
}
.flip-card[data-case] .rank-price {
    text-align: center;
}

.rank-haunt .value.rank-grad { background-image: linear-gradient(90deg, #A5A5A5, #DBDBDB); }
.rank-silence .value.rank-grad { background-image: linear-gradient(90deg, #00CBFF, #00FCE7); }
.rank-imperium .value.rank-grad { background-image: linear-gradient(90deg, #00FC1B, #A7FF5C); }
.rank-genesis .value.rank-grad { background-image: linear-gradient(90deg, #B100FC, #FF00EE); }
.rank-devour .value.rank-grad { background-image: linear-gradient(90deg, #FF5D00, #FFA500); }
.rank-ancient .value.rank-grad { background-image: linear-gradient(90deg, #0059FC, #5C9CFF); }
.rank-eclipse .value.rank-grad { background-image: linear-gradient(90deg, #8000FF, #B300FF); }
.rank-infinity .value.rank-grad { background-image: linear-gradient(90deg, #F1FF00, #FFFDAF); }
.rank-custom .value.rank-grad { background-image: linear-gradient(90deg, #FF6A00, #FFB347); }

/* ===== ЭКОНОМИКА ===== */
.economy-section {
    margin-top: 0;
    padding-top: 8px;
    border-top: none;
}
.economy-section h3 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.economy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}
.economy-card {
    background: var(--bg-card);
    border-radius: 22px;
    padding: 32px 26px;
    border: 1px solid var(--border);
    backdrop-filter: blur(14px);
    transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.economy-card:hover {
    border-color: rgba(240, 97, 20, 0.35);
    transform: translateY(-6px);
    box-shadow: 0 18px 44px rgba(0,0,0,0.35);
}
.economy-card .name {
    font-family: var(--font-display);
    font-size: 34px;
    font-weight: 400;
    letter-spacing: 1px;
    line-height: 1.15;
    margin-bottom: 6px;
}
.economy-card .rate { font-size: 15px; color: var(--muted); margin-bottom: 4px; }
.economy-card .rate span { color: var(--gold); font-weight: 700; }
.economy-card .input-group {
    width: 100%;
    margin: 16px 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.economy-card .input-group .input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}
.economy-card .input-group input {
    width: 100%;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    background: transparent;
    border: 0;
    border-bottom: 2px solid rgba(255, 255, 255, 0.35);
    border-radius: 0;
    color: #fff;
    padding: 12px 0 10px;
    font-family: var(--font-body);
    box-shadow: none;
    -moz-appearance: textfield;
    appearance: textfield;
}
.economy-card .input-group input:focus {
    outline: 0;
    border-bottom-color: #ffb347;
}
.economy-card .input-group input::-webkit-outer-spin-button,
.economy-card .input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.economy-card .input-group .amount-hint { font-size: 12px; color: #555; text-align: center; }
.economy-card .buy-btn {
    min-height: 54px;
    padding: 16px 22px;
    font-size: 16px;
    border-radius: 14px;
}
.economy-coins .name { color: #f5b342; }
.economy-pix .name { color: #b388ff; }

/* ===== ПОСЛЕДНИЕ ПОКУПКИ ===== */
.purchases-section {
    margin-top: 60px;
    padding-top: 48px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.purchases-section h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); }
.purchases-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    max-width: 1300px;
    margin: 0 auto;
}
.purchase-card {
    background: var(--bg-card);
    border-radius: 18px;
    padding: 20px 16px;
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform 0.35s, border-color 0.35s, box-shadow 0.35s;
    min-height: 170px;
    justify-content: center;
}
.purchase-card:hover {
    border-color: rgba(240, 97, 20, 0.35);
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.35);
}
.purchase-card .purchase-avatar {
    width: 52px;
    height: 52px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    flex-shrink: 0;
    color: #fff;
    margin-bottom: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
    overflow: hidden;
    background: #c6c6c6;
    border: 1px solid rgba(255, 255, 255, 0.12);
}
.purchase-card .purchase-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.purchase-card .purchase-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    margin-bottom: 6px;
}
.purchase-card .purchase-action {
    font-size: 13px;
    color: #8b8799;
    line-height: 1.5;
}
.purchase-card .purchase-action .highlight { font-weight: 700; }
.purchase-card .purchase-action .highlight-rank { color: #fc54fc; }
.purchase-card .purchase-action .highlight-coins { color: #f5b342; }
.purchase-card .purchase-action .highlight-pix { color: #b388ff; }
.purchase-card .purchase-time {
    font-size: 11px;
    color: #4a4758;
    margin-top: 8px;
}

/* ===== СТРАНИЦА ПРОФИЛЯ ===== */
.profile-page {
    display: none;
    min-height: 100vh;
    padding: 80px 32px;
    max-width: 800px;
    margin: 0 auto;
}
.profile-page.active { display: block; animation: fadeIn 0.35s ease; }

.profile-page .back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 22px;
    background: rgba(18, 18, 32, 0.75);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: #9a96a8;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    font-family: var(--font-body);
    margin-bottom: 28px;
    backdrop-filter: blur(12px);
}
.profile-page .back-btn:hover {
    background: rgba(30, 24, 40, 0.92);
    color: #fff;
    border-color: var(--border-strong);
}

.profile-card {
    background: var(--bg-card);
    border-radius: 28px;
    padding: 42px 44px;
    border: 1px solid var(--border);
    backdrop-filter: blur(18px);
    box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 40px rgba(240, 97, 20, 0.08);
}

.profile-page .profile-header {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 28px;
}
.profile-page .profile-avatar {
    width: 96px;
    height: 96px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 42px;
    font-weight: 800;
    flex-shrink: 0;
    color: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
    overflow: hidden;
}
.profile-page .profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}
.profile-page .profile-name-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.profile-page .profile-name {
    font-family: var(--font-body);
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.3px;
    line-height: 1.35;
}
.profile-page .profile-rank-badge {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.3px;
    padding: 8px 16px;
    border-radius: 100px;
    display: inline-block;
    width: fit-content;
}
.profile-page .profile-status { font-size: 15px; font-weight: 600; }
.profile-page .profile-status .online { color: var(--green); }
.profile-page .profile-status .offline { color: #ff6b6b; }
.profile-page .profile-status .last-seen { color: #666; font-weight: 400; }

.profile-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 22px 0 26px;
}

.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 24px;
}
.profile-grid .item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 15px;
}
.profile-grid .item .label { color: #777; }
.profile-grid .item .value { font-weight: 700; }
.profile-grid .item .value.gradient {
    background: linear-gradient(135deg, #b6743e, #f06114);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.profile-balance {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 22px 0 26px;
}
.profile-balance .card {
    background: rgba(8, 8, 18, 0.85);
    padding: 20px 22px;
    border-radius: 16px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s, transform 0.3s;
}
.profile-balance .card:hover {
    transform: translateY(-2px);
    border-color: rgba(240, 97, 20, 0.3);
}
.profile-balance .card .left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-balance .card .currency { font-size: 13px; color: #777; font-weight: 600; }
.profile-balance .card .amount {
    font-family: var(--font-display);
    font-size: 26px;
    font-weight: 400;
}
.profile-balance .card.coins .amount { color: #f5b342; }
.profile-balance .card.pix .amount { color: #b388ff; }

.profile-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}
.profile-actions button {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 800;
    cursor: pointer;
    transition: 0.3s;
    font-family: var(--font-body);
}
.profile-actions .btn-shop {
    background: linear-gradient(135deg, #b6743e, #f06114);
    color: #fff;
    box-shadow: 0 8px 24px rgba(240, 97, 20, 0.28);
}
.profile-actions .btn-shop:hover { opacity: 0.9; transform: translateY(-2px); }
.profile-actions .btn-logout {
    background: transparent;
    border: 1px solid rgba(255, 68, 68, 0.3);
    color: #ff6b6b;
}
.profile-actions .btn-logout:hover {
    background: rgba(255, 68, 68, 0.1);
}

/* ===== TOAST ===== */
.toast {
    position: fixed;
    bottom: 36px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    padding: 16px 32px;
    border-radius: 16px;
    background: rgba(22, 22, 42, 0.92);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    font-size: 15px;
    z-index: 3000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 48px rgba(0,0,0,0.45);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { border-color: rgba(79, 183, 108, 0.45); box-shadow: 0 16px 48px rgba(0,0,0,0.45), 0 0 24px rgba(79,183,108,0.15); }
.toast.error { border-color: rgba(255, 68, 68, 0.45); box-shadow: 0 16px 48px rgba(0,0,0,0.45), 0 0 24px rgba(255,68,68,0.12); }

.promo-buy-modal {
    max-width: 860px;
    width: min(860px, 96vw);
    padding: 0;
    overflow: hidden;
}
.promo-buy-modal .modal-close { z-index: 6; }
/* Экономика / услуги — только промо + чек + купить */
.promo-buy-modal--simple {
    max-width: 420px;
    width: min(420px, 96vw);
}
.promo-buy-modal--simple .pb-layout {
    grid-template-columns: 1fr;
    min-height: 0;
    max-height: none;
}
.promo-buy-modal--simple .pb-left {
    display: none;
}
/* Подарок кейса/услуги: показать левую колонку только ради ника получателя */
.promo-buy-modal--simple.promo-buy-modal--gift {
    max-width: 640px;
    width: min(640px, 96vw);
}
.promo-buy-modal--simple.promo-buy-modal--gift .pb-layout {
    grid-template-columns: 1fr 1fr;
}
.promo-buy-modal--simple.promo-buy-modal--gift .pb-left {
    display: block;
}
.promo-buy-modal--simple.promo-buy-modal--gift .pb-left .rank-duration-slider,
.promo-buy-modal--simple.promo-buy-modal--gift .pb-left #rankDurationTitle,
.promo-buy-modal--simple.promo-buy-modal--gift .pb-left #rankDurationHint,
.promo-buy-modal--simple.promo-buy-modal--gift .pb-left #rankUpgradeRow {
    display: none !important;
}
.promo-buy-modal--simple .pb-right {
    padding: 28px 22px 22px;
}
.promo-buy-modal--simple .pb-right > .promo-block-sub {
    display: none;
}
.pb-layout {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    min-height: 420px;
    max-height: min(82vh, 640px);
}
.pb-left {
    padding: 28px 22px 22px;
    border-right: 1px solid rgba(255,255,255,0.06);
    background:
        linear-gradient(180deg, rgba(240, 97, 20, 0.1), transparent 42%),
        rgba(10, 8, 14, 0.55);
    overflow: auto;
}
.pb-right {
    padding: 28px 22px 22px;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: auto;
}
.promo-buy-modal .modal-title {
    font-size: 26px;
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}
.promo-buy-modal .modal-subtitle {
    font-size: 13px;
    margin-bottom: 18px;
}
.promo-buy-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}
.rank-duration-slider {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 0 0 16px;
}
.rank-duration-slider.forever-only {
    grid-template-columns: 1fr;
}
.pb-receipt {
    margin-top: 4px;
    padding: 16px 16px 14px;
    border-radius: 12px;
    background:
        repeating-linear-gradient(
            0deg,
            rgba(18, 14, 22, 0.98),
            rgba(18, 14, 22, 0.98) 18px,
            rgba(24, 18, 28, 0.98) 18px,
            rgba(24, 18, 28, 0.98) 19px
        );
    color: #e8e0d4;
    font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
    border: 1px solid rgba(255, 179, 71, 0.22);
    box-shadow: 0 12px 28px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
    position: relative;
}
.pb-receipt::before,
.pb-receipt::after {
    content: '';
    position: absolute;
    left: 10px;
    right: 10px;
    height: 8px;
    background:
        radial-gradient(circle at 6px 0, transparent 5px, rgba(18, 14, 22, 0.98) 6px) repeat-x;
    background-size: 12px 8px;
}
.pb-receipt::before { top: -4px; transform: rotate(180deg); }
.pb-receipt::after { bottom: -4px; }
.pb-receipt-top {
    text-align: center;
    font-weight: 800;
    letter-spacing: 0.18em;
    font-size: 12px;
    margin-bottom: 12px;
    color: #ffb347;
}
.pb-receipt-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    margin: 6px 0;
    color: rgba(232, 224, 212, 0.78);
}
.pb-receipt-line span:last-child {
    font-weight: 700;
    text-align: right;
    word-break: break-word;
    color: #fff4e8;
}
.pb-receipt-dash {
    border-top: 1px dashed rgba(255, 179, 71, 0.28);
    margin: 10px 0;
}
.pb-receipt-total {
    display: flex;
    justify-content: space-between;
    font-size: 15px;
    font-weight: 800;
    color: #ffc46b;
}
.pb-receipt-note {
    margin-top: 8px;
    font-size: 11px;
    color: #ff8a6b;
    min-height: 1.2em;
}
.rank-duration-opt {
    appearance: none;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.03);
    border-radius: 14px;
    padding: 14px 10px;
    color: #cfcfcf;
    cursor: pointer;
    transition: border-color .2s, background .2s, transform .15s, box-shadow .2s;
    text-align: center;
}
.rank-duration-opt:hover {
    border-color: rgba(255,106,0,0.45);
    transform: translateY(-1px);
}
.rank-duration-opt.active {
    border-color: rgba(255,106,0,0.75);
    background: linear-gradient(180deg, rgba(255,106,0,0.18), rgba(255,179,71,0.08));
    box-shadow: 0 10px 28px rgba(255,106,0,0.12);
    color: #fff;
}
.rank-duration-opt .dur-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
}
.rank-duration-opt .dur-price {
    display: block;
    font-size: 18px;
    font-weight: 800;
    color: #ffb347;
}
.promo-buy-modal .promo-block-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 6px;
}
.promo-buy-modal .promo-block-sub {
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 14px;
}
.gift-block { margin: 0 0 22px; position: relative; }
.gift-block[hidden] { display: none !important; }
.gift-suggest {
    position: absolute;
    left: 0; right: 0;
    top: calc(100% - 4px);
    z-index: 40;
    background: rgba(18, 18, 22, 0.98);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.45);
    max-height: 220px;
    overflow-y: auto;
    display: none;
}
.gift-suggest.open { display: block; }
.gift-suggest-item {
    display: block;
    width: 100%;
    text-align: left;
    appearance: none;
    border: 0;
    background: transparent;
    color: #fff;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
}
.gift-suggest-item:hover,
.gift-suggest-item.active {
    background: rgba(255,106,0,0.14);
}
.rank-upgrade-row {
    margin: -10px 0 22px;
    display: none;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.rank-upgrade-row.visible { display: flex; }
.rank-upgrade-btn {
    appearance: none;
    border: 1px solid rgba(255,106,0,0.45);
    background: linear-gradient(180deg, rgba(255,106,0,0.16), rgba(255,179,71,0.06));
    color: #ffb347;
    border-radius: 12px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    cursor: default;
}
.rank-upgrade-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.35;
}
.eco-icon-coins, .eco-icon-pix, .eco-icon-anarchy {
    font-family: var(--font-display);
    font-weight: 800;
    letter-spacing: 0.5px;
}
.economy-card.economy-anarchy .icon {
    background: linear-gradient(135deg, #22D3EE, #A5F3FC);
    color: #062028;
}

/* ===== АДАПТИВ ===== */
@media (max-width: 1200px) {
    .purchases-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 14px;
        max-width: 100%;
    }
}
@media (max-width: 992px) {
    .purchases-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 14px;
    }
    .purchase-card {
        min-height: 150px;
        padding: 18px 14px;
    }
    .tops-section,
    .shop-section,
    .purchases-section {
        padding-left: 24px;
        padding-right: 24px;
    }
}

@media (max-width: 768px) {
    body { font-size: 16px; }
    .hero {
        min-height: 100svh;
        padding: max(88px, calc(64px + env(safe-area-inset-top))) 16px 48px;
    }
    .hero-title {
        font-size: clamp(1.15rem, 7.2vw, 1.55rem);
        letter-spacing: 1px;
        line-height: 1.45;
        margin-bottom: 16px;
        word-break: break-word;
    }
    .hero-subtitle {
        font-size: 1rem;
        margin-bottom: 28px;
        padding: 0 4px;
        line-height: 1.45;
    }
    .hero-join {
        width: 100%;
        max-width: 100%;
        padding: 12px;
        gap: 12px;
        margin-bottom: 36px;
        border-radius: 20px;
    }
    .hero-join-online { flex: 1 1 100%; padding: 12px 16px; min-height: 52px; }
    .hero-join-online .meta .value { font-size: 28px; }
    .hero-join-online .meta .unit { font-size: 12px; }
    .hero-join-btn {
        flex: 1 1 100%;
        width: 100%;
        min-width: 0;
        height: 52px;
        min-height: 52px;
        padding: 0 16px;
        font-size: 14px;
        border-radius: 12px;
    }
    .hero-main { transform: translateY(-2vh); }
    .hero-nav { margin-top: 8px; gap: 8px; }
    .hero-nav-btn { padding: 10px 14px; font-size: 13px; }
    .hero-scroll-hint { bottom: 22px; }
    .hero { padding-bottom: 6rem; }

    .auth-btn {
        top: max(12px, env(safe-area-inset-top));
        right: max(12px, env(safe-area-inset-right));
        padding: 10px 12px;
        font-size: 13px;
        gap: 8px;
        border-radius: 14px;
        max-width: calc(100vw - 24px);
    }
    .admin-btn {
        top: max(12px, env(safe-area-inset-top));
        left: max(12px, env(safe-area-inset-left));
        width: 44px;
        height: 44px;
        border-radius: 14px;
        font-size: 16px;
    }
    .auth-btn .auth-text {
        max-width: 96px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .auth-btn .avatar { width: 28px; height: 28px; font-size: 12px; border-radius: 4px; }

    .modal-overlay {
        padding: 12px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        align-items: flex-end;
    }
    .modal {
        padding: 28px 18px 22px;
        max-width: 100%;
        width: 100%;
        border-radius: 22px 22px 18px 18px;
        max-height: min(92svh, 100%);
        overflow-y: auto;
    }
    .modal-title { font-size: 22px; }
    .modal-subtitle { font-size: 14px; margin-bottom: 20px; }
    .modal .form-group input { padding: 14px 16px; font-size: 16px; }
    .modal .btn-primary { padding: 15px; min-height: 50px; }

    .tops-section,
    .shop-section,
    .purchases-section {
        padding-left: 14px;
        padding-right: 14px;
    }
    .tops-section { padding-top: 48px; padding-bottom: 28px; }
    .shop-section { padding-top: 40px; padding-bottom: 72px; }
    .purchases-section { padding-top: 28px; padding-bottom: 48px; }
    .shop-section h2,
    .tops-section h2,
    .purchases-section h2,
    .economy-section h3 { font-size: clamp(1.45rem, 6vw, 1.75rem); }
    .tops-section .subtitle,
    .shop-section .desc,
    .economy-section .subtitle,
    .purchases-section .subtitle {
        font-size: 14px;
        margin-bottom: 28px;
    }

    /* Топы — одна колонка, чтобы ники не сжимались */
    .tops-layout {
        gap: 20px;
    }
    .honorary-card {
        min-height: 0;
        max-width: 100%;
        padding: 28px 18px 32px;
        gap: 14px;
        border-radius: 22px;
    }
    .honorary-skin-wrap {
        width: 132px;
        min-height: 240px;
    }
    .honorary-skin {
        width: 132px;
    }
    .honorary-skin-fallback,
    .honorary-skin-empty {
        width: 96px;
        height: 180px;
        font-size: 40px;
    }
    .tops-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .tops-grid .top-card.top-card-center {
        width: 100%;
        justify-self: stretch;
    }
    .top-card {
        padding: 18px 14px;
        border-radius: 18px;
    }
    .top-card .top-header {
        font-size: 15px;
        gap: 8px;
        margin-bottom: 12px;
        flex-wrap: wrap;
    }
    .top-card .top-list li {
        padding: 10px 6px;
        gap: 8px;
        align-items: flex-start;
    }
    .top-card .top-list .position {
        min-width: 32px;
        font-size: 9px;
        padding-top: 6px;
    }
    .top-card .top-list .player-avatar {
        width: 26px;
        height: 26px;
        margin-top: 2px;
    }
    .top-card .top-list .player-name {
        font-size: 13px;
        line-height: 1.45;
    }
    .top-card .top-list .value {
        font-size: 13px;
        min-width: 58px;
        padding-top: 2px;
    }
    .top-update-time { font-size: 11px; }

    /* Ранги — 2 в ряд на телефоне */
    .ranks-grid { gap: 12px; }
    .flip-card {
        flex: 0 0 calc((100% - 12px) / 2);
        width: calc((100% - 12px) / 2);
        min-width: 0;
        max-width: none;
        height: 280px;
    }
    /* Mobile sizing for shop cards lives in parallax-ticket.css */
    .promo-buy-modal,
    .rank-features-modal {
        width: min(100vw - 16px, 560px);
        max-width: calc(100vw - 16px);
        max-height: min(92vh, 720px);
        margin: 8px auto;
        border-radius: 18px;
        overflow: hidden;
    }
    .pb-layout {
        grid-template-columns: 1fr;
        min-height: 0;
        max-height: min(88vh, 680px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    .pb-left {
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.06);
        padding: 22px 16px 14px;
    }
    .pb-right { padding: 16px 16px 18px; }
    .promo-buy-modal .modal-title { font-size: 22px; }
    .promo-buy-modal .modal-subtitle { margin-bottom: 12px; font-size: 12px; }
    .pb-receipt { font-size: 11px; padding: 14px 12px 12px; }
    .promo-buy-actions .btn-primary {
        min-height: 48px;
        font-size: 15px;
    }
    .rf-layout {
        grid-template-columns: 1fr;
        min-height: 0;
        max-height: min(88vh, 680px);
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }
    .rf-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        padding: 18px 14px 12px;
        gap: 6px;
        position: sticky;
        top: 0;
        z-index: 2;
    }
    .rf-rank-badge {
        width: 100%;
        margin: 0 4px 8px;
        font-size: 1.1rem;
    }
    .rf-nav {
        flex: 1;
        min-width: 42%;
        font-size: 12px;
        padding: 10px 12px;
    }
    .rf-main { padding: 16px 14px 18px; }
    .rank-features-modal .modal-title { font-size: 20px; }
    .rank-features-modal .modal-subtitle { font-size: 12px; margin-bottom: 12px; }
    .rank-features li { font-size: 13px; padding: 8px 0; }
    .rf-panel-wrap { min-height: 180px; }
    .economy-card .buy-btn {
        padding: 14px 16px;
        min-height: 48px;
        font-size: 15px;
    }

    .economy-grid,
    .services-grid { grid-template-columns: 1fr; max-width: 100%; gap: 16px; }
    .shop-mode-bar { max-width: 100%; flex-wrap: wrap; justify-content: center; }
    .shop-mode-bar .mode-btn { padding: 10px 14px; font-size: 13px; }
    .economy-card { padding: 24px 18px; }
    .economy-card .icon { font-size: 40px; width: 72px; height: 72px; }
    .economy-card .name { font-size: 22px; }
    .economy-card .input-group .input-row { flex-direction: column; }
    .economy-card .input-group input { width: 100%; font-size: 18px; }

    .purchases-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .purchase-card { min-height: 128px; padding: 14px 10px; border-radius: 16px; }
    .purchase-card .purchase-avatar { width: 40px; height: 40px; font-size: 15px; border-radius: 4px; }
    .purchase-card .purchase-name { font-size: 12px; }
    .purchase-card .purchase-action { font-size: 11px; line-height: 1.35; }
    .purchase-card .purchase-time { font-size: 10px; }

    .toast {
        left: 12px;
        right: 12px;
        bottom: max(16px, env(safe-area-inset-bottom));
        width: auto;
        max-width: none;
        transform: translateY(120px);
        padding: 14px 18px;
        font-size: 14px;
        text-align: center;
    }
    .toast.show { transform: translateY(0); }

    .profile-grid { grid-template-columns: 1fr; }
    .profile-balance { grid-template-columns: 1fr; }
    .profile-actions { flex-direction: column; }
    .profile-page { padding: 72px 16px 40px; }
    .profile-page .profile-name { font-size: 24px; }
    .profile-page .profile-card { padding: 26px 18px; }
    .profile-page .profile-avatar { width: 72px; height: 72px; font-size: 30px; border-radius: 4px; }
}

@media (max-width: 480px) {
    .hero {
        padding-left: 12px;
        padding-right: 12px;
    }
    .hero-title { font-size: 1.1rem; }
    .hero-join-online .meta .value { font-size: 24px; }
    .hero-join-online .dot-wrap { width: 36px; height: 36px; }
    .auth-btn .auth-text { display: none; }
    .auth-btn { padding: 10px; min-width: 44px; min-height: 44px; justify-content: center; }

    .purchases-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .purchase-card { min-height: 112px; padding: 12px 8px; }
    .purchase-card .purchase-avatar { width: 34px; height: 34px; font-size: 13px; }

    .top-card .top-list li {
        display: grid;
        grid-template-columns: 28px 26px 1fr;
        grid-template-areas:
            "pos av name"
            "pos av value";
        column-gap: 8px;
        row-gap: 2px;
        align-items: center;
    }
    .top-card .top-list .position { grid-area: pos; padding-top: 0; }
    .top-card .top-list .player-avatar { grid-area: av; margin-top: 0; }
    .top-card .top-list .player-name { grid-area: name; }
    .top-card .top-list .value {
        grid-area: value;
        text-align: left;
        min-width: 0;
        font-size: 12px;
    }

    .modal { padding: 22px 14px 18px; }
    .modal-overlay {
        padding: 8px;
        align-items: flex-end;
    }
    .promo-buy-modal,
    .rank-features-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 18px 18px 12px 12px;
        margin: 0;
    }
    .profile-balance .card { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (hover: none) {
    .hero-join:hover,
    .top-card:hover,
    .economy-card:hover,
    .purchase-card:hover {
        transform: none;
    }
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--amber, #b6743e), var(--orange, #f06114));
    border-radius: 100px;
}
::-webkit-scrollbar-thumb:hover { background: var(--orange, #f06114); }

/* Future-proof native range thumbs to the same nav accent */
input[type="range"] {
    accent-color: var(--orange, #f06114);
}
input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid rgba(240, 97, 20, 0.55);
    background: linear-gradient(135deg, var(--amber, #b6743e), var(--orange, #f06114));
    box-shadow: 0 0 12px rgba(240, 97, 20, 0.35);
    cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    border: 1px solid rgba(240, 97, 20, 0.55);
    background: linear-gradient(135deg, var(--amber, #b6743e), var(--orange, #f06114));
    box-shadow: 0 0 12px rgba(240, 97, 20, 0.35);
    cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 15, 28, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
}
input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 999px;
    background: rgba(15, 15, 28, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .reveal { opacity: 1; transform: none; }
}
