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

/*
  Warm yellow palette (lightest → deepest):
  #fdf9ea  surface   — cards, header, group headers
  #f7f0d0  canvas    — page background
  #ede5b5  inset     — workbench panels
  #e2d68e  field     — filled inputs, code, hover states
  Borders: light #e4dab8 / medium #d4c68a / heavy #c4b870
*/

/* ── Base ── */
body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: #f7f0d0;
  color: #1a1a1b;
  min-height: 100vh;
}

a { color: inherit; }

/* ── Site header ── */
.site-header {
  background: #fdf9ea;
  border-bottom: 1px solid #d4c68a;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header__brand h1 {
  font-size: 1.45rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  line-height: 1.1;
}

.brand-cap { color: #60b868; }

.site-header__brand p {
  font-size: 0.78rem;
  color: #777;
  margin-top: 0.1rem;
}

/* ── Nav ── */
.site-nav { display: flex; gap: 1.25rem; }

.nav-link {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #555;
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-link:hover,
.nav-link.active { color: #1a1a1b; border-bottom-color: #1a1a1b; }

/* ── Accordion ── */
.accordion {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.accordion-section {
  background: #fdf9ea;
  border: 1px solid #d4c68a;
  border-radius: 10px;
  overflow: hidden;
}

.accordion-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.accordion-summary::-webkit-details-marker { display: none; }

.accordion-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1;
}

.accordion-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #c4b870;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 900;
  flex-shrink: 0;
  transition: background 0.2s;
}

.accordion-section[open] .accordion-num { background: #1a1a1b; }

.accordion-status {
  font-size: 0.72rem;
  font-weight: 700;
  color: #aaa;
  white-space: nowrap;
}

.accordion-status.status--complete { color: #60b868; }

/* CSS chevron — rotates on open */
.accordion-chevron {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid #b0a060;
  border-bottom: 2px solid #b0a060;
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.22s ease;
  flex-shrink: 0;
}

.accordion-section[open] .accordion-chevron {
  transform: rotate(-135deg) translateY(-2px);
}

/* ── Accordion body ── */
.accordion-body {
  border-top: 1px solid #e4dab8;
  padding: 1.5rem;
  animation: bodyFadeIn 0.18s ease;
}

/* Workbench body has no padding — the workspace provides its own */
.accordion-body--workspace { padding: 0; }

@keyframes bodyFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

/* ── Shared entry layout (sections 1 & 2) ── */
.entry-body {
  max-width: 520px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Instructions ── */
.instructions-list {
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.instructions-list li {
  font-size: 0.88rem;
  line-height: 1.65;
  color: #333;
}

/* Inline difficulty chips */
.chip {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
  vertical-align: middle;
  margin: 0 1px;
}
.chip.yellow { background: #f9df6d; color: #5a4400; }
.chip.green  { background: #60b868; color: #fff; }
.chip.blue   { background: #5ba4cf; color: #fff; }
.chip.purple { background: #9b59d0; color: #fff; }

/* ── Section hints ── */
.section-hint {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #999;
}

/* ── Word grid ── */
.word-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
}

.word-input {
  min-width: 0;        /* prevents inputs overflowing grid columns */
  width: 100%;
  padding: 0.65rem 0.25rem;
  border: 2px solid #d4c68a;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: #fdf9ea;
  transition: border-color 0.15s, background 0.15s;
}

.word-input::placeholder { color: #c0b470; font-weight: 400; text-transform: none; letter-spacing: 0; }
.word-input:focus { outline: none; border-color: #1a1a1b; }
.word-input.filled { background: #e2d68e; border-color: #c4b870; }

/* ── OR divider ── */
.or-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: #b0a060;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
}
.or-divider::before,
.or-divider::after { content: ''; flex: 1; height: 1px; background: #e4dab8; }

/* ── Bulk entry ── */
.bulk-wrap { position: relative; }

.bulk-input {
  width: 100%;
  padding: 0.6rem 0.75rem 1.6rem;
  border: 2px solid #d4c68a;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.6;
  resize: vertical;
  background: #fdf9ea;
  transition: border-color 0.15s;
}
.bulk-input:focus { outline: none; border-color: #1a1a1b; }

.bulk-count {
  position: absolute;
  bottom: 0.45rem;
  right: 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #b0a060;
  pointer-events: none;
}
.bulk-count.complete { color: #60b868; }

/* ── Buttons ── */
button { font-family: inherit; cursor: pointer; }

.btn-primary {
  align-self: flex-start;
  background: #1a1a1b;
  color: #fff;
  border: none;
  padding: 0.75rem 1.75rem;
  border-radius: 30px;
  font-size: 0.88rem;
  font-weight: 700;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary:disabled { opacity: 0.3; cursor: not-allowed; }
.btn-primary:not(:disabled):hover { background: #3a3a3b; }

.btn-secondary {
  background: none;
  border: 2px solid #1a1a1b;
  border-radius: 20px;
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background 0.15s;
}
.btn-secondary:hover { background: #e2d68e; }

/* ── Workbench layout ── */
.workspace {
  display: flex;
  gap: 1.25rem;
  padding: 1.25rem;
  align-items: flex-start;
}

.btn-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.workbench-footer {
  padding: 0.75rem 1.25rem 1rem;
  border-top: 1px solid #e4dab8;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
}

/* ── Panels ── */
.panel {
  background: #ede5b5;
  border: 1px solid #d4c68a;
  border-radius: 10px;
  padding: 1rem;
}
.left-panel  { flex: 1; }
.right-panel { flex: 1; }

.panel-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #8a7a40;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

/* ── Tile grid ── */
.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
  align-items: start;  /* tiles size themselves, not the container */
  min-height: 2.75rem; /* keeps empty drop zones droppable */
}

/* ── Tiles ── */
.tile {
  background: #1a1a1b;
  color: #fff;
  padding: 0.7rem 0.3rem;
  min-height: 2.75rem;  /* uniform height across both panels */
  border-radius: 6px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  cursor: grab;
  user-select: none;
  word-break: break-word;
  line-height: 1.2;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.1s, opacity 0.15s, transform 0.1s;
}
.tile:hover  { background: #3a3a3b; }
.tile:active { cursor: grabbing; transform: scale(0.97); }
.tile.dragging { opacity: 0.35; }

/* Subtle ring hints that double-click is available */
.tile--in-group:hover { box-shadow: inset 0 0 0 2px rgba(255,255,255,0.25); }

/* ── Drop zones ── */
.drop-zone {
  border-radius: 6px;
  transition: background 0.12s, outline 0.12s;
}
.drop-zone.drag-over {
  background: #d8edf8;
  outline: 2px dashed #5ba4cf;
}

/* ── Groups ── */
#groups-container { display: flex; flex-direction: column; gap: 0.75rem; }

/* Group is a borderless flex-column so its tile-grid spans the full panel width,
   matching the source grid on the left and producing identical tile sizes. */
.group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

/* The card styling (background, border, colour indicator) lives on the header only */
.group-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fdf9ea;
  border: 1px solid #d4c68a;
  border-left: 5px solid #d4c68a;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  transition: border-left-color 0.2s;
}
.group-header[data-color="yellow"] { border-left-color: #f9df6d; }
.group-header[data-color="green"]  { border-left-color: #60b868; }
.group-header[data-color="blue"]   { border-left-color: #5ba4cf; }
.group-header[data-color="purple"] { border-left-color: #9b59d0; }

.group-name {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.55rem;
  border: 1px solid #d4c68a;
  border-radius: 5px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  background: #fdf9ea;
}
.group-name:focus { outline: none; border-color: #1a1a1b; }

/* ── Colour picker ── */
.color-picker { display: flex; gap: 5px; flex-shrink: 0; }

.color-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.1s, border-color 0.1s;
}
.color-btn:hover { transform: scale(1.15); }
.color-btn.yellow { background: #f9df6d; }
.color-btn.green  { background: #60b868; }
.color-btn.blue   { background: #5ba4cf; }
.color-btn.purple { background: #9b59d0; }
.color-btn.selected { border-color: #1a1a1b; transform: scale(1.2); }

.group .tile-grid { min-height: 2.75rem; }

/* ── About page ── */
.about-main {
  max-width: 680px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 4rem;
}
.about-content { display: flex; flex-direction: column; gap: 1rem; }
.about-content p,
.about-content li { font-size: 0.95rem; line-height: 1.7; color: #333; }
.about-content a { text-decoration: underline; }

.about-heading {
  font-size: 1rem;
  font-weight: 800;
  margin-top: 1rem;
}

.site-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  font-size: 0.72rem;
  color: #8a7a40;
  line-height: 1.6;
  border-top: 1px solid #d4c68a;
}

.about-disclaimer {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d4c68a;
  font-size: 0.82rem;
  color: #888;
  line-height: 1.7;
}
.about-steps,
.about-tips { padding-left: 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; }

.about-content code {
  background: #e2d68e;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.88em;
  font-family: 'Courier New', monospace;
}

.about-cta { margin-top: 1.5rem; }
.cta-btn {
  display: inline-block;
  background: #1a1a1b;
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 1.75rem;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  transition: background 0.15s;
}
.cta-btn:hover { background: #3a3a3b; }

/* ── Responsive ── */
@media (max-width: 680px) {
  .workspace { flex-direction: column; padding: 0.75rem; gap: 0.75rem; }
  .left-panel, .right-panel { flex: none; width: 100%; }
  .tile { font-size: 0.65rem; padding: 0.6rem 0.2rem; }
  .accordion { padding: 0.75rem 0.5rem 2rem; }
}
