* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

/* =========================
   Premium theme (override)
   Goal: keep layout/logic, replace visuals to match premium dark + purple glow
   ========================= */

:root {
    --bg0: #07070b;
    --bg1: #0b0b12;
    --panel: rgba(22, 18, 34, 0.52);
    --panel-strong: rgba(22, 18, 34, 0.72);
    --stroke: rgba(255, 255, 255, 0.08);
    --stroke-strong: rgba(255, 255, 255, 0.12);
    --text: rgba(255, 255, 255, 0.92);
    --muted: rgba(255, 255, 255, 0.62);
    --muted2: rgba(255, 255, 255, 0.45);

    --accent: #a855f7;      /* purple */
    --accent2: #7c3aed;     /* deep purple */
    --accent3: #c084fc;     /* lavender */

    --shadow: 0 18px 60px rgba(0,0,0,0.55);
    --shadow-soft: 0 12px 40px rgba(0,0,0,0.38);

    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 22px;
}

/* === Icon system (replace emoji with consistent premium glyphs) === */
.icon {
    font-size: 0 !important; /* hide emoji/text fallback */
    line-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.85);
}
.icon::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: var(--icon) center / contain no-repeat;
    mask: var(--icon) center / contain no-repeat;
    filter: drop-shadow(0 0 12px rgba(168,85,247,0.35));
}

.i-home { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 10.5 12 4l8 6.5V20a1 1 0 0 1-1 1h-5v-6H10v6H5a1 1 0 0 1-1-1v-9.5z'/%3E%3C/svg%3E"); }
.i-shop { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 6a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v2h3v2H2V8h3V6zm2 2h6V6H9v2zm-4 4h14l-1.2 8.4A2 2 0 0 1 15.8 22H8.2a2 2 0 0 1-1.98-1.6L5 12z'/%3E%3C/svg%3E"); }
.i-rank { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 4h10v3a5 5 0 0 1-10 0V4zm12 2h2v1a4 4 0 0 1-4 4v-2a2 2 0 0 0 2-2V6zM3 6h2v1a2 2 0 0 0 2 2v2a4 4 0 0 1-4-4V6zm6 11h6v2H9v-2zm-1 3h8v2H8v-2z'/%3E%3C/svg%3E"); }
.i-quests { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M7 3h10v2H7V3zm-2 4h14v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V7zm4 3v2h2v-2H9zm0 4v2h2v-2H9zm4-4v2h6v-2h-6zm0 4v2h6v-2h-6z'/%3E%3C/svg%3E"); }
.i-gift { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M20 7h-2.2a3 3 0 0 0 .2-1 3 3 0 0 0-5-2.2A3 3 0 0 0 8 6c0 .35.07.68.2 1H4v4h16V7zm-9-1a1 1 0 1 1-2 0c0-.55.45-1 1-1s1 .45 1 1zm4 0a1 1 0 0 1-2 0c0-.55.45-1 1-1s1 .45 1 1zm5 7v8a1 1 0 0 1-1 1h-7v-10h8zm-10 10H5a1 1 0 0 1-1-1v-8h8v10z'/%3E%3C/svg%3E"); }
.i-energy { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M13 2 3 14h8l-1 8 10-12h-8l1-8z'/%3E%3C/svg%3E"); }
.i-rocket { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M14 3c4 1 7 4 7 8-3 1-6 4-8 8-4 0-7-3-8-7 4-2 7-5 9-9zM5 17l-2 4 4-2 2-2-2-2-2 2zm10-8a2 2 0 1 0 0-4 2 2 0 0 0 0 4z'/%3E%3C/svg%3E"); }
.i-coin { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2c5.5 0 10 2.24 10 5s-4.5 5-10 5S2 9.76 2 7s4.5-5 10-5zm0 12c5.5 0 10-2.24 10-5v8c0 2.76-4.5 5-10 5S2 19.76 2 17V9c0 2.76 4.5 5 10 5z'/%3E%3C/svg%3E"); }
.i-crystal { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2 4 9l8 13 8-13-8-7zm0 3.2L17.2 9H6.8L12 5.2z'/%3E%3C/svg%3E"); }
.i-xp { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M4 7h3l2 3 2-3h3l-3.5 5L14 17h-3l-2-3-2 3H4l3.5-5L4 7zm12 0h4a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-2v4h-2V7zm2 2v2h2V9h-2z'/%3E%3C/svg%3E"); }
.i-tap { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 2a4 4 0 0 1 4 4v4h-2V6a2 2 0 1 0-4 0v6.5l-1.2-1.2a2 2 0 0 0-2.8 2.8l4.6 4.6A6 6 0 0 0 14.2 21H16a6 6 0 0 0 6-6v-1h-2v1a4 4 0 0 1-4 4h-1.8a4 4 0 0 1-2.83-1.17L7.1 13.54a.5.5 0 0 1 .7-.7L12 17V6a4 4 0 0 1 4-4z'/%3E%3C/svg%3E"); }
.i-up { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 3 4 11h5v10h6V11h5L12 3z'/%3E%3C/svg%3E"); }
.i-hour { --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M6 2h12v2h-1v3.5a6 6 0 0 1-2.4 4.8L13 13l1.6.7A6 6 0 0 1 17 18.5V22h1v2H6v-2h1v-3.5a6 6 0 0 1 2.4-4.8L11 13l-1.6-.7A6 6 0 0 1 7 7.5V4H6V2zm3 2v3.5c0 1.3.6 2.5 1.6 3.3L12 12l1.4-1.2c1-.8 1.6-2 1.6-3.3V4H9z'/%3E%3C/svg%3E"); }

.nav-icon.icon::before { width: 20px; height: 20px; }
.stat-icon.icon::before { width: 18px; height: 18px; }
.energy-icon.icon::before { width: 18px; height: 18px; }
.boost-icon.icon::before { width: 18px; height: 18px; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background:
        radial-gradient(900px 900px at 18% 12%, rgba(168, 85, 247, 0.22), transparent 55%),
        radial-gradient(700px 700px at 80% 18%, rgba(124, 58, 237, 0.16), transparent 58%),
        radial-gradient(900px 900px at 50% 86%, rgba(192, 132, 252, 0.10), transparent 58%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    user-select: none;
    -webkit-user-select: none;
    padding-bottom: 80px;
    position: relative;
}

/* subtle dynamic states */
body.state-boost {
    background:
        radial-gradient(900px 900px at 18% 12%, rgba(168, 85, 247, 0.30), transparent 55%),
        radial-gradient(700px 700px at 80% 18%, rgba(124, 58, 237, 0.22), transparent 58%),
        radial-gradient(900px 900px at 50% 86%, rgba(192, 132, 252, 0.14), transparent 58%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
}

body.state-raid {
    background:
        radial-gradient(900px 900px at 20% 20%, rgba(168, 85, 247, 0.22), transparent 55%),
        radial-gradient(700px 700px at 75% 22%, rgba(255, 92, 244, 0.10), transparent 60%),
        radial-gradient(900px 900px at 50% 86%, rgba(124, 58, 237, 0.16), transparent 58%),
        linear-gradient(180deg, var(--bg0), var(--bg1));
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: radial-gradient(circle at 30% 20%, rgba(168, 85, 247, 0.10), transparent 45%),
                radial-gradient(circle at 75% 25%, rgba(124, 58, 237, 0.08), transparent 55%),
                radial-gradient(circle at 55% 80%, rgba(192, 132, 252, 0.06), transparent 55%);
    filter: blur(38px);
    opacity: 1;
    pointer-events: none;
    z-index: 0;
}

body::after {
    /* subtle grain */
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    opacity: 0.08;
    background-image:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.02), rgba(255,255,255,0.02) 1px, transparent 1px, transparent 3px),
        repeating-linear-gradient(90deg, rgba(0,0,0,0.03), rgba(0,0,0,0.03) 1px, transparent 1px, transparent 4px);
    mix-blend-mode: overlay;
}

/* performance mode: reduce blur/glow on low-end phones */
body.perf-low::after { opacity: 0; }
body.perf-low .stat-card,
body.perf-low .currency-chip,
body.perf-low .energy-bar,
body.perf-low .modal-content,
body.perf-low .tap-circle,
body.perf-low .hub-btn,
body.perf-low .list-item {
    backdrop-filter: none !important;
}
body.perf-low .tap-circle::after { box-shadow: 0 0 0 10px rgba(168,85,247,0.08); }
body.perf-low .icon::before { filter: none; }

/* Mobile-first: one-hand reach */
@media (max-width: 480px) {
    body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }

    /* keep top clean: hide home stats cards, they are in Stats modal */
    #homeStatsCards { display: none; }

    .tap-section {
        min-height: 340px;
        padding: 12px 16px 8px;
    }

    /* bigger hit area without changing visuals */
    .tap-circle::marker { content: ""; }

    .energy-section { padding-bottom: 18px; }

    .bottom-nav {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

/* Tabs (Rewards modal) */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.tab-btn {
    flex: 1;
    padding: 10px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.03);
    color: rgba(255,255,255,0.80);
    font-weight: 800;
    cursor: pointer;
}
.tab-btn.active {
    background: rgba(168,85,247,0.18);
    border-color: rgba(168,85,247,0.35);
    color: rgba(255,255,255,0.92);
    box-shadow: 0 14px 36px rgba(168,85,247,0.18);
}
.tab-pane { display: none; }
.tab-pane.show { display: block; }

/* Bottom sheet on mobile */
@media (max-width: 480px) {
    .modal { align-items: flex-end; }
    .modal-content {
        width: 100%;
        max-width: 100%;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        max-height: calc(92vh - env(safe-area-inset-top));
    }
    .modal-header::before {
        content: "";
        display: block;
        width: 44px;
        height: 5px;
        border-radius: 999px;
        background: rgba(255,255,255,0.14);
        position: absolute;
        left: 50%;
        top: 10px;
        transform: translateX(-50%);
    }
    .modal-header { position: relative; padding-top: 22px; }
}

/* Верхняя панель */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(8, 8, 12, 0.70);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.icon-btn {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.90);
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}

.app-title {
    font-size: 18px;
    font-weight: 600;
    color: rgba(255,255,255,0.90);
    flex: 1;
    text-align: center;
    letter-spacing: 0.2px;
}

/* Профиль секция */
.profile-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.18), transparent 40%),
                linear-gradient(135deg, rgba(168, 85, 247, 0.95), rgba(124, 58, 237, 0.85));
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 18px 40px rgba(124,58,237,0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.profile-text {
    display: flex;
    flex-direction: column;
}

.profile-name {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.profile-role {
    font-size: 12px;
    color: var(--muted2);
}

.partnership {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.04);
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* Карточки статистики */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 12px 16px;
    background: transparent;
}

.stat-card {
    background: var(--panel);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(18px);
    min-height: 86px;
}

.stat-icon {
    font-size: 20px;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 14px 30px rgba(0,0,0,0.35);
}

.stat-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.stat-label {
    font-size: 10px;
    color: var(--muted2);
    text-align: center;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
}

/* Счет и прогресс */
.score-section {
    padding: 18px 16px 14px;
    background: transparent;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}

.main-score {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
}

.coin-icon {
    font-size: 0;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.26), transparent 45%),
                linear-gradient(135deg, rgba(255,255,255,0.12), rgba(255,255,255,0.06));
    border: 1px solid rgba(255,255,255,0.14);
    box-shadow: 0 18px 40px rgba(168, 85, 247, 0.22);
}

.coin-icon::before {
    content: "◈"; /* simple crystal glyph */
    font-size: 18px;
    color: rgba(255,255,255,0.88);
    text-shadow: 0 0 18px rgba(168,85,247,0.55);
}

.score-value {
    font-size: 40px;
    font-weight: 800;
    color: rgba(255,255,255,0.95);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.4px;
}

.currency-bar {
    margin: 8px auto 10px;
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}

.currency-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(18px);
    box-shadow: 0 12px 36px rgba(0,0,0,0.32);
}

.currency-chip .icon::before {
    width: 16px;
    height: 16px;
}

.currency-value {
    font-weight: 800;
    font-size: 12px;
    color: rgba(255,255,255,0.92);
    letter-spacing: 0.2px;
    font-variant-numeric: tabular-nums;
}

.level-progress {
    margin-top: 12px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 12px;
}

.progress-label {
    color: var(--muted2);
    font-weight: 500;
}

.progress-label-right {
    color: #ffffff;
    font-weight: 600;
}

.progress-bar {
    height: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(168,85,247,0.90) 0%, rgba(124,58,237,0.92) 55%, rgba(192,132,252,0.92) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 10%;
}

/* Центральная тапалка */
.tap-section {
    padding: 18px 16px 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    min-height: 300px;
}

.tap-circle {
    width: 260px;
    height: 260px;
    border-radius: 999px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    border: none;
    box-shadow: none;
    backdrop-filter: blur(18px);
    transition: transform 170ms cubic-bezier(.2,.9,.2,1), filter 170ms ease;
    user-select: none;
    will-change: transform;
}

.mascot-img {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    width: 64%;
    height: 64%;
    z-index: 3;
    filter: drop-shadow(0 22px 40px rgba(0,0,0,0.55)) drop-shadow(0 0 26px rgba(168,85,247,0.28));
    opacity: 0.98;
    transition: transform 120ms ease, filter 120ms ease;
    user-select: none;
    pointer-events: none;
}

.tap-circle.has-mascot .dino-character {
    opacity: 0;
    transform: scale(0.98);
}

.tap-circle:active .mascot-img {
    transform: translate(-50%, -50%) scale(0.98);
    filter: drop-shadow(0 26px 46px rgba(0,0,0,0.62)) drop-shadow(0 0 34px rgba(168,85,247,0.34));
}

.tap-circle::before {
    content: "";
    position: absolute;
    inset: 22px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 30% 30%, rgba(255,255,255,0.14), transparent 45%),
        radial-gradient(circle at 55% 65%, rgba(168, 85, 247, 0.20), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.10);
}

.tap-circle::after {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 999px;
    box-shadow:
        0 0 0 10px rgba(168, 85, 247, 0.16),
        0 0 0 18px rgba(124, 58, 237, 0.10),
        0 0 60px rgba(168, 85, 247, 0.22);
    pointer-events: none;
}

.tap-circle:active {
    transform: scale(0.985);
}

.tap-circle.tap-disabled {
    pointer-events: none;
    filter: grayscale(0.3) saturate(0.7);
    opacity: 0.75;
}
.tap-circle.tap-disabled::after {
    box-shadow:
        0 0 0 8px rgba(255,255,255,0.06),
        0 0 30px rgba(255,255,255,0.06);
}

.dino-character {
    font-size: 120px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
    transition: all 0.3s ease;
    animation: float 3s ease-in-out infinite;
}

.dino-character.level-2 {
    filter: drop-shadow(0 4px 12px rgba(255, 215, 0, 0.45));
}

.dino-character.level-3 {
    filter: drop-shadow(0 4px 16px rgba(255, 140, 0, 0.55));
}

.dino-character.level-4 {
    filter: drop-shadow(0 4px 20px rgba(0, 255, 191, 0.6));
}

.dino-character.level-5 {
    filter: drop-shadow(0 4px 24px rgba(138, 43, 226, 0.7));
    animation: float 3s ease-in-out infinite, glow 2s ease-in-out infinite;
}

/* Энергия и бусты */
.energy-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    padding: 14px 16px 18px;
    background: transparent;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.energy-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.90);
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 999px;
    padding: 10px 12px;
    backdrop-filter: blur(18px);
}

.energy-icon {
    font-size: 20px;
}

.energy-timer {
    font-size: 12px;
    color: var(--muted);
    margin-left: 6px;
    white-space: nowrap;
}

.boost-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(168,85,247,0.95) 0%, rgba(124,58,237,0.95) 55%, rgba(192,132,252,0.90) 100%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 14px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 18px 40px rgba(124,58,237,0.28);
    justify-content: center;
}

.boost-btn:active {
    transform: scale(0.95);
}

.boost-icon {
    font-size: 18px;
}

/* Нижняя навигация */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    background: rgba(8, 8, 12, 0.78);
    border-top: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(18px);
    z-index: 100;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 10px;
    cursor: pointer;
    transition: opacity 0.2s ease;
    border-radius: 14px;
    position: relative;
}

.nav-item:active {
    opacity: 0.6;
}

.nav-icon {
    font-size: 20px;
    color: rgba(255,255,255,0.75);
}

.nav-label {
    font-size: 10px;
    color: rgba(255,255,255,0.55);
}

.nav-item.active {
    background: rgba(168,85,247,0.18);
    border: 1px solid rgba(168,85,247,0.35);
    box-shadow: 0 10px 30px rgba(168,85,247,0.20);
}

.nav-item.active .nav-icon {
    filter: drop-shadow(0 0 12px rgba(168,85,247,0.55));
    color: rgba(255,255,255,0.92);
}

.nav-item.active .nav-label {
    color: rgba(255,255,255,0.88);
    font-weight: 700;
}

/* Уведомление об апгрейде */
.upgrade-notification {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
}

/* Make bottom nav feel like a premium dock */
.bottom-nav {
    padding: 10px 10px;
    gap: 6px;
}
.bottom-nav .nav-item {
    min-width: 64px;
}
.bottom-nav .nav-item.active {
    background: linear-gradient(180deg, rgba(168,85,247,0.22), rgba(124,58,237,0.12));
}

.upgrade-notification.show {
    display: flex;
}

.notification-content {
    background: rgba(12, 10, 18, 0.82);
    padding: 32px;
    border-radius: 20px;
    text-align: center;
    max-width: 85%;
    box-shadow: 0 22px 70px rgba(0,0,0,0.72);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(22px);
    animation: scaleIn 0.3s ease;
}

.notification-content h2 {
    font-size: 28px;
    margin-bottom: 16px;
    color: rgba(255,255,255,0.92);
}

.notification-content p {
    font-size: 18px;
    margin-bottom: 24px;
    color: #ffffff;
}

.notification-content button {
    background: linear-gradient(135deg, rgba(168,85,247,0.95) 0%, rgba(124,58,237,0.95) 55%, rgba(192,132,252,0.90) 100%);
    color: rgba(255,255,255,0.96);
    border: none;
    padding: 12px 32px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 18px 40px rgba(124,58,237,0.26);
}

.notification-content button:active {
    transform: scale(0.95);
}

/* Эффекты тапа */
.tap-effects {
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 50;
}

.tap-effect {
    position: absolute;
    font-size: 28px;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    animation: tapPop 0.6s ease-out forwards;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.tap-effect.crit {
    color: rgba(168,85,247,0.98);
    text-shadow: 0 2px 10px rgba(255, 92, 244, 0.7);
    font-size: 32px;
}

/* Квесты */
.quests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quest-item {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px;
    backdrop-filter: blur(18px);
}

.quest-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.quest-reward {
    font-size: 12px;
    color: rgba(255,255,255,0.78);
    margin-bottom: 6px;
}

.quest-progress {
    height: 8px;
    background: rgba(255,255,255,0.07);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.quest-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, rgba(168,85,247,0.85) 0%, rgba(124,58,237,0.95) 65%, rgba(192,132,252,0.85) 100%);
    width: 0%;
    transition: width 0.3s ease;
}

.quest-status {
    font-size: 12px;
    color: #aaa;
}

.quests-note {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

/* Офлайн баннер */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 10px 14px;
    background: rgba(168,85,247,0.22);
    border-bottom: 1px solid rgba(255,255,255,0.10);
    color: #fff;
    font-size: 14px;
    text-align: center;
    z-index: 3000;
    display: none;
}

@media (max-width: 360px) {
    .offline-banner {
        font-size: 12px;
    }
}

/* Анимации */
@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes glow {
    0%, 100% {
        filter: drop-shadow(0 4px 24px rgba(138, 43, 226, 0.7));
    }
    50% {
        filter: drop-shadow(0 4px 32px rgba(255, 20, 147, 0.9));
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes tapPop {
    0% {
        transform: scale(0.5) translateY(0);
        opacity: 1;
    }
    100% {
        transform: scale(1.2) translateY(-60px);
        opacity: 0;
    }
}

/* Модальное окно ежедневных наград */
.modal {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease;
}

/* Settings should be able to open above the hub ("⋯") modal */
#settingsModal {
    z-index: 2600;
}

/* Inventory visuals (rarity) */
.rarity-common { border-color: rgba(255,255,255,0.08); }
.rarity-rare { border-color: rgba(124,58,237,0.40); box-shadow: 0 0 0 1px rgba(124,58,237,0.16) inset; background: rgba(124,58,237,0.06); }
.rarity-epic { border-color: rgba(168,85,247,0.45); box-shadow: 0 0 0 1px rgba(168,85,247,0.18) inset; background: rgba(168,85,247,0.07); }
.rarity-legendary { border-color: rgba(168,85,247,0.40); box-shadow: 0 0 0 1px rgba(168,85,247,0.16) inset; }

.equipped-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(168,85,247,0.16);
    border: 1px solid rgba(168,85,247,0.28);
    color: rgba(255,255,255,0.92);
    font-weight: 800;
    margin-left: 8px;
}

.modal.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-content {
    background: rgba(12, 10, 18, 0.78);
    border-radius: 20px;
    padding: 0;
    max-width: 90%;
    width: 400px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 22px 70px rgba(0,0,0,0.72);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(22px);
    transform: translateY(14px) scale(0.985);
    opacity: 0.98;
    transition: transform 180ms ease, opacity 180ms ease;
}

.modal.show .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* Skeleton loaders */
.skeleton { display: flex; flex-direction: column; gap: 12px; }
.skeleton-row {
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    overflow: hidden;
    position: relative;
}
.skeleton-row::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-60%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.08), transparent);
    animation: shimmer 1.25s ease-in-out infinite;
}
.sk {
    height: 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
}
.sk-title { width: 62%; margin-bottom: 10px; }
.sk-sub { width: 40%; opacity: 0.8; margin-bottom: 12px; }
.sk-bar { width: 100%; height: 8px; opacity: 0.7; }

@keyframes shimmer {
    0% { transform: translateX(-60%); }
    100% { transform: translateX(60%); }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.modal-header h2 {
    font-size: 24px;
    color: rgba(255,255,255,0.92);
    margin: 0;
}

.modal-close {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 24px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(85vh - 90px);
}

.reward-info {
    text-align: center;
}

.streak-info {
    font-size: 16px;
    color: var(--muted);
    margin-bottom: 16px;
}

.streak-info strong {
    color: rgba(255,255,255,0.92);
    font-size: 20px;
}

.reward-amount {
    font-size: 36px;
    font-weight: 700;
    color: rgba(255,255,255,0.95);
    margin: 24px 0;
}

.claim-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, rgba(168,85,247,0.95) 0%, rgba(124,58,237,0.95) 55%, rgba(192,132,252,0.90) 100%);
    color: rgba(255,255,255,0.96);
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease;
    box-shadow: 0 18px 40px rgba(124,58,237,0.26);
    margin-top: 16px;
}

.claim-btn:active {
    transform: scale(0.95);
}

.claim-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Магазин */
.shop-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.shop-item {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px;
    backdrop-filter: blur(18px);
}

.shop-title {
    font-weight: 700;
    margin-bottom: 6px;
}

.shop-desc {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.shop-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.shop-cost {
    color: rgba(255,255,255,0.92);
    font-weight: 700;
}

.shop-btn {
    background: linear-gradient(135deg, rgba(168,85,247,0.95) 0%, rgba(124,58,237,0.95) 55%, rgba(192,132,252,0.90) 100%);
    color: rgba(255,255,255,0.96);
    border: none;
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 700;
    cursor: pointer;
}

.shop-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Hub + list UI helpers (used by app.js) */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.hub-btn {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px 12px;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}
.hub-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.hub-btn:active { opacity: 0.8; }

.card {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px;
    padding: 14px;
    backdrop-filter: blur(18px);
}

.list { display: flex; flex-direction: column; gap: 10px; }
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px;
}
.title { font-weight: 800; }
.muted { color: #9aa0aa; font-size: 12px; margin-top: 4px; }
.row { display: flex; align-items: center; }
.btn-small {
    background: linear-gradient(135deg, rgba(168,85,247,0.95) 0%, rgba(124,58,237,0.95) 55%, rgba(192,132,252,0.90) 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 12px;
    font-weight: 700;
    cursor: pointer;
}
.btn-small:disabled { opacity: 0.5; cursor: not-allowed; }

/* Календарь */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.calendar-day {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    backdrop-filter: blur(18px);
}

.calendar-day.active {
    border-color: rgba(168,85,247,0.45);
    box-shadow: 0 0 0 1px rgba(168,85,247,0.18) inset, 0 16px 40px rgba(168,85,247,0.18);
}

.calendar-day.done {
    background: rgba(168,85,247,0.10);
    border-color: rgba(168,85,247,0.28);
}

.calendar-reward {
    text-align: center;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    margin-bottom: 10px;
}

/* Лидерборд */
.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.leader-item {
    background: rgba(255,255,255,0.035);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(18px);
}

.leader-name {
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.leader-score {
    color: rgba(255,255,255,0.92);
    font-weight: 700;
}

/* Настройки */
.setting-item {
    margin-bottom: 10px;
}

.setting-note {
    font-size: 12px;
    color: rgba(255,255,255,0.55);
}

/* ====== Game Hub + новые модалки ====== */
.hub-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.hub-btn {
    width: 100%;
    padding: 12px 12px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(26, 26, 38, 0.78);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s ease, opacity 0.15s ease;
}

.hub-btn:active {
    transform: scale(0.98);
    opacity: 0.9;
}

.card {
    background: #121220;
    border: 1px solid #26263a;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 12px;
}

.row {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.input {
    flex: 1;
    min-width: 120px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #26263a;
    background: rgba(255,255,255,0.04);
    color: #fff;
    outline: none;
}

.input::placeholder {
    color: #888;
}

.muted {
    color: #aaa;
    font-size: 12px;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}

.list-item .title {
    font-weight: 700;
}

.btn-small {
    padding: 8px 10px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, rgba(168,85,247,0.95) 0%, rgba(124,58,237,0.95) 55%, rgba(192,132,252,0.90) 100%);
    color: rgba(255,255,255,0.96);
    font-weight: 800;
    cursor: pointer;
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Адаптивность */
@media (max-width: 360px) {
    .stats-cards {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
        padding: 8px 12px;
    }
    
    .stat-card {
        padding: 8px;
    }
    
    .stat-icon {
        font-size: 20px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    .stat-value {
        font-size: 12px;
    }
    
    .tap-circle {
        width: 180px;
        height: 180px;
    }
    
    .dino-character {
        font-size: 100px;
    }

    .hub-grid {
        grid-template-columns: 1fr;
    }
}
