/* =========================================
   СТРАНИЦА ИГРЫ (game.html)
   ========================================= */
.game-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 90px 20px 50px;
    cursor: auto;
}

.game-top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 16px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(5, 5, 16, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 50;
}

.back-to-portfolio {
    color: var(--accent-cyan);
    font-weight: 600;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

    .back-to-portfolio:hover {
        color: #fff;
        transform: translateX(-3px);
    }

.wallet-hud {
    display: flex;
    align-items: center;
    gap: 14px;
}

.coin-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.35);
    border-radius: 99px;
    font-family: var(--font-heading);
    font-size: 0.95rem;
    color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.15);
}

.sound-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}

    .sound-btn:hover {
        border-color: var(--accent-cyan);
        color: var(--accent-cyan);
    }

/* Основная сетка: Игровой экран + Правая панель */
.game-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 28px;
    align-items: start;
    width: 100%;
    max-width: 1240px;
}

.game-stage-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.game-container {
    position: relative;
    width: 100%;
    height: 580px;
    background: radial-gradient(circle at center, rgba(16, 16, 42, 0.9) 0%, rgba(5, 5, 16, 0.98) 100%);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 24px;
    box-shadow: 0 0 50px rgba(0, 240, 255, 0.12), inset 0 0 40px rgba(112, 0, 255, 0.15);
    overflow: hidden;
}

    .game-container.rush-mode {
        border-color: var(--accent-magenta);
        box-shadow: 0 0 60px rgba(255, 0, 200, 0.35), inset 0 0 50px rgba(255, 0, 200, 0.2);
    }

/* Верхний HUD внутри канваса */
.game-ui {
    position: absolute;
    top: 18px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    font-family: var(--font-heading);
    font-size: 1rem;
    z-index: 5;
    pointer-events: none;
}

.hud-pill {
    background: rgba(5, 5, 16, 0.72);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    padding: 8px 16px;
    border-radius: 99px;
    color: var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 8px;
}

    .hud-pill.combo-pill {
        color: var(--accent-magenta);
        border-color: rgba(255, 0, 200, 0.35);
        transition: transform 0.15s ease;
    }

    .hud-pill.timer-danger {
        color: var(--danger);
        border-color: rgba(255, 51, 102, 0.5);
        animation: pulseDanger 0.6s infinite alternate;
    }

@keyframes pulseDanger {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.08);
    }
}

.active-buffs {
    position: absolute;
    top: 68px;
    left: 24px;
    display: flex;
    gap: 10px;
    z-index: 5;
    pointer-events: none;
}

.buff-tag {
    padding: 5px 12px;
    border-radius: 99px;
    font-size: 0.78rem;
    font-weight: 700;
    background: rgba(0, 240, 255, 0.15);
    border: 1px solid var(--accent-cyan);
    color: #fff;
}

#gameCanvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
}

/* Оверлеи старта и финиша */
.game-overlay {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 16, 0.88);
    backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 32px;
    z-index: 10;
    transition: opacity 0.3s ease;
}

    .game-overlay.hidden {
        opacity: 0;
        pointer-events: none;
    }

    .game-overlay h1 {
        font-size: clamp(1.8rem, 3vw, 2.5rem);
        margin-bottom: 12px;
    }

    .game-overlay p {
        color: var(--text-muted);
        font-size: 1rem;
        margin-bottom: 24px;
        max-width: 480px;
    }

.sector-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 99px;
    background: rgba(112, 0, 255, 0.2);
    border: 1px solid var(--accent-purple);
    color: var(--accent-cyan);
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.round-summary {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
    flex-wrap: wrap;
    justify-content: center;
}

.summary-box {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    padding: 12px 20px;
    min-width: 120px;
}

    .summary-box span {
        display: block;
        font-size: 0.78rem;
        color: var(--text-muted);
    }

    .summary-box strong {
        font-family: var(--font-heading);
        font-size: 1.3rem;
        color: var(--accent-cyan);
    }

.save-record-form {
    display: flex;
    gap: 10px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 16px;
}

    .save-record-form input {
        flex: 1;
        padding: 12px 18px;
        background: rgba(255, 255, 255, 0.06);
        border: 1px solid var(--glass-border);
        border-radius: 99px;
        color: #fff;
        font-family: inherit;
        outline: none;
    }

        .save-record-form input:focus {
            border-color: var(--accent-cyan);
        }

/* =========================================
   АНГАР: УРОВНИ, УЛУЧШЕНИЯ, СКИНЫ, АЧИВКИ
   ========================================= */
.hangar-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 24px;
}

.hangar-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 18px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-family: var(--font-heading);
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .tab-btn:hover {
        color: #fff;
        border-color: rgba(255, 255, 255, 0.25);
    }

    .tab-btn.active {
        background: linear-gradient(90deg, rgba(0, 240, 255, 0.2), rgba(112, 0, 255, 0.25));
        border-color: var(--accent-cyan);
        color: #fff;
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.15);
    }

.tab-pane {
    display: none;
}

    .tab-pane.active {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }

.item-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 12px;
    transition: all 0.25s ease;
}

    .item-card:hover {
        border-color: rgba(0, 240, 255, 0.3);
        background: rgba(255, 255, 255, 0.05);
    }

    .item-card.selected {
        border-color: var(--accent-cyan);
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.18);
    }

    .item-card.locked {
        opacity: 0.72;
    }

.item-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.item-card h4 {
    font-size: 1rem;
    margin-bottom: 4px;
}

.item-card p {
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.4;
}

.skin-preview {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.lvl-dots {
    display: flex;
    gap: 5px;
    margin-top: 6px;
}

.lvl-dot {
    height: 6px;
    flex: 1;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
}

    .lvl-dot.filled {
        background: var(--accent-cyan);
        box-shadow: 0 0 8px var(--accent-cyan);
    }

.card-action-btn {
    width: 100%;
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    font-family: var(--font-heading);
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
    color: #fff;
}

    .card-action-btn:hover:not(:disabled) {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0, 240, 255, 0.3);
    }

    .card-action-btn.equipped {
        background: rgba(0, 255, 136, 0.15);
        border: 1px solid var(--success);
        color: var(--success);
        cursor: default;
    }

    .card-action-btn.secondary {
        background: rgba(255, 255, 255, 0.08);
        border: 1px solid var(--glass-border);
        color: #fff;
    }

    .card-action-btn:disabled {
        opacity: 0.45;
        cursor: not-allowed;
    }

/* Всплывающее уведомление об ачивке */
.achievement-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: rgba(12, 12, 32, 0.96);
    border: 1px solid var(--accent-cyan);
    box-shadow: 0 10px 35px rgba(0, 240, 255, 0.3);
    border-radius: 18px;
    padding: 16px 22px;
    display: flex;
    align-items: center;
    gap: 14px;
    z-index: 9999;
    transform: translateY(140%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

    .achievement-toast.show {
        transform: translateY(0);
    }

/* =========================================
   ТАБЛИЦА РЕКОРДОВ СПРАВА
   ========================================= */
.leaderboard {
    width: 100%;
    padding: 28px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    position: sticky;
    top: 90px;
}

    .leaderboard h3 {
        font-size: 1.2rem;
        margin-bottom: 18px;
        text-align: center;
        color: var(--accent-cyan);
    }

    .leaderboard ul {
        list-style: none;
        display: flex;
        flex-direction: column;
        gap: 14px;
    }

    .leaderboard li {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.95rem;
        padding-bottom: 10px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

        .leaderboard li:last-child {
            border-bottom: none;
        }

        .leaderboard li strong {
            color: var(--accent-cyan);
            font-size: 1.1rem;
        }

.loading-text {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.leaderboard-note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 18px;
    text-align: center;
}

@media (max-width: 960px) {
    .game-layout {
        grid-template-columns: 1fr;
    }

    .game-container {
        height: 480px;
    }

    .leaderboard {
        position: static;
    }
}
/* Предупреждение для гостей */
.guest-warning {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 22px;
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid rgba(255, 170, 0, 0.4);
    border-radius: 16px;
    color: #ffd166;
    font-size: 0.9rem;
    margin-bottom: 18px;
}

    .guest-warning.hidden {
        display: none;
    }

.guest-warning-btn {
    padding: 8px 16px;
    border-radius: 99px;
    background: #ffd166;
    color: #050510;
    font-weight: 700;
    font-size: 0.82rem;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.2s ease;
}

    .guest-warning-btn:hover {
        transform: scale(1.04);
    }
#gameNameGroup.hidden,
#forgotPassRow.hidden {
    display: none !important;
}
.verified-badge {
    color: var(--accent-cyan);
    margin-left: 6px;
    font-size: 0.9rem;
    filter: drop-shadow(0 0 6px rgba(0, 240, 255, 0.6));
}
