/* ============================================================
   Workshop rooms — shared styles for /workshop/ hub + class rooms
   Extends workshop.css (vars: --bg-*, --accent, --text, --border)

   Concept: THE WALL, literally. Builder cards are name-tags pinned
   to a wall — pin dot, slight rotation jitter, straighten on hover.
   Blue (--accent) = system. Ember orange (--ship) = shipped things.
   ============================================================ */

:root {
  --ship: #fd6524;            /* staas.fund ember — reserved for shipped work */
  --ship-soft: #ffb38a;
  --wall-line: rgba(255, 255, 255, 0.035);
  --pin: #ffd166;
}

/* The wall itself — faint pegboard dots behind the roster */
.room-wall {
  background-image: radial-gradient(circle, var(--wall-line) 1px, transparent 1.2px);
  background-size: 26px 26px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: clamp(28px, 5vw, 56px) 0 clamp(36px, 6vw, 64px);
}

/* ── Room hero — editorial, left-aligned, asymmetric ──────── */
.room-hero {
  max-width: 1080px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 88px) 20px clamp(24px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: end;
}
@media (max-width: 720px) { .room-hero { grid-template-columns: 1fr; } }

.room-kicker {
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 10px;
}
.room-kicker::before { content: ""; width: 26px; height: 2px; background: var(--accent); }

.room-hero h1 {
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.04;
  letter-spacing: -0.02em;
  margin: 14px 0 14px;
  font-weight: 800;
}
.room-sub { color: var(--text-muted); font-size: clamp(15.5px, 1.6vw, 17.5px); line-height: 1.65; max-width: 52ch; }

.room-hero-side { padding-bottom: 6px; }
.room-stats { border-left: 2px solid var(--border); padding-left: clamp(18px, 3vw, 30px); }
.room-stats .rs-row { padding: 11px 0; }
.room-stats .rs-row + .rs-row { border-top: 1px solid var(--wall-line); }
.room-stats b { display: block; font-size: clamp(28px, 3.2vw, 40px); font-weight: 800; letter-spacing: -0.02em; line-height: 1; }
.room-stats .rs-ships b { color: var(--ship); }
.room-stats span { color: var(--text-dim); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
@media (max-width: 720px) { .room-stats { border-left: 0; padding-left: 0; display: flex; gap: 26px; } }

.room-live-badge[hidden] { display: none; }
.room-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 7px 15px;
  border-radius: 4px;
  background: color-mix(in oklab, #22c55e 14%, transparent);
  color: #4ade80;
  border: 1px solid color-mix(in oklab, #22c55e 35%, transparent);
}
.room-live-badge .dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; animation: room-pulse 1.4s ease-in-out infinite; }
@keyframes room-pulse { 50% { opacity: 0.3; } }

/* ── Roster grid — pinned cards with jitter ───────────────── */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: clamp(16px, 2.5vw, 26px);
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

.builder-card {
  background: linear-gradient(177deg, var(--bg-3), var(--bg-2) 60%);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 26px 18px 18px;
  text-align: center;
  position: relative;
  box-shadow: 0 12px 24px -14px rgba(0, 0, 0, 0.65);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s;
  animation: card-pin 0.55s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
/* pin */
.builder-card::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6, transparent 45%), var(--pin);
  transform: translateX(-50%);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
/* the jitter — every card hangs a touch differently */
.builder-card:nth-child(4n + 1) { transform: rotate(-1.1deg); }
.builder-card:nth-child(4n + 2) { transform: rotate(0.8deg); }
.builder-card:nth-child(4n + 3) { transform: rotate(-0.5deg); }
.builder-card:nth-child(4n + 4) { transform: rotate(1.2deg); }
.builder-card:hover { transform: rotate(0deg) translateY(-3px); border-color: color-mix(in oklab, var(--accent) 55%, var(--border)); }
.builder-card.is-me { border-color: var(--accent); box-shadow: 0 12px 28px -12px color-mix(in oklab, var(--accent) 35%, transparent); }
.builder-card.just-shipped { animation: shipped 0.9s ease; }
@keyframes shipped {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--ship) 70%, transparent); }
  100% { box-shadow: 0 0 0 26px transparent; }
}
/* staggered pin-up on load */
@keyframes card-pin { from { opacity: 0; transform: translateY(14px) rotate(0deg); } }
.builder-card:nth-child(1) { animation-delay: 0.03s; }
.builder-card:nth-child(2) { animation-delay: 0.09s; }
.builder-card:nth-child(3) { animation-delay: 0.15s; }
.builder-card:nth-child(4) { animation-delay: 0.21s; }
.builder-card:nth-child(5) { animation-delay: 0.27s; }
.builder-card:nth-child(6) { animation-delay: 0.33s; }
.builder-card:nth-child(n + 7) { animation-delay: 0.4s; }
@media (prefers-reduced-motion: reduce) {
  .builder-card { animation: none; transition: none; }
}

.builder-avatar {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  margin: 4px auto 14px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 27px;
  color: #fff;
  background: var(--bg-4);
  border: 2px solid var(--bg-4);
  outline: 2px solid var(--border);
  outline-offset: 2px;
}
.builder-avatar img { width: 100%; height: 100%; object-fit: cover; }

.builder-name { font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.builder-tag { color: var(--text-dim); font-size: 11.5px; margin-top: 3px; letter-spacing: 0.08em; text-transform: uppercase; }
.builder-tag.has-ships { color: var(--ship-soft); }

/* ── Shipped links — orange owns "shipped" ────────────────── */
.builder-links { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }

.ship-chip {
  display: block;
  background: var(--bg-3);
  border: 1px solid var(--border);
  border-left: 3px solid var(--ship);
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color 0.15s, background 0.15s;
}
.ship-chip:hover { border-color: var(--ship); background: color-mix(in oklab, var(--ship) 7%, var(--bg-3)); text-decoration: none; }
.ship-chip .ship-host { color: var(--text-dim); font-size: 11px; display: block; letter-spacing: 0.04em; }

.ship-tile { display: block; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; transition: border-color 0.15s, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1); }
.ship-tile img { width: 100%; display: block; aspect-ratio: 16/10; object-fit: cover; object-position: top; }
.ship-tile .ship-tile-label { padding: 8px 11px; font-size: 12.5px; background: var(--bg-3); border-top: 2px solid var(--ship); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ship-tile:hover { border-color: var(--ship); transform: translateY(-2px); text-decoration: none; }

/* ── Self-serve controls (live mode, own card only) ───────── */
.claim-btn {
  margin-top: 14px;
  background: transparent;
  border: 1px dashed color-mix(in oklab, var(--accent) 45%, var(--border));
  color: var(--text-muted);
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 12.5px;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, color 0.15s;
}
.claim-btn:hover { border-color: var(--accent); color: var(--accent); }

.me-tools { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.me-tools .ship-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
}
.me-tools .ship-input:focus { outline: none; border-color: var(--ship); }
.me-tools .ship-input::placeholder { color: var(--text-dim); }
.me-row { display: flex; gap: 8px; }
.me-btn {
  background: var(--ship);
  border: 0;
  color: #1a0d05;
  font-weight: 800;
  border-radius: 4px;
  padding: 10px 15px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font);
  flex-shrink: 0;
  transition: filter 0.15s;
}
.me-btn:hover { filter: brightness(1.12); }
.me-btn.ghost { background: var(--bg-4); color: var(--text-muted); font-weight: 600; }
.me-note { font-size: 11.5px; color: var(--text-dim); line-height: 1.5; }
.me-error { font-size: 12px; color: #f87171; }

/* ── Room code bar / CTA ──────────────────────────────────── */
.room-code-bar { max-width: 520px; margin: 8px auto 0; padding: 0 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

.room-cta { text-align: center; padding: clamp(36px, 6vw, 64px) 20px clamp(48px, 7vw, 80px); }
.room-cta p { color: var(--text-muted); margin-bottom: 16px; font-size: 16px; }
.room-cta a.hub-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 14px 30px;
  border-radius: 5px;
  font-size: 16px;
  transition: filter 0.15s, transform 0.2s;
}
.room-cta a.hub-btn:hover { filter: brightness(1.1); transform: translateY(-1px); text-decoration: none; }
