/* SimpleCrossword Global Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --surface2: #1c1c1c;
  --border: #2a2a2a;
  --text: #f5f5f5;
  --text-muted: #888;
  --accent: #E8A020;
  --accent-light: #F0B040;
  --accent-glow: rgba(232, 160, 32, 0.12);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* Navigation */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  max-width: 1100px;
  margin: 0 auto;
}
.logo {
  font-family: 'Fraunces', serif;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.5px;
}
.logo span { color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* Page header */
.page-header {
  text-align: center;
  margin-bottom: 40px;
}
.page-header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 5vw, 42px);
  font-weight: 700;
  letter-spacing: -1px;
  margin-bottom: 8px;
}
.page-header p {
  color: var(--text-muted);
  font-size: 16px;
}

/* Buttons */
.btn-primary {
  display: inline-block;
  padding: 14px 28px;
  background: var(--accent);
  color: #000;
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 16px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn-primary:hover {
  background: var(--accent-light);
  transform: translateY(-1px);
}
.btn-secondary {
  display: inline-block;
  padding: 14px 28px;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 500;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.btn-secondary:hover {
  border-color: #444;
  background: var(--surface2);
}

/* Puzzle page */
.puzzle-page { max-width: 1000px; margin: 0 auto; }
.puzzle-header { text-align: center; margin-bottom: 32px; }
.puzzle-header h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  margin-bottom: 8px;
}
.puzzle-meta { color: var(--text-muted); font-size: 14px; }
.back-link {
  color: var(--accent);
  font-size: 14px;
  display: inline-block;
  margin-bottom: 16px;
}
.back-link:hover { text-decoration: underline; }

/* Puzzle layout */
.puzzle-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  align-items: start;
}

/* Grid container */
.grid-container {
  background: white;
  border-radius: 12px;
  padding: 16px;
  display: flex;
  justify-content: center;
  overflow: auto;
}
.crossword-grid {
  display: inline-grid;
  gap: 0;
  border: 2px solid #333;
}
.grid-cell {
  width: var(--cell-size, 28px);
  height: var(--cell-size, 28px);
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: white;
  cursor: pointer;
}
.grid-cell.black {
  background: #222;
  cursor: default;
}
.grid-cell .number {
  position: absolute;
  top: 1px;
  left: 2px;
  font-size: 8px;
  color: #666;
  line-height: 1;
}
.grid-cell input {
  width: 100%;
  height: 100%;
  border: none;
  text-align: center;
  font-size: calc(var(--cell-size, 28px) * 0.55);
  font-weight: 600;
  text-transform: uppercase;
  background: transparent;
  outline: none;
  color: #333;
  caret-color: var(--accent);
  padding: 0;
}
.grid-cell input:focus {
  background: rgba(232, 160, 32, 0.15);
}

/* Clues */
.clues-container { max-height: 600px; overflow-y: auto; }
.clues-section { margin-bottom: 24px; }
.clues-section h3 {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent);
}
.clue-list li {
  font-size: 14px;
  line-height: 1.6;
  padding: 4px 0;
  color: var(--text-muted);
}
.clue-list li strong { color: var(--text); }

/* Puzzle CTAs */
.puzzle-ctas {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 32px;
  flex-wrap: wrap;
}

/* Category sections */
.category-section { margin-bottom: 40px; }
.category-title {
  font-family: 'Fraunces', serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--accent);
}

/* Puzzle grid (directory) */
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.puzzle-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.2s;
  display: block;
}
.puzzle-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.puzzle-card-icon { font-size: 24px; margin-bottom: 8px; }
.puzzle-card h3 {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}
.puzzle-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Subscribe form */
.subscribe-form {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 24px;
  text-align: center;
  margin-top: 40px;
}
footer p { color: #444; font-size: 13px; }
footer a { color: #666; transition: color 0.2s; }
footer a:hover { color: var(--accent); }

/* Mobile */
@media (max-width: 768px) {
  .puzzle-layout {
    grid-template-columns: 1fr;
  }
  .clues-container {
    max-height: none;
  }
  .puzzle-grid {
    grid-template-columns: 1fr;
  }
}

/* Print mode */
@media print {
  nav, footer, .puzzle-ctas, .back-link, .subscribe-form { display: none !important; }
  body { background: white; color: black; }
  .grid-container { border: none; padding: 0; }
}
