/* SustainSnippet Game — layout mirrored from futuregameworld, eco theme colors only */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@24,400,0,0&display=swap');

:root {
  --bg-midnight: #0d1b12;
  --neon-pink: #52b788;
  --neon-blue: #95d5b2;
  --cyan-text: #d8f3dc;
  --indigo-deep: #1b4332;
  --indigo-mid: #2d6a4f;
  --accent-warm: #d4a574;
}

iframe {
  margin: 0 auto;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Fredoka', system-ui, sans-serif;
  background-color: var(--bg-midnight);
  color: #fff;
  min-height: 100vh;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: geometricPrecision;
  overflow-x: hidden;
}

img {
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

/* Site background — crisp CSS gradient (no raster upscale blur) */
.bg-site {
  background-color: var(--bg-midnight);
  background-image: radial-gradient(
      ellipse 80% 50% at 15% 20%,
      rgba(45, 106, 79, 0.45) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse 60% 40% at 85% 10%,
      rgba(82, 183, 136, 0.2) 0%,
      transparent 50%
    ),
    radial-gradient(
      ellipse 70% 55% at 50% 100%,
      rgba(27, 67, 50, 0.55) 0%,
      transparent 60%
    ),
    linear-gradient(165deg, #0a1610 0%, #0d1b12 35%, #122a1e 70%, #0d1b12 100%);
  background-size: 100% 100%;
  background-position: center top;
  background-repeat: no-repeat;
  background-attachment: scroll;
}

.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

.pc-container {
  background-attachment: scroll;
}

/* Accent title color — no glow */
.text-neon-pink-glow {
  color: var(--neon-pink);
}

.text-neon-pink {
  color: var(--neon-pink);
}
.text-neon-blue {
  color: var(--neon-blue);
}
.text-cyan-200 {
  color: var(--cyan-text);
}
.text-cyan-300 {
  color: #95d5b2;
}
.text-cyan-400 {
  color: #74c69d;
}

.bg-neon-pink {
  background-color: var(--neon-pink);
}
.border-neon-blue {
  border-color: var(--neon-blue);
}
.border-neon-pink {
  border-color: var(--neon-pink);
}

.shadow-neon-pink {
  box-shadow: 0 0 10px rgba(82, 183, 136, 0.8), 0 0 20px rgba(82, 183, 136, 0.4);
}
.shadow-neon-white {
  box-shadow: 0 0 15px rgba(149, 213, 178, 0.35),
    inset 0 0 10px rgba(149, 213, 178, 0.08);
}

/* Cards */
.card-neon {
  border-radius: 2rem;
  border-width: 2px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 12px rgba(149, 213, 178, 0.18);
  background-color: rgba(27, 67, 50, 0.72);
}

.featured-card {
  overflow: hidden;
  border-radius: 2.5rem;
  border-width: 3px;
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 20px rgba(82, 183, 136, 0.2);
}

/* Squishy play button — green gradient instead of orange/pink */
.btn-squishy {
  position: relative;
  transition: all 75ms cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(180deg, #74c69d, #2d6a4f);
  box-shadow: 0 6px 0 #1b4332, 0 0 20px rgba(82, 183, 136, 0.45),
    inset 0 2px 0 rgba(255, 255, 255, 0.25);
  border: 2px solid #d8f3dc;
  color: #fff;
  font-weight: 900;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.btn-squishy:active {
  box-shadow: 0 0 0 #1b4332, inset 0 4px 10px rgba(0, 0, 0, 0.3);
  transform: translateY(6px);
}
.btn-squishy:hover {
  filter: brightness(1.08);
}

.no-scrollbar::-webkit-scrollbar {
  display: none;
}
.no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Horizontal scroll rows */
.h-scroll-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  gap: 1rem;
  padding-bottom: 0.5rem;
}
.h-scroll-track > .h-scroll-item {
  flex-shrink: 0;
  scroll-snap-align: center;
}
.h-scroll-track.snap-start > .h-scroll-item {
  scroll-snap-align: start;
}

/* Category rows: extra vertical space so hover scale isn't clipped */
.h-scroll-categories {
  overflow-y: visible;
  padding-top: 1rem;
  padding-bottom: 1rem;
  margin-top: -0.5rem;
  margin-bottom: -0.5rem;
}
.h-scroll-categories > .h-scroll-item {
  padding: 0.5rem 0.25rem;
}
.h-scroll-categories .cat-square,
.h-scroll-categories .cat-circle {
  transform-origin: center center;
  transition: transform 0.3s ease, border-color 0.3s ease,
    background-color 0.3s ease;
}
.h-scroll-categories .h-scroll-item:hover .cat-square,
.h-scroll-categories .h-scroll-item:hover .cat-circle {
  transform: scale(1.08);
}

/* Logo frame */
.logo-frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background: rgba(27, 67, 50, 0.5);
  border: 2px solid var(--neon-blue);
  border-radius: 0.75rem;
  box-shadow: 0 0 15px rgba(149, 213, 178, 0.35);
  overflow: hidden;
}
.logo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Category icon circles */
.cat-circle {
  width: 4rem;
  height: 4rem;
  border-radius: 9999px;
  border: 2px solid #fff;
  background: rgba(27, 67, 50, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cat-square {
  width: 5rem;
  height: 5rem;
  border-radius: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(27, 67, 50, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

/* Hot badge tilt */
.hot-badge {
  position: absolute;
  top: -1rem;
  left: 1.5rem;
  background: var(--neon-pink);
  color: #0d1b12;
  padding: 0.25rem 1rem;
  border-radius: 0.75rem;
  box-shadow: 0 0 10px rgba(82, 183, 136, 0.5);
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transform: rotate(-1deg);
  z-index: 10;
  font-weight: 900;
  font-size: 0.875rem;
  text-transform: uppercase;
}

/* Rank badge */
.rank-badge {
  position: absolute;
  top: -1rem;
  left: -1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  background: var(--neon-pink);
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.875rem;
  color: #0d1b12;
  box-shadow: 0 0 10px rgba(82, 183, 136, 0.6);
}

/* PC breakpoint (matches FGW `pc:` custom screen ~1024px) */
@media (min-width: 1024px) {
  .pc\:hidden {
    display: none !important;
  }
  .pc\:block {
    display: block !important;
  }
}

@media (max-width: 1023px) {
  .pc\:block {
    display: none !important;
  }
}

/* Detail / secondary pages */
.page-shell {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2rem 1rem 4rem;
}

.prose-eco h2 {
  color: var(--neon-pink);
  font-size: 1.25rem;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 700;
}
.prose-eco p,
.prose-eco li {
  color: rgba(216, 243, 220, 0.85);
  line-height: 1.8;
  margin-bottom: 0.75rem;
}
.prose-eco ul {
  list-style: disc;
  padding-left: 1.5rem;
}

/* Play page */
.play-container {
  position: fixed;
  inset: 0;
  background: var(--bg-midnight);
  z-index: 100;
}
.play-bar {
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--indigo-deep);
  border-bottom: 1px solid rgba(149, 213, 178, 0.2);
}
.play-container iframe {
  width: 100%;
  height: calc(100% - 56px);
  border: none;
}

/* Global page loading */
html.is-loading,
body.is-loading {
  overflow: hidden;
}

.site-loading {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-midnight);
  background-image: radial-gradient(
      ellipse 80% 50% at 15% 20%,
      rgba(45, 106, 79, 0.45) 0%,
      transparent 55%
    ),
    linear-gradient(165deg, #0a1610 0%, #0d1b12 50%, #122a1e 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.site-loading.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.site-loading__content {
  text-align: center;
}

.site-loading__ring {
  position: relative;
  width: 88px;
  height: 88px;
  margin: 0 auto 1.5rem;
}

.site-loading__ring::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(149, 213, 178, 0.15);
  border-top-color: var(--neon-pink);
  border-right-color: var(--neon-blue);
  animation: loading-spin 0.85s linear infinite;
}

.site-loading__logo {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  object-fit: contain;
  border-radius: 12px;
  animation: loading-pulse 1.5s ease-in-out infinite;
}

.site-loading__bar {
  width: 10rem;
  height: 4px;
  background: rgba(149, 213, 178, 0.15);
  border-radius: 999px;
  margin: 0 auto 0.75rem;
  overflow: hidden;
}

.site-loading__bar span {
  display: block;
  height: 100%;
  width: 40%;
  background: linear-gradient(90deg, var(--neon-pink), var(--neon-blue));
  border-radius: 999px;
  animation: loading-bar 1.1s ease-in-out infinite;
}

.site-loading__text {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: rgba(216, 243, 220, 0.55);
  animation: loading-text 1.2s ease-in-out infinite;
}

@keyframes loading-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes loading-pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.9);
    opacity: 0.85;
  }
}

@keyframes loading-bar {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(320%);
  }
}

@keyframes loading-text {
  0%,
  100% {
    opacity: 0.45;
  }
  50% {
    opacity: 1;
  }
}

::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-midnight);
}
::-webkit-scrollbar-thumb {
  background: var(--indigo-mid);
  border-radius: 3px;
}
