  /* Light mode variables */
  [data-theme="light"] {
    --bg: #f1f5f9;
    --bg2: #e2e8f0;
    --text: #0f172a;
    --text-dim: #475569;
    --accent: #4f46e5;
    --accent-hover: #6366f1;
    --border: #cbd5e1;
    --card-bg: #ffffff;
  }

  /* styles */
  .main {
    margin-top: 0px;
    padding: 100px 24px 60px;
    text-align: center;
    transition: 0.3s;
  }
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 2000;
}

  body.games-open .main {
    display: none;
  }

  .title {
    font-size: 2.8rem;
    font-weight: 800;
    background: linear-gradient(145deg, #e2e8ff, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 16px;
  }

  [data-theme="light"] .title {
    background: linear-gradient(145deg, #4f46e5, #a855f7);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .ad-top {
    width: min(728px, 90%);
    height: 90px;
    margin: 18px auto;
    background: var(--card-bg);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-dim);
  }

  .search {
    margin: 28px auto;
    max-width: 480px;
  }

  .search input {
    width: 100%;
    padding: 14px 24px;
    border-radius: 60px;
    border: 1px solid var(--border);
    background: var(--card-bg);
    color: var(--text);
    font-size: 1rem;
    outline: none;
    transition: all 0.25s;
  }

  .search input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
  }

  .games-stats {
    background: rgba(99, 102, 241, 0.1);
    backdrop-filter: blur(8px);
    padding: 8px 20px;
    border-radius: 40px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    margin: 10px auto 20px;
    border: 1px solid var(--border);
    color: var(--text);
  }

  .games-stats i {
    color: var(--accent);
    font-size: 1rem;
  }

  .games-stats span {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.1rem;
  }

  .grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 16px;
    max-width: 1400px;
    margin: 40px auto 0;
    padding: 0 12px;
  }

  @media (max-width: 1200px) {
   .grid { grid-template-columns: repeat(5,1fr); }
  }
  @media (max-width: 1000px) {
   .grid { grid-template-columns: repeat(4,1fr); }
  }
  @media (max-width: 760px) {
   .grid { grid-template-columns: repeat(3,1fr); }
  }
  @media (max-width: 540px) {
   .grid { grid-template-columns: repeat(2,1fr); }
  }
  .game {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 1.5rem;
    overflow: hidden;
    cursor: pointer;
    transform: translateY(0px);
    transition: transform 0.3s cubic-bezier(0.2, 0.9, 0.4, 1.1), box-shadow 0.3s;
    box-shadow: 0 12px 20px -10px rgba(0,0,0,0.2);
    background: var(--card-bg);
    border: 1px solid var(--border);
  }

  .game:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 28px 32px -12px rgba(0,0,0,0.3);
    border-color: var(--accent);
  }

  .game img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
  }

  .game:hover img {
    transform: scale(1.06);
  }

  .game-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
    padding: 18px 8px 12px;
    font-weight: 600;
    font-size: 0.85rem;
    text-align: center;
    backdrop-filter: blur(3px);
    transform: translateY(100%);
    transition: transform 0.25s ease-out;
    color: white;
  }

  .game:hover .game-name {
    transform: translateY(0);
  }

  .suggestion-card {
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border: 2px solid rgba(255,255,255,0.3);
  }

  .suggestion-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 0 25px rgba(99,102,241,0.6);
  }

/* ===== VIEWER (FIXED FULL WIDTH) ===== */

.viewer {
position: fixed;
top: 80px;
left: 0;
width: 100%;
height: calc(100vh - 80px);
display: none;
justify-content: center;
align-items: center;
z-index: 1040;
background: rgba(0, 0, 0, 0.85);
backdrop-filter: blur(20px);
}

[data-theme="light"] .viewer {
background: rgba(255, 255, 255, 0.9);
}

.viewer.active {
display: flex; /* KEEP THIS */
}

/* 
.viewer-wrap {
display: flex;
width: 100%;
height: 100%;
}

/* 
.ad-left, .ad-right {
display: none;
}

/* ===== BOX (FULL WIDTH) ===== */
.game-box {
flex: 1;
width: 100%;
max-width: 100%; /* FIX */
height: 100%;
background: var(--card-bg);
border-radius: 0; /* full width clean */
overflow: hidden;
display: flex;
flex-direction: column;
box-shadow: none; /* cleaner */
}

/* ===== AREA ===== */
.game-area {
flex: 1;
overflow: hidden;
}

#frame {
width: 100%;
height: 100%;
border: none;
display: block;
}

/* ===== CONTROLS ===== */
.controls {
height: 56px; /* smaller but stable */
display: flex;
align-items: center;
gap: 10px;
padding: 0 14px;
background: rgba(0, 0, 0, 0.75);
backdrop-filter: blur(12px);
border-top: 1px solid rgba(255,255,255,0.06);
}

[data-theme="light"] .controls {
background: rgba(255, 255, 255, 0.9);
border-top: 1px solid var(--border);
}

/* ===== BUTTONS ===== */
.ctrl-btn {
background: #1e293b;
border: none;
color: white;
padding: 6px 12px;
border-radius: 40px;
cursor: pointer;
transition: 0.2s;
font-size: 0.85rem;
display: inline-flex;
align-items: center;
gap: 6px;
font-weight: 500;
}

[data-theme="light"] .ctrl-btn {
background: var(--card-bg);
color: var(--text);
border: 1px solid var(--border);
}

.ctrl-btn:hover {
background: var(--accent);
transform: translateY(-2px);
color: white;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: space-between; 
}
  /* Loader */
  #loader {
    position: fixed;
    top: 80px;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, #020617, #000000dd);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(12px);
  }

  [data-theme="light"] #loader {
    background: rgba(255, 255, 255, 0.95);
  }

  #loader.active {
    opacity: 1;
    pointer-events: all;
  }

  .loader-content {
    text-align: center;
  }

  #loaderIcon {
    width: 90px;
    height: 90px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2.8rem;
    animation: floatIcon 2s ease-in-out infinite;
    box-shadow: 0 0 32px rgba(99,102,241,0.7);
  }

  @keyframes floatIcon {
    0%,100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
  }

  #loaderTitle {
    margin-top: 18px;
    font-size: 1.7rem;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  [data-theme="light"] #loaderTitle {
    -webkit-text-fill-color: var(--accent);
  }

  #loaderText {
    margin-top: 8px;
    color: #94a3b8;
  }

  [data-theme="light"] #loaderText {
    color: var(--text-dim);
  }

  .progress {
    width: 240px;
    height: 6px;
    background: #1e293b;
    border-radius: 20px;
    margin: 20px auto 0;
    overflow: hidden;
  }

  [data-theme="light"] .progress {
    background: var(--border);
  }

  .bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6366f1, #a78bfa);
    transition: width 2.5s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  }

  @media (max-width: 860px) {
    .ad-left, .ad-right { display: none; }
    .controls { gap: 8px; }
    .ctrl-btn span { display: none; }
    .ctrl-btn i { margin: 0; font-size: 1.2rem; }
    .ctrl-btn { padding: 10px 12px; }
    .grid { gap: 16px; }
  }
