*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark:  #1b5e2f;
  --green-mid:   #2e7d32;
  --green-btn:   #2e7d32;
  --orange-btn:  #ff9500;
  --white:       #ffffff;
  --text-dark:   #1a2e1a;
  --card-bg:     rgba(255,255,255,0.93);
  --shadow:      0 8px 32px rgba(0,0,0,0.14);
}

/* ── Lock everything to one viewport ── */
html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: 'Nunito', 'Segoe UI', sans-serif;
  color: var(--text-dark);
}

/* ======================================
   LOCKED CARD
====================================== */

.locked-card {
  position: relative;
}

.locked-card.locked {
  filter: grayscale(0.8);
  opacity: 0.75;
  overflow: hidden;
}

.lock-overlay {
  position: absolute;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  /* CLEAR GLASS */
  background: rgba(255, 255, 255, 0.03);

  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);

  border: 1px solid rgba(255, 255, 255, 0.12);

  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(255,255,255,0.05);

  border-radius: inherit;

  z-index: 5;

  font-size: 52px;

  transition: all 0.3s ease;
}

.locked-card.locked .lp-card-img img {
  filter: brightness(0.8);
}

.locked-card.locked:hover {
  transform: none !important;
  cursor: not-allowed;
}

/* ══════════════════════════
   FULL-PAGE WRAPPER
══════════════════════════ */
.page {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Game page needs scrolling — applied via JS or a body class */
body.game-page {
  overflow: auto;
  height: auto;
}

body.game-page .page {
  height: auto;
  min-height: 100vh;
  overflow: visible;
}

/* ══════════════════════════
   BACKGROUND FARM IMAGE
══════════════════════════ */
.bg-img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 40%;
  z-index: 0;
}



/* Readability overlay */
.bg-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to right,
    rgba(0,0,0,0.15) 0%,
    rgba(0,0,0,0.04) 50%,
    rgba(0,0,0,0.0) 100%);
  z-index: 1;
}

a { text-decoration: none; color: inherit; }

/* ══════════════════════════
   NAVBAR
══════════════════════════ */
nav {
  position: relative;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 42px;
  flex-shrink: 0;
  background-color: rgba(255,255,255,0.6);
  backdrop-filter: blur(10px);
  box-shadow: none;
}

.nav-logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}

/* Toggle if need logo */
.nav-logo-img {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.5rem; font-weight: 800; color: var(--white);
  text-align: center; line-height: 1.2; overflow: hidden;
}
.nav-logo-img img { width: 100%; height: 100%; object-fit: contain; border-radius: 8px; }

.nav-logo-text {
  font-family: 'Fredoka One', cursive;
  font-size: 1.55rem;
  color: var(--green-mid);
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.logo-revise { color: #dd9e59; }

.nav-links {
  display: flex; align-items: center; gap: 28px;
  list-style: none;
}
.nav-links a {
  font-size: 0.9rem; font-weight: 700;
  color: var(--green-mid); text-decoration: none;
  opacity: 0.9; transition: opacity 0.2s;
}
.nav-links a:hover { opacity: 1; }

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.nav-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.nav-cta {
  background: var(--orange-btn) !important;
  color: var(--green-mid) !important;
  padding: 8px 20px; border-radius: 50px;
  font-weight: 800 !important; opacity: 1 !important;
  box-shadow: 0 0 6px rgba(255,149,0,0.2);
  transition: transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.nav-cta:hover { transform: translateY(-1px); box-shadow: 0 0 10px rgba(255,149,0,0.35); }

.nav-toggle {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: 10px;
  padding: 10px;
  border-radius: 5px;
  transition: background 0.2s;
  display: none;
}
.nav-toggle:hover { background: rgba(255,255,255,0.1); }

.nav-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  background: rgba(0,0,0,0.9);
  padding: 10px;
  border-radius: 5px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.5);
  z-index: 1001;
}
.nav-dropdown a {
  display: block;
  color: var(--white);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 3px;
  transition: background 0.2s;
}
.nav-dropdown a:hover { background: rgba(255,255,255,0.1); }

/* ══════════════════════════
   HERO BODY (fills remaining height)
══════════════════════════ */
.hero-body {
  position: relative;
  z-index: 5;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 52px;
  top: -25px;
}

/* On game pages the title bar is inside hero-body; don't let it expand */
body.game-page .hero-body {
  flex: 0 0 auto;
  padding: 0;
}

/* ── Center text block ── */
.hero-text {
  position: absolute;
  top: 55px;
  left: 50%;
  transform: translateX(-50%);
  display: flex; flex-direction: column;
  align-items: center; text-align: center;
  max-width: 620px;
  width: min(90%, 460px);
  margin-top: 0;
}

.hero-welcome {
  font-size: 0.95rem; font-weight: 700;
  color: var(--green-mid);
  text-shadow: 0 1px 8px rgba(0,0,0,0.6);  margin-bottom: 2px;
}

.hero-title {
  font-family: 'Fredoka One', cursive;
  font-size: clamp(3.2rem, 4.5vw, 4.2rem);
  line-height: 1.05;
  margin-bottom: 10px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.2);

}
.t-agri   { color: var(--green-mid); }
.t-revise { color: #dd9e59; }

.hero-subtitle {
  font-size: 0.86rem; font-weight: 500;
  color: var(--green-mid);
  text-shadow: 0 1px 6px rgba(0,0,0,0.6);  margin-bottom: 0;
}

/* ══════════════════════════
   BOTTOM CARDS
   — pinned to bottom of viewport
══════════════════════════ */
.cards-bar {
  position: fixed;
  z-index: 10;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: 0 52px 28px;
  width: 100%; 
  bottom: 0;
}

.cards-row {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ══════════════════════════════════════════════
   LATIHAN PENGUKUHAN PAGE
   All classes prefixed with "lp-" to avoid
   conflicts with the main landing page styles.
══════════════════════════════════════════════ */

/* 1. Default State: Hide the mobile image, show desktop */
.mobile-bg {
  display: none;
}

.desktop-bg {
  display: block;
  width: 100%;
  height: 100vh;
  object-fit: cover;
}

/* 2. Small Screen State: Hide desktop, show mobile */
@media (max-width: 480px) {
  .desktop-bg {
    display: none;
  }
  
  .mobile-bg {
    display: block;
    width: 100%;
    height: 100vh;
    object-fit: cover;
  }
}

.lp-hero-body {
  position: relative;
  z-index: 5;
  margin: 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 52px;
}

/* ── Page title banner ── */
.lp-title-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 28px 0 0;
  flex-shrink: 0;
}

.lp-title-pill {
  background: color-mix(in srgb, #D9D9D9, transparent 80%);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(160, 200, 100, 0.4);
  border-radius: 16px;
  padding: 14px 56px;
  font-family: 'Fredoka One', cursive;
  font-size: 1.55rem;
  color: var(--green-mid);
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--green-mid), transparent 0%);
}

/* ── Cards area (fills remaining space, centered) ── */
.lp-cards-area {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 40px 48px 100px;
  gap: 35px;
  flex: 1;
  flex-wrap: wrap;
}

/* ── Individual topic card ── */
.lp-card {
  position: relative;
  z-index: 1;
  width: 280px;
  height: 350px;
  background-color: #9ab47d;
  border-radius: 30px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.25s ease;
  border: 4px solid var(--green-mid);
  box-shadow: 
  0 10px 30px rgba(0, 0, 0, 0.1), /* Soft drop shadow for depth */
  0 0 15px rgba(255, 255, 255, 0.8); /* Inner white glow */
}

/* Topic menu pages use a viewport-balanced layout instead of the homepage hero spacing. */
.topic-page .hero-body,
.topic-page .lp-hero-body {
  position: relative;
  z-index: 5;
  flex: 0 0 auto;
  top: 0;
  margin: 0;
  padding: 0;
  min-height: 0;
}

.topic-page .lp-title-bar {
  padding: clamp(14px, 2.2dvh, 24px) 12px 0;
}

.topic-page .lp-title-pill {
  max-width: calc(100vw - 32px);
  white-space: nowrap;
}

.topic-page .lp-cards-area {
  position: relative;
  z-index: 5;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: center;
  align-items: center;
  justify-content: center;
  justify-items: center;
  padding: clamp(18px, 3dvh, 34px) clamp(24px, 8vw, 76px) clamp(26px, 7dvh, 84px);
}

.topic-page.topic-two-cards .lp-cards-area {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-page.topic-three-cards .lp-cards-area {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.topic-page.topic-three-cards .lp-card:nth-child(3) {
  grid-column: 1 / -1;
}

.topic-page.topic-two-cards .lp-card {
  width: clamp(170px, 22vw, 270px);
  height: clamp(245px, 46dvh, 350px);
}

.topic-page.topic-three-cards .lp-card {
  width: clamp(160px, 20vw, 260px);
  height: clamp(220px, 34dvh, 320px);
}

/* Card image / illustration placeholder */
.lp-card-img {
  position: relative;
  width: 86%; 
  flex: 1;
  background: white;
  margin: -15px 0 5px 0;
  border-radius: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
  padding: 3px;
  z-index: 2;
  /* Soft inner glow to separate from image */
  box-shadow: inset 0 0 10px rgba(0,0,0,0.3); 
}

.lp-card-img img {
  position: relative;
  top: -15px;
  width: 90%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.65));
}

.lp-card-img-3 img {
  position: relative;
  top: -5px;
  width: 90%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 0 6px rgba(0, 0, 0, 0.65));
}


/* Green label bar at bottom */
.lp-card-label {
  width: 90%;
  background-color: #2b6a2e;
  color: #ffffff;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.84rem;
  text-align: center;
  padding: 14px 10px;
  border-radius: 20px;
  box-shadow: 0 8px 12px rgba(26, 66, 28, 0.4);
  line-height: 1.2;
  position: relative;
  bottom: 10px;
  transition: transform 0.25s, box-shadow 0.25s;
}
.lp-card-label:hover  {
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ══════════════════════════
   RESPONSIVE (scale down, still no scroll)
══════════════════════════ */

/* Medium devices (tablets) */
@media (max-width: 768px) {
  nav { padding: 10px 18px; }
  .hero-body { padding: 0 18px; }
  .hero-text { top: 60px; }
  .hero-title { font-size: 2.4rem; }
  .hero-subtitle { font-size: 0.9rem; }
  
  .cards-bar { padding: 0 14px 45px; }
  .cards-row { gap: 18px; }
  
  .lp-title-pill { font-size: 1.2rem; padding: 11px 36px; }
  .lp-cards-area { padding: 28px 22px 75px; gap: 20px; }
  .lp-card { width: 165px; height: 240px; }
  .lp-card-label { font-size: 0.8rem; }
}

/* For IPAD view */
@media (max-width: 900px) {
  nav { padding: 10px 20px; }
  .hero-body { padding: 0 20px; }

  .nav-links a { color: #1a2e1a; }
  .nav-toggle { color: #1a2e1a; }
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  
  .hero-text { max-width: 100%; width: min(92%, 600px); top: 80px; }
  .hero-title { font-size: 2.8rem; }
  .hero-subtitle { font-size: 0.95rem; margin-bottom: 0; }
  
  .cards-bar { padding: 0 16px 50px; position: fixed; width: 100%; bottom: 0; }
  .cards-row { gap: 20px; flex-wrap: wrap; }
  
  /* Latihan Pengukuhan */
  .lp-title-pill { font-size: 1.3rem; padding: 12px 40px; }
  .lp-cards-area { padding: 30px 24px 80px; gap: 24px; }
  .lp-card { width: 200px; height: 280px; }
  .lp-card-label { font-size: 0.78rem; }
}

/* For HP view (very small mobile) */
@media (max-width: 480px) {
  /* Navigation */
  nav { padding: 6px 12px; }
  .nav-logo { display: flex; align-items: center; gap: 6px; width: 36px; height: 36px; }
  .nav-logo-img { width: 100%; height: 100%; border-radius: 5px; }
  .nav-logo-text { display: none; }

  .hero-text {
    z-index: 5;
    top: 55px;
    width: min(90%, 380px);
  }

  .hero-welcome {
    font-size: 1rem;
  }

  .hero-title {
    font-size: 2.7rem;
  }

  .hero-subtitle {
    font-size: 0.88rem;
    margin-bottom: 0;
  }

  .hero-text::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 680px;
    height: 480px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0.5) 30%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
    filter: blur(15px);
  }
  
  /* Bottom cards on homepage */
  .cards-bar { 
    padding: 0 8px 50px; 
    bottom: 0;
  }
  .cards-row { 
    gap: 12px; 
    justify-content: center;
  }
  
  /* Latihan Pengukuhan page - most important improvements */
  .lp-title-bar { 
    padding: 10px 0; 
  }
  .lp-title-pill { 
    padding: 8px 20px; 
    font-size: 1rem; 
    border-radius: 10px;
    border: 2px solid rgba(160, 200, 100, 0.3);
  }
  
  .lp-cards-area { 
    padding: 16px 12px 200px; 
    gap: 12px; 
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
  }
  
  .lp-card { 
    width: 130px; 
    height: 170px; 
    border-radius: 18px; 
    border: 2px solid var(--green-mid);
    flex-shrink: 0;
  }
  
  .lp-card-img, .lp-card-img-3 {
    width: 82%;
    border-radius: 14px;
    margin: -10px 0 3px 0;
  }
  
  .lp-card-img img, .lp-card-img-3 img {
    top: -12px;
    width: 100%;
  }
  
  .lp-card-label { 
    font-size: 0.58rem; 
    padding: 8px 6px;
    border-radius: 14px;
    bottom: 4px;
    width: 90%;
    line-height: 1.1;
  }

  .home-page .hero-text {
    top: 42px;
    width: min(94%, 360px);
    pointer-events: none;
  }

  .home-page .ar-hero-icon {
    --ar-size: 40px;
    margin-bottom: 2px;
  }

  .home-page .hero-welcome {
    font-size: 0.78rem;
    line-height: 1.05;
  }

  .home-page .hero-title {
    font-size: 2.1rem;
    line-height: 0.98;
    margin-bottom: 5px;
  }

  .home-page .hero-subtitle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    max-width: 100%;
    min-height: 21px;
    padding: 3px 9px;
    border: 1px solid rgba(46, 125, 50, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.74);
    box-shadow: 0 4px 14px rgba(27, 94, 47, 0.14);
    color: #1b5e2f;
    font-size: 0.62rem;
    font-weight: 900;
    line-height: 1;
    text-shadow: none;
    white-space: nowrap;
  }

}
 

/* Extra small mobile (under 360px) */
@media (max-width: 360px) {
  
  .lp-card { width: 90px; height: 120px; }
  .lp-card-label { font-size: 0.65rem; }
}

@media (max-width: 480px) {
  .topic-page .hero-body,
  .topic-page .lp-hero-body {
    flex: 0 0 auto;
    top: 0;
    padding: 0;
  }

  .topic-page .lp-title-bar {
    padding: clamp(12px, 2dvh, 18px) 10px 0;
  }

  .topic-page .lp-title-pill {
    padding: 8px 18px;
    font-size: clamp(0.86rem, 3.45vw, 1rem);
    max-width: calc(100vw - 28px);
  }

  .topic-page .lp-cards-area {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: clamp(14px, 2.4dvh, 22px) clamp(42px, 11vw, 50px) clamp(28px, 7dvh, 70px);
    gap: clamp(12px, 2.2dvh, 18px) clamp(12px, 4vw, 18px);
  }

  .topic-page.topic-two-cards .lp-card {
    width: clamp(132px, 38vw, 160px);
    height: clamp(210px, 34dvh, 280px);
  }

  .topic-page.topic-three-cards .lp-card {
    width: clamp(124px, 35vw, 150px);
    height: clamp(178px, 29dvh, 220px);
  }

  .topic-page.topic-three-cards .lp-card:nth-child(3) {
    grid-column: 1 / -1;
  }

  .topic-page .lp-card-img {
    margin-top: -9px;
    border-radius: 16px;
  }

  .topic-page .lp-card-label {
    min-width: 84%;
    padding: 7px 8px;
    font-size: clamp(0.56rem, 2.2vw, 0.66rem);
    line-height: 1.08;
  }
}

/* ══════════════════════════════════════════════
   GAME PAGE STYLES - JENIS DAN SIFAT TANAH
══════════════════════════════════════════════ */
.jdst-hero-body {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 52px;
}

.jdst-title-bar {
  position: relative;
  z-index: 10;
  display: flex;
  justify-content: center;
  padding: 28px 0 0;
  flex-shrink: 0;
}

.jdst-title-pill {
  background: color-mix(in srgb, #D9D9D9, transparent 80%);
  backdrop-filter: blur(10px);
  border: 2px solid rgba(160, 200, 100, 0.4);
  border-radius: 16px;
  padding: 5px 25px;
  width: 90vw;
  font-family: 'Fredoka One', cursive;
  font-size: 1.55rem;
  color: var(--green-mid);
  letter-spacing: 0.01em;
  box-shadow: 0 4px 20px color-mix(in srgb, var(--green-mid), transparent 0%);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.game-container {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: row;
  gap: 40px;
  padding: 20px;
  align-items: center; /* This centers the items vertically */
  justify-content: center; /* This centers the group horizontally */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 350px);
}

.tdtp-game-container {
  position: relative;
  z-index: 5;
  flex: 1;
  display: block;
  flex-direction: row;
  gap: 40px;
  padding: 20px;
  align-items: center; /* This centers the items vertically */
  justify-content: center; /* This centers the group horizontally */
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  height: calc(100vh - 150px); /* Adjust based on your nav height */
}

/* Soil Profile Section */
.game-profile {
  flex: 0 0 220px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  position: sticky;
  top: 20px;
}

.soil-profile {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.soil-layer {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: none;
  border-radius: 0;
  padding: 0;
  height: 56px;
  display: block;
  font-weight: 700;
  color: var(--green-dark);
  text-align: center;
  opacity: 0.4;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.soil-layer:last-child {
  border-bottom: none;
}

.soil-layer.layer-unlock {
  opacity: 1;
  background: rgba(46, 125, 50, 0.2);
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.2);
  border-bottom-color: rgba(46, 125, 50, 0.5);
}

.layer-visual {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  border-radius: 0;
  overflow: hidden;
}

/* Tanaman (Plants) Layer */
.layer-plants .layer-visual {
  background: linear-gradient(180deg, rgba(76, 175, 80, 0.3) 0%, rgba(139, 195, 74, 0.2) 100%);
  border: none;
}

.plants-ground {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 20px;
  background: linear-gradient(180deg, rgba(139, 90, 43, 0.4) 0%, rgba(100, 70, 30, 0.5) 100%);
}

.plant-item {
  font-size: 1.5rem;
  margin: 0 4px;
  animation: sway 3s ease-in-out infinite;
}

.plant-item:nth-child(3) {
  animation-delay: 0.3s;
}

.plant-item:nth-child(4) {
  animation-delay: 0.6s;
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2deg); }
}

.roots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 25px;
  background: linear-gradient(180deg, rgba(139, 90, 43, 0.6) 0%, transparent 100%);
}

/* Humus Layer */
.layer-humus .layer-visual {
  background: linear-gradient(180deg, rgba(60, 40, 20, 0.6) 0%, rgba(40, 25, 10, 0.7) 100%);
  border: none;
}

.humus-texture {
  width: 100%;
  height: 100%;
  position: relative;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
}

.humus-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 20% 30%, rgba(0, 0, 0, 0.2) 2px, transparent 2px),
    radial-gradient(circle at 60% 70%, rgba(0, 0, 0, 0.15) 1.5px, transparent 1.5px),
    radial-gradient(circle at 80% 20%, rgba(0, 0, 0, 0.18) 2px, transparent 2px);
  background-size: 100% 100%;
}

/* Topsoil Layer */
.layer-topsoil .layer-visual {
  background: linear-gradient(180deg, rgba(139, 90, 43, 0.6) 0%, rgba(120, 75, 35, 0.7) 100%);
  border: none;
}

.topsoil-texture {
  width: 100%;
  height: 100%;
  position: relative;
  background: repeating-linear-gradient(
    90deg,
    transparent,
    transparent 3px,
    rgba(0, 0, 0, 0.08) 3px,
    rgba(0, 0, 0, 0.08) 6px
  );
}

.topsoil-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(circle at 15% 40%, rgba(0, 0, 0, 0.15) 3px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(0, 0, 0, 0.12) 2px, transparent 2px),
    radial-gradient(circle at 45% 25%, rgba(0, 0, 0, 0.1) 2px, transparent 2px),
    radial-gradient(circle at 85% 75%, rgba(0, 0, 0, 0.14) 2.5px, transparent 2.5px);
  background-size: 100% 100%;
}

/* Subsoil Layer */
.layer-subsoil .layer-visual {
  background: linear-gradient(180deg, rgba(150, 120, 80, 0.6) 0%, rgba(130, 100, 60, 0.7) 100%);
  border: none;
}

.subsoil-texture {
  width: 100%;
  height: 100%;
  position: relative;
  background: repeating-linear-gradient(
    60deg,
    transparent,
    transparent 4px,
    rgba(0, 0, 0, 0.06) 4px,
    rgba(0, 0, 0, 0.06) 8px
  );
}

.subsoil-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    radial-gradient(ellipse 4px 3px at 25% 35%, rgba(0, 0, 0, 0.15) 1px, transparent 1px),
    radial-gradient(ellipse 3px 2px at 75% 65%, rgba(0, 0, 0, 0.1) 1px, transparent 1px),
    radial-gradient(ellipse 5px 4px at 50% 50%, rgba(0, 0, 0, 0.12) 1px, transparent 1px);
  background-size: 100% 100%;
}

/* Bedrock Layer */
.layer-bedrock .layer-visual {
  background: linear-gradient(180deg, rgba(100, 100, 100, 0.6) 0%, rgba(80, 80, 80, 0.8) 100%);
  border: none;
}

.bedrock-texture {
  width: 100%;
  height: 100%;
  position: relative;
  background: linear-gradient(135deg, rgba(90, 90, 90, 0.5) 0%, transparent 50%, rgba(70, 70, 70, 0.5) 100%);
}

.bedrock-texture::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(45deg, transparent 20%, rgba(0, 0, 0, 0.2) 20%, rgba(0, 0, 0, 0.2) 30%, transparent 30%),
    linear-gradient(-45deg, transparent 20%, rgba(0, 0, 0, 0.15) 20%, rgba(0, 0, 0, 0.15) 30%, transparent 30%);
  background-size: 20px 20px;
}

.layer-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.9);
  opacity: 1;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
  z-index: 10;
}

/* Progress Bar */
.game-progress {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 12px;
}

.progress-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  text-align: center;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--green-mid), var(--orange-btn));
  border-radius: 10px;
  width: 0%;
  transition: width 0.5s ease;
}

/* Question Area */
.game-question {
  flex: 1;
  min-width: 0;
  max-width: 620px;
}

.question-card {
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}

.question-text {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--green-dark);
  line-height: 1.8;
  min-height: 60px;
  word-wrap: break-word;
  white-space: normal;
}

.question-text br {
  content: "";
  display: block;
  margin-bottom: 4px;
}

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.option-button {
  background: rgba(46, 125, 50, 0.1);
  border: 2px solid rgba(46, 125, 50, 0.3);
  border-radius: 12px;
  padding: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--green-dark);
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  line-height: 1.4;
}

.option-button:hover:not(:disabled) {
  background: rgba(46, 125, 50, 0.2);
  border-color: rgba(46, 125, 50, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.2);
}

.option-button:disabled {
  cursor: not-allowed;
}

.option-button.selected {
  border-color: var(--green-mid);
}

.option-button.correct {
  background: rgba(76, 175, 80, 0.25);
  border-color: var(--green-btn);
  color: var(--green-dark);
  box-shadow: 0 0 15px rgba(76, 175, 80, 0.4);
}

.option-button.correct-highlight {
  background: rgba(76, 175, 80, 0.2);
  border-color: var(--green-btn);
}

.option-button.wrong {
  background: rgba(244, 67, 54, 0.2);
  border-color: #f44336;
  color: #c62828;
  box-shadow: 0 0 15px rgba(244, 67, 54, 0.3);
}

/* Feedback */
.feedback {
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
}

.feedback-correct {
  color: #2e7d32;
  text-shadow: 0 0 10px rgba(46, 125, 50, 0.3);
}

.feedback-wrong {
  color: #c62828;
  text-shadow: 0 0 10px rgba(244, 67, 54, 0.2);
}

/* Next Button */
.btn-next {
  background: var(--green-btn);
  color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-next:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

/* Completion Screen */
.completion-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 380px;
}

#completion-screen:not(.game-completion-modal) {
  position: relative;
  z-index: 999;
}

.completion-content {
  text-align: center;
  padding: 40px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.completion-content h2 {
  font-size: 2.5rem;
  color: var(--green-mid);
  margin-bottom: 16px;
  font-family: 'Fredoka One', cursive;
}

.completion-content p {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin-bottom: 12px;
  font-weight: 500;
}

.final-score {
  font-size: 1.3rem !important;
  font-weight: 800 !important;
  color: var(--orange-btn);
  margin-top: 20px !important;
}

.btn-restart {
  display: inline-block;
  background: var(--orange-btn);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(255, 149, 0, 0.3);
}

.btn-restart:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 149, 0, 0.4);
}

/* Responsive adjustments */
@media (max-width: 900px) {

  .jdst-title-pill {
    font-size: 1.0rem;
  }

  .progress-text {
    font-size: 0.7rem;
  }

  .question-text {
    font-size: 0.8rem;
    line-height: 1.0;
  }
  
  .option-button {
    padding: 6px 7px;
    font-size: 0.7rem;
  }

  .game-container {
    flex-direction: row;
    align-items: center;
  }

  .game-profile {
    flex: 0 0 60px; /* Narrow width for a vertical standing profile */
    height: 350px; /* Fixed height for the profile stack */
    justify-content: center;
  }

  .soil-profile {
    flex-direction: column; /* Forces it to stand up bottom-to-top */
    height: 100%;
    width: 100%;
  }

  .soil-layer {
    flex: 1;
    width: 100%;
    height: auto;
  }

  .layer-label {
    font-size: 0.5rem;
    transform: translate(-50%, -50%) rotate(-90deg); /* Rotates text to fit narrow column */
    display: none; /* Optional: Hide labels if it looks too cluttered on small screens */
  }

  .game-question {
    flex: 1;
  }

  .question-card {
    min-height: auto;
    padding: 24px;
    gap: 18px;
  }

  .game-progress {
    width: 95%;
    gap: 10px;
    padding: 8px 12px;
  }

  .btn-next {
    padding: 12px 24px;
    font-size: 0.9rem;
  }

  .feedback {
    font-weight: 700;
    font-size: 0.9rem;
  }
}


@media (max-width: 600px) {
  .game-container {
    padding: 12px 14px 40px;
    gap: 14px;
  }

  .soil-profile {
    height: 100%;
  }

  .soil-layer {
    height: 100%;
  }

  .layer-label {
    font-size: 0.48rem;
    letter-spacing: 0;
  }

  .question-card {
    padding: 15px;
    gap: 0;
    border-radius: 16px;
  }
  
  .question-text {
    font-size: 0.85rem;
    line-height: 1.6;
  }
  
  .options-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .option-button {
    padding: 12px 14px;
    font-size: 0.88rem;
  }
  
  .completion-content h2 {
    font-size: 2rem;
  }
}


@media (max-width: 480px) {
  .game-progress {
    width: 95%;
    gap: 10px;
    padding: 8px 12px;
  }
  
  .progress-text {
    font-size: 0.75rem;
  }

  .game-profile {
    flex: 0 0 45px;
    height: 250px;
  }
  
  .question-card {
    padding: 15px;
  }

  .question-text {
    font-size: 0.8rem;
  }

  .option-button {
    padding: 6px 7px;
    font-size: 0.6rem;
  }

  .btn-next {
    padding: 8px 20px;
    font-size: 0.7rem;
  }

  .feedback {
    font-weight: 700;
    font-size: 0.7rem;
  }
}

@media (max-width: 380px) {
  .layer-label {
    display: none; /* hide labels on very tiny screens, layers still visible */
  }
}

.drag-preview {
  position: fixed;
  transform: scale(1.05);
  opacity: 0.9;
  pointer-events: none;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

.complete-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backdrop-filter: blur(10px);
  background: rgba(0,0,0,0.4);

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 9999;
}

.complete-modal.hidden {
  display: none;
}

.complete-box {
  background: white;
  padding: 25px;
  border-radius: 12px;
  text-align: center;
  width: 300px;

  animation: popIn 0.25s ease;
}

.complete-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.complete-actions button {
  padding: 10px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

#next-station-btn {
  background: #667eea;
  color: white;
}

#restart-expedition-btn {
  background: #eb3349;
  color: white;
}

@keyframes popIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ======================================
   NAME MODAL
====================================== */

.name-modal {
  position: fixed;
  inset: 0;

  display: flex;
  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.18);

  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  z-index: 99999;

  animation: fadeIn 0.25s ease;
}

.name-modal.hidden {
  display: none;
}

.name-modal-box {
  width: min(90%, 380px);

  background: rgba(255,255,255,0.08);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border: 1px solid rgba(255,255,255,0.18);

  border-radius: 24px;

  padding: 30px 24px;

  box-shadow:
    0 10px 40px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.2);

  text-align: center;

  color: white;
}

.name-modal-box h2 {
  font-size: 1.7rem;
  margin-bottom: 10px;
  color: white;
}

.name-modal-box p {
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 20px;

  color: rgba(255,255,255,0.85);
}

#player-name-input {
  width: 100%;

  padding: 14px 16px;

  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.15);

  background: rgba(255,255,255,0.08);

  color: white;
  font-size: 1rem;
  font-weight: 600;

  outline: none;

  backdrop-filter: blur(10px);

  transition: all 0.25s ease;
}

#player-name-input::placeholder {
  color: rgba(255,255,255,0.5);
}

#player-name-input:focus {
  border-color: rgba(255,255,255,0.3);

  background: rgba(255,255,255,0.12);
}

#save-player-name {
  margin-top: 18px;

  width: 100%;

  border: none;

  padding: 14px;

  border-radius: 14px;

  background: linear-gradient(
    135deg,
    #2e7d32,
    #43a047
  );

  color: white;

  font-size: 1rem;
  font-weight: 800;

  cursor: pointer;

  transition: all 0.25s ease;
}

#save-player-name:hover {
  transform: translateY(-2px);

  box-shadow:
    0 8px 25px rgba(46,125,50,0.35);
}

/* ======================================
   LEADERBOARD PAGE
====================================== */

.leaderboard-page {
  height: 100dvh;
  overflow-y: hidden;
  overflow-x: hidden;
}

.leaderboard-page .lp-title-bar {
  flex: 0 0 auto;
  padding: 16px 0 0;
  margin-bottom: 12px;
}

.leaderboard-wrapper {
  position: relative;
  z-index: 5;

  width: 100%;
  flex: 1 1 auto;
  min-height: 0;

  display: flex;
  align-items: flex-start;
  justify-content: center;

  padding: 14px 20px 18px;
}

.leaderboard-card {
  width: min(760px, 100%);
  height: auto;
  max-height: 100%;
  min-height: 0;

  /* green glass background */
  background:
    linear-gradient(
      135deg,
      rgba(27, 94, 47, 0.92),
      rgba(46, 125, 50, 0.88)
    );

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);

  border: 2px solid rgba(255,255,255,0.12);

  border-radius: 18px;

  padding: 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  box-shadow:
    0 20px 60px rgba(0,0,0,0.45),
    0 0 30px rgba(46,125,50,0.25),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.leaderboard-card.leaderboard-full-page {
  height: 100%;
}

.leaderboard-tools {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
  color: #ffffff;
  font-weight: 800;
  font-size: 1rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.leaderboard-tools-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.leaderboard-tools select {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.94);
  color: #1b5e2f;
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.96rem;
  outline: none;
}

.leaderboard-header,
.leaderboard-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 88px;

  align-items: center;

  gap: 10px;
}

#leaderboard-list {
  flex: 0 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 6px;
  overflow: hidden;
}

.leaderboard-card.leaderboard-full-page #leaderboard-list {
  flex: 1 1 auto;
}

.leaderboard-header > div,
.leaderboard-row > div {
  min-width: 0;
}

.leaderboard-header > div:first-child,
.leaderboard-row > div:first-child {
  display: flex;
  justify-content: center;
}

.leaderboard-header > div:last-child {
  text-align: left;
}

.leaderboard-row > div:last-child {
  text-align: left;
}

.leaderboard-header {
  min-height: 40px;
  padding: 8px 14px;

  border-radius: 10px;

  background: rgba(255,255,255,0.14);

  font-weight: 800;
  font-size: 0.96rem;

  color: #ffffff;

  margin-bottom: 10px;

  /* better text visibility */
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);

  box-shadow:
    0 6px 18px rgba(0,0,0,0.35);
}

.leaderboard-row {
  min-height: 48px;
  padding: 6px 14px;

  border-radius: 10px;

  /* darker row background */
  background: rgba(255,255,255,0.09);

  color: #ffffff;

  transition: all 0.25s ease;

  border: 1px solid rgba(255,255,255,0.08);

  box-shadow:
    0 6px 18px rgba(0,0,0,0.28);
}

.leaderboard-card.leaderboard-full-page .leaderboard-row {
  flex: 1 1 0;
  min-height: 0;
}

.leaderboard-row:hover {
  transform: translateY(-3px);

  background: rgba(255,255,255,0.14);

  box-shadow:
    0 12px 24px rgba(0,0,0,0.4);
}

.rank-badge {
  width: 30px;
  height: 30px;

  border-radius: 50%;

  display: flex;
  align-items: center;
  justify-content: center;

  font-weight: 900;

  background: linear-gradient(135deg, #1b5e20, #4caf50);

  color: white;

  box-shadow:
    0 5px 15px rgba(76,175,80,0.45),
    inset 0 1px 4px rgba(255,255,255,0.2);
}

.player-name {
  font-weight: 800;
  font-size: 0.9rem;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;

  color: #ffffff;

  text-shadow: 0 2px 8px rgba(0,0,0,0.7);

  letter-spacing: 0.3px;
}

.player-score {
  font-weight: 900;
  font-size: 0.9rem;
  line-height: 1.1;
  overflow: hidden;

  color: #ffd54f;

  text-shadow:
    0 2px 10px rgba(0,0,0,0.8),
    0 0 12px rgba(255,213,79,0.25);
}

.player-score-sub {
  margin-top: 2px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.9);
}

.leaderboard-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0;
}

.leaderboard-pagination.hidden {
  display: none;
}

.leaderboard-pagination button {
  width: 24px;
  height: 28px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffd54f;
  font-family: 'Fredoka One', cursive;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: none;
  text-shadow:
    0 2px 8px rgba(0,0,0,0.7),
    0 0 10px rgba(255,213,79,0.25);
}

.leaderboard-pagination button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.leaderboard-pagination span {
  min-width: 40px;
  text-align: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 0.9rem;
  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.empty-score {
  text-align: center;

  color: rgba(255,255,255,0.92);

  padding: 30px 10px;

  font-weight: 700;

  text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.clear-score-btn:hover {
  transform: translateY(-2px);
}

@media (max-width: 600px) {

  .leaderboard-page .lp-title-bar {
    padding: 12px 0 0;
    margin: 20px 0;
  }

  .leaderboard-card {
    width: 100%;
    max-width: calc(100vw - 20px);
    padding: 9px;
  }

  .leaderboard-wrapper {
    padding: 8px 10px 10px;
  }

  .leaderboard-tools {
    font-size: 1rem;
    gap: 6px;
    margin-bottom: 8px;
  }

  .leaderboard-tools select {
    font-size: 0.96rem;
  }

  .leaderboard-header,
  .leaderboard-row {
    grid-template-columns: 46px minmax(0, 1fr) 82px;
    gap: 6px;

    font-size: 0.76rem;

    padding: 6px 8px;
  }

  .leaderboard-header {
    min-height: 34px;
    font-size: 0.9rem;
    margin-bottom: 7px;
    white-space: nowrap;
  }

  .leaderboard-row {
    flex: 0 1 auto;
    min-height: 48px;
    max-height: none;
  }

  .leaderboard-card.leaderboard-full-page .leaderboard-row {
    flex: 1 1 0;
    min-height: 0;
  }

  .rank-badge {
    width: 28px;
    height: 28px;

    font-size: 0.84rem;
  }

  .player-name,
  .player-score {
    font-size: 0.88rem;
  }

  .player-score-sub {
    font-size: 0.64rem;
    line-height: 1.1;
    white-space: nowrap;
  }

  .leaderboard-pagination button {
    width: 24px;
    height: 28px;
    font-size: 1.8rem;
  }
}

.complete-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.complete-modal.hidden {
  display: none;
}

.complete-box {
  background: rgba(255,255,255,0.95);
  border-radius: 24px;
  padding: 26px 24px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 10px 35px rgba(0,0,0,0.25);
  border: 2px solid rgba(46,125,50,0.25);
}

.complete-box h2 {
  font-family: 'Fredoka One', cursive;
  color: #1b5e2f;
  margin-bottom: 10px;
}

.complete-box p {
  font-weight: 800;
  color: #2e7d32;
  margin-bottom: 18px;
}

.complete-actions button {
  background: linear-gradient(135deg, #2e7d32, #43a047);
  color: white;
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  font-family: 'Fredoka One', cursive;
  cursor: pointer;
}

/* ======================================
   SHARED GAME COMPLETION POPUP
====================================== */

.game-completion-modal {
  position: fixed !important;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  z-index: 10000;
  display: flex;
  align-items: center !important;
  justify-content: center !important;
  padding: 18px;
  background: rgba(18, 38, 28, 0.36);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.game-completion-modal.hidden,
.game-completion-modal.pht-hidden {
  display: none !important;
}

.game-completion-card {
  width: min(320px, 100%);
  padding: 22px 18px 20px;
  border: 1.5px solid rgba(160, 200, 100, 0.35);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.2);
  text-align: center;
  animation: gameCompletePop 0.25s ease;
}

.game-completion-icon {
  width: 86px;
  height: 86px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-size: 4rem;
  line-height: 1;
  filter: drop-shadow(0 7px 16px rgba(255, 149, 0, 0.36));
}

.game-completion-title {
  display: block;
  margin: 0 0 12px;
  color: #1b5e2f;
  font-family: 'Fredoka One', cursive;
  font-size: 1.32rem;
  line-height: 1.05;
}

.game-completion-message {
  margin: 0 auto 12px;
  color: #4a6a4a;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.3;
}

.game-completion-score,
.game-completion-home {
  width: 100%;
  min-height: 38px;
  margin: 0 auto;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Fredoka One', cursive;
  font-size: 0.78rem;
  line-height: 1;
}

.game-completion-score {
  margin-bottom: 10px;
  background: linear-gradient(135deg, #ff9500, #ffb74d);
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 149, 0, 0.28);
}

.game-completion-home {
  gap: 7px;
  border: none;
  background: linear-gradient(135deg, #1b5e2f, #2e7d32);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(46, 125, 50, 0.3);
}

@keyframes gameCompletePop {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ======================================
   SHARED REALISTIC PAGE ICONS + MOTION
====================================== */

.lp-title-pill,
.leaderboard-page .lp-title-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: arTitleFloat 4.8s ease-in-out infinite;
}

.ar-page-icon,
.ar-status-icon,
.ar-inline-icon,
.ar-hero-icon {
  --ar-size: 34px;
  position: relative;
  width: var(--ar-size);
  height: var(--ar-size);
  flex: 0 0 var(--ar-size);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.96), rgba(255,255,255,0.16) 38%, transparent 39%),
    linear-gradient(145deg, rgba(241, 251, 236, 0.94), rgba(179, 218, 158, 0.78));
  border: 1px solid rgba(46, 125, 50, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.9),
    inset 0 -7px 12px rgba(48,86,48,0.1),
    0 6px 16px rgba(29, 85, 44, 0.18);
  overflow: hidden;
  vertical-align: middle;
  animation: arIconFloat 3.6s ease-in-out infinite;
}

.ar-page-icon::after,
.ar-status-icon::after,
.ar-inline-icon::after,
.ar-hero-icon::after {
  content: "";
  position: absolute;
  inset: 3px 4px auto 4px;
  height: 32%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.52), rgba(255,255,255,0));
  pointer-events: none;
}

.ar-page-icon > span,
.ar-status-icon > span,
.ar-inline-icon > span,
.ar-hero-icon > span {
  position: relative;
  z-index: 1;
  display: block;
}

.ar-hero-icon {
  --ar-size: 72px;
  margin: 0 auto 7px;
  border-radius: 22px;
  animation: arHeroIconRise 0.72s ease both, arIconFloat 4.4s ease-in-out 0.72s infinite;
}

.ar-status-icon {
  --ar-size: 31px;
}

.ar-inline-icon {
  --ar-size: 28px;
  margin-right: 5px;
  border-radius: 10px;
}

.game-status-bar .ar-status-icon,
.st-topbar .ar-status-icon {
  margin: 0 2px;
}

.pht-station-title,
.st-fasa-title {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.kmt-station-head .ar-inline-icon {
  --ar-size: 32px;
  margin: 0 0 1px;
}

.lp-card {
  animation: arCardRise 0.55s ease both;
}

.lp-card:nth-child(2) {
  animation-delay: 0.08s;
}

.lp-card:nth-child(3) {
  animation-delay: 0.16s;
}

.lp-card-img::after {
  content: "";
  position: absolute;
  inset: 8px 10px auto 10px;
  height: 28%;
  border-radius: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0));
  z-index: 3;
  pointer-events: none;
}

.lp-card-img img,
.lp-card-img-3 img {
  animation: arCardImageFloat 4.2s ease-in-out infinite;
}

.locked-card.locked .lp-card-img img {
  animation: none;
}

.game-completion-icon {
  animation: arTrophyCelebrate 2s ease-in-out infinite;
}

.leaderboard-card,
.game-container,
.tdtp-game-container,
.kmt-game-card,
.name-modal-box {
  animation: arPanelRise 0.46s ease both;
}

.leaderboard-row {
  animation: arPanelRise 0.34s ease both;
}

.name-modal-box::before {
  content: "";
  width: 54px;
  height: 54px;
  margin: 0 auto 8px;
  display: block;
  border-radius: 16px;
  background:
    radial-gradient(circle at 52% 18%, #44a85a 0 5px, transparent 6px),
    radial-gradient(ellipse at 40% 33%, #65bd63 0 12px, transparent 13px),
    radial-gradient(ellipse at 62% 36%, #2e7d32 0 11px, transparent 12px),
    linear-gradient(180deg, transparent 0 42%, #7b5131 43% 63%, #4d3525 64% 100%);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.8),
    0 8px 18px rgba(27,94,47,0.2);
  animation: arIconFloat 3.6s ease-in-out infinite;
}

.ar-icon-soil-profile > span {
  width: 62%;
  height: 70%;
  border-radius: 7px;
  border: 1px solid rgba(70, 44, 28, 0.28);
  background:
    linear-gradient(180deg, transparent 0 18%, #5fae4d 19% 23%, transparent 24%),
    linear-gradient(180deg, #7a4b2b 0 30%, #a66f3a 31% 56%, #d7ad64 57% 72%, #6b5a45 73% 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.26),
    inset 0 -4px 9px rgba(42,28,19,0.28),
    0 3px 7px rgba(64,42,30,0.24);
}

.ar-icon-soil-profile > span::before {
  content: "";
  position: absolute;
  left: 48%;
  top: -10px;
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: #2e7d32;
  transform: translateX(-50%);
}

.ar-icon-soil-profile > span::after {
  content: "";
  position: absolute;
  left: 44%;
  top: -10px;
  width: 24px;
  height: 13px;
  border-radius: 50% 50% 50% 0;
  background:
    radial-gradient(circle at 72% 28%, rgba(255,255,255,0.55) 0 2px, transparent 3px),
    linear-gradient(135deg, #8fd06a, #2f8d43);
  box-shadow: -16px 5px 0 -2px #51a64d;
  transform: rotate(-20deg);
}

.ar-icon-training > span {
  width: 66%;
  height: 72%;
  border-radius: 6px;
  background:
    linear-gradient(180deg, #fffdf6 0 18%, #f2ead8 19% 100%);
  border: 1px solid rgba(87, 68, 42, 0.2);
  box-shadow:
    inset 0 -4px 9px rgba(120,92,48,0.12),
    0 3px 8px rgba(57,76,46,0.22);
}

.ar-icon-training > span::before {
  content: "";
  position: absolute;
  left: 22%;
  right: 22%;
  top: -7px;
  height: 12px;
  border-radius: 5px 5px 3px 3px;
  background: linear-gradient(180deg, #9aa6a7, #657579);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.36);
}

.ar-icon-training > span::after {
  content: "";
  position: absolute;
  left: 15%;
  top: 30%;
  width: 70%;
  height: 42%;
  background:
    linear-gradient(135deg, transparent 0 39%, #2e7d32 40% 54%, transparent 55%) 0 4px / 20px 14px no-repeat,
    linear-gradient(#9fc49a, #9fc49a) 24px 6px / 24px 3px no-repeat,
    linear-gradient(#9fc49a, #9fc49a) 24px 17px / 20px 3px no-repeat,
    linear-gradient(#9fc49a, #9fc49a) 24px 28px / 26px 3px no-repeat;
}

.ar-icon-conservation > span {
  width: 65%;
  height: 47%;
  border-radius: 7px 10px 10px 9px;
  background: linear-gradient(145deg, #4fb2d1, #237da4);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.35),
    inset 0 -5px 10px rgba(0,52,84,0.24),
    0 4px 9px rgba(42,83,100,0.24);
}

.ar-icon-conservation > span::before {
  content: "";
  position: absolute;
  right: -17px;
  top: 7px;
  width: 23px;
  height: 7px;
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, #237da4, #61c2d7);
  transform: rotate(-18deg);
  box-shadow:
    10px 7px 0 -4px rgba(73, 167, 210, 0.9),
    17px 13px 0 -5px rgba(73, 167, 210, 0.7);
}

.ar-icon-conservation > span::after {
  content: "";
  position: absolute;
  left: -11px;
  top: 4px;
  width: 18px;
  height: 21px;
  border: 4px solid #237da4;
  border-right: none;
  border-radius: 14px 0 0 14px;
}

.ar-icon-fertilizer > span {
  width: 62%;
  height: 72%;
  border-radius: 8px 8px 10px 10px;
  background:
    radial-gradient(circle at 32% 66%, #ffca55 0 3px, transparent 4px),
    radial-gradient(circle at 55% 72%, #8bc34a 0 3px, transparent 4px),
    radial-gradient(circle at 71% 59%, #f5f5dc 0 2px, transparent 3px),
    linear-gradient(180deg, #f9f1d4 0 27%, #ffb74d 28% 100%);
  border: 1px solid rgba(131, 77, 16, 0.25);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.45),
    inset 0 -5px 10px rgba(147, 84, 20, 0.2),
    0 4px 9px rgba(94,63,34,0.22);
}

.ar-icon-fertilizer > span::before {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  top: 20%;
  height: 16px;
  border-radius: 50% 50% 50% 0;
  background:
    radial-gradient(circle at 67% 26%, rgba(255,255,255,0.56) 0 2px, transparent 3px),
    linear-gradient(135deg, #76c95a, #2e7d32);
  transform: rotate(-18deg);
}

.ar-icon-fertilizer > span::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: -5px;
  height: 10px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #f6e4a5, #c48a32);
}

.ar-icon-trophy > span {
  width: 46%;
  height: 56%;
  border-radius: 7px 7px 13px 13px;
  background:
    radial-gradient(circle at 33% 22%, rgba(255,255,255,0.76) 0 5px, transparent 6px),
    linear-gradient(135deg, #fff0a5 0%, #f8b92f 44%, #d17b00 100%);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.7),
    inset 0 -6px 10px rgba(135,75,0,0.22),
    0 5px 9px rgba(145, 87, 0, 0.25);
}

.ar-icon-trophy > span::before {
  content: "";
  position: absolute;
  left: -13px;
  right: -13px;
  top: 4px;
  height: 22px;
  border: 4px solid #e89c11;
  border-bottom-color: transparent;
  border-radius: 16px 16px 4px 4px;
  z-index: -1;
}

.ar-icon-trophy > span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -17px;
  width: 30px;
  height: 17px;
  border-radius: 4px 4px 8px 8px;
  background:
    linear-gradient(90deg, transparent 0 34%, #d18809 35% 65%, transparent 66%),
    linear-gradient(180deg, transparent 0 46%, #8a5a12 47% 100%);
  transform: translateX(-50%);
}

.ar-icon-ph-meter > span {
  width: 44%;
  height: 72%;
  border-radius: 8px;
  background: linear-gradient(180deg, #f5f9fb, #8fb3bf);
  border: 1px solid rgba(36, 64, 74, 0.22);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.68),
    inset 0 -5px 8px rgba(31,67,78,0.2),
    0 4px 9px rgba(38,65,69,0.22);
}

.ar-icon-ph-meter > span::before {
  content: "pH";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 12%;
  height: 18px;
  border-radius: 5px;
  background: linear-gradient(180deg, #113d32, #1b5e2f);
  color: #d6ffe0;
  font-family: 'Fredoka One', cursive;
  font-size: 0.43rem;
  line-height: 18px;
  text-align: center;
}

.ar-icon-ph-meter > span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 4px;
  height: 31px;
  border-radius: 99px;
  background: linear-gradient(180deg, #657579, #2f3f43);
  transform: translateX(-50%);
  box-shadow: 0 22px 0 -1px #4fc3f7;
}

.ar-icon-structure > span {
  width: 70%;
  height: 63%;
  border-radius: 9px;
  background:
    radial-gradient(circle at 21% 27%, #7a4b2b 0 7px, transparent 8px),
    radial-gradient(circle at 52% 22%, #9a6d3d 0 8px, transparent 9px),
    radial-gradient(circle at 75% 40%, #5b422b 0 7px, transparent 8px),
    radial-gradient(circle at 30% 68%, #b68545 0 8px, transparent 9px),
    radial-gradient(circle at 62% 71%, #6c4b31 0 9px, transparent 10px),
    linear-gradient(180deg, rgba(255,255,255,0.25), rgba(80,54,34,0.16));
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.24),
    0 4px 8px rgba(75,48,30,0.24);
}

.ar-icon-structure > span::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  border: 1px dashed rgba(255,255,255,0.52);
  border-radius: 9px;
}

.ar-icon-structure > span::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 38px;
  height: 7px;
  border-radius: 50%;
  background: rgba(80, 54, 34, 0.18);
  transform: translateX(-50%);
}

.ar-icon-field > span {
  width: 74%;
  height: 58%;
  border-radius: 8px;
  background:
    repeating-linear-gradient(108deg, rgba(255,255,255,0.15) 0 4px, transparent 4px 11px),
    linear-gradient(180deg, #5e8a3e 0 19%, #7a4b2b 20% 48%, #a36c3a 49% 74%, #5d4b3b 75% 100%);
  border: 1px solid rgba(70,44,28,0.18);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.24),
    0 4px 8px rgba(63,78,43,0.23);
}

.ar-icon-field > span::before {
  content: "";
  position: absolute;
  left: 46%;
  top: -16px;
  width: 4px;
  height: 24px;
  border-radius: 99px;
  background: #2e7d32;
}

.ar-icon-field > span::after {
  content: "";
  position: absolute;
  left: 44%;
  top: -17px;
  width: 24px;
  height: 14px;
  border-radius: 50% 50% 50% 0;
  background: linear-gradient(135deg, #9bd36d, #3d9647);
  box-shadow: -17px 6px 0 -2px #65b653;
  transform: rotate(-19deg);
}

.ar-icon-method > span {
  width: 52%;
  height: 75%;
  border-radius: 99px;
  background:
    linear-gradient(90deg, transparent 0 43%, #745235 44% 56%, transparent 57%),
    linear-gradient(180deg, #8d6e63 0 58%, transparent 59%);
  transform: rotate(29deg);
}

.ar-icon-method > span::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -1px;
  width: 20px;
  height: 24px;
  border-radius: 2px 2px 16px 16px;
  background: linear-gradient(135deg, #bfc8ca, #6f7f83);
  box-shadow: inset 0 2px 0 rgba(255,255,255,0.5);
  transform: translateX(-50%);
}

.ar-icon-method > span::after {
  content: "";
  position: absolute;
  left: -8px;
  top: 14px;
  width: 26px;
  height: 17px;
  border-radius: 10px 10px 4px 4px;
  border: 4px solid #745235;
  border-bottom: none;
  transform: rotate(-29deg);
}

.ar-icon-book > span {
  width: 72%;
  height: 58%;
  border-radius: 5px 8px 8px 5px;
  background:
    linear-gradient(90deg, #fff8df 0 47%, #d9caa3 48% 52%, #fff8df 53% 100%);
  border: 1px solid rgba(89,70,40,0.18);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.8),
    0 4px 8px rgba(70,55,38,0.22);
}

.ar-icon-book > span::before {
  content: "";
  position: absolute;
  inset: 8px 9px;
  background:
    linear-gradient(#9fbf8d, #9fbf8d) left 0 top 1px / 20px 2px no-repeat,
    linear-gradient(#9fbf8d, #9fbf8d) right 0 top 1px / 20px 2px no-repeat,
    linear-gradient(#d1b66d, #d1b66d) left 0 top 10px / 18px 2px no-repeat,
    linear-gradient(#d1b66d, #d1b66d) right 0 top 10px / 18px 2px no-repeat;
}

.ar-icon-book > span::after {
  content: "";
  position: absolute;
  left: 48%;
  top: 0;
  width: 6px;
  height: 31px;
  border-radius: 0 0 5px 5px;
  background: #e16d45;
}

.ar-icon-calculator > span {
  width: 62%;
  height: 72%;
  border-radius: 8px;
  background: linear-gradient(180deg, #3f5558, #1f3336);
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.18),
    0 4px 9px rgba(26,42,45,0.28);
}

.ar-icon-calculator > span::before {
  content: "";
  position: absolute;
  left: 13%;
  right: 13%;
  top: 11%;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, #d7f3c8, #83b76f);
}

.ar-icon-calculator > span::after {
  content: "";
  position: absolute;
  left: 16%;
  top: 45%;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #f5f5f5;
  box-shadow:
    13px 0 #f5f5f5,
    26px 0 #ffb74d,
    0 12px #f5f5f5,
    13px 12px #f5f5f5,
    26px 12px #66bb6a;
}

@keyframes arTitleFloat {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes arIconFloat {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-3px) rotate(-1deg);
  }
}

@keyframes arHeroIconRise {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.86);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes arCardRise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes arPanelRise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes arCardImageFloat {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-5px) scale(1.018);
  }
}

@keyframes arTrophyCelebrate {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-4px) scale(1.04);
  }
  64% {
    transform: translateY(0) scale(0.99);
  }
}

@media (max-width: 480px) {
  .lp-title-pill {
    gap: 7px;
  }

  .ar-page-icon {
    --ar-size: 27px;
    border-radius: 9px;
  }

  .ar-status-icon {
    --ar-size: 25px;
    border-radius: 8px;
  }

  .ar-inline-icon {
    --ar-size: 23px;
    border-radius: 8px;
  }

  .ar-hero-icon {
    --ar-size: 54px;
    margin-bottom: 5px;
    border-radius: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .lp-title-pill,
  .ar-page-icon,
  .ar-status-icon,
  .ar-inline-icon,
  .ar-hero-icon,
  .lp-card,
  .lp-card-img img,
  .lp-card-img-3 img,
  .leaderboard-card,
  .leaderboard-row,
  .game-container,
  .tdtp-game-container,
  .kmt-game-card,
  .name-modal-box,
  .game-completion-icon,
  .name-modal-box::before {
    animation: none !important;
  }
}
