/* Game introduction pop-up (game-intro.js): picture header, what the game is, how to play, screenshots, Play button. */
html body dialog#gameIntro {
  --intro-ink: #241a3d;
  --intro-panel: #fffaf0;
  --intro-soft: #f3ecff;
  --intro-muted: #5d5070;
  width: min(580px, calc(100vw / var(--site-zoom, 1) - 24px));
  max-width: none;
  max-height: calc(100dvh / var(--site-zoom, 1) - 24px);
  padding: 0;
  overflow: hidden;
  border: 3px solid var(--intro-ink);
  border-radius: 24px;
  background: var(--intro-panel);
  color: var(--intro-ink);
  box-shadow: 0 24px 60px #1b0f3a66, 8px 8px 0 var(--intro-ink);
}
html[data-theme="dark"] body dialog#gameIntro {
  --intro-ink: #f5f0ff;
  --intro-panel: #211b30;
  --intro-soft: #2d2541;
  --intro-muted: #c4b8d8;
  border-color: #5d4c7a;
  box-shadow: 0 24px 60px #000a;
}
html body dialog#gameIntro[open] { display: flex; flex-direction: column; }
dialog#gameIntro::backdrop { background: #1c1033b0; backdrop-filter: blur(6px); }

/* Header: the game's card gradient with its picture. */
#gameIntro .intro-hero {
  position: relative;
  flex: none;
  height: 168px;
  overflow: hidden;
  background: var(--intro-bg);
}
#gameIntro .intro-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, #ffffff66, transparent 60%),
    radial-gradient(#ffffff2e 1.5px, transparent 2px) 0 0 / 18px 18px;
}
#gameIntro .intro-art {
  position: absolute;
  left: 50%;
  bottom: -18px;
  height: 196px;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 16px #1b0f3a55);
}
html body #gameIntro .intro-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 0;
  padding: 0;
  border: 2px solid #ffffffb0 !important;
  border-radius: 50% !important;
  background: #ffffff59 !important;
  color: #20163a !important;
  box-shadow: none !important;
  font: 700 24px/1 system-ui, sans-serif;
}
html body #gameIntro .intro-close:hover { background: #ffffffa0 !important; transform: none; }

/* Body scrolls; the Play button stays at the bottom. */
#gameIntro .intro-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 18px 24px 8px; text-align: left; overscroll-behavior: contain; }
html body #gameIntro h2 { margin: 0; color: var(--intro-ink); font-size: 28px; line-height: 1.15; letter-spacing: -.02em; }
html body #gameIntro .intro-tagline { margin: 6px 0 0; color: var(--intro-muted); font-size: 15px; font-weight: 600; }
#gameIntro .intro-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
#gameIntro .intro-chips span {
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--intro-soft);
  color: var(--intro-ink);
  font-size: 12.5px;
  font-weight: 700;
}
html body #gameIntro .intro-text { margin: 14px 0 0; color: var(--intro-ink); font-size: 15px; line-height: 1.6; }
html body #gameIntro h3 { margin: 18px 0 8px; color: var(--intro-ink); font-size: 16px; }
#gameIntro .intro-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
#gameIntro .intro-steps li {
  position: relative;
  padding: 8px 12px 8px 44px;
  border-radius: 12px;
  background: var(--intro-soft);
  font-size: 14px;
  line-height: 1.45;
  counter-increment: step;
}
#gameIntro .intro-steps li::before {
  content: counter(step);
  position: absolute;
  top: 7px;
  left: 10px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #7c4dff;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}
html body #gameIntro .intro-tip {
  margin: 12px 0 0;
  padding: 9px 12px;
  border: 2px dashed #f2b92b;
  border-radius: 12px;
  background: #fff4c7;
  color: #3b2a07;
  font-size: 13.5px;
}
html[data-theme="dark"] body #gameIntro .intro-tip { background: #3a3016; color: #ffeaa6; border-color: #8a6d1f; }

/* Screenshots: a swipeable row; tap one to make it bigger. */
#gameIntro .intro-shots {
  display: flex;
  gap: 10px;
  margin: 0 -24px;
  padding: 2px 24px 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
}
html body #gameIntro .intro-shot {
  flex: none;
  height: 300px;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 2px solid var(--intro-ink) !important;
  border-radius: 14px !important;
  background: #fff !important;
  box-shadow: 0 6px 16px #1b0f3a33 !important;
  scroll-snap-align: start;
  cursor: zoom-in;
  transition: height 220ms ease;
}
html body #gameIntro .intro-shot:hover { transform: none; }
#gameIntro .intro-shot img { display: block; height: 100%; width: auto; }
html body #gameIntro .intro-shot-wide { height: 230px; }
html body #gameIntro .intro-shot-big { height: min(560px, calc(70dvh / var(--site-zoom, 1))); cursor: zoom-out; }
html body #gameIntro .intro-shot-wide.intro-shot-big { height: min(330px, calc(50dvh / var(--site-zoom, 1))); }

#gameIntro .intro-actions {
  display: flex;
  flex: none;
  gap: 10px;
  padding: 12px 24px 16px;
  border-top: 1px solid color-mix(in srgb, var(--intro-ink) 14%, transparent);
  background: var(--intro-panel);
}
html body #gameIntro .intro-actions button { min-height: 50px; margin: 0; border-radius: 999px !important; font-size: 16px; font-weight: 800; }
html body #gameIntro .intro-play {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0 !important;
  background: linear-gradient(100deg, #7c4dff, #c04dff 55%, #ff5fa2) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px #7c4dff55 !important;
}
html body #gameIntro .intro-play::before {
  content: '';
  width: 12px;
  height: 14px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
html body #gameIntro .intro-play:hover { filter: brightness(1.08); transform: translateY(-1px); }
html body #gameIntro .intro-later {
  padding: 0 22px;
  border: 2px solid color-mix(in srgb, var(--intro-ink) 25%, transparent) !important;
  background: transparent !important;
  color: var(--intro-ink) !important;
  box-shadow: none !important;
}
@media (max-width: 560px) {
  html body dialog#gameIntro { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 20px; }
  #gameIntro .intro-hero { height: 140px; }
  #gameIntro .intro-art { height: 164px; }
  #gameIntro .intro-body { padding: 14px 16px 6px; }
  #gameIntro .intro-shots { margin: 0 -16px; padding-inline: 16px; }
  html body #gameIntro h2 { font-size: 24px; }
  html body #gameIntro .intro-shot { height: 260px; }
  html body #gameIntro .intro-shot-wide { height: 170px; }
  #gameIntro .intro-actions { padding: 10px 16px 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  dialog#gameIntro[open] { animation: intro-pop 320ms cubic-bezier(.34, 1.4, .64, 1); }
  dialog#gameIntro[open] .intro-art { animation: intro-art 600ms 80ms cubic-bezier(.34, 1.56, .64, 1) both; }
  @keyframes intro-pop { from { opacity: 0; transform: translateY(18px) scale(.96); } }
  @keyframes intro-art { from { opacity: 0; transform: translate(-50%, 30px) scale(.8); } }
}
