/* =========================================================
   Go to PowerBall — Global Stylesheet
   Mobile-first | Sports/Carnival Theme | GPU Animations
   ========================================================= */

/* ---------- 1. CSS Variables (Theme Tokens) ---------- */
:root {
  /* Core palette */
  --c-sea-blue: #0A2647;
  --c-deep-blue: #144272;
  --c-mid-blue: #2C74B3;
  --c-black: #000814;
  --c-ink: #001D3D;
  --c-green: #06D6A0;
  --c-green-dark: #05A87C;
  --c-orange: #FF9E1F;
  --c-pink: #FF6B9D;
  --c-pink-soft: #FFC2D1;
  --c-gold: #FFC93C;
  --c-cream: #FFF5F8;
  --c-white: #FFFFFF;
  --c-gray-50: #F7F8FA;
  --c-gray-100: #EEF1F6;
  --c-gray-200: #D9DEE7;
  --c-gray-300: #B7BECC;
  --c-gray-500: #6B7480;
  --c-gray-700: #2E3640;
  --c-danger: #E63946;

  /* Gradients */
  --grad-hero: linear-gradient(135deg, #0A2647 0%, #000814 60%, #001D3D 100%);
  --grad-pink: linear-gradient(135deg, #FF6B9D 0%, #FFC93C 100%);
  --grad-green: linear-gradient(135deg, #06D6A0 0%, #0A2647 100%);
  --grad-orange: linear-gradient(135deg, #FF9E1F 0%, #FF6B9D 100%);
  --grad-sky: linear-gradient(180deg, #0A2647 0%, #144272 50%, #2C74B3 100%);
  --grad-card: linear-gradient(160deg, #FFFFFF 0%, #FFF5F8 100%);

  /* Shadows */
  --shadow-sm: 0 2px 6px rgba(10, 38, 71, 0.08);
  --shadow-md: 0 6px 18px rgba(10, 38, 71, 0.12);
  --shadow-lg: 0 12px 32px rgba(10, 38, 71, 0.18);
  --shadow-glow-pink: 0 0 24px rgba(255, 107, 157, 0.45);
  --shadow-glow-green: 0 0 24px rgba(6, 214, 160, 0.45);
  --shadow-glow-gold: 0 0 24px rgba(255, 201, 60, 0.45);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.08);

  /* Radii */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;

  /* Type */
  --f-heading: "Fredoka One", "Baloo 2", system-ui, -apple-system, sans-serif;
  --f-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  /* Layout */
  --phone-max: 480px;
  --nav-height: 64px;
  --bottom-safe: env(safe-area-inset-bottom, 0px);
  --top-safe: env(safe-area-inset-top, 0px);

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --t-fast: 0.18s;
  --t-base: 0.32s;
  --t-slow: 0.55s;
}

/* ---------- 2. Reset & Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-ink);
  background: var(--c-gray-50);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-top: var(--top-safe);
}

img, svg, video, canvas, audio, iframe {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

a {
  color: var(--c-sea-blue);
  text-decoration: none;
  transition: color var(--t-fast) var(--ease-out);
}

a:hover {
  color: var(--c-pink);
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--f-heading);
  font-weight: 400;
  line-height: 1.2;
  margin: 0;
  color: var(--c-sea-blue);
  letter-spacing: 0.2px;
}

p {
  margin: 0 0 var(--s-3) 0;
}

p:last-child {
  margin-bottom: 0;
}

/* ---------- 3. Custom Scrollbar ---------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--c-gray-100);
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--c-pink), var(--c-orange));
  border-radius: var(--r-pill);
  border: 2px solid var(--c-gray-100);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, var(--c-orange), var(--c-pink));
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--c-pink) var(--c-gray-100);
}

/* ---------- 4. App Shell + Phone Frame ---------- */
.app {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* PC: render a phone frame */
@media (min-width: 768px) {
  body {
    background:
      radial-gradient(circle at 20% 10%, rgba(255, 107, 157, 0.18), transparent 40%),
      radial-gradient(circle at 80% 90%, rgba(6, 214, 160, 0.18), transparent 40%),
      var(--c-gray-100);
    padding: var(--s-7) var(--s-4);
  }

  .app {
    max-width: var(--phone-max);
    margin: 0 auto;
    background: var(--c-white);
    border-radius: 36px;
    box-shadow:
      0 0 0 10px #1a1a1a,
      0 0 0 12px #2a2a2a,
      0 30px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    min-height: calc(100vh - 56px);
    min-height: calc(100dvh - 56px);
  }
}

@media (min-width: 1200px) {
  body {
    padding: var(--s-9) var(--s-4);
  }

  .app {
    min-height: calc(100vh - 112px);
    min-height: calc(100dvh - 112px);
  }
}

/* ---------- 5. Top Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--grad-hero);
  color: var(--c-white);
  height: var(--nav-height);
  display: flex;
  align-items: center;
  padding: 0 var(--s-4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.18);
  border-bottom: 2px solid rgba(255, 201, 60, 0.25);
}

.nav::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(2px 2px at 20% 30%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(2px 2px at 70% 60%, rgba(255, 255, 255, 0.4), transparent),
    radial-gradient(1px 1px at 40% 80%, rgba(255, 255, 255, 0.5), transparent);
  pointer-events: none;
  opacity: 0.6;
}

.nav-inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  position: relative;
  z-index: 1;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--f-heading);
  font-size: 18px;
  color: var(--c-white);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-brand:hover {
  color: var(--c-gold);
}

.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-pink);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: var(--shadow-glow-pink);
  animation: pulse-soft 2.4s var(--ease-bounce) infinite;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--s-1);
}

.nav-link {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  font-family: var(--f-heading);
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
  transition: all var(--t-fast) var(--ease-out);
  position: relative;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--c-white);
  background: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
  color: var(--c-sea-blue);
  background: var(--c-gold);
  box-shadow: 0 4px 12px rgba(255, 201, 60, 0.4);
}

.nav-link.active::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--c-gold);
  box-shadow: 0 0 8px var(--c-gold);
}

/* Mobile nav: tighter */
@media (max-width: 480px) {
  .nav-brand {
    font-size: 16px;
  }
  .nav-logo {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }
  .nav-link {
    padding: 6px 10px;
    font-size: 12px;
  }
}

/* ---------- 6. Hero Section ---------- */
.hero {
  position: relative;
  background: var(--grad-hero);
  color: var(--c-white);
  padding: var(--s-9) var(--s-4) var(--s-9);
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(255, 107, 157, 0.35) 0%, transparent 35%),
    radial-gradient(circle at 85% 75%, rgba(6, 214, 160, 0.3) 0%, transparent 35%),
    radial-gradient(circle at 50% 50%, rgba(255, 201, 60, 0.18) 0%, transparent 50%);
  z-index: -1;
}

.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.hero-particles span {
  position: absolute;
  display: block;
  width: var(--size, 12px);
  height: var(--size, 12px);
  border-radius: 50%;
  background: var(--c-pink);
  box-shadow: 0 0 12px currentColor;
  color: var(--c-pink);
  bottom: -20px;
  left: var(--x, 50%);
  opacity: 0.7;
  animation: float-up var(--dur, 8s) var(--delay, 0s) linear infinite;
}

.hero-particles span:nth-child(2n) { background: var(--c-gold); color: var(--c-gold); }
.hero-particles span:nth-child(3n) { background: var(--c-green); color: var(--c-green); }
.hero-particles span:nth-child(5n) { background: var(--c-orange); color: var(--c-orange); }

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 420px;
  margin: 0 auto;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: var(--s-4);
  color: var(--c-gold);
  animation: float-y 3s var(--ease-bounce) infinite;
}

.hero-title {
  font-family: var(--f-heading);
  font-size: clamp(32px, 9vw, 48px);
  color: var(--c-white);
  margin: 0 0 var(--s-3) 0;
  line-height: 1.05;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  animation: rise-in 0.7s var(--ease-out) both;
}

.hero-title .accent {
  display: inline-block;
  background: var(--grad-pink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  animation: hue-shift 6s linear infinite;
}

.hero-subtitle {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--s-6) 0;
  animation: rise-in 0.7s 0.15s var(--ease-out) both;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 14px 28px;
  background: var(--grad-pink);
  color: var(--c-white);
  border-radius: var(--r-pill);
  font-family: var(--f-heading);
  font-size: 16px;
  letter-spacing: 0.3px;
  box-shadow: var(--shadow-glow-pink);
  transition: transform var(--t-fast) var(--ease-bounce);
  animation: rise-in 0.7s 0.3s var(--ease-out) both, pulse-soft 2.4s var(--ease-bounce) infinite 0.7s;
}

.hero-cta:hover {
  transform: translateY(-2px) scale(1.04);
  color: var(--c-white);
  box-shadow: 0 0 36px rgba(255, 107, 157, 0.7);
}

.hero-cta:active {
  transform: translateY(0) scale(0.98);
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: var(--s-7);
  margin-top: var(--s-7);
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
  animation: rise-in 0.7s 0.45s var(--ease-out) both;
}

.hero-stat-num {
  font-family: var(--f-heading);
  font-size: 22px;
  color: var(--c-gold);
  line-height: 1;
}

.hero-stat-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 4px;
}

/* Floating balls in hero */
.hero-ball {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  opacity: 0.7;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.hero-ball.b1 {
  width: 80px; height: 80px;
  background: radial-gradient(circle at 30% 30%, #FFD27D, #FF9E1F);
  top: 30px; right: -20px;
  animation: float-y 4s var(--ease-bounce) infinite;
}

.hero-ball.b2 {
  width: 56px; height: 56px;
  background: radial-gradient(circle at 30% 30%, #FFFFFF, #B7BECC);
  top: 80px; left: 10px;
  animation: float-y 5s 0.4s var(--ease-bounce) infinite;
}

.hero-ball.b3 {
  width: 44px; height: 44px;
  background: radial-gradient(circle at 30% 30%, #FFB3C9, #FF6B9D);
  bottom: 40px; right: 30px;
  animation: float-y 3.4s 0.8s var(--ease-bounce) infinite;
}

.hero-ball.b4 {
  width: 36px; height: 36px;
  background: radial-gradient(circle at 30% 30%, #B5F5DD, #06D6A0);
  bottom: 60px; left: 30px;
  animation: float-y 4.6s 1.2s var(--ease-bounce) infinite;
}

/* ---------- 7. Section ---------- */
.section {
  padding: var(--s-7) var(--s-4);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--s-4);
  gap: var(--s-3);
}

.section-title {
  font-size: 22px;
  color: var(--c-sea-blue);
  position: relative;
  padding-left: 14px;
}

.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 5px;
  background: var(--grad-pink);
  border-radius: var(--r-pill);
}

.section-subtitle {
  font-size: 12px;
  color: var(--c-gray-500);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 700;
}

.section-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--c-pink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.section-link:hover {
  color: var(--c-orange);
}

.section-link::after {
  content: "→";
  transition: transform var(--t-fast) var(--ease-out);
}

.section-link:hover::after {
  transform: translateX(3px);
}

/* ---------- 8. Category Pills ---------- */
.pills {
  display: flex;
  gap: var(--s-2);
  overflow-x: auto;
  scrollbar-width: none;
  padding: var(--s-2) 0 var(--s-4);
  margin: 0 calc(-1 * var(--s-4));
  padding-left: var(--s-4);
  padding-right: var(--s-4);
  scroll-snap-type: x mandatory;
}

.pills::-webkit-scrollbar {
  display: none;
}

.pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  background: var(--c-white);
  color: var(--c-sea-blue);
  font-family: var(--f-heading);
  font-size: 13px;
  letter-spacing: 0.3px;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast) var(--ease-out);
  scroll-snap-align: start;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pill:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--c-pink-soft);
}

.pill.active {
  background: var(--grad-pink);
  color: var(--c-white);
  border-color: transparent;
  box-shadow: var(--shadow-glow-pink);
}

.pill .emoji {
  font-size: 14px;
}

/* ---------- 9. Game Card Grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s-3);
}

.grid-3 {
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 380px) {
  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  position: relative;
  background: var(--grad-card);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-base) var(--ease-bounce), box-shadow var(--t-base) var(--ease-out);
  display: flex;
  flex-direction: column;
  border: 2px solid transparent;
}

.card:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--c-pink-soft);
}

.card-thumb {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  font-size: 64px;
  background: var(--grad-sky);
  overflow: hidden;
  isolation: isolate;
}

.card-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.3), transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(6, 214, 160, 0.3), transparent 50%);
  z-index: 0;
}

.card-thumb .emoji {
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.25));
  animation: bounce-soft 2.4s var(--ease-bounce) infinite;
}

.card:hover .card-thumb .emoji {
  animation: bounce-hard 0.6s var(--ease-bounce);
}

/* Color variants per category */
.card.cat-arcade .card-thumb { background: linear-gradient(160deg, #FF9E1F, #FF6B9D); }
.card.cat-puzzle .card-thumb { background: linear-gradient(160deg, #2C74B3, #06D6A0); }
.card.cat-skill .card-thumb { background: linear-gradient(160deg, #0A2647, #2C74B3); }
.card.cat-action .card-thumb { background: linear-gradient(160deg, #E63946, #FFC93C); }
.card.cat-sports .card-thumb { background: linear-gradient(160deg, #06D6A0, #0A2647); }
.card.cat-relaxing .card-thumb { background: linear-gradient(160deg, #FFC93C, #FF6B9D); }

.card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--c-white);
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  z-index: 2;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.card-badge.hot {
  background: var(--grad-pink);
}

.card-body {
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}

.card-title {
  font-family: var(--f-heading);
  font-size: 14px;
  color: var(--c-sea-blue);
  line-height: 1.2;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--c-gray-500);
  margin-top: 2px;
}

.card-rating {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  color: var(--c-gray-700);
  font-weight: 700;
}

.card-rating .star {
  color: var(--c-gold);
  font-size: 12px;
}

.card-plays {
  font-size: 10px;
  color: var(--c-gray-500);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.card-plays::before {
  content: "▶";
  color: var(--c-green);
  font-size: 8px;
}

.card-link {
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: var(--r-lg);
}

.card-link:focus-visible {
  outline: 3px solid var(--c-gold);
  outline-offset: 2px;
}

/* ---------- 10. Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 22px;
  border-radius: var(--r-pill);
  font-family: var(--f-heading);
  font-size: 14px;
  letter-spacing: 0.3px;
  text-decoration: none;
  transition: all var(--t-fast) var(--ease-bounce);
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.btn-primary {
  background: var(--grad-pink);
  color: var(--c-white);
  box-shadow: var(--shadow-glow-pink);
}

.btn-primary:hover {
  transform: translateY(-2px);
  color: var(--c-white);
  box-shadow: 0 0 32px rgba(255, 107, 157, 0.6);
}

.btn-secondary {
  background: var(--c-white);
  color: var(--c-sea-blue);
  border: 2px solid var(--c-sea-blue);
}

.btn-secondary:hover {
  background: var(--c-sea-blue);
  color: var(--c-white);
}

.btn-ghost {
  background: transparent;
  color: var(--c-sea-blue);
  border: 2px solid var(--c-gray-200);
}

.btn-ghost:hover {
  border-color: var(--c-pink);
  color: var(--c-pink);
}

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 15px;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 12px;
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.55;
  pointer-events: none;
}

/* ---------- 11. Loading Animations ---------- */
.loader {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--s-4);
  padding: var(--s-9) var(--s-4);
}

.loader-ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #FFD27D, #FF6B9D);
  position: relative;
  box-shadow: 0 8px 24px rgba(255, 107, 157, 0.5);
  animation: ball-pulse 1.4s var(--ease-bounce) infinite;
}

.loader-ball::before,
.loader-ball::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
}

.loader-ball::before {
  border-top-color: var(--c-gold);
  border-right-color: var(--c-gold);
  animation: spin 1.4s linear infinite;
}

.loader-ball::after {
  inset: -12px;
  border: 2px dashed rgba(255, 255, 255, 0.4);
  animation: spin 3s linear infinite reverse;
}

.loader-text {
  font-family: var(--f-heading);
  font-size: 14px;
  color: var(--c-gray-500);
  letter-spacing: 1px;
  text-transform: uppercase;
  animation: pulse-text 1.4s var(--ease-bounce) infinite;
}

.loader-dots span {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--c-pink);
  border-radius: 50%;
  margin: 0 2px;
  animation: bounce-dot 1.2s var(--ease-bounce) infinite;
}

.loader-dots span:nth-child(2) { animation-delay: 0.15s; }
.loader-dots span:nth-child(3) { animation-delay: 0.3s; }

/* Full-screen loader */
.loader-screen {
  position: fixed;
  inset: 0;
  background: var(--grad-hero);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--s-4);
  color: var(--c-white);
  transition: opacity var(--t-slow) var(--ease-out), visibility var(--t-slow);
}

.loader-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-screen .loader-text {
  color: var(--c-gold);
}

/* ---------- 12. Particles (general) ---------- */
.particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-pink);
  opacity: 0.5;
  animation: drift 12s linear infinite;
}

.particle:nth-child(odd) { background: var(--c-gold); }
.particle:nth-child(3n) { background: var(--c-green); }
.particle:nth-child(5n) { background: var(--c-orange); }

/* ---------- 13. Sticky Bottom Ad ---------- */
.sticky-ad {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--c-white);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
  transform: translateY(100%);
  transition: transform 0.4s var(--ease-out);
  padding: var(--s-2) var(--s-3);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  border-top: 2px solid var(--c-pink-soft);
  max-width: var(--phone-max);
  margin: 0 auto;
  width: 100%;
}

.sticky-ad.show {
  transform: translateY(0);
}

.sticky-ad > div[id^="div-gpt-ad"] {
  flex: 1;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sticky-ad-close {
  position: absolute;
  top: -28px;
  right: 8px;
  width: 32px;
  height: 32px;
  background: var(--c-sea-blue);
  color: var(--c-white);
  border-radius: 50%;
  font-size: 14px;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--t-fast) var(--ease-bounce);
  z-index: 2;
}

.sticky-ad-close:hover {
  transform: scale(1.1) rotate(90deg);
  background: var(--c-pink);
}

.sticky-ad-reopen {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  justify-content: center;
  padding-bottom: 12px;
  pointer-events: none;
}

.sticky-ad-reopen .btn {
  pointer-events: auto;
  background: var(--c-gold);
  color: var(--c-sea-blue);
  box-shadow: var(--shadow-glow-gold);
  font-size: 12px;
  padding: 8px 16px;
}

.sticky-ad-reopen.hidden {
  display: none;
}

/* Hide sticky on larger screens, GPT banners are inline */
@media (min-width: 768px) {
  .sticky-ad {
    max-width: calc(var(--phone-max) - 16px);
  }
}

/* ---------- 14. Ad Slot Containers ---------- */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: var(--s-5) 0;
  min-height: 60px;
  background:
    repeating-linear-gradient(
      45deg,
      rgba(10, 38, 71, 0.03),
      rgba(10, 38, 71, 0.03) 8px,
      transparent 8px,
      transparent 16px
    );
  border-radius: var(--r-md);
  padding: var(--s-2);
}

.ad-slot > div[id^="div-gpt-ad"] {
  display: block;
  margin: 0 auto;
}

.ad-label {
  font-size: 9px;
  text-align: center;
  color: var(--c-gray-500);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 4px;
  font-weight: 700;
}

/* ---------- 15. Page Title Block ---------- */
.page-head {
  background: var(--grad-hero);
  color: var(--c-white);
  padding: var(--s-7) var(--s-4) var(--s-5);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-head::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(255, 201, 60, 0.25), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(255, 107, 157, 0.25), transparent 40%);
}

.page-head-content {
  position: relative;
  z-index: 1;
}

.page-title {
  font-size: 28px;
  color: var(--c-white);
  margin: 0 0 var(--s-2) 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  max-width: 320px;
  margin: 0 auto;
}

.page-count {
  display: inline-block;
  margin-top: var(--s-3);
  padding: 4px 12px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--c-gold);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- 16. Form ---------- */
.form {
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--s-4);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--f-heading);
  font-size: 13px;
  color: var(--c-sea-blue);
  letter-spacing: 0.3px;
}

.form-control {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--c-gray-200);
  border-radius: var(--r-md);
  background: var(--c-white);
  font: inherit;
  color: var(--c-ink);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.form-control:focus {
  outline: none;
  border-color: var(--c-pink);
  box-shadow: 0 0 0 4px rgba(255, 107, 157, 0.15);
}

textarea.form-control {
  min-height: 130px;
  resize: vertical;
  font-family: inherit;
}

.form-help {
  font-size: 12px;
  color: var(--c-gray-500);
}

.form-success {
  background: rgba(6, 214, 160, 0.12);
  color: var(--c-green-dark);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  border-left: 4px solid var(--c-green);
  font-size: 14px;
  display: none;
}

.form-success.show {
  display: block;
  animation: rise-in 0.4s var(--ease-out);
}

/* ---------- 17. Social Icons ---------- */
.social {
  display: flex;
  gap: var(--s-3);
  justify-content: center;
  flex-wrap: wrap;
}

.social a {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--c-white);
  color: var(--c-sea-blue);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast) var(--ease-bounce);
  border: 2px solid var(--c-gray-100);
}

.social a:hover {
  background: var(--grad-pink);
  color: var(--c-white);
  transform: translateY(-3px) rotate(-5deg);
  border-color: transparent;
  box-shadow: var(--shadow-glow-pink);
}

/* ---------- 18. Footer ---------- */
.footer {
  background: var(--c-sea-blue);
  color: rgba(255, 255, 255, 0.85);
  padding: var(--s-7) var(--s-4) calc(var(--s-6) + var(--bottom-safe));
  text-align: center;
  margin-top: auto;
  position: relative;
  overflow: hidden;
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--c-pink), var(--c-gold), var(--c-green));
  background-size: 200% 100%;
  animation: hue-shift 4s linear infinite;
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--f-heading);
  font-size: 20px;
  color: var(--c-white);
  margin-bottom: var(--s-3);
}

.footer-logo {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-pink);
  display: grid;
  place-items: center;
  font-size: 18px;
  box-shadow: var(--shadow-glow-pink);
}

.footer-tagline {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: var(--s-5);
  max-width: 280px;
  margin-left: auto;
  margin-right: auto;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-4) var(--s-5);
  margin-bottom: var(--s-5);
  font-size: 13px;
  font-weight: 700;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.85);
  transition: color var(--t-fast) var(--ease-out);
}

.footer-links a:hover {
  color: var(--c-gold);
}

.footer-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.12);
  margin: var(--s-4) auto;
  max-width: 280px;
}

.footer-copy {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  letter-spacing: 0.5px;
  line-height: 1.6;
}

.footer-copy a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-copy a:hover {
  color: var(--c-gold);
}

/* ---------- 19. Play Page (Iframe Host) ---------- */
.play-wrap {
  position: relative;
  background: var(--c-black);
  display: flex;
  flex-direction: column;
  flex: 1;
}

.play-bar {
  background: var(--c-ink);
  color: var(--c-white);
  padding: var(--s-3) var(--s-4);
  display: flex;
  align-items: center;
  gap: var(--s-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.play-back {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 18px;
  color: var(--c-white);
  flex-shrink: 0;
  transition: all var(--t-fast) var(--ease-bounce);
}

.play-back:hover {
  background: var(--c-pink);
  transform: scale(1.08);
}

.play-title {
  flex: 1;
  font-family: var(--f-heading);
  font-size: 16px;
  color: var(--c-white);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.play-fav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 16px;
  color: var(--c-gold);
  flex-shrink: 0;
  transition: all var(--t-fast) var(--ease-bounce);
}

.play-fav:hover {
  background: var(--c-pink);
  color: var(--c-white);
  transform: scale(1.08);
}

.play-fav.active {
  background: var(--c-pink);
  color: var(--c-white);
}

.play-stage {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 60vh;
  background: var(--c-black);
  overflow: hidden;
  isolation: isolate;
}

.play-iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: var(--c-black);
  z-index: 1;
}

.play-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: var(--s-4);
  background: var(--c-black);
  color: var(--c-white);
  transition: opacity var(--t-base) var(--ease-out);
}

.play-loading.hide {
  opacity: 0;
  pointer-events: none;
}

.play-loading .loader-text {
  color: var(--c-gold);
}

.play-error {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--s-3);
  padding: var(--s-5);
  text-align: center;
  color: var(--c-white);
  background: var(--c-black);
}

.play-error.show {
  display: flex;
}

.play-error h3 {
  color: var(--c-gold);
  font-size: 18px;
}

.play-error p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  max-width: 280px;
}

.play-bottom {
  background: var(--c-ink);
  color: var(--c-white);
  padding: var(--s-3) var(--s-4) calc(var(--s-3) + var(--bottom-safe));
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.play-bottom a {
  color: var(--c-gold);
  font-weight: 700;
}

/* ---------- 20. 404 Page ---------- */
.error-404 {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--s-9) var(--s-4);
  position: relative;
  overflow: hidden;
  background: var(--grad-hero);
  color: var(--c-white);
  min-height: 60vh;
}

.error-404::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 107, 157, 0.3), transparent 50%),
    radial-gradient(circle at 70% 70%, rgba(6, 214, 160, 0.3), transparent 50%);
}

.error-num {
  font-family: var(--f-heading);
  font-size: 140px;
  line-height: 1;
  margin: 0;
  background: var(--grad-pink);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 60px rgba(255, 107, 157, 0.4);
  position: relative;
  z-index: 1;
  animation: bounce-soft 2s var(--ease-bounce) infinite;
}

.error-emoji {
  font-size: 56px;
  margin-bottom: var(--s-3);
  position: relative;
  z-index: 1;
  animation: drop-in 1.4s var(--ease-bounce) both;
  filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
}

.error-title {
  font-size: 24px;
  color: var(--c-white);
  margin-bottom: var(--s-2);
  position: relative;
  z-index: 1;
}

.error-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 14px;
  max-width: 280px;
  margin: 0 auto var(--s-6);
  position: relative;
  z-index: 1;
}

.error-actions {
  display: flex;
  gap: var(--s-3);
  flex-wrap: wrap;
  justify-content: center;
  position: relative;
  z-index: 1;
}

/* ---------- 21. Legal / Doc Pages ---------- */
.doc {
  padding: var(--s-7) var(--s-4);
  max-width: 720px;
  margin: 0 auto;
  color: var(--c-ink);
  font-size: 15px;
  line-height: 1.7;
}

.doc h1 {
  font-size: 28px;
  margin-bottom: var(--s-2);
}

.doc h2 {
  font-size: 20px;
  margin: var(--s-6) 0 var(--s-3);
  padding-top: var(--s-3);
  border-top: 2px dashed var(--c-gray-200);
  position: relative;
}

.doc h2::before {
  content: "🏀";
  position: absolute;
  left: -28px;
  top: var(--s-3);
  font-size: 14px;
  opacity: 0.5;
  display: none;
}

.doc h3 {
  font-size: 16px;
  margin: var(--s-4) 0 var(--s-2);
  color: var(--c-pink);
}

.doc p,
.doc li {
  color: var(--c-gray-700);
}

.doc ul {
  list-style: none;
  margin: var(--s-2) 0;
  padding-left: 0;
}

.doc ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: var(--s-2);
}

.doc ul li::before {
  content: "🏀";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 12px;
}

.doc-meta {
  color: var(--c-gray-500);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  margin-bottom: var(--s-3);
}

.doc-callout {
  background: var(--c-cream);
  border-left: 4px solid var(--c-pink);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-sm);
  margin: var(--s-4) 0;
  font-size: 14px;
  color: var(--c-sea-blue);
}

.doc-callout strong {
  color: var(--c-pink);
}

.doc a {
  color: var(--c-pink);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--c-pink-soft);
  text-underline-offset: 3px;
}

.doc a:hover {
  color: var(--c-orange);
  text-decoration-color: var(--c-orange);
}

/* ---------- 22. Contact Page Specific ---------- */
.contact-card {
  background: var(--grad-card);
  border-radius: var(--r-lg);
  padding: var(--s-6) var(--s-5);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--s-5);
  border: 2px solid var(--c-gray-100);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3) 0;
  border-bottom: 1px solid var(--c-gray-100);
}

.contact-row:last-child {
  border-bottom: 0;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-pink);
  color: var(--c-white);
  display: grid;
  place-items: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: var(--shadow-glow-pink);
}

.contact-label {
  font-size: 11px;
  color: var(--c-gray-500);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 700;
}

.contact-value {
  color: var(--c-sea-blue);
  font-family: var(--f-heading);
  font-size: 14px;
  word-break: break-all;
}

.contact-value a {
  color: inherit;
}

.contact-value a:hover {
  color: var(--c-pink);
}

/* ---------- 23. Empty State ---------- */
.empty {
  padding: var(--s-9) var(--s-4);
  text-align: center;
  color: var(--c-gray-500);
}

.empty-emoji {
  font-size: 48px;
  margin-bottom: var(--s-3);
  opacity: 0.6;
  animation: bounce-soft 2s var(--ease-bounce) infinite;
}

.empty-text {
  font-size: 14px;
}

/* ---------- 24. Keyframe Animations ---------- */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

@keyframes float-up {
  0% { transform: translateY(0) scale(0.6); opacity: 0; }
  10% { opacity: 0.7; }
  90% { opacity: 0.7; }
  100% { transform: translateY(-100vh) scale(1); opacity: 0; }
}

@keyframes drift {
  0% { transform: translate(0, 0) scale(0.6); opacity: 0; }
  20% { opacity: 0.5; }
  80% { opacity: 0.5; }
  100% { transform: translate(var(--dx, 100px), -120vh) scale(1); opacity: 0; }
}

@keyframes pulse-soft {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

@keyframes pulse-text {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes bounce-soft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes bounce-hard {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.2) rotate(-8deg); }
  60% { transform: scale(0.95) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes bounce-dot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40% { transform: scale(1); opacity: 1; }
}

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

@keyframes hue-shift {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

@keyframes rise-in {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes drop-in {
  0% { opacity: 0; transform: translateY(-200px) rotate(180deg); }
  60% { opacity: 1; transform: translateY(20px) rotate(0); }
  80% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

@keyframes ball-pulse {
  0%, 100% { transform: scale(0.85); box-shadow: 0 4px 12px rgba(255, 107, 157, 0.4); }
  50% { transform: scale(1.1); box-shadow: 0 12px 32px rgba(255, 107, 157, 0.7); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 201, 60, 0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255, 201, 60, 0); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in { animation: fade-in 0.5s var(--ease-out) both; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

.shake { animation: shake 0.4s var(--ease-bounce); }

/* ---------- 25. Utilities ---------- */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-3 { margin-top: var(--s-3); }
.mt-5 { margin-top: var(--s-5); }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: var(--s-3); }
.mb-5 { margin-bottom: var(--s-5); }
.gap-3 { gap: var(--s-3); }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }

/* ---------- 26. Print ---------- */
@media print {
  .nav,
  .footer,
  .sticky-ad,
  .ad-slot,
  .particles,
  .hero-particles {
    display: none !important;
  }
  body { background: white; }
  .app { box-shadow: none; max-width: 100%; }
}

/* ---------- 27. Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
 * 28. Detail Page Styles (用于 detail-{id}.html / play.html / 子页)
 * 与 worker B 生成的 HTML 类对齐
 * ===================================================================== */

/* Site header (通用顶部) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3, 12px);
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--c-navy, #0A2647) 0%, #061a35 100%);
  color: #fff;
  border-bottom: 2px solid var(--c-green, #06D6A0);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #fff;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
}
.brand-icon {
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4));
}
.brand-text { letter-spacing: 0.2px; }
.site-nav { display: flex; gap: 8px; align-items: center; }
.site-nav .nav-link {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #cfe5ff;
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background 0.2s, color 0.2s;
}
.site-nav .nav-link:hover,
.site-nav .nav-link.active {
  background: var(--c-orange, #FF9E1F);
  color: #0A2647;
}

/* Site footer (通用底部) */
.site-footer {
  margin-top: 32px;
  padding: 32px 16px 24px;
  background: linear-gradient(180deg, #061a35 0%, var(--c-navy, #0A2647) 100%);
  color: #cfe5ff;
  text-align: center;
  font-family: 'Nunito', sans-serif;
}
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 18px;
  margin-bottom: 12px;
  font-size: 14px;
}
.footer-nav a {
  color: #cfe5ff;
  text-decoration: none;
  font-weight: 600;
}
.footer-nav a:hover { color: var(--c-green, #06D6A0); }
.footer-nav .footer-copy,
.site-footer .footer-copy {
  margin-top: 12px;
  font-size: 12px;
  color: #6f8fb0;
}

/* Detail page main wrapper */
.detail-main {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Game hero */
.game-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 24px 16px;
  background: linear-gradient(135deg, rgba(10,38,71,0.95), rgba(6,214,160,0.18));
  border: 2px solid var(--c-green, #06D6A0);
  border-radius: 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.game-hero::before {
  content: "";
  position: absolute;
  inset: -20%;
  background: radial-gradient(circle at 30% 20%, rgba(255,158,31,0.18), transparent 60%),
              radial-gradient(circle at 80% 80%, rgba(255,107,157,0.12), transparent 60%);
  pointer-events: none;
}
.game-icon-large {
  font-size: 80px;
  line-height: 1;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.45));
  animation: floatBall 3s ease-in-out infinite;
  z-index: 1;
}
.game-title {
  margin: 4px 0 0;
  font-family: 'Fredoka One', cursive;
  font-size: 28px;
  color: #fff;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
  z-index: 1;
}
.game-hero .subtitle {
  margin: 0;
  color: #cfe5ff;
  font-size: 14px;
  font-family: 'Nunito', sans-serif;
  z-index: 1;
}
.game-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
  font-family: 'Nunito', sans-serif;
  font-size: 13px;
  z-index: 1;
}
.game-meta .meta-rating { color: #FFC93C; font-weight: 700; }
.game-meta .meta-plays  { color: #06D6A0; font-weight: 700; }
.game-meta .meta-likes  { color: #FF6B9D; font-weight: 700; }
.btn-play-now {
  display: inline-block;
  margin-top: 12px;
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--c-orange, #FF9E1F), #ff7e1f);
  color: #0A2647;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  text-decoration: none;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(255,158,31,0.45);
  transition: transform 0.15s, box-shadow 0.15s;
  z-index: 1;
}
.btn-play-now:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(255,158,31,0.6); }
.btn-play-now:active { transform: translateY(0); }

/* Game info / how to play / tags / comments sections */
.game-info,
.how-to-play,
.game-tags,
.comments,
.related-games {
  background: rgba(10, 38, 71, 0.5);
  border: 1px solid rgba(6, 214, 160, 0.3);
  border-radius: 14px;
  padding: 18px;
  font-family: 'Nunito', sans-serif;
  color: #ffffff;
}
.game-info h2,
.how-to-play h2,
.game-tags h2,
.comments h2,
.related-games h2 {
  font-family: 'Fredoka One', cursive;
  color: var(--c-green, #06D6A0);
  font-size: 20px;
  margin: 0 0 12px;
}
.game-info p { line-height: 1.65; margin: 0; color: #ffffff; }
.how-to-play ol { margin: 0; padding-left: 20px; }
.how-to-play li { margin-bottom: 8px; line-height: 1.55; color: #ffffff; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pill {
  display: inline-block;
  padding: 6px 14px;
  background: linear-gradient(135deg, var(--c-green, #06D6A0), #04a87f);
  color: #0A2647;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

/* Comments */
.comments .comment {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.comments .comment:last-child { border-bottom: none; }
.comments .comment-avatar {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  font-size: 22px;
  flex-shrink: 0;
}
.comments .comment-body { flex: 1; }
.comments .comment-name {
  font-weight: 700;
  color: #FFC93C;
  margin-right: 8px;
}
.comments .comment-stars { color: var(--c-orange, #FF9E1F); }
.comments .comment-text { margin: 4px 0; line-height: 1.5; color: #ffffff; }
.comments .comment-date { font-size: 12px; color: #6f8fb0; }

/* Related games grid (详情页底部) */
.related-games .game-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Ad slot defaults (already exists, but ensure it works inside detail) */
.ad-slot {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  min-height: 60px;
}
.ad-slot > div[id^="div-gpt-ad"] { margin: 0 auto; }

/* =====================================================================
 * 29. Sticky bottom ad (兼容 .sticky-ad-bottom/.sticky-ad-collapsed 命名)
 * ===================================================================== */
.sticky-ad-bottom {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 60;
  background: #fff;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.25);
  transform: translateY(0);
  transition: transform 0.4s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 8px 0;
  min-height: 60px;
}
.sticky-ad-bottom.sticky-ad-collapsed {
  transform: translateY(100%);
}
.sticky-ad-bottom .sticky-ad-label {
  position: absolute;
  top: 2px; left: 8px;
  font-size: 10px;
  color: #6f8fb0;
  font-family: 'Nunito', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.sticky-ad-bottom .sticky-ad-close {
  position: absolute;
  top: 4px; right: 8px;
  width: 24px; height: 24px;
  border: none;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}
.sticky-ad-bottom .sticky-ad-close:hover { background: rgba(0,0,0,0.8); }
.sticky-ad-bottom .sticky-ad-content { width: 100%; display: flex; justify-content: center; }
.sticky-ad-bottom .sticky-ad-frame { width: 100%; max-width: 480px; }

/* Sticky reopen button (compatible with .sticky-ad-reopen) */
.sticky-ad-reopen {
  position: fixed;
  bottom: 12px; right: 12px;
  z-index: 55;
  display: flex;
}
.sticky-ad-reopen.hidden { display: none; }

/* =====================================================================
 * 30. Contact form
 * ===================================================================== */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
  font-family: 'Nunito', sans-serif;
}
.contact-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.contact-form label {
  font-weight: 700;
  font-size: 13px;
  color: #cfe5ff;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.06);
  color: #fff;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
}
.contact-form textarea { min-height: 100px; resize: vertical; }
.contact-form button {
  align-self: flex-start;
  padding: 10px 24px;
  background: var(--c-orange, #FF9E1F);
  color: #0A2647;
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  border: none;
  border-radius: 999px;
  cursor: pointer;
}
.contact-form button:hover { background: #ff7e1f; }

/* =====================================================================
 * 31. Privacy / Terms / Contact content blocks
 * ===================================================================== */
.legal-main,
.contact-main {
  padding: 20px 16px 40px;
  font-family: 'Nunito', sans-serif;
  color: #e5edf5;
  max-width: 720px;
  margin: 0 auto;
}
.legal-main h1,
.contact-main h1 {
  font-family: 'Fredoka One', cursive;
  color: var(--c-green, #06D6A0);
  font-size: 26px;
  margin: 0 0 16px;
}
.legal-main h2 {
  font-family: 'Fredoka One', cursive;
  color: var(--c-orange, #FF9E1F);
  font-size: 18px;
  margin: 24px 0 8px;
}
.legal-main p,
.legal-main li {
  line-height: 1.65;
  font-size: 15px;
}
.legal-main ul,
.legal-main ol { padding-left: 22px; }
.legal-main a { color: var(--c-green, #06D6A0); }
.contact-card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 20px;
}
.contact-card .label { color: #FFC93C; font-weight: 700; margin-right: 6px; }

/* =====================================================================
 * 32. 404 page
 * ===================================================================== */
.notfound-main {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 16px;
  font-family: 'Nunito', sans-serif;
  color: #e5edf5;
}
.notfound-main .big-404 {
  font-family: 'Fredoka One', cursive;
  font-size: 120px;
  color: var(--c-orange, #FF9E1F);
  text-shadow: 0 6px 24px rgba(255,158,31,0.4);
  line-height: 1;
  margin: 0;
  animation: floatBall 2.4s ease-in-out infinite;
}
.notfound-main h2 {
  font-family: 'Fredoka One', cursive;
  color: #fff;
  font-size: 22px;
  margin: 8px 0 4px;
}
.notfound-main p { color: #cfe5ff; max-width: 320px; }
.notfound-main .actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

/* =====================================================================
 * 33. play.html 顶部栏 + iframe
 * ===================================================================== */
.play-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: linear-gradient(180deg, var(--c-navy, #0A2647) 0%, #061a35 100%);
  border-bottom: 2px solid var(--c-green, #06D6A0);
  color: #fff;
}
.play-header .back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #fff;
  text-decoration: none;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
}
.play-header .play-title {
  margin: 0;
  font-family: 'Fredoka One', cursive;
  font-size: 18px;
  flex: 1;
  text-align: center;
}
.play-header .fav-btn {
  background: transparent;
  border: 1px solid var(--c-orange, #FF9E1F);
  color: var(--c-orange, #FF9E1F);
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}
.play-frame-wrap {
  position: relative;
  width: 100%;
  height: calc(100vh - 56px);
  background: #000;
  overflow: hidden;
}
.play-frame-wrap iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.play-frame-wrap .loading-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #061a35 0%, var(--c-navy, #0A2647) 100%);
  color: #fff;
  font-family: 'Nunito', sans-serif;
  gap: 12px;
  z-index: 2;
  transition: opacity 0.4s;
}
.play-frame-wrap .loading-overlay.hidden { opacity: 0; pointer-events: none; }
.play-frame-wrap .loading-ball {
  width: 48px; height: 48px;
  background: radial-gradient(circle at 30% 30%, #fff, var(--c-orange, #FF9E1F) 70%);
  border-radius: 50%;
  animation: floatBall 1.2s ease-in-out infinite;
  box-shadow: 0 0 20px rgba(255,158,31,0.5);
}

/* =====================================================================
 * 34. Index / list shared card + grid + section styles
 * (worker A 用了 .game-card，worker B 用了 .game-card via renderGameCard；这里是统一保险)
 * ===================================================================== */
.game-card {
  display: flex;
  flex-direction: column;
  background: rgba(10, 38, 71, 0.45);
  border: 1px solid rgba(6, 214, 160, 0.25);
  border-radius: 14px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  font-family: 'Nunito', sans-serif;
}
.game-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-green, #06D6A0);
  box-shadow: 0 8px 20px rgba(6,214,160,0.18);
}
.game-card .card-icon {
  font-size: 56px;
  text-align: center;
  margin-bottom: 6px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}
.game-card .card-title {
  font-family: 'Fredoka One', cursive;
  font-size: 15px;
  color: #fff;
  margin: 0 0 4px;
  line-height: 1.2;
}
.game-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: #cfe5ff;
}
.game-card .card-rating { color: #FFC93C; font-weight: 700; }
.game-card .card-plays { color: #06D6A0; }
.game-card .card-category {
  margin-top: 6px;
  font-size: 11px;
  color: #FF6B9D;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
}
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 768px) {
  .grid { gap: 16px; }
}
.section .section-title::before,
.section-title::before { content: "🏆"; }
