.cycle-game {
  display: grid;
  gap: 12px;
}

.cycle-brief {
  min-height: 44px;
  border: 1px solid #cfd8e5;
  border-radius: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  color: #344054;
  font-size: 14px;
  line-height: 1.45;
}

.cycle-readouts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.cycle-readout,
.cycle-mini-read {
  min-width: 0;
  border: 1px solid #d5dde8;
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
  box-shadow: inset 0 -1px 0 rgba(15, 23, 42, 0.05);
}

.cycle-readout span,
.cycle-mini-read span {
  display: block;
  color: #667085;
  font-size: 12px;
  line-height: 1.2;
}

.cycle-readout strong,
.cycle-mini-read strong {
  display: block;
  overflow-wrap: anywhere;
  margin-top: 3px;
  color: #17202a;
  font-size: 14px;
  line-height: 1.25;
}

.cycle-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 12px;
  align-items: stretch;
}

.cycle-map {
  position: relative;
  min-height: 268px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(241, 245, 249, 0.96)),
    repeating-linear-gradient(0deg, rgba(15, 23, 42, 0.035) 0, rgba(15, 23, 42, 0.035) 1px, transparent 1px, transparent 18px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.88), 0 10px 24px rgba(15, 23, 42, 0.08);
}

.cycle-arrows,
.cycle-node-layer,
.cycle-pointer-layer {
  position: absolute;
  inset: 0;
}

.cycle-arrows {
  width: 100%;
  height: 100%;
}

.cycle-node-layer {
  z-index: 2;
}

.cycle-pointer-layer {
  z-index: 3;
  pointer-events: none;
}

.cycle-arrow {
  fill: none;
  stroke: #7c8da3;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cycle-arrow-loop {
  stroke-dasharray: 5 4;
}

.cycle-arrow-active {
  stroke: #0f766e;
  stroke-width: 3.1;
  filter: drop-shadow(0 2px 3px rgba(15, 118, 110, 0.22));
}

.cycle-arrow-head {
  fill: #7c8da3;
}

.cycle-arrow-head-active {
  fill: #0f766e;
}

.cycle-node {
  position: absolute;
  left: var(--cycle-x);
  top: var(--cycle-y);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  align-content: center;
  width: 58px;
  min-width: 58px;
  height: 58px;
  min-height: 58px;
  border: 2px solid #94a3b8;
  border-radius: 999px;
  padding: 3px;
  background: linear-gradient(180deg, #ffffff, #e8eef5);
  color: #17202a;
  cursor: pointer;
  touch-action: manipulation;
  box-shadow: 0 8px 16px rgba(15, 23, 42, 0.12), inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

.cycle-node:focus-visible,
.cycle-advance:focus-visible,
.cycle-btn:focus-visible {
  outline: 3px solid rgba(15, 118, 110, 0.32);
  outline-offset: 2px;
}

.cycle-node-value {
  display: block;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
}

.cycle-node-caption,
.cycle-node-next {
  display: block;
  margin-top: 2px;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
}

.cycle-node-entry {
  border-color: #0f766e;
  background: linear-gradient(180deg, #f0fdfa, #ccfbf1);
}

.cycle-node-active {
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.18), 0 10px 18px rgba(15, 23, 42, 0.12);
}

.cycle-node-target {
  border-color: #b7791f;
  background: linear-gradient(180deg, #fffaf0, #fdecc8);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.22), 0 10px 18px rgba(146, 64, 14, 0.12);
}

.cycle-node-meet {
  border-color: #2563eb;
  background: linear-gradient(180deg, #eff6ff, #dbeafe);
}

.cycle-node-done {
  border-color: #147d4f;
  background: linear-gradient(180deg, #ecfdf3, #bbf7d0);
  box-shadow: 0 0 0 4px rgba(20, 125, 79, 0.2), 0 10px 18px rgba(20, 125, 79, 0.14);
}

.cycle-node-wrong {
  border-color: #b42318;
  background: #fff1f0;
  transform: translate(-50%, -50%) scale(0.96);
}

.cycle-pointer {
  position: absolute;
  display: grid;
  place-items: center;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  transform: translate(calc(-50% + var(--cycle-dx)), calc(-50% + var(--cycle-dy)));
  box-shadow: 0 7px 14px rgba(15, 23, 42, 0.18);
}

.cycle-pointer-slow {
  background: #0f766e;
}

.cycle-pointer-fast {
  background: #2563eb;
}

.cycle-pointer-meet {
  background: #7c3aed;
}

.cycle-pointer-reset {
  background: #b7791f;
}

.cycle-console {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.cycle-step-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.42fr);
  gap: 8px;
}

.cycle-advance,
.cycle-btn {
  min-height: 48px;
  border: 1px solid #b8c4d4;
  border-radius: 8px;
  padding: 10px 12px;
  background: #ffffff;
  color: #17202a;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
}

.cycle-advance {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  justify-content: center;
  border-color: #0f766e;
  background: linear-gradient(180deg, #0f766e, #0b5d56);
  color: #ffffff;
  box-shadow: 0 8px 16px rgba(15, 118, 110, 0.22);
}

.cycle-advance-icon {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.cycle-advance:disabled,
.cycle-btn:disabled {
  cursor: default;
  opacity: 0.58;
  box-shadow: none;
}

.cycle-control-wrong {
  border-color: #b42318;
  background: linear-gradient(180deg, #b42318, #8a1f16);
}

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

.cycle-trace-step {
  min-width: 0;
  min-height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid #d6deea;
  border-radius: 8px;
  padding: 6px 4px;
  background: #ffffff;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.cycle-trace-active {
  border-color: #b7791f;
  background: #fff7ed;
  color: #92400e;
}

.cycle-trace-done {
  border-color: #0f766e;
  background: #d7f4ef;
  color: #0f514b;
}

.cycle-status {
  min-height: 72px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  padding: 11px 12px;
  background: #ffffff;
  color: #344054;
  font-size: 14px;
  line-height: 1.45;
}

.cycle-status-good {
  border-color: #0f766e;
  background: #d7f4ef;
  color: #0f514b;
}

.cycle-status-warn {
  border-color: #b45309;
  background: #fff7ed;
  color: #8a3b07;
}

.cycle-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cycle-btn-primary {
  border-color: #0f766e;
  background: #0f766e;
  color: #ffffff;
}

@media (max-width: 760px) {
  .cycle-readouts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cycle-workbench {
    grid-template-columns: 1fr;
  }

  .cycle-map {
    min-height: 238px;
  }

  .cycle-status {
    min-height: 64px;
  }
}

@media (max-width: 390px) {
  .cycle-brief,
  .cycle-status {
    font-size: 13px;
  }

  .cycle-map {
    min-height: 220px;
  }

  .cycle-node {
    width: 52px;
    min-width: 52px;
    height: 52px;
    min-height: 52px;
  }

  .cycle-node-value {
    font-size: 17px;
  }

  .cycle-step-panel {
    grid-template-columns: 1fr;
  }

  .cycle-trace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
