/* How to Play — GridGames theme */

/* Base helpers (if not already in global.css) */
.gg-container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.gg-h2 {
  font-family: var(--gg-font-display, "Orbitron", system-ui);
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}

.gg-muted {
  opacity: 0.82;
}
.gg-small {
  font-size: 0.95rem;
}

.gg-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  opacity: 0.85;
  margin: 0 0 10px;
}

.gg-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  font-size: 0.95rem;
}

/* Cards */
.gg-card {
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  padding: 22px;
}

.gg-card--soft {
  background: rgba(0, 0, 0, 0.35);
}

/* HERO */
.gg-how-hero {
  position: relative;
  padding: 88px 0 54px;
  overflow: hidden;
}

.gg-how-hero__bg {
  position: absolute;
  inset: -2px;
  background: radial-gradient(
      900px 420px at 18% 20%,
      rgba(0, 140, 255, 0.22),
      transparent 60%
    ),
    radial-gradient(
      900px 420px at 78% 35%,
      rgba(255, 110, 20, 0.22),
      transparent 60%
    ),
    radial-gradient(
      700px 420px at 50% 85%,
      rgba(150, 70, 255, 0.14),
      transparent 60%
    );
  pointer-events: none;
}

.gg-how-hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 34px;
  align-items: start;
}

.gg-how-hero__title {
  font-family: var(--gg-font-display, "Orbitron", system-ui);
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  line-height: 1.05;
  margin: 0 0 12px;
}

.gg-how-hero__subtitle {
  margin: 0 0 18px;
  opacity: 0.9;
  font-size: 1.05rem;
  max-width: none;
}

.gg-how-hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0 18px;
}

.gg-how-hero__meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

/* STEPS */
.gg-how-steps {
  padding: 56px 0 30px;
}

.gg-section-head {
  margin-bottom: 18px;
}

.gg-how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gg-step {
  position: relative;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(12px);
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.gg-step::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(
      420px 220px at 10% 20%,
      rgba(0, 140, 255, 0.12),
      transparent 60%
    ),
    radial-gradient(
      420px 220px at 90% 10%,
      rgba(255, 110, 20, 0.12),
      transparent 60%
    );
  pointer-events: none;
}

.gg-step__num {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 0 22px rgba(255, 120, 30, 0.1);
  font-family: var(--gg-font-display, "Orbitron", system-ui);
  margin-bottom: 12px;
}

.gg-step__title {
  position: relative;
  margin: 0 0 8px;
  font-size: 1.2rem;
}

.gg-step__text {
  position: relative;
  margin: 0 0 16px;
  line-height: 1.6;
  opacity: 0.9;
}

/* Step 1 – Game rooms image link */
.gg-step__rooms-label {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.75;
  margin: 18px 0 10px;
  text-align: center;
}

.gg-game-rooms-link {
  display: block; /* was inline-block */
  width: fit-content;
  margin: 0 auto; /* centers it */
  position: relative;
  line-height: 0;
}

.gg-game-rooms-img {
  height: 60px; /* adjust if needed */
  width: auto;
  display: block;
}

/* stack hover image on top */
.gg-game-rooms-img--hover {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.gg-game-rooms-link:hover .gg-game-rooms-img--hover {
  opacity: 1;
}

.gg-game-rooms-link:hover .gg-game-rooms-img--default {
  opacity: 0;
}

.gg-step__text + .gg-step__rooms-label {
  margin-top: 22px;
}

.gg-step__bullets {
  position: relative;
  margin: 0;
  padding-left: 18px;
  opacity: 0.86;
}

.gg-step--cta {
  border-color: rgba(255, 120, 30, 0.3);
}

/* Card 6: make it match the other cards */
.gg-step--ready {
  text-align: left; /* remove centered layout */
}

.gg-step--ready .gg-step__num {
  margin: 0 0 12px 0; /* ensure it sits top-left like others */
}

.gg-step--ready .gg-step__title {
  font-size: 32px;
  margin: 0 0 8px;
  text-align: center;
}

.gg-step--ready .gg-step__actions {
  justify-content: flex-start; /* align button left like other content */
  margin-top: 18px;
}

/* INFO */
.gg-how-info {
  padding: 26px 0 56px;
}

.gg-how-info__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.gg-checklist {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.gg-checklist li {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
}

.gg-check {
  width: 12px;
  height: 12px;
  margin-top: 6px;
  border-radius: 3px;
  border: 1px solid rgba(255, 120, 30, 0.55);
  box-shadow: 0 0 16px rgba(255, 120, 30, 0.12);
}

/* FINAL CTA */
.gg-how-final {
  margin-top: 22px;
  border-radius: 22px;
  border: 1px solid rgba(255, 120, 30, 0.26);
  background: rgba(0, 0, 0, 0.45);
  box-shadow: 0 0 0 1px rgba(255, 120, 30, 0.12),
    0 18px 60px rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.gg-how-final__inner {
  padding: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.gg-how-final__title {
  margin: 0;
  font-family: var(--gg-font-display, "Orbitron", system-ui);
}

.gg-how-final__text {
  margin: 0;
  opacity: 0.86;
}

/* HOW TO PLAY – VIDEO (iframe) */
.gg-how-video {
  padding: 72px 0;
}

.gg-how-video__header {
  max-width: 1000px;
  margin-bottom: 28px;
}

.gg-how-video__text {
  opacity: 0.9;
  line-height: 1.6;
}

/* Responsive iframe wrapper */
.gg-how-video__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.55);
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);
}

.gg-how-video__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Card 4 only — CLICK to flip (checkbox toggle) */
.gg-step--flip {
  perspective: 1200px;
  padding: 0 !important; /* Remove padding here so faces can fill the space */
  min-height: 320px; /* Adjust based on your content height */
}

/* Hide checkbox */
.gg-flip-toggle {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Clickable label fills card */
.gg-flip {
  display: block;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

/* 3D inner */
.gg-flip__inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d; /* KEEP THIS */
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);

  /* ADD THESE TO FIX BLUR */
  transform: translateZ(0);
  will-change: transform;
  -webkit-font-smoothing: subpixel-antialiased;
}

.gg-step--flip .gg-flip__inner {
  padding: 22px; /* matches .gg-step padding */
}

/* Flip when checked */
.gg-flip-toggle:checked + .gg-flip .gg-flip__inner {
  transform: rotateY(180deg);
}

/* Faces */
.gg-flip__face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;

  /* Force the browser to render text on a clean pixel grid */
  -webkit-font-smoothing: subpixel-antialiased;

  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(10, 10, 10, 0.9); /* Solidify color to avoid filter noise */
  padding: 22px;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.45);

  /* Keep the face 'flat' until the flip happens */
  transform: rotateX(0deg);
}

/* Ensure the back face is flipped and styled like a CTA card if desired */
.gg-flip__back {
  transform: rotateY(180deg) translateZ(0.1px);
  border-color: rgba(255, 120, 30, 0.3); /* Match your --cta style */
  text-align: left;
}

/* Re-apply the radial glow effect to the faces */
.gg-flip__face::before {
  content: "";
  position: absolute;
  inset: -2px;
  background: radial-gradient(
      420px 220px at 10% 20%,
      rgba(0, 140, 255, 0.12),
      transparent 60%
    ),
    radial-gradient(
      420px 220px at 90% 10%,
      rgba(255, 110, 20, 0.12),
      transparent 60%
    );
  pointer-events: none;
  border-radius: 22px;
}

.gg-flip-pill {
  display: inline-block;
  margin-top: 18px;
  padding: 10px 18px;
  border-radius: 999px;

  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;

  color: #ff7a18; /* orange text */
  background: transparent;

  border: 1px solid rgba(255, 122, 24, 0.75);
  box-shadow: 0 0 0 1px rgba(255, 122, 24, 0.35),
    0 0 18px rgba(255, 122, 24, 0.25);

  pointer-events: none; /* IMPORTANT: allow card click-through */
}

/* Tile rules (Card 4 – flip back) */
.gg-tile-rules {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}

.gg-tile-rules li {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

/* The colored square */
.gg-tile {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.25);
}

/* Tile colors */
.gg-tile--red {
  background: #ff3b30;
}

.gg-tile--blue {
  background: #0a84ff;
}

.gg-tile--green {
  background: #30d158;
}

/* Rule text */
.gg-tile-text {
  font-size: 0.95rem;
}

/* Flip-back face alignment rules */
.gg-step--flip .gg-flip__back {
  text-align: left; /* baseline */
}

/* Title stays left */
.gg-step--flip .gg-flip__back .gg-step__title {
  text-align: left;
}

/* Tile rules: center each tile row */
.gg-step--flip .gg-flip__back .gg-tile-rules {
  display: flex;
  flex-direction: column;
  align-items: center; /* centers rows */
  margin-top: 18px;
}

.gg-step--flip .gg-flip__back .gg-tile-rules li {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Center the tile text itself */
.gg-step--flip .gg-flip__back .gg-tile-text {
  text-align: center;
}

.gg-step--flip .gg-flip__front .gg-flip-pill,
.gg-step--flip .gg-flip__back .gg-flip-pill {
  display: block;
  width: fit-content;
  margin: 22px auto 0;
  text-align: center;
}

/* Responsive */
@media (max-width: 1100px) {
  .gg-how-hero__inner {
    grid-template-columns: 1fr;
  }
  .gg-how-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .gg-how-hero {
    padding: 74px 0 40px;
  }
  .gg-how-grid {
    grid-template-columns: 1fr;
  }
  .gg-how-info__grid {
    grid-template-columns: 1fr;
  }
  .gg-how-final__inner {
    align-items: flex-start;
  }
}
