/* ═══════════════════════════════════════════════════════════
   MOO FACTORY — crazygames.css  (v1.8.8)
   Styles for the CrazyGames SDK integration UI:
   • #cgBoostBtn   — rewarded ×2 boost button (HUD, under SELL)
   • #cgAdVeil     — input-blocking overlay while an ad plays
   • v2.2: #cgBannerWrap (title-screen banner) REMOVED — the
     main menu carries no banner ad anymore
   • settings rows + offline ×2 button + body state classes
   Matches the game's pixel-art design system.
   ═══════════════════════════════════════════════════════════ */

/* ═══════════ REWARDED BOOST BUTTON (HUD) ═══════════ */
/* v1.8.19 QA #4: width auto + right alignment (the parent .hud-right is
   a flex column with align-items:flex-end). The boost sizes to its OWN
   content and can never stretch the container that holds the SELL
   button — SELL's rect stays independent of boost visibility, state
   text, size or width. */
.cg-boost {
  display: flex; align-items: center; gap: 8px;
  width: auto; max-width: 100%;
  background: var(--cream);
  border: 3px solid var(--wood);
  box-shadow: var(--shadow);
  color: var(--ink);
  cursor: pointer;
  padding: 7px 10px;
  font-family: var(--font-px);
  font-size: 10px;
  line-height: 1.4;
  text-align: left;
  transition: filter .1s;
}
.cg-boost:hover { filter: brightness(1.06); }
.cg-boost:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.cg-boost[disabled] { cursor: not-allowed; transform: none; }

.cg-boost-ico { flex: 0 0 26px; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center; }
.cg-boost-ico .pix-ico { width: 26px; height: 26px; }
.cg-boost-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cg-boost-main small {
  font-family: var(--font-px);
  font-size: 8px;
  color: var(--ink-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* states */
.cg-boost.cg-boost-ready {
  background: var(--gold);
  border-color: var(--gold-dark);
  color: #5b3a00;
  animation: cgBoostPulse 1.6s ease-in-out infinite;
}
.cg-boost.cg-boost-ready .cg-boost-main small { color: #7a4f00; }
@keyframes cgBoostPulse { 50% { filter: brightness(1.12); } }

.cg-boost.cg-boost-active {
  background: var(--green);
  border-color: var(--green-dark);
  color: #fff;
}
.cg-boost.cg-boost-active .cg-boost-main small { color: #dff0da; }

.cg-boost.cg-boost-cool,
.cg-boost.cg-boost-off { filter: grayscale(.65) brightness(.92); }
.cg-boost.cg-boost-busy { filter: brightness(.95); }

/* narrow phones: tighter boost button under SELL */
@media (max-width: 560px) {
  .cg-boost { padding: 5px 8px; font-size: 9px; gap: 6px; }
  .cg-boost-ico { flex-basis: 22px; width: 22px; height: 22px; }
  .cg-boost-ico .pix-ico { width: 22px; height: 22px; }
  .cg-boost-main small { font-size: 7px; }
}
/* very short landscape screens: keep it compact */
@media (max-height: 520px) {
  .cg-boost { padding: 4px 8px; }
}

/* ═══════════ AD VEIL (blocks input while an ad plays) ═══════════ */
/* v1.8.26 CrazyGames QA #1.2: the veil now FADES in and out (~300ms)
   instead of snapping — the transition into an ad and the return into
   gameplay both read as intentional. `instant` hides (JS) skip the
   transition entirely so an unfilled midgame request never blinks.
   While fading the veil is opacity-transient but still input-blocking
   (fixed, full-viewport, pointer-events:auto) — the SDK requirement
   that nothing is clickable during a request stays satisfied. */
#cgAdVeil {
  position: fixed; inset: 0;
  z-index: 5000;
  background: rgba(16, 22, 16, .78);
  display: flex; align-items: center; justify-content: center;
  pointer-events: auto;
  opacity: 0;
  transition: opacity .3s ease;
}
#cgAdVeil.hidden { display: none; }
#cgAdVeil.on { opacity: 1; }
/* midgame ads: a brief pure BLACKOUT (the ad card would add clutter
   between two pieces of moving media — the fade itself is the polish) */
body.cg-midgame #cgAdVeil { background: #070b07; }
body.cg-midgame #cgAdVeil .cg-ad-card { display: none; }
.cg-ad-card {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  background: var(--cream);
  border: 3px solid var(--wood);
  box-shadow: var(--shadow);
  padding: 22px 34px;
  text-align: center;
  max-width: min(86vw, 420px);
}
.cg-ad-ico { display: inline-flex; line-height: 0; }
.cg-ad-ico .pix-ico { width: 44px; height: 44px; }
.cg-ad-t1 {
  font-family: var(--font-px);
  font-size: 15px;
  color: var(--ink);
  letter-spacing: 2px;
  animation: cgAdBlink 1.1s ease-in-out infinite;
}
@keyframes cgAdBlink { 50% { opacity: .55; } }
.cg-ad-t2 {
  font-family: var(--font-px);
  font-size: 8px;
  color: var(--ink-soft);
  line-height: 1.7;
}

/* hard input block for the whole game UI while an ad is requested/playing */
body.cg-ad-blocked #hud,
body.cg-ad-blocked #navDock,
body.cg-ad-blocked #panelWrap,
body.cg-ad-blocked #titleScreen,
body.cg-ad-blocked #toastZone,
body.cg-ad-blocked #modalWrap,
body.cg-ad-blocked #eventBadge,
body.cg-ad-blocked #tutRoot,
body.cg-ad-blocked canvas { pointer-events: none !important; }

/* ═══════════ SETTINGS PANEL ROWS ═══════════ */
.set-row .cg-status-ico { display: inline-flex; }
.set-row .cg-status-ico .pix-ico { width: 24px; height: 24px; }
.cg-avatar {
  width: 36px; height: 36px;
  border: 2px solid var(--wood);
  background: var(--cream-dark);
  image-rendering: pixelated;
  flex: 0 0 36px;
}
.cg-user-name { font-family: var(--font-px); font-size: 8px; }

/* ═══════════ OFFLINE MODAL ×2 BUTTON ═══════════ */
/* the ad button and the plain COLLECT button share size/typography
   (advertisement requirements: never a misleading button hierarchy) */
.modal-actions .btn-cg-offline,
.modal-actions .btn-cg-collect { min-width: 46%; }
.btn-cg-offline[disabled] { filter: grayscale(.8) brightness(.85); cursor: not-allowed; }

/* ═══════════ MOBILE / RESPONSIVE ═══════════ */
@media (max-width: 560px) {
  .modal-actions .btn-cg-offline,
  .modal-actions .btn-cg-collect { min-width: 0; width: 100%; }
  .cg-ad-card { padding: 16px 20px; }
  .cg-ad-t1 { font-size: 13px; }
}
/* v2.2: the landscape-phone banner nudge (#cgBannerWrap bottom offset)
   is gone with the banner itself — nothing to keep clear of anymore. */
