/* ==========================================================================
   main.css — cinematic interactions, smooth animations, reliable show/hide
   ========================================================================== */

/* -------------------------
   Motion variables & easings
   ------------------------- */
:root {
  --ease-fast: cubic-bezier(.2,.9,.3,1);
  --ease-med: cubic-bezier(.22,.9,.2,1);
  --ease-slow: cubic-bezier(.16,.7,.3,1);
  --dur-fast: 160ms;
  --dur: 320ms;
  --dur-slow: 600ms;
}

/* -------------------------
   Keyframes
   ------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px) scale(.995); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulseGlow {
  0% { box-shadow: 0 6px 18px rgba(240,200,81,0.04); }
  50% { box-shadow: 0 14px 36px rgba(240,200,81,0.08); }
  100% { box-shadow: 0 6px 18px rgba(240,200,81,0.04); }
}
/* Cinematic zoom for clicked control */
@keyframes zoomFocus {
  0%   { transform: translateZ(0) scale(1); filter: none; }
  100% { transform: translateZ(0) scale(2.6); filter: drop-shadow(0 12px 40px rgba(0,0,0,.6)); }
}

/* ==========================================================================
   Show/hide utilities
   ========================================================================== */
.hidden { display: none !important; }
.cta, .btn, a.cta { display: inline-block; }

/* Optional: ID-specific hidden only when .hidden is present */
#generate-key-btn.hidden { display: none !important; }
#games-btn.hidden        { display: none !important; }
#admin-link.hidden       { display: none !important; }

/* ==========================================================================
   Global cinematic mode (triggered via JS)
   ========================================================================== */
/* When body.cinematic is active, dim and fade everything except the focused element */
body.cinematic {
  overflow: hidden; /* prevent scrollbars during the effect */
}
body.cinematic .cinematic-dim {
  opacity: 0;
  filter: blur(2px) brightness(.8) saturate(.9);
  transition:
    opacity var(--dur-slow) var(--ease-slow),
    filter var(--dur-slow) var(--ease-slow);
  pointer-events: none;
}
.focus-zoom {
  position: relative;
  z-index: 9999;
  animation: zoomFocus var(--dur-slow) var(--ease-med) both;
  transform-origin: center;
  will-change: transform, filter;
}

/* ==========================================================================
   Base reset & typography
   ========================================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  height: 100%;
  background: #050505;
  color: #eee;
  font-family: "Segoe UI", system-ui, Segoe, Roboto, "Helvetica Neue", Arial;
  font-size: 18px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }

/* Palette */
:root {
  --gold-1: #d4af37;
  --gold-2: #f0c851;
  --panel: #0c0c0c;
  --muted: #b5b5b5;
  --max-width: 1180px;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.wrap { display: flex; justify-content: center; padding: 28px 16px; }
.content { width: 100%; max-width: var(--max-width); }

/* ==========================================================================
   Hero grid
   ========================================================================== */
.hero {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 18px;
  background: linear-gradient(180deg, rgba(10,10,10,.98), rgba(3,3,3,1));
  padding: 22px;
  border-radius: 14px;
  box-shadow: 0 12px 50px rgba(0,0,0,.7);
  overflow: visible;
  align-items: center;
  will-change: transform, opacity;
  animation: fadeUp var(--dur) var(--ease-med) both;
}
@media (max-width:1024px) {
  .hero { grid-template-columns: 1fr; gap: 12px; padding: 18px; }
  .hero-ad-left, .hero-ad-right { display: none; }
}

/* Hero ad columns */
.hero-ad {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  overflow: hidden;
  background: var(--panel);
  min-height: 420px;
  transform-origin: center;
  transition:
    transform var(--dur) var(--ease-med),
    box-shadow var(--dur) var(--ease-med);
}
.hero-ad img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Center content */
.hero-center {
  background: linear-gradient(180deg, rgba(14,14,14,.94), rgba(7,7,7,.98));
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 420px;
  text-align: center;
}
.site-title {
  font-size: 2.6rem;
  color: var(--gold-1);
  text-shadow: 0 10px 40px rgba(212,175,55,.14);
  letter-spacing: -0.02em;
}
.subtitle { color: #cfcfcf; font-size: 1rem; }
.info { color: #d8d8d8; max-width: 880px; text-align: center; }

/* ==========================================================================
   CTAs (animated)
   ========================================================================== */
.cta-wrap {
  margin-top: 8px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

/* Default CTA appearance */
.cta {
  padding: 11px 16px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  color: #111;
  background: linear-gradient(90deg, var(--gold-1), var(--gold-2));
  border: 2px solid rgba(255,255,255,0.04);
  box-shadow: 0 6px 18px rgba(240,200,81,0.06), inset 0 -2px 0 rgba(0,0,0,0.08);
  text-decoration: none;
  text-align: center;
  will-change: transform, opacity, box-shadow;
  animation: fadeIn var(--dur-fast) var(--ease-fast) both;
  transition:
    transform var(--dur-fast) var(--ease-fast),
    box-shadow var(--dur-fast) var(--ease-fast),
    opacity var(--dur) var(--ease-fast);
}
.cta.secondary {
  background: transparent;
  color: #fff;
  border: 2px solid rgba(255,255,255,0.06);
}
.cta:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 18px 40px rgba(0,0,0,.55), 0 6px 30px rgba(240,200,81,.08);
}
.cta:active {
  transform: translateY(-1px) scale(.995);
  transition-duration: 120ms;
}
.cta:focus {
  outline: none;
  box-shadow: 0 0 0 4px rgba(208,175,55,.08), 0 8px 30px rgba(0,0,0,.6);
}

/* ==========================================================================
   Ad cards & zones
   ========================================================================== */
.ad-card {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel);
  border: 2px dashed var(--gold-1);
  border-radius: 12px;
  padding: 10px;
  margin: 0 auto 18px;
  max-width: 980px;
  min-height: 90px;
  width: 100%;
  box-shadow: 0 6px 30px rgba(212,175,55,.03);
  animation: fadeUp var(--dur) var(--ease-med) both;
  transition:
    transform var(--dur) var(--ease-med),
    box-shadow var(--dur) var(--ease-med);
}
.ad-card:hover {
  transform: translateY(-6px);
  animation: pulseGlow var(--dur-slow) var(--ease-slow) infinite;
}
.bottom-ads {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: center;
  margin-top: 10px;
}

.mobile-banner {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 16px auto;
  max-width: 320px;
  background: var(--panel);
  border-radius: 12px;
  padding: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
}
.sticky-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 9999;
  background: var(--panel);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 6px;
  border-top: 2px solid var(--gold-1);
  box-shadow: 0 -4px 20px rgba(0,0,0,.6);
}
.sticky-footer ins { max-width: 100%; }
.native-widget {
  margin: 24px auto;
  max-width: 980px;
  background: var(--panel);
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 6px 30px rgba(0,0,0,.3);
  animation: fadeUp var(--dur) var(--ease-med) both;
}

/* ==========================================================================
   Video container
   ========================================================================== */
.video-wrap {
  width: 100%;
  max-width: 920px;
  border-radius: 12px;
  overflow: hidden;
  border: 6px solid rgba(212,175,55,.22);
  box-shadow: 0 18px 60px rgba(212,175,55,.06), 0 8px 30px rgba(0,0,0,.6);
  margin-top: 8px;
  animation: fadeUp var(--dur) var(--ease-med) both;
  transition:
    transform var(--dur) var(--ease-med),
    box-shadow var(--dur) var(--ease-med);
}
.video-wrap:hover { transform: translateY(-6px); }

/* ==========================================================================
   Games grid & cards
   ========================================================================== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}
.game-card {
  position: relative;
  background: #1a1a1a;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,.6);
  cursor: pointer;
  will-change: transform, opacity;
  animation: fadeUp var(--dur) var(--ease-med) both;
  transition:
    transform .3s var(--ease-med),
    box-shadow .3s var(--ease-med);
}
.game-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0,0,0,.8);
}
.game-card img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.game-card h3 {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 1.2rem;
  color: var(--gold-1);
}
/* overlay reveal */
.overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.7);
  display: flex; align-items: center; justify-content: center;
  color: var(--gold-1); font-size: 1.3rem; font-weight: bold;
  opacity: 0; transform: translateY(6px);
  transition: opacity .28s var(--ease-fast), transform .28s var(--ease-fast);
}
.game-card:hover .overlay { opacity: 1; transform: translateY(0); }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width:640px) {
  .site-title { font-size: 1.6rem; }
  .hero-ad { min-height: 220px; }
  .video-wrap { border-width: 4px; }
  body { padding-bottom: 64px; } /* avoid sticky footer overlap */
}
@media (max-width:1024px) {
  .page { grid-template-columns: 1fr; }
  .side-column { display: none !important; }
}

/* ==========================================================================
   Defensive neutralization for injected provider wrappers
   ========================================================================== */
.hero-ad, .hero-ad * {
  transform: none !important;
  transition: none !important;
  animation: none !important;
  will-change: auto !important;
}
.hero-ad iframe, .hero-ad ins,
.ad-card iframe, .ad-card ins,
.mobile-banner iframe, .mobile-banner ins,
.sticky-footer iframe, .sticky-footer ins,
.native-widget iframe, .native-widget ins {
  width: 100% !important;
  height: 100% !important;
  display: block !important;
  border: 0 !important;
}

/* ==========================================================================
   Hide empty ad slots
   ========================================================================== */
.ad-card:empty { display: none; }
.hero-ad:empty { display: none; }
.mobile-banner:empty { display: none; }
.native-widget:empty { display: none; }
