/* ==========================================================================
   Profile Page Redesign - Pixel Perfect
   ========================================================================== */

/* NOTE: page layout (page-container/main-content spacing) is defined in css/base.css.
   Do not override global container paddings/margins here. */

/* === PROFILE HEADER - ТОЧНО ПО ТЗ === */
.profile-header {
    position: relative;
    width: 100%;
    margin-bottom: 64px; /* Отступ до следующего блока */
}

.profile-header-main {
    display: flex;
    align-items: flex-start;
    gap: 36px;
}

.profile-header-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding-right: 72px; /* место под иконки в углу */
    box-sizing: border-box;
}

.profile-header-top {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 24px;
    width: 100%;
}

.profile-name-block {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 50px;
    min-width: 0;
}

.profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-size: 24px;
    font-weight: 500;
    color: #FFFFFF;
    margin: 0;
    line-height: 1.2;
}

.profile-email {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    line-height: 1.2;
}

/* Бейдж статуса — в одной линии с именем (~50px зазор) */
.subscription-status {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.status-badge.status-active {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    background: transparent;
    border: 1px solid #00C88C;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 400;
    line-height: 1;
    white-space: nowrap;
}

.status-badge.status-active::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('assets/icons/check.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

/* Иконки — правый верх угла блока шапки; кнопка промокода временно скрыта */
.profile-header-actions {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 0;
}

.profile-header .profile-promo-pill {
    display: none !important;
}

.profile-promo-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: #FFFFFF;
    font-size: 14px;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
}

.profile-promo-pill::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url('assets/icons/badge.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
}

.icon-group {
    display: flex;
    align-items: center;
    gap: 22px; /* 22px между иконками */
}

.profile-settings-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
}

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

/* === PRACTICE OVERVIEW SECTION === */
.practice-stats-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 24px;
    font-weight: 500;
    color: #FFFFFF;
    margin-bottom: 32px; /* 32px под заголовком */
}

/* Якорь / скролл: зазор под фикс. шапкой (подстраховка к JS) */
#profilePromoTitle {
    scroll-margin-top: calc(88px + 16px);
}

/* Горизонтальный ряд плашек */
.practice-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px; /* 20px между плашками */
    margin-bottom: 24px;
}

.practice-stat {
    background: #1C1C1C;
    height: 90px;
    border-radius: 20px;
    padding: 0 20px 20px 20px; /* Паддинги: справа/слева 20, снизу 20 */
    display: flex;
    align-items: flex-end; /* Выравнивание по нижнему краю */
    justify-content: space-between;
    position: relative;
}

.practice-stat-value {
    font-size: 26px;
    font-weight: 600;
    color: #FFFFFF;
    line-height: 1;
}

.practice-stat-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: right;
}

/* Weekly Challenge */
.weekly-challenge {
    margin-bottom: 30px;
}

.challenge-subheader {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 34px; /* 34px под заголовком */
    font-weight: 500;
}

.challenge-progress {
    margin-bottom: 16px; /* 16px до текста */
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: visible; /* Для глоу */
    position: relative;
}

.progress-fill {
    height: 100%;
    width: 66%; /* Пример: 2/3 */
    background: #8A5DDD;
    border-radius: 999px;
    position: relative;
    box-shadow: 0 0 16px 0 rgba(105, 48, 209, 0.7); /* Глоу #6930D1 70% 16 blur */
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px; /* 30px до подсказки */
}

.progress-left,
.progress-right {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.challenge-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
    max-width: 100%;
}

.challenge-hint br {
    display: block;
    content: "";
    margin-top: 4px;
}

/* Сепаратор */
.section-separator {
    margin: 50px 0 60px 0; /* 50px сверху, 60px снизу */
    border: none;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    width: 100%;
}

/* === SUBSCRIPTION & PAYMENT SECTION === */
.subscription-payment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 60px;
}

.subscription-card,
.payment-card {
    background: #1C1C1C;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 0; /* Внутренние отступы через padding на строках */
}

.card-header {
    padding: 24px 36px; /* 36px от краев до заголовка */
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.card-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: #FFFFFF;
    margin: 0;
}

.subscription-details-content {
    display: flex;
    flex-direction: column;
}

.subscription-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 26px 36px; /* 52px между строками: 26px сверху + 26px снизу */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0; /* Убираем внешние отступы */
}

.subscription-detail-row:last-child {
    border-bottom: none;
}

.subscription-detail-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.subscription-detail-value {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.subscription-detail-value.status-active {
    color: #4CAF50;
    font-weight: 600;
}

/* Payment History */
.payment-entry {
    display: flex;
    justify-content: space-between;
    padding: 26px 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-entry:last-child {
    border-bottom: none;
}

.payment-date {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
}

.payment-amount {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.payment-method {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.6);
    margin-left: 12px;
}

/* === RECENT PRACTICE SECTION === */
.recent-section {
    margin-bottom: 60px;
}

.recent-section .section-title {
    margin-bottom: 32px;
}

/* === ОБЩИЕ СТИЛИ ДЛЯ КАРТОЧЕК === */
.riffs-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.riff-card {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    aspect-ratio: 214/180;
    cursor: pointer;
    background: #1C1C1C;
}

.riff-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.riff-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.8) 100%);
}

.riff-difficulty {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 12px;
    color: white;
    z-index: 2;
}

.riff-favorite-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.5);
    border: none;
    color: white;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.riff-favorite-btn svg {
    width: 16px;
    height: 16px;
}

.riff-favorite-btn.active {
    color: #FFD700;
}

.riff-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    z-index: 2;
}

.riff-song {
    font-size: 16px;
    font-weight: 600;
    color: #FFFFFF;
    margin-bottom: 4px;
}

.riff-artist {
    font-size: 14px;
    color: rgba(255,255,255,0.7);
}

/* Load More кнопка */
.load-more-container {
    text-align: center;
    margin-top: 30px;
}

.load-more-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #FFFFFF;
    font-size: 14px;
    padding: 12px 40px;
    border-radius: 30px;
    cursor: pointer;
}

.load-more-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 1400px) {
    .riffs-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1200px) {
    .profile-header-main {
        flex-wrap: wrap;
    }
    
    .profile-header-actions {
        margin-left: auto;
    }
    
    .riffs-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .practice-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .subscription-payment-grid {
        grid-template-columns: 1fr;
    }
    
    .riffs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .profile-section {
        position: relative;
    }

    .profile-header {
        /* Ряд под иконки (absolute в углу карточки) — не наезжают на аватар/имя */
        padding-top: 52px;
    }

    .profile-header-main {
        flex-direction: column;
    align-items: center;
        justify-content: center;
        gap: 16px;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .profile-avatar {
        width: 96px;
        height: 96px;
    }

    .profile-header-body {
    align-items: center;
        width: 100%;
        max-width: 100%;
        padding-right: 0;
        padding-left: 0;
    }

    .profile-header-top {
        flex-direction: column;
        align-items: center;
        gap: 16px;
        width: 100%;
    }

    .profile-name-block {
        flex-direction: column;
        align-items: center;
        gap: 10px;
        width: 100%;
    }

    .profile-name {
        text-align: center;
    }

    .subscription-status {
        justify-content: center;
    }

    .profile-email {
        text-align: center;
    }

    /* В углу блока шапки профиля — скроллятся вместе со страницей, не под глобальным topbar */
    .profile-header-actions {
        position: absolute;
        top: 10px;
        right: max(4px, env(safe-area-inset-right, 0px));
        left: auto;
        z-index: 2;
    }
}

@media (max-width: 480px) {
    .practice-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .riffs-grid {
        grid-template-columns: 1fr;
    }
    
    .subscription-detail-row {
        padding: 20px 16px;
    }
    
    .payment-entry {
        padding: 20px 16px;
    }
}

/* ==========================================================================
   Gamification additions (Profile only)
   Appends only – keep existing rules intact
   ========================================================================== */

/* 1) Streak Dashboard */
.streak-dashboard {
    margin-top: 24px;
    margin-bottom: 60px;
    background: linear-gradient(180deg, #1C1C1C 0%, #2a1f3a 100%);
    border: 1px solid rgba(138, 93, 221, 0.3);
    border-radius: 20px;
    padding: 24px;
    display: flex;
        flex-direction: column;
    gap: 14px;
}

.streak-flame {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.streak-emoji {
    font-size: 20px;
    line-height: 1;
    transform-origin: 50% 70%;
    animation: flameWiggle 1.8s ease-in-out infinite;
}

.streak-number {
    font-size: 28px;
        font-weight: 600;
    color: #fff;
    line-height: 1;
}

.streak-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.75);
}

.streak-next {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.85);
}

.streak-next .milestone-days {
    color: #fff;
    font-weight: 600;
}

.streak-next .milestone-reward {
    color: rgba(138, 93, 221, 1);
    font-weight: 600;
}

.streak-milestones {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.streak-milestones .milestone {
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.18);
    user-select: none;
}

.streak-milestones .milestone.achieved {
    border-color: rgba(255, 215, 0, 0.65);
    color: #FFD700;
    box-shadow: 0 0 18px rgba(255, 215, 0, 0.12);
}

.streak-flame[data-level="1"] .streak-emoji { filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
.streak-flame[data-level="1"] .streak-number { color: #FF9800; }

.streak-flame[data-level="2"] .streak-number { color: #FF5722; }
.streak-flame[data-level="2"] .streak-emoji { filter: drop-shadow(0 0 10px rgba(255, 87, 34, 0.35)); }

.streak-flame[data-level="3"] .streak-number { color: #F44336; }
.streak-flame[data-level="3"] .streak-emoji { animation: flameFlicker 0.9s ease-in-out infinite; filter: drop-shadow(0 0 12px rgba(244, 67, 54, 0.35)); }

@keyframes flameWiggle {
    0%, 100% { transform: rotate(-6deg) translateY(0); }
    50% { transform: rotate(6deg) translateY(-1px); }
}
@keyframes flameFlicker {
    0%, 100% { transform: rotate(-8deg) scale(1); opacity: 0.95; }
    50% { transform: rotate(8deg) scale(1.05); opacity: 1; }
}

/* 2) Riff mastery stars */
.riff-mastery {
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mastery-stars {
    position: relative;
    display: inline-flex;
    gap: 2px;
    font-size: 16px;
    color: #FFD700;
    line-height: 1;
}

.mastery-stars .star.empty { color: rgba(255, 215, 0, 0.25); }
.mastery-stars .star.half { color: rgba(255, 215, 0, 0.65); }

.mastery-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    white-space: nowrap;
}

.killed-badge {
    margin-left: 6px;
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(255, 215, 0, 0.16);
    border: 1px solid rgba(255, 215, 0, 0.35);
    color: #FFD700;
    letter-spacing: 0.08em;
}

.mastery-stars[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    transform: translateY(-34px);
    background: rgba(0,0,0,0.8);
    color: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.12);
    padding: 6px 8px;
    border-radius: 10px;
    font-size: 12px;
    white-space: nowrap;
}

/* 3) Achievements grid */
.achievements-section {
    margin-bottom: 60px;
}

.achievements-section .section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0;
    gap: 16px;
}

/* Как у остальных секций: один отступ заголовок → сетка */
.achievements-section .section-header .section-title {
    margin-bottom: 0;
}

.view-all-link {
    font-size: 13px;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
}
.view-all-link:hover { color: rgba(255, 255, 255, 0.75); }

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

.achievement-card {
    background: linear-gradient(180deg, #1E1A24 0%, #0C0A0F 100%);
    border-radius: 24px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 28px -12px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: none;
}

.achievement-card:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 18px 28px -12px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* Earned: без glow; два блика только на линии 1px (::before + conic, не размытие) */
.achievement-card.earned {
    position: relative;
    border: none;
    border-radius: 22px 20px 23px 21px;
    background:
        radial-gradient(115% 82% at 48% 0%, rgba(138, 93, 221, 0.1) 0%, transparent 52%),
        linear-gradient(180deg, #1E1A24 0%, #0C0A0F 100%);
    box-shadow: 0 18px 28px -12px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.achievement-card.earned::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    pointer-events: none;
    z-index: 0;
    --rk-conic-from: 38deg;
    transition: --rk-conic-from 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    background: conic-gradient(
        from var(--rk-conic-from) at 50% 48%,
        rgba(125, 82, 200, 0.55) 0deg,
        rgba(235, 225, 255, 0.98) 7deg,
        rgba(235, 225, 255, 0.98) 13deg,
        rgba(125, 82, 200, 0.55) 20deg,
        rgba(125, 82, 200, 0.55) 210deg,
        rgba(242, 232, 255, 0.98) 218deg,
        rgba(242, 232, 255, 0.98) 226deg,
        rgba(125, 82, 200, 0.55) 234deg,
        rgba(125, 82, 200, 0.55) 360deg
    );
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
}

.achievement-card.earned > * {
    position: relative;
    z-index: 1;
}

.achievement-icon {
    font-size: 40px;
    margin-bottom: 12px;
    line-height: 1;
}

.achievement-name {
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 6px;
}

.achievement-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.35;
}

.achievement-progress {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: rgba(255,255,255,0.7);
    font-size: 12px;
    font-weight: 400;
}

.achievement-progress .progress-bar {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 999px;
    overflow: hidden;
}

.achievement-progress .progress-bar > div {
    height: 100%;
    background: #8A5DDD;
    border-radius: 999px;
}

@media (max-width: 900px) {
    .achievements-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .achievements-grid { grid-template-columns: 1fr; }
    .streak-flame { flex-wrap: wrap; }
}

/* Mobile improvements for gamification */
@media (max-width: 640px) {
    .streak-dashboard {
        padding: 20px;
        margin-bottom: 40px;
    }
    
    .streak-flame {
        flex-wrap: wrap;
        gap: 8px;
    }

    .streak-number {
        font-size: 24px;
    }

    .streak-milestones {
        margin-top: 8px;
        justify-content: center;
    }

    .streak-milestones .milestone {
        padding: 4px 8px;
        font-size: 11px;
    }

    .achievements-section .section-header {
        margin-bottom: 16px;
    }

    .achievements-grid {
        gap: 12px;
    }

    .achievement-card {
        padding: 16px;
    }

    .achievement-icon {
        font-size: 32px;
        margin-bottom: 8px;
    }

    .achievement-name {
        font-size: 13px;
    }

    .achievement-desc {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .streak-next {
        font-size: 13px;
        line-height: 1.4;
    }

    .streak-milestones {
        gap: 6px;
    }

    .achievement-card {
        padding: 14px;
    }
}

/* Achievement cards are informational only (non-clickable) */
.achievement-card.earned:hover {
    border: none;
    border-radius: 22px 20px 23px 21px;
    background:
        radial-gradient(115% 82% at 48% 0%, rgba(138, 93, 221, 0.12) 0%, transparent 52%),
        linear-gradient(180deg, #1E1A24 0%, #0C0A0F 100%);
    box-shadow: 0 18px 28px -12px rgba(0, 0, 0, 0.75), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

/* Сдвиг только угла conic — рамка остаётся ровной по карточке */
.achievement-card.earned:hover::before {
    --rk-conic-from: 66deg;
}

.streak-flame {
    cursor: help;
    position: relative;
}

.streak-flame:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 0;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 8px;
    z-index: 10;
}

/* ===== GAME DASHBOARD ===== */
.game-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin: 28px 0 56px;
}

.card {
    position: relative;
    border-radius: 32px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
    transition: none;
    overflow: visible;
    z-index: 1;
}

.card:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.04);
}

/* Без ховер-эффекта на карточках прогресса */
.game-dashboard .card:hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.04);
    box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.8), inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

/* Градиентный фон и свечение */
.streak-card {
    background: linear-gradient(180deg, #1E1A24 0%, #0C0A0F 100%);
}
.challenge-card {
    background: linear-gradient(180deg, #171B2B 0%, #0A0C14 100%);
}

.card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 10%;
    width: 80%;
    height: 30px;
    border-radius: 50%;
    filter: blur(20px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.55;
}
.streak-card::after { background: rgba(255, 140, 0, 0.5); }
.challenge-card::after { background: rgba(138, 93, 221, 0.5); }

.content-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    z-index: 2;
    position: relative;
}
.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.card-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    min-width: 0;
    padding: 0;
    border-radius: 0;
    font-size: 40px;
    line-height: 1;
    background: transparent;
    border: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.game-dashboard .card-icon {
    font-size: 44px;
    /* Не даём колонке иконки схлопнуться в space-between (иначе эмодзи «пропадают») */
    flex-shrink: 0;
    min-width: 1.25em;
}

/* Искры не должны сдвигать сетку: 🔥 как раньше 1em; запас только у canvas (absolute + mask) */
.streak-card .card-icon {
    overflow: visible;
}

.streak-card .fire-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    min-width: 1em;
    min-height: 1em;
    flex-shrink: 0;
    vertical-align: middle;
    box-sizing: border-box;
    overflow: visible;
}

.streak-card .fire-emoji {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 1em;
    line-height: 1;
    z-index: 1;
    pointer-events: none;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'EmojiOne Color', sans-serif;
    filter: drop-shadow(0 0 10px rgba(255, 140, 0, 0.45));
    text-shadow: 0 0 1px rgba(255, 100, 0, 0.25), 0 0 2px rgba(255, 60, 0, 0.12);
    will-change: opacity;
}

.streak-card .fire-sparks-canvas {
    position: absolute;
    left: 50%;
    top: -0.82em;
    transform: translateX(-50%);
    width: 118%;
    height: calc(100% + 0.82em);
    z-index: 2;
    pointer-events: none;
    display: block;
    /* Мягкое затухание к верху/краям — без резкого «обреза» по краю canvas */
    -webkit-mask-image: radial-gradient(
        ellipse 88% 118% at 50% 100%,
        #000 0%,
        #000 36%,
        rgba(0, 0, 0, 0.55) 56%,
        rgba(0, 0, 0, 0.12) 74%,
        transparent 88%
    );
    mask-image: radial-gradient(
        ellipse 88% 118% at 50% 100%,
        #000 0%,
        #000 36%,
        rgba(0, 0, 0, 0.55) 56%,
        rgba(0, 0, 0, 0.12) 74%,
        transparent 88%
    );
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* Weekly challenge: 🗡️ + 🎸 — пропорции как в макете (54:56, overlap 28/56), масштаб = высота гитары как у 🔥 (44px) */
.challenge-icon-duo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 38px;
    font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', 'Twemoji Mozilla', 'EmojiOne Color', sans-serif;
}

.challenge-sword-mirrored {
    display: inline-block;
    font-size: calc(54px * 44 / 56);
    line-height: 1;
    position: relative;
    top: calc(-4px * 44 / 56);
    margin-right: calc(-28px * 44 / 56);
    z-index: 1;
    text-shadow: 0 0 10px rgba(138, 93, 221, 0.4);
    transform: scaleY(-1) translateZ(0);
    -webkit-transform: scaleY(-1) translateZ(0);
    -webkit-backface-visibility: visible;
    backface-visibility: visible;
}

.challenge-guitar-normal {
    display: inline-block;
    font-size: calc(56px * 44 / 56);
    line-height: 1;
    margin-left: calc(-28px * 44 / 56);
    position: relative;
    z-index: 2;
    text-shadow: 0 0 10px rgba(138, 93, 221, 0.45);
}

/* Как .practice-stat-label (Best streak, Current streak…) */
.row-label {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.25;
}

/* Header label + tooltip icon */
.label-group {
    display: flex;
    align-items: center;
    gap: 8px;
}
.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: help;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.2s;
}
.info-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 1.5;
}
.info-icon:hover {
    color: rgba(255, 255, 255, 0.9);
}

.info-icon:focus {
    outline: 2px solid rgba(147, 85, 229, 0.55);
    outline-offset: 3px;
    border-radius: 6px;
}
/* Тултип: многострочный «popover»-паттерн — не одна длинная строка, не вылезает за экран справа */
.info-icon[data-tooltip] {
    position: relative;
    z-index: 3;
}

.info-icon[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: auto;
    right: 0;
    transform: translateY(-8px);
    box-sizing: border-box;
    max-width: min(260px, calc(100vw - 32px));
    width: max-content;
    white-space: normal;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
    line-height: 1.45;
    text-align: left;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(22, 24, 36, 0.98);
    color: rgba(255, 255, 255, 0.92);
    font-size: 12px;
    font-weight: 400;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 80;
}

.info-icon[data-tooltip]::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: auto;
    right: 10px;
    transform: translateY(4px);
    border: 6px solid transparent;
    border-top-color: rgba(22, 24, 36, 0.98);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
    z-index: 81;
}

.info-icon:hover::after,
.info-icon:focus::after {
    opacity: 1;
    transform: translateY(-4px);
}

.info-icon:hover::before,
.info-icon:focus::before {
    opacity: 1;
    transform: translateY(8px);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 20px;
}
.streak-fill {
    background: linear-gradient(90deg, #FFB347, #FF5E00);
    box-shadow: 0 0 12px #FF5E00;
}
.challenge-fill {
    background: linear-gradient(90deg, #8A5DDD, #B38BFF);
    box-shadow: 0 0 12px #8A5DDD;
}

.progress-hint {
    font-size: 11px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.42);
    font-weight: 400;
    margin: 0;
    min-height: calc(1.45em * 2);
    max-width: 100%;
}


.row-main {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
}
.main-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.fraction {
    font-size: 24px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.3);
    margin: 0 4px;
}
.target-number {
    font-size: 24px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}
.main-number {
    font-size: 56px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1;
}
.main-unit {
    font-size: 20px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    margin-left: 8px;
}
.streak-number {
    background: linear-gradient(135deg, #FFB800, #FF5E00);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 16px;
    border-radius: 40px;
    font-weight: 400;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
}
.badge-orange {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.45);
    color: #FFB347;
    box-shadow: 0 0 6px rgba(255, 140, 0, 0.16);
}
.badge-purple {
    background: rgba(138, 93, 221, 0.15);
    border-color: rgba(138, 93, 221, 0.5);
    color: #B38BFF;
}

.row-bottom {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    min-height: 48px;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 40px;
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(4px);
}
.chip.achieved {
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.35);
    color: #FFB347;
}
.chip-icon { font-size: 18px; }

.dynamic-chip {
    /* same visual language as milestone chips */
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.75);
    font-size: 15px;
    gap: 8px;
}

.completed-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 40px;
    background: rgba(76, 175, 80, 0.14);
    border: 1px solid rgba(76, 175, 80, 0.45);
    color: #9BE3A9;
    font-weight: 600;
}

@media (max-width: 800px) {
    .game-dashboard {
        grid-template-columns: 1fr;
        gap: 16px;
        margin: 28px 0 36px;
    }
    .game-dashboard .card {
        border-radius: 20px;
        padding: 16px;
    }
    .game-dashboard .content-col {
        gap: 12px;
    }
    .game-dashboard .card-icon {
        width: auto;
        height: auto;
        padding: 0;
        border: none;
        border-radius: 0;
        background: transparent;
        font-size: 38px;
    }
    .game-dashboard .progress-bar {
        height: 6px;
    }
    .game-dashboard .main-number {
        font-size: 34px;
    }
    .game-dashboard .main-unit {
        font-size: 15px;
    }
    .game-dashboard .badge,
    .game-dashboard .chip {
        padding: 5px 10px;
        font-size: 12px;
    }
    .game-dashboard .row-bottom {
        min-height: 34px;
        gap: 8px;
    }
}
@media (max-width: 500px) {
    .card { padding: 14px; }
    .game-dashboard .card-icon {
        width: auto;
        height: auto;
        font-size: 34px;
        border-radius: 0;
        border: none;
        background: transparent;
    }
    .main-number { font-size: 30px; }
    .row-label { font-size: 11px; }
    .fraction, .target-number { font-size: 18px; }
    .badge, .chip { font-size: 11px; padding: 4px 9px; }
    .game-dashboard .progress-bar { height: 4px; }
    .info-icon[data-tooltip]::after {
        max-width: min(240px, calc(100vw - 24px));
    }
}

/* Scoped override for game dashboard (protect from legacy global .progress-bar/.card rules) */
.game-dashboard .card {
    border-radius: 32px;
    padding: 28px;
    overflow: visible;
}

.game-dashboard .header-row,
.game-dashboard .label-group {
    overflow: visible;
}

/* Одна линия сетки: после иконки прогресс-бар на одной высоте в Streak и Weekly */
.game-dashboard .header-row {
    align-items: center;
    min-height: 44px;
}
.game-dashboard .progress-bar { height: 8px; border-radius: 20px; }
.game-dashboard .progress-fill { border-radius: 20px; }
.game-dashboard .row-label { font-size: 13px; letter-spacing: 0.06em; }
.game-dashboard .main-number { font-size: 56px; font-weight: 700; line-height: 1; }
.game-dashboard .badge { border-radius: 40px; padding: 6px 16px; }
.game-dashboard .chip { border-radius: 40px; padding: 8px 18px; }

/* Keep game dashboard compact on mobile after scoped override */
@media (max-width: 800px) {
    .game-dashboard .card { border-radius: 20px; padding: 16px; }
    .game-dashboard .main-number { font-size: 34px; }
    .game-dashboard .badge { padding: 5px 10px; font-size: 12px; }
    .game-dashboard .chip { padding: 5px 10px; font-size: 12px; }
    .game-dashboard .progress-bar { height: 6px; }
    /* Сетка как у Streak: .card-icon 38px → тот же коэффициент для дуэта */
    .game-dashboard .header-row { min-height: 38px; }
    .game-dashboard .challenge-icon-duo { min-width: calc(48px * 38 / 56); }
    .game-dashboard .challenge-sword-mirrored {
        font-size: calc(54px * 38 / 56);
        top: calc(-4px * 38 / 56);
        margin-right: calc(-28px * 38 / 56);
    }
    .game-dashboard .challenge-guitar-normal {
        font-size: calc(56px * 38 / 56);
        margin-left: calc(-28px * 38 / 56);
    }
}
@media (max-width: 500px) {
    .game-dashboard .card { padding: 14px; }
    .game-dashboard .card-icon {
        width: auto;
        height: auto;
        font-size: 32px;
        border-radius: 0;
        border: none;
        background: transparent;
    }
    .game-dashboard .main-number { font-size: 30px; }
    .game-dashboard .badge { font-size: 11px; padding: 4px 9px; }
    .game-dashboard .chip { font-size: 11px; padding: 4px 9px; }
    .game-dashboard .progress-bar { height: 4px; }
    .game-dashboard .header-row { min-height: 32px; }
    .game-dashboard .challenge-icon-duo { min-width: calc(48px * 32 / 56); }
    .game-dashboard .challenge-sword-mirrored {
        font-size: calc(54px * 32 / 56);
        top: calc(-4px * 32 / 56);
        margin-right: calc(-28px * 32 / 56);
    }
    .game-dashboard .challenge-guitar-normal {
        font-size: calc(56px * 32 / 56);
        margin-left: calc(-28px * 32 / 56);
    }
}

/* --------------------------------------------------------------------------
   Fix: riff preview overlay/shadows should match main page (components.css)
   -------------------------------------------------------------------------- */
.riff-card {
    height: var(--height-riff-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    position: relative;
}

.riff-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.riff-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.riff-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    inset: auto;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.7) 50%,
        transparent 100%);
}

.riff-content {
    min-height: 80px;
    z-index: 1;
}