:root {
    --bg: #0b0b0c;
    --bg-2: #111113;
    --bg-3: #171719;
    --panel: #101012;
    --panel-solid: #101012;
    --surface: #101012;
    --surface-2: #17171a;
    --border: #26262b;
    --border-strong: #3a3a41;
    --text: #ededed;
    --text-dim: #a1a1a8;
    --text-faint: #6f6f78;

    /* Tema blu */
    --accent: #3b82f6;
    --accent-2: #60a5fa;
    --accent-3: #93c5fd;
    --accent-rgb: 59, 130, 246;
    --accent-soft: rgba(59, 130, 246, 0.12);
    --accent-soft-2: rgba(59, 130, 246, 0.18);
    --accent-border: rgba(59, 130, 246, 0.45);
    --accent-glow: rgba(59, 130, 246, 0.35);
    --accent-hover: #2563eb;

    --lime: #4ade80;
    --danger: #f87171;
    --amber: #fbbf24;

    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 10px;
    --radius-xl: 12px;

    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, 'Cascadia Code', Consolas, monospace;

    --glass: #101012;
    --glass-strong: #0b0b0c;
    --ring: 0 0 0 3px var(--accent-soft);
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 6px 24px rgba(0, 0, 0, 0.40);
    --shadow-glow: 0 0 24px rgba(59, 130, 246, 0.25);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

body {
    padding: 0 20px 80px;
    position: relative;
    z-index: 0;
}

::selection { background: var(--accent-soft-2); color: #fff; }

/* Scrollbar */
* { scrollbar-width: thin; scrollbar-color: var(--accent-border) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
*::-webkit-scrollbar-thumb:hover { background: var(--accent); }

.hidden { display: none !important; }

/* ============ SFONDO ============ */
#particles-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(ellipse 70% 45% at 50% -5%, rgba(var(--accent-rgb), 0.18), transparent 55%),
        radial-gradient(ellipse 55% 40% at 90% 10%, rgba(var(--accent-rgb), 0.10), transparent 55%),
        radial-gradient(ellipse 45% 35% at 5% 40%, rgba(var(--accent-rgb), 0.06), transparent 60%),
        var(--bg);
}
#particles-canvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    display: block;
}

/* ============ TOPBAR ============ */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    max-width: 1280px;
    margin: 0 auto 40px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    background: rgba(16, 16, 18, 0.85);
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.06), 0 12px 30px rgba(0, 0, 0, 0.35);
}
.topbar::after {
    content: '';
    position: absolute;
    left: 20px; right: 20px; bottom: -1px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-border), transparent);
    pointer-events: none;
    opacity: 0.6;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    color: var(--text);
}
.brand:hover { opacity: 0.9; }

.brand-logo {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 0;
    background: var(--bg-3);
    color: white;
    flex-shrink: 0;
    border: 1px solid var(--border);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.brand:hover .brand-logo {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.brand-logo img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: inherit;
}

.brand-text { line-height: 1.1; }
.brand-text .name {
    font-weight: 600;
    font-size: 15px;
    display: flex;
    align-items: baseline;
    gap: 1px;
}
.brand-text .name em { font-style: normal; color: var(--accent-2); }
.brand-text .tag {
    font-size: 10px;
    color: var(--text-faint);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-weight: 600;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }

/* ============ PULSANTI ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
    white-space: nowrap;
}
.btn:hover {
    background: var(--bg-3);
    border-color: var(--accent-border);
    color: var(--text);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-soft);
}
.btn:active { transform: translateY(0); }

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    box-shadow: 0 6px 18px rgba(var(--accent-rgb), 0.25);
}
.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.40);
}

.btn-danger {
    border-color: var(--border);
    color: var(--danger);
}
.btn-danger:hover {
    background: rgba(248, 113, 113, 0.10);
    border-color: rgba(248, 113, 113, 0.40);
}

.btn-ghost { border-color: transparent; color: var(--text-dim); }
.btn-ghost:hover { background: var(--bg-3); border-color: var(--border); color: var(--text); }

.btn-sm { padding: 6px 11px; font-size: 11.5px; }

/* ============ HERO ============ */
.hero {
    max-width: 1280px;
    margin: 0 auto 32px;
    text-align: center;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: clamp(1.8rem, 4.5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 10px;
}

.hero h1 .grad {
    background: linear-gradient(120deg, var(--accent) 0%, var(--accent-2) 50%, var(--accent-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .sub {
    color: var(--text-dim);
    font-size: 14px;
    max-width: 560px;
    margin: 0 auto;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.stat-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    font-size: 12px;
    color: var(--text-dim);
    transition: transform 0.2s, border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.stat-chip:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.30);
}
.stat-chip b { color: var(--text); font-weight: 600; }
.stat-chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2); box-shadow: 0 0 8px var(--accent-glow); }
.stat-chip .dot.pulse { animation: pulse 2s ease-in-out infinite; }

/* ============ SEARCH + FILTRI ============ */
.search-zone {
    max-width: 1280px;
    margin: 0 auto 28px;
    position: relative;
    z-index: 1;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0 14px;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease, background-color 0.25s ease;
}
.search-box:hover {
    border-color: var(--border-strong);
}
.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 8px 24px rgba(var(--accent-rgb), 0.15);
    background: var(--bg-3);
    transform: translateY(-1px);
}
.search-icon { color: var(--text-faint); flex-shrink: 0; transition: color 0.2s; }
.search-box:focus-within .search-icon { color: var(--accent-2); }
.search-box input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    padding: 12px 12px;
}
.search-box input::placeholder { color: var(--text-faint); }

.clear-search {
    width: 28px; height: 28px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-dim);
    cursor: pointer;
    transition: 0.15s;
}
.clear-search:hover {
    border-color: var(--accent-border);
    color: var(--accent-3);
    background: var(--accent-soft);
}

.search-info {
    min-height: 20px;
    margin: 8px 2px 0;
    font-size: 12px;
    color: var(--text-faint);
}
.search-info strong { color: var(--text-dim); font-weight: 600; }

.filters {
    display: flex;
    gap: 6px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.chip {
    padding: 7px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.18s;
}
.chip:hover {
    border-color: var(--accent-border);
    color: var(--text);
    background: var(--accent-soft);
    transform: translateY(-1px);
}
.chip.active {
    background: var(--accent-soft-2);
    border-color: var(--accent);
    color: var(--accent-3);
    box-shadow: 0 0 0 1px var(--accent-soft), 0 6px 16px rgba(var(--accent-rgb), 0.15);
}

/* ============ GRIGLIA ============ */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ============ CARD ============ */
.card {
    position: relative;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    will-change: transform;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.3s, background-color 0.3s, box-shadow 0.3s;
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes cardIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-border);
    background: var(--bg-2);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--accent-soft), 0 0 30px rgba(var(--accent-rgb), 0.10);
}

.card-image-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
    background: radial-gradient(ellipse at 50% 40%, #101b26 0%, #090e15 75%);
    overflow: hidden;
}
.card-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(11, 13, 18, 0.85), transparent 50%);
    pointer-events: none;
    transition: opacity 0.3s;
}
.card:hover .card-image-container::after { opacity: 0.8; }
.card-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.card:hover .card-image-container img { transform: scale(1.06); }

.card-cat {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 2;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(11, 11, 12, 0.85);
    border: 1px solid var(--accent-border);
    color: var(--accent-3);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    backdrop-filter: blur(6px);
}

.card-content {
    padding: 12px 14px 13px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 5px;
}
.card h3 {
    font-size: 13.5px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s;
}
.card:hover h3 { color: var(--accent-3); }
.card .meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-faint);
    font-size: 11px;
}
.card .meta .sep { opacity: 0.4; }
.card .meta .dl-count { color: var(--text-faint); display: inline-flex; align-items: center; gap: 4px; }
.card .description {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.card .card-foot {
    margin-top: auto;
    padding-top: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-faint);
    font-size: 11px;
}
.card .go {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-2);
    opacity: 0;
    transform: translateX(-6px);
    transition: opacity 0.25s, transform 0.25s;
}
.card:hover .go { opacity: 1; transform: translateX(0); }

/* ============ NO RESULTS / SKELETON ============ */
.no-results {
    max-width: 1280px;
    margin: 60px auto;
    text-align: center;
    color: var(--text-faint);
    position: relative;
    z-index: 1;
}
.no-results .big { font-size: 1.6rem; margin-bottom: 12px; opacity: 0.5; }
.no-results h3 { color: var(--text-dim); font-size: 1rem; margin-bottom: 6px; font-weight: 600; }

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
    gap: 16px;
    max-width: 1280px;
    margin: 0 auto;
}
.skel {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--panel);
    overflow: hidden;
}
.skel .sk-img { aspect-ratio: 16/10; }
.skel .sk-line { height: 12px; margin: 14px 16px 0; border-radius: 4px; }
.skel .sk-line.short { width: 55%; margin-bottom: 16px; }
.skel .sk-img, .skel .sk-line {
    background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.04) 25%, rgba(var(--accent-rgb), 0.12) 50%, rgba(var(--accent-rgb), 0.04) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* stat-chip + indicatore online admin */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.75); }
}

/* ============ FOOTER ============ */
footer {
    max-width: 1280px;
    margin: 64px auto 0;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-faint);
    font-size: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}
footer a { color: var(--text-dim); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: color 0.15s; }
footer a:hover { color: var(--accent-2); }

/* ============ PAGINA DETTAGLIO ============ */
.detail-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 0 40px;
    position: relative;
    z-index: 1;
}

.back-nav {
    max-width: 1080px;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    text-decoration: none;
    font-size: 12.5px;
    padding: 8px 13px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s, background-color 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.2s;
}
.back-link:hover {
    color: var(--accent-3);
    border-color: var(--accent-border);
    background: var(--accent-soft);
    transform: translateX(-2px);
    box-shadow: 0 0 0 1px var(--accent-soft);
}

.app-header {
    display: flex;
    gap: 22px;
    align-items: flex-start;
    margin-bottom: 20px;
}
.app-icon {
    width: 112px;
    height: 112px;
    border-radius: var(--radius-lg);
    object-fit: cover;
    background: var(--bg-2);
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.app-icon:hover {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 30px rgba(0, 0, 0, 0.40);
}
.app-info { flex: 1; padding-top: 4px; min-width: 0; }
.app-info h1 {
    font-size: clamp(1.5rem, 3.5vw, 2.1rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 6px;
    word-break: break-word;
}
.app-info .version-line {
    color: var(--text-dim);
    font-size: 13px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.app-info .version-line .v {
    padding: 2px 9px;
    background: var(--bg-3);
    border: 1px solid var(--accent-border);
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent-3);
}

.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-sm);
    font-size: 11.5px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.badge.b-accent { color: var(--accent-3); border-color: var(--accent-border); background: var(--accent-soft); }
.badge.b-lime { color: var(--lime); border-color: rgba(74, 222, 128, 0.35); }

/* Info bar */
.info-bar {
    display: flex;
    gap: 10px 26px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    margin-bottom: 20px;
    font-size: 12.5px;
    color: var(--text-faint);
    flex-wrap: wrap;
    align-items: center;
}
.info-item { display: inline-flex; align-items: center; gap: 7px; }
.info-item strong { color: var(--text); font-weight: 600; }
.info-item .accent { color: var(--accent-3); font-weight: 600; }
.info-bar .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--accent-border); }

/* Layout 2 colonne */
.detail-body {
    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 20px;
    align-items: start;
}

.content-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.content-box:hover {
    border-color: rgba(59, 130, 246, 0.20);
}
.content-box h2 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.content-box h2::before {
    content: '';
    width: 2px;
    height: 14px;
    border-radius: 1px;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}
.content-box .rich {
    color: var(--text-dim);
    line-height: 1.7;
    font-size: 13px;
    word-break: break-word;
}
.content-box .rich b { color: var(--text); font-weight: 600; }
.content-box .rich + .rich { margin-top: 12px; }

/* Install steps */
.install-step {
    display: flex;
    gap: 12px;
    margin-bottom: 13px;
    font-size: 12.5px;
    color: var(--text-dim);
    align-items: flex-start;
    line-height: 1.55;
}
.install-step:last-child { margin-bottom: 0; }
.install-step .num {
    background: var(--accent-soft);
    color: var(--accent-3);
    width: 24px; height: 24px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
    border: 1px solid var(--accent-border);
}

/* Download box */
.download-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: sticky;
    top: 82px;
    transition: border-color 0.25s, box-shadow 0.25s;
}
.download-box:hover {
    border-color: var(--accent-border);
    box-shadow: 0 0 0 1px var(--accent-soft), 0 12px 32px rgba(0, 0, 0, 0.35);
}
.download-header {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}
.dl-icon {
    width: 40px; height: 40px;
    background: var(--accent-soft);
    border: 1px solid var(--accent-border);
    border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
    color: var(--accent-2);
    flex-shrink: 0;
}
.download-header h3 { font-size: 14px; font-weight: 600; }
.download-header .sub { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

.btn-download-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: var(--accent);
    color: #ffffff;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-weight: 600;
    font-size: 13.5px;
    border: 1px solid var(--accent);
    cursor: pointer;
    font-family: inherit;
    box-shadow: 0 8px 22px rgba(var(--accent-rgb), 0.30);
    transition: background-color 0.15s, border-color 0.15s, box-shadow 0.2s, transform 0.15s;
}
.btn-download-main:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    box-shadow: 0 10px 28px rgba(var(--accent-rgb), 0.45);
    transform: translateY(-1px);
}
.btn-download-main:disabled { opacity: 0.6; cursor: wait; }

.dl-meta {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12px;
}
.dl-meta .row {
    display: flex;
    justify-content: space-between;
    color: var(--text-faint);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.dl-meta .row:last-child { border-bottom: none; padding-bottom: 0; }
.dl-meta .row b { color: var(--text); font-weight: 600; }

/* ============ ANIMAZIONI PAGINA DETTAGLIO ============ */
@keyframes riseIn {
    from { opacity: 0; transform: translateY(22px) scale(0.99); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes iconIn {
    0% { opacity: 0; transform: scale(0.55) rotate(-8deg); }
    60% { opacity: 1; transform: scale(1.06) rotate(2deg); }
    100% { opacity: 1; transform: scale(1) rotate(0); }
}

#app-detail > * {
    opacity: 0;
    animation: riseIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
#app-detail > .back-nav { animation-delay: 0.05s; }
#app-detail > .app-header { animation-delay: 0.14s; }
#app-detail > .info-bar { animation-delay: 0.23s; }
#app-detail > .detail-body { animation-delay: 0.32s; }
#app-detail > *:last-child { animation-delay: 0.4s; }

.app-header.animated .app-icon {
    opacity: 0;
    animation: iconIn 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s forwards;
}
.app-header.animated .app-info h1,
.app-header.animated .app-info .version-line,
.app-header.animated .app-info .badges {
    opacity: 0;
    animation: riseIn 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.app-header.animated .app-info h1 { animation-delay: 0.42s; }
.app-header.animated .app-info .version-line { animation-delay: 0.5s; }
.app-header.animated .app-info .badges { animation-delay: 0.58s; }

/* ============ INGRESSO HOMEPAGE ============ */
@keyframes pageDrop {
    from { opacity: 0; transform: translateY(-14px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.home .topbar { animation: pageDrop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.home .hero { animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.07s both; }
.home .search-zone { animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.14s both; }
.home main { animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.21s both; }
.home footer { animation: pageEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.28s both; }

/* ============ INTRO ============ */
body.intro-active .brand-logo {
    visibility: hidden;
    animation: logoReveal 0.01s linear 4s forwards;
}
@keyframes logoReveal {
    from { visibility: hidden; }
    to { visibility: visible; }
}
body.intro-blur .topbar,
body.intro-blur .hero,
body.intro-blur .search-zone,
body.intro-blur main,
body.intro-blur footer,
body.intro-blur #particles-bg {
    filter: blur(30px);
}
body.intro-blur.intro-clear .topbar,
body.intro-blur.intro-clear .hero,
body.intro-blur.intro-clear .search-zone,
body.intro-blur.intro-clear main,
body.intro-blur.intro-clear footer,
body.intro-blur.intro-clear #particles-bg {
    filter: blur(0px);
}
.topbar, .hero, .search-zone, main, footer, #particles-bg {
    transition: filter 0.55s ease;
}
.intro {
    position: fixed;
    inset: 0;
    z-index: 6000;
    display: grid;
    place-items: center;
    pointer-events: none;
    transition: opacity 0.2s ease;
    animation: introSafe 0.4s ease 4s forwards;
}
.intro::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(59, 130, 246, 0.08), transparent 60%), rgba(9, 9, 11, 0.62);
    transition: opacity 0.55s ease;
}
.intro-leaving::before { opacity: 0; }
.intro-hide { opacity: 0; }
.intro-icon-wrap {
    position: relative;
    z-index: 1;
    animation: introPop 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.intro-icon {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 26px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 40px rgba(var(--accent-rgb), 0.25);
    will-change: transform;
}
@keyframes introPop {
    from { opacity: 0; transform: scale(0.7); }
    to { opacity: 1; transform: scale(1); }
}
@keyframes introSafe {
    to { opacity: 0; visibility: hidden; }
}

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
    .stat-chip .dot.pulse { animation: none; opacity: 1; }
    .skel .sk-img,
    .skel .sk-line { animation: none; }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .detail-body { grid-template-columns: 1fr; }
    .app-header { flex-direction: column; }
    .download-box { position: static; }
}

@media (max-width: 640px) {
    body { padding: 0 14px 70px; }
    .topbar { padding: 12px 0; margin-bottom: 26px; }
    .brand-text .tag { display: none; }
    .hero { margin-bottom: 24px; }
    .hero .sub { font-size: 13px; }
    .intro-icon { width: 92px; height: 92px; border-radius: 20px; }
    .grid { gap: 12px; }
    .app-icon { width: 92px; height: 92px; }
    .content-box { padding: 18px; }
    .stat-chip { padding: 6px 11px; font-size: 11.5px; }
}

@media (max-width: 400px) {
    .brand-text .name { font-size: 14px; }
    .btn { padding: 8px 12px; font-size: 11.5px; }
}

/* ============ TOAST ============ */
.toast-container {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: min(420px, 92vw);
    width: 100%;
    align-items: center;
}
.toast {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    padding: 10px 16px;
    min-width: 260px;
    max-width: 100%;
    display: flex;
    align-items: center;
    gap: 11px;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    font-size: 12.5px;
    color: var(--text);
    animation: toastIn 0.25s ease both;
}
.toast.fade-out { animation: toastOut 0.25s ease forwards !important; }
.toast .toast-icon {
    width: 26px; height: 26px;
    border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    font-size: 12px;
    flex-shrink: 0;
    font-weight: 600;
}
.toast.success .toast-icon { background: rgba(74, 222, 128, 0.12); color: var(--lime); border: 1px solid rgba(74, 222, 128, 0.35); }
.toast.error .toast-icon { background: rgba(248, 113, 113, 0.12); color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.35); }
.toast.info .toast-icon { background: var(--accent-soft); color: var(--accent-3); border: 1px solid var(--accent-border); }
.toast.success { border-color: rgba(74, 222, 128, 0.30); }
.toast.error { border-color: rgba(248, 113, 113, 0.30); }
.toast.info { border-color: var(--accent-border); }
.toast .toast-content { flex: 1; overflow: hidden; }
.toast .toast-title { font-weight: 600; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.toast .toast-message { font-size: 11.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

@keyframes toastIn {
    from { transform: translateY(-12px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
@keyframes toastOut {
    from { transform: translateY(0); opacity: 1; }
    to { transform: translateY(-12px); opacity: 0; }
}

/* ============ MODALI ============ */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 2000;
    animation: fadeIn 0.15s ease;
    padding: 20px;
}
.modal {
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 26px;
    max-width: 440px;
    width: 100%;
    box-shadow: var(--shadow-lg), 0 0 0 1px var(--accent-soft);
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}
.modal.wide { max-width: 680px; }
.modal h3 { margin-bottom: 16px; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 9px; }
.modal .modal-sub { color: var(--text-dim); font-size: 12.5px; margin: -12px 0 16px; line-height: 1.5; }
.modal .modal-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal .modal-actions .btn { flex: 1; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
    from { transform: translateY(8px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ============ FORM ============ */
.field { margin-bottom: 14px; }
.field label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 6px;
}
.field .hint { font-size: 11px; color: var(--text-faint); margin-top: 5px; line-height: 1.4; }
.input, select.input, textarea.input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder { color: var(--text-faint); }
textarea.input { resize: vertical; min-height: 90px; line-height: 1.55; }
select.input { cursor: pointer; }
select.input option { background: var(--bg-2); color: var(--text); }
input[type="file"] { display: none; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .row-2 { grid-template-columns: 1fr; } }

/* ============ TOGGLE TEMA ============ */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-dim);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.15s, color 0.15s, background-color 0.15s, box-shadow 0.18s;
}
.theme-toggle:hover {
    color: var(--accent-3);
    border-color: var(--accent-border);
    background: var(--accent-soft);
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px var(--accent-soft);
}
.theme-toggle svg { display: block; flex-shrink: 0; }
.theme-toggle .tt-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 8px var(--accent-glow);
    flex-shrink: 0;
}

/* ============ SCHEDE PAGINA APP ============ */
.detail-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.detail-tabs .chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    padding: 7px 13px;
}
.detail-tabs .chip::before {
    content: '';
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.5;
}
.detail-tabs .chip.active::before {
    background: var(--accent-3);
    opacity: 1;
    box-shadow: 0 0 8px var(--accent-glow);
}
.detail-tabs .chip .n {
    background: var(--bg-3);
    border-radius: 4px;
    padding: 0 6px;
    font-size: 10.5px;
}

.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fadeIn 0.25s ease; }

/* ============ REQUISITI DI SISTEMA ============ */
.req-list { display: flex; flex-direction: column; }
.req-row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 9px 2px;
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    line-height: 1.5;
}
.req-row:last-child { border-bottom: none; padding-bottom: 2px; }
.req-row .k {
    color: var(--text-faint);
    font-size: 11.5px;
    font-weight: 500;
    flex-shrink: 0;
    padding-top: 1px;
}
.req-row .v { color: var(--text-dim); text-align: right; word-break: break-word; }
.req-row .v b { color: var(--text); font-weight: 600; }

/* ============ SCREENSHOT ============ */
.shots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
    gap: 12px;
}
.shot {
    position: relative;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--bg-2);
    cursor: zoom-in;
    padding: 0;
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}
.shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.shot:hover {
    border-color: var(--accent-border);
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--accent-soft);
}
.shot-empty { color: var(--text-faint); font-size: 12.5px; text-align: center; padding: 24px 10px; }

.shot-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    cursor: zoom-out;
    animation: fadeIn 0.15s ease;
}
.shot-lightbox img {
    max-width: min(1100px, 100%);
    max-height: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--accent-border);
    box-shadow: 0 0 60px rgba(var(--accent-rgb), 0.20);
}

/* ============ MODS / DLC ============ */
.mods-list { display: flex; flex-direction: column; gap: 10px; }
.mod-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: transparent;
    transition: border-color 0.2s, transform 0.2s, background-color 0.2s;
}
.mod-card:hover {
    border-color: var(--accent-border);
    background: var(--accent-soft);
    transform: translateY(-2px);
}
.mod-card .mod-body { flex: 1; min-width: 0; }
.mod-card .mod-name { font-weight: 600; font-size: 13px; }
.mod-card .mod-tag {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--accent-border);
    background: var(--accent-soft);
    color: var(--accent-3);
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    vertical-align: middle;
}
.mod-card .mod-desc { color: var(--text-dim); font-size: 11.5px; line-height: 1.4; margin-top: 2px; }
.mod-card .mod-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 5px;
    color: var(--text-faint);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.mod-card .btn { flex-shrink: 0; }
.mods-empty { color: var(--text-faint); font-size: 12.5px; text-align: center; padding: 24px 10px; }
@media (max-width: 560px) {
    .mod-card { flex-wrap: wrap; }
    .mod-card .btn { width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   TEMA DARK (nero assoluto · griglia · bianco)
   ═══════════════════════════════════════════════════════════ */
html[data-theme="dark"] {
    --bg: #050505;
    --bg-2: #0a0a0a;
    --bg-3: #111111;
    --panel: #111111;
    --panel-solid: #111111;
    --surface: #111111;
    --surface-2: #151515;
    --border: rgba(255, 255, 255, 0.13);
    --border-strong: rgba(255, 255, 255, 0.42);
    --text: #ffffff;
    --text-dim: #a0a0a0;
    --text-faint: #888888;
    --accent: #ffffff;
    --accent-2: #d0d0d0;
    --accent-3: #ffffff;
    --accent-rgb: 255, 255, 255;
    --accent-soft: rgba(255, 255, 255, 0.08);
    --accent-hover: #d0d0d0;
    --lime: #d4d4d4;
    --danger: #ff6b6b;
    --amber: #d6d6d6;
    --radius: 10px;
    --radius-sm: 6px;
}

/* Sfondo dark: griglia + gradiente, canvas particelle nascosto */
html[data-theme="dark"] #particles-bg {
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(ellipse 70% 45% at 50% -8%, rgba(255, 255, 255, 0.06), transparent 60%),
        #050505;
    background-size: 56px 56px, 56px 56px, auto, auto;
}
html[data-theme="dark"] #particles-canvas { display: none; }

/* Topbar */
html[data-theme="dark"] .topbar {
    background: rgba(0, 0, 0, 0.82);
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 0 0 8px 8px;
    box-shadow: none;
}
html[data-theme="dark"] .topbar::after {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    opacity: 0.5;
}

/* Pulsanti outline con inversione in hover */
html[data-theme="dark"] .btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #ffffff;
    border-radius: 6px;
    box-shadow: none;
}
html[data-theme="dark"] .btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    box-shadow: none;
}
html[data-theme="dark"] .btn-sm { border-radius: 4px; }
html[data-theme="dark"] .btn-primary {
    background: #ffffff;
    border: 1px solid #ffffff;
    color: #000000;
    box-shadow: none;
}
html[data-theme="dark"] .btn-primary:hover {
    background: #050505;
    border-color: #ffffff;
    color: #ffffff;
    box-shadow: none;
}
html[data-theme="dark"] .btn-ghost,
html[data-theme="dark"] .btn-ghost:hover {
    background: transparent;
    border-color: transparent;
    color: #ffffff;
}
html[data-theme="dark"] .btn-ghost:hover { background: rgba(255, 255, 255, 0.08); }
html[data-theme="dark"] .btn-danger {
    background: transparent;
    border-color: rgba(255, 107, 107, 0.6);
    color: var(--danger);
}
html[data-theme="dark"] .btn-danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #000000;
}

/* Download principale */
html[data-theme="dark"] .btn-download-main {
    background: #ffffff;
    border: 1px solid #ffffff;
    color: #000000;
    border-radius: 6px;
    box-shadow: none;
}
html[data-theme="dark"] .btn-download-main:hover {
    background: #dcdcdc;
    border-color: #dcdcdc;
    box-shadow: none;
    transform: none;
}

/* Badge / chip / tag */
html[data-theme="dark"] .chip,
html[data-theme="dark"] .badge,
html[data-theme="dark"] .stat-chip {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    border-radius: 4px;
}
html[data-theme="dark"] .chip { font-size: 0.68rem; font-weight: 700; }
html[data-theme="dark"] .chip.active,
html[data-theme="dark"] .badge.b-accent {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
}
html[data-theme="dark"] .badge.b-lime {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}
html[data-theme="dark"] .theme-toggle {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.55);
    color: #ffffff;
    border-radius: 4px;
}
html[data-theme="dark"] .theme-toggle:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
}
html[data-theme="dark"] .theme-toggle .tt-dot {
    background: currentColor;
    box-shadow: none;
}

/* Card */
html[data-theme="dark"] .card {
    background: #111111;
    border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .card:hover {
    border-color: rgba(255, 255, 255, 0.75);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.22), 0 20px 45px rgba(0, 0, 0, 0.7);
}
html[data-theme="dark"] .card-image-container { background: #0a0a0a; }
html[data-theme="dark"] .card-image-container::after {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent 45%);
}
html[data-theme="dark"] .card-cat {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
}
html[data-theme="dark"] .card:hover h3 { color: #ffffff; }
html[data-theme="dark"] .card .go { color: #ffffff; }

/* Hero */
html[data-theme="dark"] .hero h1 .grad {
    background: linear-gradient(120deg, #ffffff 0%, #9b9b9b 55%, #ffffff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Search bar */
html[data-theme="dark"] .search-box {
    background: #0b0b0b;
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: none;
}
html[data-theme="dark"] .search-box:hover { border-color: rgba(255, 255, 255, 0.4); }
html[data-theme="dark"] .search-box:focus-within {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px #ffffff;
    background: #0b0b0b;
}
html[data-theme="dark"] .search-box input { color: #ffffff; }
html[data-theme="dark"] .search-box input::placeholder { color: #7d7d7d; }
html[data-theme="dark"] .search-icon { color: #8a8a8a; }
html[data-theme="dark"] .search-box:focus-within .search-icon { color: #ffffff; }
html[data-theme="dark"] .clear-search {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.25);
    color: #cfcfcf;
}
html[data-theme="dark"] .clear-search:hover {
    background: rgba(255, 107, 107, 0.15);
    border-color: rgba(255, 107, 107, 0.6);
    color: var(--danger);
}

/* Input */
html[data-theme="dark"] .input,
html[data-theme="dark"] select.input,
html[data-theme="dark"] textarea.input {
    background: #0a0a0a;
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
    border-radius: 6px;
}
html[data-theme="dark"] .input:focus {
    border-color: #ffffff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.65);
}
html[data-theme="dark"] .input::placeholder { color: #6f6f6f; }
html[data-theme="dark"] select.input option { background: #111111; color: #ffffff; }

/* Pannelli e contenitori */
html[data-theme="dark"] .content-box,
html[data-theme="dark"] .info-bar,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .back-link,
html[data-theme="dark"] .mod-card,
html[data-theme="dark"] .mgr-row,
html[data-theme="dark"] .shot,
html[data-theme="dark"] .login-card {
    background: #111111;
    border-color: rgba(255, 255, 255, 0.14);
}
html[data-theme="dark"] .content-box:hover { border-color: rgba(255, 255, 255, 0.2); }
html[data-theme="dark"] .back-link:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
    transform: none;
    box-shadow: none;
}
html[data-theme="dark"] .download-box {
    background: #0d0d0d;
    border-color: rgba(255, 255, 255, 0.35);
}
html[data-theme="dark"] .download-box:hover { border-color: rgba(255, 255, 255, 0.7); box-shadow: none; }
html[data-theme="dark"] .dl-icon {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}
html[data-theme="dark"] .mod-card { background: #111111; }
html[data-theme="dark"] .mod-card:hover { border-color: #ffffff; transform: none; background: #111111; }
html[data-theme="dark"] .mod-card .mod-tag {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
}
html[data-theme="dark"] .mod-card .mod-ico {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.45);
}
html[data-theme="dark"] .info-bar .dotsep { background: #3a3a3a; }
html[data-theme="dark"] .info-item .accent { color: #ffffff; }
html[data-theme="dark"] .app-icon {
    background: #0a0a0a;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}
html[data-theme="dark"] .app-icon:hover { box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7); border-color: rgba(255, 255, 255, 0.4); }
html[data-theme="dark"] .shot:hover { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5); transform: none; }
html[data-theme="dark"] .app-info .version-line .v {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.35);
    color: #ffffff;
}

/* Scrollbar */
html[data-theme="dark"] ::-webkit-scrollbar-thumb { background: #3a3a3a; border-color: #050505; }
html[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: #6a6a6a; }

/* Modal e toast */
html[data-theme="dark"] .modal-overlay { background: rgba(0, 0, 0, 0.82); }
html[data-theme="dark"] .modal {
    background: #111111;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.85);
}
html[data-theme="dark"] .toast {
    background: #111111;
    border-color: rgba(255, 255, 255, 0.35);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.8);
}
html[data-theme="dark"] .toast.info { border-color: rgba(255, 255, 255, 0.35); }
html[data-theme="dark"] .toast.info .toast-icon { background: rgba(255, 255, 255, 0.08); color: #ffffff; border-color: rgba(255, 255, 255, 0.35); }

/* Admin */
html[data-theme="dark"] .icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.25);
    color: #cfcfcf;
}
html[data-theme="dark"] .icon-btn:hover {
    background: #ffffff;
    border-color: #ffffff;
    color: #000000;
}
html[data-theme="dark"] .icon-btn.danger:hover {
    background: var(--danger);
    border-color: var(--danger);
    color: #000000;
}
html[data-theme="dark"] .tab:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
html[data-theme="dark"] .code-block {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}
html[data-theme="dark"] .drop-zone { border-color: rgba(255, 255, 255, 0.35); }
html[data-theme="dark"] .drop-zone:hover,
html[data-theme="dark"] .drop-zone.drag {
    border-color: #ffffff;
    background: rgba(255, 255, 255, 0.06);
    color: #ffffff;
}
html[data-theme="dark"] .top-row .rank {
    background: #000000;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
}
html[data-theme="dark"] .install-step .num {
    background: #000000;
    border-color: rgba(255, 255, 255, 0.4);
    color: #ffffff;
}
html[data-theme="dark"] .detail-tabs .chip .n { background: rgba(255, 255, 255, 0.1); }
html[data-theme="dark"] .search-info strong { color: #ffffff; }
html[data-theme="dark"] .no-results h3 { color: #ffffff; }
html[data-theme="dark"] ::selection { background: rgba(255, 255, 255, 0.20); color: #ffffff; }
html[data-theme="dark"] .intro::before {
    background: rgba(0, 0, 0, 0.7);
}
html[data-theme="dark"] .intro-icon {
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
}

/* ============ RESPONSIVE — TABLET / MOBILE ============ */
@media (max-width: 720px) {
    .topbar { padding: 12px 0; margin-bottom: 22px; gap: 10px; }
    .topbar-actions { gap: 6px; }
    .hero-stats { gap: 7px; }
    .stat-chip { padding: 6px 11px; font-size: 11.5px; }
    .search-box input { font-size: 13.5px; padding: 11px 10px; }
    .filters { gap: 6px; }
    .chip { padding: 6px 11px; font-size: 11.5px; }
    .grid { gap: 12px; }
    .info-bar { padding: 12px 15px; gap: 10px 16px; }
    .back-nav { margin-bottom: 16px; }
    .app-header { gap: 16px; margin-bottom: 18px; }
    .detail-tabs { gap: 6px; margin-bottom: 16px; }
    .detail-tabs .chip { padding: 6px 11px; font-size: 11.5px; }
    .shots-grid { gap: 10px; }
    .mods-list { gap: 8px; }
    .install-step { gap: 10px; font-size: 12px; }
    footer { margin-top: 44px; padding-top: 16px; }
    .modal { padding: 22px 18px; }
    .modal-overlay { padding: 14px; }
}

@media (max-width: 480px) {
    body { padding: 0 12px 60px; }
    .brand { gap: 8px; }
    .brand-logo { width: 30px; height: 30px; }
    .brand-logo img { border-radius: inherit; }
    .brand-text .name { font-size: 14px; }
    .brand-text .tag { display: none; }
    .theme-toggle { padding: 6px 10px; font-size: 11px; gap: 6px; }
    .btn { padding: 7px 11px; font-size: 11.5px; }
    .btn-sm { padding: 5px 9px; font-size: 10.5px; }
    .hero { margin-bottom: 20px; }
    .hero h1 { font-size: clamp(1.6rem, 9vw, 2.1rem); }
    .hero .sub { font-size: 12.5px; }
    .hero-stats { margin-top: 16px; gap: 6px; }
    .stat-chip { padding: 5px 10px; font-size: 10.5px; gap: 6px; }
    .search-zone { margin-bottom: 20px; }
    .search-box input { font-size: 13px; padding: 10px 8px; }
    .chip { padding: 6px 10px; font-size: 11px; }
    .grid, .skeleton-grid { gap: 10px; }
    .card-content { padding: 11px 12px 12px; }
    .card h3 { font-size: 12.5px; }
    .card .description { font-size: 11px; }
    .card .meta { font-size: 10px; }
    .card .card-foot { font-size: 9.5px; }
    .app-header { gap: 14px; }
    .app-icon { width: 80px; height: 80px; }
    .app-info { padding-top: 0; }
    .app-info h1 { font-size: clamp(1.35rem, 7vw, 1.8rem); margin-bottom: 4px; }
    .app-info .version-line { font-size: 12px; margin-bottom: 10px; }
    .badges { gap: 6px; }
    .badge { padding: 5px 10px; font-size: 10.5px; }
    .info-bar { padding: 12px 14px; font-size: 11.5px; }
    .detail-tabs .chip { padding: 6px 10px; font-size: 11px; gap: 6px; }
    .content-box { padding: 16px 14px; }
    .content-box h2 { font-size: 12.5px; margin-bottom: 12px; }
    .req-row { font-size: 11.5px; gap: 12px; padding: 9px 2px; }
    .req-row .k { font-size: 11px; }
    .download-box { padding: 16px; }
    .download-header { gap: 10px; margin-bottom: 13px; }
    .dl-icon { width: 36px; height: 36px; }
    .btn-download-main { padding: 12px 16px; font-size: 12.5px; }
    .dl-meta { gap: 7px; font-size: 11.5px; }
    .mod-card { padding: 10px 11px; gap: 10px; }
    .mod-card .mod-name { font-size: 12px; }
    .mod-card .mod-desc { font-size: 10.5px; }
    .mod-card .btn { width: 100%; }
    .shot-lightbox { padding: 12px; }
    .back-link { padding: 8px 12px; font-size: 11.5px; }
    .login-card { padding: 26px 20px; }
    .modal { padding: 18px 16px; }
    .modal h3 { font-size: 14px; }
    .modal .modal-actions { flex-wrap: wrap; }
    .row-2 { grid-template-columns: 1fr; }
    .req-grid { grid-template-columns: 1fr; }
    .mod-grid { grid-template-columns: 1fr; }
    .mgr-row { flex-wrap: wrap; }
    .mgr-row .input { flex: 1 1 140px; }
    .toast { min-width: 0; padding: 10px 14px; }
    footer { font-size: 11px; gap: 8px; margin-top: 34px; }
}

@media (max-width: 360px) {
    .theme-toggle .tt-label { display: none; }
    .stat-chip span { font-size: 10.5px; }
    .hero-stats { flex-direction: column; align-items: center; }
}

html[data-theme="dark"] .detail-tabs .chip::before {
    background: currentColor;
    opacity: 0.35;
    box-shadow: none;
}
html[data-theme="dark"] .detail-tabs .chip.active::before {
    background: currentColor;
    opacity: 1;
    box-shadow: none;
}