/* ==========================================
   UPGRADE SCREEN - Верхние вкладки
   ========================================== */

/* Создаем фиксированный фон для всего экрана апгрейда */
body.upgrade-screen-active::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('assets/upgrade-bg.svg'),
        linear-gradient(to bottom, #0a0a1a, #111827, #0a0a1a);
    background-position: top left, 0 0;
    background-size: cover, cover;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
    z-index: 0;
    pointer-events: none;
}

#upgrade-screen {
    position: relative;
    z-index: 1;
}

.upgrade-top-tabs {
    position: relative;
    display: flex;
    gap: 0;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 3px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    margin: 0 auto;
    align-items: center;
    min-height: 48px;
    overflow: hidden;
}

#upgrade-top-slider {
    position: absolute;
    top: 3px;
    left: 0;
    height: calc(100% - 6px);
    width: 0;
    background: linear-gradient(to bottom, #fbbf24 0%, #f59e0b 100%);
    border-radius: 17px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.3s ease, opacity 0.25s ease;
    z-index: 1;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
}

#upgrade-top-slider.visible {
    opacity: 1;
}

.upgrade-top-btn {
    position: relative;
    z-index: 2;
    padding: 10px 12px;
    flex: 1;
    border-radius: 17px;
    border: none;
    color: #666;
    background: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.upgrade-top-btn:hover {
    color: #fff;
}

.upgrade-top-btn.active {
    color: #1a1a1a;
}

.upgrade-empty-state {
    border: 1px dashed rgba(148, 163, 184, 0.6);
    border-radius: 16px;
    padding: 16px 12px;
    background: rgba(17, 24, 39, 0.7);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.upgrade-empty-arrow {
    font-size: 26px;
    color: #fbbf24;
    animation: upgradeArrow 1.3s ease-in-out infinite;
    margin-bottom: 6px;
}

@keyframes upgradeArrow {

    0%,
    100% {
        transform: translateY(2px);
        opacity: 0.7;
    }

    50% {
        transform: translateY(-6px);
        opacity: 1;
    }
}

.upgrade-panel {
    width: 100%;
}

#upgrade-screen {
    position: relative;
    z-index: 1;
    background: linear-gradient(to bottom, #0a0a1a, #111827, #0a0a1a);
    min-height: 100vh;
}

#upgrade-screen>* {
    position: relative;
    z-index: 1;
}

.upgrade-toggle {
    margin-left: auto;
    margin-right: auto;
    margin-top: 5px;
}

/* ==========================================
   UPGRADE SCREEN - Переключатель табов
   ========================================== */

/* Toggle Container */
.upgrade-toggle {
    display: flex;
    position: relative;
    background: #1a1a1a;
    border-radius: 20px;
    padding: 3px;
    border: 1px solid #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    width: 240px;
}

/* Toggle Slider */
#upgrade-toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: calc(50% - 3px);
    height: calc(100% - 6px);
    background: linear-gradient(to bottom, #fbbf24 0%, #f59e0b 100%);
    border-radius: 17px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
}

#upgrade-toggle-slider.right {
    transform: translateX(calc(100% + 3px));
}

/* Toggle Buttons */
.upgrade-tab-btn {
    position: relative;
    z-index: 2;
    flex: 1;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 600;
    color: #666;
    background: none;
    border: none;
    border-radius: 17px;
    cursor: pointer;
    transition: color 0.2s;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.upgrade-tab-btn.active {
    color: #1a1a1a;
}

/* Tab Content */
.upgrade-tab-content {
    display: none;
}

.upgrade-tab-content.active {
    display: block;
}

/* Stat blocked state */
.coin-stat-row.blocked {
    opacity: 0.5;
}

.coin-stat-row.blocked .coin-stat-btn {
    background: #4b5563 !important;
    cursor: not-allowed;
}

.coin-stat-row.maxed .coin-stat-btn {
    background: #4b5563 !important;
    cursor: not-allowed;
}

/* ==========================================
   SHOP SCREEN - Верхние вкладки (Магазин | Рынок)
   ========================================== */

#shop-top-slider {
    position: absolute;
    top: 3px;
    left: 0;
    height: calc(100% - 6px);
    width: 0;
    background: linear-gradient(to bottom, #fbbf24 0%, #f59e0b 100%);
    border-radius: 17px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), width 0.3s ease, opacity 0.25s ease;
    z-index: 1;
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -1px 0 rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
}

#shop-top-slider.visible {
    opacity: 1;
}

.shop-top-btn {
    position: relative;
    z-index: 2;
    padding: 10px 12px;
    flex: 1;
    border-radius: 17px;
    border: none;
    color: #666;
    background: none;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: color 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    text-align: center;
}

.shop-top-btn:hover {
    color: #fff;
}

.shop-top-btn.active {
    color: #1a1a1a;
}

.shop-panel {
    width: 100%;
}