/* ============================================================
   NYT Games Hints — Main Stylesheet
   Design: Clean, reading-focused, warm neutral with per-game accents
   Mobile-first responsive, no external dependencies
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  /* Colors */
  --bg: #fafaf8;
  --bg-card: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #555555;
  --text-muted: #888888;
  --border: #e5e5e0;
  --border-light: #efefea;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --warning: #f59e0b;
  --success: #10b981;
  --danger: #ef4444;

  /* Game colors */
  --wordle: #6aaa64;
  --connections: #b49fda;
  --connections-sports: #f09b59;
  --strands: #5ba4cf;
  --spelling-bee: #d4a72c;
  --letter-boxed: #d66b6b;
  --mini-crossword: #85c0f9;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Georgia', 'Times New Roman', serif;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Layout */
  --max-w: 800px;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }

/* ---------- Typography ---------- */
h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; line-height: 1.25; }
h2 { font-size: clamp(1.25rem, 3vw, 1.5rem); font-weight: 600; line-height: 1.3; }
h3 { font-size: clamp(1rem, 2.5vw, 1.2rem); font-weight: 600; line-height: 1.35; }
p { margin-bottom: var(--space-md); font-size: 1rem; color: var(--text-secondary); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

main {
  flex: 1;
  padding-top: var(--space-lg);
  padding-bottom: var(--space-3xl);
}

/* ---------- Navigation ---------- */
.nav {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}
.nav-logo:hover { text-decoration: none; opacity: 0.8; }

.nav-logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--wordle) 0%, var(--strands) 50%, var(--connections) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #fff;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  font-size: 0.9rem;
}

.nav-links a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  text-decoration: none;
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Mobile nav */
.mobile-nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--space-xs);
  color: var(--text);
}

@media (max-width: 640px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: var(--space-md) var(--space-lg);
    gap: var(--space-md);
    box-shadow: var(--shadow-md);
  }
  .mobile-nav-toggle { display: block; }
}

/* ---------- Hero Section ---------- */
.hero {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-xl);
}

.hero-date {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: var(--space-xs) var(--space-md);
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.hero h1 {
  margin-bottom: var(--space-sm);
}

.hero-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 540px;
  margin: 0 auto var(--space-lg);
}

/* ---------- Game Card ---------- */
.games-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.game-card:hover { box-shadow: var(--shadow-md); }

.game-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  cursor: pointer;
  user-select: none;
}

.game-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #fff;
}

.game-card-info { flex: 1; min-width: 0; }

.game-card-info h2 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.game-number {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--border-light);
  padding: 2px 8px;
  border-radius: 10px;
}

.game-card-arrow {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.game-card.open .game-card-arrow {
  transform: rotate(180deg);
}

/* Play link on game card header */
.play-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  padding: 5px 12px;
  border: 1px solid var(--accent);
  border-radius: 18px;
  transition: all 0.2s;
  flex-shrink: 0;
  white-space: nowrap;
}
.play-link:hover {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}

@media (max-width: 480px) {
  .play-link { padding: 4px 10px; font-size: 0.75rem; }
}

/* Difficulty badge */
.difficulty {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 4px;
}

.difficulty-dots {
  display: flex;
  gap: 2px;
}

.difficulty-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.difficulty-dot.filled { background: var(--warning); }

.difficulty-label { color: var(--text-muted); margin-left: 4px; }

/* ---------- Hint Levels ---------- */
.game-card-body {
  display: none;
  padding: 0 var(--space-lg) var(--space-lg);
  border-top: 1px solid var(--border);
}

.game-card.open .game-card-body { display: block; }

.hint-levels {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding-top: var(--space-lg);
}

.hint-level {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.hint-level-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text);
  text-align: left;
  transition: background 0.15s;
}
.hint-level-btn:hover { background: var(--border-light); }

.hint-level-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  font-weight: 600;
}

.hint-level-1 .hint-level-icon { background: #dbeafe; color: #1e40af; }
.hint-level-2 .hint-level-icon { background: #fef3c7; color: #92400e; }
.hint-level-3 .hint-level-icon { background: #fee2e2; color: #991b1b; }
.hint-answer .hint-level-icon { background: #d1fae5; color: #065f46; }

.hint-level-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hint-level-content {
  display: none;
  padding: 0 var(--space-md) var(--space-md);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.hint-level.open .hint-level-content { display: block; }

.hint-answer .hint-level-content {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  padding: var(--space-lg);
  letter-spacing: 0.05em;
  font-family: var(--font-serif);
}

.hint-spoiler-warning {
  font-size: 0.8rem;
  color: var(--danger);
  font-weight: 500;
  margin-top: var(--space-xs);
}

/* ---------- Connections Categories ---------- */
.categories-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.category-card {
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  border: 2px solid transparent;
}

.category-card.yellow  { background: #fef9c3; border-color: #eab308; }
.category-card.green   { background: #dcfce7; border-color: #22c55e; }
.category-card.blue    { background: #dbeafe; border-color: #3b82f6; }
.category-card.purple  { background: #f3e8ff; border-color: #a855f7; }

.category-card h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.category-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* ---------- Strands / Spelling Bee Special ---------- */
.spangram-display,
.pangram-display {
  display: inline-block;
  background: var(--strands);
  color: #fff;
  padding: 6px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.05em;
}

.theme-words {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.theme-word-tag {
  background: var(--border-light);
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 0.9rem;
  font-weight: 500;
}

/* ---------- Spelling Bee letter grid ---------- */
.bee-letters {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin: var(--space-lg) 0;
  flex-wrap: wrap;
}

.bee-letter {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
}

.bee-letter.center {
  background: var(--spelling-bee);
  color: #fff;
  width: 48px;
  height: 48px;
  font-size: 1.3rem;
}

/* ---------- Letter Boxed ---------- */
.letter-boxed-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
  max-width: 320px;
  margin: var(--space-md) auto;
}

.letter-boxed-side {
  background: var(--border-light);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  text-align: center;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
}

/* ---------- Mini Crossword ---------- */
.crossword-answers {
  margin-top: var(--space-md);
}

.crossword-section h4 {
  font-size: 0.9rem;
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.crossword-clue {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.9rem;
}

.crossword-clue-num {
  font-weight: 600;
  color: var(--text-muted);
  min-width: 24px;
}

.crossword-clue-answer {
  font-weight: 600;
  margin-left: auto;
  color: var(--accent);
}

/* ---------- How It Works Section ---------- */
.how-it-works {
  padding: var(--space-3xl) 0;
  text-align: center;
}

.how-it-works h2 { margin-bottom: var(--space-xl); }

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
}

.step {
  text-align: center;
}

.step-number {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.step h3 { margin-bottom: var(--space-sm); }
.step p { font-size: 0.9rem; }

/* ---------- Content Section ---------- */
.content-section {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.content-section h2 { margin-bottom: var(--space-md); }
.content-section h3 { margin-top: var(--space-lg); margin-bottom: var(--space-sm); }
.content-section p { line-height: 1.75; }
.content-section ul,
.content-section ol { margin-bottom: var(--space-md); padding-left: var(--space-xl); }
.content-section li { margin-bottom: var(--space-sm); color: var(--text-secondary); }

/* ---------- FAQ Section ---------- */
.faq-section {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--border);
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.faq-question:hover { background: var(--border-light); }

.faq-icon {
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform 0.3s;
  flex-shrink: 0;
}

.faq-item.open .faq-icon { transform: rotate(45deg); }

.faq-answer {
  display: none;
  padding: 0 var(--space-lg) var(--space-md);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

.faq-item.open .faq-answer { display: block; }

/* ---------- CTA / Ad Section ---------- */
.ad-section {
  padding: var(--space-xl) 0;
  text-align: center;
}

.ad-placeholder {
  background: var(--border-light);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-xl);
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: var(--space-2xl) 0 var(--space-lg);
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--space-xl);
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.footer-col h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-md);
  color: var(--text-muted);
}

.footer-col ul { list-style: none; }

.footer-col li { margin-bottom: var(--space-sm); }

.footer-col a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  text-align: center;
  padding-top: var(--space-xl);
  margin-top: var(--space-xl);
  border-top: 1px solid var(--border-light);
  font-size: 0.8rem;
  color: var(--text-muted);
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

/* ---------- Archive Page ---------- */
.archive-list {
  list-style: none;
}

.archive-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-light);
}

.archive-date {
  font-weight: 500;
}

.archive-link {
  font-size: 0.9rem;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: var(--space-md) 0;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--text); }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Date navigation */
.date-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.date-nav-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--text);
  font-family: var(--font-sans);
  transition: background 0.15s;
}
.date-nav-btn:hover { background: var(--border-light); }
.date-nav-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Print styles */
@media print {
  .nav, .footer, .ad-section { display: none; }
  body { background: #fff; }
  .game-card { break-inside: avoid; box-shadow: none; border: 1px solid #ccc; }
}
