@view-transition {
  navigation: auto;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  scroll-behavior: smooth;
}

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

/* -----------------------------
   HEADER & NAV
----------------------------- */

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #4338ca 0%, #312e81 100%);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.55);
}

.brand-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}

.nav-link {
  color: #ffffff;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.25s ease, transform 0.25s ease;
}

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

.mobile-menu-btn {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 1.6rem;
  cursor: pointer;
}

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

.dropdown-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  min-width: 220px;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.35);
  padding: 6px 0;
  display: none;
  z-index: 1010;
}

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

.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  font-size: 0.9rem;
  text-decoration: none;
  color: #4b5563;
  transition: background 0.2s ease, color 0.2s ease, padding-left 0.2s ease;
}

.dropdown-menu a:hover {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  padding-left: 22px;
}

/* Mobile slide-down menu */
.mobile-menu {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.25s ease;
  opacity: 0;
}

.mobile-menu.open {
  max-height: 380px;
  opacity: 1;
}

.mobile-menu-inner {
  padding: 10px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-menu-inner a {
  text-decoration: none;
  color: #ecfdf5;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 0;
}

/* Hide desktop nav on mobile */
@media (max-width: 767px) {
  .nav-links {
    display: none !important;
  }
}

/* -----------------------------
   HERO
----------------------------- */

.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  padding: 80px 20px 70px;
  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.7;
}

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

.page-header p {
  position: relative;
  z-index: 1;
  font-size: 1.1rem;
  max-width: 720px;
  margin: 0 auto;
  animation: slideInUp 0.6s ease;
}

@media (max-width: 768px) {
  .page-header {
    padding: 70px 16px 56px;
  }
  .page-header h1 {
    font-size: 2rem;
  }
  .page-header p {
    font-size: 0.98rem;
  }
}

/* Pulse icon */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

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

/* -----------------------------
   LAYOUT & CARDS
----------------------------- */

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

.game-layout {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 24px;
}

.game-card {
  background: #ffffff;
  border-radius: 24px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: slideUp 0.6s ease;
}

.card-title {
  font-size: 1.7rem;
  font-weight: 800;
  color: #4f46e5;
  margin: 0 0 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

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

@media (max-width: 768px) {
  .game-card {
    padding: 24px;
  }
}

/* -----------------------------
   INPUTS & BUTTONS
----------------------------- */

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

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

.input-field {
  width: 100%;
  padding: 14px;
  border: 2px solid #4f46e5;
  border-radius: 10px;
  font-size: 0.98rem;
  font-weight: 600;
  transition: all 0.3s ease;
  color: #1e293b;
  background: #ffffff;
}

.input-field:focus {
  outline: none;
  border-color: #7c3aed;
  box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.13);
  transform: scale(1.02);
}

.game-btn {
  padding: 14px 32px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
  border: none;
  border-radius: 12px;
  font-size: 0.98rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  width: 100%;
  margin-bottom: 12px;
}

.game-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

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

.game-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.certificate-btn {
  margin-top: 6px;
}

/* Theme buttons */
.theme-btn {
  padding: 10px 16px;
  background: linear-gradient(135deg, #f97316 0%, #ec4899 100%);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-right: 4px;
  margin-bottom: 8px;
}

.theme-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

/* -----------------------------
   WORD LIST
----------------------------- */

.word-list {
  max-height: 300px;
  overflow-y: auto;
  margin-top: 16px;
}

.word-item {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s ease;
}

.word-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.word-item.found {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border-left: 4px solid #16a34a;
}

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

.word-def {
  font-size: 0.8rem;
  color: #6b7280;
  margin-top: 4px;
}

.delete-btn {
  background: #ef4444;
  color: #ffffff;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  transition: all 0.3s ease;
}

.delete-btn:hover {
  background: #dc2626;
  transform: scale(1.05);
}

/* -----------------------------
   PUZZLE GRID
----------------------------- */

.puzzle-grid {
  display: grid;
  gap: 2px;
  background: #e5e7eb;
  padding: 2px;
  border-radius: 12px;
  margin: 0 auto;
  width: fit-content;
}

.puzzle-cell {
  width: 40px;
  height: 40px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  position: relative;
}

.puzzle-cell:hover {
  background: #eef2ff;
  transform: scale(1.05);
}

.puzzle-cell.selected {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
}

.puzzle-cell.found {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
}

.puzzle-cell.blocked {
  background: #111827;
  cursor: default;
}

.puzzle-cell.blocked:hover {
  transform: none;
}

.cell-number {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 0.6rem;
  font-weight: 600;
  color: #4f46e5;
}

/* Adjust for small screens */
@media (max-width: 768px) {
  .puzzle-cell {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
}

/* -----------------------------
   STATS BAR
----------------------------- */

.stats-bar {
  display: flex;
  justify-content: space-around;
  margin-bottom: 24px;
  gap: 12px;
}

.stat-card {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  padding: 16px;
  border-radius: 12px;
  color: #ffffff;
  text-align: center;
  flex: 1;
}

.stat-label {
  font-size: 0.75rem;
  opacity: 0.9;
  margin-bottom: 4px;
  font-weight: 600;
  text-transform: uppercase;
}

.stat-value {
  font-size: 1.4rem;
  font-weight: 900;
}

/* -----------------------------
   MODE TOGGLE
----------------------------- */

.mode-toggle {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.mode-btn {
  flex: 1;
  padding: 12px;
  background: #ffffff;
  border: 2px solid #4f46e5;
  color: #4f46e5;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.mode-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  color: #ffffff;
}

/* -----------------------------
   CLUES
----------------------------- */

.clue-section {
  margin-top: 24px;
}

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

.clue-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 12px;
}

.clue-item {
  padding: 8px 12px;
  background: #eef2ff;
  border-radius: 6px;
  margin-bottom: 8px;
  font-size: 0.9rem;
  color: #4b5563;
}

.clue-number {
  font-weight: 700;
  color: #4f46e5;
  margin-right: 8px;
}

/* -----------------------------
   ADSENSE PLACEHOLDER
----------------------------- */

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

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

/* -----------------------------
   HOW TO BOX
----------------------------- */

.how-to-box {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  padding: 20px;
  border-radius: 12px;
  border-left: 4px solid #4f46e5;
  margin-top: 20px;
}

.how-to-title {
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 6px;
  font-size: 0.98rem;
}

.how-to-text {
  color: #5b21b6;
  font-size: 0.9rem;
  line-height: 1.7;
}

/* -----------------------------
   BLOG CONTENT
----------------------------- */

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

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

.blog-content h2 {
  font-size: 2.3rem;
  font-weight: 900;
  margin-top: 0;
  margin-bottom: 24px;
  background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.blog-content h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2933;
  margin-top: 32px;
  margin-bottom: 14px;
}

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

.blog-content ul, .blog-content ol {
  color: #4b5563;
  margin-left: 22px;
  margin-bottom: 18px;
  font-size: 0.96rem;
}

.blog-content li {
  margin-bottom: 10px;
  line-height: 1.7;
}

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

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

/* FAQ styling */
.faq-section {
  margin-top: 40px;
}

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

.faq-item {
  border-bottom: 1px dashed #e5e7eb;
  padding-bottom: 14px;
  margin-bottom: 14px;
}

.faq-question {
  font-weight: 700;
  color: #111827;
  margin-bottom: 6px;
  font-size: 0.96rem;
}

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

@media (max-width: 768px) {
  .blog-content {
    padding: 32px 24px;
  }
  .blog-content h2 {
    font-size: 1.8rem;
  }
  .blog-content h3 {
    font-size: 1.3rem;
  }
}

/* -----------------------------
   FOOTER
----------------------------- */

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

.footer-column h3 {
  font-size: 0.96rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

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

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

.footer-column ul li a {
  color: #cbd5e0;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin-top: 32px;
  padding-top: 18px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
}

/* -----------------------------
   NOTIFICATION TOAST
----------------------------- */

.notification {
  position: fixed;
  top: 90px;
  right: 20px;
  max-width: 320px;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  padding: 16px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(16, 185, 129, 0.7);
  z-index: 5000;
  animation: slideInRight 0.5s ease;
  font-size: 0.95rem;
}

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

/* -----------------------------
   ANIMATIONS
----------------------------- */

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

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

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