@view-transition {
  navigation: auto;
}

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

html,
body {
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100%;
}

/* CONTAINER UTIL */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* HEADER */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.6);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  position: relative;
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

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

.site-name {
  color: #f9fafb;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
}

/* Desktop nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-desktop a {
  color: #e5e7eb;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.nav-desktop a:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.nav-desktop-more {
  display: flex;
  align-items: center;
}

/* Dropdown */
.dropdown {
  position: relative;
}

.dropdown-toggle {
  background: none;
  border: none;
  color: #e5e7eb;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
}

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

.dropdown-content a {
  display: block;
  padding: 0.75rem 1.2rem;
  color: #4b5563;
  font-size: 0.9rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

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

/* Mobile menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 0.5rem;
  padding: 0.3rem 0.6rem;
  color: #e5e7eb;
  font-size: 1.25rem;
  cursor: pointer;
}

.mobile-menu-btn.open {
  background: #16a34a;
  border-color: #16a34a;
}

.mobile-menu {
  display: none;
  flex-direction: column;
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  padding: 0.75rem 1.5rem 1rem;
  gap: 0.45rem;
  transform-origin: top;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.25s ease;
}

.mobile-menu a {
  color: #ecfdf5;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid rgba(22, 163, 74, 0.6);
}

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

.mobile-menu.open {
  display: flex;
  max-height: 360px;
  opacity: 1;
}

/* HERO */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 4.5rem 1.5rem 5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at top, rgba(255,255,255,0.23) 0, transparent 60%);
  opacity: 0.35;
}

.page-header h1 {
  position: relative;
  z-index: 1;
  font-size: 2.8rem;
  max-width: 900px;
  margin: 0.75rem auto 0.65rem;
  font-weight: 900;
  text-shadow: 0 3px 10px rgba(15, 23, 42, 0.4);
}

.page-header p {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  font-size: 1.15rem;
  opacity: 0.96;
}

/* GAME LAYOUT */
.game-container {
  max-width: 1400px;
  margin: -3.5rem auto 4rem;
  padding: 0 1.5rem;
  position: relative;
  z-index: 10;
}

.game-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 1.5rem;
}

.game-card {
  background: #ffffff;
  border-radius: 1.4rem;
  padding: 2.3rem;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.38);
  animation: slideUp 0.5s ease;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.45rem;
  font-weight: 800;
  color: #4f46e5;
  margin-top: 0;
  margin-bottom: 1.4rem;
}

/* Buttons */
.game-btn {
  width: 100%;
  padding: 0.9rem 1.5rem;
  border-radius: 0.85rem;
  border: none;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  margin-bottom: 0.6rem;
  transition: all 0.2s ease;
}

.game-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(79, 70, 229, 0.5);
}

.game-btn.secondary {
  background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
}

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

/* Info boxes */
.info-box {
  background: linear-gradient(135deg, #eef2ff 0%, #e5e7eb 100%);
  padding: 1.1rem 1.2rem;
  border-radius: 0.9rem;
  border-left: 4px solid #4f46e5;
  margin-top: 1rem;
}

.info-title {
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
}

.info-text {
  font-size: 0.9rem;
  color: #4b5563;
  line-height: 1.6;
}

.info-box.alt {
  background: linear-gradient(135deg, #fce7f3 0%, #e0e7ff 100%);
  border-left-color: #7c3aed;
}

.info-title.alt {
  color: #7c3aed;
}

.info-level {
  font-size: 1.1rem;
  color: #4f46e5;
  font-weight: 800;
}

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

.stat-box {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: 0.9rem;
  padding: 1rem;
  text-align: center;
  border-left: 4px solid #4f46e5;
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: #4f46e5;
  margin-bottom: 0.3rem;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 900;
  color: #4338ca;
}

/* Certificate */
.certificate-section {
  margin-top: 1.4rem;
  padding-top: 1rem;
  border-top: 1px dashed #e5e7eb;
}

.certificate-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: #4f46e5;
  margin-bottom: 0.4rem;
}

.certificate-text {
  font-size: 0.9rem;
  color: #4b5563;
  margin-bottom: 0.75rem;
}

.certificate-form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.certificate-form input {
  border-radius: 0.75rem;
  border: 1px solid #d1d5db;
  padding: 0.55rem 0.8rem;
  font-size: 0.9rem;
  outline: none;
}

.certificate-form input:focus {
  border-color: #4f46e5;
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.5);
}

/* Download buttons */
.download-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Canvas */
#gameCanvas {
  width: 100%;
  border-radius: 1rem;
  background: #0f0f23;
  display: block;
  box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
  cursor: pointer;
}

/* Hint under game */
.game-hint {
  text-align: center;
  margin-top: 0.85rem;
  color: #4f46e5;
  font-weight: 600;
  font-size: 0.86rem;
}

/* AdSense */
.adsense-container {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border-radius: 1rem;
  padding: 1.2rem;
  margin: 1.5rem 0;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed #c7d2fe;
}

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

/* History */
.history-item {
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
  padding: 0.9rem 1rem;
  border-radius: 0.9rem;
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideInRight 0.4s ease;
}

.history-score {
  font-size: 0.98rem;
  font-weight: 700;
  color: #4f46e5;
}

.history-date {
  font-size: 0.78rem;
  color: #6b7280;
}

/* Notifications */
.notification {
  position: fixed;
  top: 5.5rem;
  right: 1.25rem;
  max-width: 320px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 0.9rem 1.1rem;
  border-radius: 0.9rem;
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.6);
  z-index: 2000;
  animation: slideInRight 0.35s ease;
}

.notification.error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  animation: fadeIn 0.25s ease;
}

.modal-content {
  background: #ffffff;
  border-radius: 1.4rem;
  padding: 2.2rem 2.4rem 2.4rem;
  max-width: 640px;
  width: 92%;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

.modal-title {
  font-size: 1.7rem;
  font-weight: 900;
  color: #4f46e5;
  margin-bottom: 1.3rem;
  text-align: center;
}

/* BLOG / FAQ */
.blog-section {
  max-width: 980px;
  margin: 4.5rem auto 3rem;
  padding: 0 1.5rem;
}

.blog-content {
  background: #ffffff;
  border-radius: 1.4rem;
  padding: 2.8rem 2.4rem;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.24);
  line-height: 1.8;
}

.blog-content h2 {
  font-size: 2rem;
  font-weight: 900;
  margin-top: 0;
  margin-bottom: 1.6rem;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.blog-content h3 {
  font-size: 1.45rem;
  font-weight: 800;
  color: #111827;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.blog-content p {
  font-size: 0.98rem;
  color: #4b5563;
  margin-bottom: 1rem;
}

.blog-content a {
  color: #4f46e5;
  text-decoration: none;
  font-weight: 600;
}

.blog-content a:hover {
  text-decoration: underline;
}

.highlight-box {
  background: linear-gradient(135deg, #eef2ff 0%, #f9fafb 100%);
  padding: 1.3rem 1.4rem;
  border-radius: 1rem;
  border-left: 4px solid #4f46e5;
  margin: 1.8rem 0;
  font-size: 0.94rem;
  color: #374151;
}

/* FAQ */
.faq-section {
  max-width: 980px;
  margin: 0 auto 4rem;
  padding: 0 1.5rem;
}

.faq-item {
  margin-bottom: 1.4rem;
}

.faq-item h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 0.25rem;
}

.faq-item p {
  font-size: 0.94rem;
  color: #4b5563;
}

/* FOOTER (structure reused from your other pages) */
.footer {
  background: linear-gradient(135deg, #111827 0%, #020617 100%);
  color: #f9fafb;
  padding: 3.5rem 0 1.5rem;
  margin-top: 4rem;
}

.footer-column h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 1.1rem;
  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: 0.6rem;
}

.footer-column ul li a {
  color: #cbd5f5;
  font-size: 0.92rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.35);
  margin-top: 2.4rem;
  padding-top: 1.3rem;
  text-align: center;
  color: #9ca3af;
  font-size: 0.88rem;
}

/* ANIMATIONS */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(24px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

/* Small pulse for hero icon */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
  .game-layout {
    grid-template-columns: 1fr;
  }

  .nav-desktop {
    position: static;
    transform: none;
    margin-right: 1.5rem;
  }
}

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

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

  .page-header {
    padding: 3rem 1.25rem 3.5rem;
  }

  .page-header h1 {
    font-size: 2rem;
  }

  .page-header p {
    font-size: 0.98rem;
  }

  .game-card {
    padding: 1.7rem 1.5rem;
  }

  .blog-content {
    padding: 2rem 1.5rem;
  }

  .blog-content h2 {
    font-size: 1.6rem;
  }

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