@view-transition {
  navigation: auto;
}

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

/* Disable text selection globally (as requested) */
* {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
}

/* --------------------------
   HEADER
--------------------------- */

.header {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 20px rgba(5, 150, 105, 0.3);
}

.brand-title {
  color: #ffffff;
  font-weight: 800;
  font-size: 1.25rem;
  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);
}

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

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

.dropdown-content {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  min-width: 220px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.16);
  border-radius: 12px;
  margin-top: 2px;
  overflow: hidden;
  display: none;
  z-index: 1010;
}

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

.dropdown-content a {
  color: #4b5563;
  padding: 10px 18px;
  text-decoration: none;
  display: block;
  transition: all 0.25s ease;
  font-size: 0.9rem;
}

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

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

/* Mobile menu (green slide-down) */
.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;
  }
}

/* --------------------------
   GAME LAYOUT
--------------------------- */

.game-container {
  background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
  min-height: calc(100% - 200px);
  padding: 40px 0 60px;
}

.word-grid-wrapper {
  overflow-x: auto;
  padding-bottom: 8px;
}

/* Word grid */
.word-grid {
  display: grid;
  gap: 2px;
  background: #0f172a;
  padding: 10px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.4);
  margin: 0 auto;
  max-width: fit-content;
}

.grid-cell {
  width: 35px;
  height: 35px;
  background: #ffffff;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.grid-cell:hover {
  background: #f1f5f9;
  transform: scale(1.05);
}

.grid-cell.selected {
  background: #3b82f6;
  color: #ffffff;
  border-color: #1d4ed8;
}

.grid-cell.found {
  background: #10b981;
  color: #ffffff;
  border-color: #059669;
}

.grid-cell.hint-highlight {
  background: #fbbf24 !important;
  color: #111827 !important;
}

/* Control panel */
.control-panel {
  background: #ffffff;
  border-radius: 18px;
  padding: 24px 22px 28px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.15);
  margin-bottom: 24px;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  border: none;
  font-size: 0.95rem;
}

.btn-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: #ffffff;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

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

.btn-success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

/* Stats card */
.stats-card {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #0ea5e9 100%);
  color: #ffffff;
  padding: 20px;
  border-radius: 18px;
  text-align: center;
  box-shadow: 0 10px 26px rgba(79, 70, 229, 0.5);
}

.timer {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 4px;
}

.progress-bar {
  background: rgba(15, 23, 42, 0.25);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0 6px;
}

.progress-fill {
  background: linear-gradient(90deg, #22c55e, #16a34a);
  height: 100%;
  transition: width 0.3s ease;
  border-radius: 4px;
}

/* Word list */
.word-list {
  background: #ffffff;
  border-radius: 18px;
  padding: 20px 18px 22px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.12);
}

.word-item {
  padding: 8px 12px;
  margin: 3px 0;
  border-radius: 8px;
  transition: all 0.25s ease;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.98rem;
  color: #0f172a;
}

.word-item:hover {
  background: #f1f5f9;
}

.word-item.found {
  background: #dcfce7;
  color: #166534;
  text-decoration: line-through;
}

/* Modal & overlay */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1999;
  display: none;
}

.celebration {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #ffffff;
  padding: 40px 36px;
  border-radius: 20px;
  box-shadow: 0 22px 80px rgba(15, 23, 42, 0.7);
  text-align: center;
  z-index: 2000;
  display: none;
}

/* SEO / BLOG */
.prose a {
  color: #f97316;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover {
  color: #ea580c;
}

/* FAQ */
.faq-item {
  border-bottom: 1px dashed #e5e7eb;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

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

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

/* Footer */
.footer {
  background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
  color: #ffffff;
  padding: 60px 0 30px;
  margin-top: 40px;
}

.footer-column h3 {
  color: #14b8a6;
  font-size: 0.98rem;
  font-weight: 700;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  position: relative;
}

.footer-column h3::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 40px;
  height: 3px;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  border-radius: 2px;
}

.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: all 0.25s ease;
  display: inline-block;
}

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

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

/* Responsive tweaks */
@media (max-width: 768px) {
  .game-container {
    padding: 24px 0 40px;
  }

  .control-panel {
    padding: 18px 16px 22px;
  }

  .grid-cell {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
}
