/* =========================================================
   GameVerse Clean Cyberpunk Dark UI
========================================================= */
:root {
  --bg-main: #0a0b10;
  --bg-card: rgba(18, 20, 30, 0.85);
  --bg-elevated: #1a1d2e;
  --border: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 240, 255, 0.35);
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  --cyan: #00f0ff;
  --purple: #a855f7;
  --pink: #ec4899;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg-main);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.15) 0%, transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(0, 240, 255, 0.12) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(236, 72, 153, 0.08) 0%, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }

/* Container */
.container {
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(16px);
  background: rgba(10, 11, 16, 0.88);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--cyan), var(--purple), var(--pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.logo-icon {
  font-size: 1.8rem;
  -webkit-text-fill-color: initial;
}

.search-box {
  flex: 1;
  max-width: 480px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 12px 18px 12px 42px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(26, 29, 46, 0.7);
  color: var(--text-main);
  font-size: 0.95rem;
  transition: var(--transition);
}
[dir="rtl"] .search-box input {
  padding: 12px 42px 12px 18px;
}
.search-box input:focus {
  outline: none;
  border-color: var(--cyan);
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.25);
  background: rgba(26, 29, 46, 0.95);
}
.search-icon {
  position: absolute;
  top: 50%;
  left: 16px;
  transform: translateY(-50%);
  color: var(--text-dim);
  pointer-events: none;
}
[dir="rtl"] .search-icon {
  left: auto;
  right: 16px;
}

.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 700;
  transition: var(--transition);
}
.lang-btn:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 12px var(--cyan);
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 40px 0 24px;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.3);
  color: var(--cyan);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
}
.hero h1 {
  font-size: 2.8rem;
  font-weight: 900;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #ffffff 30%, #38bdf8 70%, #a855f7 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero p {
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.1rem;
}

/* Category Pills */
.category-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0 20px;
  scrollbar-width: none;
}
.category-bar::-webkit-scrollbar { display: none; }
.cat-pill {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(26, 29, 46, 0.6);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: var(--transition);
  cursor: pointer;
}
.cat-pill:hover, .cat-pill.active {
  background: linear-gradient(135deg, rgba(0, 240, 255, 0.2), rgba(168, 85, 247, 0.2));
  border-color: var(--cyan);
  color: #fff;
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.25);
  transform: translateY(-2px);
}

/* Games Grid */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 22px;
  margin: 16px 0 40px;
}
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}
.game-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--cyan);
  box-shadow: 0 12px 30px rgba(0, 240, 255, 0.25);
}
.game-thumb-wrap {
  position: relative;
  aspect-ratio: 16/10;
  background: #111420;
  overflow: hidden;
}
.game-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.game-card:hover .game-thumb {
  transform: scale(1.06);
}
.game-cat-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  font-size: 0.75rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.1);
}
[dir="rtl"] .game-cat-badge {
  right: auto;
  left: 10px;
}

.game-info {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.game-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.game-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.play-btn {
  display: block;
  text-align: center;
  background: linear-gradient(135deg, var(--cyan), #0284c7);
  color: #000;
  font-weight: 800;
  font-size: 0.9rem;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.play-btn:hover {
  box-shadow: 0 0 15px var(--cyan);
  color: #000;
}

/* Game Play Viewport Page */
.play-shell {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 0;
}
.game-frame-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 78vh;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(0, 240, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
.game-frame {
  width: 100%;
  height: 100%;
  border: none;
}
.game-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  background: var(--bg-card);
  padding: 16px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
}
.action-btn:hover {
  background: var(--cyan);
  color: #000;
  box-shadow: 0 0 12px var(--cyan);
}
.action-btn.primary {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  color: #fff;
  border: none;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: #08090d;
  border-top: 1px solid var(--border);
  padding: 40px 0 20px;
  color: var(--text-muted);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
}
.footer-links {
  display: flex;
  gap: 18px;
}

@media (max-width: 768px) {
  .hero h1 { font-size: 1.9rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .game-frame-wrapper { aspect-ratio: 4/3; max-height: 60vh; }
  .header-inner { flex-wrap: wrap; }
  .search-box { order: 3; max-width: 100%; width: 100%; }
}
