﻿/* ============================================
   ИМПОРТ ШРИФТА SPACE GROTESK
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap');

/* ============================================
   БАЗОВЫЕ СТИЛИ
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Space Grotesk', sans-serif;
}

body {
    background-image: url('/images/background3.jpg');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--color-text-primary);
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 400;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 16px;
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border-default);
    border-radius: var(--border-radius-card);
    min-height: 60px;
}

.user-info {
    font-size: 14px;
    font-weight: 400;
    color: var(--color-text-secondary);
    display: flex;
    align-items: center;
    gap: 12px;
    height: 100%;
}

.header-logo {
    height: 100%;
    width: auto;
    max-height: 60px;
    object-fit: contain;
    border-radius: 4px;
    margin: 5px 0;
}

#username {
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 100%;
}

.balance-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.balance {
    background: var(--color-bg-hover);
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--color-text-accent);
    border: 1px solid var(--color-border-accent);
    font-size: 15px;
}

    .balance span {
        vertical-align: middle;
    }

.currency-coin {
    width: 30px;
    height: 30px;
    vertical-align: middle;
    display: inline-block;
    filter: drop-shadow(0 2px 4px rgba(255, 215, 0, 0.5));
    transition: filter 0.2s ease;
}

    .currency-coin:hover {
        filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.8));
    }

.deposit-btn {
    background: var(--gradient-button-pink);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-default);
    color: var(--color-bg-primary);
    font-weight: 500;
}

    .deposit-btn:hover {
        transform: scale(1.1);
        box-shadow: var(--shadow-card);
    }

/* Навигация */
.nav-menu {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.nav-btn {
    flex: 1;
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border-default);
    border-radius: var(--border-radius-button);
    padding: 10px;
    color: var(--color-text-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-default);
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: 0.3px;
}

    .nav-btn:hover {
        border-color: var(--color-border-hover);
        background: var(--color-bg-hover);
    }

    .nav-btn.active {
        background: var(--gradient-button-pink);
        border-color: var(--color-border-active);
        color: var(--color-bg-primary);
        font-weight: 600;
    }

/* Секции */
.section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s;
}

    .section.active {
        display: block;
        opacity: 1;
    }

/* Модальные окна – обёртка */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

    .modal.active {
        display: flex;
    }

/* ЕДИНЫЙ СТИЛЬ "ЖИДКОЕ СТЕКЛО" ДЛЯ МОДАЛЬНЫХ ОКОН */
.modal-glass {
    background: rgba(26, 16, 34, 0.7) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: var(--border-radius-modal) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    color: var(--color-text-primary) !important;
    animation: modalAppear 0.3s ease;
}

/* ============================================
   УНИВЕРСАЛЬНЫЙ СТИЛЬ "ЖИДКОЕ СТЕКЛО" ДЛЯ ПАНЕЛЕЙ
   ============================================ */
.glass-panel {
    background: rgba(26, 16, 34, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    border-radius: var(--border-radius-card);
    color: var(--color-text-primary);
    transition: var(--transition-default);
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Единый стиль кнопки закрытия */
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #b8a9c9;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 9999;
    font-family: 'Space Grotesk', sans-serif;
    line-height: 1;
    pointer-events: auto;
}

    .modal-close-btn:hover {
        color: var(--color-text-accent);
        transform: scale(1.1);
    }

/* Защита контента от кнопки закрытия */
.modal-header,
.case-modal-header,
.item-detail-header,
.drop-detail-header,
.upgrade-result-header {
    padding-right: 50px !important;
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

    .modal-header h2,
    .case-modal-header h2,
    .item-detail-header h2,
    .drop-detail-header h2,
    .upgrade-result-header h2 {
        max-width: 100%;
        word-break: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
        line-height: 1.3;
    }

/* Скроллбар */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg-tertiary);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: var(--color-border-default);
    border-radius: 10px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: var(--color-border-hover);
    }

/* Утилиты */
.hidden {
    display: none !important;
}

/* Тосты */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border-hover);
    border-radius: var(--border-radius-button);
    padding: 12px 20px;
    color: var(--color-text-primary);
    font-size: 14px;
    z-index: 2000;
    animation: toastAppear 0.3s ease;
    box-shadow: var(--shadow-card);
    font-family: 'Space Grotesk', sans-serif;
}

@keyframes toastAppear {
    from {
        opacity: 0;
        transform: translate(-50%, 20px);
    }

    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

/* Экран загрузки */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--color-bg-primary);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease;
    margin: 0;
    padding: 20px;
    overflow: hidden;
    box-sizing: border-box;
}

    #loading-screen.hidden {
        opacity: 0;
        pointer-events: none;
    }

.loading-logo {
    max-width: calc(100% - 5px);
    max-height: calc(100% - 40px);
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 5px;
    animation: logoPulse 2s ease-in-out infinite;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid var(--color-border-default);
    border-top: 6px solid var(--color-border-hover);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    flex-shrink: 0;
}

.loading-text {
    color: var(--color-text-primary);
    font-size: 20px;
    font-weight: 500;
    letter-spacing: 1px;
    text-shadow: 0 0 10px var(--color-border-accent);
    font-family: 'Space Grotesk', sans-serif;
    text-align: center;
    padding: 0 10px;
    max-width: 100%;
    word-wrap: break-word;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes logoPulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.1);
        opacity: 0.9;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Кнопка "наверх" */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-bg-tertiary);
    border: 2px solid var(--color-border-hover);
    color: var(--color-text-accent);
    font-size: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: var(--transition-default);
    z-index: 999;
    box-shadow: var(--shadow-card);
    font-family: 'Space Grotesk', sans-serif;
}

    .scroll-to-top:hover {
        transform: translateY(-5px);
        box-shadow: var(--shadow-card-hover);
    }

/* Единый стиль для основных кнопок (продать всё, сохранить и т.п.) */
.btn-primary {
    background: var(--gradient-button-pink);
    border: none;
    border-radius: var(--border-radius-button);
    color: var(--color-bg-primary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-default);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

    .btn-primary:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-card-hover);
        background: var(--gradient-button-pink-hover);
    }

    .btn-primary:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        background: var(--color-border-default);
        color: var(--color-text-disabled);
        transform: none;
        box-shadow: none;
    }
