/* === BiteArcade Stylesheet v3.1 — Mobile-first responsive === */
:root {
  --bg: #0a0a0a;
  --bg-card: #1a1a1a;
  --bg-hover: #252525;
  --bg-elevated: #222;
  --text: #f0f0f0;
  --text-dim: #888;
  --text-muted: #666;
  --accent: #00ff88;
  --accent-dark: #00cc6a;
  --accent-glow: rgba(0, 255, 136, 0.15);
  --border: #333;
  --border-light: #444;
  --radius: 12px;
  --radius-sm: 8px;
  --max-width: 1400px;
  --shadow: 0 4px 20px rgba(0,0,0,0.4);
  --nav-height: 48px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.6;
  /* Safe area for notched phones */
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Header */
.site-header { background: #111; border-bottom: 2px solid var(--accent); position: sticky; top: 0; z-index: 100; }
.header-inner { max-width: var(--max-width); margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-img { width: 32px; height: 32px; }
.logo-text { font-size: 22px; font-weight: 800; color: var(--text); }
.logo-accent { color: var(--accent); }
.slogan { color: var(--text-dim); font-size: 13px; font-style: italic; display: none; }

/* Hamburger Toggle (hidden on desktop) */
.nav-toggle { display: block; background: none; border: none; color: var(--text); font-size: 28px; cursor: pointer; padding: 4px 8px; min-height: 44px; min-width: 44px; line-height: 1; border-radius: var(--radius-sm); transition: background 0.2s; }
.nav-toggle:hover { background: var(--bg-hover); }
.nav-toggle__icon { display: inline-block; width: 24px; height: 18px; position: relative; }
.nav-toggle__icon span { display: block; width: 100%; height: 2px; background: var(--text); position: absolute; left: 0; transition: all 0.3s; border-radius: 1px; }
.nav-toggle__icon span:nth-child(1) { top: 0; }
.nav-toggle__icon span:nth-child(2) { top: 8px; }
.nav-toggle__icon span:nth-child(3) { top: 16px; }
.nav-toggle.active .nav-toggle__icon span:nth-child(1) { top: 8px; transform: rotate(45deg); }
.nav-toggle.active .nav-toggle__icon span:nth-child(2) { opacity: 0; }
.nav-toggle.active .nav-toggle__icon span:nth-child(3) { top: 8px; transform: rotate(-45deg); }

/* Navigation — mobile: vertical dropdown; desktop: horizontal tabs */
.main-nav { background: #161616; border-bottom: 1px solid var(--border); }
.nav-inner { max-width: var(--max-width); margin: 0 auto; padding: 0 16px; display: none; flex-direction: column; gap: 0; }
.nav-inner.open { display: flex; }
.nav-inner a { color: var(--text-dim); text-decoration: none; padding: 10px 16px; font-size: 14px; font-weight: 500; transition: color 0.2s, background 0.2s; border-left: 3px solid transparent; min-height: 44px; display: flex; align-items: center; }
.nav-inner a:hover, .nav-inner a.active { color: var(--accent); background: var(--bg-hover); border-left-color: var(--accent); }

/* Main */
main { max-width: var(--max-width); margin: 0 auto; padding: 16px 12px; }

/* Hero */
.hero { text-align: center; padding: 20px 0 16px; }
.hero h1 { font-size: 24px; margin-bottom: 8px; line-height: 1.2; }
.hero p { color: var(--text-dim); font-size: 14px; margin-bottom: 12px; }

/* Value Props */
.value-props { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.value-tag { background: var(--bg-card); color: var(--accent); padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; border: 1px solid var(--border-light); white-space: nowrap; }

/* Section headers */
.section-header { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 12px; }
.section-header h2 { font-size: 18px; }
.see-all { color: var(--accent); text-decoration: none; font-size: 13px; }

/* Category Header */
.category-header { margin-bottom: 16px; }
.category-header h1 { font-size: 22px; margin-bottom: 6px; }
.category-subtitle { color: var(--text-dim); font-size: 14px; max-width: 700px; }
.category-header .value-props { justify-content: flex-start; margin-top: 8px; }

/* Sort Bar */
.sort-bar { display: flex; align-items: center; gap: 6px; margin-bottom: 16px; padding: 8px 12px; background: var(--bg-card); border-radius: var(--radius-sm); flex-wrap: wrap; }
.sort-label { color: var(--text-dim); font-size: 13px; font-weight: 600; }
.sort-btn { background: transparent; color: var(--text-dim); border: 1px solid var(--border); padding: 6px 12px; border-radius: 20px; cursor: pointer; font-size: 12px; font-weight: 500; transition: all 0.2s; min-height: 36px; }
.sort-btn:hover { color: var(--text); border-color: var(--border-light); }
.sort-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }

/* Game grid */
.game-grid-section { margin-bottom: 16px; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

/* Game card — touch-friendly */
.game-card { display: block; background: var(--bg-card); border-radius: var(--radius-sm); overflow: hidden; text-decoration: none; transition: transform 0.2s, background 0.2s, box-shadow 0.2s; border: 1px solid transparent; }
.game-card:hover { transform: translateY(-2px); background: var(--bg-hover); border-color: var(--accent); box-shadow: var(--shadow); }
.game-card__img-wrap { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.game-card__cover { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.game-card:hover .game-card__cover { transform: scale(1.05); }
.game-card__title { padding: 6px 8px 2px; font-size: 12px; font-weight: 600; color: var(--text); line-height: 1.3; }
.game-card__category { display: block; padding: 0 8px 6px; font-size: 10px; color: var(--accent); text-transform: uppercase; }

/* Breadcrumbs */
.breadcrumbs { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.breadcrumbs a { color: var(--accent); text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }
.breadcrumbs .sep { margin: 0 4px; color: var(--text-muted); }

/* Pagination */
.pagination { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 16px 0; flex-wrap: wrap; }
.page-btn { display: inline-block; padding: 8px 12px; background: var(--bg-card); color: var(--text-dim); text-decoration: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; transition: all 0.2s; border: 1px solid var(--border); min-height: 44px; min-width: 44px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.page-btn:hover { background: var(--bg-hover); color: var(--text); }
.page-btn.active { background: var(--accent); color: #000; border-color: var(--accent); }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; }

/* Game Page */
.game-page .game-title-bar { margin-bottom: 12px; }
.game-page h1 { font-size: 20px; margin-bottom: 6px; }
.game-info-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-item { font-size: 12px; color: var(--text-dim); }
.meta-rating { color: #ffd700; font-weight: 600; }

/* Game Play Area - Full width, no sidebar */
.game-play-area { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }

/* Game Player — mobile: 55vh (compact, leaves room for controls); desktop: 80vh */
.game-player-wrap { margin-bottom: 0; }
.game-player { background: #000; border-radius: var(--radius-sm); overflow: hidden; position: relative; width: 100%; height: 55vh; min-height: 300px; max-height: 600px; }
.game-cover { width: 100%; height: 100%; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; position: relative; }
.game-cover::before { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); }
.play-now-btn { position: relative; z-index: 1; background: var(--accent); color: #000; border: none; padding: 14px 32px; border-radius: 50px; font-size: 18px; font-weight: 700; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: transform 0.2s, box-shadow 0.2s; box-shadow: 0 4px 20px var(--accent-glow); min-height: 44px; }
.play-now-btn:hover { transform: scale(1.05); box-shadow: 0 6px 30px var(--accent-glow); }
.play-icon { font-size: 20px; }
.game-iframe { width: 100%; height: 100%; border: none; display: none; }

/* Game Loading Overlay - hides iDev.games cookie popup */
.game-loading-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.92); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 10; color: var(--text); }
.loading-spinner { width: 48px; height: 48px; border: 4px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.loading-subtext { font-size: 13px; color: var(--text-dim); margin-bottom: 20px; }
.loading-progress { width: 200px; max-width: 80%; height: 4px; background: var(--border); border-radius: 2px; overflow: hidden; }
.loading-progress-bar { height: 100%; background: var(--accent); border-radius: 2px; width: 0%; }

/* Game Controls Bar — touch-friendly buttons */
.game-controls-bar { display: flex; gap: 6px; padding: 8px 0; flex-wrap: wrap; }
.control-btn { background: var(--bg-card); color: var(--text-dim); border: 1px solid var(--border); padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-weight: 600; transition: all 0.2s; min-height: 40px; display: flex; align-items: center; }
.control-btn:hover { background: var(--bg-hover); color: var(--text); border-color: var(--border-light); }
.control-btn.favorited { background: var(--accent); color: #000; border-color: var(--accent); }
.control-btn--restart { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 700; }
.control-btn--restart:hover { background: #5ad44f; }

/* Game Description — compact on mobile */
.game-description { margin: 16px 0; padding: 16px; background: var(--bg-card); border-radius: var(--radius-sm); }
.game-description h2 { font-size: 16px; margin-bottom: 12px; }
.gameplay-section h3, .controls-section h3 { font-size: 14px; margin: 12px 0 6px; color: var(--accent); }
.gameplay-section p { color: var(--text-dim); margin-bottom: 8px; line-height: 1.6; }

/* Controls Grid */
.controls-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.control-col h4 { font-size: 13px; margin-bottom: 6px; }
.control-col ul { list-style: none; padding: 0; }
.control-col li { padding: 3px 0 3px 14px; position: relative; font-size: 12px; color: var(--text-dim); }
.control-col li::before { content: '▸'; position: absolute; left: 0; color: var(--accent); }

/* FAQ Section */
.faq-section { margin: 16px 0; padding: 16px; background: var(--bg-card); border-radius: var(--radius-sm); }
.faq-section h2 { font-size: 16px; margin-bottom: 12px; }
.faq-item { border-bottom: 1px solid var(--border); padding: 10px 0; }
.faq-item:last-child { border-bottom: none; }
.faq-item summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--text); padding: 4px 0; list-style: none; position: relative; padding-left: 20px; min-height: 44px; display: flex; align-items: center; }
.faq-item summary::before { content: '+'; position: absolute; left: 0; color: var(--accent); font-weight: 700; font-size: 16px; }
.faq-item[open] summary::before { content: '−'; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { padding: 6px 0 4px 20px; color: var(--text-dim); font-size: 13px; line-height: 1.6; }

/* Sidebar — hidden on mobile */
.game-sidebar { display: none; flex-direction: column; gap: 16px; }
.sidebar-tags h3, .sidebar-dev h3 { font-size: 14px; margin-bottom: 8px; color: var(--accent); }
.sidebar-dev p { color: var(--text-dim); font-size: 14px; }

/* Ad Zone */
.ad-zone { background: var(--bg-card); border: 1px dashed var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; justify-content: center; min-height: 250px; }
.ad-300x250 { min-height: 250px; }
.ad-placeholder { color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }

/* Related games */
.related-games { margin: 24px 0; }
.related-games h2 { font-size: 16px; margin-bottom: 12px; }

/* Category tags */
.category-tags { margin: 16px 0; }
.category-tags h2 { font-size: 16px; margin-bottom: 8px; }

/* Related categories */
.related-categories { margin: 24px 0; }
.related-categories h2 { font-size: 16px; margin-bottom: 8px; }

/* Tag cloud */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-link { background: var(--bg-card); color: var(--text-dim); padding: 6px 12px; border-radius: 20px; text-decoration: none; font-size: 12px; transition: all 0.2s; }
.tag-link:hover { background: var(--accent); color: #000; }

/* SEO text */
.seo-text { margin: 24px 0; padding: 16px; background: var(--bg-card); border-radius: var(--radius-sm); }
.seo-text h2 { font-size: 16px; margin-bottom: 8px; }
.seo-text p { color: var(--text-dim); margin-bottom: 8px; font-size: 13px; line-height: 1.6; }
.seo-text a { color: var(--accent); text-decoration: none; }
.seo-text a:hover { text-decoration: underline; }

/* Content pages */
.content-page { max-width: 800px; }
.content-section { margin: 16px 0; padding: 16px; background: var(--bg-card); border-radius: var(--radius-sm); }
.content-section h2 { font-size: 16px; margin-bottom: 8px; }
.content-section ul { padding-left: 20px; margin: 8px 0; }
.content-section li { margin-bottom: 6px; color: var(--text-dim); }
.content-section a { color: var(--accent); }

/* Footer */
.site-footer { background: #111; border-top: 2px solid var(--accent); margin-top: 32px; }
.footer-inner { max-width: var(--max-width); margin: 0 auto; padding: 24px 16px; display: grid; grid-template-columns: 1fr; gap: 16px; }
.footer-col h4 { font-size: 13px; margin-bottom: 8px; color: var(--accent); }
.footer-col p { color: var(--text-dim); font-size: 12px; }
.footer-col a { display: block; color: var(--text-dim); text-decoration: none; font-size: 12px; padding: 2px 0; min-height: 44px; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid var(--border); padding: 12px 16px; text-align: center; }
.footer-bottom p { color: var(--text-dim); font-size: 11px; }

/* =============================================
   DESKTOP BREAKPOINTS — progressive enhancement
   ============================================= */

/* ≥ 600px — Small tablets / large phones landscape */
@media (min-width: 600px) {
  .game-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .game-card__title { font-size: 13px; }
  .game-card__category { font-size: 11px; }
  .hero { padding: 28px 0 20px; }
  .hero h1 { font-size: 28px; }
  .hero p { font-size: 16px; }
  .value-tag { padding: 6px 14px; font-size: 12px; }
  .game-player { height: 65vh; min-height: 400px; max-height: none; }
  .game-description { padding: 20px; }
  .faq-section { padding: 20px; }
  main { padding: 20px 16px; }
}

/* ≥ 768px — Tablets */
@media (min-width: 768px) {
  /* Desktop navigation — horizontal tabs */
  .nav-toggle { display: none; }
  .nav-inner { display: flex !important; flex-direction: row; gap: 4px; overflow-x: auto; scrollbar-width: thin; padding: 0 16px; }
  .nav-inner a { padding: 12px 16px; white-space: nowrap; border-radius: var(--radius-sm) var(--radius-sm) 0 0; border-left: none; font-size: 14px; }
  .nav-inner a:hover, .nav-inner a.active { border-left-color: transparent; }

  .slogan { display: block; }
  .header-inner { padding: 16px 20px; }
  .logo-img { width: 40px; height: 40px; }
  .logo-text { font-size: 28px; }
  .game-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
  .game-card { border-radius: var(--radius); }
  .game-card__title { font-size: 13px; padding: 8px 10px 4px; }
  .game-card__category { font-size: 11px; padding: 0 10px 8px; }
  .hero { padding: 40px 0 24px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 17px; }
  .value-tag { font-size: 13px; padding: 6px 16px; }
  .section-header h2 { font-size: 22px; }
  .category-header h1 { font-size: 28px; }
  .game-page h1 { font-size: 26px; }
  .game-player { height: 80vh; min-height: 400px; }
  .play-now-btn { padding: 16px 40px; font-size: 20px; }
  .game-description { padding: 24px; border-radius: var(--radius); }
  .game-description h2 { font-size: 20px; }
  .controls-grid { grid-template-columns: 1fr 1fr; }
  .faq-section { padding: 24px; border-radius: var(--radius); }
  .faq-section h2 { font-size: 20px; }
  .content-section { padding: 20px; border-radius: var(--radius); }
  .seo-text { padding: 24px; border-radius: var(--radius); }
  .related-games h2 { font-size: 20px; }
  main { padding: 24px 20px; }
  .footer-inner { grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding: 32px 20px; }
}

/* ≥ 1024px — Desktop — show sidebar */
@media (min-width: 1024px) {
  .game-play-area { display: grid; grid-template-columns: 1fr 280px; gap: 24px; }
  .game-sidebar { display: flex; }
  .game-player { border-radius: var(--radius); }
  .hero h1 { font-size: 36px; }
  .category-header h1 { font-size: 32px; }
  .game-page h1 { font-size: 28px; }
  .meta-item { font-size: 14px; }
}
