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

:root {
  --bg:       #09090f;
  --bg2:      #0f0f18;
  --surface:  #13131e;
  --surface2: #1a1a28;
  --surface3: #222234;
  --border:   rgba(255,255,255,0.07);
  --accent:   #7c3aed;
  --accent-h: #6d28d9;
  --accent2:  #06b6d4;
  --red:      #ef4444;
  --green:    #22c55e;
  --text:     #f0f0f8;
  --text2:    #9999b8;
  --text3:    #55556a;
  --radius:   12px;
  --radius-sm:8px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  line-height: 1.5;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }
img { display: block; max-width: 100%; }

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface3); border-radius: 99px; }

/* ── HEADER ── */
.header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(9,9,15,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 24px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.logo-text { color: var(--text); }
.logo-text span { color: var(--accent); }

/* Search */
.header-search {
  flex: 1;
  max-width: 420px;
  position: relative;
}

.header-search input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 9px 44px 9px 18px;
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.header-search input::placeholder { color: var(--text3); }
.header-search input:focus { border-color: var(--accent); }

.search-icon {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text3);
  pointer-events: none;
  font-size: 0.95rem;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.header-nav a {
  color: var(--text2);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}

.header-nav a:hover { color: var(--text); background: var(--surface); }
.header-nav a.active { color: var(--text); background: var(--surface2); }

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 99px;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background 0.15s, transform 0.1s;
}

.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }

/* ── HERO ── */
.hero {
  background: radial-gradient(ellipse 80% 60% at 50% -10%, rgba(124,58,237,0.18) 0%, transparent 70%);
  padding: 56px 24px 40px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(124,58,237,0.15);
  border: 1px solid rgba(124,58,237,0.3);
  color: #a78bfa;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 99px;
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -1.5px;
  margin-bottom: 16px;
}

.hero h1 .grad {
  background: linear-gradient(135deg, #a78bfa 0%, #06b6d4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--text2);
  font-size: 1.05rem;
  max-width: 480px;
  margin: 0 auto 32px;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 36px;
}

.stat { text-align: center; }
.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}
.stat-label { font-size: 0.8rem; color: var(--text3); margin-top: 2px; }

/* ── CATEGORY STRIP ── */
.cat-strip {
  display: flex;
  gap: 8px;
  padding: 20px 24px;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1280px;
  margin: 0 auto;
}
.cat-strip::-webkit-scrollbar { display: none; }

.cat-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 16px;
  border-radius: 99px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.15s;
  flex-shrink: 0;
}
.cat-pill:hover { border-color: rgba(124,58,237,0.4); color: var(--text); background: var(--surface2); }
.cat-pill.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.cat-pill .cat-icon { font-size: 1rem; }

/* ── MAIN LAYOUT ── */
.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 64px;
}

/* ── SECTION HEADER ── */
.sec-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.sec-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sec-title::before {
  content: '';
  width: 4px; height: 20px;
  background: linear-gradient(to bottom, var(--accent), var(--accent2));
  border-radius: 99px;
  display: block;
}

.sec-link {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.15s;
}
.sec-link:hover { color: var(--accent2); }

/* ── FEATURED ROW (horizontal scroll) ── */
.featured-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 48px;
}
.featured-row::-webkit-scrollbar { display: none; }

.featured-card {
  flex-shrink: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}
.featured-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 48px rgba(124,58,237,0.2);
  border-color: rgba(124,58,237,0.35);
}

.featured-thumb {
  height: 160px;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  position: relative;
  overflow: hidden;
}
.featured-thumb img { width: 100%; height: 100%; object-fit: cover; }

.featured-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.featured-info { padding: 14px 16px 16px; }
.featured-title { font-size: 1rem; font-weight: 700; margin-bottom: 6px; }
.featured-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text2);
}

.rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #f59e0b;
  font-weight: 600;
}

/* ── GAME GRID ── */
.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 48px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(124,58,237,0.18);
  border-color: rgba(124,58,237,0.3);
}

.game-thumb {
  aspect-ratio: 4/3;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.8rem;
  position: relative;
  overflow: hidden;
}
.game-thumb img { width: 100%; height: 100%; object-fit: cover; }

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.game-card:hover .play-overlay { opacity: 1; }

.play-circle {
  width: 44px; height: 44px;
  background: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 24px rgba(124,58,237,0.6);
}
.play-circle::after {
  content: '';
  border: 8px solid transparent;
  border-left: 14px solid white;
  margin-left: 3px;
}

.game-info { padding: 10px 12px 12px; }
.game-title {
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.game-cat {
  font-size: 0.75rem;
  color: var(--text3);
}

/* ── EMPTY STATE ── */
.empty {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 0;
  color: var(--text3);
}
.empty p { margin-top: 12px; font-size: 0.95rem; }

/* ── BANNER AD ZONE ── */
.ad-banner {
  background: linear-gradient(135deg, rgba(124,58,237,0.08), rgba(6,182,212,0.06));
  border: 1px dashed rgba(124,58,237,0.2);
  border-radius: var(--radius);
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text3);
  font-size: 0.8rem;
  margin-bottom: 32px;
  letter-spacing: 0.05em;
}

/* ── FOOTER ── */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 40px 24px;
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.footer-brand p {
  color: var(--text2);
  font-size: 0.875rem;
  margin-top: 12px;
  max-width: 260px;
  line-height: 1.6;
}
.footer-col h4 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text3);
  margin-bottom: 14px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 10px; }
.footer-col a {
  color: var(--text2);
  font-size: 0.875rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: var(--text); }

.footer-bottom {
  max-width: 1280px;
  margin: 28px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text3);
}

/* ── GAME PLAYER PAGE ── */
.player-wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text2);
  margin-bottom: 20px;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb span { color: var(--text3); }

.player-layout {
  display: block;
}

.player-main {}

.player-frame {
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
  aspect-ratio: 16/9;
  width: 100%;
  min-height: 360px;
  max-height: 80vh;
}
.player-frame iframe {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}
/* Scale-to-fit mode: iframe uses its natural size, scaled up to fill container */
.player-frame.scaled {
  overflow: visible;
}
.player-frame.scaled iframe {
  position: static;
  transform-origin: top left;
}

.more-games-section {
  margin-top: 40px;
}

.player-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.ctrl-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}
.ctrl-btn:hover { background: var(--surface2); color: var(--text); border-color: rgba(124,58,237,0.3); }
.ctrl-btn.full { margin-left: auto; }

.player-info { margin-top: 20px; }
.player-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 8px; }
.player-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text2);
}
.tag-pill {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.78rem;
}

.player-sidebar {}
.sidebar-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.sidebar-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 14px;
}
.sidebar-game {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.sidebar-game:hover { background: var(--surface2); }
.sidebar-thumb {
  width: 52px; height: 40px;
  background: var(--surface2);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.sidebar-game-title { font-size: 0.85rem; font-weight: 600; }
.sidebar-game-cat { font-size: 0.75rem; color: var(--text3); }

/* ── LOADING SKELETON ── */
@keyframes shimmer {
  from { background-position: -600px 0; }
  to   { background-position:  600px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface2) 50%, var(--surface) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 6px;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .header { padding: 0 16px; gap: 12px; }
  .header-nav { display: none; }
  .hero { padding: 36px 16px 28px; }
  .hero-stats { gap: 24px; }
  .main { padding: 0 16px 48px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .footer-inner { grid-template-columns: 1fr; }
  .player-frame { aspect-ratio: 4/3; }
}
