/* ============================================================
   WGPlayground embed player — gate-splash.css
   ------------------------------------------------------------
   Pre-launch "this game won't launch here" splashes. A family of
   states sharing the splash surface (cover/vignette/grain + brand
   row). Each card stacks a gamer-facing block (escape hatch) above
   an optional separated publisher block (diagnostic + fix/appeal).
   Tone variants recolor the accent:
     --gate-attention (amber)  transient, fixable (ads.txt)
     --gate-privacy   (indigo) calm, consent-related (gdpr)
     --gate-locked    (slate)  final, authoritative (hard block)

   Pairs with gate-splash.js. Ported from new_theme/game-final.html.
   Relies on the base .player-splash* surface already in game.html.
   ============================================================ */
.gate-card {
  --gate-accent: #f59e0b;            /* default: attention/amber */
  max-width: min(460px, calc(100% - 32px));
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  text-align: center;
  gap: 0;
}
.gate-card > * { max-width: 100%; min-width: 0; }
.gate-card--attention { --gate-accent: #f59e0b; }   /* amber  */
.gate-card--privacy   { --gate-accent: #818cf8; }   /* indigo */
.gate-card--locked    { --gate-accent: #94a3b8; }   /* slate  */
.gate-eyebrow { color: var(--gate-accent); }

/* --- Gamer block (primary) --- */
.gate-gamer {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 6px;
  width: 100%;
  min-width: 0;
}
.gate-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--gate-accent);
  margin-bottom: 12px;
  opacity: 0;
  transform: scale(.8);
  animation: splashLogoIn .6s var(--ease-pop, cubic-bezier(.34,1.56,.64,1)) .15s forwards;
}
.gate-icon svg { width: 46px; height: 46px; }
/* Owned here so gate-splash.css is self-contained (game.html's base
   splash CSS does not define this keyframe; without it the icon would
   stay at opacity:0). */
@keyframes splashLogoIn { to { opacity: 1; transform: translateY(0) scale(1); } }
.gate-title {
  font-size: clamp(19px, 3.4vw, 24px);
  font-weight: 800;
  letter-spacing: -.02em;
  color: #fff;
  margin: 0 0 8px;
  line-height: 1.2;
}
.gate-sub {
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .72);
  margin: 0 0 18px;
  max-width: 380px;
}
.gate-cta {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 46px;
  padding: 0 22px 0 16px;
  border-radius: 999px;
  background: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f97316 100%);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -.01em;
  box-shadow: 0 8px 22px -6px rgba(236, 72, 153, .55);
  transition: transform .12s, box-shadow .2s, filter .2s;
}
.gate-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px -6px rgba(236, 72, 153, .65);
  filter: brightness(1.06);
}
.gate-cta:active { transform: translateY(0); }
.gate-cta-ic {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .22);
}
.gate-cta-ic svg { width: 13px; height: 13px; }

/* --- Publisher block (secondary, separated) --- */
.gate-pub {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  text-align: left;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.gate-pub-head {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 8px;
}
.gate-pub-badge {
  flex-shrink: 0;
  color: var(--gate-accent);
  margin-top: 1px;
}
.gate-pub-badge svg { width: 18px; height: 18px; display: block; }
.gate-pub-headtext {
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .82);
}
.gate-pub-headtext strong { color: #fff; font-weight: 800; }
.gate-pub-howto {
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, .58);
  margin: 0 0 12px;
}
.gate-pub code,
.gate-pub-code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.gate-pub-howto code {
  font-size: 11.5px;
  background: rgba(255, 255, 255, .1);
  padding: 1px 5px;
  border-radius: 4px;
  color: rgba(255, 255, 255, .85);
}
.gate-pub-codewrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 12px;
  width: 100%;
  min-width: 0;
}
.gate-pub-code {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 11.5px;
  line-height: 1.4;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .38);
  border: 1px solid rgba(255, 255, 255, .12);
  color: #e8eaf0;
  overflow-x: auto;
  white-space: nowrap;
  display: flex;
  align-items: center;
}
.gate-pub-copy {
  flex-shrink: 0;
  padding: 0 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .16);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s;
}
.gate-pub-copy:hover { background: rgba(255, 255, 255, .2); }
.gate-pub-copy.is-copied {
  background: rgba(34, 197, 94, .25);
  border-color: rgba(34, 197, 94, .5);
  color: #86efac;
}
/* Action row: re-check / manage / learn / appeal */
.gate-pub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}
.gate-pub-recheck {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .22);
  color: rgba(255, 255, 255, .85);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.gate-pub-recheck:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .35);
  color: #fff;
}
.gate-recheck-ic { display: inline-grid; place-items: center; }
.gate-recheck-ic svg { width: 14px; height: 14px; display: block; }
.gate-pub-recheck.is-checking .gate-recheck-ic { animation: gateSpin .8s linear infinite; }
.gate-pub-recheck.is-verified { border-color: rgba(34, 197, 94, .55); color: #86efac; }
.gate-pub-recheck.is-failed   { border-color: rgba(245, 158, 11, .5); color: #fcd34d; }
.gate-pub-secondary {
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .18);
  color: rgba(255, 255, 255, .9);
  font-weight: 700;
  font-size: 12.5px;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.gate-pub-secondary:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); }
.gate-pub-link {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--gate-accent);
  white-space: nowrap;
  transition: filter .15s;
}
.gate-pub-link:hover { filter: brightness(1.15); text-decoration: underline; }
@keyframes gateSpin { to { transform: rotate(360deg); } }

/* ===== OFFLINE GATE: recommendations rail ===== */
/* The offline gate is wider — it leads with similar-game cards
   instead of a publisher panel. */
.gate-card--offline { max-width: min(540px, calc(100% - 32px)); }
.gate-card--offline .gate-sub { margin-bottom: 14px; }
.gate-recs {
  width: 100%;
  min-width: 0;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  text-align: left;
}
.gate-recs-head {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
  margin-bottom: 10px;
}
.gate-recs-list { display: flex; flex-direction: column; gap: 8px; }
.gate-rec-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: background .15s, border-color .15s, transform .12s;
}
.gate-rec-card:hover {
  background: rgba(255, 255, 255, .11);
  border-color: rgba(255, 255, 255, .2);
  transform: translateY(-1px);
}
.gate-rec-art {
  flex-shrink: 0;
  width: 46px; height: 46px;
  border-radius: 9px;
  background: var(--art, #333);
  background-size: cover;
  background-position: center;
  display: grid; place-items: center;
  overflow: hidden;
}
.gate-rec-art svg { width: 30px; height: 30px; }
.gate-rec-meta { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gate-rec-title {
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gate-rec-sub { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.gate-rec-genre { color: rgba(255, 255, 255, .6); }
.gate-rec-rating { color: #fbbf24; font-weight: 700; }
.gate-rec-play {
  flex-shrink: 0;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  transition: background .15s;
}
.gate-rec-card:hover .gate-rec-play { background: rgba(255, 255, 255, .26); }
.gate-rec-play svg { width: 13px; height: 13px; }
.gate-recs-empty { font-size: 13px; color: rgba(255,255,255,.7); }
.gate-recs-empty a { color: var(--gate-accent); font-weight: 700; }
/* Footer row: retry / note / help */
.gate-offline-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 16px;
}
.gate-offline-note {
  font-size: 12.5px;
  color: rgba(255, 255, 255, .55);
  font-style: italic;
}

/* ===== LOAD-FAILURE GATE ===== */
.gate-loadfail-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}
/* Retry is the hero — reuses .gate-cta styling but as a button. */
.gate-loadfail-retry {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.gate-loadfail-retry .gate-cta-ic svg { width: 14px; height: 14px; }
.gate-loadfail-retry.is-checking .gate-loadfail-retry-ic { animation: gateSpin .8s linear infinite; }
.gate-loadfail-retry.is-verified { filter: saturate(1.1) brightness(1.03); }
.gate-loadfail-retry.is-failed { filter: grayscale(.15); }
/* Secondary "Play on WGPlayground" fallback — quiet by default. */
.gate-loadfail-alt {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, .6);
  transition: color .15s, transform .15s;
}
.gate-loadfail-alt:hover { color: #fff; }
/* After persistent failure, elevate the fallback so it's obvious. */
.gate-card.is-persistent .gate-loadfail-alt {
  color: var(--gate-accent);
  font-size: 13.5px;
}
.gate-card.is-persistent .gate-loadfail-alt:hover { filter: brightness(1.15); text-decoration: underline; }
/* Offline variant recolors the accent to a calmer slate. */
.gate-card.is-offline { --gate-accent: #94a3b8; }

/* ===== REFERRER GATE ===== */
/* The corrected embed URL is long — let it wrap instead of scrolling
   so the publisher can read the whole thing. */
.gate-pub-code--wrap {
  white-space: normal;
  word-break: break-all;
  line-height: 1.5;
  display: block;
  align-items: stretch;
}
.gate-pub-codewrap--wrap { align-items: flex-start; }
.gate-pub-codewrap--wrap .gate-pub-copy { align-self: stretch; }
/* "Continue to game" — soft-warning primary action. Slightly calmer
   than a full launch CTA, but still clearly actionable. */
.gate-continue-btn { border: 0; cursor: pointer; font-family: inherit; }

@media (max-width: 560px) {
  .gate-card { padding: 18px 18px; }
  .gate-sub { font-size: 13px; }
  .gate-rec-title { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .gate-icon { animation: none; opacity: 1; transform: none; }
  .gate-pub-recheck.is-checking .gate-recheck-ic { animation: none; }
  .gate-loadfail-retry.is-checking .gate-loadfail-retry-ic { animation: none; }
  .gate-rec-card:hover { transform: none; }
}
