/* ==============================================================
   WORRY BEADS · page styles
   File: /worry-beads/worry-beads.css
   Colours, font and buttons come from site.css.
   The "How it helps" section uses shared styles (site.css, section 13).
   Bead colours themselves live in worry-beads.js (section 1).

   Sections:
     1  The room (intro and layout)
     2  The bead stage
     3  Controls
   ============================================================== */


/* --------------------------------------------------------------
   1 · THE ROOM
   -------------------------------------------------------------- */
.beadroom {
  padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(3rem, 8vw, 5.5rem);
  background: linear-gradient(var(--c-sky-top), color-mix(in srgb, var(--c-sky-bottom) 70%, var(--bg)));
}
.beadroom__inner {
  display: grid;
  grid-template-columns: minmax(0, 20rem) minmax(0, 1fr);
  gap: 2rem clamp(2rem, 6vw, 5rem);
  align-items: start;
}
.beadroom__intro {
  position: sticky;
  top: calc(var(--header-h) + 2rem);
}
.beadroom__title {
  margin-bottom: .45em;
  font-size: clamp(2.4rem, 1.6rem + 3vw, 4rem);
  font-weight: var(--weight-light);
  letter-spacing: -.025em;
}
.beadroom__lede {
  margin-bottom: 1rem;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
  line-height: 1.45;
}
.beadroom__note { color: var(--muted); font-size: 1rem; }
.beadroom__work { max-width: 38rem; }

@media (max-width: 900px) {
  .beadroom__inner { grid-template-columns: 1fr; }
  .beadroom__intro { position: static; }
}


/* --------------------------------------------------------------
   2 · THE BEAD STAGE
   -------------------------------------------------------------- */
.bead-stage {
  position: relative;
  aspect-ratio: 1 / 1.08;
  max-height: 72svh;
  margin-inline: auto;
}
.bead-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-l);
  cursor: pointer;
  touch-action: none;           /* lets you drag a bead without scrolling the page */
  -webkit-tap-highlight-color: transparent;
}
.bead-stage canvas:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}
.bead-stage canvas.is-dragging { cursor: grabbing; }

.bead-count {
  margin-top: .5rem;
  text-align: center;
  font-size: var(--step-1);
  font-weight: var(--weight-light);
  font-variant-numeric: tabular-nums;
}


/* --------------------------------------------------------------
   3 · CONTROLS
   -------------------------------------------------------------- */
.bead-panel {
  margin-top: 1.5rem;
  padding: clamp(1.25rem, 4vw, 1.75rem);
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
}

.bead-choice {
  margin: 0 0 1.25rem;
  padding: 0;
  border: 0;
}
.bead-choice legend {
  padding: 0;
  margin-bottom: .6rem;
  font-weight: var(--weight-strong);
}
.bead-choice__row {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.bead-pill {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 46px;
  padding: .45rem 1.1rem .45rem .9rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.bead-pill input { margin: 0; width: 1.05rem; height: 1.05rem; accent-color: var(--accent); }
.bead-pill:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.bead-pill:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

/* Little bead swatches next to each material */
.swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  box-shadow: inset -2px -2px 3px rgba(0, 0, 0, .25);
}
.swatch--amber { background: radial-gradient(circle at 35% 30%, #F6CF7A, #C97C22 60%, #8A4E12); }
.swatch--olive { background: radial-gradient(circle at 35% 30%, #BC9A70, #8B6A45 60%, #5A4128); }
.swatch--glass { background: radial-gradient(circle at 35% 30%, #E4F5F0, #93C6BA 60%, #5C8F86); }

.bead-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
