:root {
  --wood: #5b4430;
  --wood-grain: #6b5039;
  --hole: #2e2115;
  --hole-rim: #77593d;
  --sign: #f4e8d1;
  --sign-shadow: #d9c6a0;
  --ink: #4a3420;
  --ink-dim: #6b5138;
  --honey: #d99a3f;
  --honey-bright: #eab461;
  --rope: #9c7b53;
  --bench: #3a2b1e;
  --bench-dark: #2a1f16;
  --chalk: #eee5d3;
  --workbench-h: 104px;
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background-color: var(--wood);
  background-image:
    radial-gradient(circle at 25% 15%, rgba(234, 180, 97, 0.08), transparent 40%),
    radial-gradient(circle 3.5px, var(--hole) 0 3.5px, transparent 4px),
    repeating-linear-gradient(90deg, var(--wood-grain) 0 2px, transparent 2px 64px);
  background-size: auto, 46px 46px, auto;
  background-position: 0 0, 23px 23px, 0 0;
  color: var(--sign);
  font-family: 'Work Sans', sans-serif;
  padding-bottom: calc(var(--workbench-h) + 24px);
}

body.no-hover {
  padding-bottom: 32px;
}

a, button {
  color: inherit;
  text-decoration: none;
}

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 28px;
  width: 100%;
}

/* ---------- Header / hero ---------- */

header {
  padding: 30px 0 6px;
}

header .brand {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--sign-shadow);
  opacity: .8;
}

.hero {
  padding: 6px 0 34px;
}

h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: clamp(24px, 3vw, 32px);
  margin: 0;
  color: var(--sign);
  letter-spacing: 0.01em;
}

.hero p.sub {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--sign-shadow);
  opacity: .85;
}

/* ---------- Catalog grid ---------- */

section.catalog {
  padding: 6px 0 20px;
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-bottom: 30px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--sign-shadow);
  opacity: .6;
}

.board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 40px 16px;
}

.board.empty {
  display: block;
  padding: 40px 0 20px;
  text-align: center;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 13px;
  color: var(--sign-shadow);
  opacity: .6;
}

.slot {
  position: relative;
  padding-top: 22px;
  display: block;
}

.slot .hook {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hole);
  box-shadow: 0 0 0 4px var(--hole-rim);
  z-index: 2;
}

.slot .string {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 16px;
  background: var(--rope);
  opacity: .7;
  z-index: 2;
}

.tag {
  position: relative;
  z-index: 1;
  background: var(--sign);
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 22px 12px 14px;
  border-radius: 9px;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: transform .15s ease, box-shadow .15s ease;
  width: 100%;
}

.tag:hover {
  transform: translateY(3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
}

.tag .icon {
  width: 34px;
  height: 34px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 3;
}

.tag img.icon {
  object-fit: contain;
  stroke: none;
}

.tag .name {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 13px;
  color: var(--ink);
  text-align: center;
  line-height: 1.2;
}

.slot.wip .tag {
  opacity: .5;
  cursor: default;
}

/* ---------- Workbench ledge (desktop / hover-capable only) ---------- */

.workbench {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--workbench-h);
  background: linear-gradient(var(--bench), var(--bench-dark));
  border-top: 5px solid var(--bench-dark);
  box-shadow: 0 -10px 20px rgba(0, 0, 0, 0.3);
  z-index: 10;
  display: flex;
  align-items: center;
}

body.no-hover .workbench {
  display: none;
}

.workbench .wrap {
  height: 100%;
  display: flex;
  align-items: center;
}

.chalkboard {
  width: 100%;
  height: calc(var(--workbench-h) - 24px);
  background: #262e28;
  border: 5px solid #4a3a28;
  border-radius: 5px;
  padding: 8px 18px;
  box-shadow: inset 0 0 14px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.chalkboard .wb-title {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  letter-spacing: .05em;
  color: var(--honey-bright);
  text-transform: uppercase;
  margin: 0 0 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chalkboard .wb-desc {
  font-family: 'Work Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--chalk);
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Dialog (mobile / touch only) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 8, 0.6);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .18s ease;
  z-index: 50;
}

.overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--sign);
  color: var(--ink);
  max-width: 380px;
  width: 100%;
  border-radius: 14px;
  padding: 28px 26px 24px;
  position: relative;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
  transform: translateY(8px);
  transition: transform .18s ease;
}

.overlay.open .modal {
  transform: translateY(0);
}

.modal .close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--ink-dim);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}

.modal .icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(74, 52, 32, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}

.modal .icon-wrap svg {
  width: 28px;
  height: 28px;
  stroke: var(--ink);
  fill: none;
  stroke-width: 3;
}

.modal h2 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  font-size: 21px;
  margin: 0 0 10px;
}

.modal p {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-dim);
  margin: 0 0 20px;
}

.modal .go {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--sign);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12.5px;
  padding: 11px 18px;
  border-radius: 7px;
}

.modal .go.disabled {
  opacity: .4;
  pointer-events: none;
}

/* ---------- Responsive tuning ---------- */

@media (max-width: 560px) {
  :root {
    --workbench-h: 92px;
  }

  .wrap {
    padding: 0 18px;
  }

  .board {
    grid-template-columns: repeat(auto-fill, minmax(108px, 1fr));
    gap: 32px 12px;
  }

  .tag {
    padding: 18px 8px 12px;
  }

  .tag .icon {
    width: 28px;
    height: 28px;
  }

  .tag .name {
    font-size: 12px;
  }
}
