*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  background: #0f0f1a;
  color: #e0e0e0;
  padding: 20px 28px;
  min-height: 100vh;
}

/* ── HINT BANNER ── */
.hint-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #1e1b40;
  border: 1px solid #7c3aed;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
  color: #a78bfa;
  width: fit-content;
  margin-bottom: 16px;
}
.hint-close {
  background: none;
  border: none;
  color: #555;
  font-size: 1.1rem;
  cursor: pointer;
  line-height: 1;
  padding: 0 2px;
}
.hint-close:hover { color: #fff; }

/* ── HEADER ── */
.page-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-header h1 {
  font-size: 1.15rem;
  color: #a78bfa;
  letter-spacing: 0.05em;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn {
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: opacity 0.15s;
}
.btn:hover { opacity: 0.85; }
.btn-primary  { background: #7c3aed; color: #fff; }
.btn-secondary { background: #1e1e35; color: #a78bfa; border: 1.5px solid #7c3aed; }
.btn-success  { background: #059669; color: #fff; }

/* ── STATUS INDICATOR ── */
.status-indicator { display: flex; align-items: center; gap: 6px; font-size: 0.75rem; color: #888; }
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #555;
  transition: background 0.3s;
}
.status-dot.generating { background: #f59e0b; animation: pulse 1s infinite; }
.status-dot.ready      { background: #059669; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.35} }

/* ── COLUMN HEADERS ── */
.col-headers {
  display: flex;
  margin-left: 114px;
  gap: 4px;
  margin-bottom: 4px;
}
.col-header {
  width: 100px;
  text-align: center;
  font-size: 0.68rem;
  color: #555;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── GRID ── */
.grid-wrapper { display: flex; flex-direction: column; gap: 4px; }

.grid-row { display: flex; align-items: center; gap: 4px; }

.row-label {
  width: 110px;
  font-size: 0.68rem;
  font-weight: 700;
  color: #7c3aed;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
  text-align: right;
  padding-right: 8px;
}

.grid-cell {
  width: 100px; height: 100px;
  background: #16162a;
  border: 2px solid #2a2a45;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, background 0.15s;
}
.grid-cell.filled    { border-color: #3d2a70; }
.grid-cell.drag-over { border-color: #a78bfa; background: #1e1b40; }
.grid-cell.starter   { border-color: #7c3aed; background: #1e1a40; }
.grid-cell.correct   { border-color: #059669; }
.grid-cell.wrong     { border-color: #dc2626; }

.grid-cell img {
  width: 72px; height: 72px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.cell-tooltip {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: rgba(0,0,0,0.75);
  font-size: 0.58rem; text-align: center;
  padding: 2px 4px; color: #ccc;
  border-radius: 0 0 6px 6px;
  opacity: 0; transition: opacity 0.15s;
  pointer-events: none;
}
.grid-cell:hover .cell-tooltip { opacity: 1; }

/* ── STRIP DIVIDER ── */
.strip-divider {
  width: 2px; align-self: stretch;
  background: #252540;
  margin: 0 6px;
  border-radius: 1px;
  flex-shrink: 0;
}

/* ── ICON STRIP ── */
.icon-strip { display: flex; align-items: center; gap: 6px; }

.strip-icon {
  width: 52px; height: 52px;
  background: #1a1a30;
  border: 1.5px solid #2a2a45;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  cursor: grab;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.15s, opacity 0.2s;
}
.strip-icon:hover:not(.used) { border-color: #a78bfa; }
.strip-icon.used { opacity: 0.22; cursor: default; pointer-events: none; }
.strip-icon img {
  width: 38px; height: 38px;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.strip-tooltip {
  position: absolute; top: -28px; left: 50%;
  transform: translateX(-50%);
  background: #2a2060; border: 1px solid #7c3aed;
  border-radius: 4px; padding: 2px 6px;
  font-size: 0.62rem; white-space: nowrap; color: #e0e0e0;
  pointer-events: none;
  opacity: 0; transition: opacity 0.15s;
  z-index: 10;
}
.strip-icon:hover .strip-tooltip { opacity: 1; }

/* ── PUZZLE AREA LAYOUT ── */
#puzzle-area {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}
#grid-block { flex-shrink: 0; }

/* ── NOTES PANEL ── */
#notes-panel {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: stretch;
  min-width: 180px;
  width: 220px;
}
.notes-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
#notes {
  flex: 1;
  background: #16162a;
  border: 1.5px solid #2a2a45;
  border-radius: 8px;
  color: #c0c0d8;
  font-family: system-ui, sans-serif;
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 10px 12px;
  resize: none;
  outline: none;
  min-height: 200px;
}
#notes:focus { border-color: #7c3aed; }
#notes::placeholder { color: #3a3a55; }

/* ── CLUES ── */
.clues-section { margin-top: 18px; }
.clues-label {
  font-size: 0.68rem; font-weight: 700; color: #444;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 8px;
}
.clues-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 6px;
}
.clue {
  background: #16162a; border: 1px solid #222238;
  border-radius: 6px; padding: 7px 12px;
  font-size: 0.78rem; color: #aaa; line-height: 1.45;
}
.clue-num { color: #7c3aed; font-weight: 700; margin-right: 4px; font-size: 0.7rem; }
.clue.satisfied { opacity: 0.35; text-decoration: line-through; }
.clue.hint      { border-color: #d97706; background: #1c1810; color: #fbbf24; }

/* ── SOLVED BANNER ── */
.solved-banner {
  margin-top: 20px;
  background: linear-gradient(135deg, #1a3329, #0f2520);
  border: 1.5px solid #059669;
  border-radius: 10px;
  padding: 16px 22px;
  text-align: center;
}
.solved-banner h2 { color: #34d399; font-size: 1.1rem; margin-bottom: 6px; }
.solved-banner p  { font-size: 0.8rem; color: #6ee7b7; margin-bottom: 12px; }

/* ── FULL-PAGE DROP ZONE (behind content) ── */
.drop-zone {
  position: fixed; inset: 0;
  z-index: -1;
  pointer-events: none;
}
.drop-zone.active { pointer-events: all; }

/* ── UTILITIES ── */
.hidden { display: none !important; }
