/* ========================================
   Prepp Games — play202-inspired Casual Portal
   Light theme · Mobile-first · Taboola-friendly
   ======================================== */

*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

:root {
  --bg: #f5f5f7;
  --bg-card: #ffffff;
  --text: #111827;
  --text-2: #374151;
  --text-3: #6b7280;
  --text-4: #9ca3af;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --primary: #2563eb;
  --primary-2: #1d4ed8;
  --primary-soft: #dbeafe;
  --accent: #f59e0b;
  --green: #10b981;
  --red: #ef4444;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.10), 0 8px 24px rgba(0,0,0,0.06);
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

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

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER (clean, simple) ===== */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-flex {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.brand-icon {
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.brand-text {
  font-size: 19px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.4px;
  line-height: 1;
}

.brand-sub { display: none; }

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

.header-nav a {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  border-radius: 8px;
  transition: all 0.15s;
}

.header-nav a:hover { background: var(--primary-soft); color: var(--primary); }

.header-nav a.primary {
  background: var(--primary);
  color: white;
  font-weight: 700;
}

.header-nav a.primary:hover { background: var(--primary-2); color: white; }

@media (max-width: 520px) {
  .header-nav a:not(.primary) { display: none; }
}

@media (min-width: 768px) {
  .site-header { padding: 14px 0; }
  .brand-icon { width: 40px; height: 40px; font-size: 22px; border-radius: 10px; }
  .brand-text { font-size: 22px; }
  .header-nav a { padding: 9px 16px; font-size: 14px; }
}

/* ===== HERO (small, like play202) ===== */
.hero {
  text-align: center;
  padding: 18px 0 12px;
}

.hero h1 {
  font-size: clamp(20px, 4.5vw, 32px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 6px;
}

.hero p {
  font-size: clamp(13px, 2vw, 15px);
  color: var(--text-3);
  max-width: 580px;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .hero { padding: 32px 0 20px; }
}

/* Hide all hero extras (eyebrow, CTA, stats) - keep simple */
.hero-eyebrow, .hero-cta, .hero-stats, .hero-cards { display: none !important; }

/* Floating orbs / mesh - off (white theme) */
.orb { display: none; }
body::before { display: none; }

/* ===== AD SLOT (prominent for Taboola) ===== */
.ad-slot { padding: 8px 0; }

@media (min-width: 768px) {
  .ad-slot { padding: 14px 0; }
}

.ad-inner {
  background: #fafafa;
  border: 1px dashed var(--border-2);
  border-radius: var(--radius);
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-text {
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  opacity: 0.4;
  position: relative;
  z-index: 1;
}

.ad-mid .ad-inner { min-height: 130px; }
.ad-below .ad-inner { min-height: 200px; }
.ad-footer .ad-inner { min-height: 200px; }
.ad-bottom .ad-inner { min-height: 200px; }

/* === STICKY BOTTOM AD (Vertoz/AdSense banner) === */
.ad-sticky-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.10);
  padding: 6px 8px 6px 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
}

.ad-sticky-wrap.hidden { display: none; }

.ad-sticky {
  flex: 1;
  max-width: 728px;
  padding: 0;
  margin: 0;
}

.ad-sticky .ad-inner {
  min-height: 50px;
  border: 1px dashed #cbd5e1;
}

.ad-sticky-close {
  position: absolute;
  top: -14px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #1f2937;
  color: #fff;
  border: 2px solid #fff;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  z-index: 91;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  padding: 0;
  line-height: 1;
}

.ad-sticky-close:hover { background: var(--red); }

/* Add bottom padding when sticky ad is showing so it doesn't cover content */
body.has-sticky-ad { padding-bottom: 70px; }

@media (min-width: 768px) {
  .ad-sticky .ad-inner { min-height: 90px; }
  body.has-sticky-ad { padding-bottom: 110px; }
}

/* === NATIVE FEED ad (Taboola-style) === */
.ad-native-feed {
  margin-top: 24px;
  padding: 14px 0;
}

.ad-native-feed .ad-inner {
  min-height: 280px;
  flex-direction: column;
  gap: 8px;
  background: linear-gradient(180deg, #f9fafb, #f3f4f6);
  position: relative;
}

.ad-native-feed .ad-inner::after {
  content: '🔄 Discovery widget loads here when Vertoz/Taboola tag is added';
  position: absolute;
  bottom: 8px;
  font-size: 9px;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

/* ===== CATEGORY NAV ===== */
.cat-nav-wrap {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: sticky;
  top: 54px;
  z-index: 50;
}

.cat-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.cat-nav::-webkit-scrollbar { display: none; }

.cat-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  transition: all 0.15s;
  white-space: nowrap;
}

.cat-pill:hover { border-color: var(--primary); color: var(--primary); }

.cat-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

@media (min-width: 768px) {
  .cat-nav-wrap { padding: 14px 0; top: 68px; }
  .cat-pill { padding: 10px 22px; font-size: 14px; }
}

/* ===== SECTION HEADER ===== */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 10px;
  flex-wrap: wrap;
  gap: 10px;
}

.section-head h2 {
  font-size: clamp(18px, 3vw, 24px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-head .accent-bar {
  width: 4px;
  height: 22px;
  background: var(--primary);
  border-radius: 2px;
}

.badge-hot {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  background: #fff7ed;
  color: var(--accent);
  border: 1px solid #fed7aa;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

@media (min-width: 768px) {
  .section-head { margin: 28px 0 16px; }
}

/* ===== GAME GRID (2-col mobile like play202) ===== */
.games-section { padding: 4px 0 24px; scroll-margin-top: 110px; }

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 520px) { .game-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; } }
@media (min-width: 768px) { .game-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .game-grid { grid-template-columns: repeat(5, 1fr); } }
@media (min-width: 1280px) { .game-grid { grid-template-columns: repeat(6, 1fr); } }

/* ===== GAME CARD (play202 style) ===== */
.game-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  transition: all 0.2s;
  box-shadow: var(--shadow-sm);
}

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

.game-card-thumb {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f3f4f6;
}

.game-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #1a1a2e;
  transition: transform 0.3s ease;
}

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

.thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #bfdbfe);
  font-size: 40px;
}

.game-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.game-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.play-button {
  display: block;
  width: 100%;
  padding: 9px;
  background: var(--primary);
  color: white;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  transition: background 0.15s;
  margin-top: auto;
}

.play-button:hover { background: var(--primary-2); }

@media (min-width: 768px) {
  .game-card-title { font-size: 14px; }
  .play-button { font-size: 13px; padding: 10px; }
}

/* ===== DOWNLOAD BANNER (homepage CTA to preppgames.com) ===== */
.download-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: var(--radius);
  color: white;
  text-decoration: none;
  transition: all 0.2s;
  margin: 14px 0 8px;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.25);
}

.download-banner:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35); }

.download-banner-icons {
  font-size: 22px;
  flex-shrink: 0;
  letter-spacing: -2px;
}

.download-banner-text {
  flex: 1;
  min-width: 0;
}

.download-banner-title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.download-banner-sub {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 3px;
  line-height: 1.3;
}

.download-banner-cta {
  background: rgba(255,255,255,0.2);
  padding: 8px 14px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 800;
  flex-shrink: 0;
  white-space: nowrap;
  border: 1px solid rgba(255,255,255,0.3);
}

@media (min-width: 768px) {
  .download-banner { padding: 18px 24px; gap: 18px; }
  .download-banner-title { font-size: 18px; }
  .download-banner-sub { font-size: 13px; }
  .download-banner-cta { font-size: 14px; padding: 10px 18px; }
  .download-banner-icons { font-size: 28px; }
}

/* ===== FEATURES SECTION ===== */
.features-section { padding: 30px 0 20px; }

.features-section h2 {
  text-align: center;
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.features-section .subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-3);
  max-width: 580px;
  margin: 0 auto 24px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.feature-card {
  padding: 18px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.feature-icon {
  width: 44px; height: 44px;
  margin: 0 auto 10px;
  background: var(--primary-soft);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.feature-card h3 {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 4px;
  color: var(--text);
}

.feature-card p {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.5;
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-card);
  padding: 24px 0 18px;
  border-top: 1px solid var(--border);
  margin-top: 32px;
}

.footer-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--text-3);
  font-size: 13px;
  font-weight: 500;
  padding: 0 8px;
  transition: color 0.15s;
}

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

.footer-links .dot { color: var(--text-4); margin: 0 2px; }

.site-footer .copy { font-size: 12px; color: var(--text-4); }

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.game-card {
  animation: fadeInUp 0.3s ease forwards;
  opacity: 0;
}

.game-card:nth-child(1) { animation-delay: 0.02s; }
.game-card:nth-child(2) { animation-delay: 0.04s; }
.game-card:nth-child(3) { animation-delay: 0.06s; }
.game-card:nth-child(4) { animation-delay: 0.08s; }
.game-card:nth-child(5) { animation-delay: 0.10s; }
.game-card:nth-child(6) { animation-delay: 0.12s; }
.game-card:nth-child(n+7) { animation-delay: 0.14s; }

/* =========================================
   GAME DETAIL PAGE — play202 style
   ========================================= */

/* Game title at top (CAPS) */
.play202-title-wrap {
  text-align: center;
  padding: 14px 0 12px;
}

.play202-title {
  font-size: clamp(20px, 4vw, 28px);
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Game preview container — matches thumbnail aspect (4:3) when showing poster */
.play202-frame-container {
  position: relative;
  background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 380px;
  margin: 0 auto;
  aspect-ratio: 4/3;
  transition: aspect-ratio 0.3s;
}

/* When iframe is active (game playing), container becomes vertical 9:16 */
.play202-frame-container.playing {
  aspect-ratio: 9/16;
  max-height: calc(100svh - 220px);
  min-height: 520px;
  background: #000;
}

.play202-thumb-preview {
  position: absolute;
  inset: 0;
  cursor: pointer;
  transition: transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1a1a2e;
}

.play202-thumb-preview:hover { transform: scale(1.02); }

.play202-thumb-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.play202-thumb-preview.hidden { display: none; }

/* Optional play overlay icon on hover */
.play202-thumb-preview::after {
  content: '▶';
  position: absolute;
  width: 80px; height: 80px;
  background: rgba(37,99,235,0.95);
  border: 4px solid white;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  padding-left: 5px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.4);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  transform: scale(0.7);
  pointer-events: none;
}

.play202-thumb-preview:hover::after { opacity: 1; transform: scale(1); }

/* iframe wrapper inside container */
.play202-frame-wrapper {
  position: absolute;
  inset: 0;
}

.play202-frame-wrapper.hidden { display: none; }

.play202-frame-wrapper iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

@media (min-width: 768px) {
  .play202-frame-container { max-width: 480px; }
  .play202-frame-container.playing {
    max-width: 480px;
  }
}

/* Close button — only visible during gameplay */
.game-close-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  border: 2px solid rgba(255, 255, 255, 0.5);
  cursor: pointer;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.4);
  transition: all 0.15s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  padding: 0;
  line-height: 1;
}

.play202-frame-container.playing .game-close-btn {
  display: flex;
}

.game-close-btn:hover,
.game-close-btn:active {
  background: var(--red);
  border-color: #fff;
  transform: scale(1.08);
}

@media (min-width: 768px) {
  .game-close-btn { width: 42px; height: 42px; font-size: 20px; top: 12px; right: 12px; }
}

/* Yellow PLAY GAME button (the big CTA, like play202) */
.play202-cta-wrap {
  text-align: center;
  padding: 14px 0 8px;
}

.play202-cta-wrap.hidden { display: none; }

.play202-cta {
  display: inline-block;
  padding: 14px 56px;
  background: linear-gradient(180deg, #fde047, #facc15);
  color: #1a1a1a;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
  box-shadow: 0 4px 14px rgba(250, 204, 21, 0.45), inset 0 -3px 0 rgba(0,0,0,0.1);
  transition: all 0.15s;
  cursor: pointer;
  min-width: 280px;
}

.play202-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(250, 204, 21, 0.55); }
.play202-cta:active { transform: translateY(0); }

/* Rewards card (links to preppgames.com) */
.play202-rewards-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  text-align: center;
  margin: 12px 0;
  box-shadow: var(--shadow-sm);
}

.rewards-text {
  font-size: 14px;
  color: var(--text-2);
  margin-bottom: 12px;
  font-weight: 500;
}

.rewards-btn {
  display: inline-block;
  padding: 12px 28px;
  background: var(--primary);
  color: white;
  border-radius: 50px;
  font-size: 14px;
  font-weight: 700;
  transition: all 0.15s;
}

.rewards-btn:hover { background: var(--primary-2); transform: translateY(-1px); }

/* Top ad slot in game page */
.play202-ad-slot {
  margin: 12px 0;
  padding: 0;
}

.play202-ad-slot .ad-inner {
  background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== DOWNLOAD GAMES SECTION ===== */
.download-section {
  margin: 28px 0 16px;
  padding: 18px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
}

.download-section .section-head {
  margin: 0 0 6px;
}

.download-section .section-head h2 {
  font-size: clamp(16px, 3vw, 20px);
  color: var(--text);
}

.download-section .more-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
}

.download-subtitle {
  font-size: 13px;
  color: var(--text-3);
  margin-bottom: 14px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

@media (min-width: 520px) {
  .download-grid { grid-template-columns: repeat(4, 1fr); }
}

.download-card {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: all 0.15s;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.download-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.download-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex-shrink: 0;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
  background: #f3f4f6;
  object-fit: cover;
}

.download-info {
  flex: 1;
  min-width: 0;
}

.download-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.download-cat {
  font-size: 9px;
  color: var(--text-3);
  margin-top: 1px;
}

.download-arrow {
  font-size: 13px;
}

.download-arrow {
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.download-cta {
  display: block;
  text-align: center;
  padding: 12px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: all 0.15s;
}

.download-cta:hover { background: var(--primary-2); transform: translateY(-1px); }

/* === Original game.html styles (kept for compatibility) === */
.game-page { position: relative; }

.game-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--primary);
  padding: 7px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: all 0.15s;
}

.back-btn:hover { background: var(--primary-soft); border-color: var(--primary); }

.game-breadcrumb {
  font-size: 12px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.game-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 12px 0 20px;
}

.game-main { display: flex; flex-direction: column; gap: 14px; }

.game-frame-container {
  background: #000;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.game-frame-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: calc(100svh - 160px);
  min-height: 520px;
}

.game-frame-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.game-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  z-index: 5;
  gap: 14px;
}

.game-loading.hidden { display: none; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.game-loading p { color: #999; font-size: 14px; font-weight: 500; }

.game-info-bar {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.game-info-main h1 {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.game-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.stars { color: var(--accent); font-size: 13px; font-weight: 700; }

.cat-badge {
  padding: 3px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 50px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.game-controls { display: flex; gap: 8px; flex-shrink: 0; }

.ctrl-btn {
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.ctrl-fs { background: var(--accent); color: white; }
.ctrl-fs:hover { background: #d97706; }

.ctrl-reload {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
}
.ctrl-reload:hover { background: #f9fafb; }

.how-to-play {
  padding: 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.how-to-play h3 { font-size: 16px; font-weight: 800; margin-bottom: 8px; color: var(--text); }
.how-to-play p { font-size: 14px; color: var(--text-2); line-height: 1.7; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.game-tag {
  padding: 3px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 600;
}

.game-sidebar { display: flex; flex-direction: column; gap: 14px; }

.sidebar-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.sidebar-card h3 { font-size: 14px; font-weight: 800; margin-bottom: 10px; color: var(--text); }

.more-games { margin-top: 24px; }

.more-games h3 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 14px;
  color: var(--text);
  letter-spacing: -0.4px;
}

.game-frame-container.fullscreen {
  position: fixed;
  inset: 0;
  z-index: 9999;
  border-radius: 0;
}

.game-frame-container.fullscreen .game-frame-wrapper {
  aspect-ratio: unset;
  height: 100vh;
  max-height: none;
  min-height: 0;
}

@media (min-width: 1024px) {
  .game-layout { grid-template-columns: minmax(0,1fr) 320px; gap: 20px; }
}

/* ===== LEGAL/INFO PAGES ===== */
.legal-page { padding: 24px 0 50px; }

.legal-hero { text-align: center; padding: 16px 0 24px; }

.legal-hero h1 {
  font-size: clamp(26px, 5vw, 38px);
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.8px;
  margin-bottom: 6px;
}

.legal-hero p { color: var(--text-3); font-size: 14px; }

.legal-content {
  max-width: 820px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 36px);
  box-shadow: var(--shadow-sm);
}

.legal-content h2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  margin: 24px 0 10px;
  letter-spacing: -0.3px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.legal-content h2::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--primary);
  border-radius: 2px;
}

.legal-content h2:first-child { margin-top: 0; }

.legal-content h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 18px 0 8px; }

.legal-content p, .legal-content li {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-2);
  margin-bottom: 10px;
}

.legal-content ul, .legal-content ol { padding-left: 22px; margin-bottom: 12px; }
.legal-content li { margin-bottom: 5px; }

.legal-content a { color: var(--primary); font-weight: 600; }
.legal-content a:hover { text-decoration: underline; }

.legal-content strong { color: var(--text); font-weight: 700; }

.legal-content .updated {
  display: inline-block;
  padding: 4px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 50px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 16px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin: 14px 0 22px;
}

.contact-card {
  padding: 16px;
  background: #f9fafb;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.contact-card .ic {
  width: 40px; height: 40px;
  background: var(--primary-soft);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  margin: 0 auto 8px;
}

.contact-card h4 { font-size: 12px; color: var(--text-3); font-weight: 700; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.contact-card p { font-size: 13px; color: var(--text); margin: 0; word-break: break-word; }
.contact-card a { color: var(--primary); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media print {
  .ad-slot, .header-nav, .game-controls { display: none; }
}

/* ========================================
   VERTOZ AD PLACEHOLDERS (May 2026)
   Visible size labels for review before real tag integration.
   Layout/positions match Ayushmann's screenshots.
   ======================================== */

/* LIVE Vertoz ad slots — transparent + borderless so the actual ad creative
   renders cleanly. Size class (.ad-728x90 etc.) drives min-height (CLS guard).
   IMPORTANT — do NOT add `min-height: 0` or `:empty { display: none }` here:
   Vertoz's pageads.js calls updateDimensions() on the parent container; if
   the slot is 0-height or hidden during script init, it throws
   "[VZ-FRAME] Error in updateDimensions:" (Ayushmann reported May 16). */
.ad-live .ad-inner {
  background: transparent;
  border: 0;
  padding: 0;
  /* display: flex inherited from base .ad-inner — fine for Vertoz */
  /* min-height inherited from size class (.ad-728x90 etc.) — required */
}
.ad-live { padding: 0; }

/* Vertoz placeholder visual — prominent size label like in Ayushmann's screenshots */
.ad-vertoz .ad-inner {
  position: relative;
  background: #fafafa;
  border: 2px dashed #ef4444;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.ad-vertoz .ad-size-label {
  font-size: 28px;
  font-weight: 800;
  color: #ef4444;
  font-style: italic;
  letter-spacing: 1px;
  line-height: 1;
}

.ad-vertoz .ad-text {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 2px;
  color: #94a3b8;
  text-transform: uppercase;
  opacity: 0.8;
}

@media (max-width: 600px) {
  .ad-vertoz .ad-size-label { font-size: 18px; }
}

/* Size-specific min-heights & widths — match exact Vertoz sizes */
.ad-728x90 .ad-inner {
  min-height: 90px;
  max-width: 728px;
  margin: 0 auto;
  width: 100%;
}

.ad-970x250 .ad-inner {
  min-height: 250px;
  max-width: 970px;
  margin: 0 auto;
  width: 100%;
}

.ad-970x90 .ad-inner {
  min-height: 90px;
  max-width: 970px;
  margin: 0 auto;
  width: 100%;
}

.ad-300x600 .ad-inner {
  min-height: 600px;
  width: 300px;
  margin: 0 auto;
}

/* Mobile fallback for big banners (970x250 won't fit) */
@media (max-width: 700px) {
  .ad-970x250 .ad-inner {
    min-height: 250px;
    max-width: 100%;
  }
  .ad-970x250 .ad-size-label::after {
    content: ' → 300x250 mobile';
    font-size: 11px;
    font-style: normal;
    color: #64748b;
    display: block;
    margin-top: 6px;
  }
  .ad-970x90 .ad-size-label::after {
    content: ' → 320x50 mobile';
    font-size: 11px;
    font-style: normal;
    color: #64748b;
    display: block;
    margin-top: 6px;
  }
  .ad-728x90 .ad-size-label::after {
    content: ' → 320x50 mobile';
    font-size: 11px;
    font-style: normal;
    color: #64748b;
    display: block;
    margin-top: 6px;
  }
}

/* ============================================================
   MOBILE-FRIENDLY AD CONTAINMENT (fix: wide ads cutting/overflowing)
   Desktop ad sizes (970px, 728px) overflow small screens and break
   the layout (horizontal scroll / cut-off). These rules keep every ad
   strictly inside the viewport on all devices.
   ============================================================ */
/* No page-level horizontal scroll, ever */
html, body { max-width: 100%; overflow-x: hidden; }

/* Ad containers never exceed their column / the screen */
.ad-slot, .ad-inner { max-width: 100%; }
.ad-inner { overflow: hidden; }

/* Image/native creatives scale naturally to fit width.
   (iframes are scaled proportionally by js/ads-fit.js so the WHOLE ad
   stays visible on mobile — not clipped — while keeping aspect ratio.) */
.ad-inner img,
.ad-inner ins {
  max-width: 100% !important;
  height: auto;
}

/* On phones, cap reserved heights of the big desktop banners so an
   unfilled / clipped slot doesn't leave a huge empty gap */
@media (max-width: 768px) {
  .ad-970x250 .ad-inner { min-height: 110px; }
  .ad-970x90  .ad-inner { min-height: 60px; }
  .ad-728x90  .ad-inner { min-height: 60px; }
  .ad-sticky  .ad-inner { min-height: 50px; }
}

/* Vertoz Slot B: In-grid 728x90 — spans full game grid width */
.ad-in-grid {
  grid-column: 1 / -1;
  margin: 14px 0;
  padding: 0;
  max-width: 100%;
  overflow: hidden;
}

/* Game page 3-column stage row: [300x600 left] [preview] [300x600 right] */
.game-stage-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.game-stage-center {
  min-width: 0;
}

/* Sidebars hidden on mobile/tablet — only show when viewport is wide enough */
.game-stage-sidebar {
  display: none;
  padding: 0;
}

@media (min-width: 1280px) {
  .game-stage-row {
    grid-template-columns: 300px minmax(0, 1fr) 300px;
    gap: 24px;
  }
  .game-stage-sidebar {
    display: block;
    position: sticky;
    top: 80px;
  }
  .game-stage-sidebar .ad-inner {
    min-height: 600px;
    width: 300px;
  }
}

/* ===== VERTOZ SLOT H: INTERSTITIAL OVERLAY (320x480) ===== */
.interstitial-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  animation: interstitialFadeIn 0.25s ease-out;
}

.interstitial-overlay.hidden { display: none; }

@keyframes interstitialFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.interstitial-modal {
  background: #fff;
  border-radius: 14px;
  padding: 14px;
  max-width: 360px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: interstitialPopIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes interstitialPopIn {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* 320x480 ad container */
.ad-320x480 .ad-inner {
  width: 320px;
  min-height: 480px;
  max-width: 100%;
  margin: 0 auto;
}

@media (max-width: 360px) {
  .ad-320x480 .ad-inner { width: 100%; }
}

.interstitial-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  width: 100%;
}

.interstitial-countdown {
  font-size: 13px;
  color: #6b7280;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.interstitial-close {
  background: #1f2937;
  color: #fff;
  border: 0;
  padding: 10px 22px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.interstitial-close.hidden { display: none; }

.interstitial-close:hover { background: #ef4444; }
.interstitial-close:active { transform: translateY(1px); }

/* ===== STICKY-specific Vertoz overrides =====
   Keep sticky height compact even when ad-vertoz/ad-728x90 are applied. */
.ad-sticky.ad-vertoz .ad-inner {
  min-height: 50px;
  flex-direction: row;
  gap: 10px;
  border-width: 1px;
  padding: 4px 12px;
}

.ad-sticky.ad-vertoz .ad-size-label {
  font-size: 14px;
  line-height: 1;
}

.ad-sticky.ad-vertoz .ad-text {
  font-size: 8px;
}

/* No "→ 320x50 mobile" subtitle inside sticky — too cramped */
.ad-sticky.ad-vertoz .ad-size-label::after {
  display: none !important;
}

@media (min-width: 768px) {
  .ad-sticky.ad-vertoz .ad-inner {
    min-height: 90px;
  }
  .ad-sticky.ad-vertoz .ad-size-label {
    font-size: 20px;
  }
}
