/* ===== Canvas ===== */
.board {
  position: fixed; inset: calc(var(--topbar-h) + var(--filterbar-h)) 0 var(--nav-h) 0;
  overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none;
  overscroll-behavior: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
  background-color: var(--paper);
  /* Springboards-style square dot grid */
  background-image: radial-gradient(circle at 1.5px 1.5px, var(--dot) 1.5px, transparent 1.8px);
  background-size: 26px 26px;
  cursor: default;
}
.board[data-tool="hand"], .board.is-grab,
.board[data-tool="hand"] .card, .board.is-grab .card { cursor: grab; }
.board.is-panning, .board.is-panning .card { cursor: grabbing; }
/* post-it tool: a tiny yellow post-it with a "+" as the pointer over anything stickable */
.board[data-tool="postit"] .card,
.board[data-tool="postit"] .card * {
  cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath d='M2 2l7 2-3 2z' fill='%230e0e10'/%3E%3Crect x='9' y='9' width='17' height='17' rx='1' transform='rotate(-6 17 17)' fill='%23ffe45c' stroke='%230e0e10' stroke-width='2'/%3E%3Cpath d='M17.5 13v9M13 17.5h9' stroke='%230e0e10' stroke-width='2.2' stroke-linecap='round'/%3E%3C/svg%3E") 2 2, copy;
}
/* z-index keeps the canvas above any board::after overlay */
/* will-change only while the camera moves (board.js toggles .is-moving): a permanently
   promoted layer is rastered once and then scaled, so text goes soft after zooming in */
.world { position: absolute; left: 0; top: 0; z-index: 2; transform-origin: 0 0; }
.world.is-moving { will-change: transform; }

/* ===== Sections (category clusters) ===== */
.section {
  --c: var(--acid);
  position: absolute;
  border: 2px dashed color-mix(in srgb, var(--ink) 55%, transparent);
  border-radius: var(--r-lg);
  background: color-mix(in srgb, var(--c) 9%, transparent);
  transition: opacity 0.4s, filter 0.4s, background 0.3s;
  animation: sec-in 0.3s var(--ease-out) both;
}
.section.is-dim { opacity: 0.22; filter: grayscale(1); }
.section.is-focus { border-style: solid; border-color: var(--ink); background: color-mix(in srgb, var(--c) 16%, transparent); }
.section-label:focus-visible { outline: 3px solid var(--hot); outline-offset: 3px; }
@keyframes sec-in { from { opacity: 0; } }

.section-label {
  position: absolute; left: 22px; top: -24px;
  display: inline-flex; align-items: center; gap: 12px;
  padding: 6px 16px 6px 10px;
  background: var(--c); color: #0e0e10;
  border: 2px solid #0e0e10; border-radius: 10px;
  box-shadow: 4px 4px 0 #0e0e10;
  transform: rotate(-1.5deg);
  cursor: pointer;
  transition: transform 0.2s var(--ease-spring);
}
.section-label:hover { transform: rotate(1deg) scale(1.04); }
.section-emoji { font-size: 22px; }
.section-name { font-family: var(--f-display); font-style: italic; font-size: 34px; line-height: 1; letter-spacing: -0.01em; }
.section-count {
  font-family: var(--f-mono); font-size: 12px; font-weight: 600;
  background: #0e0e10; color: var(--c); padding: 2px 6px; border-radius: 4px;
}
/* Pantom-style plus grid ornament */
.section-plus {
  position: absolute; right: 18px; top: 16px; width: 92px; height: 38px; opacity: 0.5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16'%3E%3Cpath d='M8 3v10M3 8h10' stroke='%230e0e10' stroke-width='2'/%3E%3C/svg%3E");
  background-size: 16px 16px;
}
.section-empty {
  position: absolute; inset: 90px 30px 30px; display: grid; place-items: center; text-align: center;
  font-family: var(--f-marker); font-size: 20px; color: var(--ink-3);
  border: 2px dashed var(--ink-3); border-radius: var(--r-md);
}

/* ===== Freshest dividers ===== */
.divider {
  position: absolute; left: 0; height: 60px;
  display: flex; align-items: center; gap: 14px;
  animation: sec-in 0.3s var(--ease-out) both;
}
.divider-sq { width: 30px; height: 30px; background: var(--ink); flex: none; }
.divider-label { font-family: var(--f-display); font-style: italic; font-size: 52px; line-height: 1; text-transform: lowercase; }
.divider-line { flex: 1; height: 0; border-top: 2px dashed var(--ink); opacity: 0.4; }
.divider-count { font-family: var(--f-mono); font-size: 12px; background: var(--acid); color: #0e0e10; padding: 3px 8px; border: 1.5px solid #0e0e10; }

/* ===== Idea cards ===== */
/* Position lives in the `translate` property + `--r` (set by board.js), so `transform`
   is free for hover / press / entrance without fighting the layout transition. */
.card {
  --cat: var(--acid);
  --r: 0deg;
  position: absolute; left: 0; top: 0;
  width: 280px; height: 236px;
  padding: 18px 18px 13px;
  display: flex; flex-direction: column; gap: 7px;
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: 4px;
  box-shadow: 5px 5px 0 var(--ink);
  cursor: pointer;
  rotate: var(--r);
  transition:
    translate 0.6s var(--ease-spring),
    rotate 0.3s var(--ease-out),
    transform 0.2s var(--ease-spring),
    opacity 0.3s, box-shadow 0.15s, filter 0.3s;
  outline: none;
}
.card::before { /* category color strip */
  content: ""; position: absolute; left: -2px; right: -2px; top: -2px; height: 7px;
  background: var(--cat); border: 2px solid var(--ink); border-bottom-width: 2px; border-radius: 4px 4px 0 0;
}
.board .card:hover, .board .card:focus-visible { rotate: 0deg; transform: translateY(-4px); z-index: 5; }
.card:hover, .card:focus-visible { box-shadow: 8px 8px 0 var(--cat), 8px 8px 0 2px var(--ink); }
.card:focus-visible { outline: 3px solid var(--hot); outline-offset: 5px; }
.board .card:active { transform: translateY(-1px) scale(0.985); box-shadow: 3px 3px 0 var(--ink); transition-duration: 0.6s, 0.3s, 0.08s, 0.3s, 0.08s, 0.3s; }
.card:hover .tape { transform: translateX(-50%) rotate(4deg); }
.card.is-selected { box-shadow: 8px 8px 0 var(--hot), 8px 8px 0 2px var(--ink); outline: 2px dashed var(--hot); outline-offset: 6px; z-index: 6; }
.card.is-dim { opacity: 0.18; filter: grayscale(1); pointer-events: none; }
.card.is-gone { opacity: 0; pointer-events: none; }
.card.is-ping { animation: ping 1.2s var(--ease-out); }
@keyframes ping {
  0%, 100% { box-shadow: 5px 5px 0 var(--ink); }
  30% { box-shadow: 0 0 0 10px var(--acid), 5px 5px 0 var(--ink); }
}
/* first paint / new idea: quick staggered "slapped onto the wall" drop-in */
.card.is-enter { animation: card-drop 0.34s var(--ease-spring) backwards; animation-delay: var(--enter-d, 0ms); }
@keyframes card-drop {
  from { opacity: 0; transform: translateY(-16px) scale(0.94) rotate(-2deg); }
  60% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .card { transition: opacity 0.2s, box-shadow 0.15s, filter 0.2s; }
  .card.is-enter { animation: none; }
  .board .card:hover, .board .card:focus-visible { transform: none; }
}

.tape { transform: translateX(-50%) rotate(4deg); }
.card.is-selected { box-shadow: 8px 8px 0 var(--hot); z-index: 6; }
.card.is-dim { opacity: 0.18; filter: grayscale(1); pointer-events: none; }
.card.is-gone { opacity: 0; pointer-events: none; }
.card.is-new { opacity: 0; }
.card.is-ping { animation: ping 1.2s var(--ease-out); }
@keyframes ping {
  0%, 100% { box-shadow: 5px 5px 0 var(--ink); }
  30% { box-shadow: 0 0 0 10px var(--acid), 5px 5px 0 var(--ink); }
}

.tape {
  position: absolute; top: -14px; left: 34%; transform: translateX(-50%) rotate(-3deg);
  width: 86px; height: 24px;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.35) 0 6px, transparent 6px 12px), color-mix(in srgb, var(--cat) 70%, #fff);
  border: 1.5px solid rgba(14,14,16,.35);
  opacity: 0.92;
  transition: transform 0.3s var(--ease-spring);
  z-index: 2;
}

.card-head { display: flex; align-items: center; gap: 6px; margin-top: 2px; min-width: 0; white-space: nowrap; }
.card-head .cat-chip { flex: none; }
.cat-chip {
  --c: var(--acid);
  font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.05em;
  padding: 2px 7px; border: 1.5px solid var(--ink); border-radius: 3px;
  background: var(--c); color: #0e0e10;
}
.stage {
  font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); text-transform: uppercase; letter-spacing: 0.06em;
}
.card-head .stage { margin-left: auto; display: inline-flex; align-items: baseline; gap: 5px; min-width: 0; }
.stage-name { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.stage-when { flex: none; text-transform: none; letter-spacing: 0.02em; color: var(--ink-2); }
.stage-when::before { content: "·"; margin-right: 5px; color: var(--ink-3); }
.card-title {
  margin: 2px 0 0; font-family: var(--f-sans); font-weight: 700; font-size: 20px; line-height: 1.12; letter-spacing: -0.02em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-pitch {
  margin: 0; color: var(--ink-2); font-size: 13.5px; line-height: 1.38;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-asks { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; overflow: hidden; }
.asks-label { font-family: var(--f-mono); font-size: 10px; color: var(--ink-3); }
.ask { font-family: var(--f-mono); font-size: 10.5px; padding: 1px 6px; border: 1px dashed var(--ink-2); border-radius: 3px; white-space: nowrap; }
.card-foot {
  margin-top: auto; display: flex; align-items: center; gap: 7px; min-width: 0;
  font-family: var(--f-mono); font-size: 11px; color: var(--ink-2);
  padding-top: 8px; border-top: 1.5px dashed color-mix(in srgb, var(--ink) 30%, transparent);
}
.card-foot .who { flex: 1 1 auto; min-width: 64px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-foot .when { white-space: nowrap; flex: none; }
.foot-stats { flex: none; display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.card-foot .count {
  margin-left: auto; font-weight: 600; padding: 2px 7px; border-radius: 3px; flex: none;
  background: var(--ink); color: var(--paper); white-space: nowrap;
}
.card-foot .count.is-zero { background: var(--acid); color: #0e0e10; border: 1.5px solid #0e0e10; }

/* ===== v2: badges, hover quick-actions ===== */
.card-badges { display: inline-flex; gap: 3px; flex: none; }
.badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 3px;
  font-size: 10px; line-height: 1; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--card);
}
.badge-yt { background: #ff2e2e; color: #fff; border-color: #0e0e10; }
.foot-stats .count { margin-left: 0; }

.card-actions {
  position: absolute; right: -8px; top: -16px; z-index: 4;
  display: flex; gap: 6px;
  opacity: 0; transform: translateY(6px) scale(0.96); pointer-events: none;
  transition: opacity 0.18s, transform 0.25s var(--ease-spring);
}
.card:hover .card-actions, .card:focus-within .card-actions { opacity: 1; transform: none; pointer-events: auto; }
.card-act {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border: 2px solid #0e0e10; border-radius: 6px;
  font-family: var(--f-mono); font-size: 11px; font-weight: 600; letter-spacing: 0.04em;
  background: #0e0e10; color: #fff; box-shadow: 2px 2px 0 var(--cat);
  cursor: pointer;
}
.card-act:hover { transform: translate(-1px, -1px); }
.card-act-postit { background: var(--pi-yellow); color: #0e0e10; box-shadow: 2px 2px 0 #0e0e10; }
.mini-pi { width: 12px; height: 12px; background: var(--pi-pink); border: 1.5px solid #0e0e10; transform: rotate(-8deg); }
.board[data-tool="postit"] .card-actions { display: none; }

/* ===== Empty canvas state (filters leave nothing on the board) ===== */
.board-empty {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center; padding: 24px 16px 110px;
  pointer-events: none;
  animation: be-in 0.32s var(--ease-spring) both;
}
.board-empty.is-out { animation: be-out 0.18s ease-in both; }
@keyframes be-in { from { opacity: 0; transform: translateY(14px) scale(0.96); } }
@keyframes be-out { to { opacity: 0; transform: translateY(8px) scale(0.97); } }
.board-empty-card {
  position: relative; pointer-events: auto;
  width: min(400px, 100%); padding: 26px 24px 22px; text-align: center;
  background: var(--card); color: var(--ink);
  border: 2px solid var(--ink); border-radius: 4px; box-shadow: 6px 6px 0 var(--ink);
  transform: rotate(-1.5deg);
}
.board-empty-tape {
  position: absolute; top: -13px; left: 50%; width: 92px; height: 24px; transform: translateX(-50%) rotate(3deg);
  background: repeating-linear-gradient(45deg, rgba(255,255,255,.4) 0 6px, transparent 6px 12px), var(--pi-pink);
  border: 1.5px solid rgba(14,14,16,.35);
}
.board-empty-big { margin: 0 0 8px; font-family: var(--f-marker); font-size: 26px; line-height: 1.1; }
.board-empty-why { margin: 0 0 18px; font-family: var(--f-mono); font-size: 12px; color: var(--ink-2); overflow-wrap: anywhere; }
.board-empty-why b { color: var(--ink); background: color-mix(in srgb, var(--acid) 55%, transparent); padding: 0 4px; border-radius: 2px; white-space: nowrap; }
.board-empty-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media (prefers-reduced-motion: reduce) { .board-empty, .board-empty.is-out { animation: none; } }
@media (pointer: coarse) { .card-act { height: 40px; padding: 0 14px; } .tool { width: 48px; height: 48px; } .zoom-hud button { height: 44px; min-width: 44px; } }

/* "ideas from the community": world-space heading above every section */
.wall-banner { position: absolute; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.wall-banner-k {
  margin: 0; align-self: flex-start; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 14px; font-weight: 700; letter-spacing: 0.14em;
  padding: 5px 12px; background: var(--ink); color: var(--paper); border-radius: var(--r-pill);
}
.wall-banner-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--hot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hot) 35%, transparent); animation: wall-pulse 1.8s ease-in-out infinite; }
@keyframes wall-pulse { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--hot) 0%, transparent); } }
.wall-banner-t { margin: 0; font-family: var(--f-display); font-style: italic; font-weight: 400; font-size: 76px; line-height: 0.95; letter-spacing: -0.02em; }
.wall-banner-s { margin: 0; max-width: 900px; font-size: 21px; line-height: 1.4; color: var(--ink-2); }
@media (prefers-reduced-motion: reduce) { .wall-banner-dot { animation: none; } }

/* ===== v4: touch ===== */
/* no hover on touch screens: keep "+ Add advice" on every card (tapping the card opens it) */
@media (hover: none) {
  .board .card-actions { opacity: 1; transform: none; pointer-events: auto; top: -30px; }
  .board .card-act { height: 38px; }
  .board .card-act[data-act="open"] { display: none; }
  .board .card:hover { rotate: var(--r); transform: none; }
  .card:hover { box-shadow: 5px 5px 0 var(--ink); }
  .card.is-selected:hover { box-shadow: 8px 8px 0 var(--hot), 8px 8px 0 2px var(--ink); }
}
/* the heading shrinks to the phone frame (board.js sets .is-compact and the width) */
.wall-banner.is-compact { gap: 12px; }
.wall-banner.is-compact .wall-banner-k { font-size: 13px; padding: 5px 11px; }
.wall-banner.is-compact .wall-banner-t { font-size: 50px; line-height: 0.98; }
.wall-banner.is-compact .wall-banner-s { font-size: 17px; line-height: 1.42; }
.divider.is-compact { gap: 10px; }
.divider.is-compact .divider-label { font-size: 40px; }
.divider.is-compact .divider-sq { width: 22px; height: 22px; }
