/* ===============================================
   POLISH - GAME GUIDE (the hub with the five games, and the five guide pages)
   The same look as the bet slips and the profile pages: glass cards with a green top line and a
   crimson light, rounded corners. Loaded AFTER the page's own CSS (and Polish-Text.css / Polish-Game.css).
   Looks only: the links, the texts and the page scripts are not touched.
   To go back, remove this one <link> from the page.
   =============================================== */

:root {
  --pg2-green: #00ff92;
  --pg2-crimson: rgba(120, 0, 48, 0.5);
  --pg2-line: rgba(205, 205, 205, 0.12);
  --pg2-panel: linear-gradient(180deg, rgba(18, 18, 18, 0.94), rgba(6, 6, 6, 0.94));
}

/* ---------- THE HUB: one card for each game ---------- */
.gameguide-intro {
  flex-shrink: 0;
  width: 100%;
  margin-top: -14px;
  font-size: 15px;
  line-height: 1.4;
  color: rgba(215, 215, 215, 0.72);
  text-align: left;
}

/* Desktop: the cards (three in a row) scroll inside their own box, with the site's scroll bar. */
@media (min-width: 769px) {
  .gameguide-scroll-outer {
    display: flex;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
  }

  .gameguide-scroll-inner {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    height: 100%;
  }

  .gameguide-scroll-wrap {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    overflow-x: hidden;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .gameguide-scroll-wrap::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .gameguide-scrollbar-track {
    display: block;
    flex-shrink: 0;
    align-self: stretch;
    position: relative;
  }

  /* The thumb must be placed (absolute) or the script cannot move it: with six cards the list is taller than a short window. */
  .gameguide-scrollbar-thumb {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    cursor: pointer;
  }

  /* nothing on the page can be pushed sideways */
  .gameguide-body {
    overflow: clip;
  }

  .gameguide-content {
    flex: none;
    height: auto;
    padding: 4px 4px 18px;
    box-sizing: border-box;
  }
}

.gameguide-content {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: start;
  justify-items: stretch;
  gap: 22px;
}

.gameguide-card {
  width: auto;
  padding: 8px;
  border: 1px solid var(--pg2-line);
  border-top: 2px solid rgba(0, 255, 146, 0.5);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 85% 45% at 50% 0%, var(--pg2-crimson), rgba(0, 0, 0, 0) 72%),
    var(--pg2-panel);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.55), inset 0 0 22px rgba(205, 205, 205, 0.03);
  box-sizing: border-box;
  aspect-ratio: auto;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

/* A small "read" tag at the bottom right of every card. */
.gameguide-card::after {
  content: 'READ THE GUIDE  \203A';
  position: absolute;
  right: 14px;
  bottom: 12px;
  padding: 3px 10px;
  border: 1px solid rgba(0, 255, 146, 0.4);
  border-radius: 6px;
  background: rgba(6, 6, 6, 0.85);
  font: 700 10px/1.4 'JetBrains Mono', monospace;
  letter-spacing: 0.08em;
  color: var(--pg2-green);
  opacity: 0.85;
  transition: opacity 0.25s ease, background 0.25s ease;
}

@media (hover: hover) {
  .gameguide-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 255, 146, 0.45);
    border-top-color: var(--pg2-green);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.6), 0 0 22px rgba(0, 255, 146, 0.22), inset 0 0 22px rgba(0, 255, 146, 0.05);
  }

  .gameguide-card:hover::after {
    opacity: 1;
    background: rgba(0, 255, 146, 0.14);
  }
}

.gameguide-card:focus-visible {
  outline: 2px solid var(--pg2-green);
  outline-offset: 3px;
}

/* The scroll bar of the phone list. */
.gameguide-scrollbar-track {
  width: 5px;
  border-radius: 3px;
  background: rgba(205, 205, 205, 0.08);
}

.gameguide-scrollbar-thumb {
  width: 3px;
  border-radius: 2px;
  filter: none;
  box-shadow: 0 0 8px rgba(0, 255, 146, 0.65);
}

@media (max-width: 768px) {
  /* the same side space as the text pages */
  .gameguide-body {
    padding-left: 40px;
    padding-right: 40px;
  }

  .gameguide-intro {
    margin-top: -2px;
    font-size: 13px;
  }

  .gameguide-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .gameguide-card {
    width: 100%;
  }

  .gameguide-card {
    min-height: 150px;
    padding: 18px 16px 44px;
  }

  .gg-title {
    font-size: 28px;
  }
}

/* ---------- THE HUB CARDS: only text. Each game name has its own motion, repeated every 6 seconds ---------- */
.gameguide-card {
  --gg: #00ff92;
  --cd: 0s;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 190px;
  padding: 22px 24px 48px;
  overflow: hidden;
  text-decoration: none;
}

.gg-race { --gg: #00ff92; }
.gg-dice { --gg: #f5c542; }
.gg-coin { --gg: #4de1ff; }
.gg-card { --gg: #ff5fa8; }
.gg-slot { --gg: #b48cff; }
.gg-tale { --gg: #ff6a00; }

/* a coloured light behind the name */
.gameguide-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 90% at 12% 30%, color-mix(in srgb, var(--gg) 18%, transparent), transparent 70%);
  pointer-events: none;
}

.gg-title {
  position: relative;
  display: block;
  font: 700 clamp(26px, 2.4vw, 36px) / 1.1 'JetBrains Mono', monospace;
  letter-spacing: 0.02em;
  color: #f2f2f2;
  perspective: 600px;
  text-decoration: none;
}

.gg-title b {
  font-weight: 700;
  color: var(--gg);
  text-shadow: 0 0 18px var(--gg);
}

.gg-ch {
  display: inline-block;
  backface-visibility: visible;
}

.gg-line {
  position: relative;
  font-size: 15px;
  font-weight: 700;
  color: var(--gg);
}

.gg-sub {
  position: relative;
  font-size: 12px;
  line-height: 1.4;
  color: rgba(215, 215, 215, 0.62);
}

@media (prefers-reduced-motion: no-preference) {
  .gg-ch {
    animation-duration: 6s;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
    animation-delay: calc(var(--cd) + var(--i) * 0.05s);
  }

  /* RACE: the letters dash in from the left, leaning forward, and a streak of speed crosses the card */
  .gg-race .gg-ch { animation-name: gg-race; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }

  /* DICE: the letters tumble down like rolled dice and settle */
  .gg-dice .gg-ch { animation-name: gg-dice; animation-timing-function: ease-out; animation-delay: calc(var(--cd) + var(--i) * 0.07s); }

  /* COIN: every letter spins like a flipped coin and lands */
  .gg-coin .gg-ch { animation-name: gg-coin; animation-timing-function: cubic-bezier(0.3, 0.6, 0.3, 1); animation-delay: calc(var(--cd) + var(--i) * 0.06s); }

  /* CARD: the letters are dealt, thrown from the corner, turning as they land */
  .gg-card .gg-ch { animation-name: gg-deal; animation-timing-function: cubic-bezier(0.25, 1.1, 0.4, 1); animation-delay: calc(var(--cd) + var(--i) * 0.08s); }

  /* SLOT: the letters are reels: they spin fast and stop one after the other */
  .gg-slot .gg-ch { animation-name: gg-reel; animation-timing-function: linear; animation-delay: calc(var(--cd) + var(--i) * 0.14s); }

  /* TALE: the letters walk in one step after the other, like the knight on his path */
  .gg-tale .gg-ch { animation-name: gg-race; animation-timing-function: steps(6, end); animation-delay: calc(var(--cd) + var(--i) * 0.12s); }
}

@keyframes gg-race {
  0% { transform: translateX(-60px) skewX(-30deg); opacity: 0; filter: blur(4px); }
  6% { opacity: 1; }
  11% { transform: translateX(6px) skewX(8deg); filter: blur(0); }
  14%, 100% { transform: none; opacity: 1; filter: none; }
}

@keyframes gg-streak {
  0% { left: -70%; opacity: 0; }
  2% { opacity: 1; }
  14% { left: 120%; opacity: 0; }
  100% { left: 120%; opacity: 0; }
}

@keyframes gg-dice {
  0% { transform: translateY(-34px) rotateX(-300deg) rotateZ(-24deg); opacity: 0; }
  8% { opacity: 1; }
  15% { transform: translateY(5px) rotateX(18deg) rotateZ(5deg); }
  19% { transform: translateY(-3px) rotateX(-6deg); }
  23%, 100% { transform: none; opacity: 1; }
}

@keyframes gg-coin {
  0% { transform: rotateY(-720deg) translateY(-8px); opacity: 0; }
  6% { opacity: 1; }
  20% { transform: rotateY(0deg) translateY(0); }
  100% { transform: none; opacity: 1; }
}

@keyframes gg-deal {
  0% { transform: translate(-90px, -40px) rotate(-40deg) scale(0.4); opacity: 0; }
  10% { opacity: 1; }
  15% { transform: translate(6px, 4px) rotate(7deg) scale(1.1); }
  19%, 100% { transform: none; opacity: 1; }
}

@keyframes gg-reel {
  0% { transform: translateY(-120%); filter: blur(5px); opacity: 0; }
  2% { opacity: 1; }
  5% { transform: translateY(120%); }
  5.01% { transform: translateY(-120%); }
  8% { transform: translateY(120%); }
  8.01% { transform: translateY(-120%); }
  11% { transform: translateY(10%); filter: blur(2px); }
  13% { transform: translateY(-5%); filter: blur(0); }
  15%, 100% { transform: none; filter: none; opacity: 1; }
}

/* the race streak: a line of speed that crosses the name */
.gg-race .gg-title::after {
  content: '';
  position: absolute;
  left: -70%;
  top: 50%;
  width: 70%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--gg));
  box-shadow: 0 0 12px var(--gg);
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
  .gg-race .gg-title::after { animation: gg-streak 6s ease-in infinite; animation-delay: var(--cd); }
}

/* ---------- THE FIVE GUIDE PAGES: the reading panel ---------- */
main[class$="-body"] [class$="guide-scroll"] {
  border: 1px solid var(--pg2-line);
  border-top: 2px solid rgba(0, 255, 146, 0.5);
  border-left: 1px solid var(--pg2-line);
  border-radius: 12px;
  background:
    radial-gradient(ellipse 70% 30% at 50% 0%, var(--pg2-crimson), rgba(0, 0, 0, 0) 75%),
    var(--pg2-panel);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55), inset 0 0 26px rgba(205, 205, 205, 0.03);
}

/* Section titles: a small green tag look. */
[class$="guide-heading"] {
  color: var(--pg2-green);
  letter-spacing: 0.04em;
}

[class$="guide-highlight"] {
  border-radius: 4px;
}
