/* ============================================
   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,
.ad-slot {
  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;
}

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;
}

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);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* --- 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);
}

.tile.selected {
  background: var(--bg-tile-selected);
  border-color: #7c85f5;
  transform: translateY(-3px);
  box-shadow: 0 4px 16px rgba(88, 101, 242, 0.3);
}

.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: 32px;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: var(--shadow);
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.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;
}

.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);
}

/* --- Ad Slots --- */
.ad-slot {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin: 24px 0;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.8rem;
}

/* --- SEO Content Section --- */
.seo-content {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding: 0 16px;
}

.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);
}

.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;
}

.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;
}

.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: 16px 20px;
    gap: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  }

  .nav-links.open a {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
  }

  .nav-links.open a:hover {
    background: var(--bg-tile);
  }

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

  .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 h1 {
    font-size: 1.3rem;
  }

  .seo-content h2 {
    font-size: 1.15rem;
  }

  .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; }
}

.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; }

/* --- 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;
}

/* --- Hint Button --- */
.btn-hint {
  border-color: #7c3aed;
  color: #c4b5fd;
}
.btn-hint:hover {
  background: rgba(124, 58, 237, 0.15);
  border-color: #a78bfa;
  color: #e9d5ff;
}
.btn-hint:disabled {
  border-color: var(--border);
  color: var(--text-muted);
}

/* --- Stats in Modal --- */
.stats-container {
  margin: 16px 0 20px;
}

.stats-row {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-bottom: 12px;
}

.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;
}

/* --- 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: #7c85f5;
}

/* --- 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);
}

/* --- 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);
}
