:root {
  --bg: #00997a; /* teal background */
  --surface: #075b48; /* dark section */
  --surface-2: #186755; /* slightly lighter panel */
  --text: #f6fffb; /* near-white */
  --muted: rgba(246, 255, 251, 0.78);
  --border: rgba(255, 255, 255, 0.14);

  --accent: #feaa00; /* orange */
  --accent-2: #20c997; /* bright teal button */
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.25);

  --radius: 16px;
  --radius-lg: 22px;

  --container: 1100px;
}

* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    Segoe UI,
    Roboto,
    Arial,
    sans-serif;
  background: var(--bg);
  color: var(--text);
}

/* utilities */
.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
}
a {
  color: var(--text);
  text-decoration: none;
}
a:hover {
  opacity: 0.92;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent-2);
  color: #063a2f;
}
.btn-accent {
  background: var(--accent);
  color: #1e1600;
}
.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 700;
}

/* top strip */
.top-strip {
  height: 8px;
  background: var(--accent);
}

/* header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}
.header-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 150px;
}
.brand .logo {
  height: 28px;
  width: 86px;
  border-radius: 8px;
  background: var(--accent);
  color: #1e1600;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  letter-spacing: 0.3px;
  font-size: 12px;
}

/* nav */
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
}
.nav a {
  font-size: 13px;
  font-weight: 700;
  color: rgba(246, 255, 251, 0.92);
  padding: 8px 8px;
  border-radius: 10px;
}
.nav a.active {
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid var(--border);
}

.nav .dropdown {
  position: relative;
}
.nav .dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.nav .dropdown-menu {
  position: absolute;
  top: 42px;
  left: 0;
  min-width: 220px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px;
  display: none;
}
.nav .dropdown-menu a {
  display: block;
  padding: 10px 10px;
  border-radius: 12px;
}
.nav .dropdown:hover .dropdown-menu {
  display: block;
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* mobile menu */
.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  height: 38px;
  width: 44px;
  border-radius: 12px;
  cursor: pointer;
}
.mobile-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.mobile-drawer .drawer-inner {
  padding: 14px 0 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mobile-drawer a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.08);
  font-weight: 800;
}

/* page shells */
.section {
  padding: 26px 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.panel-inner {
  padding: 22px;
}

.h1 {
  margin: 0 0 10px;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.2px;
  text-align: center;
}
.lead {
  margin: 0 auto;
  text-align: center;
  max-width: 900px;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}
.hero-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.hero-note {
  margin-top: 16px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

/* table of contents bar */
.toc-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: flex-start;
}
.toc {
  width: 100%;
  background: rgba(0, 0, 0, 0.12);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.toc summary {
  list-style: none;
  cursor: pointer;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 900;
  color: rgba(246, 255, 251, 0.92);
}
.toc summary::-webkit-details-marker {
  display: none;
}
.toc .toc-body {
  padding: 12px 12px 14px;
  border-top: 1px solid var(--border);
}
.toc ul {
  margin: 0;
  padding: 0 0 0 18px;
}
.toc li {
  margin: 8px 0;
}
.toc a {
  color: rgba(246, 255, 251, 0.9);
  font-weight: 700;
}

/* content sections */
.section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.2px;
}
.hr {
  height: 1px;
  background: var(--border);
  margin: 12px 0 14px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
  align-items: start;
}
.p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}
.phone-box {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}
.phone-box img {
  max-width: 180px;
  width: 100%;
  height: auto;
  opacity: 0.9;
  filter: drop-shadow(0 14px 24px rgba(0, 0, 0, 0.25));
}

/* steps */
.step-title {
  margin: 10px 0 6px;
  font-size: 14px;
  font-weight: 900;
}
.step-text {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 13px;
}
.callout {
  margin-top: 12px;
  padding: 12px 14px;
  background: rgba(0, 0, 0, 0.14);
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

/* footer */
.site-footer {
  margin-top: 26px;
  background: var(--bg);
}
.footer-strip {
  height: 8px;
  background: var(--accent);
}
.footer-inner {
  padding: 14px 0 22px;
  border-top: 1px solid rgba(0, 0, 0, 0.12);
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  justify-content: center;
  margin: 10px 0 8px;
}
.footer-links a {
  font-size: 12px;
  font-weight: 800;
  color: rgba(246, 255, 251, 0.9);
}
.footer-copy {
  text-align: center;
  font-size: 12px;
  color: rgba(246, 255, 251, 0.75);
}

/* small helpers */
.anchor-offset {
  scroll-margin-top: 92px;
}

/* helpers */
.actions-left {
  justify-content: flex-start;
}
.mt-12 {
  margin-top: 12px;
}


/* ===========================
   Readability + Lively Layout
   =========================== */
:root{
  --fs-base: 18px;
  --fs-p: 16px;
  --fs-li: 16px;
  --fs-lead: 18px;
  --fs-h1: 46px;
  --fs-h2: 30px;
  --fs-h3: 22px;
}

body{
  font-size: var(--fs-base);
  background:
    radial-gradient(900px 420px at 14% 10%, rgba(32, 201, 151, 0.25), rgba(0,0,0,0) 65%),
    radial-gradient(720px 380px at 82% 20%, rgba(254, 170, 0, 0.16), rgba(0,0,0,0) 60%),
    radial-gradient(900px 520px at 60% 90%, rgba(124, 77, 255, 0.16), rgba(0,0,0,0) 60%),
    linear-gradient(180deg, #00997a 0%, #075b48 58%, #054034 100%);
}

body::before{
  content:"";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(2px 2px at 12% 18%, rgba(255,255,255,0.22), rgba(0,0,0,0)),
    radial-gradient(2px 2px at 72% 24%, rgba(255,255,255,0.18), rgba(0,0,0,0)),
    radial-gradient(2px 2px at 38% 64%, rgba(255,255,255,0.14), rgba(0,0,0,0)),
    radial-gradient(2px 2px at 88% 78%, rgba(255,255,255,0.12), rgba(0,0,0,0));
  opacity: 0.9;
}

a:not(.btn){
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
a:not(.btn):hover{
  text-decoration: underline;
  opacity: 1;
}

/* sticky header with blur */
.site-header{
  background: rgba(7, 91, 72, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255,255,255,0.10);
  z-index: 1000;
}

.brand .logo{
  background: transparent;
  width: auto;
  height: auto;
  border-radius: 0;
  padding: 0;
}
.brand .logo img{
  height: 34px;
  width: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,0.35));
}

/* bigger nav */
.nav a{
  font-size: 15px;
  padding: 10px 10px;
}
.header-inner{
  height: 72px;
}

/* hero */
.hero{
  position: relative;
  padding: 44px 0 26px;
  background:
    linear-gradient(180deg, rgba(0,0,0,0.30), rgba(0,0,0,0.55)),
    url("../img/Fantasy-Gems-Official-BG.webp");
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.hero .panel{
  background: rgba(7, 91, 72, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.hero-feature{
  width: min(300px, 70%);
  height: auto;
  display: block;
  margin: 0 auto 14px;
  border-radius: 26px;
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: 0 22px 48px rgba(0,0,0,0.35);
}

/* typography */
.h1{
  font-size: var(--fs-h1);
}
.section-title{
  font-size: var(--fs-h2);
}
.section-subtitle,
.step-title{
  font-size: var(--fs-h3);
}
.lead{
  font-size: var(--fs-lead);
  line-height: 1.7;
}
.p, .step-text{
  font-size: var(--fs-p);
  line-height: 1.75;
}
li{
  font-size: var(--fs-li);
  line-height: 1.7;
}

/* centered content buttons */
.hero-actions,
.content-actions,
.center-actions{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* shiny hover buttons */
.btn{
  position: relative;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn::after{
  content:"";
  position:absolute;
  top:-40%;
  left:-55%;
  width: 40%;
  height: 180%;
  transform: rotate(18deg);
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,0.42), rgba(255,255,255,0));
  opacity: 0;
  transition: left .55s ease, opacity .2s ease;
}
.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0,0,0,0.28);
}
.btn:hover::after{
  left: 120%;
  opacity: 1;
}

/* step list with alternating media */
.steps{
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.step{
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 14px 14px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(0,0,0,0.14);
}
.step:nth-child(even){
  flex-direction: row-reverse;
}
.step .step-text-wrap{
  flex: 1;
  min-width: 0;
}
.step .step-media{
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.step .step-media img,
.phone-box img{
  max-width: 220px;
  width: 100%;
  height: auto;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.12);
  box-shadow: 0 18px 36px rgba(0,0,0,0.32);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.step .step-media img:hover,
.phone-box img:hover{
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 24px 52px rgba(0,0,0,0.38);
  filter: saturate(1.05);
}

/* panel padding */
.panel-inner{
  padding: 28px;
}

/* toc bigger */
.toc summary{
  font-size: 16px;
}
.toc a{
  font-size: 15px;
}

.actions-left{justify-content:center;}


/* ===========================
   Layout fixes requested
   =========================== */

/* Fixed header on all pages */
:root{
  --topStripH: 8px;
  --headerH: 72px;
}

/* Make room for fixed top strip + header */
body{
  padding-top: calc(var(--topStripH) + var(--headerH));
}

.top-strip{
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
}

.site-header{
  position: fixed;
  top: var(--topStripH);
  left: 0;
  right: 0;
  z-index: 9998;
}

/* Ensure in-page anchors do not hide behind fixed header */
.anchor-offset{
  scroll-margin-top: calc(var(--topStripH) + var(--headerH) + 16px);
}

/* Center text+image blocks on wide screens to avoid large empty gaps */
.grid-2{
  grid-template-columns: minmax(0, 640px) minmax(0, 380px);
  justify-content: center;
}
.grid-2 > div:first-child{
  max-width: 640px;
}

/* Step rows: center the combined block and prevent text column from stretching too wide */
.steps .step{
  justify-content: center;
}
.steps .step .step-text-wrap{
  flex: 0 1 640px;
  max-width: 640px;
}
.steps .step .step-media{
  flex: 0 0 380px;
}

/* Screenshot cleanup: crop small white edges and keep frames clean */
.step .step-media img,
.phone-box img{
  clip-path: inset(2.5% 2.5% 2.5% 2.5% round 18px);
}

/* Keep mobile layout unchanged */
@media (max-width: 900px){
  body{ padding-top: calc(var(--topStripH) + 70px); } /* header shrinks on small screens */
  .steps .step .step-text-wrap{
    flex: 1 1 auto;
    max-width: none;
  }
  .steps .step .step-media{
    flex: 0 0 auto;
  }
}



/* ===========================
   STEP LAYOUT FIXES (gap + multi-images + text-only list items)
   =========================== */

/* Keep images close to the text (no big empty gap inside the media column) */
.steps .step{
  overflow: hidden;
  justify-content: center;
}

/* Let media column size naturally and align media to the inner edge (near the text) */
.steps .step .step-media{
  flex: 0 0 auto !important;
  min-width: 0;
  justify-content: flex-start;
}
.steps .step:nth-child(even) .step-media{
  justify-content: flex-end;
}

/* If a step has no media, keep it left aligned (not centered) */
.step.step--text{
  justify-content: flex-start !important;
}
.step.step--text .step-text-wrap{
  flex: 1 1 auto !important;
  max-width: none !important;
}

/* Allow multiple screenshots inside .phone-box without overlap or overflow */
.phone-box{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  max-width: 520px;
}
.step:nth-child(odd) .phone-box{ justify-content: flex-start; }
.step:nth-child(even) .phone-box{ justify-content: flex-end; }

/* Make sure screenshots never exceed the card border */
.phone-box img{
  flex: 0 1 220px;
  max-width: 220px;
}

/* Plain bullet lists */
.bullet-list{
  margin: 10px 0 0;
  padding-left: 22px;
  list-style: disc;
}
.bullet-list li{
  margin: 8px 0;
  line-height: 1.7;
  color: rgba(246,255,251,0.92);
  text-align: left;
}



/* ===== Fantasy Gems homepage upgrades (carousel + hero + background) ===== */

/* Ensure full-width section backgrounds without obvious body gutters */
.section{
  margin: 0;
  padding: 44px 0;
}

/* Alternate section backgrounds (lighter/darker) */
main > section.section{
  background: var(--surface);
}
main > section.section:nth-of-type(even){
  background: var(--surface-2);
}

/* Reduce "panel inside different background" effect */
.panel{
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Remove the thin seam lines that look like gaps */
.site-header{
  border-bottom: none;
}
.hero{
  border-bottom: none;
}

/* HERO: no surface card, readable text, 3D title, side phones */
.hero .container{
  position: relative;
  z-index: 2;
}

.hero .panel{
  background: transparent;
  border: none;
  box-shadow: none;
}
.hero .panel-inner{
  padding: 8px 0;
}
.hero .h1{
  text-shadow:
    0 2px 0 rgba(0,0,0,0.25),
    0 8px 18px rgba(0,0,0,0.35),
    0 18px 34px rgba(0,0,0,0.30);
}
.hero .lead,
.hero .hero-note{
  text-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.hero .hero-note{
  background: rgba(0,0,0,0.20);
  border: 1px solid rgba(255,255,255,0.14);
}

.hero-phones{
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.hero-phone{
  position: absolute;
  width: min(270px, 34vw);
  height: auto;
  border-radius: 18px;
  filter: drop-shadow(0 18px 30px rgba(0,0,0,0.35));
  opacity: 0.98;
}
.hero-phone-left{
  left: clamp(-40px, -2vw, 12px);
  top: 110px;
  transform: perspective(950px) rotateY(16deg) rotateZ(-2deg);
}
.hero-phone-right{
  right: clamp(-40px, -2vw, 12px);
  top: 140px;
  transform: perspective(950px) rotateY(-16deg) rotateZ(2deg);
}

@media (max-width: 900px){
  .hero-phone-left,
  .hero-phone-right{
    display: none;
  }
  .hero .panel-inner{
    padding: 10px 0;
  }
}

/* ===== Carousel base ===== */
.fg-carousel{
  position: relative;
}
.fg-carousel__viewport{
  overflow: hidden;
  border-radius: 18px;
}
.fg-carousel__track{
  display: flex;
  gap: 14px;
  will-change: transform;
  transform: translate3d(0,0,0);
}

/* Buttons */
.fg-carousel__btn{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(0,0,0,0.28);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fg-carousel__btn--prev{ left: 10px; }
.fg-carousel__btn--next{ right: 10px; }

/* Auto screenshots carousel: 4 columns */
.fg-screens-carousel .fg-carousel__slide{
  flex: 0 0 calc((100% - (14px * 3)) / 4);
  background: rgba(0,0,0,0.14);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 10px;
}
.fg-screens-carousel .fg-carousel__slide img{
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

/* Games carousel: one slide at a time (reuse existing steps content word-for-word) */
.fg-carousel--single .fg-carousel__track{
  gap: 0;
}
.fg-carousel--games .steps.fg-carousel__track{
  flex-direction: row;
  margin: 12px 0 0;
  padding: 0;
}
.fg-carousel--games .step{
  flex: 0 0 100%;
  margin: 0;
}
.fg-carousel--games .step:nth-child(even){
  flex-direction: row;
}

@media (max-width: 992px){
  .fg-screens-carousel .fg-carousel__slide{
    flex: 0 0 calc((100% - 14px) / 2);
  }
}
@media (max-width: 560px){
  .fg-screens-carousel .fg-carousel__slide{
    flex: 0 0 100%;
  }
}
