@import url("https://fonts.googleapis.com/css2?family=Public+Sans:ital,wght@0,400..700;1,400..700&display=swap");

@font-face {
  font-family: "Editor's Note";
  src: url("/assets/fonts/Editor'sNote-Regular.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  /* ── brand (The Builder Board) — exact mockup hex ──────────────── */
  --charcoal: #3B3B3B;
  --peach: #E9C7A5;
  --rose: #F4B69A;
  --sage: #B9C8B1;
  --cream: #FBF6F4;
  --white: #FFFFFF;
  --line: #E8DCD4;
  --muted-ink: #6E6661;

  /* ── shadcn base tokens ───────────────────────────────────────── */
  --background: var(--cream);
  --foreground: var(--charcoal);
  --card: oklch(0.99 0.004 45);
  --card-foreground: var(--charcoal);
  --popover: oklch(0.99 0.004 45);
  --popover-foreground: var(--charcoal);
  --primary: var(--charcoal);
  --primary-foreground: var(--cream);
  --secondary: var(--peach);
  --secondary-foreground: var(--charcoal);
  --muted: oklch(0.95 0.01 50);
  --muted-foreground: var(--muted-ink);
  --accent: oklch(0.95 0.012 50);
  --accent-foreground: var(--charcoal);
  --destructive: oklch(0.55 0.16 30);
  --destructive-foreground: var(--cream);
  --border: var(--line);
  --input: var(--line);
  --ring: var(--charcoal);
  --success: oklch(0.6 0.08 140);
  --warning: oklch(0.72 0.12 65);
  --chart-1: var(--peach);
  --chart-2: var(--rose);
  --chart-3: var(--sage);
  --chart-4: var(--charcoal);
  --chart-5: var(--muted-ink);
  --sidebar: oklch(0.965 0.008 45);
  --sidebar-foreground: var(--charcoal);
  --sidebar-primary: var(--charcoal);
  --sidebar-primary-foreground: var(--cream);
  --sidebar-accent: oklch(0.94 0.012 50);
  --sidebar-accent-foreground: var(--charcoal);
  --sidebar-border: var(--line);
  --sidebar-ring: var(--charcoal);

  /* ── surface hierarchy ────────────────────────────────────────── */
  --background-secondary: oklch(0.955 0.01 48);
  --surface-hover:   color-mix(in srgb, var(--foreground) 6%,  var(--background));
  --surface-active:  color-mix(in srgb, var(--foreground) 10%, var(--background));
  --surface-elevated: oklch(0.99 0.004 45);

  /* ── border hierarchy ─────────────────────────────────────────── */
  --border-subtle: oklch(0.94 0.01 50);
  --border-muted: oklch(0.92 0.012 50);
  --border-strong: var(--charcoal);

  /* ── text hierarchy ───────────────────────────────────────────── */
  --foreground-secondary: oklch(0.42 0.008 48);

  /* ── primary depth (hover/tint states for brand colour) ─────── */
  --primary-hover: color-mix(in srgb, var(--primary) 88%, var(--cream));
  --primary-muted: color-mix(in srgb, var(--primary) 15%, var(--background));
  --primary-soft:  color-mix(in srgb, var(--primary) 8%,  var(--background));
  --primary-tint:  color-mix(in srgb, var(--primary) 5%,  var(--background));

  /* ── focus ring (alpha-blended, for soft ring style) ────────── */
  --focus-ring: oklch(0.34 0.004 45 / 0.35);

  /* ── error (form validation — distinct from destructive) ─────── */
  --error: oklch(0.55 0.16 30);
  --error-foreground: var(--cream);

  /* ── radius (square corners — ever) ───────────────────────────── */
  --radius: 0;
  --radius-none: 0rem;
  --radius-sm: 0rem;
  --radius-lg: 0rem;
  --radius-xl: 0rem;
  --radius-full: 0rem;

  /* ── typography ───────────────────────────────────────────────── */
  --font-display: "Editor's Note", Georgia, "Times New Roman", serif;
  --font-sans: "Public Sans", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-weight-display: 500;
  --line-height-display: 1.05;
  --tracking-display: -0.015em;
  --font-weight-body: 400;
  --line-height-body: 1.55;
  --tracking-body: 0em;
  --font-weight-mono: 400;

  /* ── shadows (none — flat brand) ──────────────────────────────── */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;

  /* ── motion ───────────────────────────────────────────────────── */
  --duration-fast: 120ms;
  --duration-normal: 220ms;
  --duration-slow: 420ms;
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-accelerate: cubic-bezier(0.4, 0, 1, 1);
  --ease-decelerate: cubic-bezier(0, 0, 0.2, 1);

  /* ── spacing ──────────────────────────────────────────────────── */
  --spacing-base: 0.25rem;
}

/* ═══════════════════════════════════════════════════════════════════
   Board component CSS — editorial board-game layout. Global classes;
   screens use these names as-is. Level grid, no tilt, brand palette only.
   ═══════════════════════════════════════════════════════════════════ */

.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding-inline: clamp(16px, 4vw, 36px);
  padding-block: 28px 64px;
}
.wrap h1, .wrap h2, .wrap h3 { font-family: var(--font-display); font-weight: 400; margin: 0; }
.wrap :focus-visible { outline: 2px solid var(--charcoal); outline-offset: 2px; }

/* The shared initials monogram — used for every photo-less avatar on the board. */
.mono {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-weight: 600;
  color: var(--charcoal);
  letter-spacing: .01em;
  line-height: 1;
  border-radius: inherit;
  user-select: none;
}

/* ── 1 · Header ─────────────────────────────────────────────────── */
.bb-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 28px;
  padding-bottom: 20px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.bb-eyebrow {
  display: block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted-ink);
  margin-bottom: 6px;
}
.bb-title {
  font-size: clamp(40px, 6.4vw, 64px);
  line-height: .98;
  letter-spacing: -.02em;
}
.bb-tag {
  margin: 0;
  max-width: 30ch;
  text-align: right;
  color: var(--muted-ink);
  font-size: 15px;
  line-height: 1.4;
}

/* ── 2 · Current-move banner ────────────────────────────────────── */
.move-banner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  background: var(--peach);
  border: 1.5px solid var(--charcoal);
  border-radius: 28px;
  padding: 20px 24px;
  margin-bottom: 18px;
}
.move-token-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: none;
}
.move-token {
  position: relative;
  width: 76px;
  height: 76px;
  border: 2.5px solid var(--charcoal);
  border-radius: 50%;
  background: var(--cream);
  padding: 0;
  cursor: pointer;
  overflow: visible;
}
.move-token > img,
.move-token > .mono {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
}
.move-token .edit-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  background: var(--cream);
  border: 1.5px solid var(--charcoal);
  border-radius: 50%;
}
.move-token .edit-badge svg { width: 12px; height: 12px; }
.move-token:hover .edit-badge { background: var(--white); }
.you-pill {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--charcoal);
  border-radius: 999px;
  padding: 3px 12px;
}
.move-name-row {
  display: flex;
  align-items: center;
  gap: 4px;
  max-width: 108px;
}
.move-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--charcoal);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.move-name-edit {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  flex: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted-ink);
  border-radius: 50%;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard), color var(--duration-fast) var(--ease-standard);
}
.move-name-edit svg { width: 12px; height: 12px; }
.move-name-edit:hover {
  background: var(--white);
  color: var(--charcoal);
}
.move-body { flex: 1; min-width: 200px; }
.move-lbl {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--charcoal);
}
.move-title { font-size: clamp(26px, 3.6vw, 34px); line-height: 1.04; margin-top: 4px; }
.move-desc {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted-ink);
  max-width: 52ch;
}
.move-actions { display: flex; flex-direction: column; align-items: center; gap: 8px; flex: none; }
.go {
  background: var(--charcoal);
  color: var(--white);
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background var(--duration-fast) var(--ease-standard);
}
.go:hover { background: #4a4a4a; }
.go:disabled { opacity: .6; cursor: default; }
.go svg { width: 18px; height: 18px; }
.undo {
  background: none;
  border: 0;
  font-family: var(--font-sans);
  color: var(--charcoal);
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 4px;
  cursor: pointer;
}
.photo-error { margin: -6px 0 14px; font-size: 12.5px; color: var(--muted-ink); }
.move-error { margin: 2px 0 0; font-size: 12.5px; text-align: center; color: var(--muted-ink); }

/* ── 3 · Community + legend ─────────────────────────────────────── */
.cohort {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  margin-bottom: 22px;
}
.cohort-left { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 16px; min-width: 0; }
.cohort-avatars { display: flex; align-items: center; }
.ava {
  width: 40px;
  height: 40px;
  border: 2px solid var(--cream);
  border-radius: 50%;
  background: var(--white);
  overflow: hidden;
  flex: none;
  display: block;
  margin-left: -10px;
  outline: 1px solid rgba(59, 59, 59, .18);
  cursor: default;
}
.cohort-avatars > .ava:first-child { margin-left: 0; }
.ava > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ava-me { border-color: var(--charcoal); outline: 0; width: 44px; height: 44px; z-index: 2; }
.ava-more {
  display: grid;
  place-items: center;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--charcoal);
  background: var(--peach);
  cursor: pointer;
}
.ava-sm {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
}
.ava-sm > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cohort-copy { margin: 0; font-size: 14px; color: var(--muted-ink); max-width: 34ch; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--charcoal);
}
.dot { width: 11px; height: 11px; border-radius: 50%; flex: none; border: 1px solid rgba(59,59,59,.25); }
.dot-cleared { background: var(--sage); }
.dot-current { background: var(--rose); }
.dot-next { background: var(--line); }

/* ── 4 · The board ──────────────────────────────────────────────── */
.board-panel {
  position: relative;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(16px, 3vw, 28px);
  background-image: radial-gradient(rgba(59, 59, 59, .05) 1px, transparent 1px);
  background-size: 18px 18px;
}
.board-path {
  position: absolute;
  inset: clamp(16px, 3vw, 28px);
  width: calc(100% - 2 * clamp(16px, 3vw, 28px));
  height: calc(100% - 2 * clamp(16px, 3vw, 28px));
  pointer-events: none;
  z-index: 0;
  overflow: visible;
}
.move-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(12px, 1.8vw, 18px);
}
.move-card {
  position: relative;
  text-align: left;
  background: var(--white);
  border: 1.5px solid var(--charcoal);
  border-radius: 20px;
  min-height: 168px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: var(--font-sans);
  color: var(--charcoal);
  transition:
    transform var(--duration-fast) var(--ease-standard),
    box-shadow var(--duration-fast) var(--ease-standard),
    background var(--duration-fast) var(--ease-standard);
}
.move-card:hover { transform: translateY(-3px); }
.move-card.is-cleared { background: #F3F7F0; }
.move-card.is-here { border-color: var(--rose); border-width: 2px; }
.move-card.is-finish { background: var(--rose); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.card-num {
  font-family: var(--font-display);
  font-size: 40px;
  line-height: .9;
  flex: none;
}
.card-chips { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chip {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--charcoal);
  white-space: nowrap;
}
.chip-cleared { background: var(--sage); border-color: transparent; }
.chip-here { background: var(--charcoal); color: var(--cream); }
.chip-next { background: transparent; color: var(--muted-ink); border-color: var(--line); }
.chip-milestone { background: var(--peach); border-color: transparent; }
.chip-finish { background: var(--charcoal); color: var(--cream); }
.card-title { font-family: var(--font-display); font-size: 20px; line-height: 1.08; margin-top: 2px; }
.move-card.is-finish .card-title { font-weight: 500; }
.card-desc {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted-ink);
  margin: 0;
}
.move-card.is-finish .card-desc { color: color-mix(in srgb, var(--charcoal) 70%, var(--rose)); }
.card-badge {
  display: flex;
  align-items: center;
  width: 100%;
  margin-top: auto;
  padding: 6px 4px 0 0;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-standard);
}
.card-badge:hover { transform: translateY(-1px); }
.badge-avas {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 0;
}
.badge-ava {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--white);
  overflow: hidden;
  margin-left: -10px;
  background: var(--cream);
  flex-shrink: 0;
}
.badge-avas > .badge-ava:first-child { margin-left: 0; }
.badge-ava > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.move-card.is-finish .badge-ava { border-color: var(--rose); }

@media (max-width: 900px) {
  .move-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .move-grid { grid-template-columns: 1fr; }
  .move-card { min-height: 0; }
  .bb-tag { text-align: left; }
  .bb-head { align-items: flex-start; }
}

/* Confetti bits — positioned and animated imperatively by the board script */
.bit { position: fixed; width: 9px; height: 9px; border-radius: 50%; pointer-events: none; z-index: 70; }

@media (prefers-reduced-motion: reduce) {
  .move-card { transition: none; }
  .move-card:hover { transform: none; }
}
