* { margin: 0; padding: 0; box-sizing: border-box; }

/* ==== ТЕМА: ОСНОВНАЯ (чёрно-сиреневая) ==== */
:root {
  --bg: #0a0714;
  --bg-2: #120a24;
  --card: #1a1030;
  --accent: #a855f7;
  --accent-2: #7c3aed;
  --text: #e9e2ff;
  --text-dim: #9b8fbf;
  --border: #2a1a4a;
}

/* ==== ТЕМА: ЧЁРНАЯ ==== */
body.theme-dark {
  --bg: #050505;
  --bg-2: #0d0d0d;
  --card: #151515;
  --accent: #a855f7;
  --accent-2: #7c3aed;
  --text: #ffffff;
  --text-dim: #888888;
  --border: #222222;
}

/* ==== ТЕМА: СИНЯЯ ==== */
body.theme-blue {
  --bg: #030b1a;
  --bg-2: #071430;
  --card: #0d1f3d;
  --accent: #3b82f6;
  --accent-2: #1d4ed8;
  --text: #e0f0ff;
  --text-dim: #7ba3d9;
  --border: #14355e;
}

/* ==== ТЕМА: ЗЕЛЁНАЯ ==== */
body.theme-green {
  --bg: #06120a;
  --bg-2: #0a1f10;
  --card: #102a17;
  --accent: #22c55e;
  --accent-2: #15803d;
  --text: #d5ffe0;
  --text-dim: #7bbd8f;
  --border: #1a4529;
}

/* ==== ТЕМА: КРАСНАЯ ==== */
body.theme-red {
  --bg: #1a0507;
  --bg-2: #2b080e;
  --card: #3d0d16;
  --accent: #ef4444;
  --accent-2: #b91c1c;
  --text: #ffe0e0;
  --text-dim: #c97676;
  --border: #5a1a22;
}

/* ==== ТЕМА: ЗОЛОТАЯ ==== */
body.theme-gold {
  --bg: #141005;
  --bg-2: #221a08;
  --card: #33270d;
  --accent: #eab308;
  --accent-2: #ca8a04;
  --text: #fff5d6;
  --text-dim: #c9b073;
  --border: #4d3b12;
}

/* ==== КУРСОР (обычный, но сиреневый) ==== */
body {
  font-family: 'Inter', sans-serif;
  background: radial-gradient(circle at 20% 0%, var(--bg-2) 0%, var(--bg) 55%);
  color: var(--text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath d='M4 2 L4 18 L8 14 L11 21 L14 19 L11 13 L17 13 Z' fill='%23a855f7' stroke='%230a0714' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 4 2, auto;
}

a, button, .game-card, .nav-btn, .filter-btn, .sort-select, input, select, .fav-star, .detail-close {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='26' height='26' viewBox='0 0 26 26'%3E%3Cpath d='M5 3 L5 21 L9 16 L12 23 L15 21 L12 14 L19 14 Z' fill='%23c77dff' stroke='%230a0714' stroke-width='1.5' stroke-linejoin='round'/%3E%3C/svg%3E") 5 3, pointer !important;
}

/* LOADER */
#loader {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 9999;
  display: grid;
  place-items: center;
  grid-template-rows: auto auto auto;
  gap: 30px;
  transition: opacity .6s, visibility .6s;
}
#loader.hidden { opacity: 0; visibility: hidden; }
.loader-logo {
  font-size: 36px; font-weight: 900; letter-spacing: 2px;
  animation: logoPulse 1.5s infinite alternate;
}
.loader-logo span { color: var(--accent); }
@keyframes logoPulse {
  from { text-shadow: 0 0 10px var(--accent); }
  to { text-shadow: 0 0 30px var(--accent), 0 0 50px var(--accent-2); }
}
.loader-bar {
  width: 200px; height: 4px;
  background: var(--card);
  border-radius: 4px;
  overflow: hidden;
}
.loader-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  animation: loadFill 1.8s ease forwards;
}
@keyframes loadFill { to { width: 100%; } }
.loader-text { color: var(--text-dim); font-size: 13px; }

/* PARTICLES */
#particles {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
}

.bg-glow {
  position: fixed; inset: 0;
  background:
    radial-gradient(circle at 80% 80%, rgba(168,85,247,0.15), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(124,58,237,0.12), transparent 40%);
  pointer-events: none; z-index: 0;
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: .7; } 50% { opacity: 1; } }

/* SIDEBAR */
.sidebar {
  width: 260px;
  background: rgba(18, 10, 36, 0.85);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 24px 18px;
  z-index: 2;
}
.logo { display: flex; align-items: center; gap: 10px; margin-bottom: 40px; }
.logo-dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 20px var(--accent);
  animation: glow 2s infinite alternate;
}
@keyframes glow {
  from { box-shadow: 0 0 10px var(--accent); }
  to { box-shadow: 0 0 28px var(--accent), 0 0 40px var(--accent-2); }
}
.logo h1 { font-size: 18px; font-weight: 800; letter-spacing: 1px; }
.logo h1 span { color: var(--accent); }

nav { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.nav-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-dim);
  padding: 12px 14px;
  border-radius: 10px;
  text-align: left;
  font-size: 14px; font-weight: 600;
  transition: all .25s ease;
  font-family: inherit;
}
.nav-btn:hover {
  background: rgba(168,85,247,0.08);
  color: var(--text);
  transform: translateX(4px);
}
.nav-btn.active {
  background: linear-gradient(135deg, rgba(168,85,247,0.25), rgba(124,58,237,0.15));
  color: #fff;
  border-color: rgba(168,85,247,0.5);
  box-shadow: 0 0 20px rgba(168,85,247,0.25);
}

.sidebar-footer { border-top: 1px solid var(--border); padding-top: 16px; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid; place-items: center;
  font-weight: 800;
  box-shadow: 0 0 15px rgba(168,85,247,0.5);
}
.uname { font-size: 13px; font-weight: 600; }
.ustatus { font-size: 11px; color: #4ade80; }

/* CONTENT */
.content { flex: 1; padding: 28px 36px; overflow-y: auto; z-index: 2; }
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.topbar h2 { font-size: 24px; font-weight: 800; }
.topbar-right { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.search-wrap input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 16px;
  border-radius: 10px;
  width: 260px;
  font-family: inherit;
  transition: all .25s;
}
.search-wrap input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.2);
}

/* FILTERS */
.filters {
  display: flex; justify-content: space-between;
  align-items: center; gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-group { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px; font-weight: 600;
  font-family: inherit;
  transition: all .25s;
}
.filter-btn:hover { border-color: var(--accent); color: var(--text); }
.filter-btn.active {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 15px rgba(168,85,247,0.4);
}
.sort-select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
}
.sort-select:focus { outline: none; border-color: var(--accent); }

/* GRID */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.game-card {
  background: linear-gradient(180deg, var(--card), var(--bg-2));
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.2,.8,.2,1), box-shadow .3s, border-color .3s;
  position: relative;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp .5s forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }
.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--accent);
  box-shadow: 0 15px 40px rgba(168,85,247,0.35);
}

.game-cover {
  height: 150px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 900;
  color: #fff;
  transition: filter .3s;
}
.game-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, transparent, transparent 12px, rgba(255,255,255,0.04) 12px, rgba(255,255,255,0.04) 24px),
    repeating-linear-gradient(-45deg, transparent, transparent 12px, rgba(0,0,0,0.08) 12px, rgba(0,0,0,0.08) 24px);
  pointer-events: none;
}
.game-cover::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(10,7,20,0.95));
}
.game-card:hover .game-cover { filter: brightness(1.2) saturate(1.2); }

.fav-star {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(10,7,20,0.7);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  color: var(--text-dim);
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 16px;
  z-index: 3;
  transition: all .25s;
}
.fav-star:hover { color: var(--accent); transform: scale(1.15); }
.fav-star.active { color: #ffd700; border-color: #ffd700; box-shadow: 0 0 15px rgba(255,215,0,0.5); }

.game-info { padding: 14px 16px; }
.game-info h3 { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.game-info p { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }

.btn-play {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  transition: all .25s;
  position: relative;
  overflow: hidden;
}
.btn-play:hover {
  box-shadow: 0 0 25px rgba(168,85,247,0.6);
  transform: translateY(-2px);
}
.btn-play:active { transform: scale(0.97); }
.btn-play::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left .6s;
}
.btn-play:hover::before { left: 100%; }
.btn-play:disabled {
  opacity: .4;
  cursor: not-allowed;
  background: var(--card);
}

/* Tabs */
.tab-content { display: none; animation: fadeSlide .35s ease; }
.tab-content.active { display: block; }
@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Empty */
.empty-msg {
  text-align: center;
  color: var(--text-dim);
  padding: 40px;
  font-size: 14px;
  display: none;
}
.empty-msg.show { display: block; }

/* News */
.news-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  margin-bottom: 16px;
  transition: all .25s;
}
.news-card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 20px rgba(168,85,247,0.2);
}
.news-card h3 { margin-bottom: 8px; color: var(--accent); }
.news-card p { color: var(--text-dim); font-size: 14px; line-height: 1.6; }

/* Settings */
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px;
  max-width: 520px;
  display: flex; flex-direction: column; gap: 14px;
}
.settings-card label { font-size: 13px; color: var(--text-dim); font-weight: 600; }
.settings-card input[type=text], .settings-card select {
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-family: inherit;
}
.settings-card input:focus, .settings-card select:focus {
  outline: none;
  border-color: var(--accent);
}
.toggle-label {
  display: flex; justify-content: space-between; align-items: center;
}
.toggle { position: relative; width: 44px; height: 24px; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span {
  position: absolute; inset: 0;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: 24px;
  transition: all .3s;
}
.toggle span::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--text-dim);
  top: 2px; left: 2px;
  transition: all .3s;
}
.toggle input:checked + span {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border-color: var(--accent);
}
.toggle input:checked + span::before {
  transform: translateX(20px);
  background: #fff;
}

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(5,2,12,0.8);
  backdrop-filter: blur(6px);
  display: none;
  place-items: center;
  z-index: 100;
}
.modal.show { display: grid; animation: fadeIn .25s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-box {
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 30px;
  width: 360px;
  box-shadow: 0 0 60px rgba(168,85,247,0.4);
  animation: popIn .3s cubic-bezier(.2,.8,.2,1);
}
@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal-box h3 { margin-bottom: 8px; }
.modal-box p { color: var(--text-dim); font-size: 13px; margin-bottom: 16px; }
.progress {
  height: 8px;
  background: var(--bg-2);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}
.progress-bar {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .2s;
  box-shadow: 0 0 15px var(--accent);
}
.btn-primary, .btn-secondary {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-family: inherit;
  transition: all .25s;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
}
.btn-primary:hover, .btn-secondary:hover {
  box-shadow: 0 0 25px rgba(168,85,247,0.6);
  transform: translateY(-2px);
}

/* DETAIL PAGE */
.detail {
  position: fixed; inset: 0;
  background: rgba(5,2,12,0.85);
  backdrop-filter: blur(8px);
  display: none;
  z-index: 200;
  overflow-y: auto;
  padding: 40px 20px;
}
.detail.show { display: block; animation: fadeIn .3s; }
.detail-box {
  max-width: 760px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(168,85,247,0.3);
  animation: popIn .35s cubic-bezier(.2,.8,.2,1);
  position: relative;
}
.detail-close {
  position: absolute; top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(10,7,20,0.8);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 16px;
  z-index: 3;
  transition: all .25s;
}
.detail-close:hover { background: var(--accent); transform: rotate(90deg); }
.detail-hero {
  height: 220px;
  display: grid; place-items: center;
  font-size: 90px;
  font-weight: 900;
  color: #fff;
  position: relative;
}
.detail-hero::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, var(--card));
}
.detail-body { padding: 26px 30px 30px; }
.detail-body h2 { font-size: 26px; margin-bottom: 6px; }
.detail-meta { color: var(--accent); font-size: 13px; font-weight: 600; margin-bottom: 16px; }
.detail-desc { color: var(--text-dim); line-height: 1.7; margin-bottom: 22px; }
.detail-actions { display: flex; gap: 12px; }
.detail-actions button { flex: 1; }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb {
  background: var(--accent-2);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* Responsive */
@media (max-width: 768px) {
  body { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar { width: 100%; padding: 14px; }
  .sidebar nav { flex-direction: row; overflow-x: auto; }
  .nav-btn { white-space: nowrap; font-size: 12px; padding: 8px 10px; }
  .sidebar-footer { display: none; }
  .content { padding: 16px; }
  .search-wrap input { width: 100%; }
  .topbar { flex-direction: column; gap: 12px; align-items: stretch; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .game-cover { height: 100px; font-size: 40px; }
  .detail-actions { flex-direction: column; }
}