/* fillable.css — turns the static workbook into an editable, autosaving tool.
   Pairs with fillable.js. Layered on top of style.css (light working surface). */

:root {
  --wb-amber: #f59e0b;
  --wb-amber-300: #fcd34d;
  --wb-ink: #111111;
  --wb-green: #4ade80;
}

/* editable cells (.fill divs + bare placeholder table cells) */
.editable {
  outline: none;
  cursor: text;
  transition: box-shadow 120ms ease, background 120ms ease;
  min-width: 1em;
}
.editable:hover { background: #fffaf0; }
.editable:focus {
  box-shadow: inset 0 0 0 2px var(--wb-amber);
  background: #fffdf5;
  border-radius: 4px;
}
/* CSS-only placeholder — shows the hint, stores nothing */
.editable:empty:before {
  content: attr(data-ph);
  color: #b3b3b3;
  font-style: italic;
  pointer-events: none;
}
td.editable { min-width: 2.5em; }

/* sticky toolbar */
#wb-toolbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--wb-ink); color: #fff;
  padding: 10px 18px; margin: 0 0 24px; border-radius: 0 0 12px 12px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 0.9rem;
  box-shadow: 0 6px 24px -10px rgba(0,0,0,0.5);
}
#wb-toolbar .left, #wb-toolbar .right { display: flex; align-items: center; gap: 14px; }
#wb-toolbar .brand img { height: 22px; width: auto; display: block; filter: invert(1); }
#wb-progress { font-variant-numeric: tabular-nums; color: var(--wb-amber-300); font-weight: 600; white-space: nowrap; }
#wb-bar { width: 150px; height: 6px; background: #1f2937; border-radius: 999px; overflow: hidden; }
#wb-bar > i { display: block; height: 100%; width: 0; background: var(--wb-amber); transition: width 300ms ease; }
#wb-status { color: #9ca3af; white-space: nowrap; }
#wb-status.saving { color: var(--wb-amber-300); }
#wb-status.saved { color: var(--wb-green); }

.wb-btn {
  background: transparent; border: 1px solid #374151; color: #fff;
  padding: 6px 13px; border-radius: 7px; cursor: pointer; font-size: 0.85rem;
  font-family: inherit; transition: border-color 120ms ease, color 120ms ease;
}
.wb-btn:hover { border-color: var(--wb-amber); color: var(--wb-amber-300); }
.wb-btn.primary { background: var(--wb-amber); color: var(--wb-ink); border-color: var(--wb-amber); font-weight: 700; }
.wb-btn.primary:hover { background: var(--wb-amber-300); color: var(--wb-ink); }

@media (max-width: 640px) {
  #wb-bar { display: none; }
  #wb-toolbar { padding: 8px 12px; gap: 10px; font-size: 0.82rem; }
}

/* privacy badge (light working surface) */
.privacy-badge {
  display: inline-block; margin: 0 0 20px; padding: 9px 15px; border-radius: 9px;
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  font-size: 0.88rem; font-weight: 500; line-height: 1.45;
}
.privacy-badge strong { font-weight: 700; }

/* share toast */
.wb-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 14px);
  background: var(--wb-ink); color: #fff; padding: 11px 20px; border-radius: 10px;
  font-family: 'Inter', system-ui, sans-serif; font-size: 0.9rem; font-weight: 600;
  border: 1px solid #374151; box-shadow: 0 10px 30px -10px rgba(0,0,0,0.6);
  opacity: 0; transition: opacity 240ms ease, transform 240ms ease; z-index: 100; pointer-events: none;
}
.wb-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- L3 defender scoring ---- */
.score-in {
  width: 3em; padding: 4px 2px; text-align: center;
  border: 1px solid #d8d8d8; border-radius: 6px; font: inherit; font-size: 0.95rem;
  -moz-appearance: textfield;
}
.score-in:focus { outline: none; border-color: var(--wb-amber); box-shadow: 0 0 0 2px rgba(245,158,11,0.25); }
.total-cell { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.verdict-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.02em;
}
.verdict-chip.safe { background: #dcfce7; color: #166534; }
.verdict-chip.caution { background: #fef3c7; color: #92400e; }
.verdict-chip.kill { background: #fee2e2; color: #991b1b; }

.def-summary {
  margin: 14px 0 26px; padding: 12px 16px; border-radius: 10px; font-size: 0.92rem;
  border-left: 4px solid #d1d5db; background: #f6f6f6;
}
.def-summary.warn { border-left-color: #ef4444; background: #fef2f2; }
.def-summary.ok { border-left-color: #22c55e; background: #f0fdf4; }
.def-summary.neutral { color: #6b7280; }

/* ---- "your defended pick" scoreboard ---- */
#wb-scoreboard {
  background: var(--wb-ink); color: #fff; border-radius: 12px;
  padding: 18px 20px; margin: 0 0 28px;
  font-family: 'Inter', system-ui, sans-serif;
  box-shadow: 0 10px 30px -14px rgba(0,0,0,0.5);
}
#wb-scoreboard .sb-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
#wb-scoreboard .sb-title { font-size: 0.8rem; letter-spacing: 0.16em; text-transform: uppercase; color: #fcd34d; font-weight: 700; }
#wb-scoreboard .sb-note { font-size: 0.74rem; color: #9ca3af; }
#wb-scoreboard .pick { font-size: 1.05rem; color: #fff; margin: 4px 0 14px; line-height: 1.5; }
#wb-scoreboard .pick-name { color: #fbbf24; font-weight: 800; }
.sb-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.sb-table th { text-align: left; color: #9ca3af; font-weight: 600; font-size: 0.76rem; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 8px; border-bottom: 1px solid #1f2937; }
.sb-table td { padding: 7px 8px; border-bottom: 1px solid #1a1a1a; color: #e5e7eb; }
.sb-table td.cn { font-weight: 600; color: #fff; }
.sb-table .m { font-weight: 800; }
.sb-table .m.ok { color: #4ade80; }
.sb-table .m.no { color: #f87171; }
.sb-table .m.und { color: #6b7280; }
.sb-table .status { font-size: 0.78rem; font-weight: 700; padding: 1px 9px; border-radius: 999px; }
.sb-table .status.fin { background: #064e3b; color: #6ee7b7; }
.sb-table .status.cut { background: #3f1d1d; color: #fca5a5; }
.sb-table .status.inc { background: #1f2937; color: #9ca3af; }

/* print: hide the chrome, show answers cleanly */
@media print {
  #wb-toolbar { display: none; }
  #wb-scoreboard { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .editable:focus { box-shadow: none; background: transparent; }
  .editable:empty:before { content: ""; }
  .score-in { border: none; }
}
