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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #ccc8be;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 56px 16px 48px;
}

/* ─── Wall + whiteboard ─── */

.wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  width: 100%;
  max-width: 920px;
}

.whiteboard {
  background: #fafafa;
  border: 9px solid #1c1c1c;
  border-radius: 3px;
  box-shadow:
    0 0 0 2px #444,
    0 16px 56px rgba(0,0,0,0.32),
    0 4px 12px rgba(0,0,0,0.18);
  width: 100%;
  padding: 28px 32px 0;
  position: relative;
}

/* ─── Header ─── */

.board-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.title-main {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.title-sub {
  display: block;
  font-size: 0.82rem;
  color: #666;
  margin-top: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.word-count {
  display: flex;
  align-items: baseline;
  gap: 5px;
  font-size: 0.95rem;
}

.wc-label  { color: #444; font-weight: 500; }
.wc-sep    { color: #444; font-weight: 700; }
.wc-goal   { color: #444; font-weight: 600; }

.wc-current {
  color: #dc2626;
  font-weight: 800;
  font-size: 1.35rem;
  font-variant-numeric: tabular-nums;
}

/* ─── Progress bar ─── */

.progress-track {
  height: 8px;
  background: #e4e4e4;
  border-radius: 4px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #2563eb 0%, #16a34a 50%, #dc2626 100%);
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-pct {
  position: absolute;
  right: 6px;
  top: -18px;
  font-size: 0.72rem;
  color: #888;
}

/* ─── Progress grid ─── */

.grid-wrap {
  overflow-x: auto;
  margin: 0 -32px;
  padding: 0 32px;
}

.grid {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
  table-layout: fixed;
}

.grid th,
.grid td {
  padding: 9px 6px;
  text-align: center;
  border: 1.5px solid #d1d1d1;
}

/* Column headers */
.grid thead th {
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.05em;
  background: #f4f4f4;
  padding: 10px 4px;
}

.grid thead th.col-int,
.grid thead th.col-con  { color: #1a1a1a; }
.grid thead th.col-blue  { color: #2563eb; }
.grid thead th.col-green { color: #16a34a; }
.grid thead th.col-red   { color: #dc2626; }

/* Row label cell */
.grid tbody td.row-label {
  font-weight: 600;
  font-size: 0.82rem;
  text-align: right;
  padding-right: 14px;
  color: #333;
  white-space: nowrap;
  border-right: 2.5px solid #888;
  background: #f4f4f4;
  width: 72px;
}

/* Data cells */
.grid tbody td.cell {
  font-size: 1.25rem;
  line-height: 1;
  transition: background 0.12s;
  user-select: none;
}

.grid tbody td.cell.checked-int   { color: #1a1a1a; }
.grid tbody td.cell.checked-blue  { color: #2563eb; }
.grid tbody td.cell.checked-green { color: #16a34a; }
.grid tbody td.cell.checked-red   { color: #dc2626; }

/* Admin mode: cells become interactive */
body.admin-mode .grid tbody td.cell {
  cursor: pointer;
}

body.admin-mode .grid tbody td.cell:hover {
  background: #f0f0f0;
}

/* ─── Board footer & tray ─── */

.board-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0 12px;
}

.footer-note {
  font-size: 0.74rem;
  color: #bbb;
}

.lock-icon {
  font-size: 0.74rem;
}

.admin-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.22;
  transition: opacity 0.2s;
  padding: 2px 4px;
  line-height: 1;
}

.admin-btn:hover  { opacity: 0.55; }
body.admin-mode .admin-btn { opacity: 0.7; }

/* Decorative marker tray */
.board-tray {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 6px;
  height: 20px;
  background: #888;
  margin: 0 -32px;
  padding: 3px 18px;
  border-top: 2px solid #555;
}

.marker {
  width: 10px;
  height: 14px;
  border-radius: 2px 2px 0 0;
}
.marker.black { background: #1a1a1a; }
.marker.blue  { background: #2563eb; }
.marker.green { background: #16a34a; }
.marker.red   { background: #dc2626; }

.eraser {
  width: 22px;
  height: 12px;
  background: #f0ede8;
  border-radius: 2px;
  border: 1px solid #ccc;
  margin-left: 4px;
}

/* ─── Email signup (placeholder) ─── */

.signup-section {
  text-align: center;
  color: #aaa;
}

.signup-heading {
  font-size: 0.92rem;
  margin-bottom: 10px;
}

.signup-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 6px;
}

.email-input {
  padding: 9px 14px;
  border-radius: 7px;
  border: 1.5px solid #d0d0d0;
  font-size: 0.88rem;
  width: 200px;
  background: #e8e4dc;
  color: #aaa;
  cursor: not-allowed;
}

.email-btn {
  padding: 9px 16px;
  background: #c4c0b8;
  border: none;
  border-radius: 7px;
  font-size: 0.88rem;
  color: #f5f5f5;
  cursor: not-allowed;
}

.signup-note {
  font-size: 0.75rem;
  color: #c0c0c0;
}

/* ─── Admin password modal ─── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
}

.modal-overlay.visible { display: flex; }

.modal {
  background: #fff;
  border-radius: 12px;
  padding: 28px 28px 24px;
  width: 340px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.28);
}

.modal h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #1a1a1a;
}

.modal input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #d0d0d0;
  border-radius: 7px;
  font-size: 0.88rem;
  font-family: monospace;
  letter-spacing: 0.08em;
  color: #1a1a1a;
  margin-bottom: 6px;
}

.modal input[type="password"]:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

.modal-error {
  font-size: 0.8rem;
  color: #dc2626;
  min-height: 20px;
  margin-bottom: 14px;
}

.modal-buttons {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.modal-buttons button {
  padding: 8px 18px;
  border-radius: 7px;
  border: none;
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 500;
}

.modal-buttons button:first-child {
  background: #f3f4f6;
  color: #444;
}

.modal-buttons button:first-child:hover { background: #e5e7eb; }

.btn-primary {
  background: #2563eb;
  color: #fff;
}

.btn-primary:hover { background: #1d4ed8; }

/* ─── Floating admin edit panel ─── */

.edit-panel {
  display: none;
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1c1c1c;
  color: #fff;
  border-radius: 10px;
  padding: 16px 18px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  z-index: 100;
  flex-direction: column;
  gap: 12px;
  min-width: 220px;
}

.edit-panel.visible { display: flex; }

.edit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}

.edit-row label { color: #ccc; white-space: nowrap; }

.edit-row input[type="number"] {
  width: 90px;
  padding: 6px 8px;
  border-radius: 5px;
  border: none;
  font-size: 0.85rem;
  color: #1a1a1a;
  font-variant-numeric: tabular-nums;
}

.btn-save {
  padding: 6px 12px;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  background: #2563eb;
  color: #fff;
}

.btn-save:hover { background: #1d4ed8; }

.btn-lock {
  padding: 7px 12px;
  background: #3a3a3a;
  color: #ccc;
  font-size: 0.82rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  text-align: left;
}

.btn-lock:hover { background: #4a4a4a; }

/* ─── Responsive ─── */

@media (max-width: 600px) {
  body { padding: 24px 8px 40px; }

  .whiteboard { padding: 20px 16px 0; }
  .grid-wrap  { margin: 0 -16px; padding: 0 16px; }
  .board-tray { margin: 0 -16px; padding: 3px 12px; }

  .title-main  { font-size: 1.2rem; }
  .wc-current  { font-size: 1.1rem; }

  .edit-panel {
    bottom: 12px;
    right: 12px;
    left: 12px;
  }
}
