/* Daily Cybersecurity Crossword — crossword.css */

#dccp-root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  max-width: 900px;
  margin: 0 auto;
  padding: 12px;
  box-sizing: border-box;
  color: #1a1a1a;
}

/* Header */
.dccp-header {
  text-align: center;
  margin-bottom: 18px;
}
.dccp-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #111;
}
.dccp-date {
  font-size: 0.85rem;
  color: #666;
}

/* Loading / error states */
.dccp-loading, .dccp-error {
  text-align: center;
  padding: 40px 20px;
  color: #555;
  font-size: 1rem;
}
.dccp-error { color: #c0392b; }

/* Layout: grid left, clues right */
.dccp-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  flex-wrap: wrap;
}

/* --- Grid --- */
.dccp-grid-wrap {
  flex: 0 0 auto;
  overflow-x: auto;
}
.dccp-grid {
  display: grid;
  border: 2px solid #111;
  width: fit-content;
  line-height: 0;
}
.dccp-cell {
  width: 34px;
  height: 34px;
  border: 1px solid #ccc;
  position: relative;
  box-sizing: border-box;
  background: #fff;
}
.dccp-cell.black {
  background: #111;
  border-color: #111;
}
.dccp-cell-num {
  position: absolute;
  top: 2px;
  left: 2px;
  font-size: 9px;
  line-height: 1;
  color: #444;
  pointer-events: none;
  user-select: none;
}
.dccp-cell input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  caret-color: transparent;
  cursor: pointer;
  padding: 0;
  outline: none;
  color: #1a1a1a;
}
.dccp-cell.selected { background: #b8d4f7; }
.dccp-cell.highlighted { background: #d9eaff; }
.dccp-cell.correct { background: #d4edda; }
.dccp-cell.incorrect { background: #f8d7da; }
.dccp-cell.correct input,
.dccp-cell.incorrect input { pointer-events: none; }

/* --- Clues panel --- */
.dccp-clues {
  flex: 1 1 260px;
  min-width: 220px;
}
.dccp-clue-section {
  margin-bottom: 20px;
}
.dccp-clue-section h3 {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #444;
  margin: 0 0 8px;
  border-bottom: 2px solid #111;
  padding-bottom: 4px;
}
.dccp-clue-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.dccp-clue-list li {
  display: flex !important;
  gap: 8px;
  font-size: 1.15rem !important;
  font-family: Georgia, "Times New Roman", serif !important;
  padding: 6px 8px;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1.6;
  transition: background 0.1s;
  visibility: visible !important;
}
.dccp-clue-list li:hover { background: #f0f0f0; }
.dccp-clue-list li.active { background: #b8d4f7; font-weight: 600; }
.dccp-clue-num {
  font-weight: 700;
  min-width: 26px;
  color: #000;
  font-family: Georgia, "Times New Roman", serif;
}
.dccp-clue-text { color: #111; }
.dccp-clue-list li.solved .dccp-clue-text {
  text-decoration: line-through;
  color: #888;
}

/* --- Controls --- */
.dccp-controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
#dccp-root .dccp-btn {
  padding: 7px 16px !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: 5px !important;
  border: 1.5px solid #666 !important;
  background: #f5f5f5 !important;
  color: #1a1a1a !important;
  cursor: pointer !important;
  transition: background 0.15s, border-color 0.15s !important;
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  text-decoration: none !important;
  line-height: normal !important;
}
#dccp-root .dccp-btn:hover {
  background: #e0e0e0 !important;
  border-color: #333 !important;
  color: #1a1a1a !important;
}
#dccp-root .dccp-btn.primary {
  background: #1a1a1a !important;
  color: #fff !important;
  border-color: #1a1a1a !important;
}
#dccp-root .dccp-btn.primary:hover {
  background: #333 !important;
  color: #fff !important;
}
#dccp-root .dccp-btn.hint {
  border-color: #c8860a !important;
  color: #7a5200 !important;
  background: #fff8ec !important;
}
#dccp-root .dccp-btn.hint:hover {
  background: #fff0cc !important;
  border-color: #a06800 !important;
  color: #7a5200 !important;
}
.dccp-cell.hint-revealed { background: #fff3cd; }
.dccp-cell.hint-revealed input { color: #7a5200; }

/* Completion banner */
.dccp-complete {
  text-align: center;
  padding: 18px;
  background: #d4edda;
  border: 1.5px solid #28a745;
  border-radius: 8px;
  margin-top: 16px;
  font-size: 1.1rem;
  font-weight: 600;
  color: #155724;
  display: none;
}
.dccp-complete.visible { display: block; }

/* Responsive */
@media (max-width: 640px) {
  .dccp-layout { flex-direction: column; }
  .dccp-cell { width: 28px; height: 28px; }
  .dccp-cell input { font-size: 13px; }
  .dccp-cell-num { font-size: 8px; }
}
