/* ============================================
   RehaVerse Games - Gaming Portal Stylesheet
   ============================================ */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-primary: #0a0a1a;
  --bg-secondary: #12122a;
  --bg-card: #1a1a3e;
  --bg-card-hover: #24245a;
  --accent-primary: #7c3aed;
  --accent-secondary: #a855f7;
  --accent-glow: rgba(124, 58, 237, 0.3);
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-pink: #ec4899;
  --accent-blue: #3b82f6;
  --accent-red: #ef4444;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-color: rgba(124, 58, 237, 0.2);
  --shadow-glow: 0 0 20px rgba(124, 58, 237, 0.15);
  --radius: 12px;
  --radius-lg: 16px;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

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

/* --- Utilities --- */
.container { max-width: 1320px; margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }

/* --- Header & Navigation --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 26, 0.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1320px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-pink));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-glow);
}

.logo-text span {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-pink));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-links a.premium-link {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
  font-weight: 700;
}

.nav-links a.premium-link:hover {
  opacity: 0.9;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px 14px;
  gap: 8px;
  width: 280px;
  transition: var(--transition);
}

.search-bar:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.search-bar input {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.9rem;
  width: 100%;
  outline: none;
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-icon { color: var(--text-muted); font-size: 1rem; }

.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  color: var(--text-primary);
  padding: 4px;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  padding: 60px 20px;
  text-align: center;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  margin-bottom: 14px;
  position: relative;
}

.hero h1 .highlight {
  background: linear-gradient(135deg, var(--accent-secondary), var(--accent-pink), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto 28px;
  position: relative;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  position: relative;
}

.hero-stat {
  text-align: center;
}

.hero-stat .number {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-secondary);
}

.hero-stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Category Tabs --- */
.category-section { padding: 0 20px 30px; }

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
  max-width: 1320px;
  margin: 0 auto;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar { display: none; }

.category-tab {
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid transparent;
  transition: var(--transition);
}

.category-tab:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.category-tab.active {
  background: var(--accent-primary);
  color: #fff;
  border-color: var(--accent-secondary);
  box-shadow: var(--shadow-glow);
}

.category-tab .emoji { margin-right: 6px; }

/* --- Games Grid --- */
.games-section {
  padding: 10px 20px 60px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto 20px;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
}

.section-header a {
  color: var(--accent-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-width: 1320px;
  margin: 0 auto;
}

.game-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid transparent;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
}

.game-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.game-card:hover .game-thumb::after {
  opacity: 1;
}

.game-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  position: relative;
  overflow: hidden;
}

.game-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder for games without images */
.game-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  font-family: var(--font-display);
  color: rgba(255,255,255,0.9);
}

.game-thumb::after {
  content: '▶ PLAY';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 58, 237, 0.7);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 2px;
  opacity: 0;
  transition: var(--transition);
}

.game-info {
  padding: 12px 14px;
}

.game-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.game-tag {
  padding: 2px 8px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(124, 58, 237, 0.15);
  color: var(--accent-secondary);
}

.game-rating {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Featured game card */
.game-card.featured {
  grid-column: span 2;
  grid-row: span 2;
}

.game-card.featured .game-thumb {
  aspect-ratio: auto;
  height: 100%;
  min-height: 300px;
}

.game-card.featured .game-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(10, 10, 26, 0.95));
  padding: 40px 20px 20px;
}

.game-card.featured .game-title { font-size: 1.3rem; }

.featured-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  z-index: 2;
}

/* --- Ad Banner --- */
.ad-banner {
  max-width: 1320px;
  margin: 0 auto 40px;
  padding: 0 20px;
}

.ad-placeholder {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Game Player Page --- */
.game-player-section {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px;
}

.game-player-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.game-iframe {
  width: 100%;
  border: none;
  display: block;
}

.game-player-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--bg-secondary);
}

.game-player-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.control-buttons {
  display: flex;
  gap: 10px;
}

.control-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-card);
  color: var(--text-secondary);
  transition: var(--transition);
}

.control-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.fullscreen-btn {
  background: var(--accent-primary);
  color: #fff;
}

.fullscreen-btn:hover {
  background: var(--accent-secondary);
}

.game-details-panel {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 24px;
  margin-top: 24px;
}

.game-description h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 12px;
}

.game-description p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 16px;
}

.game-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.game-tags .tag {
  padding: 6px 14px;
  background: var(--bg-card);
  border-radius: 50px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.sidebar-ad {
  background: var(--bg-secondary);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  min-height: 600px;
}

/* --- Premium Section --- */
.premium-section {
  padding: 80px 20px;
  text-align: center;
}

.premium-section h2 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 12px;
}

.premium-section h2 .gold {
  color: var(--accent-gold);
}

.premium-section > p {
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto 40px;
}

.pricing-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.pricing-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  border: 1px solid var(--border-color);
  text-align: left;
  transition: var(--transition);
}

.pricing-card:hover {
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.pricing-card.popular {
  border-color: var(--accent-gold);
  position: relative;
}

.pricing-card.popular::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
  padding: 4px 16px;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 1px;
}

.pricing-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.pricing-price {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.pricing-price span {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 400;
}

.pricing-period {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.pricing-features {
  margin-bottom: 28px;
}

.pricing-features li {
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.pricing-features li::before {
  content: '✓';
  color: var(--accent-green);
  font-weight: 700;
}

.pricing-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
  transition: var(--transition);
}

.pricing-btn.primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: #fff;
}

.pricing-btn.gold {
  background: linear-gradient(135deg, var(--accent-gold), #d97706);
  color: #000;
}

.pricing-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* --- Donate Section --- */
.donate-section {
  padding: 60px 20px;
  text-align: center;
}

.donate-card {
  max-width: 600px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  border: 1px solid var(--border-color);
}

.donate-card h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  margin-bottom: 12px;
}

.donate-card p {
  color: var(--text-secondary);
  margin-bottom: 24px;
}

.donate-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.donate-btn {
  padding: 12px 24px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.95rem;
  transition: var(--transition);
}

.donate-btn.small { background: var(--bg-card-hover); color: var(--text-primary); }
.donate-btn.medium { background: var(--accent-primary); color: #fff; }
.donate-btn.large { background: linear-gradient(135deg, var(--accent-gold), #d97706); color: #000; }
.donate-btn:hover { transform: translateY(-2px); opacity: 0.9; }

/* --- Footer --- */
.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 40px 20px;
}

.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
  line-height: 1.6;
}

.footer-col h4 {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-col a {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 4px 0;
  transition: var(--transition);
}

.footer-col a:hover { color: var(--accent-secondary); }

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

.footer-social {
  display: flex;
  gap: 12px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  font-size: 1rem;
}

.footer-social a:hover {
  background: var(--accent-primary);
  color: #fff;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .game-details-panel { grid-template-columns: 1fr; }
  .game-card.featured { grid-column: span 1; grid-row: span 1; }
  .game-card.featured .game-thumb { min-height: 180px; }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 2rem; }
  .hero p { font-size: 1rem; }
  .hero-stats { gap: 24px; }
  .hero-stat .number { font-size: 1.4rem; }
  .search-bar { width: 200px; }
  .nav-links a:not(.premium-link) { display: none; }
  .mobile-menu-btn { display: block; }
  .games-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .footer-inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 12px; }
  .pricing-cards { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .hero { padding: 40px 16px; }
  .hero h1 { font-size: 1.6rem; }
  .games-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .game-info { padding: 8px 10px; }
  .game-title { font-size: 0.85rem; }
  .search-bar { width: 160px; }
  .logo { font-size: 1.2rem; }
  .logo-icon { width: 32px; height: 32px; }
}

/* --- Loading Animation --- */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading {
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb {
  background: var(--bg-card-hover);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-primary); }

/* --- About Page --- */
.about-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 60px 20px;
}

.about-section h1 {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.about-section p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.about-section h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  margin: 32px 0 12px;
}

/* --- Mobile nav overlay --- */
.mobile-nav {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 26, 0.98);
  z-index: 200;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  font-size: 1.2rem;
  font-weight: 600;
  padding: 12px 32px;
  border-radius: 10px;
}

.mobile-nav a:hover { background: var(--bg-card); }

.mobile-nav .close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 1.8rem;
  color: var(--text-primary);
}

/* --- No Results --- */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.no-results h3 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--text-secondary);
}
