:root {
    --bg-overlay: rgba(15, 17, 23, 0.78);
    --card-bg: rgba(255, 255, 255, 0.04);
    --border-color: rgba(255, 255, 255, 0.08);
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-gold: #f59e0b;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --player-rank-color: #10b981;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Inter', sans-serif;
}

html {
    /* Always reserve scrollbar space so viewport width never changes between tabs */
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: #0f1117;
    position: relative;
    isolation: isolate;
}

/* Dedicated fixed layer — use large viewport units so mobile chrome can't rescale it */
.site-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: -1;
    width: auto;
    height: auto;
    min-height: 100vh;
    min-height: 100lvh;
    pointer-events: none;
    overflow: hidden;
    background: #0f1117;
}

.site-backdrop::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-overlay);
    z-index: 1;
}

.site-backdrop img {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    max-width: none;
    transform: translate(-50%, -50%);
    user-select: none;
    -webkit-user-drag: none;
}

a {
    color: inherit;
}

header,
.site-header {
    padding: 18px 24px 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    position: relative;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.online-badge {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 50;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    color: var(--text-main);
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    color: inherit;
    min-width: 0;
}

.brand-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
    flex-shrink: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 24px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.brand h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: 2px;
}

.btn-auth {
    background: var(--accent-color);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-auth:hover {
    background: var(--accent-hover);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    padding: 6px 16px 6px 6px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
}

.user-profile:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.1);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 6px;
}

.user-name {
    font-weight: 600;
}

.rank-badge {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid currentColor;
    background: color-mix(in srgb, currentColor 18%, transparent);
}

.rank-badge.rank-badge--img {
    padding: 0;
    border: none;
    background: transparent;
    line-height: 0;
}

/* Значки рангов - пиксель-арт высотой 11 px. Высота = целое число физических пикселей на пиксель
   картинки (--rank-badge-h считает script.js под devicePixelRatio), иначе буквы плывут: OWNER → «OUHER». */
.rank-badge.rank-badge--img img,
img.rank-badge-img {
    display: inline-block;
    height: var(--rank-badge-h, 22px);
    width: auto;
    max-width: none;
    border-radius: 0;
    flex-shrink: 0;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    vertical-align: middle;
}

main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 12px 20px 30px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    padding: 14px 32px;
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 700;
    font-size: 16px;
    transition: all 0.25s ease;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.nav-store-btn {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    position: relative;
    overflow: visible;
}

.nav-store-deal {
    position: absolute;
    top: -9px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    line-height: 1;
    white-space: nowrap;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(15, 17, 23, 0.95);
    border: 1px solid rgba(245, 158, 11, 0.45);
    background-image: linear-gradient(90deg, #fbbf24, #f472b6, #22d3ee, #a78bfa, #fbbf24);
    background-size: 300% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: store-deal-shine 3.5s linear infinite;
    pointer-events: none;
}

.nav-store-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.nav-store-btn:hover,
.nav-store-btn.active {
    border-color: rgba(245, 158, 11, 0.7);
    box-shadow: 0 0 24px rgba(245, 158, 11, 0.25);
}

@keyframes store-deal-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

.nav-btn:hover,
.nav-btn.active {
    background: rgba(99, 102, 241, 0.2);
    border-color: rgba(99, 102, 241, 0.6);
    transform: translateY(-2px);
}

.block-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(12px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 15px;
}

.section-header h2 {
    font-size: 22px;
    font-weight: 800;
}

.section-desc {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: -10px;
    margin-bottom: 20px;
    line-height: 1.5;
}

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

.products-grid:has(> :nth-child(3):last-child) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.products-grid:has(> :nth-child(4):last-child),
.grief-ranks-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.scortiki-packs-grid,
.products-grid:has(> :nth-child(5)) {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.product-card {
    background: rgba(15, 17, 26, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    transition: all 0.3s ease;
}

.product-card:hover {
    border-color: rgba(99, 102, 241, 0.4);
    transform: translateY(-4px);
}

.product-card-opening {
    border: 1px solid rgba(251, 191, 36, 0.45);
    background:
        radial-gradient(circle at 90% 10%, rgba(244, 114, 182, 0.22), transparent 45%),
        radial-gradient(circle at 10% 90%, rgba(99, 102, 241, 0.2), transparent 50%),
        linear-gradient(155deg, rgba(36, 20, 10, 0.85), rgba(15, 17, 26, 0.92));
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.12),
        0 0 36px rgba(244, 114, 182, 0.18),
        0 18px 40px rgba(0, 0, 0, 0.45);
}

.product-card-opening:hover {
    border-color: rgba(251, 191, 36, 0.75);
    transform: translateY(-5px) scale(1.01);
    box-shadow:
        0 0 40px rgba(251, 191, 36, 0.28),
        0 22px 44px rgba(0, 0, 0, 0.5);
}

.badge-opening {
    background: linear-gradient(135deg, #fbbf24, #f472b6, #a78bfa) !important;
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.45);
}

.product-price-opening {
    background: linear-gradient(90deg, #fbbf24, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 800;
}

.reward-scortiki {
    display: inline-flex;
    align-items: center;
    font-weight: 800;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, #fde68a, #f59e0b, #fbbf24, #fde68a);
    background-size: 220% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: scortiki-shine 2.8s linear infinite;
    text-shadow: 0 0 18px rgba(245, 158, 11, 0.25);
}

.reward-booster {
    display: inline-block;
    font-weight: 700;
    color: #c4b5fd;
    padding: 1px 7px;
    border-radius: 6px;
    background: rgba(167, 139, 250, 0.14);
    border: 1px solid rgba(167, 139, 250, 0.35);
}

@keyframes scortiki-shine {
    0% { background-position: 0% 50%; }
    100% { background-position: 220% 50%; }
}

.badge-special {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 4px 9px;
    border-radius: 20px;
    text-transform: uppercase;
}

.product-title {
    font-size: 19px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-items {
    list-style: none;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.product-items li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: #d1d5db;
}

.item-text {
    display: flex;
    align-items: center;
    gap: 8px;
}

.product-items i {
    color: var(--accent-color);
    width: 17px;
    height: 17px;
}

.mode-badge {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.07);
    color: #9ca3af;
    border: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.product-timer {
    background: rgba(0, 0, 0, 0.3);
    border: 1px dashed rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--accent-gold);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 600;
}

.product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    gap: 12px;
    flex-wrap: wrap;
}

.product-price {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

.btn-buy {
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-buy:hover:not(:disabled) {
    opacity: 0.9;
    transform: scale(1.03);
}

.btn-buy:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.3);
}

.section-prime {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(6, 78, 59, 0.25));
    border: 2px solid #10b981;
    box-shadow: 0 0 35px rgba(16, 185, 129, 0.3);
    animation: primePulse 3s infinite alternate;
}

@keyframes primePulse {
    0% { box-shadow: 0 0 20px rgba(16, 185, 129, 0.2); }
    100% { box-shadow: 0 0 40px rgba(16, 185, 129, 0.45); }
}

.section-unique {
    position: relative;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(153, 27, 27, 0.3));
    border: 2px solid #ef4444;
    box-shadow: 0 0 35px rgba(239, 68, 68, 0.35);
    animation: redGlow 2.5s infinite alternate;
}

@keyframes redGlow {
    0% { border-color: #ef4444; box-shadow: 0 0 20px rgba(239, 68, 68, 0.3); }
    100% { border-color: #f43f5e; box-shadow: 0 0 45px rgba(244, 63, 94, 0.6); }
}

.btn-glow-container {
    display: flex;
    justify-content: center;
    margin-top: 25px;
}

.btn-glow {
    background: linear-gradient(135deg, #ff007a, #7928ca, #00dfd8);
    background-size: 200% 200%;
    animation: gradientMove 3s ease infinite, pulseGlow 2s infinite;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    padding: 16px 40px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: transform 0.2s;
}

.btn-glow:hover {
    transform: scale(1.04);
}

.btn-grief-shop {
    background: linear-gradient(135deg, #f59e0b, #ef4444, #dc2626);
    background-size: 200% 200%;
    animation: gradientMove 2.5s ease infinite, griefGlow 1.8s infinite alternate;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    padding: 18px 45px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 0 30px rgba(239, 68, 68, 0.6);
    transition: transform 0.2s ease;
}

.btn-grief-shop:hover {
    transform: scale(1.05);
    box-shadow: 0 0 45px rgba(245, 158, 11, 0.8);
}

.store-cat-panel { display: none; }

/* ================= Store Catalog ================= */
.store-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}
.store-rail {
    position: static;
    top: auto;
    padding: 14px 10px;
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    height: auto;
    min-height: 100%;
    align-self: stretch;
    box-sizing: border-box;
}
.store-rail-title {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    padding: 4px 10px 12px;
}
.store-rail-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.store-tab {
    appearance: none;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.store-tab-ico {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}
.store-tab-ico i, .store-tab-ico svg {
    width: 16px;
    height: 16px;
}
.store-tab-meta {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.store-tab-name {
    font-size: 13px;
    font-weight: 700;
    color: #e5e7eb;
}
.store-tab-hint {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.store-tab:hover {
    background: rgba(255, 255, 255, 0.04);
}
.store-tab.active {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.35);
}
.store-tab.active .store-tab-name { color: #fff; }
.store-tab.active .store-tab-ico {
    background: rgba(245, 158, 11, 0.18);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fbbf24;
}

.store-stage {
    min-width: 0;
}
.store-panel {
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 0;
    background: transparent;
    border: none;
}
.store-panel.is-active,
.store-panel:not([hidden]) { display: flex; }
.store-panel[hidden] { display: none !important; }

.store-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}
.store-panel-title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
}
.store-panel-desc {
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
    max-width: 560px;
}

.btn-buy-store {
    background: #f59e0b;
    color: #111827;
}
.btn-buy-store:hover:not(:disabled) {
    background: #fbbf24;
    opacity: 1;
}

.deal-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.deal-card {
    display: grid;
    grid-template-columns: 6px minmax(0, 1fr) auto;
    gap: 0;
    align-items: stretch;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    overflow: hidden;
    min-height: 132px;
}
.deal-accent { width: 6px; }
.deal-accent-sale { background: #f59e0b; }
.deal-accent-open { background: linear-gradient(180deg, #fbbf24, #f472b6); }
.deal-accent-service { background: #64748b; }
.deal-body {
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}
.deal-topline {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.deal-badge {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.18);
    color: #fcd34d;
}
.deal-badge-hot {
    background: rgba(244, 114, 182, 0.18);
    color: #f9a8d4;
}
.deal-timer {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
}
.deal-timer i, .deal-timer svg { width: 13px; height: 13px; color: #fbbf24; }
.deal-title {
    font-size: 18px;
    font-weight: 800;
    margin: 0;
}
.deal-text {
    margin: 0;
    color: var(--text-muted);
    font-size: 13px;
    line-height: 1.45;
}
.deal-perks {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.deal-perks li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
    color: #d1d5db;
}
.deal-cta {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 10px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.02);
    border-left: 1px solid rgba(255, 255, 255, 0.06);
    min-width: 148px;
}
.deal-price {
    font-size: 22px;
    font-weight: 800;
    text-align: center;
    color: #fff;
}
.deal-price-hot {
    background: linear-gradient(90deg, #fbbf24, #f472b6);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.deal-cta .btn-buy {
    width: 100%;
    justify-content: center;
}

.prime-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.75fr);
    gap: 14px;
    align-items: start;
}
.prime-perks {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.perk-group h4 {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.perk-chips {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
}
.perk-chips li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 12px;
    color: #e5e7eb;
}
.perk-chips li i, .perk-chips li svg {
    width: 14px;
    height: 14px;
    color: #34d399;
}
.prime-buy-panel {
    padding: 14px;
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(16, 185, 129, 0.28);
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: static;
    min-width: 0;
    overflow: hidden;
}
.prime-buy-panel h4 { font-size: 13px; font-weight: 700; margin: 0; }
.prime-selector {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
}
.prime-opt {
    appearance: none;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    border-radius: 12px;
    padding: 12px 8px;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.prime-opt-label {
    display: block;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}
.prime-opt:hover { border-color: rgba(16, 185, 129, 0.45); }
.prime-opt.active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.6);
    color: #fff;
}
.prime-opt .discount-badge {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
    max-width: 100%;
}
.prime-checkout {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.prime-checkout-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
}
.prime-checkout-price {
    font-size: 28px;
    font-weight: 800;
    color: #34d399;
}
.prime-checkout .btn-buy { width: 100%; justify-content: center; }

/* ---- PRIME / PRIME+ : карточки уровней, таблица сравнения, улучшение ---- */
.prime-compare {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
.prime-tier-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.prime-tier-card {
    appearance: none;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 14px;
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(52, 211, 153, 0.22);
    color: var(--text-main);
    font: inherit;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.prime-tier-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(120% 90% at 0% 0%, rgba(52, 211, 153, 0.14), transparent 60%);
    pointer-events: none;
}
.prime-tier-card.is-plus { border-color: rgba(132, 204, 22, 0.28); }
.prime-tier-card.is-plus::before {
    background: radial-gradient(120% 90% at 0% 0%, rgba(132, 204, 22, 0.18), transparent 60%);
}
.prime-tier-card:hover { transform: translateY(-1px); }
.prime-tier-card.active {
    border-color: rgba(52, 211, 153, 0.75);
    background: #131b19;
}
.prime-tier-card.is-plus.active {
    border-color: rgba(132, 204, 22, 0.8);
    background: #161b12;
}
.prime-tier-badge {
    height: 22px;
    width: auto;
    image-rendering: pixelated;
    position: relative;
}
.prime-tier-price {
    position: relative;
    font-size: 13px;
    color: var(--text-muted);
}
.prime-tier-price strong {
    font-size: 22px;
    font-weight: 800;
    color: #34d399;
}
.prime-tier-card.is-plus .prime-tier-price strong { color: #a3e635; }
.prime-tier-tagline {
    position: relative;
    font-size: 12px;
    line-height: 1.35;
    color: #d1d5db;
}
.prime-tier-ribbon {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(132, 204, 22, 0.16);
    border: 1px solid rgba(132, 204, 22, 0.45);
    color: #d9f99d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.prime-matrix-wrap {
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
}
.prime-matrix {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.prime-matrix th,
.prime-matrix td {
    padding: 9px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
    vertical-align: middle;
}
.prime-matrix th:first-child,
.prime-matrix td:first-child {
    text-align: left;
    color: #e5e7eb;
}
.prime-matrix thead th {
    position: sticky;
    top: 0;
    background: #151922;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: #34d399;
}
.prime-matrix thead th.is-plus { color: #a3e635; }
.prime-matrix thead th.prime-matrix-feature {
    color: var(--text-muted);
    text-transform: uppercase;
}
.prime-matrix-col { width: 26%; }
.prime-matrix-group td {
    padding-top: 14px;
    background: rgba(255, 255, 255, 0.02);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted) !important;
}
.prime-matrix-group td i,
.prime-matrix-group td svg {
    width: 13px;
    height: 13px;
    vertical-align: -2px;
    margin-right: 4px;
    color: #6ee7b7;
}
.prime-matrix .pm-yes i,
.prime-matrix .pm-yes svg {
    width: 16px;
    height: 16px;
    color: #34d399;
}
.prime-matrix .pm-no { color: rgba(255, 255, 255, 0.22); }
.prime-matrix .pm-val { font-weight: 700; color: #f3f4f6; }
.prime-matrix .pm-muted { color: var(--text-muted); font-weight: 500; }
.prime-matrix .pm-note { font-size: 11px; color: var(--text-muted); }
.prime-matrix tbody tr:not(.prime-matrix-group):hover td { background: rgba(255, 255, 255, 0.025); }
.prime-matrix[data-tier="prime"] td:nth-child(2),
.prime-matrix[data-tier="prime"] th:nth-child(2) { background-color: rgba(52, 211, 153, 0.06); }
.prime-matrix[data-tier="prime_plus"] td:nth-child(3),
.prime-matrix[data-tier="prime_plus"] th:nth-child(3) { background-color: rgba(132, 204, 22, 0.07); }
.prime-matrix[data-tier="prime_plus"] td.pm-yes:nth-child(3) svg { color: #a3e635; }
.prime-tier-switch {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}
.prime-tier-opt {
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 11px 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.prime-tier-opt img {
    height: 18px;
    width: auto;
    image-rendering: pixelated;
}
.prime-tier-opt:hover { border-color: rgba(52, 211, 153, 0.45); }
.prime-tier-opt.active {
    background: rgba(16, 185, 129, 0.18);
    border-color: rgba(16, 185, 129, 0.6);
}
.prime-tier-opt.is-plus.active {
    background: rgba(132, 204, 22, 0.16);
    border-color: rgba(132, 204, 22, 0.65);
}
.prime-opt-price {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
}
.prime-opt.active .prime-opt-price { color: #d1fae5; }
.prime-buy-panel.is-plus { border-color: rgba(132, 204, 22, 0.35); }
.prime-buy-panel.is-plus .prime-checkout-price { color: #a3e635; }
.prime-buy-panel.is-plus .prime-opt.active {
    background: rgba(132, 204, 22, 0.16);
    border-color: rgba(132, 204, 22, 0.6);
}
.prime-buy-panel.is-plus .prime-opt:hover { border-color: rgba(132, 204, 22, 0.45); }
.prime-upgrade-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1), rgba(132, 204, 22, 0.12));
    border: 1px dashed rgba(132, 204, 22, 0.5);
}
.prime-upgrade-box[hidden] { display: none; }
.prime-upgrade-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #ecfccb;
}
.prime-upgrade-head i,
.prime-upgrade-head svg { width: 16px; height: 16px; color: #a3e635; }
.prime-upgrade-text {
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
    color: #d1d5db;
}
.prime-upgrade-box .btn-buy { width: 100%; justify-content: center; }
.friends-limit {
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}
.friends-limit:empty { display: none; }
.friends-limit.is-full { color: #fca5a5; border-color: rgba(239, 68, 68, 0.4); }
@media (max-width: 560px) {
    .prime-tier-cards { grid-template-columns: 1fr; }
    .prime-matrix th,
    .prime-matrix td { padding: 8px; font-size: 12px; }
}

.grief-ranks-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}
.rank-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 100%;
}
.rank-card-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}
.rank-name { font-size: 16px; font-weight: 800; }
.grief-rank-prestige .rank-name { color: #facc15; }
.grief-rank-immortal .rank-name { color: #f59e0b; }
.grief-rank-imperium .rank-name { color: #38bdf8; }
.grief-rank-scortum .rank-name { color: #e879f9; }
.rank-price { font-size: 18px; font-weight: 800; color: #fff; }
.rank-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rank-metrics span {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    padding: 4px 7px;
}
.rank-metrics strong { color: #fdba74; font-weight: 800; }
.rank-cmds {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    font-size: 12px;
    color: #d1d5db;
}
.rank-cmds code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 11px;
    color: #fdba74;
    background: rgba(251, 146, 60, 0.1);
    border: 1px solid rgba(251, 146, 60, 0.22);
    padding: 1px 5px;
    border-radius: 5px;
}
.grief-rank-prestige { border-color: rgba(250, 204, 21, 0.3); }
.grief-rank-immortal { border-color: rgba(245, 158, 11, 0.35); }
.grief-rank-imperium { border-color: rgba(56, 189, 248, 0.35); }
.grief-rank-scortum { border-color: rgba(232, 121, 249, 0.4); }

.pack-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}
.pack-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.pack-title { font-size: 16px; font-weight: 800; margin: 0; }
.pack-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}
.pack-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: #d1d5db;
}
.pack-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.scortiki-packs-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.coin-tile {
    position: relative;
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: #12151c;
    border-radius: 14px;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: inherit;
    font: inherit;
    transition: border-color 0.15s ease, transform 0.15s ease;
}
.coin-tile:hover {
    border-color: rgba(245, 158, 11, 0.45);
    transform: translateY(-1px);
}
.scortiki-amount {
    font-size: 26px;
    font-weight: 800;
    color: #fde68a;
}
.coin-tile-price {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}
.scortiki-save {
    position: absolute;
    top: 10px;
    right: 10px;
}
.coins-calculator {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 14px;
    background: #12151c;
    border: 1px solid rgba(245, 158, 11, 0.22);
}
.coins-calc-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 110px;
}
.coins-calc-copy label { font-weight: 700; font-size: 13px; }
.coins-calc-hint { font-size: 12px; color: var(--text-muted); }
.coins-calc-total { font-size: 18px; font-weight: 800; color: #fbbf24; }
.coins-input {
    width: 120px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0b0d12;
    color: #fff;
    font: inherit;
    font-weight: 700;
}
.btn-buy-block { width: 100%; justify-content: center; }
.btn-buy-lg { padding: 12px 18px; }

@media (max-width: 980px) {
    .store-shell {
        grid-template-columns: 1fr;
    }
    .store-rail {
        position: static;
        padding: 10px;
    }
    .store-rail-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        scrollbar-width: none;
    }
    .store-rail-nav::-webkit-scrollbar { display: none; }
    .store-tab {
        width: auto;
        min-width: 148px;
        flex-shrink: 0;
    }
    .store-tab-hint { display: none; }
    .prime-layout { grid-template-columns: 1fr; }
    .prime-buy-panel { position: static; }
    .grief-ranks-grid,
    .pack-grid,
    .scortiki-packs-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 650px) {
    .deal-card {
        grid-template-columns: 6px 1fr;
    }
    .deal-cta {
        grid-column: 2;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .deal-cta .btn-buy { width: auto; }
    .grief-ranks-grid,
    .pack-grid,
    .scortiki-packs-grid {
        grid-template-columns: 1fr;
    }
    .coins-calculator { align-items: stretch; }
    .coins-input { width: 100%; }
    .coins-calculator .btn-buy { width: 100%; justify-content: center; }
}

.store-cat-panel { display: none !important; }

.store-cat-panel-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.store-cat-panel-head i,
.store-cat-panel-head svg {
    width: 18px;
    height: 18px;
    color: var(--accent-gold);
    stroke: var(--accent-gold);
}

.store-cat-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.store-cat-btn {
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 96px;
    padding: 16px 10px 14px;
    border-radius: 16px;
    border: 1px solid transparent;
    cursor: pointer;
    color: #fff;
    background: rgba(15, 17, 26, 0.85);
    font: inherit;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-align: center;
    line-height: 1.25;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, filter 0.2s ease;
}

.store-cat-btn::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.55;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 42%);
}

.store-cat-icon {
    position: relative;
    z-index: 1;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.store-cat-icon i,
.store-cat-icon svg {
    width: 22px;
    height: 22px;
    stroke-width: 2.2;
}

.store-cat-label {
    position: relative;
    z-index: 1;
    max-width: 100%;
}

.store-cat-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 3px 7px;
    border-radius: 999px;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #111827;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}

.store-cat-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.08);
}

.store-cat-btn.active {
    transform: translateY(-2px);
    outline: 2px solid rgba(255, 255, 255, 0.35);
    outline-offset: 2px;
}

.store-cat-btn:focus-visible {
    outline: 2px solid #a5b4fc;
    outline-offset: 3px;
}

/* ЭКСКЛЮЗИВ — red promo */
.store-cat-exclusive {
    background:
        radial-gradient(circle at 80% 10%, rgba(248, 113, 113, 0.35), transparent 50%),
        linear-gradient(155deg, #7f1d1d 0%, #b91c1c 48%, #450a0a 100%);
    border-color: rgba(248, 113, 113, 0.65);
    box-shadow: 0 0 22px rgba(239, 68, 68, 0.28), 0 12px 24px rgba(0, 0, 0, 0.35);
}
.store-cat-exclusive .store-cat-icon {
    color: #fecaca;
    border-color: rgba(252, 165, 165, 0.45);
    background: rgba(127, 29, 29, 0.55);
}
.store-cat-exclusive:hover,
.store-cat-exclusive.active {
    box-shadow: 0 0 32px rgba(239, 68, 68, 0.5), 0 14px 28px rgba(0, 0, 0, 0.4);
    border-color: #f87171;
}

/* PRIME — emerald network */
.store-cat-prime {
    background:
        radial-gradient(circle at 20% 0%, rgba(52, 211, 153, 0.35), transparent 48%),
        linear-gradient(155deg, #064e3b 0%, #059669 52%, #022c22 100%);
    border-color: rgba(52, 211, 153, 0.65);
    box-shadow: 0 0 22px rgba(16, 185, 129, 0.28), 0 12px 24px rgba(0, 0, 0, 0.35);
}
.store-cat-prime .store-cat-icon {
    color: #a7f3d0;
    border-color: rgba(110, 231, 183, 0.45);
    background: rgba(6, 78, 59, 0.55);
}
.store-cat-prime:hover,
.store-cat-prime.active {
    box-shadow: 0 0 34px rgba(16, 185, 129, 0.5), 0 14px 28px rgba(0, 0, 0, 0.4);
    border-color: #34d399;
}

/* СКОРТИКИ — gold currency */
.store-cat-scortiki {
    background:
        radial-gradient(circle at 70% 15%, rgba(251, 191, 36, 0.38), transparent 50%),
        linear-gradient(155deg, #78350f 0%, #d97706 50%, #451a03 100%);
    border-color: rgba(251, 191, 36, 0.6);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.28), 0 12px 24px rgba(0, 0, 0, 0.35);
}
.store-cat-scortiki .store-cat-icon {
    color: #fde68a;
    border-color: rgba(252, 211, 77, 0.5);
    background: rgba(120, 53, 15, 0.55);
}
.store-cat-scortiki:hover,
.store-cat-scortiki.active {
    box-shadow: 0 0 34px rgba(245, 158, 11, 0.5), 0 14px 28px rgba(0, 0, 0, 0.4);
    border-color: #fbbf24;
}

/* НАБОРЫ — indigo kits (site accent) */
.store-cat-packs {
    background:
        radial-gradient(circle at 25% 10%, rgba(165, 180, 252, 0.32), transparent 48%),
        linear-gradient(155deg, #312e81 0%, #4f46e5 52%, #1e1b4b 100%);
    border-color: rgba(165, 180, 252, 0.55);
    box-shadow: 0 0 22px rgba(99, 102, 241, 0.28), 0 12px 24px rgba(0, 0, 0, 0.35);
}
.store-cat-packs .store-cat-icon {
    color: #c7d2fe;
    border-color: rgba(199, 210, 254, 0.45);
    background: rgba(49, 46, 129, 0.55);
}
.store-cat-packs:hover,
.store-cat-packs.active {
    box-shadow: 0 0 34px rgba(99, 102, 241, 0.5), 0 14px 28px rgba(0, 0, 0, 0.4);
    border-color: #a5b4fc;
}

/* GRIEF — standout premium */
.store-cat-grief {
    min-height: 108px;
    padding-top: 20px;
    font-size: 14px;
    letter-spacing: 0.14em;
    background:
        radial-gradient(circle at 50% -10%, rgba(251, 191, 36, 0.45), transparent 42%),
        linear-gradient(135deg, #7f1d1d, #b45309, #dc2626, #7c2d12, #450a0a);
    background-size: 220% 220%;
    animation: gradientMove 2.8s ease infinite, griefGlow 1.8s infinite alternate;
    border: 2px solid #fbbf24;
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.25),
        0 0 34px rgba(239, 68, 68, 0.55),
        0 0 18px rgba(251, 191, 36, 0.25),
        inset 0 0 22px rgba(251, 191, 36, 0.12);
    transform: scale(1.02);
}
.store-cat-grief .store-cat-icon {
    width: 48px;
    height: 48px;
    color: #fff7ed;
    border-color: rgba(251, 191, 36, 0.7);
    background: linear-gradient(145deg, rgba(185, 28, 28, 0.75), rgba(120, 53, 15, 0.8));
    box-shadow: 0 0 16px rgba(251, 191, 36, 0.35);
}
.store-cat-grief .store-cat-label {
    text-shadow: 0 0 12px rgba(251, 191, 36, 0.45);
}
.store-cat-grief:hover,
.store-cat-grief.active {
    transform: translateY(-4px) scale(1.04);
    filter: brightness(1.1);
    box-shadow:
        0 0 0 1px rgba(251, 191, 36, 0.45),
        0 0 48px rgba(239, 68, 68, 0.7),
        0 0 28px rgba(251, 191, 36, 0.4),
        inset 0 0 24px rgba(251, 191, 36, 0.16);
}

.section-grief-shop {
    background: linear-gradient(145deg, rgba(127, 29, 29, 0.35), rgba(15, 23, 42, 0.65));
    border: 2px solid rgba(239, 68, 68, 0.55);
    box-shadow: 0 0 40px rgba(239, 68, 68, 0.28);
}

.grief-rank-card .hl {
    color: #fb923c;
    font-weight: 800;
}

.grief-rank-prestige { border-color: rgba(250, 204, 21, 0.45); }
.grief-rank-immortal { border-color: rgba(245, 158, 11, 0.5); }
.grief-rank-imperium { border-color: rgba(56, 189, 248, 0.5); }
.grief-rank-scortum {
    border-color: rgba(232, 121, 249, 0.55);
    box-shadow: 0 0 24px rgba(232, 121, 249, 0.2);
}

.scortiki-packs-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.scortiki-pack-card .product-title {
    font-size: 22px;
    justify-content: center;
}

.golden-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}

.golden-event-card {
    border-radius: 14px;
    padding: 16px 18px;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(120, 53, 15, 0.35));
    border: 1px solid rgba(251, 191, 36, 0.45);
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.18);
}

.golden-event-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    margin-bottom: 8px;
    color: #fde68a;
}

.golden-event-status {
    font-size: 15px;
    color: #fff;
}

.golden-event-status.active {
    color: #86efac;
}

.warps-panel {
    margin: 18px 0 24px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
}

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

.warp-item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.warp-item img:not(.rank-badge-img) {
    width: 28px;
    height: 28px;
    border-radius: 6px;
}

.warp-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.warp-creator {
    font-weight: 700;
}

.warp-name {
    color: var(--text-muted);
    font-size: 13px;
}

.warp-coords {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
    color: #fb923c;
}

.grief-tops-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.skin-side-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-skin-side {
    width: 100%;
    justify-content: center;
    background: rgba(99, 102, 241, 0.14);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
}

.btn-skin-side.active {
    background: rgba(99, 102, 241, 0.35);
    border-color: rgba(165, 180, 252, 0.7);
    color: #fff;
}

.grief-rank-box {
    border-color: rgba(239, 68, 68, 0.35);
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(0, 0, 0, 0.2));
}

.grief-coins-card {
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.18);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(0, 0, 0, 0.2));
}

.profile-panel-hidden {
    display: none !important;
}

.profile-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}
.profile-aside {
    position: sticky;
    top: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-skin-wrap {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-height: 280px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.profile-skin-wrap .skin-img {
    height: 92%;
    max-height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.45));
}
.profile-aside-meta {
    text-align: center;
}
.profile-aside-meta .player-nickname {
    font-size: 20px;
    font-weight: 800;
    justify-content: center;
}
.profile-aside-meta .reg-date {
    justify-content: center;
    margin-top: 6px;
    font-size: 12px;
}
.profile-aside-meta .reg-date i,
.profile-aside-meta .reg-date svg {
    width: 13px;
    height: 13px;
}
.profile-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.profile-nav-btn {
    appearance: none;
    width: 100%;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.profile-nav-btn i,
.profile-nav-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}
.profile-nav-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #e5e7eb;
}
.profile-nav-btn.active {
    background: rgba(99, 102, 241, 0.14);
    border-color: rgba(99, 102, 241, 0.35);
    color: #fff;
}
.profile-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.profile-panel {
    display: none;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.profile-panel.is-active {
    display: flex;
}
.profile-panel-head h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}
.profile-panel-head h3 i,
.profile-panel-head h3 svg {
    width: 18px;
    height: 18px;
    color: var(--accent-color, #818cf8);
}
.season-banner-compact {
    margin: 0;
    padding: 14px 16px;
}
.season-banner-compact .season-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0 0 2px;
}
.season-banner-compact .season-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin: 0;
}
.season-banner-compact .season-timer-box i,
.season-banner-compact .season-timer-box svg {
    color: var(--accent-gold);
    width: 16px;
    height: 16px;
}
.widget-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.widget-val-sm {
    font-size: 14px;
    font-weight: 700;
}
.widget-val-gold {
    color: var(--accent-gold);
}
.ico-grief { color: #ef4444; }
.ico-gold { color: var(--accent-gold); }
.ico-2fa { color: #6366f1; }

.profile-grid {
    display: contents;
}

.skin-card {
    display: none;
}

.info-column {
    display: contents;
}

@media (max-width: 900px) {
    .store-cat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .store-cat-grief {
        grid-column: 1 / -1;
        min-height: 96px;
    }
}

@keyframes griefGlow {
    0% { box-shadow: 0 0 20px rgba(239, 68, 68, 0.5); }
    100% { box-shadow: 0 0 40px rgba(245, 158, 11, 0.8); }
}

@keyframes gradientMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 20px rgba(255, 0, 122, 0.5); }
    50% { box-shadow: 0 0 35px rgba(121, 40, 202, 0.8); }
    100% { box-shadow: 0 0 20px rgba(255, 0, 122, 0.5); }
}

.prime-extend-info {
    font-size: 13px;
    color: #6ee7b7;
    margin-top: 12px;
    line-height: 1.4;
}

.discount-badge {
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 4px;
}

.coins-calculator {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 20px;
    border-radius: 12px;
    flex-wrap: wrap;
}

.coins-input {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    width: 130px;
    outline: none;
}

.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.mode-tab-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mode-tab-btn:hover,
.mode-tab-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.top-player-card {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(0, 0, 0, 0.4));
    border: 1px solid rgba(245, 158, 11, 0.4);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

.top-player-avatar {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    border: 2px solid var(--accent-gold);
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.4);
}

.top-player-info h4 {
    font-size: 14px;
    color: var(--accent-gold);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.top-player-info .name {
    font-size: 22px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.tops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 25px;
}

.top-box {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 20px;
}

.top-box-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding-bottom: 10px;
}

.top-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.top-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 13px;
}

.top-item:nth-child(1) {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.top-item:nth-child(2) {
    background: rgba(156, 163, 175, 0.12);
}

.top-item:nth-child(3) {
    background: rgba(180, 83, 9, 0.12);
}

.top-rank {
    font-weight: 800;
    width: 24px;
    color: var(--text-muted);
}

.top-item:nth-child(1) .top-rank { color: #f59e0b; }
.top-item:nth-child(2) .top-rank { color: #d1d5db; }
.top-item:nth-child(3) .top-rank { color: #b45309; }

.top-user {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    font-weight: 600;
}

.top-nick {
    font-weight: 700;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-rank-badge {
    display: inline-flex;
    align-items: center;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 2px 6px;
    border-radius: 6px;
    border: 1px solid;
    line-height: 1.2;
    white-space: nowrap;
}

.top-player-info .top-rank-badge {
    font-size: 11px;
    padding: 3px 8px;
}

.top-user img:not(.rank-badge-img) {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    flex-shrink: 0;
}

.top-value {
    font-weight: 700;
    color: var(--accent-gold);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ================= Home visit card ================= */
.home-visit {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 70% at 10% 0%, rgba(99, 102, 241, 0.18), transparent 55%),
        radial-gradient(ellipse 60% 50% at 100% 100%, rgba(16, 185, 129, 0.1), transparent 50%),
        var(--card-bg);
    border-color: rgba(129, 140, 248, 0.22);
}

.home-visit-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(240px, 0.85fr);
    gap: 28px;
    align-items: stretch;
}

.home-visit-eyebrow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.home-visit-brand {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #a5b4fc;
}

.home-version-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #ecfdf5;
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(52, 211, 153, 0.35);
}

.home-visit-title {
    font-size: clamp(26px, 4vw, 38px);
    font-weight: 850;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: #fff;
    margin: 0 0 10px;
}

.home-visit-sub {
    margin: 0 0 18px;
    max-width: 34em;
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.55;
}

.home-visit-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.home-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e7eb;
    font-size: 12px;
    font-weight: 700;
}

.home-chip i,
.home-chip svg {
    width: 14px;
    height: 14px;
    color: #93c5fd;
}

.home-ip-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border-radius: 14px;
    background: rgba(9, 11, 16, 0.72);
    border: 1px solid rgba(165, 180, 252, 0.22);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.home-ip-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.home-ip-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.home-ip-value {
    font-family: Consolas, "SFMono-Regular", ui-monospace, monospace;
    font-size: clamp(18px, 3vw, 24px);
    font-weight: 800;
    color: #c7d2fe;
    letter-spacing: 0.04em;
}

.home-ip-copy {
    flex-shrink: 0;
}

.home-visit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.home-visit-store {
    padding: 12px 18px;
    border-radius: 10px;
    font-weight: 700;
}

.home-visit-aside {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.home-aside-title {
    font-size: 15px;
    font-weight: 800;
    color: #fff;
}

.home-aside-sub {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--text-muted);
}

.home-mode-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.home-mode-item {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    background-color: rgba(17, 24, 39, 0.72);
    color: #f3f4f6;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.home-mode-item:hover {
    background: rgba(99, 102, 241, 0.12);
    border-color: rgba(129, 140, 248, 0.35);
    transform: translateY(-1px);
}

.home-mode-item i,
.home-mode-item svg {
    width: 18px;
    height: 18px;
    color: #93c5fd;
    flex-shrink: 0;
}

.home-mode-item span {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.home-mode-item strong {
    font-size: 13px;
    font-weight: 800;
    color: #f3f4f6;
}

.home-mode-item small {
    font-size: 11px;
    color: var(--text-muted);
}

.home-aside-link {
    appearance: none;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: #a5b4fc;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.home-aside-link:hover {
    color: #c7d2fe;
}

.home-aside-link i,
.home-aside-link svg {
    width: 15px;
    height: 15px;
}

/* ================= Home news ================= */
.home-news-section {
    margin-top: 22px;
}

.home-news-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.home-news-head .section-header h2 {
    font-size: 22px;
}

.home-news-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #a5b4fc;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.home-news-all:hover {
    color: #c7d2fe;
}

.home-news-all i,
.home-news-all svg {
    width: 14px;
    height: 14px;
}

.home-news-sub {
    margin: 0 0 18px;
    color: var(--text-muted);
    font-size: 13px;
}

.home-news-list {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 16px;
}

.home-news-list:not(:has(.news-card-feature)) {
    grid-template-columns: 1fr;
}

.home-news-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.news-card {
    display: flex;
    gap: 0;
    background: rgba(0, 0, 0, 0.28);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.07);
    text-decoration: none;
    color: inherit;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    border-color: rgba(129, 140, 248, 0.35);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
}

.news-card-feature {
    flex-direction: column;
    min-height: 100%;
}

.news-card-compact {
    flex-direction: row;
    min-height: 108px;
}

.news-preview {
    width: 100%;
    height: 210px;
    object-fit: cover;
    background:
        linear-gradient(135deg, rgba(99, 102, 241, 0.35), rgba(15, 23, 42, 0.9)),
        #111827;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    flex-shrink: 0;
}

.news-card-compact .news-preview {
    width: 118px;
    min-width: 118px;
    height: auto;
    align-self: stretch;
}

.news-preview i,
.news-preview svg {
    width: 36px;
    height: 36px;
    opacity: 0.85;
}

.news-card-compact .news-preview i,
.news-card-compact .news-preview svg {
    width: 22px;
    height: 22px;
}

.news-content {
    padding: 18px 18px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    flex: 1;
    min-width: 0;
}

.news-card-compact .news-content {
    padding: 14px 14px 12px;
    gap: 8px;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
}

.news-title {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.25;
    color: #fff;
}

.news-card-compact .news-title {
    font-size: 15px;
    margin-bottom: 4px;
}

.news-excerpt {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
}

.news-card-compact .news-excerpt {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-read {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #a5b4fc;
    font-size: 13px;
    font-weight: 700;
}

.news-card:hover .news-read {
    color: #c7d2fe;
}

.news-read i,
.news-read svg {
    width: 14px;
    height: 14px;
}

.placeholder-box {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.25);
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
}

.placeholder-box h3 {
    color: var(--text-main);
    margin-bottom: 8px;
    font-size: 20px;
}

/* Profile */
.season-banner {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(168, 85, 247, 0.15));
    border: 2px solid rgba(245, 158, 11, 0.5);
    border-radius: 20px;
    padding: 20px 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px rgba(245, 158, 11, 0.15);
    flex-wrap: wrap;
    gap: 15px;
}

.season-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.season-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    padding: 8px 16px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
}

.season-timer-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.4);
    padding: 10px 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.season-timer-val {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-gold);
    letter-spacing: 1px;
}

.skin-img {
    height: auto;
    max-height: 250px;
    object-fit: contain;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.5));
}

.btn-logout {
    width: 100%;
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-logout:hover {
    background: var(--accent-red);
    color: #fff;
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.player-nickname {
    font-size: 20px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.reg-date {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 15px;
}

.widget-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
}

.widget-box.prime-box {
    background: linear-gradient(135deg, color-mix(in srgb, var(--player-rank-color) 18%, transparent), rgba(0, 0, 0, 0.4));
    border-color: color-mix(in srgb, var(--player-rank-color) 45%, transparent);
    box-shadow: 0 0 20px color-mix(in srgb, var(--player-rank-color) 20%, transparent);
}

.widget-title {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-val {
    font-size: 22px;
    font-weight: 800;
}

.btn-action {
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
    color: #fff;
}

.btn-upgrade {
    background: linear-gradient(135deg, var(--player-rank-color), color-mix(in srgb, var(--player-rank-color) 70%, #000));
    color: #fff;
    border: 1px solid var(--player-rank-color);
}

.btn-deposit {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
}

.btn-action:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-unavailable {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    cursor: default;
}

.profile-inline-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.profile-nick-input {
    flex: 1 1 160px;
    min-width: 140px;
    max-width: 220px;
    padding: 9px 12px;
    font-size: 14px;
}

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

.profile-empty {
    font-size: 13px;
    color: var(--text-muted);
    padding: 8px 2px;
}

.wardrobe-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
    gap: 10px;
}

.wardrobe-item {
    position: relative;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 8px 8px;
    cursor: pointer;
    color: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: border-color 0.2s, transform 0.2s, background 0.2s;
}

.wardrobe-item:hover {
    border-color: rgba(99, 102, 241, 0.55);
    transform: translateY(-1px);
}

.wardrobe-item.is-equipped {
    border-color: rgba(16, 185, 129, 0.65);
    background: rgba(16, 185, 129, 0.1);
}

.wardrobe-item img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    image-rendering: pixelated;
}

.wardrobe-nick {
    font-size: 12px;
    font-weight: 700;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wardrobe-meta {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.2;
}

.wardrobe-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    font-size: 9px;
    font-weight: 800;
    padding: 2px 5px;
    border-radius: 999px;
    background: rgba(16, 185, 129, 0.9);
    color: #04110c;
}

.profile-friends-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

.profile-friends-toolbar .profile-inline-form {
    margin-bottom: 0;
    flex: 1 1 auto;
}

.btn-skin-reset,
.btn-friends-toggle,
.btn-friend-mute {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.btn-friends-toggle.is-closed {
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.35);
}

.btn-friend-danger {
    background: rgba(239, 68, 68, 0.14);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.friends-tabs {
    margin-top: 8px;
}

.friends-panel {
    display: none;
}

.friends-panel.active {
    display: block;
}

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

.friend-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid var(--border-color);
}

.friend-avatar {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    flex-shrink: 0;
    image-rendering: pixelated;
}

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

.friend-name {
    font-size: 14px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
}

.friend-name .top-nick {
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-badge {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
}

.friend-badge.is-online {
    color: #34d399;
}

.friend-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.friend-actions .btn-action {
    padding: 6px 10px;
    font-size: 12px;
}

.stats-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.tab-btn {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    white-space: nowrap;
}

.tab-btn:hover,
.tab-btn.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

.mode-stats-panel {
    display: none;
}

.mode-stats-panel.active {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.mode-stats-panel.active.island-stats {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.island-stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.island-details {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.island-section {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(0, 0, 0, 0.22));
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 16px;
    padding: 0;
    position: relative;
    overflow: hidden;
}

.island-section::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--island-accent, var(--accent-color));
    opacity: 0.9;
    z-index: 1;
}

.island-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 14px 18px;
    cursor: pointer;
    list-style: none;
    user-select: none;
}

.island-section-head::-webkit-details-marker {
    display: none;
}

.island-section-head:hover {
    background: rgba(255, 255, 255, 0.03);
}

.island-section-body {
    padding: 0 18px 16px;
}

.island-section-meta-wrap {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.island-section-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--text-muted);
    border-bottom: 2px solid var(--text-muted);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -4px;
}

.island-section[open] .island-section-chevron {
    transform: rotate(225deg);
    margin-top: 2px;
}

.island-section-title {
    margin: 0;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: #e8eef8;
}

.island-section-meta {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.island-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.island-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 13px;
    color: #f3f4f6;
    font-weight: 600;
}

.island-chip.is-on {
    border-color: rgba(74, 222, 128, 0.35);
    background: rgba(74, 222, 128, 0.1);
}

.island-chip.is-off {
    border-color: rgba(248, 113, 113, 0.28);
    background: rgba(248, 113, 113, 0.08);
}

.island-chip strong {
    color: var(--accent-gold, #f5c542);
    font-weight: 800;
}

.island-chip-muted {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    padding: 4px 0;
}

.island-member {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.island-member-name {
    font-weight: 800;
    font-size: 14px;
}

.island-member-rank {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--member-color, #9ca3af) 22%, transparent);
    color: var(--member-color, #9ca3af);
    border: 1px solid color-mix(in srgb, var(--member-color, #9ca3af) 35%, transparent);
}

.island-upgrade-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px;
}

.island-upgrade {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 12px;
}

.island-upgrade-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 13px;
}

.island-upgrade-name {
    color: #e5e7eb;
    font-weight: 700;
}

.island-upgrade-value {
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.island-upgrade-bar {
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.island-upgrade-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #38bdf8, #818cf8);
    width: 0;
    transition: width 0.35s ease;
}

.island-upgrade.is-max .island-upgrade-fill {
    background: linear-gradient(90deg, #fbbf24, #f59e0b);
}

.island-upgrade-bonus {
    margin-top: 6px;
    font-size: 11px;
    color: #86efac;
    font-weight: 700;
}

.island-progress {
    margin-top: 12px;
}

.island-progress-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.island-quest-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.island-quest-title {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
}

.island-quest-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.45;
}

.island-ach-block {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.island-ach-subtitle {
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.island-ach {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 10px 12px;
}

.island-ach.is-done {
    border-color: rgba(74, 222, 128, 0.25);
    background: rgba(74, 222, 128, 0.08);
}

.island-ach-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.island-ach-name {
    font-size: 13px;
    font-weight: 800;
    color: #f3f4f6;
}

.island-ach-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
}

.island-ach-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.island-ach.is-done .island-ach-desc {
    margin-bottom: 0;
}

.stat-card {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stat-card-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

.stat-card-value {
    font-size: 20px;
    font-weight: 800;
    color: #fff;
}

/* Login */
.login-card {
    max-width: 440px;
    margin: 0 auto;
    width: 100%;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
}

.form-input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    outline: none;
    transition: border-color 0.2s;
}

.form-input:focus {
    border-color: rgba(99, 102, 241, 0.7);
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.login-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    color: #fca5a5;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.login-error.visible {
    display: block;
}

.btn-login-submit {
    background: linear-gradient(135deg, var(--accent-color), #4f46e5);
    color: #fff;
    border: none;
    padding: 14px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 15px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-login-submit:hover {
    opacity: 0.92;
}

.btn-login-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-overlay.open {
    display: flex;
}

.modal-card {
    background: rgba(15, 17, 26, 0.95);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 28px;
    max-width: 480px;
    width: 100%;
    max-height: min(90vh, calc(100dvh - 40px));
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(16px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    margin: auto;
}

.modal-card.modal-card--wide {
    max-width: min(920px, 100%);
}

.modal-card h3 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#modalBody {
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.modal-meta {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 13px;
}

.modal-meta-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.modal-meta-row span:first-child {
    color: var(--text-muted);
}

.modal-price {
    font-size: 24px;
    font-weight: 800;
    color: var(--accent-gold);
    margin-bottom: 18px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    flex-shrink: 0;
    margin-top: 16px;
}

.modal-actions .btn-buy,
.modal-actions .btn-secondary,
.modal-actions .btn-action {
    flex: 1;
    justify-content: center;
    min-width: 120px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-main);
    border: 1px solid var(--border-color);
    padding: 9px 18px;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-decoration: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-message {
    background: rgba(99, 102, 241, 0.12);
    border: 1px solid rgba(99, 102, 241, 0.35);
    color: #c7d2fe;
    padding: 12px 14px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
}

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(15, 17, 26, 0.95);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    z-index: 1100;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    max-width: 90vw;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

footer {
    border-top: 1px solid var(--border-color);
    background: rgba(10, 11, 16, 0.85);
    backdrop-filter: blur(10px);
    padding: 25px 20px;
    margin-top: auto;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
}

.footer-link:hover {
    color: var(--text-main);
}

.legal-doc {
    max-width: 860px;
    margin: 0 auto;
}

.legal-hero {
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.legal-eyebrow {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 10px;
}

.legal-hero h1 {
    font-size: clamp(28px, 4vw, 40px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}

.legal-updated {
    color: var(--text-muted);
    font-size: 14px;
}

.legal-intro {
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 16px;
    padding: 18px 20px;
    margin-bottom: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    color: #e5e7eb;
    line-height: 1.65;
    font-size: 15px;
}

.legal-section {
    margin-bottom: 26px;
}

.legal-section h2 {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 12px;
    color: #f3f4f6;
}

.legal-section p,
.legal-section li {
    color: #d1d5db;
    line-height: 1.7;
    font-size: 15px;
    margin-bottom: 10px;
}

.legal-section ul {
    margin: 0 0 12px 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legal-inline-link {
    color: #93c5fd;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.legal-inline-link:hover {
    color: #bfdbfe;
}

.legal-footer-note {
    margin-top: 10px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: #fde68a;
    font-weight: 600;
    line-height: 1.55;
}

.page,
.mode-content {
    display: none;
}

.page.active {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.mode-content.active {
    display: block;
}

.auth-block {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.lang-switch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    padding: 6px 10px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.lang-btn:hover {
    color: #fff;
}

.lang-btn.active {
    background: var(--accent-color);
    color: #fff;
}

@media (max-width: 980px) {
    .grief-ranks-grid,
    .products-grid:has(> :nth-child(4):last-child) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 850px) {
    .profile-shell {
        grid-template-columns: 1fr;
    }

    .profile-aside {
        position: static;
    }

    .profile-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        scrollbar-width: none;
    }

    .profile-nav::-webkit-scrollbar { display: none; }

    .profile-nav-btn {
        width: auto;
        flex-shrink: 0;
        white-space: nowrap;
    }

    .profile-skin-wrap {
        max-height: 220px;
        aspect-ratio: 1 / 1;
        max-width: 180px;
        margin: 0 auto;
    }
}

@media (max-width: 960px) {
    .home-visit-grid {
        grid-template-columns: 1fr;
    }

    .home-news-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 650px) {
    .home-visit {
        padding: 22px 18px;
    }

    .home-ip-card {
        flex-direction: column;
        align-items: stretch;
    }

    .home-ip-copy,
    .home-visit-actions .btn-hero-primary,
    .home-visit-store {
        width: 100%;
        justify-content: center;
    }

    .news-card,
    .news-card-compact {
        flex-direction: column;
    }

    .news-preview,
    .news-card-compact .news-preview {
        width: 100%;
        min-width: 0;
        height: 160px;
    }

    .main-nav,
    .mode-tabs {
        flex-direction: column;
    }

    header,
    .site-header {
        flex-direction: column;
        align-items: center;
        padding: 16px 16px 8px;
    }

    .auth-block {
        justify-content: center;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
    }

    .products-grid,
    .products-grid:has(> :nth-child(3):last-child),
    .products-grid:has(> :nth-child(4):last-child),
    .grief-ranks-grid {
        grid-template-columns: 1fr;
    }

    .section-header-split {
        flex-direction: column;
        align-items: flex-start;
    }

    .section-header-split .btn-compare-ranks {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .brand h1 {
        font-size: 22px;
    }

    .prime-selector {
        flex-direction: column;
    }

    .stats-tabs {
        grid-template-columns: 1fr;
    }
}

/* ---- Staff tools ---- */
.staff-tools {
    margin-top: 16px;
}

/* ================= Online Badge Enhanced ================= */
.online-badge {
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.online-badge::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 10px #10b981;
    animation: live-pulse 2s infinite ease-in-out;
}
.online-badge:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(99, 102, 241, 0.3);
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

/* ================= Header Command Palette Button ================= */
.btn-cmd-palette {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.btn-cmd-palette:hover {
    background: rgba(255, 255, 255, 0.09);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-main);
}
.btn-cmd-palette i, .btn-cmd-palette svg {
    width: 16px;
    height: 16px;
}
.cmd-key {
    display: none;
}

/* ================= Hero ================= */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 18px 12px 8px;
    margin-bottom: 0;
    position: relative;
}
.hero-title {
    font-size: clamp(24px, 4vw, 36px);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 10px;
    color: #fff;
}
.hero-sub {
    font-size: clamp(14px, 2vw, 16px);
    color: var(--text-muted);
    max-width: 560px;
    line-height: 1.5;
    margin-bottom: 20px;
}
.btn-hero-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}
.btn-hero-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}
.btn-hero-primary i, .btn-hero-primary svg {
    width: 17px;
    height: 17px;
}

.section-header-split {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.section-header-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.section-header-split .btn-compare-ranks {
    margin-left: auto;
}

.compare-ranks-bar {
    display: none;
}
.btn-compare-ranks {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.btn-compare-ranks:hover {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.6);
}
.btn-compare-ranks i, .btn-compare-ranks svg {
    width: 15px;
    height: 15px;
}

/* ================= Compare Ranks Modal ================= */
.compare-ranks-modal {
    width: 100%;
    margin-top: 4px;
}
.compare-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
}
.compare-table th, .compare-table td {
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.compare-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: rgba(15, 17, 26, 0.98);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.07);
}
.compare-table th {
    background: rgba(255, 255, 255, 0.03);
    font-weight: 700;
}
.compare-feature-cell {
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
}
.compare-check {
    color: #10b981;
    font-weight: bold;
    font-size: 15px;
}
.compare-cross {
    color: rgba(255, 255, 255, 0.25);
}
.compare-table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

@media (max-width: 700px) {
    .modal-overlay {
        padding: 12px;
        align-items: flex-start;
    }

    .modal-card {
        padding: 18px 14px;
        max-height: min(92vh, calc(100dvh - 24px));
        border-radius: 14px;
    }

    .modal-card h3 {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .compare-table {
        font-size: 12px;
        min-width: 560px;
    }

    .compare-table th, .compare-table td {
        padding: 8px 6px;
    }
}

/* ================= Profile Punish Banner & 2FA ================= */
.profile-punish-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    margin-bottom: 20px;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 14px;
    backdrop-filter: blur(12px);
    flex-wrap: wrap;
}
.punish-banner-left {
    display: flex;
    align-items: center;
    gap: 14px;
}
.punish-banner-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.punish-banner-title {
    font-size: 14px;
    font-weight: 700;
    color: #fca5a5;
}
.punish-banner-sub {
    font-size: 12px;
    color: #fecaca;
    margin-top: 2px;
}
.punish-banner-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.security-widget {
    border-color: rgba(99, 102, 241, 0.25);
}
.security-widget.sec-active {
    border-color: rgba(16, 185, 129, 0.35);
}
.security-widget.sec-active .widget-val {
    color: #10b981;
}
.security-widget.sec-warning {
    border-color: rgba(245, 158, 11, 0.35);
}
.security-widget.sec-warning .widget-val {
    color: #f59e0b;
}

/* ================= Buyer Preview in Purchase Modal ================= */
.gift-target {
    margin-bottom: 16px;
}

.gift-mode-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.gift-mode-tab {
    appearance: none;
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    border-radius: 10px;
    padding: 9px 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.gift-mode-tab:hover {
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.18);
}

.gift-mode-tab.is-active {
    color: #fff;
    background: rgba(99, 102, 241, 0.22);
    border-color: rgba(129, 140, 248, 0.55);
}

.gift-recipient-field {
    margin-top: 10px;
}

.gift-recipient-field[hidden] {
    display: none !important;
}

.gift-recipient-field .promo-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.modal-buyer-preview {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    margin-bottom: 0;
}

.gift-target .modal-buyer-preview {
    margin-bottom: 0;
}
.buyer-avatar {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.15);
}
.buyer-info-label {
    font-size: 11px;
    color: var(--text-muted);
}
.buyer-info-nick {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
}

/* ================= Command Palette ================= */
.cmd-palette-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(10, 12, 16, 0.75);
    backdrop-filter: blur(16px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 100px 20px 20px;
}
.cmd-palette-card {
    background: #141721;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    max-width: 580px;
    width: 100%;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(99, 102, 241, 0.25);
    overflow: hidden;
    animation: cmd-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cmd-pop {
    from { opacity: 0; transform: scale(0.96) translateY(-10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
.cmd-palette-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.cmd-palette-input-wrap i, .cmd-palette-input-wrap svg {
    color: var(--accent-color);
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}
#cmdPaletteInput {
    flex: 1;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    outline: none;
}
.cmd-badge {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-weight: 700;
}
.cmd-palette-list {
    max-height: 380px;
    overflow-y: auto;
    padding: 8px;
}
.cmd-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    color: var(--text-main);
    transition: all 0.15s ease;
}
.cmd-item:hover, .cmd-item.active {
    background: rgba(99, 102, 241, 0.15);
    color: #ffffff;
}
.cmd-item-left {
    display: flex;
    align-items: center;
    gap: 12px;
}
.cmd-item-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}
.cmd-item-title {
    font-size: 14px;
    font-weight: 600;
}
.cmd-item-desc {
    font-size: 11px;
    color: var(--text-muted);
}
.cmd-item-badge {
    font-size: 11px;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 2px 8px;
    border-radius: 6px;
}

/* ================= Mobile Bottom Navigation ================= */
.mobile-bottom-nav {
    display: none;
}
@media (max-width: 650px) {
    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 9999;
        background: rgba(15, 17, 23, 0.88);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        padding: 6px 10px calc(6px + env(safe-area-inset-bottom));
        justify-content: space-around;
        box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.5);
    }
    .mobile-nav-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        background: none;
        border: none;
        color: var(--text-muted);
        text-decoration: none;
        font-size: 10px;
        font-weight: 600;
        padding: 6px 10px;
        border-radius: 8px;
        transition: color 0.2s ease;
    }
    .mobile-nav-btn i, .mobile-nav-btn svg {
        width: 18px;
        height: 18px;
    }
    .mobile-nav-btn.active, .mobile-nav-btn:hover {
        color: var(--accent-color);
    }
    body {
        padding-bottom: 70px;
    }
}

/* ================= Wiki / Guide ================= */
.wiki-shell {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}
.wiki-stage {
    min-width: 0;
    padding: 22px 24px 28px;
    border-radius: 16px;
    background: #12151c;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.wiki-panel { display: none; }
.wiki-panel.active { display: block; }
.wiki-hero {
    margin-bottom: 22px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.wiki-hero h2 {
    font-size: clamp(22px, 3vw, 30px);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 0 0 8px;
    color: #f3f4f6;
}
.wiki-lead {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.55;
    margin: 0;
    max-width: 62ch;
}
.wiki-block {
    margin-bottom: 22px;
}
.wiki-block:last-child { margin-bottom: 0; }
.wiki-block h3 {
    font-size: 16px;
    font-weight: 800;
    color: #f3f4f6;
    margin: 0 0 10px;
}
.wiki-block p,
.wiki-block li {
    color: #d1d5db;
    line-height: 1.65;
    font-size: 14px;
    margin: 0 0 8px;
}
.wiki-block ul,
.wiki-block ol {
    margin: 0 0 4px 1.15rem;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.wiki-steps { list-style: decimal; }
.wiki-callout {
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.22);
    border-radius: 14px;
    padding: 14px 16px;
}
.wiki-callout-warn {
    background: rgba(245, 158, 11, 0.08);
    border-color: rgba(245, 158, 11, 0.28);
}
.wiki-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.wiki-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.wiki-table th,
.wiki-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    color: #d1d5db;
}
.wiki-table th {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.03);
}
.wiki-table tr:last-child td { border-bottom: none; }
.wiki-table td:first-child {
    font-weight: 700;
    color: #e5e7eb;
    white-space: nowrap;
    width: 4.5rem;
}
.wiki-table code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: #93c5fd;
    background: rgba(147, 197, 253, 0.1);
    padding: 2px 6px;
    border-radius: 6px;
}
@media (max-width: 860px) {
    .wiki-shell {
        grid-template-columns: 1fr;
    }
    .wiki-shell .store-rail {
        position: static;
    }
    .wiki-shell .store-rail-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 6px;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .wiki-shell .store-tab {
        min-width: 148px;
        flex-shrink: 0;
    }
    .wiki-stage {
        padding: 18px 16px 22px;
    }
}

/* ---------- promo codes ---------- */

.promo-box {
    margin-bottom: 16px;
}

.promo-box-row {
    display: flex;
    gap: 8px;
}

.promo-box-row .promo-input {
    flex: 1;
    min-width: 0;
    text-transform: uppercase;
    padding: 10px 12px;
    font-size: 14px;
}

.promo-box-result {
    font-size: 13px;
    margin-top: 8px;
    line-height: 1.45;
}

.promo-box-result:empty {
    display: none;
}

.promo-box-result.is-ok {
    color: var(--accent-green);
}

.promo-box-result.is-error {
    color: var(--accent-red);
}

.promo-old-price {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 600;
    margin-right: 6px;
}

.promo-bonus-list {
    margin: 0 0 16px 18px;
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.6;
}

.promo-block + .promo-block {
    margin-top: 28px;
}

.promo-block-title {
    font-size: 16px;
    font-weight: 800;
    margin: 18px 0 10px;
}

.promo-form {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.promo-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
}

.promo-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.promo-field[hidden],
.profile-nav-btn[hidden],
.promo-block[hidden],
#promoAccessHint[hidden] {
    display: none !important;
}

.promo-field .form-input,
.promo-reward-row .form-input {
    padding: 9px 11px;
    font-size: 14px;
}

.promo-rewards-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 8px;
}

.promo-reward-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.promo-reward-row {
    display: grid;
    grid-template-columns: minmax(150px, 1.3fr) minmax(140px, 1.2fr) 110px auto;
    gap: 8px;
    align-items: center;
}

.promo-reward-row [data-rw-param][hidden] {
    display: block;
    visibility: hidden;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.btn-sm svg {
    width: 15px;
    height: 15px;
}

.promo-form-error {
    color: var(--accent-red);
    font-size: 13px;
}

.promo-form-error:empty {
    display: none;
}

.promo-form .btn-action {
    align-self: flex-start;
}

.promo-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.promo-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    padding: 14px 16px;
}

.promo-card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.promo-card-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--accent-gold);
}

.promo-status {
    font-size: 12px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
}

.promo-status.is-active {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.promo-status.is-off {
    background: rgba(156, 163, 175, 0.15);
    color: var(--text-muted);
}

.promo-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px 16px;
    font-size: 13px;
}

.promo-card-grid > div {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.promo-card-grid span {
    color: var(--text-muted);
    font-size: 12px;
}

.promo-card-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 12px;
}

.promo-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.promo-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.promo-table th,
.promo-table td {
    text-align: left;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.promo-table th {
    color: var(--text-muted);
    font-weight: 600;
}

.promo-table s {
    color: var(--text-muted);
}

@media (max-width: 640px) {
    .promo-reward-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Telegram 2FA */
.btn-link-muted {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px;
    align-self: center;
}

.btn-link-muted:hover {
    color: var(--text-main);
}

.login-form[hidden],
.btn-login-submit[hidden],
.tfa-wait[hidden],
#securityChangeBlock[hidden] {
    display: none;
}

.tfa-wait {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 8px 0;
}

.tfa-wait-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
    animation: tfa-pulse 1.6s ease-in-out infinite;
}

.tfa-wait-icon svg {
    width: 26px;
    height: 26px;
}

.tfa-wait-title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
}

.tfa-timer {
    font-size: 22px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    color: var(--text-main);
}

.tfa-wait .login-error {
    width: 100%;
}

@keyframes tfa-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.35); }
    50% { box-shadow: 0 0 0 10px rgba(56, 189, 248, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .tfa-wait-icon { animation: none; }
}

.security-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 440px;
}

.security-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.security-row-ico {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: rgba(56, 189, 248, 0.12);
    color: #38bdf8;
}

.security-row-ico svg {
    width: 20px;
    height: 20px;
}

.tfa-wait-icon.is-vk,
.security-row-ico.is-vk {
    background: rgba(0, 119, 255, 0.14);
    color: #4a9dff;
}

.vk-mark {
    font-weight: 900;
    font-size: 15px;
    letter-spacing: -0.5px;
    line-height: 1;
}

.tfa-wait-icon .vk-mark {
    font-size: 19px;
}

.security-row-title {
    font-weight: 800;
    font-size: 15px;
}

#securityChangeBlock {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Nickname change */
.profile-nick-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-nick-edit {
    flex: none;
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
}

.btn-nick-edit:hover {
    color: var(--text-main);
    border-color: rgba(99, 102, 241, 0.7);
}

.btn-nick-edit svg {
    width: 15px;
    height: 15px;
}

.nick-modal {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
}

.nick-price {
    font-size: 14px;
    color: var(--text-main);
}

.nick-price-free {
    color: var(--accent-green);
    font-weight: 700;
}

.nick-balance {
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 6px;
}

.nick-history {
    font-size: 13px;
    color: var(--text-muted);
}

.nick-history summary {
    cursor: pointer;
    font-weight: 600;
}

.nick-history ul {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

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

.nick-history-date {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* ---- Localization editor (/admin/i18n) ---- */
.btn-staff-loc {
    width: 100%;
    justify-content: center;
    margin-top: 8px;
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    border-color: #a78bfa;
}

.loc-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 18px;
}

.loc-title {
    margin-top: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.loc-header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.loc-error {
    border: 1px solid color-mix(in srgb, var(--accent-red) 55%, var(--border-color));
    background: color-mix(in srgb, var(--accent-red) 12%, transparent);
    color: var(--text-main);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.loc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.loc-stat {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 12px;
}

.loc-stat-head {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.loc-stat-head span:last-child {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.loc-stat-bar {
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.loc-stat-bar div {
    height: 100%;
    background: var(--accent-green);
    border-radius: 3px;
}

.loc-toolbar {
    display: grid;
    grid-template-columns: 160px 180px 260px minmax(0, 1fr);
    gap: 10px;
    margin-bottom: 16px;
}

.loc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.loc-field > span,
.loc-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.loc-field .form-input {
    width: 100%;
    min-width: 0;
    padding: 9px 12px;
    font-size: 14px;
}

.loc-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.loc-row {
    border: 1px solid var(--border-color);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 14px;
}

.loc-row-head {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.loc-key {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    overflow-wrap: anywhere;
}

.loc-chip,
.loc-flag {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--text-muted);
    white-space: nowrap;
}

.loc-flag-missing {
    background: color-mix(in srgb, var(--accent-red) 18%, transparent);
    color: #fca5a5;
}

.loc-flag-outdated {
    background: color-mix(in srgb, var(--accent-gold) 18%, transparent);
    color: #fcd34d;
}

.loc-flag-code {
    background: color-mix(in srgb, var(--accent-color) 22%, transparent);
    color: #c7d2fe;
}

.loc-row-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-muted);
}

.loc-cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}

.loc-cols-single {
    grid-template-columns: minmax(0, 1fr);
}

.loc-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.loc-preview {
    background: #1b1d24;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #ffffff;
    overflow-wrap: anywhere;
    min-height: 38px;
}

.loc-preview-empty {
    color: var(--text-muted);
    font-style: italic;
}

.loc-ink-action {
    text-decoration: underline dotted;
    cursor: help;
}

.loc-raw {
    margin: 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-muted);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.loc-text {
    width: 100%;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.5;
    resize: vertical;
}

.loc-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.loc-save {
    background: linear-gradient(135deg, var(--accent-green), #059669);
}

.loc-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.loc-status.is-ok {
    color: var(--accent-green);
}

.loc-status.is-error {
    color: #fca5a5;
}

.loc-status.is-dirty {
    color: #fcd34d;
}

.loc-more {
    display: flex;
    justify-content: center;
    margin-top: 16px;
}

.modal-card.loc-modal {
    max-width: 760px;
    width: min(760px, calc(100vw - 32px));
}

.loc-revs {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 55vh;
    overflow-y: auto;
    margin-top: 12px;
}

.loc-rev {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.loc-rev.is-current {
    border-color: color-mix(in srgb, var(--accent-green) 50%, var(--border-color));
}

.loc-rev-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 12px;
    color: var(--text-muted);
}

.loc-rev-head code {
    color: var(--text-main);
}

.loc-rev-note {
    font-size: 12px;
    color: #fcd34d;
}

.loc-rev-btn {
    padding: 5px 12px;
    font-size: 12px;
}

.loc-audit-tools {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.loc-audit-tools .form-input {
    padding: 8px 12px;
    font-size: 14px;
    flex: 1 1 160px;
    min-width: 0;
}

.loc-audit-tools input[type="number"] {
    flex: 0 0 90px;
}

.loc-danger {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--accent-red) 40%, var(--border-color));
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.loc-danger-btn {
    background: linear-gradient(135deg, var(--accent-red), #b91c1c);
}

@media (max-width: 900px) {
    .loc-toolbar {
        grid-template-columns: 1fr 1fr;
    }

    .loc-cols {
        grid-template-columns: minmax(0, 1fr);
    }

    .loc-row-meta {
        margin-left: 0;
        width: 100%;
    }
}
