
@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@400;600;700;800;900&family=Fredoka+One&display=swap');

:root {
  --bg: #0d0f1a;
  --surface: #161825;
  --card: #1e2235;
  --card-hover: #252a42;
  --accent: #ff5f57;
  --accent2: #ffbe30;
  --accent3: #2bff9e;
  --success: #2bff9e;
  --text: #eef0ff;
  --muted: #7b80a8;
  --sw: 220px;
  --r: 14px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─── SIDEBAR ─── */
.sidebar {
  position: fixed; top: 0; left: 0; width: var(--sw); height: 100vh;
  background: var(--surface); border-right: 1px solid #fff2;
  display: flex; flex-direction: column; z-index: 100; overflow-y: auto; scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }
.logo { padding: 20px 18px 14px; display: flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-icon { width: 40px; height: 40px; background: linear-gradient(135deg, var(--accent), var(--accent2)); border-radius: 11px; display: grid; place-items: center; font-size: 21px; flex-shrink: 0; }
.logo-text { font-family: 'Fredoka One', cursive; font-size: 24px; background: linear-gradient(90deg, #ff5f57, #ffbe30); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

/* search */
.search-wrap { padding: 0 14px 16px; }
.search-box { display: flex; align-items: center; background: var(--card); border: 1.5px solid #fff1; border-radius: 10px; padding: 0 12px; gap: 8px; transition: border-color .2s; }
.search-box:focus-within { border-color: var(--accent); }
.search-icon { font-size: 14px; line-height: 1; flex-shrink: 0; display: flex; align-items: center; }
.search-box input { flex: 1; background: none; border: none; padding: 9px 0; color: var(--text); font-family: 'Nunito', sans-serif; font-size: 13px; outline: none; }
.search-box input::placeholder { color: var(--muted); }

.nav-section { padding: 2px 10px 8px; }
.nav-label { font-size: 10px; font-weight: 800; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); padding: 6px 10px 6px; }
.nav-item { display: flex; align-items: center; gap: 9px; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--muted); transition: all .15s; user-select: none; text-decoration: none; }
.nav-item:hover { background: var(--card); color: var(--text); }
.nav-item.active { background: var(--accent); color: #fff; }
.nav-item .ni { font-size: 16px; width: 20px; text-align: center; }

/* ─── MAIN ─── */
.main { margin-left: var(--sw); min-height: 100vh; display: flex; flex-direction: column; }
.topbar { 
  position: sticky; 
  top: 0; 
  background: var(--bg); 
  border-bottom: 1px solid #fff1; 
  padding: 10px 20px; 
  display: flex; 
  align-items: center; 
  justify-content: space-between; 
  z-index: 50; 
  backdrop-filter: blur(14px); 
  gap: 15px;
  flex-wrap: nowrap;
}
.topbar-title { font-family: 'Fredoka One', cursive; font-size: 21px; flex-shrink: 0; }
.topbar-cats { 
  display: flex; 
  gap: 8px; 
  flex-wrap: nowrap; 
  overflow-x: auto; 
  scrollbar-width: none; 
  -ms-overflow-style: none;
  padding: 4px 0;
  flex: 1;
}
.topbar-cats::-webkit-scrollbar { display: none; }
.cat-pill { 
  padding: 8px 16px; 
  border-radius: 20px; 
  font-size: 13px; 
  font-weight: 700; 
  cursor: pointer; 
  transition: all .15s; 
  background: var(--card); 
  color: var(--muted); 
  border: none; 
  outline: none; 
  white-space: nowrap; 
}
.cat-pill:hover { background: var(--card-hover); color: var(--text); }
.cat-pill.active { background: var(--accent); color: #fff; }

/* ─── TOPBAR AUTH ─── */
.topbar-auth { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar-login-btn { padding: 7px 17px; background: var(--accent); color: #fff; border-radius: 20px; font-size: 13px; font-weight: 800; text-decoration: none; transition: all .2s; white-space: nowrap; }
.topbar-login-btn:hover { background: #e04e48; transform: translateY(-1px); }
.topbar-user { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid #fff1; border-radius: 24px; padding: 5px 14px 5px 6px; transition: all .2s; }
.topbar-user:hover { background: var(--card-hover); border-color: var(--accent); transform: translateY(-1px); }
.topbar-avatar { width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent2)); display: grid; place-items: center; font-size: 15px; flex-shrink: 0; }
.topbar-username { font-size: 13px; font-weight: 800; color: var(--text); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar-logout-btn { padding: 4px 11px; background: transparent; border: 1.5px solid #fff2; color: var(--muted); border-radius: 12px; font-size: 11.5px; font-weight: 700; cursor: pointer; transition: all .15s; white-space: nowrap; }
.topbar-logout-btn:hover { border-color: var(--accent); color: var(--accent); }

.section { padding: 18px 26px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-title { font-family: 'Fredoka One', cursive; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.game-count-badge { background: var(--card); border-radius: 20px; padding: 4px 12px; font-size: 12px; font-weight: 700; color: var(--muted); }

/* GAMES GRID */
.games-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.games-grid.large { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.game-card { background: var(--card); border-radius: var(--r); overflow: hidden; cursor: pointer; transition: transform .2s, box-shadow .2s; position: relative; border: 1px solid #fff1; animation: fadeIn .3s ease both; text-decoration: none; display: block; color: var(--text); }
.game-card:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 14px 36px #00000055; border-color: #fff2; z-index: 2; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px) } to { opacity: 1; transform: translateY(0) } }
.game-thumb-wrap { position: relative; overflow: hidden; width: 100%; padding-top: 100%; }
.game-thumb { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; background: var(--card-hover); }
.game-thumb-wrap::after { content: ''; position: absolute; inset: 0; background: #00000055; opacity: 0; transition: opacity .2s; }
.game-card:hover .game-thumb-wrap::after { opacity: 1; }
.game-badge { position: absolute; top: 7px; left: 7px; background: var(--accent2); color: #111; font-size: 9px; font-weight: 900; letter-spacing: 1px; text-transform: uppercase; padding: 2px 7px; border-radius: 4px; z-index: 1; }
.game-play-btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(.7); background: var(--accent); color: #fff; border-radius: 50%; width: 44px; height: 44px; display: grid; place-items: center; font-size: 17px; opacity: 0; transition: all .2s; box-shadow: 0 4px 18px #ff5f5775; z-index: 2; }
.game-card:hover .game-play-btn { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.game-info { padding: 9px 11px 10px; }
.game-name { font-size: 12.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.game-meta { display: flex; align-items: center; justify-content: space-between; }
.game-cat { font-size: 10.5px; color: var(--muted); font-weight: 600; }
.live-badge { display: flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: #2bff9e; }
.live-dot { width: 6px; height: 6px; background: #2bff9e; border-radius: 50%; animation: pulse-dot 1.5s ease-in-out infinite; flex-shrink: 0; }
@keyframes pulse-dot { 0%, 100% { opacity: 1; transform: scale(1) } 50% { opacity: .4; transform: scale(.7) } }

.game-fav-btn { position: absolute; top: 7px; right: 7px; background: #0009; border: none; border-radius: 50%; width: 27px; height: 27px; display: grid; place-items: center; font-size: 13px; cursor: pointer; opacity: 0; transition: all .2s; z-index: 3; }
.game-card:hover .game-fav-btn, .game-fav-btn.active { opacity: 1; }
.game-fav-btn.active { background: var(--accent); }

.load-more-wrap { display: flex; justify-content: center; padding: 22px 0 6px; }
.load-more-btn { background: var(--card); border: 1px solid #fff2; color: var(--text); font-family: 'Nunito', sans-serif; font-size: 14px; font-weight: 800; padding: 11px 34px; border-radius: 30px; cursor: pointer; transition: all .2s; }
.load-more-btn:hover { background: var(--accent); border-color: var(--accent); }

.no-results { grid-column: 1/-1; text-align: center; padding: 60px 20px; color: var(--muted); font-size: 15px; }
.no-results .ic { font-size: 48px; margin-bottom: 12px; }

/* ─── PAGES ─── */
.page-hdr { padding: 22px 26px 10px; }
.page-ttl { font-family: 'Fredoka One', cursive; font-size: 24px; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; }
.page-sub { color: var(--muted); font-size: 13px; }

/* footer */
.footer { margin-top: 36px; padding: 22px 26px; border-top: 1px solid #fff1; color: var(--muted); font-size: 12px; display: flex; align-items: center; justify-content: space-between; }

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #fff2; border-radius: 99px; }

.ad-container { padding: 15px; text-align: center; background: #111; margin: 15px; border: 1px solid #333; border-radius: 5px; color: #555;}
