  :root {
    --neon-pink: #ff2d78;
    --neon-cyan: #00f5ff;
    --neon-yellow: #ffe600;
    --neon-green: #39ff14;
    --neon-orange: #ff6b00;
    --bg-deep: #040408;
    --bg-card: #0a0a14;
    --bg-card2: #0d0d1a;
    --grid-line: rgba(0,245,255,0.06);
    --gold: #ffd700;
    --silver: #c0c0c0;
    --bronze: #cd7f32;
  }

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

  body {
    background: var(--bg-deep);
    color: #e0e0ff;
    font-family: 'Share Tech Mono', monospace;
    overflow-x: hidden;
    cursor: crosshair;
  }

  /* Scanlines overlay */
  body::before {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.15) 2px,
      rgba(0,0,0,0.15) 4px
    );
    pointer-events: none;
    z-index: 9999;
  }

  /* CRT vignette */
  body::after {
    content: '';
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.7) 100%);
    pointer-events: none;
    z-index: 9998;
  }

  /* Grid background */
  .grid-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
      linear-gradient(var(--grid-line) 1px, transparent 1px),
      linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: 0;
    perspective: 600px;
    transform-style: preserve-3d;
  }

  /* Header */
  header {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 60px 20px 40px;
    border-bottom: 1px solid rgba(0,245,255,0.2);
  }

  .header-subtitle {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--neon-cyan);
    letter-spacing: 0.4em;
    text-transform: uppercase;
    margin-bottom: 16px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards 0.2s;
  }

  .header-title {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(1.8rem, 5vw, 3.5rem);
    line-height: 1.3;
    color: #fff;
    text-shadow:
      0 0 20px var(--neon-cyan),
      0 0 40px var(--neon-cyan),
      0 0 80px rgba(0,245,255,0.4);
    opacity: 0;
    animation: fadeUp 0.6s ease forwards 0.4s;
  }

  .header-title span {
    color: var(--neon-pink);
    text-shadow:
      0 0 20px var(--neon-pink),
      0 0 40px var(--neon-pink),
      0 0 80px rgba(255,45,120,0.4);
  }

  .header-era {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--neon-yellow);
    margin-top: 18px;
    text-shadow: 0 0 10px var(--neon-yellow);
    opacity: 0;
    animation: fadeUp 0.6s ease forwards 0.6s;
  }

  .header-meta {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 30px;
    opacity: 0;
    animation: fadeUp 0.6s ease forwards 0.8s;
  }

  .meta-item {
    text-align: center;
  }

  .meta-num {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--neon-cyan);
    text-shadow: 0 0 15px var(--neon-cyan);
  }

  .meta-label {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.4);
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }

  /* Genre filter bar */
  .filter-bar {
    position: relative;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    padding: 30px 20px;
    border-bottom: 1px solid rgba(0,245,255,0.1);
  }

  .filter-btn {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    padding: 6px 14px;
    border: 1px solid rgba(0,245,255,0.3);
    background: transparent;
    color: rgba(0,245,255,0.6);
    cursor: pointer;
    transition: all 0.2s;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
  }

  .filter-btn:hover, .filter-btn.active {
    background: rgba(0,245,255,0.1);
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0,245,255,0.3), inset 0 0 12px rgba(0,245,255,0.05);
  }

  .filter-btn.active {
    background: rgba(0,245,255,0.15);
  }

  /* Section headers */
  .section-header {
    position: relative;
    z-index: 10;
    padding: 40px 40px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
  }

  .section-label {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.7rem;
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
    white-space: nowrap;
  }

  .section-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--neon-pink), transparent);
    opacity: 0.4;
  }

  /* Main grid */
  .games-grid {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2px;
    padding: 0 20px 20px;
    max-width: 1600px;
    margin: 0 auto;
  }

  /* TOP 3 special layout */
  .top3-grid {
    position: relative;
    z-index: 10;
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: auto auto;
    gap: 2px;
    padding: 0 20px 2px;
    max-width: 1600px;
    margin: 0 auto;
  }

  /* Game card */
  .game-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(0,245,255,0.08);
    padding: 16px 16px 14px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    opacity: 0;
    animation: cardReveal 0.4s ease forwards;
  }

  .game-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent-color, var(--neon-cyan)), transparent);
    opacity: 0;
    transition: opacity 0.3s;
  }

  .game-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at top left, var(--accent-color, var(--neon-cyan)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
  }

  .game-card:hover {
    border-color: var(--accent-color, var(--neon-cyan));
    box-shadow: 0 0 20px rgba(0,245,255,0.1), inset 0 0 20px rgba(0,245,255,0.03);
    transform: translateY(-2px);
    z-index: 1;
  }

  .game-card:hover::before { opacity: 1; }
  .game-card:hover::after { opacity: 0.04; }

  /* TOP 3 cards */
  .card-top1 {
    --accent-color: var(--gold);
    background: linear-gradient(135deg, #0d0d00, #1a1500, #0d0d00);
    border-color: rgba(255,215,0,0.3);
    padding: 30px 24px 24px;
    grid-row: 1 / 3;
    grid-column: 1;
  }
  .card-top1:hover {
    box-shadow: 0 0 40px rgba(255,215,0,0.2), inset 0 0 30px rgba(255,215,0,0.05);
    border-color: var(--gold);
  }

  .card-top2 {
    --accent-color: var(--silver);
    background: linear-gradient(135deg, #0a0a0d, #111118, #0a0a0d);
    border-color: rgba(192,192,192,0.2);
    padding: 24px 20px 20px;
    grid-row: 1;
    grid-column: 2;
  }

  .card-top3 {
    --accent-color: var(--bronze);
    background: linear-gradient(135deg, #0d0900, #150e00, #0d0900);
    border-color: rgba(205,127,50,0.2);
    padding: 20px;
    grid-row: 2;
    grid-column: 2;
  }

  /* Rank number */
  .rank {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    color: rgba(255,255,255,0.12);
    position: absolute;
    top: 10px;
    right: 14px;
    font-size: 2.2rem;
    line-height: 1;
    letter-spacing: -0.02em;
    transition: color 0.3s;
    z-index: 1;
  }

  .game-card:hover .rank {
    color: rgba(255,255,255,0.06);
  }

  .card-top1 .rank {
    font-size: 4rem;
    color: rgba(255,215,0,0.15);
  }
  .card-top2 .rank {
    font-size: 3rem;
    color: rgba(192,192,192,0.12);
  }
  .card-top3 .rank {
    font-size: 2.5rem;
    color: rgba(205,127,50,0.12);
  }

  /* Medal */
  .medal {
    font-size: 1.4rem;
    margin-bottom: 6px;
    display: block;
  }

  .card-top1 .medal { font-size: 2rem; }
  .card-top2 .medal { font-size: 1.6rem; }
  .card-top3 .medal { font-size: 1.5rem; }

  /* Game title */
  .game-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    color: #fff;
    margin-bottom: 8px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
  }

  .card-top1 .game-title { font-size: 1.3rem; margin-bottom: 12px; }
  .card-top2 .game-title { font-size: 1rem; }
  .card-top3 .game-title { font-size: 0.9rem; }

  /* Game info row */
  .game-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
  }

  .game-year {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    color: var(--neon-cyan);
    opacity: 0.8;
  }

  .game-producer {
    font-size: 0.65rem;
    color: rgba(255,255,255,0.35);
    font-family: 'Share Tech Mono', monospace;
  }

  .game-genre {
    font-size: 0.6rem;
    padding: 2px 8px;
    border: 1px solid;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Share Tech Mono', monospace;
    clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%);
  }

  /* Genre colors */
  .genre-shoot    { border-color: rgba(57,255,20,0.4);  color: var(--neon-green);  }
  .genre-fighting { border-color: rgba(255,45,120,0.4); color: var(--neon-pink);   }
  .genre-platform { border-color: rgba(255,230,0,0.4);  color: var(--neon-yellow); }
  .genre-racing   { border-color: rgba(255,107,0,0.4);  color: var(--neon-orange); }
  .genre-beat     { border-color: rgba(0,245,255,0.4);  color: var(--neon-cyan);   }
  .genre-puzzle   { border-color: rgba(180,0,255,0.4);  color: #b400ff;            }
  .genre-sports   { border-color: rgba(255,107,0,0.4);  color: var(--neon-orange); }
  .genre-maze     { border-color: rgba(255,215,0,0.4);  color: var(--gold);        }
  .genre-action   { border-color: rgba(0,245,255,0.4);  color: var(--neon-cyan);   }
  .genre-other    { border-color: rgba(255,255,255,0.2); color: rgba(255,255,255,0.5); }

  /* Score bar */
  .score-bar {
    margin-top: 10px;
    height: 2px;
    background: rgba(255,255,255,0.05);
    position: relative;
    z-index: 1;
    overflow: hidden;
  }

  .score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color, var(--neon-cyan)), transparent);
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
  }

  /* Pixel dot decoration */
  .pixel-dots {
    position: absolute;
    bottom: 8px;
    right: 10px;
    display: flex;
    gap: 3px;
    z-index: 1;
    opacity: 0.3;
  }

  .pixel-dot {
    width: 4px;
    height: 4px;
    background: var(--accent-color, var(--neon-cyan));
  }

  /* Legend */
  .legend {
    position: relative;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    padding: 30px 20px;
    border-top: 1px solid rgba(0,245,255,0.1);
    margin-top: 20px;
  }

  .legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.65rem;
    color: rgba(255,255,255,0.5);
  }

  .legend-dot {
    width: 8px;
    height: 8px;
    clip-path: polygon(2px 0, 100% 0, calc(100% - 2px) 100%, 0 100%);
  }

  /* Footer */
  footer {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 30px;
    border-top: 1px solid rgba(0,245,255,0.08);
    font-size: 0.6rem;
    color: rgba(255,255,255,0.2);
    letter-spacing: 0.2em;
    text-transform: uppercase;
  }

  footer span {
    color: var(--neon-pink);
  }

  /* Blinking cursor effect */
  .blink {
    animation: blink 1s step-end infinite;
  }

  /* Animations */
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes cardReveal {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  @keyframes blink {
    50% { opacity: 0; }
  }

  @keyframes flicker {
    0%, 95%, 100% { opacity: 1; }
    96% { opacity: 0.8; }
    97% { opacity: 1; }
    98% { opacity: 0.6; }
    99% { opacity: 1; }
  }

  @keyframes scanMove {
    from { transform: translateY(-100%); }
    to   { transform: translateY(100vh); }
  }

  /* Moving scan line */
  .scan-line {
    position: fixed;
    left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(0,245,255,0.15), transparent);
    animation: scanMove 8s linear infinite;
    pointer-events: none;
    z-index: 9997;
  }

  /* Responsive — vedi blocco in fondo al file */

  /* Hidden class for filtering */
  .game-card.hidden {
    display: none;
  }

  /* Mute button */
  #mute-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    padding: 8px 16px;
    border: 1px solid rgba(0,245,255,0.3);
    background: rgba(4,4,8,0.9);
    color: rgba(0,245,255,0.6);
    cursor: pointer;
    clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%);
    transition: all 0.2s;
    backdrop-filter: blur(4px);
  }
  #mute-btn:hover {
    background: rgba(0,245,255,0.08);
    color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0,245,255,0.2);
  }


  /* ── MODAL STORIA ─────────────────────────────────── */
  .modal-bg {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50000;
    background: rgba(0,0,0,0.93);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
    padding: 16px;
    cursor: pointer;
  }
  .modal-bg.open { display: flex; }

  .modal-panel {
    position: relative;
    background: #05050e;
    border: 1px solid rgba(0,245,255,0.2);
    max-width: 720px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    cursor: default;
    animation: mIn .22s cubic-bezier(.4,0,.2,1) forwards;
    scrollbar-width: thin;
    scrollbar-color: var(--mc, var(--neon-cyan)) transparent;
  }
  .modal-panel::-webkit-scrollbar { width: 3px; }
  .modal-panel::-webkit-scrollbar-thumb { background: var(--mc, var(--neon-cyan)); }

  @keyframes mIn {
    from { opacity:0; transform:scale(.93) translateY(14px); }
    to   { opacity:1; transform:scale(1)   translateY(0); }
  }

  .modal-bar { height: 3px; }

  .modal-inner { padding: 24px 28px 28px; }

  .modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
  }
  .modal-badge {
    font-family: 'Orbitron', sans-serif;
    font-size: .6rem;
    font-weight: 700;
    letter-spacing: .2em;
    padding: 3px 10px;
    border: 1px solid;
    clip-path: polygon(5px 0,100% 0,calc(100% - 5px) 100%,0 100%);
  }
  .modal-name {
    font-family: 'Press Start 2P', monospace;
    font-size: clamp(.75rem,2vw,1.1rem);
    color: #fff;
    line-height: 1.4;
    margin-top: 8px;
  }
  .modal-close {
    font-family: 'Share Tech Mono', monospace;
    font-size: .65rem;
    color: rgba(255,255,255,.3);
    background: none;
    border: 1px solid rgba(255,255,255,.1);
    padding: 4px 10px;
    cursor: pointer;
    flex-shrink: 0;
    letter-spacing: .1em;
    transition: all .2s;
  }
  .modal-close:hover { color: var(--neon-pink); border-color: var(--neon-pink); }

  .modal-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    margin-bottom: 18px;
  }
  .mstat { display: flex; flex-direction: column; gap: 2px; }
  .mstat-l { font-size: .52rem; letter-spacing: .22em; text-transform: uppercase; color: rgba(255,255,255,.3); font-family:'Share Tech Mono',monospace; }
  .mstat-v { font-family: 'Orbitron',sans-serif; font-weight: 700; font-size: .75rem; }

  .modal-sec {
    font-family: 'Share Tech Mono', monospace;
    font-size: .58rem;
    letter-spacing: .28em;
    text-transform: uppercase;
    margin-bottom: 9px;
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .modal-sec::after { content:''; flex:1; height:1px; background: currentColor; opacity:.18; }

  .modal-history {
    font-family: 'Share Tech Mono', monospace;
    font-size: .7rem;
    line-height: 1.85;
    color: rgba(255,255,255,.58);
    margin-bottom: 20px;
  }
  .modal-history p { margin-bottom: 10px; }

  .modal-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
  }
  .mfact {
    background: rgba(255,255,255,.025);
    border: 1px solid rgba(255,255,255,.06);
    border-left: 2px solid;
    padding: 9px 11px;
    font-family: 'Share Tech Mono', monospace;
    font-size: .63rem;
    line-height: 1.55;
    color: rgba(255,255,255,.48);
  }
  .mfact strong { display: block; color: rgba(255,255,255,.82); font-size: .6rem; letter-spacing: .08em; margin-bottom: 2px; }

  .modal-footer { font-family:'Press Start 2P',monospace; font-size:.38rem; color:rgba(255,255,255,.07); text-align:right; margin-top:12px; }

  /* modal responsive — vedi blocco in fondo */


  /* ── SEARCH BAR ─────────────────────────────────── */
  .search-wrap {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 0 20px 28px;
  }
  .search-box {
    position: relative;
    width: 100%;
    max-width: 540px;
  }
  .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.75rem;
    color: rgba(0,245,255,0.4);
    pointer-events: none;
  }
  .search-input {
    width: 100%;
    background: rgba(0,245,255,0.04);
    border: 1px solid rgba(0,245,255,0.2);
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    padding: 10px 44px 10px 36px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  }
  .search-input::placeholder {
    color: rgba(0,245,255,0.25);
    letter-spacing: 0.15em;
  }
  .search-input:focus {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 16px rgba(0,245,255,0.12);
  }
  .search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.25);
    font-size: 0.75rem;
    cursor: pointer;
    display: none;
    font-family: 'Share Tech Mono', monospace;
    transition: color .2s;
    padding: 4px;
  }
  .search-clear:hover { color: var(--neon-pink); }
  .search-clear.visible { display: block; }

  .search-count {
    text-align: center;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.6rem;
    color: rgba(0,245,255,0.4);
    letter-spacing: 0.2em;
    margin-top: -18px;
    margin-bottom: 10px;
    min-height: 1em;
  }

  /* ── FILTRI AVANZATI ─────────────────────────────── */
  .adv-filters {
    position: relative;
    z-index: 10;
    padding: 0 20px 12px;
    max-width: 1600px;
    margin: 0 auto;
  }
  .adv-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 16px;
    justify-content: center;
  }
  .adv-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  .adv-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.48rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.3);
  }
  .adv-pills {
    display: flex;
    gap: 3px;
  }
  .adv-pill {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.58rem;
    letter-spacing: 0.08em;
    padding: 5px 10px;
    border: 1px solid rgba(0,245,255,0.2);
    background: transparent;
    color: rgba(0,245,255,0.5);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
  }
  .adv-pill:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0,245,255,0.06);
  }
  .adv-pill.active {
    background: rgba(0,245,255,0.12);
    color: var(--neon-cyan);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 8px rgba(0,245,255,0.15);
  }
  .adv-select {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    padding: 5px 24px 5px 8px;
    border: 1px solid rgba(0,245,255,0.2);
    background: rgba(0,0,0,0.6);
    color: rgba(0,245,255,0.7);
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%2300f5ff' opacity='0.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    min-width: 120px;
  }
  .adv-select:hover, .adv-select:focus {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
  }
  .adv-select option {
    background: #0a0a14;
    color: #e0e0ff;
  }
  .adv-reset {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.55rem;
    letter-spacing: 0.1em;
    padding: 5px 12px;
    border: 1px solid rgba(255,45,120,0.3);
    background: transparent;
    color: rgba(255,45,120,0.5);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    display: none; /* Visibile solo quando ci sono filtri attivi */
  }
  .adv-reset:hover {
    background: rgba(255,45,120,0.1);
    color: var(--neon-pink);
    border-color: var(--neon-pink);
  }
  .adv-reset.visible { display: inline-block; }

  /* Filtri avanzati mobile */
  @media (max-width: 600px) {
    .adv-filters { padding: 0 10px 10px; }
    .adv-row { gap: 8px; justify-content: flex-start; }
    .adv-pills {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
      padding-bottom: 2px;
    }
    .adv-pills::-webkit-scrollbar { display: none; }
    .adv-pill { padding: 6px 10px; font-size: 0.55rem; flex-shrink: 0; }
    .adv-select { font-size: 16px !important; min-width: 100px; padding: 6px 24px 6px 8px; }
    .adv-group { flex: 1; min-width: 0; }
    .adv-reset { font-size: 0.5rem; padding: 6px 10px; }
  }

  /* Card non trovata: hide */
  .game-card.no-match { display: none; }

  /* Section header nascosto se vuoto */
  .section-header.all-hidden { display: none; }


  .g-icon {
    font-size: 0.85em;
    margin-right: 6px;
    filter: drop-shadow(0 0 4px currentColor);
    vertical-align: middle;
  }
  .card-top1 .g-icon { font-size: 1em; }
  .card-top2 .g-icon { font-size: 0.9em; }
  .card-top3 .g-icon { font-size: 0.9em; }


  .game-title { display: flex; align-items: center; flex-wrap: nowrap; }


  .header-subtitle {
    transition: color 0.15s, text-shadow 0.15s;
  }
  .header-subtitle:hover {
    color: var(--neon-yellow) !important;
    text-shadow: 0 0 12px var(--neon-yellow);
  }
  .header-subtitle:active {
    transform: scale(0.97);
  }


  .g-icon-img {
    width: 20px; height: 20px;
    object-fit: contain;
    vertical-align: middle;
    margin-right: 6px;
    image-rendering: pixelated;
    flex-shrink: 0;
  }
  .card-top1 .g-icon-img { width: 26px; height: 26px; }
  .card-top2 .g-icon-img, .card-top3 .g-icon-img { width: 22px; height: 22px; }


  #msnap img {
    display: block;
    max-width: 100%;
    max-height: 320px;
    width: auto;
    height: auto;
    margin: 0 auto;
    image-rendering: pixelated;
    border-radius: 4px;
    object-fit: contain;
  }





  .mod-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--mc, var(--neon-cyan));
    color: var(--mc, var(--neon-cyan));
    font-size: 2.5rem;
    line-height: 1;
    width: 40px;
    height: 70px;
    cursor: pointer;
    z-index: 10;
    border-radius: 4px;
    transition: background 0.15s, color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .mod-nav:hover {
    background: var(--mc, var(--neon-cyan));
    color: #000;
  }
  .mod-prev { left: calc(50% - 380px); }
  .mod-next { right: calc(50% - 380px); }
  /* mod-nav responsive — vedi blocco in fondo */


  .vote-btn { position:absolute; bottom:28px; right:6px; background:rgba(0,0,0,0.7); border:1px solid var(--accent-color,var(--neon-cyan)); color:var(--accent-color,var(--neon-cyan)); border-radius:4px; padding:2px 6px; font-size:10px; cursor:pointer; font-family:'Share Tech Mono',monospace; transition:all 0.2s; z-index:2; }
  .vote-btn:hover { background:var(--accent-color,var(--neon-cyan)); color:#000; }
  .vote-btn.voted { border-color:gold; color:gold; }
  .vote-bar { position:absolute; bottom:0; left:0; height:2px; background:gold; transition:width 0.5s; z-index:1; }
  #vote-hud { position:fixed; bottom:70px; right:16px; background:rgba(0,0,0,0.85); border:1px solid gold; color:gold; font-family:'Press Start 2P',monospace; font-size:9px; padding:8px 12px; border-radius:4px; z-index:999; line-height:1.8; }
  #vote-hud span { color:#fff; }
  #vote-banner { background:rgba(255,215,0,0.08); border-top:1px solid rgba(255,215,0,0.3); border-bottom:1px solid rgba(255,215,0,0.3); color:#ccc; font-family:'Share Tech Mono',monospace; font-size:0.78rem; text-align:center; padding:8px 1rem; }
  #vote-banner strong { color:gold; }
  #btn-ranking-header { background:transparent; border:1px solid gold; color:gold; font-family:'Press Start 2P',monospace; font-size:0.55rem; padding:6px 10px; cursor:pointer; border-radius:4px; margin-left:10px; transition:all 0.2s; }
  #btn-ranking:hover { background:gold; color:#000; }
  .modal-vote-btn { margin-top:12px; padding:8px 20px; background:transparent; border:1px solid gold; color:gold; font-family:'Press Start 2P',monospace; font-size:9px; cursor:pointer; border-radius:4px; transition:all 0.2s; width:100%; }
  .modal-vote-btn:hover { background:gold; color:#000; }
  .modal-vote-btn.voted { border-color:#888; color:#888; cursor:default; }
  #rank-modal { display:none; position:fixed; inset:0; background:rgba(0,0,0,0.85); z-index:1000; overflow-y:auto; padding:2rem 1rem; }
  #rank-modal.open { display:block; }
  #rank-panel { max-width:600px; margin:0 auto; background:#05050e; border:1px solid gold; border-radius:6px; padding:1.5rem; position:relative; }
  #rank-panel h2 { font-family:'Press Start 2P',monospace; color:gold; font-size:0.9rem; text-align:center; margin:0 0 1.5rem; text-shadow:0 0 12px gold; }
  .rank-entry { display:flex; align-items:center; gap:12px; padding:10px 0; border-bottom:1px solid rgba(255,215,0,0.15); cursor:pointer; transition:background 0.15s; }
  .rank-entry:hover { background:rgba(255,215,0,0.05); border-radius:4px; }
  .rank-pos { font-family:'Press Start 2P',monospace; font-size:0.7rem; color:gold; width:28px; text-align:center; flex-shrink:0; }
  .rank-pos.gold { color:gold; text-shadow:0 0 8px gold; }
  .rank-pos.silver { color:#ccc; } .rank-pos.bronze { color:#cd7f32; }
  .rank-icon { width:32px; height:32px; flex-shrink:0; }
  .rank-info { flex:1; min-width:0; }
  .rank-title { font-family:'Press Start 2P',monospace; font-size:0.6rem; color:#fff; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .rank-bar-wrap { background:rgba(255,255,255,0.1); border-radius:2px; height:4px; margin-top:6px; }
  .rank-bar-fill { height:4px; background:gold; border-radius:2px; transition:width 0.6s; }
  .rank-votes { font-family:'Share Tech Mono',monospace; font-size:0.75rem; color:gold; flex-shrink:0; width:50px; text-align:right; }
  .rank-close { position:absolute; top:12px; right:12px; background:none; border:1px solid gold; color:gold; font-size:1rem; width:28px; height:28px; cursor:pointer; border-radius:4px; }
  .rank-empty { text-align:center; color:#666; font-family:'Share Tech Mono',monospace; padding:2rem; }


  #blind-modal {
    display: none; position: fixed; inset: 0;
    background: rgba(0,0,0,0.92); z-index: 1001;
    overflow-y: auto; padding: 1rem;
  }
  #blind-modal.open { display: flex; align-items: center; justify-content: center; }
  #blind-panel {
    background: #05050e; border: 2px solid #ff00ff;
    border-radius: 8px; padding: 1.5rem;
    width: 100%; max-width: 520px;
    font-family: 'Press Start 2P', monospace;
    position: relative;
  }
  #blind-panel h2 { color: #ff00ff; font-size: 0.7rem; text-align: center; margin: 0 0 1rem; text-shadow: 0 0 10px #ff00ff; }
  #blind-snap-wrap { position: relative; margin-bottom: 1rem; border-radius: 6px; overflow: hidden; border: 1px solid #333; }
  #blind-snap { width: 100%; display: block; transition: filter 0.5s; }
  #blind-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.0); pointer-events: none; transition: background 0.5s; }
  #blind-tries { display: flex; gap: 8px; justify-content: center; margin-bottom: 1rem; }
  .blind-try { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #555; font-size: 10px; display: flex; align-items: center; justify-content: center; }
  .blind-try.used { border-color: #ff4444; background: rgba(255,68,68,0.2); }
  .blind-try.correct { border-color: #39ff14; background: rgba(57,255,20,0.2); }
  #blind-input-wrap { display: flex; gap: 8px; margin-bottom: 8px; position: relative; }
  #blind-input { flex: 1; padding: 8px 12px; background: #111; border: 1px solid #444; color: #fff; font-family: 'Share Tech Mono', monospace; font-size: 13px; border-radius: 4px; }
  #blind-input:focus { outline: none; border-color: #ff00ff; }
  #blind-submit { padding: 8px 16px; background: #ff00ff; color: #000; border: none; border-radius: 4px; font-family: 'Press Start 2P', monospace; font-size: 0.5rem; cursor: pointer; }
  #blind-submit:disabled { opacity: 0.4; cursor: default; }
  #blind-hints { font-family: 'Share Tech Mono', monospace; font-size: 11px; color: #888; min-height: 20px; margin-bottom: 8px; }
  #blind-result { text-align: center; padding: 1rem; display: none; }
  #blind-result.win { color: #39ff14; }
  #blind-result.lose { color: #ff4444; }
  #blind-score-bar { display: flex; justify-content: space-between; margin-bottom: 1rem; font-size: 0.5rem; color: #888; }
  #blind-score-bar span { color: #ff00ff; }
  #blind-autocomplete { position: absolute; top: 100%; left: 0; right: 44px; background: #1a1a1a; border: 1px solid #444; border-top: none; border-radius: 0 0 4px 4px; max-height: 160px; overflow-y: auto; z-index: 10; }
  .blind-ac-item { padding: 6px 12px; font-family: 'Share Tech Mono', monospace; font-size: 12px; cursor: pointer; color: #ccc; }
  .blind-ac-item:hover { background: #333; color: #fff; }
  #blind-btn-skip { padding: 6px 12px; background: transparent; border: 1px solid #555; color: #888; font-family: 'Share Tech Mono', monospace; font-size: 11px; cursor: pointer; border-radius: 4px; }
  #blind-btn-next { padding: 8px 20px; background: #39ff14; color: #000; border: none; font-family: 'Press Start 2P', monospace; font-size: 0.5rem; cursor: pointer; border-radius: 4px; display: none; }
  #blind-close { position: absolute; top: 10px; right: 12px; background: none; border: 1px solid #ff00ff; color: #ff00ff; width: 26px; height: 26px; cursor: pointer; border-radius: 4px; font-size: 14px; }
  #btn-blind { display: block; width: 100%; margin: 6px 0 0 0; background: transparent; border: 1px solid #ff00ff; color: #ff00ff; font-family: 'Press Start 2P', monospace; font-size: 0.42rem; padding: 5px 0; cursor: pointer; border-radius: 4px; text-align: center; transition: all 0.2s; box-sizing: border-box; }
  #btn-blind:hover { background: #ff00ff; color: #000; }


  #btn-blind {
    display: block;
    width: 100%;
    margin: 6px 0 0 0;
    box-sizing: border-box;
  }



  /* SFIDA ARCADE */
  #challenge-modal {
    display: none; position: fixed; inset: 0; z-index: 10000;
    background: rgba(0,0,0,0.92);
  }
  #challenge-modal.open { display: flex; align-items: center; justify-content: center; }
  #challenge-panel {
    background: #0a0a0a; border: 1px solid #ff4444; border-radius: 10px;
    padding: 1.5rem; width: 95vw; max-width: 500px; position: relative;
    box-shadow: 0 0 30px rgba(255,68,68,0.3);
    max-height: 90vh; overflow-y: auto;
  }
  #challenge-panel h2 { color: #ff4444; font-size: 0.7rem; text-align: center; margin: 0 0 1rem; text-shadow: 0 0 10px #ff4444; }
  #challenge-close { position: absolute; top: 10px; right: 12px; background: none; border: 1px solid #ff4444; color: #ff4444; width: 26px; height: 26px; cursor: pointer; border-radius: 4px; font-size: 14px; }
  #btn-challenge:hover { background: #ff4444; color: #000; }
  .ch-dot {
    width: 20px; height: 20px; border-radius: 50%; border: 2px solid #333;
    font-size: 8px; display: flex; align-items: center; justify-content: center;
    font-family: monospace; color: #555; transition: all 0.3s;
  }
  .ch-dot.active { border-color: #ff4444; color: #ff4444; }
  .ch-dot.correct { border-color: #39ff14; background: rgba(57,255,20,0.2); color: #39ff14; }
  .ch-dot.half { border-color: #ffcc00; background: rgba(255,204,0,0.15); color: #ffcc00; }
  .ch-dot.wrong { border-color: #ff4444; background: rgba(255,68,68,0.2); color: #ff4444; }
  #ch-input:focus { outline: none; border-color: #ff4444; }
  #ch-timer-wrap.urgent { color: #ff4444 !important; animation: blink-timer 0.5s infinite; }
  @keyframes blink-timer { 0%,100%{opacity:1} 50%{opacity:0.3} }

  /* ================================
     MIGLIORIE ESTETICHE v2
     ================================ */

  /* --- CARD: effetto glow al hover + micro-animazione titolo --- */
  .game-card:hover .game-title {
    text-shadow: 0 0 8px rgba(255,255,255,0.3);
    transition: text-shadow 0.3s;
  }
  .game-card:hover .game-genre {
    filter: brightness(1.3);
    transition: filter 0.3s;
  }
  .game-card:hover .score-fill {
    filter: brightness(1.5);
    box-shadow: 0 0 6px var(--accent-color, var(--neon-cyan));
  }

  /* --- CARD TOP3: effetto shimmer sul bordo --- */
  .card-top1 { position: relative; overflow: hidden; }
  .card-top1::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(255,215,0,0.06), transparent, transparent);
    animation: shimmer-rotate 8s linear infinite;
    pointer-events: none;
  }
  @keyframes shimmer-rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
  }

  /* --- HEADER: glow pulsante sul titolo --- */
  .header-title {
    animation: fadeUp 0.6s ease forwards 0.4s, title-pulse 4s ease-in-out infinite 1.2s;
  }
  @keyframes title-pulse {
    0%, 100% { text-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan), 0 0 80px rgba(0,245,255,0.4); }
    50% { text-shadow: 0 0 30px var(--neon-cyan), 0 0 60px var(--neon-cyan), 0 0 100px rgba(0,245,255,0.6); }
  }

  /* --- HEADER ERA: sottile breathing glow --- */
  .header-era {
    animation: fadeUp 0.6s ease forwards 0.6s, era-breathe 3s ease-in-out infinite 1.5s;
  }
  @keyframes era-breathe {
    0%, 100% { text-shadow: 0 0 10px var(--neon-yellow); opacity: 1; }
    50% { text-shadow: 0 0 20px var(--neon-yellow), 0 0 40px rgba(255,230,0,0.3); opacity: 0.9; }
  }

  /* --- META NUMERI: contatore glow --- */
  .meta-num {
    transition: text-shadow 0.3s, transform 0.3s;
  }
  .meta-item:hover .meta-num {
    text-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-cyan);
    transform: scale(1.08);
  }
  .meta-item:hover .meta-label {
    color: rgba(255,255,255,0.6);
    transition: color 0.3s;
  }

  /* --- SECTION HEADERS: linea animata --- */
  .section-line {
    background: linear-gradient(90deg, var(--neon-pink), transparent);
    background-size: 200% 100%;
    animation: line-slide 3s ease-in-out infinite;
  }
  @keyframes line-slide {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
  }

  /* --- VOTE BUTTON: heartbeat quando voted --- */
  .vote-btn.voted {
    animation: heartbeat 1.5s ease-in-out 1;
  }
  @keyframes heartbeat {
    0% { transform: scale(1); }
    15% { transform: scale(1.25); }
    30% { transform: scale(1); }
    45% { transform: scale(1.15); }
    60% { transform: scale(1); }
  }

  /* --- MODAL: bordo glow animato --- */
  .modal-panel {
    border-image: linear-gradient(180deg, var(--mc, var(--neon-cyan)), rgba(0,245,255,0.1)) 1;
  }

  /* --- MODAL screenshot: scanline overlay --- */
  #msnap img {
    position: relative;
  }
  #msnap {
    position: relative;
  }
  #msnap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0,0,0,0.12) 2px,
      rgba(0,0,0,0.12) 4px
    );
    pointer-events: none;
    border-radius: 6px;
  }

  /* --- MODAL storia: prima lettera capitolare --- */
  .modal-history p:first-child::first-letter {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.6em;
    font-weight: 900;
    color: var(--mc, var(--neon-cyan));
    float: left;
    line-height: 1;
    margin-right: 4px;
    text-shadow: 0 0 8px currentColor;
  }

  /* --- FOOTER: neon flicker --- */
  footer span {
    animation: flicker 3s infinite alternate;
  }

  /* --- GRID BG: sottile parallax feel --- */
  .grid-bg {
    transition: transform 0.3s ease-out;
  }

  /* --- CARD rank number: ghost effect al hover --- */
  .game-card:hover .rank {
    color: rgba(255,255,255,0.04);
    text-shadow: 0 0 30px rgba(255,255,255,0.05);
    transition: all 0.5s;
  }

  /* --- SEARCH: glow border quando attivo --- */
  #search-input:focus {
    border-color: var(--neon-pink) !important;
    box-shadow: 0 0 15px rgba(255,45,120,0.2);
  }

  /* --- HUD vote: glassmorphism upgrade --- */
  #vote-hud {
    backdrop-filter: blur(12px);
    background: rgba(0,0,0,0.75) !important;
    box-shadow: 0 0 20px rgba(255,215,0,0.1);
    border-color: rgba(255,215,0,0.5) !important;
  }

  /* --- FILTRI genere: glow hover --- */
  .filter-btn:hover {
    filter: brightness(1.3);
    text-shadow: 0 0 8px currentColor;
    transition: all 0.2s;
  }
  .filter-btn.active {
    text-shadow: 0 0 12px currentColor;
    transform: scale(1.05);
  }

  /* ============================================================
     EFFETTI VISIVI AVANZATI v3
     ============================================================ */

  /* --- 1. CRT BOOT SEQUENCE --- */
  .crt-boot {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: #000;
    pointer-events: none;
    animation: crtBoot 1.8s ease-out forwards;
  }
  .crt-boot::before {
    content: '';
    position: absolute;
    inset: 0;
    background: #fff;
    animation: crtFlash 1.8s ease-out forwards;
  }
  .crt-boot::after {
    content: '';
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 2px;
    background: var(--neon-cyan);
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 60px var(--neon-cyan);
    animation: crtLine 1.8s ease-out forwards;
  }
  @keyframes crtBoot {
    0%   { opacity: 1; }
    60%  { opacity: 1; }
    100% { opacity: 0; pointer-events: none; }
  }
  @keyframes crtFlash {
    0%   { opacity: 0; }
    5%   { opacity: 0.8; }
    10%  { opacity: 0; }
    15%  { opacity: 0.3; }
    20%  { opacity: 0; }
    100% { opacity: 0; }
  }
  @keyframes crtLine {
    0%   { transform: translateY(-50%) scaleY(1); opacity: 1; }
    30%  { transform: translateY(-50%) scaleY(1); opacity: 1; }
    60%  { transform: translateY(-50%) scaleY(100); opacity: 0.6; }
    80%  { transform: translateY(-50%) scaleY(200); opacity: 0.2; }
    100% { transform: translateY(-50%) scaleY(400); opacity: 0; }
  }

  /* --- 2. GLITCH EFFECT sul titolo --- */
  .header-title {
    position: relative;
  }
  .glitch-active {
    animation: glitch-main 0.4s linear !important;
  }
  .glitch-active::before,
  .glitch-active::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
  }
  .glitch-active::before {
    color: var(--neon-pink);
    animation: glitch-1 0.4s linear;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
  }
  .glitch-active::after {
    color: var(--neon-cyan);
    animation: glitch-2 0.4s linear;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
  }
  @keyframes glitch-main {
    0%   { transform: translate(0); }
    20%  { transform: translate(-3px, 2px); }
    40%  { transform: translate(3px, -2px); }
    60%  { transform: translate(-2px, -1px); }
    80%  { transform: translate(2px, 1px); }
    100% { transform: translate(0); }
  }
  @keyframes glitch-1 {
    0%   { transform: translate(0); opacity: 0.8; }
    20%  { transform: translate(4px, -1px); opacity: 0.6; }
    40%  { transform: translate(-4px, 2px); opacity: 0.8; }
    60%  { transform: translate(2px, -2px); opacity: 0.5; }
    80%  { transform: translate(-2px, 1px); opacity: 0.7; }
    100% { transform: translate(0); opacity: 0; }
  }
  @keyframes glitch-2 {
    0%   { transform: translate(0); opacity: 0.8; }
    20%  { transform: translate(-3px, 2px); opacity: 0.7; }
    40%  { transform: translate(3px, -1px); opacity: 0.5; }
    60%  { transform: translate(-2px, 2px); opacity: 0.8; }
    80%  { transform: translate(4px, -1px); opacity: 0.6; }
    100% { transform: translate(0); opacity: 0; }
  }

  /* --- 3. PARTICELLE NEON (canvas dietro tutto) --- */
  #particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
  }

  /* --- 4. SCROLL REVEAL --- */
  .scroll-reveal {
    opacity: 0 !important;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    animation: none !important; /* override cardReveal */
  }
  .scroll-reveal.revealed {
    opacity: 1 !important;
    transform: translateY(0);
  }
  /* Stagger per le card nella griglia */
  .scroll-reveal.revealed:nth-child(2) { transition-delay: 0.06s; }
  .scroll-reveal.revealed:nth-child(3) { transition-delay: 0.12s; }
  .scroll-reveal.revealed:nth-child(4) { transition-delay: 0.18s; }
  .scroll-reveal.revealed:nth-child(5) { transition-delay: 0.24s; }
  .scroll-reveal.revealed:nth-child(6) { transition-delay: 0.30s; }
  .scroll-reveal.revealed:nth-child(7) { transition-delay: 0.36s; }

  /* --- 5. TILT 3D sulle card (solo desktop) --- */
  @media (pointer: fine) {
    .game-card {
      transform-style: preserve-3d;
      perspective: 800px;
    }
    .game-card .game-title,
    .game-card .game-info,
    .game-card .medal {
      transform: translateZ(20px);
      transition: transform 0.3s ease;
    }
    .game-card .rank {
      transform: translateZ(40px);
      transition: transform 0.3s ease;
    }
  }

  /* --- 6. TRANSIZIONI CARD MIGLIORATE --- */
  .game-card {
    animation: cardReveal 0.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
  }
  .game-card:hover {
    box-shadow:
      0 0 20px rgba(0,245,255,0.12),
      0 0 40px rgba(0,245,255,0.06),
      inset 0 0 20px rgba(0,245,255,0.03);
  }

  /* --- 7. MODALE: transizione migliorata --- */
  @keyframes mIn {
    from { opacity: 0; transform: scale(0.88) translateY(20px); filter: blur(4px); }
    to   { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); }
  }

  /* --- 8. FILTER BUTTON: click ripple --- */
  .filter-btn {
    position: relative;
    overflow: hidden;
  }
  .filter-btn::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    background: rgba(0,245,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
  }
  .filter-btn:active::after {
    width: 200px; height: 200px;
    opacity: 0;
    transition: 0s;
  }

  /* --- 9. SECTION HEADER: reveal animato --- */
  .section-header .section-label {
    opacity: 0;
    animation: none;
  }
  .section-header .section-line {
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .section-header.revealed .section-label {
    animation: fadeUp 0.5s ease forwards;
  }
  .section-header.revealed .section-line {
    transform: scaleX(1);
  }

  /* --- 10. GLOW TRAIL sul cursore (solo desktop) --- */
  #cursor-glow {
    position: fixed;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(0,245,255,0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 2;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s;
    mix-blend-mode: screen;
  }

  /* --- 11. SCORE BAR: animazione riempimento al reveal --- */
  .scroll-reveal .score-fill {
    width: 0 !important;
    transition: width 1.2s cubic-bezier(0.22, 1, 0.36, 1) 0.3s;
  }
  .scroll-reveal.revealed .score-fill {
    width: var(--target-width) !important;
  }

  /* --- 12. MEDAL bounce al reveal --- */
  .scroll-reveal.revealed .medal {
    animation: medalBounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
  }
  @keyframes medalBounce {
    from { transform: scale(0) rotate(-20deg); }
    to   { transform: scale(1) rotate(0deg); }
  }

  /* --- Disabilita effetti pesanti su mobile --- */
  @media (max-width: 600px) {
    #particles-canvas { opacity: 0.3; }
    #cursor-glow { display: none; }
    .crt-boot { animation-duration: 1s; }
    .glitch-active::before,
    .glitch-active::after { display: none; }
  }
  @media (prefers-reduced-motion: reduce) {
    .crt-boot { display: none; }
    .scroll-reveal { opacity: 1; transform: none; transition: none; }
    #particles-canvas { display: none; }
    .glitch-active { animation: none !important; }
  }

  /* ============================================================
     RESPONSIVE MOBILE v2 — Basato su test reale
     ============================================================ */

  /* ---- MOBILE <= 600px ---- */
  @media (max-width: 600px) {

    /* VOTE HUD: da box fisso a barra orizzontale compatta in basso */
    #vote-hud {
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      top: auto;
      max-width: 100%;
      width: 100%;
      border-radius: 0;
      border: none;
      border-top: 1px solid rgba(255,215,0,0.4);
      padding: 6px 10px;
      font-size: 8px;
      line-height: 1.5;
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 6px;
      z-index: 10000;
      background: rgba(0,0,0,0.95) !important;
      backdrop-filter: blur(12px);
    }
    #vote-hud > div:first-child {
      flex: 1;
      min-width: 0;
    }
    #vote-hud > div:first-child br { display: none; }
    #vote-hud > div:first-child small { display: none; }
    #vote-hud > div:nth-child(2) { display: none; } /* nasconde il divider */

    /* Bottoni mini-gioco dentro l'HUD: inline compatti */
    #btn-blind,
    #btn-challenge {
      width: auto !important;
      display: inline-block !important;
      margin: 0 !important;
      padding: 4px 8px !important;
      font-size: 0.35rem !important;
      white-space: nowrap;
      flex-shrink: 0;
    }
    #btn-blind span,
    #btn-challenge span { display: none; } /* nasconde emoji per salvare spazio */

    /* Mute button: sopra l'HUD barra */
    #mute-btn {
      bottom: 46px;
      right: 8px;
      padding: 5px 10px;
      font-size: 0.55rem;
    }

    /* Body: padding in basso per non coprire contenuti con la barra HUD */
    body { padding-bottom: 50px; }

    /* Header compatto */
    header { padding: 20px 14px 18px; }
    .header-subtitle { font-size: 0.5rem; letter-spacing: 0.2em; margin-bottom: 10px; }
    .header-title { line-height: 1.4; }
    .header-era { font-size: 0.7rem; letter-spacing: 0.15em; margin-top: 10px; }
    .header-meta { gap: 14px; margin-top: 16px; }
    .meta-num { font-size: 1.1rem; }
    .meta-label { font-size: 0.55rem; }

    /* Filter bar: scroll orizzontale */
    .filter-bar {
      flex-wrap: nowrap;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      justify-content: flex-start;
      padding: 12px 10px;
      gap: 6px;
      scrollbar-width: none;
    }
    .filter-bar::-webkit-scrollbar { display: none; }
    .filter-btn {
      white-space: nowrap;
      flex-shrink: 0;
      padding: 8px 14px;
      font-size: 0.6rem;
    }

    /* Vote banner: una riga compatta */
    #vote-banner {
      font-size: 0.62rem;
      padding: 6px 10px;
      line-height: 1.5;
    }

    /* Search */
    .search-wrap { padding: 0 10px 16px; }
    .search-input { font-size: 16px !important; } /* previene zoom iOS */

    /* Griglia */
    .top3-grid {
      grid-template-columns: 1fr;
      grid-template-rows: auto;
      padding: 0 8px 2px;
    }
    .card-top1 { grid-row: 1; grid-column: 1; padding: 20px 16px 16px; }
    .card-top1 .rank { font-size: 2.5rem; }
    .card-top1 .game-title { font-size: 1rem; }
    .card-top1 .medal { font-size: 1.6rem; }
    .card-top2 { grid-row: 2; grid-column: 1; }
    .card-top3 { grid-row: 3; grid-column: 1; }
    .games-grid { grid-template-columns: 1fr; padding: 0 8px 8px; }

    /* Section headers */
    .section-header { padding: 20px 10px 10px; gap: 10px; }
    .section-label { font-size: 0.55rem; }

    /* Card */
    .game-card { padding: 14px 14px 30px; }
    .rank { font-size: 1.8rem; }
    .game-title { font-size: 0.8rem; }
    .game-genre { font-size: 0.55rem; }
    .game-year { font-size: 0.65rem; }
    .game-producer { font-size: 0.58rem; }
    .vote-btn { bottom: 6px; right: 6px; font-size: 9px; padding: 3px 8px; }

    /* Modale gioco */
    .modal-bg { padding: 0; align-items: flex-start; }
    .modal-panel {
      max-width: 100%;
      max-height: 100vh;
      border-radius: 0;
      border: none;
      border-top: 2px solid var(--mc, var(--neon-cyan));
    }
    .modal-inner { padding: 14px 12px 20px; }
    .modal-head { flex-direction: column; gap: 6px; }
    .modal-close {
      position: absolute;
      top: 6px;
      right: 6px;
      z-index: 2;
      min-width: 40px;
      min-height: 40px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    .modal-badge { font-size: 0.5rem; }
    .modal-name { font-size: 0.65rem; margin-top: 4px; padding-right: 40px; }
    .modal-stats { gap: 6px 10px; }
    .mstat-l { font-size: 0.46rem; }
    .mstat-v { font-size: 0.63rem; }
    .modal-sec { font-size: 0.5rem; }
    .modal-history { font-size: 0.62rem; line-height: 1.7; }
    .modal-facts { grid-template-columns: 1fr; gap: 5px; }
    .mfact { font-size: 0.56rem; padding: 7px 9px; }

    /* Modale navigazione */
    .mod-prev, .mod-next {
      opacity: 0.9;
      background: rgba(0,0,0,0.85);
      min-width: 40px;
      min-height: 40px;
      font-size: 1.1rem;
    }
    .mod-prev { left: 2px; }
    .mod-next { right: 2px; }

    /* Classifica modale */
    #rank-modal { padding: 0.5rem; }
    #rank-panel { padding: 1rem 0.7rem; }
    #rank-panel h2 { font-size: 0.6rem; margin-bottom: 0.8rem; }
    .rank-title { font-size: 0.48rem; }
    .rank-votes { font-size: 0.6rem; width: 36px; }
    .rank-pos { font-size: 0.55rem; width: 24px; }
    .rank-icon { width: 24px; height: 24px; }
    .rank-close { min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; }

    /* Blind test / Sfida */
    #blind-panel, #challenge-panel { padding: 1rem 0.8rem; }
    #blind-panel h2, #challenge-panel h2 { font-size: 0.55rem; }
    #blind-input, #ch-input { font-size: 16px !important; }
    #blind-submit, #blind-btn-skip, #blind-btn-next { min-height: 40px; }
    #blind-close, #challenge-close { min-width: 40px; min-height: 40px; display: flex; align-items: center; justify-content: center; }

    /* Legend e footer */
    .legend { gap: 8px 12px; padding: 18px 10px; }
    .legend-item { font-size: 0.55rem; }
    footer { font-size: 0.5rem; padding: 18px 10px 60px; } /* padding-bottom per la barra HUD */

    /* Performance: alleggerisci effetti */
    .scan-line { display: none; }
    body::before {
      background: repeating-linear-gradient(
        0deg, transparent, transparent 3px,
        rgba(0,0,0,0.08) 3px, rgba(0,0,0,0.08) 6px
      );
    }
    body::after {
      background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.4) 100%);
    }
    .grid-bg { background-size: 60px 60px; }

    /* Disabilita transform hover per scroll fluido */
    .game-card:hover { transform: none; }
    .game-card { will-change: auto; }
  }

  /* ---- ULTRA SMALL <= 380px ---- */
  @media (max-width: 380px) {
    header { padding: 16px 10px 14px; }
    .header-subtitle { font-size: 0.45rem; }
    .header-era { font-size: 0.6rem; }
    .meta-num { font-size: 1rem; }
    .filter-btn { padding: 6px 10px; font-size: 0.55rem; }
    .modal-name { font-size: 0.58rem; }
    .games-grid { padding: 0 6px 6px; }
    .top3-grid { padding: 0 6px 2px; }
  }

  /* ---- LANDSCAPE MOBILE ---- */
  @media (max-height: 500px) and (orientation: landscape) {
    header { padding: 12px 16px 10px; }
    .header-meta { margin-top: 8px; }
    .modal-bg { padding: 0; }
    .modal-panel { max-height: 100vh; }
    .modal-inner { padding: 10px 14px; }
    #vote-hud { padding: 4px 10px; }
  }

  /* ---- SAFE AREA (notch iPhone) ---- */
  @supports (padding: env(safe-area-inset-bottom)) {
    @media (max-width: 600px) {
      #vote-hud { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
      body { padding-bottom: calc(50px + env(safe-area-inset-bottom)); }
      footer { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
      #mute-btn { bottom: calc(46px + env(safe-area-inset-bottom)); }
    }
  }
