/* ========================================
   JojoXFun - Global Styles
   Modern dark theme, 2026 aesthetic
   ======================================== */

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

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #12121a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --border-color: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(139, 92, 246, 0.3);
  --text-primary: #f0f0f5;
  --text-secondary: #8a8a9a;
  --text-muted: #55556a;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-pink: #ec4899;
  --accent-gradient: linear-gradient(135deg, #8b5cf6, #3b82f6);
  --accent-gradient-hover: linear-gradient(135deg, #a78bfa, #60a5fa);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.15);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: 'Space Grotesk', var(--font-main);
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 1400px;
}

html {
  scroll-behavior: smooth;
}

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

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ========================================
   Background ambient glow
   ======================================== */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 20%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   Header / Navigation
   ======================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  overflow: visible;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-gradient);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.logo-text span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Search Bar */
.search-container {
  flex: 1;
  max-width: 480px;
  position: relative;
}

.search-input {
  width: 100%;
  height: 40px;
  padding: 0 16px 0 42px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: var(--transition-fast);
}

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

.search-input:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 200;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.search-result-item:hover {
  background: var(--bg-card-hover);
}

.search-result-item img {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  object-fit: cover;
}

.search-result-item .result-info h4 {
  font-size: 14px;
  font-weight: 500;
}

.search-result-item .result-info span {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

/* Language Selector */

.lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.lang-btn:hover {
  border-color: var(--accent-purple);
  color: var(--text-primary);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 160px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  padding: 6px;
  display: none;
  z-index: 9999;
}

.lang-selector {
  position: relative;
  z-index: 9999;
}

.lang-dropdown.active {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  color: var(--text-secondary);
}

.lang-option:hover,
.lang-option.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* ========================================
   Category Navigation
   ======================================== */
.category-nav {
  position: relative;
  z-index: 1;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
}

.category-nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-nav-inner::-webkit-scrollbar {
  display: none;
}

.category-link {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition-fast);
}

.category-link:hover {
  color: var(--text-primary);
}

.category-link.active {
  color: var(--accent-purple);
  border-bottom-color: var(--accent-purple);
}

/* ========================================
   Main Content
   ======================================== */
.main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px;
}

/* Ad Banners */
.ad-banner {
  width: 100%;
  min-height: 90px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 24px;
}

.ad-sidebar {
  min-height: 250px;
  width: 300px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 12px;
  flex-shrink: 0;
}

/* Featured Hero */
.featured-hero {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: 32px;
  cursor: pointer;
}

.featured-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-hero:hover img {
  transform: scale(1.05);
}

.featured-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 10, 15, 0.9) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
}

.featured-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-gradient);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  width: fit-content;
  margin-bottom: 12px;
}

.featured-hero-overlay h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.featured-hero-overlay p {
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 500px;
}

/* Section */
.section {
  margin-bottom: 40px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title .icon {
  font-size: 22px;
}

.view-all {
  font-size: 13px;
  color: var(--accent-purple);
  font-weight: 500;
  transition: var(--transition-fast);
}

.view-all:hover {
  color: var(--accent-blue);
}

/* ========================================
   Game Cards Grid
   ======================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

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

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

.game-card-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
}

.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.game-card:hover .game-card-thumb img {
  transform: scale(1.08);
}

/* Shine effect on hover */
.game-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
  transition: 0.6s;
  pointer-events: none;
}

.game-card:hover::after {
  left: 100%;
}

.game-card-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: var(--transition-fast);
}

.game-card:hover .game-card-play {
  opacity: 1;
}

.play-btn {
  width: 48px;
  height: 48px;
  background: var(--accent-gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0.8);
  transition: var(--transition-smooth);
}

.game-card:hover .play-btn {
  transform: scale(1);
}

.play-btn svg {
  width: 20px;
  height: 20px;
  fill: white;
  margin-left: 2px;
}

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

.game-card-title {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.game-card-category {
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   Game Page Layout
   ======================================== */
.game-page {
  display: flex;
  gap: 24px;
}

.game-page-main {
  flex: 1;
  min-width: 0;
}

.game-page-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.game-container {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 20px;
  position: relative;
}

.game-container iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.game-container .fullscreen-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  z-index: 10;
}

.game-container .fullscreen-btn:hover {
  background: rgba(139, 92, 246, 0.6);
}

.game-info-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.game-info-panel h1 {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.game-meta {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

.game-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.game-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.7;
}

.game-controls {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.game-controls h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
}

.game-controls p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================
   Footer
   ======================================== */
.footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 40px 24px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 12px;
  line-height: 1.7;
}

.footer-section h4 {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.footer-section a {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  transition: var(--transition-fast);
}

.footer-section a:hover {
  color: var(--text-primary);
}

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

/* ========================================
   Static Pages (About, Privacy, etc.)
   ======================================== */
.static-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px;
}

.static-page h1 {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}

.static-page .subtitle {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

.static-page h2 {
  font-size: 20px;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 12px;
}

.static-page p, .static-page li {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 12px;
}

.static-page ul {
  padding-left: 20px;
}

.static-page a {
  color: var(--accent-purple);
}

.static-page a:hover {
  text-decoration: underline;
}

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

.form-group input,
.form-group textarea {
  padding: 12px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: var(--transition-fast);
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group textarea {
  min-height: 120px;
  resize: vertical;
}

.submit-btn {
  padding: 12px 24px;
  background: var(--accent-gradient);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  width: fit-content;
}

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

/* ========================================
   Responsive Design
   ======================================== */

/* Safe area for notched / pill-shaped screens */
@supports (padding: env(safe-area-inset-top)) {
  .header { padding-top: env(safe-area-inset-top); }
  .mobile-bottom-nav { padding-bottom: env(safe-area-inset-bottom); }
  .main { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
}

/* Tablet */
@media (max-width: 1024px) {
  .game-page {
    flex-direction: column;
  }
  .game-page-sidebar {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .ad-sidebar {
    width: 100%;
    min-height: 100px;
  }
  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .header-inner {
    padding: 0 12px;
    height: 52px;
  }
  .logo {
    font-size: 18px;
  }
  .logo-icon {
    width: 30px;
    height: 30px;
    font-size: 15px;
  }
  .search-container {
    display: none;
  }
  .main {
    padding: 12px;
    padding-bottom: 80px; /* space for bottom nav */
  }
  .games-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .featured-hero {
    height: 180px;
    border-radius: var(--radius-md);
  }
  .featured-hero-overlay {
    padding: 16px;
  }
  .featured-hero-overlay h2 {
    font-size: 18px;
  }
  .featured-hero-overlay p {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .featured-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
  .section-title {
    font-size: 16px;
  }
  .section-header {
    margin-bottom: 14px;
  }
  .section {
    margin-bottom: 28px;
  }
  .ad-banner {
    min-height: 60px;
    margin-bottom: 16px;
  }

  /* Game detail page mobile */
  .game-container {
    aspect-ratio: 4/3; /* taller for mobile */
    border-radius: var(--radius-md);
    margin-left: -12px;
    margin-right: -12px;
    width: calc(100% + 24px);
    border-radius: 0;
    margin-bottom: 16px;
  }
  .game-info-panel {
    padding: 16px;
    border-radius: var(--radius-md);
  }
  .game-info-panel h1 {
    font-size: 20px;
  }
  .game-container .fullscreen-btn {
    width: 44px;
    height: 44px;
    bottom: 8px;
    right: 8px;
  }

  /* Footer mobile */
  .footer {
    margin-top: 32px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 24px 16px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 16px;
    margin-bottom: 60px; /* above bottom nav */
  }

  /* Category nav scrollable */
  .category-nav-inner {
    padding: 0 12px;
    gap: 2px;
    -webkit-overflow-scrolling: touch;
  }
  .category-link {
    padding: 10px 12px;
    font-size: 12px;
  }

  /* Touch-friendly: always show play overlay on mobile */
  .game-card-play {
    opacity: 1;
    background: rgba(0, 0, 0, 0.25);
  }
  .play-btn {
    transform: scale(0.85);
    width: 40px;
    height: 40px;
  }
  .play-btn svg {
    width: 16px;
    height: 16px;
  }

  /* Card touch active state */
  .game-card:active {
    transform: scale(0.96);
  }
  .game-card:hover {
    transform: none; /* disable hover transform on touch */
  }

  /* Static pages mobile */
  .static-page {
    padding: 24px 16px;
    padding-bottom: 80px;
  }
  .static-page h1 {
    font-size: 24px;
  }
  .static-page h2 {
    font-size: 18px;
    margin-top: 24px;
  }
}

/* Small phones */
@media (max-width: 380px) {
  .games-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .game-card-info {
    padding: 6px 8px;
  }
  .game-card-title {
    font-size: 11px;
  }
  .game-card-category {
    font-size: 10px;
  }
  .featured-hero {
    height: 140px;
  }
  .header-inner {
    height: 48px;
  }
  .logo {
    font-size: 16px;
  }
  .logo-icon {
    width: 26px;
    height: 26px;
    font-size: 13px;
  }
}

/* ========================================
   Mobile Bottom Navigation Bar
   ======================================== */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  padding: 6px 0;
}

.mobile-bottom-nav-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  transition: var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item.active {
  color: var(--accent-purple);
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.mobile-nav-item span {
  line-height: 1;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: block;
  }
}

/* Mobile search toggle */
.mobile-search-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  -webkit-tap-highlight-color: transparent;
}

@media (max-width: 768px) {
  .mobile-search-btn {
    display: flex;
  }
}

/* Mobile search overlay */
.mobile-search-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 300;
  background: var(--bg-primary);
  padding: 16px;
  flex-direction: column;
}

.mobile-search-overlay.active {
  display: flex;
}

.mobile-search-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.mobile-search-overlay .search-input {
  flex: 1;
  height: 48px;
  font-size: 16px; /* prevents iOS zoom on focus */
  border-radius: var(--radius-md);
  padding: 0 16px;
}

.mobile-search-close {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 16px;
  cursor: pointer;
  padding: 8px 4px;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.mobile-search-results {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.mobile-search-results .search-result-item {
  padding: 14px 8px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-search-results .search-result-item img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
}

.mobile-search-results .result-info h4 {
  font-size: 15px;
}

.mobile-search-results .result-info span {
  font-size: 13px;
}

/* ========================================
   Touch optimizations
   ======================================== */
@media (hover: none) and (pointer: coarse) {
  /* Touch devices: disable hover effects, use active states */
  .game-card:hover {
    transform: none;
    border-color: var(--border-color);
    box-shadow: none;
  }
  .game-card:active {
    transform: scale(0.97);
    border-color: var(--border-glow);
  }
  .game-card:hover .game-card-thumb img {
    transform: none;
  }
  .game-card::after {
    display: none; /* disable shine effect on touch */
  }
  /* Always visible play button on touch */
  .game-card-play {
    opacity: 1;
    background: rgba(0, 0, 0, 0.2);
  }
  .play-btn {
    transform: scale(0.8);
  }

  /* Bigger touch targets */
  .category-link {
    padding: 12px 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .lang-btn {
    min-height: 44px;
  }
  .lang-option {
    padding: 12px 14px;
    min-height: 44px;
  }
  .view-all {
    padding: 8px 12px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
}

/* Landscape phone: game fills more screen */
@media (max-width: 768px) and (orientation: landscape) {
  .game-container {
    aspect-ratio: 16/9;
    margin-left: -12px;
    margin-right: -12px;
    width: calc(100% + 24px);
  }
  .main {
    padding-top: 8px;
  }
  .header-inner {
    height: 44px;
  }
  .mobile-bottom-nav {
    display: none; /* hide in landscape to maximize game view */
  }
}

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

@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========================================
   Scrollbar
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}
