:root {
  --bg: #101820;
  --panel: #172331;
  --panel2: #203145;
  --line: #2d4057;
}

html, body { min-height: 100%; }
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; min-width: 0; }
.main > *, .hero > * { min-width: 0; }
.hero p { overflow-wrap: anywhere; }
.site-footer { display: none; }

.site-topbar {
  min-height: 72px;
  padding: 12px max(28px, calc((100vw - 1280px) / 2 + 28px));
  background: #0c1420;
  backdrop-filter: none;
}

.site-topbar .brand { margin: 0; min-width: 0; flex-shrink: 1; }
/* The source image includes white margins; cover trims that space while
   keeping the complete logo visible inside the compact white badge. */
.brand-logo { width: 190px; height: 44px; display: block; max-width: 100%; object-fit: cover; object-position: center; border-radius: 9px; background: #fff; padding: 0; }
.top-actions { margin-left: auto; }

.site-menu { position: relative; margin-left: auto; }
.site-menu > summary { width: 44px; height: 44px; display: grid; place-items: center; cursor: pointer; list-style: none; border: 1px solid var(--line); border-radius: 9px; background: var(--panel); transition: border-color .18s ease, background .18s ease; }
.site-menu > summary:hover { border-color: #4a6686; background: var(--panel2); }
.site-menu > summary:focus-visible { outline: 3px solid rgba(61, 165, 255, .45); outline-offset: 3px; }
.site-menu > summary::-webkit-details-marker { display: none; }
.site-menu > summary span, .site-menu > summary span::before, .site-menu > summary span::after { width: 20px; height: 2px; display: block; border-radius: 2px; background: var(--text); transition: top .18s ease, transform .18s ease, background .18s ease; }
.site-menu > summary span { position: relative; }
.site-menu > summary span::before, .site-menu > summary span::after { content: ""; position: absolute; left: 0; }
.site-menu > summary span::before { top: -6px; }
.site-menu > summary span::after { top: 6px; }
.site-menu[open] > summary { position: fixed; top: 24px; right: 24px; z-index: 90; background: #172331; }
.site-menu[open] > summary span { background: transparent; }
.site-menu[open] > summary span::before { top: 0; transform: rotate(45deg); }
.site-menu[open] > summary span::after { top: 0; transform: rotate(-45deg); }
.site-menu[open] > summary span { display: none; }
.site-menu[open] > summary::after { content: "\00d7"; color: var(--text); font-size: 34px; line-height: 1; font-weight: 300; }
.site-menu[open]::before { content: ""; position: fixed; inset: 0; z-index: 70; background: rgba(2, 6, 11, .8); backdrop-filter: blur(5px); animation: menu-fade-in .18s ease-out; }
.site-menu[open] > nav { position: fixed; top: 50%; left: 50%; z-index: 80; width: min(400px, calc(100vw - 32px)); max-height: min(620px, calc(100dvh - 40px)); display: grid !important; flex-direction: column; align-items: stretch !important; gap: 5px !important; overflow-y: auto; overscroll-behavior: contain; padding: 20px; border: 1px solid #36506d; border-radius: 16px; background: #111b27; box-shadow: 0 28px 90px rgba(0, 0, 0, .68); transform: translate(-50%, -50%); animation: menu-pop-in .2s ease-out; }
.site-menu[open] > nav::before { content: "Menu"; padding: 2px 12px 14px; margin-bottom: 5px; color: var(--text); font-size: 21px; line-height: 1.2; font-weight: 800; border-bottom: 1px solid var(--line); }
.site-menu[open] > nav a { display: block; padding: 13px 14px !important; border-radius: 9px; color: var(--muted); font-weight: 700; line-height: 1.35; }
.site-menu[open] > nav a:hover, .site-menu[open] > nav a:focus-visible { color: var(--text); background: var(--panel2); outline: none; }
[data-marketing-link][hidden] { display: none !important; }
html:has(.site-menu[open]) body, body.menu-open { overflow: hidden; touch-action: none; }

@keyframes menu-fade-in { from { opacity: 0; } }
@keyframes menu-pop-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 12px)) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  .site-menu[open]::before, .site-menu[open] > nav { animation: none; }
  .site-menu > summary, .site-menu > summary span, .site-menu > summary span::before, .site-menu > summary span::after { transition: none; }
}

.main {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 28px 28px;
}

.hero.compact-hero {
  min-height: 120px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  margin-bottom: 10px;
  background: none;
}

.hero.compact-hero h1 {
  margin: 0 0 8px;
  font-size: clamp(34px, 4vw, 50px);
  letter-spacing: normal;
  line-height: 1;
}

.hero.compact-hero p { margin: 0; font-size: 16px; }

.ad-slot {
  min-height: 90px;
  margin: 10px 0 24px;
  overflow: hidden;
}

.section-head {
  align-items: end;
  margin: 0 0 16px;
}

.section-head h2 {
  margin: 0 0 8px;
  font-size: 1.5em;
  letter-spacing: normal;
}

.category-filter {
  flex-wrap: wrap;
  overflow: visible;
  gap: 10px;
  padding: 0;
  margin: -4px 0 22px;
}

.category-pill { border-radius: 8px; }
.card { border-radius: 8px; }
.card:hover { transform: none; }
.thumb-button { position: relative; }

.thumb-button::after {
  content: "🔒";
  position: absolute;
  right: 10px;
  bottom: 10px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 999px;
  background: rgba(5,8,12,.86);
}
.card.is-unlocked .thumb-button::after { content: "🔓"; color: #16c784; }
.card.is-unlocked .thumb { filter: none; }

/* Make the reward state obvious even on a small WebView screen. */
.card.is-unlocked {
  border: 2px solid #20e59a;
  box-shadow: 0 0 0 2px rgba(32,229,154,.18), 0 8px 24px rgba(0,0,0,.32);
}
.card.is-unlocked .thumb-button::before {
  content: "UNLOCKED";
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 2;
  padding: 7px 11px;
  border-radius: 7px;
  background: #16c784;
  color: #04120c;
  font-size: 13px;
  font-weight: 950;
  line-height: 1;
  letter-spacing: .05em;
  box-shadow: 0 2px 10px rgba(0,0,0,.45);
}
.card.is-unlocked .play-button {
  min-height: 38px;
  padding: 7px 14px;
  border-radius: 8px;
  background: #16c784;
  color: #03120b;
  font-weight: 950;
}

.thumb { filter: saturate(.82) brightness(.88); }
.card-meta { display: none; }
.card-actions { margin-top: 12px; }
.card { position: relative; }
.favorite-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(8, 15, 24, .88);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .4);
}
.favorite-button:hover, .favorite-button:focus-visible { background: #17283a; }
.game-instructions { width: min(100%, 620px); margin: 0 0 18px; padding: 14px 16px; border: 1px solid #36506d; border-left: 4px solid var(--accent); border-radius: 10px; background: var(--panel); color: var(--muted); font-size: 13px; }
.game-instructions > strong { display: block; margin-bottom: 5px; color: var(--text); font-size: 14px; }
.notification-opt-in { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 10px; }
.notification-opt-in[hidden] { display: none; }
.notification-button { min-height: 36px; padding: 6px 12px; border: 1px solid #16c784; border-radius: 8px; background: #16c784; color: #03120b; font-weight: 850; cursor: pointer; }
.notification-button[data-state="enabled"] { border-color: #2b4057; background: #1b2b3d; color: #16c784; }
.notification-button:disabled { cursor: default; opacity: .8; }
[data-notification-status] { color: var(--muted); font-size: 12px; }
.game-instructions ol { margin: 0; padding-left: 21px; }
.game-instructions li + li { margin-top: 4px; }
.game-instructions b, .game-instructions em { color: var(--text); font-style: normal; }
.game-instructions span[aria-hidden="true"] { color: #ffd166; font-size: 18px; vertical-align: -1px; }
/* Game cards and ads occupy identical grid columns (250px minimum when space permits).
   Ads are ordinary peer tiles, never full-row banners. */
.main .grid[data-games-grid] {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr));
  /* The tallest game/ad determines a common tile height for every row. */
  grid-auto-rows: 1fr;
  align-items: stretch;
}
.main .grid[data-games-grid] > :is(.card, .in-feed-ad) {
  grid-column: auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.in-feed-ad {
  box-sizing: border-box;
  /* Match the game tiles' outer dimensions without resizing Google's creative. */
  align-self: stretch;
  min-height: 0;
  height: 100%;
  border: 1px dashed #62788e;
  border-radius: 8px;
  background: #101a27;
}
.in-feed-ad-disclosure {
  padding: 7px 10px;
  color: #ced8e5;
  background: #253447;
  border-bottom: 1px solid #43576b;
  text-align: center;
  font-size: 11px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.in-feed-ad .adsbygoogle {
  display: block;
  width: 100%;
}
.in-feed-ad:has(.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.in-feed-ad .adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
.play-button { padding: 0; font-size: 13px; }

.player {
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  background: #05080c;
}

.inline-player-head h2 { margin: 0; font-size: 16px; }
.inline-player-head .eyebrow { display: none; }
.inline-player-head > div:last-child { display: flex; gap: 8px; }
.inline-game-frame { display: block; width: 100%; height: 100%; min-height: 0; border: 0; background: #000; }
.player:fullscreen, .player:-webkit-full-screen { grid-template-rows: 1fr; }
.player:fullscreen .inline-player-head, .player:-webkit-full-screen .inline-player-head { display: none; }

.unlock-dialog { padding: 0; }
.unlock-dialog form { padding: 24px; text-align: center; }
.unlock-actions { display: flex; justify-content: center; gap: 10px; margin-top: 22px; }

.site-footer {
  margin-top: 32px;
  padding: 14px 28px;
  border-top: 1px solid var(--line);
  background: #0c1420;
  color: var(--muted);
}

.footer-inner {
  width: 100%;
  max-width: 1224px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 8px 24px;
}

.footer-inner strong { color: var(--text); font-size: 16px; }
.footer-inner p { margin: 0; font-size: 12px; }
.footer-inner nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 12px 20px; }
.footer-inner nav a:hover { color: var(--accent); }
.footer-inner small { grid-column: 1 / -1; padding-top: 7px; border-top: 1px solid var(--line); font-size: 11px; }

@media (max-width: 1000px) {
  .site-footer { display: none; }
}

.legal-main { min-height: calc(100vh - 280px); }
.legal-page { max-width: 850px; }
.legal-page h1 { margin: 8px 0 12px; font-size: clamp(34px, 5vw, 52px); }
.legal-page h2 { margin: 30px 0 8px; font-size: 22px; }
.legal-page p, .legal-page li { color: var(--muted); line-height: 1.75; }
.legal-page a { color: var(--accent); }
.legal-card { margin-top: 24px; padding: 22px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 18px 0 24px; }
.page-heading h1 { margin: 0 0 8px; font-size: clamp(34px, 4vw, 50px); }
.page-heading p { margin: 0; color: var(--muted); }
.compact-stats { width: 280px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.stat strong, .stat span { display: block; }
.stat strong { font-size: 22px; }
.stat span { color: var(--muted); font-size: 12px; }
.catalog-toolbar { display: grid; grid-template-columns: 1fr 220px auto; gap: 12px; margin-bottom: 22px; }
.catalog-toolbar .search, .catalog-toolbar .select { width: 100%; height: 42px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); }
.category-list { display: flex; flex-wrap: wrap; gap: 10px; }
.detail { display: grid; grid-template-columns: minmax(280px, 540px) minmax(0, 1fr); gap: 28px; align-items: center; margin-top: 30px; }
.detail-media { overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.detail-media img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.detail-copy h1 { margin: 0 0 12px; font-size: clamp(30px, 4vw, 52px); }
.detail-copy p { color: var(--muted); line-height: 1.65; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }

.app-landing { max-width: 1120px; }
.app-hero { min-height: 360px; display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 48px; padding: 56px 0; }
.app-mark { width: 100%; height: auto; object-fit: contain; }
.app-hero h1 { margin: 8px 0 14px; font-size: clamp(42px, 7vw, 72px); line-height: 1; }
.app-hero p { max-width: 700px; margin: 0 0 24px; color: var(--muted); font-size: 18px; }
.download-section, .app-features { padding: 48px 0; border-top: 1px solid var(--line); }
.download-grid, .feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.download-card, .feature-grid article { padding: 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.download-card h3, .feature-grid h3 { margin: 0 0 8px; }
.download-card p, .feature-grid p { margin: 0 0 18px; color: var(--muted); }
.download-button[hidden], .availability[hidden] { display: none; }
.availability { color: var(--muted); font-size: 13px; font-weight: 700; }

@media (max-width: 760px) {
  .site-topbar { flex-wrap: nowrap; gap: 12px; padding: 8px 16px; min-height: 64px; }
  .site-topbar nav { display: flex; flex-basis: auto; flex-direction: row; padding: 0; }
  .main { padding: 20px 16px 24px; }
  .hero.compact-hero { padding-block: 16px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-inner nav { justify-content: flex-start; }
  .footer-inner small { grid-column: 1; }
  .page-heading, .detail { display: grid; grid-template-columns: 1fr; }
  .compact-stats { width: 100%; }
  .catalog-toolbar { grid-template-columns: 1fr; }
  .brand-logo { width: 190px; height: 44px; }
  .brand small { display: block; }
  .app-hero { min-height: 0; grid-template-columns: 100px minmax(0, 1fr); gap: 20px; padding: 32px 0; }
  .download-grid, .feature-grid { grid-template-columns: 1fr; }
}

.site-menu > nav .menu-app-version { margin: 8px 0 0; padding: 14px 14px 2px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; line-height: 1.5; }
.site-menu > nav .menu-app-version strong { color: var(--text); }

/* Player guidance */
.guide-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.legal-page li { line-height: 1.7; }
.legal-page a { text-decoration: underline; text-underline-offset: 3px; }
.legal-page details { border-top: 1px solid #30465d; padding: 18px 0; }
.legal-page summary { cursor: pointer; font-weight: 700; }
@media (max-width: 640px) { .guide-grid { grid-template-columns: 1fr; } }

/* Compact catalog introduction */
.play-resources { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; margin: 0 0 26px; border-bottom: 1px solid #2b3d4e; }
.play-resources a { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-size: 14px; font-weight: 600; text-decoration: none; }
.play-resources a:hover { color: var(--accent); }
.play-resources a:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; border-radius: 3px; }
.resource-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: #153a36; color: var(--accent); }
.play-resources .resource-description { color: var(--muted); font-size: 13px; font-weight: 400; }
.catalog-hint { font-size: 14px; line-height: 1.6; }
.favorite-hint { color: #ffd166; }
.native-play-hint { color: var(--muted); font-size: 13px; }
.native-play-hint:empty { display: none; }
@media (max-width: 520px) { .play-resources { gap: 12px; margin-bottom: 18px; } .play-resources .resource-description { display: none; } .play-resources a { font-size: 13px; } }



/* On narrow screens, both card types collapse to the same single-column width. */

/* Separate GameMonetize and GamePix choices work on desktop and mobile. */
.provider-switch { display:flex; flex-wrap:wrap; gap:10px; align-items:center; margin: 10px 0 20px; }
.provider-switch-label { color:var(--muted); font-size:13px; font-weight:600; margin-right:4px; }
.provider-option { cursor:pointer; color:var(--text); background:var(--panel); border:1px solid var(--line); border-radius:9px; padding:10px 15px; font:inherit; font-weight:600; }
.provider-option.is-active { background:var(--accent); color:#071D3F; border-color:var(--accent); }
.provider-option:disabled { cursor:not-allowed; opacity:.58; }
.provider-option-note { margin-left:6px; font-size:11px; font-weight:500; }
.provider-option:focus-visible { outline: 2px solid var(--accent); outline-offset:3px; }
@media (max-width:520px) {
  .provider-switch { gap:8px; }
  .provider-switch-label { width:100%; }
  .provider-option { flex:1 1 150px; padding:10px 8px; }
}

/* Temporary provider-origin identifiers for CAGE catalog testing.
   Label-only, not a switch or an assertion that all sources are enabled. */
.provider-names { display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin:0 0 19px; }
.provider-names[hidden] { display:none !important; }
.provider-names-heading { color:var(--muted); font-size:12px; font-weight:600; margin-right:3px; }
.provider-name { display:inline-block; font-size:12px; padding:5px 9px;
  border:1px solid var(--line); border-radius:7px; color:var(--text); background:var(--panel); }
.game-provider-label { display:inline-block; font-size:11px; font-weight:600;
  padding:3px 7px; border:1px solid var(--line); border-radius:5px;
  color:var(--text); background:var(--panel); width:max-content; max-width:100%; }
.card-body .game-provider-label { margin-top:8px; }
.detail-copy > .game-provider-label { margin-bottom:12px; }
@media (max-width:520px) { .provider-names { gap:6px; }
  .provider-name { font-size:11px; padding:5px 7px; } }
