/* ============================================
   connectionssports.com — Design System
   Light/Dark Theme with System Preference
   ============================================ */

/* --- Light Theme (Default) --- */
:root {
  --bg-primary: #f8f9fb;
  --bg-secondary: #ffffff;
  --bg-card: #f0f1f5;
  --bg-tile: #e2e4ec;
  --bg-tile-hover: #d4d7e2;
  --bg-tile-selected: #5865f2;
  --text-primary: #1a1d2e;
  --text-secondary: #4a4d63;
  --text-muted: #6e7189;
  --accent-green: #16a34a;
  --accent-gold: #d97706;
  --accent-blue: #2563eb;
  --accent-red: #dc2626;

  /* Category Colors — matching NYT Connections */
  --cat-yellow: #f9df6d;
  --cat-yellow-bg: #f9df6d;
  --cat-yellow-text: #1a1a1a;
  --cat-green: #a0c35a;
  --cat-green-bg: #a0c35a;
  --cat-green-text: #1a1a1a;
  --cat-blue: #b0c4ef;
  --cat-blue-bg: #b0c4ef;
  --cat-blue-text: #1a1a1a;
  --cat-purple: #ba81c5;
  --cat-purple-bg: #ba81c5;
  --cat-purple-text: #1a1a1a;

  --border: #dde0ea;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 16px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --max-width: 680px;
  color-scheme: light;
}

/* --- Dark Theme --- */
[data-theme="dark"] {
  --bg-primary: #0f1117;
  --bg-secondary: #1a1d28;
  --bg-card: #232636;
  --bg-tile: #3a3f54;
  --bg-tile-hover: #4a5070;
  --bg-tile-selected: #5865f2;
  --text-primary: #f0f0f5;
  --text-secondary: #a0a3b5;
  --text-muted: #6b6f82;
  --accent-green: #4ade80;
  --accent-gold: #f59e0b;
  --accent-blue: #60a5fa;
  --accent-red: #ef4444;

  --border: #2a2d3a;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  color-scheme: dark;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
  background: none;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.15rem;
  transition: all var(--transition);
  flex-shrink: 0;
  margin-left: 6px;
}

.theme-toggle:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
  color: var(--text-primary);
  transform: rotate(30deg);
}

/* Smooth theme transition */
body,
.navbar,
.footer,
.modal,
.tile,
.btn,
.hints-today,
.hint-reveal,
.faq-question,
.archive-card,
.game-card,
.category-input-group,
.text-input {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* --- Reset --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  max-width: 100vw;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent-green);
}

img {
  max-width: 100%;
  height: auto;
  content-visibility: auto;
}

/* --- Skip to Content (Accessibility) --- */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-blue);
  color: #fff;
  padding: 10px 20px;
  border-radius: 0 0 8px 8px;
  z-index: 999;
  font-weight: 600;
  font-size: 0.85rem;
  transition: top 0.2s;
}

.skip-to-content:focus {
  top: 0;
  color: #fff;
}

/* --- Focus Visible (Accessibility) --- */
*:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
}

/* --- Header / Navbar --- */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--text-primary);
  text-decoration: none;
}

.logo-icon {
  display: grid;
  grid-template-columns: repeat(2, 10px);
  gap: 3px;
}

.logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.logo-dot:nth-child(1) { background: var(--cat-yellow); }
.logo-dot:nth-child(2) { background: var(--cat-green); }
.logo-dot:nth-child(3) { background: var(--cat-blue); }
.logo-dot:nth-child(4) { background: var(--cat-purple); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.nav-links .btn-create {
  background: var(--accent-green);
  color: var(--bg-primary);
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 20px;
}

.nav-links .btn-create:hover {
  background: #22c55e;
  color: var(--bg-primary);
}

.nav-links .nav-active {
  color: var(--text-primary);
  background: var(--bg-card);
  border-radius: var(--radius-sm);
}

.nav-links .btn-create.nav-active {
  border: 2px solid var(--text-primary);
  background: var(--accent-green);
  color: var(--bg-primary);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 2px;
  color: var(--text-secondary);
  font-size: 0.88rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.dropdown-toggle:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.dropdown-arrow {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 0;
  min-width: 170px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  z-index: 200;
}

.nav-dropdown:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  display: block;
  padding: 8px 16px;
  white-space: nowrap;
  border-radius: 0;
}

.dropdown-menu a:hover {
  background: var(--bg-card);
}

/* --- Main Container --- */
.main-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 30px 16px 60px;
}

/* --- Game Section --- */
.game-header {
  text-align: center;
  margin-bottom: 24px;
}

.game-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 8px;
}

.game-nav button {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.game-nav button:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.puzzle-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.puzzle-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* --- Solved Categories --- */
.solved-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.solved-category {
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  animation: categoryReveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.solved-category.yellow { background: var(--cat-yellow); color: var(--cat-yellow-text); }
.solved-category.green { background: var(--cat-green); color: var(--cat-green-text); }
.solved-category.blue { background: var(--cat-blue); color: var(--cat-blue-text); }
.solved-category.purple { background: var(--cat-purple); color: var(--cat-purple-text); }

.solved-category-name {
  font-weight: 800;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.solved-category-words {
  font-size: 0.85rem;
  font-weight: 500;
}

/* --- Game Grid --- */
.game-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.tile {
  background: var(--bg-tile);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 18px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  user-select: none;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  word-break: break-word;
  touch-action: manipulation;
  -webkit-user-select: none;
}

.tile:hover {
  background: var(--bg-tile-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

@keyframes tilePop {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1.03); }
}

.tile.selected {
  background: var(--bg-tile-selected);
  color: #fff;
  border-color: transparent;
  transform: scale(1.03);
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.35), inset 0 1px 0 rgba(255,255,255,0.15);
  animation: tilePop 0.15s ease-out;
}

.tile.disabled {
  pointer-events: none;
  opacity: 0.4;
}

/* Shake animation for wrong guess */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.tile.shake {
  animation: shake 0.5s ease-in-out;
}

/* Category reveal animation */
@keyframes categoryReveal {
  0% { transform: scaleY(0); opacity: 0; }
  60% { transform: scaleY(1.05); }
  100% { transform: scaleY(1); opacity: 1; }
}

/* --- Game Controls --- */
.game-controls {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  padding: 10px 24px;
  border-radius: 24px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition);
}

.btn:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.btn-submit {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

.btn-submit:hover {
  opacity: 0.85;
}

.btn-submit:disabled {
  background: var(--bg-tile);
  color: var(--text-muted);
  border-color: var(--border);
}

/* --- Mistakes Indicator --- */
.mistakes-section {
  text-align: center;
  margin-bottom: 20px;
}

.mistakes-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.mistakes-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
}

.mistake-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-tile);
  transition: all 0.3s ease;
}

.mistake-dot.remaining {
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

/* --- Toast / Message --- */
.toast {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--text-primary);
  color: var(--bg-primary);
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* --- Results Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  max-width: 480px;
  width: 92%;
  text-align: center;
  box-shadow: var(--shadow);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  overflow: hidden;
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.modal p {
  color: var(--text-secondary);
  margin-bottom: 20px;
  font-size: 0.9rem;
}

.results-grid {
  font-family: monospace;
  font-size: 1.3rem;
  line-height: 1.6;
  margin-bottom: 20px;
  letter-spacing: 2px;
}

.btn-share {
  background: var(--accent-green);
  color: var(--bg-primary);
  border: none;
  font-weight: 700;
  padding: 12px 32px;
}

.btn-share:hover {
  background: #22c55e;
}

/* Social Share Buttons */
.social-share-section {
  margin: 16px 0 8px;
}

.social-share-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 10px;
}

.social-share-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.social-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  border-radius: 10px;
  border: none;
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  color: #fff;
  text-decoration: none;
  line-height: 1;
}

.social-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.social-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.social-btn.twitter { background: #000; }
.social-btn.twitter:hover { background: #1a1a1a; }

.social-btn.facebook { background: #1877f2; }
.social-btn.facebook:hover { background: #0d65d9; }

.social-btn.whatsapp { background: #25d366; }
.social-btn.whatsapp:hover { background: #1ebe57; }

.social-btn.telegram { background: #0088cc; }
.social-btn.telegram:hover { background: #0077b3; }

.social-btn.reddit { background: #ff4500; }
.social-btn.reddit:hover { background: #e63e00; }

.social-btn.linkedin { background: #0a66c2; }
.social-btn.linkedin:hover { background: #084d94; }

.social-btn.threads { background: #000; }
.social-btn.threads:hover { background: #1a1a1a; }

.social-btn.copy { background: var(--bg-tile); color: var(--text-primary); border: 1px solid var(--border); }
.social-btn.copy:hover { background: var(--bg-tile-hover); }

@media (max-width: 480px) {
  .social-share-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }
  .social-btn {
    padding: 9px 4px;
    font-size: 0;
  }
  .social-btn svg {
    width: 18px;
    height: 18px;
  }
}

.btn-close-modal {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  margin-top: 12px;
  padding: 6px 12px;
}

.btn-close-modal:hover {
  color: var(--text-primary);
}

/* --- SEO Content Section --- */
.seo-content {
  max-width: 960px;
  margin: 40px auto 0;
  padding: 0 24px;
}

.seo-content h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
  background: linear-gradient(135deg, var(--cat-yellow), var(--cat-green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.seo-content h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text-primary);
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.section-card h2:first-child,
.section-card--alt h2:first-child {
  margin-top: 0;
}

.seo-content h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 20px 0 8px;
  color: var(--accent-blue);
}

.seo-content p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.seo-content ul, .seo-content ol {
  margin: 12px 0;
  padding-left: 24px;
  color: var(--text-secondary);
}

.seo-content li {
  margin-bottom: 8px;
  font-size: 0.93rem;
}

.seo-content strong {
  color: var(--text-primary);
}

/* FAQ Accordion */
.faq-section {
  margin-top: 32px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item:hover {
  border-color: var(--text-muted);
}

.faq-question {
  width: 100%;
  text-align: left;
  background: var(--bg-card);
  border: none;
  padding: 16px 20px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background var(--transition);
}

.faq-question:hover {
  background: var(--bg-tile);
}

.faq-question::after {
  content: '+';
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.faq-item.open .faq-question::after {
  content: '−';
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.faq-item.open .faq-answer {
  max-height: 400px;
  padding: 16px 20px;
}

.faq-answer p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* --- Games Grid (Similar Games) --- */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

/* Ensure ads inside grids span full width (AdSense requires ≥250px) */
.games-grid > .ad-wrapper,
.archive-grid > .ad-wrapper {
  grid-column: 1 / -1;
  min-width: 250px;
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--text-muted);
}

.game-card h3 {
  font-size: 1rem;
  margin-bottom: 6px;
}

.game-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.game-card .btn {
  font-size: 0.8rem;
  padding: 6px 20px;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
  padding: 32px 20px;
  text-align: center;
  margin-top: 60px;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--text-primary);
}

.footer-disclaimer {
  color: var(--text-muted);
  font-size: 0.78rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* --- Archive Page --- */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.archive-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  text-decoration: none;
  color: var(--text-primary);
}

.archive-card:hover {
  background: var(--bg-tile);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  color: var(--text-primary);
}

.archive-card .puzzle-num {
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--accent-gold);
  margin-bottom: 4px;
}

.archive-card .puzzle-date-sm {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- Create Page --- */
.create-form {
  max-width: var(--max-width);
  margin: 0 auto;
}

.category-input-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.category-input-group.yellow { border-left: 4px solid var(--cat-yellow); }
.category-input-group.green { border-left: 4px solid var(--cat-green); }
.category-input-group.blue { border-left: 4px solid var(--cat-blue); }
.category-input-group.purple { border-left: 4px solid var(--cat-purple); }

.input-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.text-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  color: var(--text-primary);
  transition: border-color var(--transition);
  margin-bottom: 10px;
}

.text-input:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.text-input::placeholder {
  color: var(--text-muted);
}

.words-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

/* --- Legal Pages --- */
.legal-content {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 20px;
}

.legal-content h1 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 24px;
}

.legal-content h2 {
  font-size: 1.2rem;
  margin: 28px 0 10px;
  color: var(--accent-blue);
}

.legal-content p {
  color: var(--text-secondary);
  margin-bottom: 14px;
  font-size: 0.92rem;
}

.legal-content ul {
  padding-left: 20px;
  margin-bottom: 14px;
  color: var(--text-secondary);
}

.legal-content li {
  margin-bottom: 6px;
  font-size: 0.92rem;
}

/* --- Responsive --- */

/* Tablet (769–1024px) */
@media (max-width: 1024px) {
  .nav-links a {
    font-size: 0.82rem;
    padding: 6px 10px;
  }
  .nav-links {
    gap: 2px;
  }
}

/* Small Tablet / Large Phone (641–768px) */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 16px;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    overflow-x: hidden;
  }

  .nav-links.open a,
  .nav-links.open .dropdown-toggle {
    padding: 12px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .nav-links.open a:hover,
  .nav-links.open .dropdown-toggle:hover {
    background: var(--bg-tile);
  }

  .mobile-menu-btn {
    display: block;
  }

  .nav-dropdown {
    position: static;
  }

  .dropdown-menu {
    position: static;
    transform: none;
    border: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    padding: 4px 0;
    margin: 4px 0 4px 0;
    min-width: auto;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
  }

  .nav-dropdown:hover .dropdown-menu {
    display: none;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block;
  }

  .dropdown-menu a {
    font-size: 0.88rem;
    padding: 10px 12px;
  }

  .seo-content h1 {
    font-size: 1.5rem;
  }

  .games-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile (<=640px) */
@media (max-width: 640px) {
  .tile {
    padding: 14px 4px;
    font-size: 0.72rem;
    min-height: 56px;
  }

  .game-controls {
    gap: 6px;
    flex-wrap: wrap;
  }

  .btn {
    padding: 8px 16px;
    font-size: 0.82rem;
  }

  .seo-content {
    padding: 0 12px;
  }

  .seo-content h1 {
    font-size: 1.3rem;
  }

  .seo-content h2 {
    font-size: 1.15rem;
  }

  .faq-section {
    padding: 16px 12px;
  }

  .games-grid {
    padding: 16px 12px;
  }

  .words-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .archive-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  }

  .footer-links {
    gap: 12px;
  }

  .main-container {
    padding: 20px 12px 40px;
  }

  .mode-selector {
    margin-bottom: 14px;
  }

  .mode-pill {
    padding: 6px 14px;
    font-size: 0.78rem;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .tile {
    padding: 12px 2px;
    font-size: 0.65rem;
    min-height: 50px;
  }

  .game-grid {
    gap: 5px;
  }

  .game-controls {
    gap: 4px;
  }

  .btn {
    padding: 7px 12px;
    font-size: 0.75rem;
  }

  .logo {
    font-size: 1rem;
  }
}

/* --- Confetti animation class --- */
@keyframes confettiDrop {
  0% { transform: translateY(-100vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

@keyframes confettiBurst {
  0% { transform: translateY(0) translateX(0) rotate(0deg) scale(1); opacity: 1; }
  25% { opacity: 1; }
  100% { transform: translateY(100vh) translateX(var(--drift, 0px)) rotate(var(--rot, 720deg)) scale(0.5); opacity: 0; }
}

.confetti-piece {
  position: fixed;
  width: 10px;
  height: 10px;
  top: -10px;
  z-index: 400;
  animation: confettiDrop 2.5s ease-in forwards;
}

/* --- Utility --- */
.text-center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* --- Section Card: Alternating Content Containers --- */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin: 28px 0;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.section-card--alt {
  background: var(--bg-secondary);
}

/* Full-width banded section behind seo-content */
.content-band {
  width: 100%;
  padding: 40px 0;
  margin: 0;
}

.content-band--grey {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.content-band--white {
  background: var(--bg-primary);
}

@media (max-width: 640px) {
  .section-card {
    padding: 20px 14px;
    margin: 20px 0;
    border-radius: var(--radius);
  }
}

/* --- Hint Banner --- */
.hint-box {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: linear-gradient(135deg, #5865f2, #7c3aed);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(88, 101, 242, 0.35);
}

.hint-box.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}


/* --- Stats in Modal --- */
.stats-container {
  margin: 16px 0 20px;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.stats-row.secondary {
  margin-bottom: 0;
}

.stat-item {
  text-align: center;
  min-width: 60px;
}

.stat-num {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent-green);
  line-height: 1.2;
}

.stats-row.secondary .stat-num {
  font-size: 1.1rem;
  color: var(--accent-blue);
}

.stat-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

@media (max-width: 480px) {
  .modal {
    width: 96%;
    padding: 24px 16px;
    max-height: 90vh;
    overflow-y: auto;
  }
  .modal h2 {
    font-size: 1.25rem;
  }
  .stat-num {
    font-size: 1.15rem;
  }
  .stats-row.secondary .stat-num {
    font-size: 0.95rem;
  }
  .results-grid {
    font-size: 1.1rem;
  }
}

@media (max-width: 360px) {
  .modal {
    width: 98%;
    padding: 20px 12px;
  }
  .stats-row {
    gap: 10px;
  }
  .stat-item {
    min-width: 50px;
  }
  .stat-num {
    font-size: 1rem;
  }
  .stats-row.secondary .stat-num {
    font-size: 0.85rem;
  }
}

/* Leaderboard motivation banner in modal */
.lb-motivation {
  margin-top: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(88,101,242,0.1), rgba(129,140,248,0.06));
  border: 1px solid rgba(88,101,242,0.2);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.lb-motivation:hover {
  border-color: rgba(88,101,242,0.4);
  transform: translateY(-1px);
}
@media (max-width: 480px) {
  .lb-motivation {
    padding: 12px 14px;
  }
  .lb-motivation > div:first-child {
    font-size: 1rem !important;
  }
  .lb-motivation > div:last-child {
    font-size: 0.78rem !important;
  }
}

/* --- Hints Page Styles --- */
.hints-today {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin: 24px 0;
}

.hint-reveal {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color var(--transition);
}

.hint-reveal:hover {
  border-color: var(--text-muted);
}

.hint-reveal-btn {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 14px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hint-reveal-btn::after {
  content: 'Tap to reveal';
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.hint-reveal.revealed .hint-reveal-btn::after {
  content: '';
}

.hint-reveal-content {
  padding: 0 18px 14px;
  color: var(--accent-green);
  font-weight: 600;
  font-size: 0.92rem;
  display: none;
}

.hint-reveal.revealed .hint-reveal-content {
  display: block;
}

/* --- Author Bio Box (E-E-A-T) --- */
.author-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); /* Subtle shadow for depth */
}

html[data-theme="dark"] .author-box {
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.05), rgba(15, 17, 23, 1));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.author-image {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-blue);
  flex-shrink: 0;
  aspect-ratio: 1;
}

.author-info {
  flex: 1;
}

.author-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 4px 0;
  font-family: 'Inter', sans-serif;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Verified Checkmark */
.author-name::after {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  background-color: var(--accent-blue);
  color: #fff;
  border-radius: 50%;
  font-size: 0.65rem;
}

.author-bio {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 10px 0;
}

.author-contact a {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  margin-right: 12px;
}

.author-contact a:hover {
  color: var(--accent-blue);
}

@media (max-width: 600px) {
  .author-box {
    flex-direction: column;
    text-align: center;
    padding: 20px;
  }
  
  .author-name {
    justify-content: center;
  }
}

/* --- Mode Selector (Easy / Normal / Hard) --- */
.mode-selector {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-bottom: 18px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 4px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.mode-pill {
  padding: 6px 18px;
  border-radius: 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.mode-pill:hover {
  color: var(--text-primary);
}

.mode-pill.active {
  background: var(--bg-tile-selected);
  color: #fff;
  box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

/* --- Easy Mode Tile Tints --- */
.tile.easy-tint {
  border-width: 2px;
  border-style: solid;
}

.tile.easy-yellow {
  border-color: var(--cat-yellow);
  background: rgba(249, 223, 109, 0.08);
}

.tile.easy-green {
  border-color: var(--cat-green);
  background: rgba(160, 195, 90, 0.08);
}

.tile.easy-blue {
  border-color: var(--cat-blue);
  background: rgba(176, 196, 239, 0.08);
}

.tile.easy-purple {
  border-color: var(--cat-purple);
  background: rgba(186, 129, 197, 0.08);
}

/* Keep selected state priority over easy tint */
.tile.easy-tint.selected {
  background: var(--bg-tile-selected);
  border-color: transparent;
}

/* --- Reveal Answers Button --- */
.btn-reveal {
  background: transparent;
  color: var(--text-muted);
  border: 1px dashed var(--border);
  font-size: 0.82rem;
  padding: 8px 20px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
}

.btn-reveal:hover {
  color: var(--accent-red);
  border-color: var(--accent-red);
  background: rgba(239, 68, 68, 0.06);
}

/* --- Hint Button --- */
.btn-hint {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
  color: var(--accent-gold);
}

.btn-hint:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: var(--accent-gold);
}

.btn-hint:disabled {
  border-color: var(--border);
  color: var(--text-muted);
  background: transparent;
}

/* --- Promo Strip (Top Announcement Bar) --- */
.promo-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg, #1e1b4b, #312e81, #4c1d95, #312e81, #1e1b4b);
  padding: 10px 16px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(139, 92, 246, 0.3);
}

.promo-strip::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.15), transparent);
  transform: translateX(-100%);
  animation: promoShimmer 6s ease-in-out infinite;
  will-change: transform;
}

html:not([data-theme="dark"]) .promo-strip {
  background: linear-gradient(90deg, #eef2ff, #e0e7ff, #ddd6fe, #e0e7ff, #eef2ff);
  border-bottom: 1px solid rgba(139, 92, 246, 0.2);
}

html:not([data-theme="dark"]) .promo-strip::before {
  background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
}

@keyframes promoShimmer {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

.promo-strip a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  transition: all 0.25s ease;
}

.promo-strip a:hover {
  transform: scale(1.02);
}

.promo-strip-pulse {
  width: 8px;
  height: 8px;
  background: #a78bfa;
  border-radius: 50%;
  flex-shrink: 0;
  animation: promoPulse 2s ease-in-out infinite;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
}

@keyframes promoPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.7); }
}

.promo-strip-text {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  color: #e0e7ff;
  letter-spacing: 0.2px;
}

.promo-strip-text strong {
  color: #c4b5fd;
  font-weight: 700;
}

html:not([data-theme="dark"]) .promo-strip-text {
  color: #3730a3;
}

html:not([data-theme="dark"]) .promo-strip-text strong {
  color: #6d28d9;
}

.promo-strip-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(196, 181, 253, 0.5);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  transition: color 0.2s;
}

.promo-strip-close:hover {
  color: #f5f3ff;
}

html:not([data-theme="dark"]) .promo-strip-close {
  color: rgba(109, 40, 217, 0.35);
}

html:not([data-theme="dark"]) .promo-strip-close:hover {
  color: #4c1d95;
}

@media (max-width: 480px) {
  .promo-strip {
    padding: 8px 36px 8px 12px;
  }
  .promo-strip-text {
    font-size: 0.75rem;
  }
}

/* --- Community Rating --- */
.community-rating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: var(--radius);
}

.rate-btn {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-primary);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.rate-btn:hover {
  background: var(--bg-tile);
  border-color: var(--text-muted);
}

/* --- Cookie Consent Banner --- */
.cookie-consent-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 20px;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateY(100%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s;
  contain: layout;
  will-change: transform;
}

.cookie-consent-banner.show {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.cookie-consent-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-consent-text {
  flex: 1;
  min-width: 280px;
}

.cookie-consent-text p {
  margin: 0;
  color: var(--text-primary);
  font-size: 0.92rem;
  line-height: 1.5;
}

.cookie-consent-text a {
  color: var(--accent-blue);
  text-decoration: underline;
}

/* --- Ad Inserter Sidebar Styles (Moved below .ad-wrapper for specificity) --- */

.cookie-consent-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-consent-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  border: none;
}

.cookie-consent-btn.accept {
  background: var(--accent-blue);
  color: #fff;
}

.cookie-consent-btn.accept:hover {
  background: #1d4ed8;
}

.cookie-consent-btn.reject {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.cookie-consent-btn.reject:hover {
  background: var(--bg-tile);
  color: var(--text-primary);
}

@media (max-width: 600px) {
  .cookie-consent-inner {
    flex-direction: column;
    text-align: center;
  }
  .cookie-consent-buttons {
    justify-content: center;
  }
}

/* --- Ads Inserter --- */
.ad-wrapper {
  width: 100%;
  margin: 20px auto;
  text-align: center;
  display: block;
}

.ad-wrapper.ad-header { margin: 10px auto 20px; }
.ad-wrapper.ad-sidebar { margin: 0 0 20px; }
.ad-wrapper.ad-footer { margin: 30px auto 10px; }

/* Sticky Sidebars */
.ad-wrapper.ad-left_sidebar,
.ad-wrapper.ad-right_sidebar {
  display: none; /* Hidden on mobile/tablet */
  margin: 0;
  width: auto;
}

@media (min-width: 1100px) {
  .ad-wrapper.ad-left_sidebar,
  .ad-wrapper.ad-right_sidebar {
    display: flex;
    justify-content: center;
    align-items: center;
    position: fixed;
    top: 90px;
    width: 300px; /* Max width */
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    z-index: 10;
    scrollbar-width: none; 
    -ms-overflow-style: none;
  }
  
  .ad-wrapper.ad-left_sidebar::-webkit-scrollbar,
  .ad-wrapper.ad-right_sidebar::-webkit-scrollbar {
    display: none;
  }

  .ad-wrapper.ad-left_sidebar {
    right: calc(50vw + 350px); /* Pins right edge exactly 10px from main container */
    left: auto;
  }

  .ad-wrapper.ad-right_sidebar {
    left: calc(50vw + 350px); /* Pins left edge exactly 10px from main container */
    right: auto;
  }
}

/* ==============================================
   GLOBAL RESPONSIVE CONTAINMENT
   Forces ALL pages to stay within viewport width.
   Prevents horizontal scrolling from ads, tables,
   iframes, embeds, and user-generated content.
   ============================================== */

/* --- Prevent content containers from overflowing --- */
/* NOTE: Do NOT use overflow-x:hidden on containers that hold ads.
   It clips AdSense iframes during auction sizing, killing viewability & CPM.
   Use overflow-wrap instead for safe text containment. */
main,
article,
section,
aside,
.main-container,
.seo-content,
.page-container,
.article-container,
.legal-content,
.create-form,
.blog-grid {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* --- AdSense & Ad Containers --- */
/* IMPORTANT: Only style the .ad-wrapper parent container.
   Do NOT override ins.adsbygoogle sizing — AdSense manages it internally.
   Forced !important on ins elements breaks the ad auction & lowers CPM. */
.ad-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin-left: auto;
  margin-right: auto;
  display: block;
  text-align: center;
}

/* Let AdSense children inherit containment from parent, not forced sizing */
ins.adsbygoogle > iframe,
ins.adsbygoogle > div,
ins.adsbygoogle > ins,
div[id^="google_ads_iframe"],
iframe[id^="aswift_"] {
  max-width: 100%;
  box-sizing: border-box;
}

/* In-article ad specific */
.ad-in-article,
.ad-vertigo {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  padding: 0;
  box-sizing: border-box;
  margin: 24px auto;
}

/* --- Iframes (embeds, videos, ads) --- */
iframe {
  max-width: 100%;
  border: 0;
}

/* --- Tables — responsive wrapper fallback --- */
table {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* For tables that are too wide, allow horizontal scroll within their container */
.page-content,
.article-content,
.seo-content,
.legal-content {
  overflow-wrap: break-word;
  word-wrap: break-word;
}

/* --- Pre / Code blocks --- */
pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* --- Embedded media --- */
video,
object,
embed,
svg {
  max-width: 100%;
  height: auto;
}

/* --- Mobile-specific ad containment --- */
@media (max-width: 768px) {
  .ad-wrapper {
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    display: block;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
  }

  .ad-wrapper ins,
  .ad-wrapper iframe,
  .ad-wrapper > div {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Prevent fixed-position sidebar ads from showing on mobile */
  .ad-wrapper.ad-left_sidebar,
  .ad-wrapper.ad-right_sidebar {
    display: none !important;
  }
}

/* --- Hide Sidebars on Tablets to prevent layout breaking --- */
@media (max-width: 1200px) {
  .ad-wrapper.ad-left_sidebar,
  .ad-wrapper.ad-right_sidebar {
    display: none !important;
  }
}

/* --- Sticky Footer Ad (mobile only) --- */
#msa-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  text-align: center;
  background: var(--bg-body, #fff);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.12);
  box-sizing: border-box;
}

[data-theme="dark"] #msa-wrap {
  background: rgba(15, 15, 35, 0.95);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.5);
}



/* ================================================
   HINTS PAGE COMPONENT STYLES
   Shared across all hints pages (NYT, Sports, Soccer)
   ================================================ */

/* Hint Cards (progressive clues) */
.hint-card { padding: 20px; border-radius: 12px; margin: 15px 0; border-left: 5px solid; }
.hint-card.yellow { background: linear-gradient(135deg, #fef9c3, #fef08a); border-left-color: #eab308; }
.hint-card.green { background: linear-gradient(135deg, #dcfce7, #bbf7d0); border-left-color: #22c55e; }
.hint-card.blue { background: linear-gradient(135deg, #dbeafe, #bfdbfe); border-left-color: #3b82f6; }
.hint-card.purple { background: linear-gradient(135deg, #f3e8ff, #e9d5ff); border-left-color: #a855f7; }
.hint-card h3 { margin: 0 0 10px; font-size: 18px; }
.hint-card.yellow h3 { color: #854d0e; }
.hint-card.green h3 { color: #166534; }
.hint-card.blue h3 { color: #1e3a5f; }
.hint-card.purple h3 { color: #581c87; }
.hint-card p { margin: 0 0 8px; font-size: 15px; line-height: 1.6; }
.hint-card.yellow p { color: #713f12; }
.hint-card.green p { color: #14532d; }
.hint-card.blue p { color: #1e40af; }
.hint-card.purple p { color: #6b21a8; }

/* Answer Cards (full solution reveal) */
.answer-card { padding: 20px; border-radius: 12px; margin: 15px 0; border: 2px solid; }
.answer-card.yellow { background: #fef9c3; border-color: #eab308; }
.answer-card.green { background: #dcfce7; border-color: #22c55e; }
.answer-card.blue { background: #dbeafe; border-color: #3b82f6; }
.answer-card.purple { background: #f3e8ff; border-color: #a855f7; }
.answer-card h3 { margin: 0 0 10px; font-size: 20px; }
.answer-card.yellow h3 { color: #854d0e; }
.answer-card.green h3 { color: #166534; }
.answer-card.blue h3 { color: #1e40af; }
.answer-card.purple h3 { color: #6b21a8; }

/* Word Chips & Tiles */
.word-chips { display: flex; gap: 10px; flex-wrap: wrap; }
.word-chip { padding: 10px 18px; border-radius: 8px; font-weight: bold; font-size: 16px; color: #fff; }
.word-chip.yellow { background: #eab308; }
.word-chip.green { background: #22c55e; }
.word-chip.blue { background: #3b82f6; }
.word-chip.purple { background: #a855f7; }
.word-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 20px 0; }
.word-tile { background: #f0eaff; padding: 14px; text-align: center; border-radius: 8px; font-weight: bold; font-size: 14px; color: #4a1fb8; border: 2px solid #d4c5f9; word-break: break-word; }

/* One-Word Hint Grid */
.one-word-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 15px; margin: 20px 0; }
.one-word-card { padding: 20px; border-radius: 10px; text-align: center; }
.one-word-card.yellow { background: #fef08a; }
.one-word-card.green { background: #bbf7d0; }
.one-word-card.blue { background: #bfdbfe; }
.one-word-card.purple { background: #e9d5ff; }

/* Section Headings */
.section-heading { font-size: 24px; color: var(--text-primary, #1a1a1a); border-bottom: 3px solid #6c3ce0; padding-bottom: 10px; margin-top: 40px; }

/* Content Boxes */
.quick-answer { background: #f5f0ff; border-left: 5px solid #6c3ce0; padding: 20px; margin-bottom: 25px; border-radius: 0 10px 10px 0; }
.trust-box { background: linear-gradient(135deg, #6c3ce0 0%, #4a1fb8 100%); padding: 20px; border-radius: 10px; margin-bottom: 25px; }
.key-takeaways { background: var(--bg-card, #f8f9fa); border: 2px solid #6c3ce0; padding: 25px; border-radius: 10px; margin: 25px 0; }
.toc-box { background: var(--bg-card, #fff); border: 1px solid var(--border, #ddd); padding: 20px; border-radius: 8px; margin: 25px 0; }
.strategy-box { background: #d1ecf1; padding: 20px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #0c5460; }
.red-herring-alert { background: #fff3cd; padding: 15px; border-radius: 8px; margin: 20px 0; border-left: 4px solid #ffc107; }
.conclusion-box { background: linear-gradient(135deg, #1a1a1a 0%, #333 100%); padding: 30px; border-radius: 10px; margin-top: 40px; }
.internal-links-box { background: var(--bg-card, #f8f9fa); border: 1px solid var(--border, #ddd); padding: 20px; border-radius: 10px; margin: 25px 0; }

/* Breakdown Cards (detailed answer explanations) */
.breakdown-card { padding: 20px; border-radius: 12px; margin: 20px 0; border: 1px solid var(--border, #ddd); background: var(--bg-card, #fff); }
.breakdown-card h4 { margin: 0 0 12px; font-size: 18px; }
.breakdown-card p { margin: 0 0 10px; font-size: 15px; line-height: 1.7; color: var(--text-primary, #333); }
.breakdown-card ul { margin: 0; padding-left: 20px; line-height: 1.8; }

/* Hints Page Responsive */
@media(max-width:600px) {
  .word-grid { grid-template-columns: repeat(2, 1fr); }
  .one-word-grid { grid-template-columns: 1fr 1fr; }
  .word-tile { font-size: 12px; padding: 10px 6px; }
}

/* --- WhatsApp Banner --- */
.whatsapp-banner {
  display: block;
  background: linear-gradient(45deg, #25D366, #128C7E);
  color: #ffffff !important;
  text-align: center;
  padding: 10px 15px;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.3);
  position: relative;
  overflow: hidden;
  z-index: 99;
}

.whatsapp-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.15), transparent);
  transform: translateX(-100%);
  animation: gradientShift 3s ease infinite;
  will-change: transform;
}

.whatsapp-banner:hover {
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

.whatsapp-banner-text {
  display: inline-block;
  animation: pulseText 1.5s infinite;
  will-change: transform, opacity;
}

@keyframes gradientShift {
  0% { transform: translateX(-100%); }
  50% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}

@keyframes pulseText {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

/* ============================================
   PREMIUM UPGRADES
   ============================================ */

/* --- Scroll Reveal Animations --- */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }

/* --- Game Tile Entrance Stagger --- */
@keyframes tileEntrance {
  0% { opacity: 0; transform: scale(0.7) translateY(12px); }
  60% { transform: scale(1.04) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}
.game-grid:not(.rendered) .tile {
  animation: tileEntrance 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.game-grid:not(.rendered) .tile:nth-child(1) { animation-delay: 0.02s; }
.game-grid:not(.rendered) .tile:nth-child(2) { animation-delay: 0.04s; }
.game-grid:not(.rendered) .tile:nth-child(3) { animation-delay: 0.06s; }
.game-grid:not(.rendered) .tile:nth-child(4) { animation-delay: 0.08s; }
.game-grid:not(.rendered) .tile:nth-child(5) { animation-delay: 0.10s; }
.game-grid:not(.rendered) .tile:nth-child(6) { animation-delay: 0.12s; }
.game-grid:not(.rendered) .tile:nth-child(7) { animation-delay: 0.14s; }
.game-grid:not(.rendered) .tile:nth-child(8) { animation-delay: 0.16s; }
.game-grid:not(.rendered) .tile:nth-child(9) { animation-delay: 0.18s; }
.game-grid:not(.rendered) .tile:nth-child(10) { animation-delay: 0.20s; }
.game-grid:not(.rendered) .tile:nth-child(11) { animation-delay: 0.22s; }
.game-grid:not(.rendered) .tile:nth-child(12) { animation-delay: 0.24s; }
.game-grid:not(.rendered) .tile:nth-child(13) { animation-delay: 0.26s; }
.game-grid:not(.rendered) .tile:nth-child(14) { animation-delay: 0.28s; }
.game-grid:not(.rendered) .tile:nth-child(15) { animation-delay: 0.30s; }
.game-grid:not(.rendered) .tile:nth-child(16) { animation-delay: 0.32s; }

/* --- Premium Button States --- */
.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--ripple-x, 50%) var(--ripple-y, 50%), rgba(255,255,255,0.25) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s;
}
.btn:active::after {
  opacity: 1;
  transition: opacity 0s;
}
.btn:active {
  transform: scale(0.96);
}

/* --- Glassmorphism Game Container --- */
.main-container {
  position: relative;
}
.main-container::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(88,101,242,0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.main-container > * {
  position: relative;
  z-index: 1;
}

/* --- Colored Card Shadows --- */
.game-card {
  position: relative;
  overflow: hidden;
}
.game-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--cat-yellow), var(--cat-green), var(--cat-blue), var(--cat-purple));
  opacity: 0;
  transition: opacity 0.3s;
}
.game-card:hover::before {
  opacity: 1;
}
.game-card:hover {
  box-shadow: 0 8px 32px rgba(88,101,242,0.12), 0 2px 8px rgba(0,0,0,0.06);
}

/* --- Premium Navbar Glass Effect --- */
.navbar {
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
}
[data-theme="dark"] .navbar {
  background: rgba(15,17,23,0.85);
}

/* --- Navbar Link Active Indicator --- */
.nav-links a {
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 2px;
  background: var(--accent-blue);
  transition: width 0.3s, left 0.3s;
  border-radius: 1px;
}
.nav-links a:hover::after {
  width: 60%;
  left: 20%;
}

/* --- Animated Hamburger Icon --- */
.mobile-menu-btn {
  width: 38px;
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
}
.mobile-menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}
.mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Smooth Dropdown Transitions --- */
.dropdown-menu {
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(8px);
  transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
}
.nav-dropdown:hover .dropdown-menu,
.nav-dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-dropdown:hover .dropdown-arrow {
  transform: rotate(180deg);
}

@media (max-width: 768px) {
  .dropdown-menu {
    transform: translateY(8px);
  }
  .nav-dropdown:hover .dropdown-menu,
  .nav-dropdown.open .dropdown-menu {
    transform: translateY(0);
  }
}

/* --- Premium Footer --- */
.footer {
  background: linear-gradient(180deg, var(--bg-secondary) 0%, var(--bg-card) 100%);
  border-top: 1px solid var(--border);
  padding: 48px 20px 32px;
  margin-top: 80px;
}
.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}
.footer-logo .logo-icon {
  display: grid;
  grid-template-columns: repeat(2, 8px);
  gap: 2px;
}
.footer-logo .logo-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}
.footer-logo-text {
  font-weight: 800;
  font-size: 1rem;
  color: var(--text-primary);
}
.footer-divider {
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--cat-yellow), var(--cat-green), var(--cat-blue), var(--cat-purple));
  margin: 0 auto 20px;
  border-radius: 1px;
}
.footer-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.footer-links {
  margin-bottom: 24px;
}
.footer-links a {
  font-size: 0.82rem;
  padding: 4px 0;
  transition: color 0.2s;
}
.footer-links a:hover {
  color: var(--accent-blue);
}
.footer-social {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
}
.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-tile);
  color: var(--text-secondary);
  font-size: 0.85rem;
  transition: all 0.25s;
}
.footer-social a:hover {
  background: var(--accent-blue);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(88,101,242,0.3);
}

/* --- Premium Modal --- */
.modal {
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
}
.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
  animation: modalBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalBounce {
  0% { transform: scale(0.85) translateY(20px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* --- Category Reveal Premium --- */
@keyframes categoryReveal {
  0% { transform: scaleY(0) scaleX(0.9); opacity: 0; }
  50% { transform: scaleY(1.06) scaleX(1.02); }
  100% { transform: scaleY(1) scaleX(1); opacity: 1; }
}
.solved-category {
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

/* --- Answer-First Box Premium --- */
.seo-content > div[style*="gradient"] {
  border-radius: var(--radius-lg);
  backdrop-filter: blur(8px);
}

/* --- Toast Premium --- */
.toast {
  backdrop-filter: blur(12px);
  background: rgba(26,29,46,0.9);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
[data-theme="dark"] .toast {
  background: rgba(240,240,245,0.9);
  color: var(--text-primary);
}

/* --- Archive Card Premium --- */
.archive-card {
  position: relative;
  overflow: hidden;
}
.archive-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue));
  transform: scaleX(0);
  transition: transform 0.3s;
}
.archive-card:hover::after {
  transform: scaleX(1);
}

/* --- FAQ Premium --- */
.faq-item {
  transition: border-color 0.3s, box-shadow 0.3s;
}
.faq-item:hover {
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
}
.faq-item.open {
  border-color: var(--accent-blue);
  box-shadow: 0 4px 20px rgba(37,99,235,0.08);
}

/* --- Performance & Layout Shift (CLS) Optimizations --- */
@font-face {
  font-family: 'Inter';
  font-display: swap;
}

.homepage-banner {
  width: 100%;
  max-width: 100%;
  margin: 16px 0 24px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--bg-card);
  contain: layout;
}

.homepage-banner img {
  width: 100%;
  height: auto;
  aspect-ratio: 692 / 258;
  object-fit: cover;
  display: block;
}

.game-grid {
  min-height: 280px;
  contain: content;
  contain-intrinsic-size: auto 280px;
}

.solved-container {
  min-height: 0;
}

.solved-container:empty,
.hint-box:empty {
  display: none;
}

/* Reserve ad slot heights to prevent CLS */
/* NOTE: Do NOT use content-visibility:auto on ad containers.
   It defers rendering, which makes AdSense see ads as "not viewable"
   → lower Active View score → drastically lower CPM bids. */
.ad-wrapper,
.ad-unit,
.ad-best-ctr,
.ad-autorelaxed,
.ad-auto-responsive {
  min-height: 250px;
  background: transparent;
}

.ad-wrapper.ad-in-article,
.ad-wrapper.ad-native-feed {
  min-height: 120px;
}

.ad-wrapper.ad-header {
  min-height: 90px;
}

.ad-wrapper.ad-before_content,
.ad-wrapper.ad-after_content {
  min-height: 100px;
}

/* GPU-composited hints for animated elements */
.confetti-piece {
  will-change: transform, opacity;
}

.tile {
  will-change: transform;
  contain: layout style;
}

.solved-category {
  will-change: transform, opacity;
  contain: layout style;
}

/* ============================================
   Connections Solver Tool Styles
   /connections-solver
   ============================================ */

/* --- Source Tabs --- */
.solver-source-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.solver-source-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 10px 20px;
  border-radius: 24px;
  border: 2px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.solver-source-btn:hover {
  background: var(--bg-card);
  border-color: var(--text-muted);
  color: var(--text-primary);
}

.solver-source-btn.active {
  background: var(--text-primary);
  color: var(--bg-primary);
  border-color: var(--text-primary);
}

/* --- Input Panel --- */
.solver-input-panel {
  margin-bottom: 24px;
}

.solver-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.solver-textarea {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Inter', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  resize: vertical;
  transition: border-color var(--transition);
}

.solver-textarea:focus {
  outline: none;
  border-color: #5865f2;
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.15);
}

.solver-select {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  min-width: 180px;
}

.solver-select:focus {
  outline: none;
  border-color: #5865f2;
}

/* --- Loading --- */
.solver-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 40px 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.solver-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border);
  border-top-color: #5865f2;
  border-radius: 50%;
  animation: solver-spin 0.8s linear infinite;
}

@keyframes solver-spin {
  to { transform: rotate(360deg); }
}

/* --- Board Header --- */
.solver-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.solver-board-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.solver-action-btn {
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 16px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.solver-action-btn:hover {
  background: var(--bg-tile);
  border-color: var(--text-muted);
  color: var(--text-primary);
  transform: translateY(-1px);
}

/* --- Color Legend --- */
.solver-color-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}

.solver-legend-item {
  font-weight: 600;
}

.solver-legend-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  font-size: 14px;
}

/* --- Solver Grid (16 tiles, 4x4) --- */
.solver-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.solver-tile {
  background: var(--bg-tile);
  border: 2px solid transparent;
  border-radius: var(--radius);
  padding: 16px 8px;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s ease;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  user-select: none;
  -webkit-user-select: none;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  word-break: break-word;
  touch-action: manipulation;
  position: relative;
}

.solver-tile:hover {
  background: var(--bg-tile-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.solver-tile:active {
  transform: scale(0.96);
}

.solver-tile--dragging {
  opacity: 0.4;
  transform: scale(0.95);
}

/* Color states */
.solver-tile--yellow {
  background: var(--cat-yellow) !important;
  color: #1a1a1a !important;
  border-color: #e6c84a;
  box-shadow: 0 2px 10px rgba(249, 223, 109, 0.4);
}

.solver-tile--green {
  background: var(--cat-green) !important;
  color: #1a1a1a !important;
  border-color: #8ab34a;
  box-shadow: 0 2px 10px rgba(160, 195, 90, 0.4);
}

.solver-tile--blue {
  background: var(--cat-blue) !important;
  color: #1a1a1a !important;
  border-color: #8fa8d5;
  box-shadow: 0 2px 10px rgba(176, 196, 239, 0.4);
}

.solver-tile--purple {
  background: var(--cat-purple) !important;
  color: #1a1a1a !important;
  border-color: #a069ab;
  box-shadow: 0 2px 10px rgba(186, 129, 197, 0.4);
}

/* --- Group Lanes --- */
.solver-lanes {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.solver-lane {
  border-radius: var(--radius);
  padding: 14px 16px;
  border: 2px dashed var(--border);
  transition: all 0.2s ease;
  min-height: 72px;
}

.solver-lane.yellow { border-color: #e6c84a; background: rgba(249, 223, 109, 0.08); }
.solver-lane.green  { border-color: #8ab34a; background: rgba(160, 195, 90, 0.08); }
.solver-lane.blue   { border-color: #8fa8d5; background: rgba(176, 196, 239, 0.08); }
.solver-lane.purple { border-color: #a069ab; background: rgba(186, 129, 197, 0.08); }

.solver-lane--full {
  border-style: solid !important;
}

.solver-lane--full.yellow { background: rgba(249, 223, 109, 0.18); }
.solver-lane--full.green  { background: rgba(160, 195, 90, 0.18); }
.solver-lane--full.blue   { background: rgba(176, 196, 239, 0.18); }
.solver-lane--full.purple { background: rgba(186, 129, 197, 0.18); }

.solver-lane--dragover {
  border-style: solid !important;
  transform: scale(1.01);
  box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.2);
}

.solver-lane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.solver-lane-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.solver-lane-note {
  flex: 1;
  min-width: 140px;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-style: italic;
  transition: border-color var(--transition);
}

.solver-lane-note:focus {
  outline: none;
  border-color: #5865f2;
}

.solver-lane-words {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
}

.solver-lane-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.solver-lane-chip:hover {
  transform: scale(0.95);
  opacity: 0.8;
}

.solver-lane-chip--yellow { background: var(--cat-yellow); color: #1a1a1a; }
.solver-lane-chip--green  { background: var(--cat-green);  color: #1a1a1a; }
.solver-lane-chip--blue   { background: var(--cat-blue);   color: #1a1a1a; }
.solver-lane-chip--purple { background: var(--cat-purple); color: #1a1a1a; }

/* --- Pattern Detection Panel --- */
.solver-patterns {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  overflow: hidden;
}

.solver-patterns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(88, 101, 242, 0.08), rgba(124, 58, 237, 0.08));
}

.solver-patterns-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.solver-patterns-close:hover {
  color: var(--text-primary);
}

.solver-patterns-body {
  padding: 12px 16px;
  max-height: 360px;
  overflow-y: auto;
}

.solver-pattern-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.solver-pattern-item:last-child {
  border-bottom: none;
}

.solver-pattern-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.solver-pattern-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.solver-pattern-word {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(88, 101, 242, 0.12);
  color: #5865f2;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

[data-theme="dark"] .solver-pattern-word {
  background: rgba(88, 101, 242, 0.2);
  color: #8b9cf7;
}

/* --- Board Footer --- */
.solver-board-footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* --- Responsive --- */
@media (max-width: 640px) {
  .solver-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
  }

  .solver-tile {
    padding: 12px 4px;
    font-size: 0.72rem;
    min-height: 52px;
  }

  .solver-source-bar {
    gap: 4px;
  }

  .solver-source-btn {
    padding: 8px 14px;
    font-size: 0.78rem;
  }

  .solver-board-actions {
    width: 100%;
    justify-content: center;
  }

  .solver-action-btn {
    font-size: 0.72rem;
    padding: 5px 10px;
  }

  .solver-lane-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .solver-lane-note {
    min-width: 100%;
  }
}

@media (max-width: 400px) {
  .solver-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }

  .solver-tile {
    padding: 10px 3px;
    font-size: 0.65rem;
    min-height: 46px;
  }
}

/* ============================================
   FAQ ACCORDION STYLES
   ============================================ */
.faq-section {
  margin-bottom: 32px;
}

.faq-item {
  border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius, 12px);
  margin-bottom: 10px;
  overflow: hidden;
  background: var(--bg-secondary, #f8f9fa);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.faq-item:hover {
  border-color: var(--accent-purple, #6c3ce0);
  box-shadow: 0 2px 8px rgba(108, 60, 224, 0.08);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #1a1a2e);
  text-align: left;
  line-height: 1.5;
  font-family: inherit;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: rgba(108, 60, 224, 0.04);
}

.faq-question::after {
  content: '▸';
  font-size: 14px;
  color: var(--text-muted, #999);
  margin-left: 12px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.faq-item.open .faq-question::after {
  transform: rotate(90deg);
  color: var(--accent-purple, #6c3ce0);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.35s ease;
  padding: 0 20px;
}

.faq-item.open .faq-answer {
  max-height: 500px;
  padding: 0 20px 16px;
}

.faq-answer p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary, #555);
}

.faq-answer a {
  color: var(--accent-purple, #6c3ce0);
  font-weight: 600;
  text-decoration: none;
}

.faq-answer a:hover {
  text-decoration: underline;
}

/* ============================================
   SOLVER QUICK-SOLVE HELPER BUTTONS
   ============================================ */
.solver-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border, #e0e0e0);
}

.solver-quick-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border: 1px solid var(--border, #e0e0e0);
  border-radius: 8px;
  background: var(--bg-secondary, #f8f9fa);
  color: var(--text-primary, #1a1a2e);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.solver-quick-btn:hover {
  background: var(--accent-purple, #6c3ce0);
  color: #fff;
  border-color: var(--accent-purple, #6c3ce0);
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(108, 60, 224, 0.2);
}

@media (max-width: 600px) {
  .faq-question {
    padding: 14px 16px;
    font-size: 14px;
  }

  .faq-answer {
    padding: 0 16px;
  }

  .faq-item.open .faq-answer {
    padding: 0 16px 14px;
  }

  .solver-quick-actions {
    gap: 6px;
  }

  .solver-quick-btn {
    padding: 7px 11px;
    font-size: 12px;
  }
}

/* ============================================
   SOLVER WORD SEARCH RESULTS
   ============================================ */
.solver-search-results {
  background: var(--bg-secondary, #f8f9fa);
  border: 1px solid var(--border, #e0e0e0);
  border-radius: var(--radius, 12px);
  margin-bottom: 16px;
  overflow: hidden;
}

.solver-search-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(108,60,224,0.06), rgba(88,101,242,0.06));
  border-bottom: 1px solid var(--border, #e0e0e0);
}

.solver-search-body {
  padding: 14px 18px;
  max-height: 500px;
  overflow-y: auto;
}

.solver-search-body::-webkit-scrollbar {
  width: 6px;
}

.solver-search-body::-webkit-scrollbar-thumb {
  background: var(--border, #ccc);
  border-radius: 3px;
}

/* Individual search result card */
.search-result-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  border-radius: 10px;
  border-left: 4px solid var(--border);
  background: var(--bg-primary, #fff);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s ease;
}

.search-result-card:hover {
  box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

.search-result-card:last-child {
  margin-bottom: 0;
}

.search-result-card[data-color="yellow"] { border-left-color: var(--cat-yellow, #f9df6d); }
.search-result-card[data-color="green"]  { border-left-color: var(--cat-green, #a0c35a); }
.search-result-card[data-color="blue"]   { border-left-color: var(--cat-blue, #b0c4ef); }
.search-result-card[data-color="purple"] { border-left-color: var(--cat-purple, #ba81c5); }

.search-result-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}

.search-result-puzzle {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-purple, #6c3ce0);
  background: rgba(108, 60, 224, 0.08);
  padding: 3px 10px;
  border-radius: 20px;
  text-decoration: none;
}

.search-result-puzzle:hover {
  background: rgba(108, 60, 224, 0.15);
}

.search-result-color-badge {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 3px 10px;
  border-radius: 20px;
  color: #fff;
}

.search-result-color-badge[data-color="yellow"] { background: var(--cat-yellow, #f9df6d); color: #5a4e00; }
.search-result-color-badge[data-color="green"]  { background: var(--cat-green, #a0c35a); color: #2d4a00; }
.search-result-color-badge[data-color="blue"]   { background: var(--cat-blue, #b0c4ef); color: #1a3066; }
.search-result-color-badge[data-color="purple"] { background: var(--cat-purple, #ba81c5); color: #3d1a4a; }

.search-result-group {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary, #1a1a2e);
  line-height: 1.4;
}

.search-result-words {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.search-result-word {
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--bg-tile, #eef0f4);
  border-radius: 6px;
  color: var(--text-secondary, #555);
  transition: background 0.15s ease;
}

.search-result-word.highlight {
  background: rgba(108, 60, 224, 0.15);
  color: var(--accent-purple, #6c3ce0);
  box-shadow: 0 0 0 1.5px var(--accent-purple, #6c3ce0);
}

.search-no-results {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted, #999);
  font-size: 14px;
  line-height: 1.6;
}

.search-no-results strong {
  color: var(--text-primary, #1a1a2e);
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
}

.search-loading {
  text-align: center;
  padding: 24px 16px;
  color: var(--text-muted, #999);
  font-size: 14px;
}

.search-loading .solver-spinner {
  margin: 0 auto 10px;
}

@media (max-width: 600px) {
  .solver-search-body {
    padding: 10px 14px;
  }
  
  .search-result-card {
    padding: 12px 14px;
  }

  .search-result-word {
    padding: 3px 8px;
    font-size: 11px;
  }
}
