/* ============================================
   ПРОФИЛЬ — отдельная страница
   ============================================ */

.profile-page {
    /* фон берётся из style.css (body) */
}

/* ============================================
   ЛЕВЫЙ ВЕРХНИЙ УГОЛ — кружок с 3 полосками
   + выезжающее вправо меню
   ============================================ */
.side-menu {
    position: fixed;
    top: 30px;
    left: 20px;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* ---------- Круглая кнопка с полосками ---------- */
.side-menu-toggle {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 50%;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;

    border: 1.5px solid rgba(150, 180, 255, 0.5);
    background: rgba(20, 30, 80, 0.35);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);

    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(80, 120, 255, 0.25),
        inset 0 1px 0 rgba(150, 180, 255, 0.35);

    cursor: pointer;
    transition:
        background 0.3s,
        border-color 0.3s,
        box-shadow 0.3s,
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.side-menu-toggle:hover {
    background: rgba(50, 80, 180, 0.5);
    border-color: rgba(150, 180, 255, 0.9);
    box-shadow:
        0 8px 32px rgba(80, 120, 255, 0.55),
        0 0 45px rgba(80, 120, 255, 0.4),
        inset 0 1px 0 rgba(180, 200, 255, 0.55);
}

.side-menu-line {
    display: block;
    width: 20px;
    height: 2.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, #ffffff, #8ab4ff);
    box-shadow: 0 0 8px rgba(120, 160, 255, 0.9);
    transition:
        transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.25s,
        width 0.25s;
}

/* Превращаем в X при открытом меню */
.side-menu.open .side-menu-toggle .side-menu-line:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}
.side-menu.open .side-menu-toggle .side-menu-line:nth-child(2) {
    opacity: 0;
    width: 0;
}
.side-menu.open .side-menu-toggle .side-menu-line:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ---------- Панель меню ---------- */
.side-menu-panel {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;

    padding: 8px;

    border-radius: 999px;
    border: 1.5px solid rgba(150, 180, 255, 0.5);
    background: rgba(20, 30, 80, 0.35);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(15px) saturate(180%);

    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.5),
        0 0 30px rgba(80, 120, 255, 0.25),
        inset 0 1px 0 rgba(150, 180, 255, 0.35);

    transform-origin: left center;
    transform: scaleX(0);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
        opacity 0.3s,
        visibility 0.3s;
}

.side-menu.open .side-menu-panel {
    transform: scaleX(1);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* ---------- Кнопки меню ---------- */
.side-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;

    padding: 10px 16px;
    border-radius: 999px;

    color: #e6ecff;
    text-decoration: none;
    font-family: inherit;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    white-space: nowrap;

    transition:
        background 0.25s,
        color 0.25s,
        transform 0.25s,
        box-shadow 0.3s;
}

.side-menu-item:hover {
    background: rgba(80, 120, 255, 0.35);
    color: #ffffff;
    box-shadow:
        0 0 20px rgba(80, 120, 255, 0.5),
        inset 0 1px 0 rgba(180, 200, 255, 0.5);
    transform: translateY(-2px);
}

.side-menu-item:hover .side-menu-item-icon {
    transform: scale(1.15);
}

.side-menu-item-icon {
    font-size: 1.25rem;
    filter: drop-shadow(0 0 8px rgba(120, 160, 255, 0.9));
    transition: transform 0.25s;
    line-height: 1;
}

.side-menu-item-text {
    line-height: 1;
    color: rgba(200, 215, 255, 0.9);
}

/* ============================================
   Верхний овал: баланс + ник без стрелки и без меню
   ============================================ */
.user-oval-static {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
    align-items: center;
    gap: 14px;
}

.user-oval-static .user-name {
    pointer-events: none;
}

/* ============================================
   ПАНЕЛЬ ПРОФИЛЯ
   ============================================ */
.profile-panel {
    position: fixed;
    top: 100px;
    right: 20px;

    width: 320px;
    padding: 20px;

    display: flex;
    flex-direction: column;
    gap: 16px;

    border-radius: 22px;

    border: 1.5px solid rgba(150, 180, 255, 0.55);
    background: rgba(20, 30, 80, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.55),
        0 0 60px rgba(80, 120, 255, 0.25),
        inset 0 2px 0 rgba(150, 180, 255, 0.45);

    z-index: 50;
    animation: fadeUp 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Кнопка настроек + меню ---------- */
.profile-settings-wrap {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 60;
}

.profile-settings-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;

    display: flex;
    align-items: center;
    justify-content: center;

    border: 1.5px solid rgba(150, 180, 255, 0.6);
    background: rgba(20, 30, 80, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);

    color: #e6ecff;
    cursor: pointer;

    box-shadow:
        0 2px 12px rgba(0, 0, 0, 0.5),
        0 0 18px rgba(80, 120, 255, 0.35),
        inset 0 1px 0 rgba(180, 200, 255, 0.4);

    transition: transform 0.3s, background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.profile-settings-btn:hover {
    transform: rotate(60deg);
    background: rgba(50, 80, 180, 0.7);
    border-color: rgba(180, 200, 255, 0.95);
    box-shadow:
        0 4px 18px rgba(80, 120, 255, 0.6),
        0 0 30px rgba(80, 120, 255, 0.5);
}

.profile-settings-icon {
    font-size: 1rem;
    filter: drop-shadow(0 0 6px rgba(120, 160, 255, 0.9));
    line-height: 1;
}

.profile-settings-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;

    min-width: 190px;
    padding: 6px 0;

    border-radius: 14px;

    border: 1.5px solid rgba(150, 180, 255, 0.55);
    background: rgba(15, 25, 70, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);

    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.65),
        0 0 30px rgba(80, 120, 255, 0.35),
        inset 0 1px 0 rgba(150, 180, 255, 0.4);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.96);
    transform-origin: top right;

    transition:
        opacity 0.25s,
        transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
        visibility 0.25s;
}

.profile-settings-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.profile-settings-item {
    display: flex;
    align-items: center;
    gap: 10px;

    width: 100%;
    padding: 10px 16px;

    background: none;
    border: none;
    cursor: pointer;

    color: #e6ecff;
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-align: left;

    transition: background 0.25s, color 0.25s, padding-left 0.25s;
}

.profile-settings-item:hover {
    background: rgba(120, 160, 255, 0.25);
    color: #ffffff;
    padding-left: 22px;
}

.profile-settings-item-icon {
    font-size: 1rem;
    filter: drop-shadow(0 0 6px rgba(120, 160, 255, 0.9));
}

/* ---------- Шапка панели: аватар + ник + ранг ---------- */
.profile-panel-head {
    display: flex;
    align-items: center;
    gap: 14px;

    padding-bottom: 14px;
    padding-right: 40px;
    border-bottom: 1.5px solid rgba(150, 180, 255, 0.25);
}

.profile-panel-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    flex-shrink: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 1.4rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.7);

    background: linear-gradient(135deg, #4d6bff, #8ab4ff);

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    box-shadow:
        0 0 18px rgba(80, 120, 255, 0.6),
        inset 0 2px 0 rgba(255, 255, 255, 0.4);

    transition: background 0.4s;
    overflow: hidden;
}

.profile-panel-avatar.has-image {
    color: transparent;
    text-shadow: none;
}

.profile-panel-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-panel-name {
    font-size: 1rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;

    background: linear-gradient(90deg, #ffffff, #8ab4ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 10px rgba(120, 160, 255, 0.8));

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.profile-panel-rank {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(200, 215, 255, 0.75);
}

.profile-panel-rank span {
    color: #8ab4ff;
    text-shadow: 0 0 8px rgba(120, 160, 255, 1);
}

/* ---------- Сетка статов 2x3 ---------- */
.profile-panel-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.profile-panel-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;

    padding: 12px 8px;
    border-radius: 12px;

    border: 1.5px solid rgba(150, 180, 255, 0.35);
    background: rgba(15, 25, 70, 0.5);

    box-shadow:
        0 3px 12px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(150, 180, 255, 0.3);

    transition: transform 0.25s, border-color 0.3s, box-shadow 0.3s;
}

.profile-panel-stat:hover {
    transform: translateY(-3px);
    border-color: rgba(150, 180, 255, 0.95);
    box-shadow:
        0 8px 22px rgba(80, 120, 255, 0.5),
        0 0 25px rgba(80, 120, 255, 0.4),
        inset 0 1px 0 rgba(180, 200, 255, 0.6);
}

.pps-icon {
    font-size: 1rem;
    filter: drop-shadow(0 0 8px rgba(120, 160, 255, 1));
}

.pps-num {
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 1px;

    background: linear-gradient(90deg, #ffffff, #8ab4ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(120, 160, 255, 0.9));
}

.pps-label {
    font-size: 0.58rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(200, 215, 255, 0.65);
}

/* ---------- Кнопка возврата к игре ---------- */
.profile-panel-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 11px 16px;
    border-radius: 12px;

    border: 1.5px solid rgba(150, 180, 255, 0.6);
    background: linear-gradient(135deg, rgba(80, 120, 255, 0.45), rgba(40, 80, 220, 0.55));

    color: #ffffff;
    text-decoration: none;
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;

    box-shadow:
        0 3px 14px rgba(0, 0, 0, 0.5),
        0 0 22px rgba(80, 120, 255, 0.35),
        inset 0 1px 0 rgba(180, 200, 255, 0.45);

    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
                background 0.3s,
                border-color 0.3s,
                box-shadow 0.3s;
}

.profile-panel-back:hover {
    transform: translateY(-3px);
    background: linear-gradient(135deg, rgba(120, 160, 255, 0.65), rgba(60, 110, 255, 0.8));
    border-color: rgba(180, 200, 255, 0.95);
    box-shadow:
        0 8px 28px rgba(80, 120, 255, 0.7),
        0 0 40px rgba(80, 120, 255, 0.5),
        inset 0 1px 0 rgba(200, 220, 255, 0.7);
}

.profile-panel-back:active {
    transform: translateY(-1px) scale(0.98);
}

.profile-panel-back-icon {
    font-size: 1rem;
    filter: drop-shadow(0 0 10px rgba(120, 160, 255, 1));
}

.profile-panel-back-text {
    background: linear-gradient(90deg, #ffffff, #8ab4ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(120, 160, 255, 0.9));
}

/* ---------- Цвета рангов ---------- */
.profile-panel-avatar.rank-bronze { background-color: transparent; background-image: linear-gradient(135deg, #cd7f32, #a05a1c); }
.profile-panel-avatar.rank-silver { background-color: transparent; background-image: linear-gradient(135deg, #c0c0c0, #8a8a8a); }
.profile-panel-avatar.rank-gold { background-color: transparent; background-image: linear-gradient(135deg, #ffd700, #b89400); }
.profile-panel-avatar.rank-diamond { background-color: transparent; background-image: linear-gradient(135deg, #96e6ff, #4aa8c8); }
.profile-panel-avatar.rank-platinum { background-color: transparent; background-image: linear-gradient(135deg, #c8ffe6, #7ac9a3); }
.profile-panel-avatar.rank-emerald { background-color: transparent; background-image: linear-gradient(135deg, #50ff96, #1ea85c); }
.profile-panel-avatar.rank-ruby { background-color: transparent; background-image: linear-gradient(135deg, #ff5078, #b82140); }
.profile-panel-avatar.rank-axerion {
    background-color: transparent;
    background-image: linear-gradient(135deg, #b478ff, #6a3ac8);
    box-shadow:
        0 0 35px rgba(180, 120, 255, 1),
        0 0 65px rgba(120, 80, 255, 0.7),
        inset 0 2px 0 rgba(230, 200, 255, 0.8);
}

/* Когда у аватара своя картинка — перебиваем градиент */
.profile-panel-avatar.has-image,
.profile-panel-avatar.has-image.rank-bronze,
.profile-panel-avatar.has-image.rank-silver,
.profile-panel-avatar.has-image.rank-gold,
.profile-panel-avatar.has-image.rank-diamond,
.profile-panel-avatar.has-image.rank-platinum,
.profile-panel-avatar.has-image.rank-emerald,
.profile-panel-avatar.has-image.rank-ruby,
.profile-panel-avatar.has-image.rank-axerion {
    background-image: var(--avatar-img);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #05060f;
}

/* ---------- Мобильный ---------- */
@media (max-width: 900px) {
    .side-menu {
        top: 15px;
        left: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .side-menu-toggle {
        width: 42px;
        height: 42px;
    }

    .side-menu-panel {
        flex-direction: column;
        border-radius: 18px;
        transform-origin: top center;
        transform: scaleY(0);
    }

    .side-menu.open .side-menu-panel {
        transform: scaleY(1);
    }

    .side-menu-item {
        flex-direction: row;
        gap: 10px;
        padding: 10px 16px;
        border-radius: 12px;
        font-size: 0.72rem;
    }

    .profile-panel {
        position: fixed;
        top: auto;
        bottom: 15px;
        right: 15px;
        left: 15px;
        width: auto;
        padding: 16px;
        gap: 12px;
    }

    .profile-panel-avatar {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .profile-panel-name {
        font-size: 0.85rem;
    }

    .profile-panel-rank {
        font-size: 0.6rem;
    }

    .profile-panel-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .profile-panel-stat {
        padding: 10px 6px;
    }

    .pps-num {
        font-size: 0.85rem;
    }

    .pps-icon {
        font-size: 0.9rem;
    }

    .pps-label {
        font-size: 0.5rem;
    }

    .profile-panel-back {
        padding: 10px 14px;
        font-size: 0.65rem;
    }

    .profile-settings-btn {
        width: 30px;
        height: 30px;
    }

    .profile-settings-icon {
        font-size: 0.9rem;
    }
}