/* ==========================================================================
   Game detail page – themeable stylesheet for a WordPress `game` post type
   --------------------------------------------------------------------------
   Expected markup (output this from single-game.php or a block template):

   <main class="game">
     <section class="game-hero">
       <video class="game-hero__media" autoplay muted loop playsinline src="..."></video>
       <div class="game-hero__inner">
         <h1 class="game-hero__title">Cash Volt</h1>
         <p class="game-hero__desc">Short description…</p>
         <div class="game-hero__actions">
           <a class="btn btn--primary" href="#demo">Demo</a>
           <span class="badge">Playing in Coins</span>
         </div>
       </div>
     </section>

     <section class="game-stats">
       <dl class="stats">
         <div class="stat"><dt>RTP</dt><dd>95.71%</dd></div>
         <div class="stat"><dt>Max payout</dt><dd>2 500 x bet</dd></div>
         …
       </dl>
     </section>

     <section class="game-demo" id="demo">
       <div class="game-demo__frame"><iframe src="..." title="Cash Volt demo" allowfullscreen></iframe></div>
     </section>

     <section class="game-features">
       <h2>Game features</h2>
       <article class="feature">
         <img class="feature__img" src="..." alt="">
         <div class="feature__body"><h3>Cash Volt</h3><p>…</p></div>
       </article>
     </section>

     <footer class="game-legal">…</footer>
   </main>

   Optional: <a class="btn btn--secondary"> (gold outline), <a class="btn btn--gold">,
   and <h2>Game <span>features</span></h2> for the two-tone heading.

   Per-game theming: set the variables on the page wrapper, e.g.
   <main class="game" style="--accent:#e63946;">
   ========================================================================== */

/* ---------- Tokens ---------- */
.game {
  /* PlayTSOGO palette (sampled from the site) */
  --bg: #0c0d12;          /* page background */
  --surface: #161822;     /* cards, sidebar, search boxes */
  --surface-2: #20222e;   /* raised / hover surfaces */
  --text: #ffffff;
  --heading: #ffffff;     /* all headings */
  --muted: #a3a8b8;
  --accent: #00bce6;      /* cyan: active states, highlights */
  --accent-contrast: #04141a;
  --gold: #bc9860;        /* gold: secondary buttons, badges */
  --grad-start: #0aa7eb;  /* sign-up button gradient */
  --grad-end: #bd0efa;
  --brand-gradient: linear-gradient(90deg, var(--grad-start), var(--grad-end));
  --line: rgba(255, 255, 255, 0.08);

  --radius: 16px;
  --radius-sm: 10px;
  --gap: clamp(1rem, 2.5vw, 2rem);
  --section-space: clamp(2.5rem, 6vw, 5rem);
  --content-width: 1120px;

  background: var(--bg);
  color: var(--text);
  font-family: "Montserrat", "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}

.game *,
.game *::before,
.game *::after {
  box-sizing: border-box;
}

.game img,
.game video,
.game iframe {
  display: block;
  max-width: 100%;
}

/* Shared horizontal container for every section */
.game-stats,
.game-demo,
.game-features,
.game-legal,
.game-hero__inner {
  width: min(100% - 2rem, var(--content-width));
  margin-inline: auto;
}

.game h2 {
  margin: 0 0 1.25rem;
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

/* Two-tone section headings like "FEATURED CASINO": wrap the second part in <span> */
.game h2 span {
  color: var(--accent);
}

.game h3 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

/* ---------- Buttons & badges ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 2rem;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.btn--primary {
  background: var(--brand-gradient);
  color: #fff;
}

.btn--secondary {
  background: transparent;
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--gold);
}

.btn--gold {
  background: var(--gold);
  color: #1a1308;
}

.btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--gold);
  font-size: 0.9rem;
  font-weight: 600;
}

.game a:focus-visible,
.game button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ---------- Hero ---------- */
.game-hero {
  position: relative;
  display: grid;
  align-items: end;
  min-height: clamp(360px, 55vw, 600px);
  overflow: hidden;
  isolation: isolate;
}

.game-hero__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Darkens the bottom so the text always stays readable over any banner */
.game-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, var(--bg) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0) 100%);
}

.game-hero__inner {
  padding-block: clamp(1.5rem, 4vw, 3rem);
}

.game-hero__title {
  margin: 0 0 0.5rem;
  font-size: clamp(2.4rem, 7vw, 4.5rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.game-hero__desc {
  max-width: 62ch;
  margin: 0 0 1.5rem;
  color: var(--text);
  opacity: 0.9;
}

.game-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
}

/* ---------- Stats grid ---------- */
.game-stats {
  margin-top: var(--section-space);
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line); /* shows through the 1px gaps as dividers */
}

.stat {
  padding: 1.1rem 1.25rem;
  background: var(--surface);
}

.stat dt {
  margin: 0 0 0.25rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.stat dd {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* Highlight the key number (e.g. add class="stat stat--key" to Max payout) */
.stat--key dd {
  color: var(--accent);
}

/* ---------- Demo frame ---------- */
.game-demo {
  margin-top: var(--section-space);
}

.game-demo__frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #000;
}

.game-demo__frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Feature blocks ---------- */
.game-features {
  margin-top: var(--section-space);
}

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  align-items: center;
  gap: var(--gap);
  padding: var(--gap);
  border-radius: var(--radius);
  background: var(--surface);
}

.feature + .feature {
  margin-top: var(--gap);
}

/* Alternate image side on every second feature */
.feature:nth-of-type(even) .feature__img {
  order: 2;
}

.feature__img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

.feature__body p {
  max-width: 60ch;
  margin: 0;
  color: var(--muted);
}

/* ---------- Legal / footer ---------- */
.game-legal {
  margin-top: var(--section-space);
  padding-block: 2rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.game-legal a {
  color: inherit;
}

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .feature {
    grid-template-columns: 1fr;
  }

  .feature:nth-of-type(even) .feature__img {
    order: 0;
  }

  .btn {
    width: 100%;
  }

  .stat dd {
    font-size: 1.15rem;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }

  .btn:hover {
    transform: none;
  }

  .game-hero__media {
    display: none; /* skip autoplaying video; hero keeps its dark background */
  }
}

/* ---------- Page chrome & archive grid (added by plugin) ---------- */
body.single-game,
body.post-type-archive-game {
  background: #0c0d12;
}

.game-archive__head {
  width: min(100% - 2rem, var(--content-width));
  margin: 2rem auto 1.5rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
  width: min(100% - 2rem, var(--content-width));
  margin: 0 auto var(--section-space);
  padding: 0;
  list-style: none;
}

.game-card {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.15s ease;
}

.game-card:hover {
  transform: translateY(-3px);
}

.game-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.game-card__title {
  padding: 0.75rem 1rem;
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  .game-card { transition: none; }
  .game-card:hover { transform: none; }
}

/* ---------- Heading & button colour fixes (beat theme overrides) ---------- */
.game h1,
.game h2,
.game h3,
.game .game-hero__title,
.game .feature__body h3 {
  color: var(--heading, #ffffff);
}

/* keep the two-tone accent word cyan */
.game h2 span {
  color: var(--accent);
}

/* theme link styles must not change button text */
.game a.btn,
.game a.btn:hover,
.game a.btn:visited {
  text-decoration: none;
}

.game a.btn--primary,
.game a.btn--primary:hover,
.game a.btn--primary:visited {
  color: #ffffff;
}

/* Play for Real Money: bright gold with near-black text for maximum contrast */
.game a.btn--real,
.game a.btn--real:visited {
  background: linear-gradient(180deg, #ffe27a 0%, #ffb81f 100%);
  color: #1a1000;
  font-weight: 800;
  letter-spacing: 0.01em;
  box-shadow: 0 0 0 1px rgba(255, 226, 122, 0.4), 0 6px 20px rgba(255, 184, 31, 0.25);
}

.game a.btn--real:hover {
  color: #1a1000;
}

/* ---------- Force white headings (wins against theme/page-builder heading styles) ---------- */
body main.game h1,
body main.game h1.game-hero__title,
body main.game .game-hero__title,
body main.game h2,
body main.game h3 {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  opacity: 1 !important;
  background: none !important;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
}

body main.game h2 span {
  color: var(--accent) !important;
  -webkit-text-fill-color: var(--accent) !important;
}

/* make sure nothing paints over the hero text */
.game-hero__inner {
  position: relative;
  z-index: 1;
}
