/* STACKBOARD — styles.css · Level 56
   Arcade-dark, legible. Pixel type in the chrome/HUD labels; clean utilitarian
   working surface for the board itself. Columns are bento-style surfaces with
   layered depth; cards have a left color-stripe label system. */

@font-face { font-family: "Press Start 2P"; font-style: normal; font-weight: 400; font-display: swap; src: url("/press-start-2p.woff2") format("woff2"); }
@font-face { font-family: "Press Start 2P Fallback"; src: local("Courier New"); size-adjust: 166.64%; ascent-override: 60%; descent-override: 0%; line-gap-override: 0%; }

:root {
  --bg: #0a0a12;
  --surface: #12121d;
  --surface-2: #1a1a2a;
  --line: #28283c;
  --control-line: #5e5e80;
  --text: #e9e9f2;
  --dim: #9aa0b5;
  --cyan: #45f0ff;
  --magenta: #ff3d8b;
  --gold: #ffc857;
  --green: #41ff8b;
  --red: #ff5560;

  --pixel: "Press Start 2P", "Press Start 2P Fallback", "Courier New", monospace;
  --body: -apple-system, "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 10px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --glow-cyan: 0 0 14px rgba(69, 240, 255, 0.35);
  --space-gutter: clamp(14px, 4vw, 48px);
}

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 520px at 50% -10%, rgba(69, 240, 255, 0.06), transparent 70%),
    radial-gradient(900px 400px at 100% 0%, rgba(255, 61, 139, 0.04), transparent 70%),
    var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
::selection { background: rgba(69, 240, 255, 0.3); }
[hidden] { display: none !important; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -48px;
  z-index: 200;
  background: var(--cyan);
  color: #05050d;
  padding: 10px 16px;
  border-radius: 6px;
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.2s var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(60px); }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(69, 240, 255, 0.15);
}
a { color: var(--cyan); }

/* ---------- header chrome ---------- */
.site-header {
  padding: 26px var(--space-gutter) 10px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lab-link {
  align-self: flex-start;
  font-family: var(--pixel);
  font-size: 10px;
  color: var(--dim);
  text-decoration: none;
  padding: 6px 2px;
  transition: color 0.15s, text-shadow 0.15s;
}
.lab-link:hover { color: var(--cyan); text-shadow: var(--glow-cyan); }
.level {
  margin: 0;
  font-family: var(--pixel);
  font-size: 9px;
  letter-spacing: 3px;
  color: var(--gold);
}
.wordmark {
  position: relative;
  margin: 6px 0 4px;
  font-family: var(--pixel);
  font-size: clamp(20px, 4.4vw, 34px);
  letter-spacing: 3px;
  color: var(--text);
  text-shadow: 0 0 16px rgba(69, 240, 255, 0.5), 3px 3px 0 var(--magenta);
}
/* glitch wordmark */
.wordmark::before, .wordmark::after {
  content: attr(data-glitch);
  position: absolute;
  left: 0; top: 0;
  width: 100%;
  overflow: hidden;
  pointer-events: none;
}
.wordmark::before { color: var(--cyan); clip-path: inset(0 0 55% 0); animation: glitch-a 3.6s infinite steps(2); }
.wordmark::after { color: var(--magenta); clip-path: inset(60% 0 0 0); animation: glitch-b 4.2s infinite steps(2); }
@keyframes glitch-a { 0%, 92%, 100% { transform: translate(0); } 94% { transform: translate(-2px, 1px); } 96% { transform: translate(2px, -1px); } }
@keyframes glitch-b { 0%, 90%, 100% { transform: translate(0); } 93% { transform: translate(2px, -1px); } 97% { transform: translate(-2px, 1px); } }

.tagline {
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
}
.cursor { color: var(--cyan); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* ---------- layout ---------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px var(--space-gutter) 56px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

/* ---------- toolbar ---------- */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  align-items: center;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--surface), rgba(18, 18, 29, 0.4));
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.toolbar-group { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.toolbar-search { margin-left: auto; }
.tb-label {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--cyan);
  text-shadow: 0 0 8px rgba(69, 240, 255, 0.35);
}
.tb-select {
  background: var(--bg);
  border: 1px solid var(--control-line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 6px;
  min-height: 40px;
  max-width: 200px;
  cursor: pointer;
}
.search-wrap { position: relative; display: flex; align-items: center; }
.search-icon {
  position: absolute; left: 10px;
  color: var(--dim); font-size: 14px; pointer-events: none;
}
.tb-search {
  background: var(--bg);
  border: 1px solid var(--control-line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  padding: 8px 30px 8px 30px;
  border-radius: 999px;
  min-height: 40px;
  width: min(240px, 60vw);
}
.tb-search::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 6px;
  width: 26px; height: 26px;
  border: 0; border-radius: 50%;
  background: var(--surface-2);
  color: var(--dim);
  font-size: 18px; line-height: 1;
  cursor: pointer;
}
.search-clear:hover { color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.4px;
  padding: 10px 14px;
  min-height: 40px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s var(--ease-out), border-color 0.12s, box-shadow 0.12s, color 0.12s;
}
.btn:hover { border-color: var(--cyan); box-shadow: 0 0 12px rgba(69, 240, 255, 0.2); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-sm { font-size: 11px; padding: 8px 11px; min-height: 40px; }
.btn-primary { background: var(--cyan); border-color: var(--cyan); color: #05050d; }
.btn-primary:hover { box-shadow: 0 0 18px rgba(69, 240, 255, 0.5); }
.btn-ghost { background: transparent; }
.btn-danger { background: transparent; border-color: rgba(255, 85, 96, 0.55); color: var(--red); }
.btn-danger:hover { border-color: var(--red); box-shadow: 0 0 12px rgba(255, 85, 96, 0.3); color: var(--red); }

/* ---------- keyboard hint ---------- */
.kb-hint {
  margin: 0;
  font-size: 12px;
  color: var(--dim);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
}
.kb-hint-title {
  font-family: var(--pixel);
  font-size: 8px;
  letter-spacing: 2px;
  color: var(--gold);
}

/* ---------- board ---------- */
.board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x proximity;
  scrollbar-color: var(--line) transparent;
}
.board::-webkit-scrollbar { height: 12px; }
.board::-webkit-scrollbar-thumb { background: var(--line); border-radius: 999px; }

.column {
  flex: 0 0 300px;
  max-width: 300px;
  background: linear-gradient(180deg, var(--surface), rgba(18, 18, 29, 0.55));
  border: 1px solid var(--line);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  min-height: 140px;
  scroll-snap-align: start;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}
.column.is-over-wip { border-color: rgba(255, 200, 87, 0.55); }

.col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line);
}
.col-head-main { display: flex; align-items: center; gap: 8px; min-width: 0; }
.col-name {
  background: none;
  border: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: left;
  padding: 4px 6px;
  border-radius: 6px;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.col-name:hover { background: var(--surface-2); color: var(--cyan); }
.col-count {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--dim);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
  min-width: 28px;
  text-align: center;
}
.col-count.is-over { color: var(--gold); border-color: rgba(255, 200, 87, 0.6); }
.col-menu-btn {
  flex: 0 0 auto;
  width: 34px; height: 34px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.col-menu-btn:hover { color: var(--cyan); border-color: var(--line); }

.col-wipbar { height: 4px; background: var(--bg); margin: 0 12px; border-radius: 999px; overflow: hidden; }
.col-wipbar i { display: block; height: 100%; background: var(--cyan); transition: width 0.2s var(--ease-out); }
.col-wipbar.is-over i { background: var(--gold); }

.col-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  flex: 1;
  min-height: 56px;
}
.col-empty {
  margin: 0;
  padding: 18px 8px;
  text-align: center;
  color: var(--dim);
  font-size: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
}
.col-add {
  margin: 0 12px 12px;
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  padding: 9px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.col-add:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(69, 240, 255, 0.05); }

.add-column {
  flex: 0 0 220px;
  align-self: stretch;
  min-height: 140px;
  max-height: 240px;
  background: rgba(18, 18, 29, 0.4);
  border: 1px dashed var(--line);
  border-radius: 12px;
  color: var(--dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.add-column:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(69, 240, 255, 0.05); }

/* ---------- cards ---------- */
.card {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 12px 11px 14px;
  cursor: grab;
  overflow: hidden;
  transition: transform 0.12s var(--ease-out), border-color 0.12s, box-shadow 0.12s, opacity 0.12s;
}
.card:hover { border-color: var(--control-line); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); transform: translateY(-1px); }
.card:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.card:active { cursor: grabbing; }
.card.is-dimmed { opacity: 0.28; }
.card.is-source { opacity: 0.35; }
.card.is-keyboard-held {
  border-color: var(--cyan);
  box-shadow: 0 0 0 2px var(--cyan), 0 0 22px rgba(69, 240, 255, 0.35);
  cursor: grabbing;
}

.card-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.card-cyan .card-stripe { background: var(--cyan); }
.card-magenta .card-stripe { background: var(--magenta); }
.card-gold .card-stripe { background: var(--gold); }
.card-green .card-stripe { background: var(--green); }
.card-red .card-stripe { background: var(--red); }

.card-title { margin: 0; font-size: 13.5px; font-weight: 600; line-height: 1.35; word-break: break-word; }
.card-notes {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--dim);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.card-actions {
  position: absolute;
  top: 6px; right: 6px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.12s;
}
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; }
.card-btn {
  width: 28px; height: 28px;
  background: rgba(10, 10, 18, 0.85);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--dim);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
}
.card-btn:hover { color: var(--cyan); border-color: var(--cyan); }
.card-btn[data-act="delete"]:hover { color: var(--red); border-color: var(--red); }

/* drag ghost follows the pointer */
.card-ghost {
  position: fixed;
  z-index: 300;
  margin: 0;
  pointer-events: none;
  opacity: 0.92;
  cursor: grabbing;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--cyan);
  transform: rotate(2deg);
}
body.is-dragging-card { cursor: grabbing; user-select: none; }

/* drop indicator */
.drop-indicator {
  height: 4px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 12px rgba(69, 240, 255, 0.7);
  margin: 1px 0;
  animation: pulse 0.9s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.55; } }
.kb-moving .col-list { background: rgba(69, 240, 255, 0.02); }

/* ---------- column menu popover ---------- */
.col-menu {
  position: absolute;
  z-index: 250;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--control-line);
  border-radius: 10px;
  padding: 6px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.col-menu-item {
  text-align: left;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: var(--mono);
  font-size: 12.5px;
  padding: 9px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.col-menu-item:hover:not(:disabled) { background: var(--surface-2); color: var(--cyan); }
.col-menu-item.is-danger { color: var(--red); }
.col-menu-item.is-danger:hover:not(:disabled) { background: rgba(255, 85, 96, 0.1); color: var(--red); }
.col-menu-item:disabled { opacity: 0.4; cursor: not-allowed; }

/* ---------- dialogs ---------- */
.dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--control-line);
  border-radius: 14px;
  padding: 22px;
  max-width: min(440px, calc(100vw - 28px));
  width: 100%;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.6);
}
.dialog::backdrop { background: rgba(5, 5, 12, 0.74); backdrop-filter: blur(2px); }
.dlg-title { margin: 0 0 14px; font-family: var(--pixel); font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.dlg-form { display: flex; flex-direction: column; gap: 10px; }
.dlg-label { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--dim); }
.dlg-msg { margin: 0 0 18px; color: var(--text); line-height: 1.55; }
.dlg-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--control-line);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 14px;
}
.dlg-input:hover { border-color: #74749a; }
.dlg-textarea { resize: vertical; min-height: 84px; font-family: var(--body); font-size: 14px; }
.dlg-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.dlg-swatch {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 2px solid var(--line);
  background: var(--sw, var(--surface-2));
  cursor: pointer;
  position: relative;
  transition: transform 0.1s, box-shadow 0.1s;
}
.dlg-swatch.is-none { background: var(--surface-2); }
.dlg-swatch.is-none::after {
  content: ""; position: absolute; inset: 7px;
  background: linear-gradient(135deg, transparent 44%, var(--dim) 44%, var(--dim) 56%, transparent 56%);
}
.dlg-swatch:hover { transform: scale(1.08); }
.dlg-swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--cyan); }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 8px; }
.dlg-actions-edit { justify-content: space-between; }
.dlg-actions-edit .dlg-del { margin-right: auto; }

/* ---------- toasts ---------- */
.toasts {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cyan);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: toast-in 0.22s var(--ease-out) both;
}
.toast-success { border-left-color: var(--green); }
.toast-error { border-left-color: var(--red); }
.toast.out { opacity: 0; transform: translateY(6px); transition: opacity 0.25s, transform 0.25s; }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- privacy + footer ---------- */
.privacy-note { margin: 4px 0 0; text-align: center; font-size: 12.5px; color: var(--dim); }
.site-footer {
  border-top: 1px solid var(--line);
  padding: 22px var(--space-gutter);
  text-align: center;
  color: var(--dim);
  font-size: 13px;
}
.site-footer a { color: var(--cyan); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; text-shadow: var(--glow-cyan); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .toolbar-search { margin-left: 0; width: 100%; }
  .tb-search { width: 100%; }
  .search-wrap { flex: 1; }
  .column { flex-basis: 86vw; max-width: 86vw; max-height: calc(100vh - 260px); }
  .add-column { flex-basis: 80vw; }
}
@media (max-width: 420px) {
  .toolbar { padding: 10px; }
  .tb-select { max-width: 140px; }
  .column { flex-basis: 88vw; max-width: 88vw; }
}
@media (pointer: coarse) {
  .card-actions { opacity: 1; }
  .card { padding: 13px 12px 13px 16px; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .cursor, .wordmark::before, .wordmark::after, .drop-indicator { animation: none !important; }
  .card-ghost { transform: none; }
}
