/* ═══════════════════════════════════════════════════════════════
   MODHUB — Global Gaming Design System
   Shared tokens, components & utilities — loaded on every page
   ═══════════════════════════════════════════════════════════════ */

/* ── 1. DESIGN TOKENS ─────────────────────────────────────────── */
:root {
    /* Brand colours */
    --mh-primary:       #4ade80;
    --mh-primary-dark:  #22c55e;
    --mh-primary-glow:  rgba(74,222,128,0.22);
    --mh-primary-dim:   rgba(74,222,128,0.10);
    --mh-gold:          #f59e0b;
    --mh-gold-dim:      rgba(245,158,11,0.12);
    --mh-red:           #ef4444;
    --mh-red-dim:       rgba(239,68,68,0.12);
    --mh-indigo:        #818cf8;
    --mh-indigo-dim:    rgba(129,140,248,0.12);
    --mh-sky:           #38bdf8;
    /* Surfaces */
    --mh-bg:            #050507;
    --mh-surface:       #0a0a0f;
    --mh-card:          #111118;
    --mh-card-hover:    #18182a;
    --mh-border:        rgba(255,255,255,0.06);
    --mh-border-hover:  rgba(255,255,255,0.12);
    /* Typography */
    --mh-text:          #e4e4e7;
    --mh-text-muted:    #71717a;
    --mh-font:          'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --mh-font-heading:  'Space Grotesk', 'Geist', sans-serif;
    /* Layout */
    --mh-radius:        16px;
    --mh-radius-sm:     10px;
    --mh-radius-xs:     6px;
    --mh-transition:    cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── 2. CUSTOM SCROLLBAR ───────────────────────────────────────── */
::-webkit-scrollbar              { width: 6px; height: 6px; }
::-webkit-scrollbar-track        { background: transparent; }
::-webkit-scrollbar-thumb        { background: rgba(255,255,255,0.10); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover  { background: rgba(255,255,255,0.20); }
*                                 { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.10) transparent; }

/* ── 3. TEXT SELECTION ─────────────────────────────────────────── */
::selection { background: rgba(74,222,128,0.28); color: #fff; }

/* ── 4. FOCUS RING (accessibility + gaming feel) ───────────────── */
*:focus-visible {
    outline: 2px solid var(--mh-primary) !important;
    outline-offset: 3px !important;
    border-radius: 4px !important;
}

/* ── 5. GAMING BADGES ──────────────────────────────────────────── */
.badge-hot,
.badge-new,
.badge-trending,
.badge-featured,
.badge-top {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.60rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: var(--mh-radius-xs);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    line-height: 1.3;
    white-space: nowrap;
}

.badge-hot {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #fff;
    box-shadow: 0 2px 10px rgba(239,68,68,0.40);
    animation: pulse-hot 2.5s infinite;
}
@keyframes pulse-hot {
    0%,100% { box-shadow: 0 2px 10px rgba(239,68,68,0.40); }
    50%      { box-shadow: 0 2px 18px rgba(239,68,68,0.65); }
}

.badge-new {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #000;
}

.badge-trending {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #000;
}

.badge-featured {
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
}

.badge-top {
    background: linear-gradient(135deg, #38bdf8, #0ea5e9);
    color: #fff;
}

/* ── 6. RANK NUMBERS (top-3 leaderboard) ──────────────────────── */
.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    flex-shrink: 0;
}
.rank-1 { background: linear-gradient(135deg,#f59e0b,#d97706); color:#000; }
.rank-2 { background: rgba(192,192,192,0.15); color:#d4d4d8; border:1px solid rgba(255,255,255,0.12); }
.rank-3 { background: rgba(180,100,50,0.18); color:#cd9b6a; border:1px solid rgba(180,100,50,0.2); }

/* ── 7. KEYBOARD SHORTCUT HINT ─────────────────────────────────── */
.kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.10);
    color: var(--mh-text-muted);
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 5px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    line-height: 1.4;
    letter-spacing: 0.3px;
    transition: all 0.15s;
    user-select: none;
}
.kbd:hover { background: rgba(255,255,255,0.10); color: var(--mh-text); }

/* ── 8. SKELETON LOADING ───────────────────────────────────────── */
.skeleton {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.03) 25%,
        rgba(255,255,255,0.07) 50%,
        rgba(255,255,255,0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.6s infinite linear;
    border-radius: 8px;
    pointer-events: none;
}
@keyframes shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}
.skeleton-text   { height: 14px; margin-bottom: 8px; }
.skeleton-title  { height: 22px; width: 65%; margin-bottom: 12px; }
.skeleton-thumb  { aspect-ratio: 16/9; width: 100%; }

/* ── 9. FADE-UP ANIMATION ──────────────────────────────────────── */
.mh-fade-up {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.mh-fade-up.visible { opacity: 1; transform: translateY(0); }

/* Stagger delays for grids */
.mh-fade-up:nth-child(1) { transition-delay: 0.05s; }
.mh-fade-up:nth-child(2) { transition-delay: 0.10s; }
.mh-fade-up:nth-child(3) { transition-delay: 0.15s; }
.mh-fade-up:nth-child(4) { transition-delay: 0.20s; }
.mh-fade-up:nth-child(5) { transition-delay: 0.25s; }
.mh-fade-up:nth-child(6) { transition-delay: 0.30s; }

/* ── 10. GLOW TEXT EFFECTS ─────────────────────────────────────── */
.text-glow-green {
    color: var(--mh-primary);
    text-shadow: 0 0 20px rgba(74,222,128,0.45), 0 0 40px rgba(74,222,128,0.18);
}
.text-glow-gold {
    color: var(--mh-gold);
    text-shadow: 0 0 20px rgba(245,158,11,0.45);
}

/* ── 11. RATING STARS ──────────────────────────────────────────── */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--mh-gold);
    font-size: 0.78rem;
}
.star-rating .sr-val {
    font-weight: 700;
    color: var(--mh-text);
    font-size: 0.80rem;
    margin-left: 3px;
}
.star-rating .sr-cnt {
    color: var(--mh-text-muted);
    font-size: 0.70rem;
    font-weight: 400;
}

/* Interactive star rater */
.star-rater { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-rater input { display: none; }
.star-rater label {
    font-size: 1.4rem; cursor: pointer; color: rgba(255,255,255,0.1);
    transition: color 0.15s, transform 0.15s;
}
.star-rater label:hover,
.star-rater label:hover ~ label,
.star-rater input:checked ~ label { color: var(--mh-gold); }
.star-rater label:hover { transform: scale(1.15); }

/* ── 12. VERSION BADGE ─────────────────────────────────────────── */
.ver-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--mh-text-muted);
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    letter-spacing: 0.3px;
}

/* ── 13. TOAST NOTIFICATION ────────────────────────────────────── */
.mh-toast {
    position: fixed;
    bottom: 28px; left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: #1c1c28;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 14px;
    padding: 14px 20px;
    color: var(--mh-text);
    font-size: 0.9rem; font-weight: 500;
    box-shadow: 0 8px 40px rgba(0,0,0,0.55);
    z-index: 9999;
    opacity: 0;
    transition: all 0.35s var(--mh-transition);
    display: flex; align-items: center; gap: 10px;
    min-width: 240px; max-width: 380px;
    pointer-events: none;
    backdrop-filter: blur(12px);
}
.mh-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.mh-toast.success { border-color: rgba(74,222,128,0.25); }
.mh-toast.success i { color: var(--mh-primary); font-size: 1.1rem; }
.mh-toast.error   { border-color: rgba(239,68,68,0.25); }
.mh-toast.error i { color: var(--mh-red); font-size: 1.1rem; }
.mh-toast.info    { border-color: rgba(56,189,248,0.25); }
.mh-toast.info  i { color: var(--mh-sky); font-size: 1.1rem; }

/* ── 14. TOOLTIP ───────────────────────────────────────────────── */
.mh-tip { position: relative; cursor: default; }
.mh-tip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: calc(100% + 7px); left: 50%;
    transform: translateX(-50%);
    background: #1c1c28;
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 8px;
    color: var(--mh-text);
    font-size: 0.74rem; font-weight: 500;
    white-space: nowrap;
    padding: 5px 10px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.18s;
    z-index: 200;
}
.mh-tip:hover::after { opacity: 1; }

/* ── 15. MOBILE FLOATING SEARCH BUTTON ────────────────────────── */
.mh-search-fab {
    position: fixed;
    bottom: 80px; right: 20px;
    width: 50px; height: 50px;
    border-radius: 50%;
    background: var(--mh-primary);
    color: #000;
    display: none; align-items: center; justify-content: center;
    font-size: 1.25rem;
    box-shadow: 0 4px 24px rgba(74,222,128,0.40);
    z-index: 999;
    transition: all 0.3s var(--mh-transition);
    border: none; cursor: pointer;
}
.mh-search-fab:hover { transform: scale(1.08); box-shadow: 0 6px 32px rgba(74,222,128,0.55); }
@media (max-width: 991px) { .mh-search-fab { display: flex; } }

/* ── 16. STAT COUNTER (hero stats) ────────────────────────────── */
.mh-stat-block {
    display: flex; flex-direction: column; gap: 2px;
    min-width: 80px;
}
.mh-stat-val {
    font-family: var(--mh-font-heading);
    font-size: 1.55rem; font-weight: 900;
    letter-spacing: -0.03em;
    color: #fff;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}
.mh-stat-lbl {
    font-size: 0.72rem; font-weight: 500;
    color: var(--mh-text-muted);
    text-transform: uppercase; letter-spacing: 0.8px;
}
.mh-stat-sep {
    width: 1px;
    background: rgba(255,255,255,0.08);
    height: 36px;
    align-self: center;
    flex-shrink: 0;
}

/* ── 17. PROGRESS BAR ──────────────────────────────────────────── */
.mh-progress {
    height: 4px;
    background: rgba(255,255,255,0.06);
    border-radius: 4px;
    overflow: hidden;
}
.mh-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--mh-primary), var(--mh-primary-dark));
    border-radius: 4px;
    transition: width 0.65s var(--mh-transition);
}
.mh-progress-bar.gold { background: linear-gradient(90deg, var(--mh-gold), #d97706); }

/* ── 18. GAME TILE (game listing cards) ────────────────────────── */
.game-tile {
    background: var(--mh-card);
    border: 1px solid var(--mh-border);
    border-radius: var(--mh-radius);
    overflow: hidden;
    transition: all 0.30s var(--mh-transition);
    display: block; color: inherit; text-decoration: none;
}
.game-tile:hover {
    border-color: var(--mh-border-hover);
    color: inherit;
    transform: translateY(-4px);
    box-shadow: 0 14px 40px rgba(0,0,0,0.35);
}
.game-tile-thumb { aspect-ratio: 16/9; overflow: hidden; background: var(--mh-surface); }
.game-tile-thumb img { width:100%; height:100%; object-fit:cover; transition:transform 0.40s var(--mh-transition); }
.game-tile:hover .game-tile-thumb img { transform: scale(1.06); }
.game-tile-body { padding: 14px 16px; }
.game-tile-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 4px; color: #fff; }
.game-tile-count { font-size: 0.78rem; color: var(--mh-text-muted); }

/* ── 19. CARD GLOW CLASS ───────────────────────────────────────── */
.card-glow:hover {
    box-shadow:
        0 0 0 1px rgba(74,222,128,0.18),
        0 16px 48px rgba(0,0,0,0.35),
        0 0 50px rgba(74,222,128,0.06) !important;
}

/* ── 20. COPY-TO-CLIPBOARD BUTTON ──────────────────────────────── */
.btn-copy {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--mh-radius-xs);
    color: var(--mh-text-muted); font-size: 0.78rem; font-weight: 600;
    padding: 5px 12px; cursor: pointer;
    transition: all 0.2s var(--mh-transition);
}
.btn-copy:hover { background: rgba(255,255,255,0.09); color: var(--mh-text); border-color: rgba(255,255,255,0.14); }
.btn-copy.copied { background: var(--mh-primary-dim); color: var(--mh-primary); border-color: rgba(74,222,128,0.2); }

/* ── 21. PILL TABS ─────────────────────────────────────────────── */
.mh-tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--mh-border);
    border-radius: 10px; padding: 4px;
}
.mh-tab-btn {
    padding: 7px 16px; border-radius: 7px;
    background: transparent; border: none;
    color: var(--mh-text-muted); font-size: 0.85rem; font-weight: 600;
    cursor: pointer; transition: all 0.18s; white-space: nowrap;
}
.mh-tab-btn:hover { color: var(--mh-text); background: rgba(255,255,255,0.04); }
.mh-tab-btn.active {
    background: var(--mh-card); color: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ── 22. FILE-SIZE / SPEC CHIPS ────────────────────────────────── */
.spec-chip {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 8px; padding: 5px 10px;
    font-size: 0.78rem; font-weight: 600; color: var(--mh-text-muted);
}
.spec-chip i { font-size: 0.9rem; color: var(--mh-primary); }

/* ── 23. DOWNLOAD COUNTER INLINE ───────────────────────────────── */
.dl-num {
    display: inline-flex; align-items: center; gap: 4px;
    color: var(--mh-text-muted); font-size: 0.78rem; font-weight: 600;
    transition: color 0.18s;
}
.dl-num:hover { color: var(--mh-primary); }
.dl-num i { font-size: 0.82rem; }

/* ── 24. "ONLINE" / STATUS DOT ─────────────────────────────────── */
.status-dot {
    width: 8px; height: 8px; border-radius: 50%; display: inline-block;
}
.status-dot.online  { background: var(--mh-primary); box-shadow: 0 0 6px rgba(74,222,128,0.6); animation: blink-online 2s infinite; }
.status-dot.offline { background: var(--mh-text-muted); }
@keyframes blink-online {
    0%,100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

/* ── 25. SEARCH KEYBOARD SHORTCUT HINT ────────────────────────── */
.search-kbd-wrap {
    position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
    display: flex; gap: 2px; pointer-events: none;
}
@media (max-width: 767px) { .search-kbd-wrap { display: none; } }

/* ── 26. IMAGE LIGHTBOX OVERLAY ────────────────────────────────── */
.mh-lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.92);
    backdrop-filter: blur(16px);
    z-index: 9990;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: opacity 0.3s;
    pointer-events: none;
}
.mh-lightbox.open { opacity: 1; pointer-events: auto; }
.mh-lightbox img  { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 0 80px rgba(0,0,0,0.8); }
.mh-lightbox-close {
    position: absolute; top: 20px; right: 24px;
    width: 44px; height: 44px; border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: background 0.2s;
}
.mh-lightbox-close:hover { background: rgba(255,255,255,0.15); }

/* ── 27. GLOBAL UTILITIES ──────────────────────────────────────── */
.text-accent   { color: var(--mh-primary) !important; }
.text-gold     { color: var(--mh-gold) !important; }
.text-danger-s { color: var(--mh-red) !important; }
.bg-glass {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.06);
}
.border-accent { border-color: rgba(74,222,128,0.3) !important; }
.rounded-mh    { border-radius: var(--mh-radius) !important; }
.rounded-mh-sm { border-radius: var(--mh-radius-sm) !important; }
.no-select     { user-select: none; -webkit-user-select: none; }
