/* Amber Loom & DNA Sequencer Upgrades — owned exclusively by loom-builder */

/* ==========================================================================
   1. Four-Ring Rotating Amber Helix Dial
   ========================================================================== */
.helix-svg-wrap {
  width: min(410px, 100%);
  aspect-ratio: 1 / 1;
  position: relative;
}

.helix-ring-group,
.helix-calib-ring,
.helix-core-pulse {
  transform-origin: 240px 240px;
}

.helix-ring-track {
  transition: stroke 0.28s ease, stroke-width 0.28s ease, filter 0.28s ease;
}

.helix-ring-track.is-focused {
  stroke-width: 21px;
  filter: drop-shadow(0 0 8px rgba(255, 210, 117, 0.35));
}

.helix-ring-track-4.is-focused {
  stroke: rgba(255, 168, 92, 0.45);
  filter: drop-shadow(0 0 10px rgba(255, 158, 125, 0.42));
}

.helix-ring-track-1.is-focused {
  stroke: rgba(244, 239, 226, 0.38);
}

.helix-ring-track-2.is-focused {
  stroke: rgba(58, 216, 230, 0.42);
}

.helix-ring-track-3.is-focused {
  stroke: rgba(229, 159, 58, 0.46);
}

.helix-node.is-selected circle.node-hit {
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.65));
}

.helix-ring-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  width: 100%;
}

.helix-legend-pill {
  min-height: 44px;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--bone-muted);
  background: rgba(244, 239, 226, 0.06);
  border: 1px solid rgba(244, 239, 226, 0.16);
  cursor: pointer;
  transition: all 0.2s ease;
}

.helix-legend-pill.is-active {
  color: var(--amber-bright);
  background: rgba(229, 159, 58, 0.2);
  border-color: var(--amber-gold);
}

/* ==========================================================================
   2. Incubating vs Undiscovered Status & Battle Modifier Pills
   ========================================================================== */
.badge-incubating {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #D7FFF6;
  background: linear-gradient(135deg, rgba(24, 132, 136, 0.78), rgba(45, 168, 120, 0.78));
  border: 1px solid rgba(94, 234, 212, 0.75);
  box-shadow: 0 0 10px rgba(58, 216, 230, 0.28);
}

.loom-outcome-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
}

.loom-mod-pills-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.loom-mod-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.25;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: rgba(244, 239, 226, 0.08);
  border: 1px solid rgba(244, 239, 226, 0.22);
  color: var(--bone);
}

.loom-mod-pill.loom-mod-marking {
  background: rgba(58, 216, 230, 0.12);
  border-color: rgba(58, 216, 230, 0.42);
  color: #BFF8FF;
}

.loom-mod-pill.loom-mod-splice {
  background: rgba(229, 159, 58, 0.16);
  border-color: rgba(255, 210, 117, 0.45);
  color: var(--amber-bright);
}

.loom-mod-pill.loom-mod-splice.is-baseline {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.34);
  color: #CBD5E1;
}

.loom-mod-pill.loom-mod-adapt {
  background: color-mix(in srgb, var(--mod-accent, #E59F3A) 18%, rgba(12, 30, 36, 0.85));
  border-color: var(--mod-accent, #E59F3A);
  color: #FFF3DA;
}

.loom-mod-pill.loom-mod-init {
  background: rgba(91, 185, 107, 0.14);
  border-color: rgba(140, 224, 112, 0.44);
  color: #C4F9B3;
  font-family: var(--font-mono);
}

.loom-preview-modifiers {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 10px;
  border-radius: 12px;
  background: rgba(8, 22, 26, 0.72);
  border: 1px solid rgba(244, 239, 226, 0.16);
}

.loom-preview-mod-line {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 0.73rem;
  line-height: 1.35;
  color: var(--bone);
}

.loom-preview-mod-tag {
  flex-shrink: 0;
  min-width: 74px;
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--oxidized-cyan);
  padding-top: 2px;
}

/* ==========================================================================
   3. DNA Helix Pulse Sequencer Mini-Game (6-Rung Optical Lens & Streak Gauge)
   ========================================================================== */
.pulse-hud-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(12, 34, 42, 0.92), rgba(18, 46, 52, 0.88));
  border: 1.5px solid rgba(58, 216, 230, 0.35);
  margin-top: 10px;
}

.pulse-streak-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pulse-tier-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.pulse-tier-chip {
  padding: 5px 8px;
  border-radius: 10px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 900;
  color: var(--bone-muted);
  background: rgba(244, 239, 226, 0.06);
  border: 1px solid rgba(244, 239, 226, 0.14);
  transition: all 0.22s ease;
}

.pulse-tier-chip.is-reached {
  color: var(--bone);
  background: rgba(58, 216, 230, 0.16);
  border-color: rgba(58, 216, 230, 0.45);
}

.pulse-tier-chip.is-current {
  color: #161004;
  background: linear-gradient(135deg, #FFE08A, #E59F3A);
  border-color: #FFF4CC;
  box-shadow: 0 0 14px rgba(255, 210, 117, 0.45);
}

.pulse-tier-chip.is-flawless.is-current {
  background: linear-gradient(135deg, #5EEAD4, #FFD275);
  border-color: #FFFFFF;
  box-shadow: 0 0 18px rgba(94, 234, 212, 0.6);
}

.harmonic-pulse-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: rgba(6, 16, 20, 0.85);
  border: 1px solid rgba(244, 239, 226, 0.18);
  overflow: hidden;
}

.harmonic-pulse-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #3AD8E6 0%, #5EEAD4 48%, #FFD275 100%);
  transition: width 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}

.harmonic-pulse-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  animation: pulseWaveSweep 1.8s linear infinite;
}

@keyframes pulseWaveSweep {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

.sequencer-optical-stage {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.sequencer-rung-row.is-active-lens {
  border-color: var(--amber-bright);
  background: radial-gradient(circle at 50% 50%, rgba(229, 159, 58, 0.2), rgba(14, 34, 42, 0.96));
  box-shadow: 0 0 20px rgba(255, 210, 117, 0.32), inset 0 0 14px rgba(58, 216, 230, 0.14);
  transform: scale(1.01);
}

.sequencer-rung-row.is-queued {
  opacity: 0.56;
}

.sequencer-rung-row.is-mismatch-shake {
  border-color: #FF6B5B;
  background: rgba(120, 24, 24, 0.45);
  animation: sequencerShake 0.34s ease-in-out;
}

.sequencer-rung-row.is-snap-flash {
  animation: sequencerSnapFlash 0.35s ease-out;
}

@keyframes sequencerShake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-7px); }
  45% { transform: translateX(7px); }
  70% { transform: translateX(-4px); }
  88% { transform: translateX(4px); }
}

@keyframes sequencerSnapFlash {
  0% { box-shadow: 0 0 0 rgba(58, 216, 230, 0); }
  45% { box-shadow: 0 0 22px rgba(94, 234, 212, 0.8); }
  100% { box-shadow: 0 0 0 rgba(58, 216, 230, 0); }
}

.lens-complement-slot {
  min-width: 72px;
  height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.08rem;
  font-weight: 900;
  border: 1.5px dashed rgba(255, 210, 117, 0.55);
  color: var(--amber-bright);
  background: rgba(10, 24, 30, 0.85);
}

.lens-complement-slot.is-locked {
  border-style: solid;
  border-color: var(--oxidized-cyan);
  background: rgba(58, 216, 230, 0.24);
  color: #FFFFFF;
  box-shadow: 0 0 12px rgba(58, 216, 230, 0.35);
}

.lens-complement-slot.is-standby {
  border-color: rgba(244, 239, 226, 0.18);
  color: var(--bone-muted);
}

.pulse-keypad-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.pulse-key-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 66px;
  padding: 8px 6px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(26, 62, 70, 0.92), rgba(14, 36, 42, 0.96));
  border: 1.5px solid rgba(58, 216, 230, 0.42);
  color: var(--bone);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.pulse-key-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--amber-bright);
  box-shadow: 0 4px 14px rgba(255, 210, 117, 0.24);
}

.pulse-key-btn:active:not(:disabled) {
  transform: translateY(1px) scale(0.98);
}

.pulse-key-btn:disabled {
  opacity: 0.48;
  cursor: default;
}

.pulse-key-letter {
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--amber-bright);
  line-height: 1;
}

.pulse-key-name {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--bone-muted);
}

.pulse-key-kbd {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(244, 239, 226, 0.1);
  border: 1px solid rgba(244, 239, 226, 0.2);
  color: var(--oxidized-cyan);
}

.sequencer-quick-extract-btn {
  opacity: 0.86;
  border-color: rgba(244, 239, 226, 0.28);
  color: var(--bone-muted);
}

.sequencer-quick-extract-btn:hover {
  opacity: 1;
  color: var(--bone);
}

html[data-reduce-motion="true"] .harmonic-pulse-fill::after,
html[data-reduce-motion="true"] .sequencer-rung-row.is-mismatch-shake,
html[data-reduce-motion="true"] .sequencer-rung-row.is-snap-flash {
  animation: none !important;
}

@media (max-width: 560px) {
  .pulse-tier-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pulse-keypad-deck {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
