/* gamezog — H5 game portal
   Dark, mobile-first theme. One stylesheet for the whole site. */

:root {
  --bg: #0f1116;
  --bg-2: #171a21;
  --card: #1c2028;
  --card-hover: #232833;
  --line: #2a2f3a;
  --text: #eef1f6;
  --text-dim: #9aa3b2;
  --accent: #ff5a3c;
  --accent-2: #ffb020;
  --brand-grad: linear-gradient(135deg, #ff5a3c 0%, #ff2d78 100%);
  --radius: 14px;
  --maxw: 1180px;
  --font: "Saira", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15,17,22,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 16px;
  height: 62px;
}
.logo {
  font-weight: 800; font-size: 22px; letter-spacing: -.5px;
  display: flex; align-items: center; gap: 8px;
}
.logo .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--brand-grad);
}
.logo b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.search {
  margin-left: auto; position: relative; flex: 0 1 320px;
}
.search input {
  width: 100%; height: 40px; border-radius: 999px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); padding: 0 16px 0 40px; font-family: inherit; font-size: 14px;
}
.search input::placeholder { color: var(--text-dim); }
.search svg { position: absolute; left: 14px; top: 11px; width: 18px; height: 18px; stroke: var(--text-dim); }

/* ---------- Hero ---------- */
.hero {
  background: radial-gradient(1200px 400px at 50% -20%, rgba(255,90,60,.18), transparent 70%);
  padding: 44px 0 28px;
  text-align: center;
}
.hero h1 { font-size: clamp(28px, 5vw, 46px); font-weight: 800; letter-spacing: -1px; }
.hero h1 span { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--text-dim); margin-top: 8px; font-size: 16px; }

/* ---------- Category chips ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 18px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 8px 16px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--line);
  color: var(--text-dim); font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--accent); }
.chip.active { background: var(--brand-grad); color: #fff; border-color: transparent; }

/* ---------- Ad slots ---------- */
.ad-slot {
  margin: 22px auto; display: flex; align-items: center; justify-content: center;
  min-height: 90px; background: var(--bg-2); border: 1px dashed var(--line);
  border-radius: 10px; color: #4b5364; font-size: 12px; letter-spacing: 1px;
}
.ad-slot.filled { border-style: solid; }

/* ---------- Game grid ---------- */
.section-title { font-size: 20px; font-weight: 700; margin: 26px 0 14px; }
.grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); background: var(--card-hover); }
.card .thumb { aspect-ratio: 1/1; width: 100%; background: var(--bg-2); object-fit: cover; }
.card .meta { padding: 10px 12px; }
.card .name { font-weight: 700; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .cat { color: var(--text-dim); font-size: 12px; margin-top: 2px; }
.empty { color: var(--text-dim); padding: 40px 0; text-align: center; }

/* ---------- Game detail page ---------- */
.game-top { display: grid; grid-template-columns: 128px 1fr; gap: 20px; align-items: center; padding: 24px 0; }
.game-top .logo-lg { width: 128px; height: 128px; border-radius: 20px; border: 1px solid var(--line); }
.game-top h1 { font-size: 30px; font-weight: 800; letter-spacing: -.5px; }
.game-top .cat { color: var(--accent-2); font-weight: 600; margin: 4px 0 12px; }
.btn-play {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--brand-grad); color: #fff; font-weight: 700; font-size: 16px;
  padding: 12px 26px; border-radius: 999px; border: none; cursor: pointer;
  font-family: inherit;
}
.btn-play:hover { filter: brightness(1.08); }

/* Play stage (iframe host) */
.stage {
  position: relative; width: 100%; aspect-ratio: 16/10;
  background: #000; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); margin: 8px 0 24px;
}
.stage iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.stage .poster {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px; cursor: pointer;
  background: radial-gradient(600px 300px at 50% 40%, rgba(255,90,60,.25), #0a0c10);
}
.stage .poster .big-play {
  width: 78px; height: 78px; border-radius: 50%; background: var(--brand-grad);
  display: flex; align-items: center; justify-content: center;
}
.stage .fs-btn {
  position: absolute; right: 10px; bottom: 10px; z-index: 5;
  background: rgba(0,0,0,.6); border: 1px solid var(--line); color: #fff;
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer; font-family: inherit;
}

/* SEO content */
.content { display: grid; grid-template-columns: 1fr; gap: 22px; padding-bottom: 40px; }
.content h2 { font-size: 20px; margin-bottom: 8px; }
.content p, .content li { color: #cdd3dd; }
.content ul, .content ol { padding-left: 20px; }
.content li { margin: 5px 0; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.faq details { border-bottom: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details[open] summary { color: var(--accent); }
.faq p { margin-top: 8px; }
.license-note { color: var(--text-dim); font-size: 13px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 30px; padding: 26px 0; color: var(--text-dim); font-size: 14px; }
.site-footer .row { display: flex; flex-wrap: wrap; gap: 18px; align-items: center; justify-content: space-between; }
.site-footer a:hover { color: var(--text); }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .game-top { grid-template-columns: 88px 1fr; gap: 14px; }
  .game-top .logo-lg { width: 88px; height: 88px; }
  .game-top h1 { font-size: 22px; }
  .search { flex-basis: 160px; }
}

/* ---- Rewarded coins: header HUD + reward popup ------------------------- */
.coin-hud {
  display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto;
  margin-left: 10px; padding: 0 12px; height: 38px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: 999px;
  color: var(--accent-2); font-family: inherit; font-weight: 700; font-size: 14px;
  cursor: pointer; white-space: nowrap;
}
.coin-hud:hover { border-color: var(--accent-2); }
.coin-hud .coin-ico { font-size: 16px; line-height: 1; }

.sp-reward-overlay {
  position: fixed; inset: 0; z-index: 9999; display: flex;
  align-items: center; justify-content: center; padding: 20px;
  background: rgba(6,8,12,.72); backdrop-filter: blur(3px);
  animation: sp-fade .2s ease both;
}
.sp-reward-overlay.closing { animation: sp-fade .2s ease reverse both; }
@keyframes sp-fade { from { opacity: 0; } to { opacity: 1; } }

.sp-reward-modal {
  position: relative; width: 100%; max-width: 340px; text-align: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px;
  padding: 26px 22px 20px; box-shadow: 0 24px 60px rgba(0,0,0,.5);
  animation: sp-pop .34s cubic-bezier(.22,.68,0,1.2) both;
}
@keyframes sp-pop { from { transform: translateY(14px) scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.sp-reward-close {
  position: absolute; top: 10px; right: 12px; background: none; border: 0;
  color: var(--text-dim); font-size: 24px; line-height: 1; cursor: pointer;
}
.sp-reward-chest { line-height: 1; margin: 4px 0 14px; }
.sp-reward-tag { font-size: 19px; font-weight: 800; color: var(--text); }
.sp-reward-title { font-size: 24px; font-weight: 800; color: var(--text); margin-top: 10px; }
.sp-reward-sub { margin-top: 10px; color: var(--text-dim); font-size: 14px; }
.sp-reward-btn {
  margin-top: 22px; width: 100%; height: 54px; border: 0; border-radius: 14px;
  background: #fff; color: #14171d; font-family: inherit;
  font-size: 17px; font-weight: 800; cursor: pointer;
}
.sp-reward-btn:hover { background: #eef1f6; }
.sp-reward-btn:disabled { opacity: .8; cursor: default; }
.sp-reward-note { margin-top: 12px; color: var(--text-dim); font-size: 12px; }

/* ---- Quiz funnel lander ------------------------------------------------ */
.quiz-headtag {
  margin-left: auto; padding: 6px 14px; border-radius: 999px;
  background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 13px;
  letter-spacing: .3px;
}
.quiz-wrap { padding-bottom: 40px; }
.quiz-hero { text-align: center; padding: 26px 0 18px; }
.quiz-hero h1 { font-size: 30px; font-weight: 800; }
.quiz-hero h1 span { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.quiz-hero p { color: var(--text-dim); margin-top: 8px; }
.quiz-hero strong { color: var(--accent-2); }

.quiz-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; margin: 16px 0;
}
.quiz-meta {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--text-dim); font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.quiz-coins b { color: var(--accent-2); }
.quiz-q { font-size: 20px; font-weight: 800; line-height: 1.3; margin-bottom: 16px; }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .quiz-options { grid-template-columns: 1fr; } }
.q-option {
  text-align: left; padding: 16px; border-radius: 12px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); font-family: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; transition: border-color .15s, background .15s;
}
.q-option:hover { border-color: var(--accent); }
.q-option.correct { background: rgba(46,196,120,.15); border-color: #2ec478; color: #7ef0b0; }
.q-option.wrong { background: rgba(255,90,60,.15); border-color: var(--accent); color: #ff9a86; }

.quiz-facts {
  background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px; margin-top: 20px;
}
.quiz-facts h3 { font-size: 16px; margin-bottom: 10px; }
.quiz-facts ul { margin: 0; padding-left: 18px; color: var(--text-dim); font-size: 14px; line-height: 1.8; }

/* ---- Quiz funnel: won page + category hub ----------------------------- */
.won-card {
  text-align: center; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 30px 22px; margin: 18px 0;
}
.won-coin { font-size: 54px; line-height: 1; }
.won-amount { font-size: 24px; font-weight: 800; margin: 10px 0 6px; }
.won-amount b { color: var(--accent-2); }
.won-card p { color: var(--text-dim); max-width: 460px; margin: 6px auto 0; }
.won-card strong { color: var(--text); }
.won-btn { max-width: 300px; margin: 20px auto 0; }
.won-note { color: var(--text-dim); font-size: 12px; margin-top: 12px; }

.quiz-cats { margin: 16px 0; }
.cat-card { text-align: center; padding: 22px 12px 16px; }
.cat-emoji { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.cat-card .name { font-size: 16px; }
.cat-card .cat { color: var(--accent-2); }
a.quiz-headtag { text-decoration: none; }

/* ---- Cross-pillar CTA (games home -> quiz funnel) --------------------- */
.hero-cta {
  display: inline-block; margin-top: 18px; padding: 13px 22px; border-radius: 999px;
  background: var(--brand-grad); color: #fff; font-weight: 800; font-size: 15px;
  text-decoration: none; box-shadow: 0 8px 24px rgba(255,45,120,.28);
}
.hero-cta:hover { filter: brightness(1.06); }
.nav-link {
  margin-left: auto; padding: 8px 14px; border-radius: 999px; white-space: nowrap;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); font-weight: 700; font-size: 13px; text-decoration: none;
}
.nav-link:hover { border-color: var(--accent); }

/* ---- Reference-style single-screen quiz lander (teaser) --------------- */
body.ref-lander { margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); }
.ref-adzone { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 140px; padding: 12px; }
/* The ad engine (ailogic) injects its own ad into this zone; hide our
   placeholder so there's a single, centered top ad like the reference. */
.ref-adzone .ad-slot { display: none; }
.ref-sheet {
  background: #171a21; border-top: 1px solid var(--line);
  border-top-left-radius: 26px; border-top-right-radius: 26px;
  padding: 24px 18px 30px;
}
.ref-intro { text-align: center; color: var(--text-dim); font-weight: 700; font-size: 15px; }
.ref-intro b { color: var(--accent-2); }
.ref-bell { text-align: left; font-size: 30px; line-height: 1; margin: 4px 0 16px; }
.ref-progress { text-align: center; color: var(--text-dim); font-size: 13px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; margin: 0 0 10px; }
.ref-q { font-size: 22px; font-weight: 800; line-height: 1.25; margin: 0 0 16px; color: var(--text); }
.ref-options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ref-options .q-option {
  text-align: left; padding: 18px 16px; border-radius: 12px;
  background: #262b34; border: 1px solid #333a45;
  color: var(--text); font-family: inherit; font-size: 15px; font-weight: 700; cursor: pointer;
}
.ref-options .q-option:hover { border-color: var(--accent); }
.ref-options .q-option.correct { background: rgba(46,196,120,.18); border-color: #2ec478; color: #7ef0b0; }
.ref-options .q-option.wrong { background: rgba(255,90,60,.18); border-color: var(--accent); color: #ff9a86; }

/* ---- Reference layout: won / play / hub -------------------------------- */
.ref-sheet.ref-center { text-align: center; }
.ref-won-emoji { font-size: 48px; line-height: 1; }
.ref-won-amount { font-size: 24px; font-weight: 800; margin: 10px 0 6px; }
.ref-won-amount b { color: var(--accent-2); }
.ref-won-sub { color: var(--text-dim); font-size: 14px; max-width: 380px; margin: 0 auto; }
.ref-cta {
  margin-top: 20px; width: 100%; max-width: 340px; height: 54px; border: 0; border-radius: 14px;
  background: var(--brand-grad); color: #fff; font-family: inherit; font-size: 17px; font-weight: 800; cursor: pointer;
}
.ref-meta { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: 13px; font-weight: 700; margin-bottom: 12px; }
.ref-score b { color: var(--accent-2); }
/* hub — chrome-less but scrollable category grid */
body.ref-hub { margin: 0; background: var(--bg); min-height: 100vh; padding: 24px 16px 40px; }
.ref-hub .ref-intro { font-size: 19px; margin-bottom: 8px; }
.ref-hub .ref-intro-sub { text-align: center; color: var(--text-dim); font-size: 14px; margin-bottom: 18px; }
.ref-hub .grid { max-width: 640px; margin: 18px auto 0; }
