@view-transition {
  navigation: auto;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
  scroll-behavior: smooth;
}

body {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100%;
}

/* HEADER & NAV */

.header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(31, 41, 55, 0.4);
}

.site-title {
  text-decoration: none;
}

.main-nav {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.nav-link {
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.25s ease;
  display: inline-block;
}

.nav-link:hover {
  color: #e5e7eb;
  transform: translateY(-1px) scale(1.05);
}

/* Dropdown (desktop) */

.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  transition: color 0.25s ease;
}

.dropdown-toggle:hover {
  color: #e5e7eb;
}

.dropdown-content {
  display: none;
  position: absolute;
  top: 120%;
  right: 0;
  background: #ffffff;
  min-width: 220px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.25);
  border-radius: 12px;
  margin-top: 8px;
  overflow: hidden;
  animation: fadeInDown 0.25s ease;
  z-index: 1100;
}

.dropdown-content a {
  color: #4b5563;
  padding: 12px 18px;
  text-decoration: none;
  display: block;
  font-size: 14px;
  transition: all 0.2s ease;
}

.dropdown-content a:hover {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #ffffff;
  padding-left: 24px;
}

.dropdown.open .dropdown-content {
  display: block;
}

/* Mobile menu */

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 26px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.mobile-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #059669; /* green */
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.5);
  padding: 12px 24px 20px;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.3s ease, opacity 0.3s ease;
  z-index: 999;
}

.mobile-menu a {
  display: block;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 118, 110, 0.3);
  color: #ecfdf5;
  font-weight: 500;
  text-decoration: none;
  font-size: 15px;
}

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

.mobile-menu a:hover {
  color: #bbf7d0;
}

.mobile-menu.open {
  max-height: 420px;
  opacity: 1;
  pointer-events: auto;
}

/* PAGE HEADER */

.page-header {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #22c55e 100%);
  color: #ffffff;
  padding: 80px 20px 100px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 120'><path d='M0,0 Q300,60 600,30 T1200,0 L1200,120 L0,120 Z' fill='rgba(255,255,255,0.12)'/></svg>") repeat-x bottom;
  background-size: 1200px 120px;
  opacity: 0.5;
}

.page-header h1 {
  font-size: 52px;
  font-weight: 900;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
  text-shadow: 2px 2px 4px rgba(15, 23, 42, 0.55);
  animation: slideInDown 0.6s ease;
}

.page-header p {
  font-size: 20px;
  opacity: 0.96;
  position: relative;
  z-index: 1;
  animation: slideInUp 0.6s ease;
}

/* ANIMATIONS */

@keyframes slideInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

.float-animation {
  animation: float 3s ease-in-out infinite;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* GAME CONTAINER & CARDS */

.game-container {
  max-width: 1200px;
  margin: -60px auto 60px;
  padding: 0 20px;
  position: relative;
  z-index: 10;
}

.game-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.3);
  animation: slideUp 0.6s ease;
  margin-bottom: 24px;
}

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

.card-title {
  font-size: 26px;
  font-weight: 800;
  color: #4f46e5;
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* CANVAS */

#gameCanvas {
  display: block;
  margin: 0 auto;
  border-radius: 16px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.4);
  background: linear-gradient(180deg, #87CEEB 0%, #E0F6FF 100%);
  cursor: pointer;
  max-width: 100%;
}

/* GAME BUTTONS & STATS */

.game-controls {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.game-btn {
  padding: 12px 28px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #22c55e 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.game-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.6);
}

.game-btn:active:not(:disabled) {
  transform: translateY(0);
}

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

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 20px;
  margin-top: 32px;
}

.stat-card {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #22c55e 100%);
  padding: 20px 18px;
  border-radius: 16px;
  color: #ffffff;
  text-align: center;
  transition: all 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(55, 65, 81, 0.6);
}

.stat-label {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}

.stat-value {
  font-size: 30px;
  font-weight: 900;
}

/* LEADERBOARD TABLE */

.leaderboard-table {
  width: 100%;
  margin-top: 24px;
  border-collapse: collapse;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
}

.leaderboard-table thead {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%, #22c55e 100%);
  color: #ffffff;
}

.leaderboard-table th,
.leaderboard-table td {
  padding: 14px 16px;
  text-align: left;
  font-size: 14px;
}

.leaderboard-table th {
  font-weight: 700;
}

.leaderboard-table td {
  border-bottom: 1px solid #e5e7eb;
  color: #4b5563;
}

.leaderboard-table tr:hover td {
  background: #f9fafb;
}

.rank-badge {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-weight: 700;
  line-height: 32px;
  text-align: center;
  font-size: 15px;
}

.rank-badge.gold {
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
}

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

.rank-badge.bronze {
  background: linear-gradient(135deg, #f97316 0%, #b45309 100%);
}

/* INPUTS & DOWNLOAD BUTTONS */

.input-group {
  margin-bottom: 20px;
}

.input-label {
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 8px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}

.input-field {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #4f46e5;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  transition: all 0.2s ease;
  color: #111827;
  background: #ffffff;
}

.input-field:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.25);
  transform: translateY(-1px);
}

.download-buttons {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.download-btn {
  flex: 1 1 180px;
  padding: 12px 18px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 60%);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.5);
}

/* INFO / ADS */

.info-box {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #ecfdf5 100%);
  padding: 18px 18px;
  border-radius: 14px;
  border-left: 4px solid #4f46e5;
  margin-top: 22px;
}

.info-title {
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 6px;
  font-size: 15px;
}

.info-text {
  color: #4b5563;
  font-size: 14px;
  line-height: 1.7;
}

.adsense-container {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 100%);
  border-radius: 18px;
  padding: 20px;
  margin: 24px 0;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #c4b5fd;
}

.adsense-placeholder {
  text-align: center;
  color: #4f46e5;
  font-size: 14px;
}

/* BLOG SECTION */

.blog-section {
  max-width: 900px;
  margin: 70px auto 40px;
  padding: 0 20px;
}

.blog-content {
  background: #ffffff;
  border-radius: 24px;
  padding: 50px 56px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.25);
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 34px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 26px;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 40%, #22c55e 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-content h3 {
  font-size: 24px;
  font-weight: 700;
  color: #111827;
  margin-top: 32px;
  margin-bottom: 14px;
}

.blog-content h4 {
  font-size: 19px;
  font-weight: 600;
  color: #1f2933;
  margin-top: 24px;
  margin-bottom: 10px;
}

.blog-content p {
  color: #4b5563;
  font-size: 16px;
  margin-bottom: 18px;
  line-height: 1.9;
}

.blog-content ul,
.blog-content ol {
  color: #4b5563;
  margin-left: 26px;
  margin-bottom: 18px;
}

.blog-content li {
  margin-bottom: 9px;
  line-height: 1.8;
}

.blog-content a {
  color: #4f46e5;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.blog-content a:hover {
  color: #22c55e;
}

.highlight-box {
  background: linear-gradient(135deg, #eef2ff 0%, #f5f3ff 50%, #ecfdf5 100%);
  padding: 20px 22px;
  border-radius: 14px;
  border-left: 4px solid #4f46e5;
  margin: 26px 0;
  font-size: 15px;
  color: #4338ca;
}

.example-box {
  background: #eef2ff;
  padding: 18px 20px;
  border-radius: 14px;
  border-left: 4px solid #7c3aed;
  margin: 24px 0;
  font-size: 15px;
}

/* FAQ BLOCK */

.faq-section {
  margin-top: 32px;
}

.faq-section h3 {
  margin-bottom: 16px;
}

.faq-item {
  border-top: 1px solid #e5e7eb;
  padding: 12px 0 10px;
}

.faq-item:first-of-type {
  border-top: none;
}

.faq-item h4 {
  font-size: 17px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 6px;
}

.faq-item p {
  margin-bottom: 4px;
  font-size: 15px;
}

/* FOOTER */

.footer {
  background: linear-gradient(135deg, #111827 0%, #020617 100%);
  color: #ffffff;
  padding: 60px 0 22px;
  margin-top: 70px;
}

.footer-column h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 18px;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  color: #e5e7eb;
  text-decoration: none;
  transition: all 0.2s ease;
  display: inline-block;
  font-size: 14px;
}

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

.footer-bottom {
  border-top: 1px solid rgba(249, 250, 251, 0.08);
  margin-top: 32px;
  padding-top: 18px;
  text-align: center;
  color: #9ca3af;
  font-size: 14px;
}

/* RESPONSIVE */

@media (max-width: 1024px) {
  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block;
  }

  .main-nav {
    position: static;
    transform: none;
  }
}

@media (max-width: 768px) {
  .page-header {
    padding: 60px 18px 80px;
  }

  .page-header h1 {
    font-size: 32px;
  }

  .page-header p {
    font-size: 16px;
  }

  .game-card {
    padding: 26px 20px;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .blog-content {
    padding: 28px 20px 30px;
  }

  .blog-content h2 {
    font-size: 26px;
  }

  .blog-content h3 {
    font-size: 20px;
  }

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

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .footer {
    padding-top: 40px;
  }
}
