/* -----------------------------------
   Global
----------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #0f172a;
  color: #0f172a;
}

/* Utility-ish */
.w-full {
  width: 100%;
}

/* -----------------------------------
   Header
----------------------------------- */
/* -----------------------------------
   Header (aligned with percentage/BMI pages)
----------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0;
  gap: 1.25rem;
}

/* Logo + site name */
.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
}

.site-logo img {
  display: block;
  height: 40px;
  width: auto;
}

/* TEXT NEXT TO LOGO – visible on mobile too */
.site-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

/* Desktop nav */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
}

.nav-links a {
  position: relative;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  background: #16a34a;
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: #16a34a;
  transform: translateY(-1px);
}

.nav-links a:hover::after {
  width: 100%;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* More dropdown (desktop only) */
.dropdown {
  position: relative;
}

.more-toggle {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  transition: background 0.2s ease, color 0.2s ease,
              transform 0.2s ease, box-shadow 0.2s ease;
}

.more-toggle:hover {
  background: #16a34a;
  color: #f9fafb;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(22, 163, 74, 0.35);
}

.dropdown-content {
  position: absolute;
  right: 0;
  top: calc(100% + 0.5rem);
  min-width: 220px;
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.5rem 0;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  opacity: 0;
  transform: translateY(-6px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 40;
}

.dropdown.open .dropdown-content {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.dropdown-content a {
  display: block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  color: #111827;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease,
              padding-left 0.15s ease;
}

.dropdown-content a:hover {
  background: #f1f5f9;
  color: #16a34a;
  padding-left: 1.2rem;
}

/* Mobile menu toggle */
.mobile-menu-btn {
  display: none;
  border: none;
  background: transparent;
  color: #0f172a;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0.25rem 0.35rem;
  border-radius: 0.375rem;
  transition: background 0.2s ease, transform 0.1s ease;
}

.mobile-menu-btn:hover {
  background: rgba(148, 163, 184, 0.25);
  transform: translateY(-1px);
}

/* Mobile slide-down menu */
.mobile-menu {
  display: none;
  position: relative;
  margin-top: 0.35rem;
  border-radius: 0.75rem;
  overflow: hidden;
  background: linear-gradient(145deg, #16a34a 0%, #15803d 40%, #166534 100%);
  box-shadow: 0 16px 35px rgba(21, 128, 61, 0.45);
  transform-origin: top;
  transform: scaleY(0.9);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu.open {
  display: block;
  opacity: 1;
  transform: scaleY(1);
}

.mobile-menu a {
  display: block;
  padding: 0.7rem 1rem;
  font-size: 0.96rem;
  font-weight: 500;
  color: #f9fafb;
  text-decoration: none;
  border-bottom: 1px solid rgba(22, 163, 74, 0.35);
  transition: background 0.18s ease, padding-left 0.18s ease;
}

.mobile-menu a:last-child {
  border-bottom: none;
}

.mobile-menu a:hover {
  background: rgba(15, 23, 42, 0.15);
  padding-left: 1.3rem;
}

/* ------- Mobile tweaks ------- */
@media (max-width: 768px) {
  /* show logo text but a bit smaller so it fits */
  .site-title {
    font-size: 0.9rem;
  }

  .nav-links {
    display: none;
  }

  /* HIDE More dropdown on mobile */
  .dropdown {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }
}

/* -----------------------------------
   Hero Section
----------------------------------- */
.page-hero {
  padding: 2.75rem 1rem 2.5rem;
  background: radial-gradient(circle at top, #22c55e 0%, transparent 55%),
              radial-gradient(circle at bottom, #1d4ed8 0%, transparent 60%),
              #020617;
  color: #e5e7eb;
  text-align: center;
}

.hero-title {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-size: clamp(0.98rem, 2.1vw, 1.06rem);
  max-width: 38rem;
  margin: 0 auto;
  color: #cbd5f5;
}

/* -----------------------------------
   Main Layout
----------------------------------- */
.main-wrap {
  background: radial-gradient(circle at top left, rgba(56, 189, 248, 0.12), transparent 55%),
              radial-gradient(circle at bottom right, rgba(34, 197, 94, 0.14), transparent 55%),
              #020617;
  padding-bottom: 4rem;
}

.game-section {
  margin-top: 2.5rem;
  margin-bottom: 2.5rem;
}

/* Cards / Sections */
.section-card {
  background: rgba(15, 23, 42, 0.95);
  border-radius: 1.5rem;
  padding: 1.5rem 1.25rem 1.75rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

@media (min-width: 768px) {
  .section-card {
    padding: 1.9rem 2rem 2.1rem;
    margin-bottom: 1.75rem;
  }
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #e5e7eb;
  margin-bottom: 1.15rem;
}

/* -----------------------------------
   Game Type Selector
----------------------------------- */
.game-type-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 768px) {
  .game-type-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.game-type-card {
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  text-align: left;
  background: radial-gradient(circle at top left, rgba(52, 211, 153, 0.12), transparent 60%),
              #020617;
  cursor: pointer;
  transition: border 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.game-type-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.65);
  border-color: rgba(52, 211, 153, 0.9);
}

.game-type-card.active {
  border-color: #22c55e;
  background: radial-gradient(circle at top left, rgba(52, 211, 153, 0.2), transparent 70%),
              radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.2), transparent 70%),
              #020617;
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.45);
}

.game-type-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f9fafb;
  margin-bottom: 0.2rem;
}

.game-type-desc {
  font-size: 0.9rem;
  color: #9ca3af;
  line-height: 1.5;
}

/* -----------------------------------
   Mode Selector
----------------------------------- */
.mode-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .mode-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.mode-card {
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 0.8rem 0.75rem;
  background: rgba(15, 23, 42, 0.96);
  cursor: pointer;
  text-align: center;
  transition: border 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.mode-card:hover {
  transform: translateY(-2px);
  border-color: rgba(59, 130, 246, 0.8);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.55);
}

.mode-card.active {
  border-color: #22c55e;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(59, 130, 246, 0.18));
}

.mode-icon {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.mode-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f9fafb;
}

.mode-desc {
  font-size: 0.83rem;
  color: #9ca3af;
  margin-top: 0.1rem;
}

/* -----------------------------------
   Game Layout
----------------------------------- */
.game-layout {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.canvas-wrap {
  border-radius: 1.25rem;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.7);
  background: #020617;
}

#gameCanvas {
  width: 100%;
  height: auto;
  display: block;
}

/* Stats bar under canvas */
.game-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.9rem;
  color: #e5e7eb;
}

.stat-inline {
  background: rgba(15, 23, 42, 0.7);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
}

/* Controls */
.game-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.game-btn {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  font-size: 0.93rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e 0%, #15803d 40%, #1d4ed8 100%);
  color: #f9fafb;
  box-shadow: 0 14px 30px rgba(34, 197, 94, 0.5);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.game-btn:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 18px 40px rgba(34, 197, 94, 0.6);
}

.game-btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 10px 24px rgba(34, 197, 94, 0.4);
}

.game-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

/* Info box */
.info-box {
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(15, 118, 110, 0.6));
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  border-left: 4px solid #22c55e;
}

.info-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #e5e7eb;
  margin-bottom: 0.3rem;
}

.info-text {
  font-size: 0.88rem;
  color: #d1d5db;
  line-height: 1.6;
}

/* Stats grid (overall stats) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stat-card {
  border-radius: 1rem;
  padding: 0.9rem 0.9rem 1rem;
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.3), transparent 60%),
              rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: #f9fafb;
  text-align: left;
}

.stat-label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9ca3af;
  margin-bottom: 0.2rem;
}

.stat-value {
  font-size: 1.3rem;
  font-weight: 800;
}

/* -----------------------------------
   AdSense Placeholder
----------------------------------- */
.adsense-card {
  border-radius: 1.25rem;
  padding: 1.1rem;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(22, 101, 52, 0.7));
  border: 1px dashed rgba(34, 197, 94, 0.6);
  margin-bottom: 1.8rem;
}

.adsense-inner {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #e5e7eb;
  text-align: center;
  gap: 0.25rem;
}

.ads-emoji {
  font-size: 2.3rem;
}

.ads-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.ads-text {
  font-size: 0.9rem;
  color: #cbd5e1;
}

/* -----------------------------------
   Leaderboard & Downloads
----------------------------------- */
.leaderboard-top {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .leaderboard-top {
    flex-direction: row;
    align-items: flex-end;
  }
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.input-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #cbd5e1;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.input-field {
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  padding: 0.6rem 0.8rem;
  font-size: 0.9rem;
  color: #e5e7eb;
  background: rgba(15, 23, 42, 0.85);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.input-field::placeholder {
  color: #64748b;
}

.input-field:focus {
  border-color: #22c55e;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.8);
  transform: translateY(-1px);
}

/* Downloads */
.download-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 1rem;
}

.download-btn {
  flex: 1 1 120px;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.7);
  background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), transparent 60%),
              rgba(15, 23, 42, 0.95);
  color: #e5e7eb;
  padding: 0.55rem 0.9rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.download-btn:hover {
  border-color: #22c55e;
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.2), transparent 60%),
              rgba(15, 23, 42, 0.98);
  transform: translateY(-1px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.6);
}

/* Leaderboard table */
.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.4rem;
  font-size: 0.87rem;
  background: rgba(15, 23, 42, 0.95);
  border-radius: 1rem;
  overflow: hidden;
}

.leaderboard-table thead {
  background: linear-gradient(135deg, #1d4ed8 0%, #22c55e 50%, #15803d 100%);
  color: #f9fafb;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(30, 64, 175, 0.3);
  text-align: left;
}

.leaderboard-table th {
  font-weight: 600;
  font-size: 0.82rem;
}

.leaderboard-table tbody tr:last-child td {
  border-bottom: none;
}

.leaderboard-table tbody tr:nth-child(even) {
  background: rgba(15, 23, 42, 0.92);
}

.leaderboard-table tbody tr:hover {
  background: rgba(15, 23, 42, 0.98);
}

.leaderboard-empty {
  text-align: center;
  color: #9ca3af;
  padding: 1.3rem 0.75rem;
}

/* Rank badge */
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #020617;
  background: linear-gradient(135deg, #6b7280, #374151);
}

.rank-badge.gold {
  background: linear-gradient(135deg, #fbbf24, #f97316);
  color: #1f2933;
}

.rank-badge.silver {
  background: linear-gradient(135deg, #e5e7eb, #9ca3af);
  color: #111827;
}

.rank-badge.bronze {
  background: linear-gradient(135deg, #fed7aa, #c2410c);
  color: #1f2937;
}

/* -----------------------------------
   Blog / SEO Content
----------------------------------- */
.blog-section {
  max-width: 56rem;
  margin: 0 auto 0;
  padding: 0 1rem 1rem;
}

.blog-content {
  background: #f9fafb;
  border-radius: 1.5rem;
  padding: 2.2rem 1.25rem 2.3rem;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.55);
}

@media (min-width: 768px) {
  .blog-content {
    padding: 2.5rem 2.4rem 2.6rem;
  }
}

.blog-content h2 {
  font-size: 1.85rem;
  font-weight: 800;
  margin-bottom: 1rem;
  background: linear-gradient(135deg, #1d4ed8, #22c55e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.blog-content h3 {
  font-size: 1.25rem;
  margin-top: 1.6rem;
  margin-bottom: 0.6rem;
  color: #111827;
  font-weight: 700;
}

.blog-content p {
  font-size: 0.98rem;
  line-height: 1.85;
  color: #374151;
  margin-bottom: 0.8rem;
}

.blog-content ul {
  margin: 0.5rem 0 0.9rem 1.4rem;
  padding: 0;
  color: #374151;
}

.blog-content li {
  margin-bottom: 0.4rem;
}

.blog-content a {
  color: #1d4ed8;
  text-decoration: none;
  border-bottom: 1px dashed rgba(37, 99, 235, 0.6);
  transition: color 0.18s ease, border-color 0.18s ease;
}

.blog-content a:hover {
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.8);
}

.faq-list {
  list-style: none;
  padding-left: 0;
  margin-top: 0.8rem;
}

.faq-list li {
  margin-bottom: 0.75rem;
}

/* -----------------------------------
   Footer
----------------------------------- */
.footer {
  background: linear-gradient(180deg, #020617 0%, #020617 45%, #020617 100%);
  color: #e5e7eb;
  padding: 2.7rem 1rem 1.5rem;
  margin-top: 2.5rem;
  border-top: 1px solid rgba(30, 64, 175, 0.4);
}

.footer-grid {
  margin-bottom: 1.9rem;
}

.footer-column h3 {
  font-size: 0.98rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9ca3af;
  margin-bottom: 0.8rem;
}

.footer-column p {
  font-size: 0.9rem;
  color: #cbd5e1;
  line-height: 1.7;
  margin: 0;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  margin-bottom: 0.3rem;
}

.footer-column a {
  font-size: 0.9rem;
  color: #e5e7eb;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.footer-column a:hover {
  color: #22c55e;
  transform: translateX(3px);
}

.footer-bottom {
  border-top: 1px solid rgba(51, 65, 85, 0.9);
  padding-top: 0.9rem;
  font-size: 0.82rem;
  text-align: center;
  color: #9ca3af;
}

/* -----------------------------------
   Responsive Tweaks
----------------------------------- */
@media (max-width: 768px) {
  /* Hide desktop nav on mobile */
  .nav-links {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .header-row {
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
  }

  .section-card {
    border-radius: 1.25rem;
  }

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

  .hero-subtitle {
    font-size: 0.95rem;
  }

  .blog-content {
    border-radius: 1.4rem;
  }

  .game-controls {
    flex-direction: column;
  }

  .download-buttons {
    flex-direction: column;
  }

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