/* ============================================================
   grammar-cryptex.css — Cryptex (spinning dial rings).

   Loaded alongside grammar-match.css (shared gm- frame chrome + tokens).
   Two vertical char-cell rings (base stems right-aligned, suffixes left-
   aligned) that spin; the centre row forms the assembled word. Ring heights
   + the centre band are sized in JS (WINDOW × cell pitch).
   ============================================================ */

.gm-cr-prompt {
  margin-top: 16px;
  text-align: center;
  font-size: clamp(15px, 3.8vw, 19px);
  font-weight: 600;
  color: var(--gm-acc);
}

.gm-cr-stage { margin-top: 14px; }

.gm-cr-rings {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 0;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}
.gm-cr-ring {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  touch-action: none;
  cursor: grab;
}
.gm-cr-ring:active { cursor: grabbing; }
.gm-cr-strip {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  will-change: transform;
}
.gm-cr-strip.snap { transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.3, 1); }

.gm-cr-row {
  display: flex;
  height: 36px;
  margin-bottom: 4px;          /* JS cellSize = row height + 4 */
  justify-content: flex-end;   /* base ring: right-align (hug the centre) */
}
.gm-cr-ring[data-ring="suffix"] .gm-cr-row { justify-content: flex-start; }
.gm-cr-cell {
  flex: 0 0 30px;   /* never shrink — rows live in a 0-width absolute strip */
  width: 30px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans JP', sans-serif;
  font-size: 23px;
  color: var(--gm-faint);
  transition: color 0.15s;
}
.gm-cr-cell.filler { color: transparent; }
.gm-cr-row.center .gm-cr-cell { color: var(--gm-ink); font-weight: 600; }

/* Centre highlight band (sized in JS to one row). */
.gm-cr-windowline {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  background: var(--gm-accbg);
  border-top: 1.5px solid var(--gm-line2);
  border-bottom: 1.5px solid var(--gm-line2);
  border-radius: 6px;
  pointer-events: none;
  z-index: 0;
}
.gm-cr-stage.is-matched .gm-cr-windowline {
  background: rgba(47, 143, 91, 0.14);
  border-color: var(--gm-green);
}

/* Readout. */
.gm-cr-readout { text-align: center; margin-top: 16px; }
.gm-cr-assembled {
  font-family: 'Noto Sans JP', sans-serif;
  font-size: clamp(26px, 7vw, 38px);
  font-weight: 600;
  color: var(--gm-acc);
  min-height: 1.2em;
  line-height: 1.2;
}
.gm-cr-assembled.invalid { color: var(--gm-faint); opacity: 0.6; }
.gm-cr-stage.is-matched .gm-cr-assembled { color: var(--gm-green); }
.gm-cr-meaning {
  color: var(--gm-muted);
  font-size: clamp(14px, 3.4vw, 16px);
  margin-top: 5px;
  min-height: 1.3em;
}
.gm-cr-reveal { margin-top: 10px; }
