/* ==========================================================================
   Initiative-page-only styles: DEX pair, PB readout, subclass strip, d20 instrument,
   d20 range, DEX reference highlight. Shared components live in tool.css.
   ========================================================================== */

.dex-pair {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 10px;
}

/* Precision Stepper */
/* Discrete 5-Tier PB Pill Strip (screentester .sh-tiers craft) */
/* Proficiency Bonus readout: flat text, never a pill (readout grammar) */
.pb-read {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pb-read-lbl {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
}

.pb-read-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--data);
}

.pb-read-help {
  margin-left: auto;
}

/* Subclass & Custom Hairline 4-Col Strip */
.sub-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sub-cell {
  padding: 11px 12px;
}

.sub-cell + .sub-cell {
  border-left: 1px solid var(--div);
}

.sub-top {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 6px;
}

.sub-code {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
}

.sub-hint {
  font-size: 11px;
  color: var(--ink-4);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Handcrafted Geometric d20 SVG Stage */
.d20-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 0;
}

.d20-wrap {
  position: relative;
  width: 122px;
  height: 122px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.d20-svg {
  width: 122px;
  height: 122px;
  color: var(--x-axis);
  transition: color 0.25s var(--ease);
}

.d20-svg .d20-outer {
  stroke: var(--x-data);
  fill: rgba(227, 180, 90, 0.08);
  transition: stroke 0.25s var(--ease), fill 0.25s var(--ease);
}

.d20-svg .d20-inner {
  stroke: var(--x-axis);
  fill: none;
}

.d20-svg.is-rolled .d20-outer {
  stroke: var(--x-ink);
  fill: rgba(255, 235, 200, 0.06);
}

.d20-svg.is-nat20 .d20-outer {
  stroke: var(--x-ok);
  fill: rgba(95, 211, 141, 0.14);
}

.d20-svg.is-nat1 .d20-outer {
  stroke: var(--x-fail);
  fill: rgba(255, 128, 112, 0.14);
}

.d20-wrap.is-spinning .d20-svg {
  animation: d20-settle 0.36s var(--spring);
}

@keyframes d20-settle {
  0% {
    transform: rotate(-28deg) scale(0.86);
  }
  100% {
    transform: rotate(0deg) scale(1);
  }
}

.d20-val {
  position: absolute;
  font-family: var(--num);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--x-ink);
  pointer-events: none;
}

.d20-val.is-idle {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  color: var(--x-ink-3);
}

.d20-val.is-nat20 {
  color: var(--x-ok);
}

.d20-val.is-nat1 {
  color: var(--x-fail);
}

.d20-sub {
  margin-top: 6px;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.die-chip {
  height: 20px;
  padding: 0 7px;
  border-radius: var(--r-sm);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.die-chip.is-kept {
  background-color: rgba(95, 211, 141, 0.14);
  border: 1px solid rgba(95, 211, 141, 0.35);
  color: var(--x-ok);
}

.die-chip.is-drop {
  background-color: var(--x-ctl);
  border: 1px dashed var(--x-axis);
  color: var(--x-ink-3);
  text-decoration: line-through;
}

/* Interactive Vernier Scale Track */
/* Flat read-only d20 range: no ticks, no handles (readout grammar) */
.range {
  position: relative;
  height: 64px;
  padding: 24px 6px 0;
}

.range-track {
  position: relative;
  height: 8px;
  margin: 0 4px;
  border-radius: 4px;
  background-color: var(--trk);
}

.range-mark {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 16px;
  margin-left: -1px;
  border-radius: 1px;
  background-color: var(--data);
  transition: left 0.3s var(--ease);
}

.range-mark-lbl {
  position: absolute;
  bottom: 100%;
  left: 50%;
  margin-bottom: 3px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--data);
  white-space: nowrap;
}

.range-dot {
  position: absolute;
  top: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid var(--tile);
  background-color: var(--green);
  transition: left 0.35s var(--spring);
}

.range-dot[hidden] {
  display: none;
}

.range-dot-lbl {
  position: absolute;
  top: 100%;
  left: 50%;
  margin-top: 4px;
  transform: translateX(-50%);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--green);
  white-space: nowrap;
}

.range-ends {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-4);
}

/* Reference Matrix Active DEX Highlight */

.dex-table td {
  font-family: var(--mono);
  font-size: 12.5px;
}

.dex-table td.is-active-dex {
  background-color: var(--data-tint);
  color: var(--data);
  font-weight: 700;
}

.dex-table td:nth-child(2) {
  border-right: 1px solid var(--div);
}
