/*
  The board: lanes, cards, face-down cards, seals, edges.
*/
.board-outer { position: relative; height: 100%; min-height: 0; }
.board-wrap {
  position: absolute; inset: 0; overflow: auto;
  background: var(--paper);
  overscroll-behavior: contain;
}
.board-sizer { position: relative; margin: 0 auto; }
.board {
  position: absolute; left: 0; top: 0; transform-origin: 0 0;
  /* survey grid: a planning table */
  background-color: var(--card);
  background-image:
    linear-gradient(color-mix(in srgb, var(--text-faint) 14%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--text-faint) 14%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  background-position: 13px 13px;
}
.board-zoom {
  position: absolute; left: 12px; bottom: 12px; z-index: 5;
  display: flex; align-items: center; gap: 2px; padding: 3px;
  background: color-mix(in srgb, var(--bg-panel) 94%, transparent); border: 1px solid var(--rule-2); border-radius: 8px;
  box-shadow: var(--shadow-card); color: var(--slate-ink);
}
.board-zoom .z-label { min-width: 44px; text-align: center; font-size: 12.5px; font-weight: 650; }

.lane {
  position: absolute; left: 0; right: 0;
  background: color-mix(in srgb, var(--fam) 5%, transparent);
  border-top: 1px solid color-mix(in srgb, var(--fam) 16%, transparent);
}
.lane::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--fam); opacity: .75; }
.lane-name {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl; font-size: 11.5px; font-weight: 700; letter-spacing: .02em;
  color: color-mix(in srgb, var(--fam) 85%, var(--graphite)); white-space: nowrap; opacity: .9;
}

/* ------------------------------------------------------------------ edges */
.edges { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.e .e-line { fill: none; stroke: var(--edge); stroke-width: 1.5; }
.e .e-head { fill: var(--edge); }
.e-ahead .e-line { stroke-dasharray: 4 4; stroke: var(--edge); }
.e-open .e-line { stroke: var(--edge-open); stroke-width: 1.7; }
.e-open .e-head { fill: var(--edge-open); }
.e-done .e-line { stroke: var(--fam); stroke-width: 2.2; }
.e-done .e-head { fill: var(--fam); }
.e-sel .e-line { stroke: var(--clay-ink); stroke-width: 2; stroke-dasharray: 5 3; }
.e-sel .e-head { fill: var(--clay-ink); }
.e-closed .e-line { stroke: var(--edge-closed); stroke-width: 1.3; }
.e-closed .e-head { fill: var(--edge-closed); }
.e-path .e-line { stroke: var(--graphite); stroke-width: 2.6; }
.e-path .e-head { fill: var(--graphite); }
.e-faint .e-line { stroke: var(--edge-faint); stroke-width: 1.1; }
.e-faint .e-head { fill: var(--edge-faint); }

/* ------------------------------------------------------------------ cards */
.node {
  --fam: #3D5A84;
  position: absolute; width: 180px; height: 66px; padding: 0;
  display: flex; flex-direction: column; text-align: left;
  font: inherit; color: var(--graphite);
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--fam) 45%, var(--rule-2));
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  cursor: pointer; overflow: visible;
  transition: transform .12s ease, box-shadow .12s ease;
}
.node .band {
  display: flex; align-items: center; gap: 5px; height: 19px; padding: 0 7px 0 6px;
  background: var(--fam); color: var(--on-fill);
  border-radius: 6px 6px 0 0;
  font-size: 10.5px; font-weight: 650; line-height: 1;
}
.node .band .code { font-family: var(--f-mono); font-weight: 600; letter-spacing: .01em; }
.node .band .cost { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.node .band .fte { display: inline-flex; align-items: center; gap: 1px; }
.node .band .fte .ico { vertical-align: 0; }
.node .title {
  flex: 1; display: flex; align-items: center;
  padding: 2px 9px 3px;
  font-size: 12px; line-height: 1.18; font-weight: 600; letter-spacing: -.003em;
  overflow: hidden;
}
.node.available { border-width: 1.5px; }
.node.available:hover, .node.available:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.node.played, .node.again { background: color-mix(in srgb, var(--fam) 11%, var(--card)); }
.node.played .band, .node.again .band { background: color-mix(in srgb, var(--fam) 82%, var(--graphite)); }
.node.played .band, .node.again .band { padding-right: 24px; }
.node.played .cost, .node.again .cost { font-weight: 600; opacity: .9; }
.node.again { border-style: dashed; }
.node .again { background: color-mix(in srgb, var(--bg-panel) 22%, transparent); border-radius: 8px; padding: 2px 5px; }
.node.closed { background: var(--card); opacity: .62; box-shadow: none; }
.node.closed .band { background: color-mix(in srgb, var(--fam) 55%, var(--text-faint)); }
.node.dim { opacity: .22; }
.node.short .band .cost { color: #fff; text-decoration: underline wavy rgba(255,255,255,.8); text-underline-offset: 3px; }

/* the seal: a played card is stamped with its round */
.node .seal {
  position: absolute; right: -9px; top: -10px;
  width: 27px; height: 27px; border-radius: 50%;
  display: grid; place-items: center;
  font: 700 10.5px/1 var(--f-sans); letter-spacing: -.01em;
  color: var(--on-fill); background: color-mix(in srgb, var(--fam) 70%, var(--graphite));
  border: 2px solid var(--paper);
  box-shadow: 0 1px 3px rgba(47, 45, 41, .3);
  transform: rotate(-8deg);
}

/* in the order: a clay ring and the priority number */
.node.sel { box-shadow: 0 0 0 3px var(--clay-ink), var(--shadow-lift); transform: translateY(-2px); }
.node .badge {
  position: absolute; left: -10px; top: -10px;
  width: 23px; height: 23px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--clay-ink); color: var(--on-fill);
  font: 750 12px/1 var(--f-sans);
  border: 2px solid var(--paper);
}

/* face-down cards: one step ahead, family shown, title and cost hidden */
.node.shadow, .node.locked {
  display: grid; place-items: center;
  border: 1.3px dashed color-mix(in srgb, var(--fam) 60%, transparent);
  background:
    repeating-linear-gradient(135deg,
      color-mix(in srgb, var(--fam) 17%, var(--paper)) 0 5px,
      color-mix(in srgb, var(--fam) 9%, var(--paper)) 5px 10px);
  box-shadow: none;
  color: color-mix(in srgb, var(--fam) 80%, var(--graphite));
}
.node.locked { opacity: .82; }
.node .back { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: color-mix(in srgb, var(--bg-panel) 86%, transparent); box-shadow: 0 0 0 1px color-mix(in srgb, var(--fam) 30%, transparent); }
.node .lockb {
  position: absolute; right: 6px; top: 6px;
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: var(--graphite); color: var(--on-fill);
}
.node.played .lockb, .node.available .lockb, .node.closed .lockb { display: none; }

/* debrief: which teams played the card */
.node .marks { position: absolute; left: 7px; bottom: -9px; display: flex; gap: 3px; }
.node .mark {
  display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
  background: var(--team); color: var(--on-fill); border: 1.5px solid var(--paper);
  font: 700 10px/1 var(--f-sans);
}

/* new cards turn over when a round opens */
@keyframes turn { 0% { transform: rotateY(90deg); } 100% { transform: rotateY(0); } }
.node.flip { animation: turn .45s ease-out both; }
