/* ========================================= */
/*   APP SHELL (Global UI)                   */
/* ========================================= */

/* --- MOBILE BOTTOM NAVIGATION --- */
.bottom-nav {
    display: none; /* Hidden by default (Desktop or non-landing views) */
    position: fixed;
    bottom: 0; left: 0; right: 0;
    /* PWA Fix: Auto height allows it to grow with the Safe Area */
    height: auto; 
    min-height: 80px; 
    background-color: var(--bg-surface);
    border-top: var(--border-width) solid var(--border-subtle);
    padding-top: 12px;
    padding-bottom: max(12px, env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0,0,0,0.05);
}

.nav-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: 100%;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    gap: 4px;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.nav-item .app-icon {
    width: 28px; height: 28px;
    fill: var(--text-muted);
    transition: fill 0.2s;
}

.nav-label {
    font-size: 0.75rem;
    font-weight: 800;
}

.nav-item.active { color: var(--c-blue); }
.nav-item.active .app-icon { fill: var(--c-blue); }

/* FIX: Only show on Mobile AND Landing View */
@media (max-width: 767px) {
    body.view-landing .bottom-nav { display: block; }
    body.view-game .bottom-nav { display: none; }
}

/* --- PROGRESS BAR (Games) --- */
.pb-container {
    width: 100%;
    margin-bottom: 1rem;
    position: relative;
    height: 30px; 
    display: flex;
    align-items: center;
}

.pb-track {
    left: 16px; 
    right: 16px;
    height: 12px;
    background-color: white;
    border: var(--border-width) solid var(--border-subtle);
    border-radius: var(--radius-pill);
    overflow: hidden;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.pb-fill {
    height: 100%;
    width: 0%;
    background-color: var(--c-blue);
    transition: width 0.3s ease;
}

.pb-knob-guide {
    position: absolute;
    top: 0; left: 16px; right: 16px; height: 100%;
    pointer-events: none; z-index: 2;
}

.pb-knob {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--text-main);
    color: white;
    font-size: 0.75rem;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
    transition: left 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.pb-total {
    left: 100% !important;
    background-color: var(--c-grey-300);
    color: var(--text-muted);
}

.pb-current {
    left: 0%;
    background-color: var(--c-blue);
}

/* --- SKELETON UI --- */
.skeleton {
    background-color: var(--c-grey-50);
    position: relative;
    overflow: hidden;
    min-height: 1em; 
}

.skeleton::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background-image: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0,
        rgba(255, 255, 255, 0.6) 20%,
        rgba(255, 255, 255, 0.9) 60%,
        rgba(255, 255, 255, 0)
    );
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.skeleton-logo { width: 60px; height: 60px; border-radius: 12px; flex-shrink: 0; }
.skeleton-h1 { width: 60%; height: 2rem; border-radius: 8px; margin-bottom: 0.25rem; }
.skeleton-sub { width: 40%; height: 1rem; border-radius: 4px; }
.skeleton-title { width: 40%; height: 1.4rem; border-radius: 6px; margin-bottom: 1rem; }
.skeleton-text { width: 100%; height: 1rem; border-radius: 4px; margin-bottom: 0.5rem; }
.skeleton-chart-block { width: 100%; height: 300px; border-radius: 12px; margin-top: 1rem; }
.skeleton-grid-box { width: 100%; aspect-ratio: 1/1; border-radius: 12px; }
.skeleton-btn { width: 100%; height: 3rem; border-radius: var(--radius-md); }

/* --- PWA INSTALL CARD --- */
.install-card-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.install-instructions {
    background-color: var(--c-grey-50);
    border-radius: var(--radius-md);
    padding: 1rem;
    font-size: 0.95rem;
    color: var(--text-main);
    line-height: 1.5;
    margin-top: 1rem; 
    border-top: 2px solid var(--border-subtle);
}

.install-instructions p { margin-bottom: 0.75rem; display: flex; align-items: center; flex-wrap: wrap; }
.inline-icon { width: 1.3em; height: 1.3em; vertical-align: middle; display: inline-block; fill: var(--c-blue); margin: 0 4px; }

@media (min-width: 768px) {
    .pwa-install-card { display: none !important; }
}